Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solana/transaction-messages

Package Overview
Dependencies
Maintainers
15
Versions
728
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/transaction-messages - npm Package Compare versions

Comparing version 2.0.0-preview.1.20240408101831.4c6dbbcef41ae3f2a185994915ce187b71a174fd to 2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890

dist/types/codecs/address-table-lookup.d.ts

59

dist/index.browser.js
import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { assertIsBlockhash } from '@solana/rpc-types';
import { getAddressComparator } from '@solana/addresses';
import { getAddressEncoder, getAddressDecoder, getAddressComparator } from '@solana/addresses';
import { combineCodec } from '@solana/codecs-core';
import { getStructEncoder, getArrayEncoder, getStructDecoder, getArrayDecoder } from '@solana/codecs-data-structures';
import { getU8Encoder, getShortU16Encoder, getU8Decoder, getShortU16Decoder } from '@solana/codecs-numbers';
import { AccountRole, isSignerRole, isWritableRole, mergeRoles } from '@solana/instructions';

@@ -34,2 +37,33 @@

}
var memoizedAddressTableLookupEncoder;
function getAddressTableLookupEncoder() {
if (!memoizedAddressTableLookupEncoder) {
memoizedAddressTableLookupEncoder = getStructEncoder([
["lookupTableAddress", getAddressEncoder()],
[
"writableIndices",
getArrayEncoder(getU8Encoder(), { size: getShortU16Encoder() })
],
[
"readableIndices",
getArrayEncoder(getU8Encoder(), { size: getShortU16Encoder() })
]
]);
}
return memoizedAddressTableLookupEncoder;
}
var memoizedAddressTableLookupDecoder;
function getAddressTableLookupDecoder() {
if (!memoizedAddressTableLookupDecoder) {
memoizedAddressTableLookupDecoder = getStructDecoder([
["lookupTableAddress", getAddressDecoder()],
["writableIndices", getArrayDecoder(getU8Decoder(), { size: getShortU16Decoder() })],
["readableIndices", getArrayDecoder(getU8Decoder(), { size: getShortU16Decoder() })]
]);
}
return memoizedAddressTableLookupDecoder;
}
function getAddressTableLookupCodec() {
return combineCodec(getAddressTableLookupEncoder(), getAddressTableLookupDecoder());
}
var AddressMapEntryType = /* @__PURE__ */ ((AddressMapEntryType2) => {

@@ -215,2 +249,23 @@ AddressMapEntryType2[AddressMapEntryType2["FEE_PAYER"] = 0] = "FEE_PAYER";

}
function getCompiledAddressTableLookups(orderedAccounts) {
const index = {};
for (const account of orderedAccounts) {
if (!("lookupTableAddress" in account)) {
continue;
}
const entry = index[account.lookupTableAddress] ||= {
readableIndices: [],
writableIndices: []
};
if (account.role === AccountRole.WRITABLE) {
entry.writableIndices.push(account.addressIndex);
} else {
entry.readableIndices.push(account.addressIndex);
}
}
return Object.keys(index).sort(getAddressComparator()).map((lookupTableAddress) => ({
lookupTableAddress,
...index[lookupTableAddress]
}));
}

@@ -340,4 +395,4 @@ // src/create-transaction-message.ts

export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.browser.js.map
import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { assertIsBlockhash } from '@solana/rpc-types';
import { getAddressComparator } from '@solana/addresses';
import { getAddressEncoder, getAddressDecoder, getAddressComparator } from '@solana/addresses';
import { combineCodec } from '@solana/codecs-core';
import { getStructEncoder, getArrayEncoder, getStructDecoder, getArrayDecoder } from '@solana/codecs-data-structures';
import { getU8Encoder, getShortU16Encoder, getU8Decoder, getShortU16Decoder } from '@solana/codecs-numbers';
import { AccountRole, isSignerRole, isWritableRole, mergeRoles } from '@solana/instructions';

@@ -34,2 +37,33 @@

}
var memoizedAddressTableLookupEncoder;
function getAddressTableLookupEncoder() {
if (!memoizedAddressTableLookupEncoder) {
memoizedAddressTableLookupEncoder = getStructEncoder([
["lookupTableAddress", getAddressEncoder()],
[
"writableIndices",
getArrayEncoder(getU8Encoder(), { size: getShortU16Encoder() })
],
[
"readableIndices",
getArrayEncoder(getU8Encoder(), { size: getShortU16Encoder() })
]
]);
}
return memoizedAddressTableLookupEncoder;
}
var memoizedAddressTableLookupDecoder;
function getAddressTableLookupDecoder() {
if (!memoizedAddressTableLookupDecoder) {
memoizedAddressTableLookupDecoder = getStructDecoder([
["lookupTableAddress", getAddressDecoder()],
["writableIndices", getArrayDecoder(getU8Decoder(), { size: getShortU16Decoder() })],
["readableIndices", getArrayDecoder(getU8Decoder(), { size: getShortU16Decoder() })]
]);
}
return memoizedAddressTableLookupDecoder;
}
function getAddressTableLookupCodec() {
return combineCodec(getAddressTableLookupEncoder(), getAddressTableLookupDecoder());
}
var AddressMapEntryType = /* @__PURE__ */ ((AddressMapEntryType2) => {

@@ -215,2 +249,23 @@ AddressMapEntryType2[AddressMapEntryType2["FEE_PAYER"] = 0] = "FEE_PAYER";

}
function getCompiledAddressTableLookups(orderedAccounts) {
const index = {};
for (const account of orderedAccounts) {
if (!("lookupTableAddress" in account)) {
continue;
}
const entry = index[account.lookupTableAddress] ||= {
readableIndices: [],
writableIndices: []
};
if (account.role === AccountRole.WRITABLE) {
entry.writableIndices.push(account.addressIndex);
} else {
entry.readableIndices.push(account.addressIndex);
}
}
return Object.keys(index).sort(getAddressComparator()).map((lookupTableAddress) => ({
lookupTableAddress,
...index[lookupTableAddress]
}));
}

@@ -340,4 +395,4 @@ // src/create-transaction-message.ts

export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.native.js.map
import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { assertIsBlockhash } from '@solana/rpc-types';
import { getAddressComparator } from '@solana/addresses';
import { getAddressEncoder, getAddressDecoder, getAddressComparator } from '@solana/addresses';
import { combineCodec } from '@solana/codecs-core';
import { getStructEncoder, getArrayEncoder, getStructDecoder, getArrayDecoder } from '@solana/codecs-data-structures';
import { getU8Encoder, getShortU16Encoder, getU8Decoder, getShortU16Decoder } from '@solana/codecs-numbers';
import { AccountRole, isSignerRole, isWritableRole, mergeRoles } from '@solana/instructions';

@@ -34,2 +37,33 @@

}
var memoizedAddressTableLookupEncoder;
function getAddressTableLookupEncoder() {
if (!memoizedAddressTableLookupEncoder) {
memoizedAddressTableLookupEncoder = getStructEncoder([
["lookupTableAddress", getAddressEncoder()],
[
"writableIndices",
getArrayEncoder(getU8Encoder(), { size: getShortU16Encoder() })
],
[
"readableIndices",
getArrayEncoder(getU8Encoder(), { size: getShortU16Encoder() })
]
]);
}
return memoizedAddressTableLookupEncoder;
}
var memoizedAddressTableLookupDecoder;
function getAddressTableLookupDecoder() {
if (!memoizedAddressTableLookupDecoder) {
memoizedAddressTableLookupDecoder = getStructDecoder([
["lookupTableAddress", getAddressDecoder()],
["writableIndices", getArrayDecoder(getU8Decoder(), { size: getShortU16Decoder() })],
["readableIndices", getArrayDecoder(getU8Decoder(), { size: getShortU16Decoder() })]
]);
}
return memoizedAddressTableLookupDecoder;
}
function getAddressTableLookupCodec() {
return combineCodec(getAddressTableLookupEncoder(), getAddressTableLookupDecoder());
}
var AddressMapEntryType = /* @__PURE__ */ ((AddressMapEntryType2) => {

@@ -215,2 +249,23 @@ AddressMapEntryType2[AddressMapEntryType2["FEE_PAYER"] = 0] = "FEE_PAYER";

}
function getCompiledAddressTableLookups(orderedAccounts) {
const index = {};
for (const account of orderedAccounts) {
if (!("lookupTableAddress" in account)) {
continue;
}
const entry = index[account.lookupTableAddress] ||= {
readableIndices: [],
writableIndices: []
};
if (account.role === AccountRole.WRITABLE) {
entry.writableIndices.push(account.addressIndex);
} else {
entry.readableIndices.push(account.addressIndex);
}
}
return Object.keys(index).sort(getAddressComparator()).map((lookupTableAddress) => ({
lookupTableAddress,
...index[lookupTableAddress]
}));
}

@@ -340,4 +395,4 @@ // src/create-transaction-message.ts

export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.node.js.map
export * from './accounts.js';
export * from './address-table-lookups.js';
//# sourceMappingURL=index.d.ts.map
export * from './blockhash.js';
export * from './codecs/index.js';
export * from './compile/index.js';

@@ -3,0 +4,0 @@ export * from './create-transaction-message.js';

13

package.json
{
"name": "@solana/transaction-messages",
"version": "2.0.0-preview.1.20240408101831.4c6dbbcef41ae3f2a185994915ce187b71a174fd",
"version": "2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890",
"description": "Helpers for creating transaction messages",

@@ -49,6 +49,9 @@ "exports": {

"dependencies": {
"@solana/addresses": "2.0.0-preview.1.20240408101831.4c6dbbcef41ae3f2a185994915ce187b71a174fd",
"@solana/errors": "2.0.0-preview.1.20240408101831.4c6dbbcef41ae3f2a185994915ce187b71a174fd",
"@solana/instructions": "2.0.0-preview.1.20240408101831.4c6dbbcef41ae3f2a185994915ce187b71a174fd",
"@solana/rpc-types": "2.0.0-preview.1.20240408101831.4c6dbbcef41ae3f2a185994915ce187b71a174fd"
"@solana/addresses": "2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890",
"@solana/codecs-core": "2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890",
"@solana/codecs-data-structures": "2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890",
"@solana/codecs-numbers": "2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890",
"@solana/errors": "2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890",
"@solana/instructions": "2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890",
"@solana/rpc-types": "2.0.0-preview.1.20240408102000.ab044e4b4f8458f4c1d833ef9dd87900017be890"
},

@@ -55,0 +58,0 @@ "bundlewatch": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc