@solana/transaction-messages
Advanced tools
Comparing version 2.1.0-canary-20241210160712 to 2.1.0-canary-20241211084257
{ | ||
"name": "@solana/transaction-messages", | ||
"version": "2.1.0-canary-20241210160712", | ||
"version": "2.1.0-canary-20241211084257", | ||
"description": "Helpers for creating transaction messages", | ||
@@ -57,10 +57,10 @@ "exports": { | ||
"dependencies": { | ||
"@solana/addresses": "2.1.0-canary-20241210160712", | ||
"@solana/codecs-core": "2.1.0-canary-20241210160712", | ||
"@solana/codecs-numbers": "2.1.0-canary-20241210160712", | ||
"@solana/codecs-data-structures": "2.1.0-canary-20241210160712", | ||
"@solana/errors": "2.1.0-canary-20241210160712", | ||
"@solana/functional": "2.1.0-canary-20241210160712", | ||
"@solana/instructions": "2.1.0-canary-20241210160712", | ||
"@solana/rpc-types": "2.1.0-canary-20241210160712" | ||
"@solana/addresses": "2.1.0-canary-20241211084257", | ||
"@solana/codecs-numbers": "2.1.0-canary-20241211084257", | ||
"@solana/codecs-data-structures": "2.1.0-canary-20241211084257", | ||
"@solana/codecs-core": "2.1.0-canary-20241211084257", | ||
"@solana/errors": "2.1.0-canary-20241211084257", | ||
"@solana/functional": "2.1.0-canary-20241211084257", | ||
"@solana/rpc-types": "2.1.0-canary-20241211084257", | ||
"@solana/instructions": "2.1.0-canary-20241211084257" | ||
}, | ||
@@ -67,0 +67,0 @@ "peerDependencies": { |
@@ -224,1 +224,33 @@ [![npm][npm-image]][npm-url] | ||
See [`appendTransactionMessageInstruction()`](#appendtransactioninstruction) for an example of how to use this function. | ||
## Compress transaction message using lookup tables | ||
### Types | ||
#### `AddressesByLookupTableAddress` | ||
This type represents a mapping of lookup table addresses to the addresses of the accounts that are stored in them. | ||
### Functions | ||
#### `compressTransactionMessageUsingAddressLookupTables` | ||
Given a transaction message and a mapping of lookup tables to the addresses stored in them, this function will return a new transaction message with the same instructions but with all non-signer accounts that are found in the given lookup tables represented by an `IAccountLookupMeta` instead of an `IAccountMeta`. | ||
This means that these accounts will take up less space in the compiled transaction message. This size reduction is most significant when the transaction includes many accounts from the same lookup table. | ||
```ts | ||
import { address } from '@solana/addresses'; | ||
import { compressTransactionMessageUsingAddressLookupTables } from '@solana/transaction-messages'; | ||
const lookupTableAddress = address('4QwSwNriKPrz8DLW4ju5uxC2TN5cksJx6tPUPj7DGLAW'); | ||
const accountAddress = address('5n2ADjHPsqB4EVUNEX48xRqtnmuLu5XSHDwkJRR98qpM'); | ||
const lookupTableAddresses: AddressesByLookupTableAddress = { | ||
[lookupTableAddress]: [accountAddress], | ||
}; | ||
const compressedTransactionMessage = compressTransactionMessageUsingAddressLookupTables( | ||
transactionMessage, | ||
lookupTableAddresses, | ||
); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
737363
256
+ Added@solana/addresses@2.1.0-canary-20241211084257(transitive)
+ Added@solana/assertions@2.1.0-canary-20241211084257(transitive)
+ Added@solana/codecs-core@2.1.0-canary-20241211084257(transitive)
+ Added@solana/codecs-data-structures@2.1.0-canary-20241211084257(transitive)
+ Added@solana/codecs-numbers@2.1.0-canary-20241211084257(transitive)
+ Added@solana/codecs-strings@2.1.0-canary-20241211084257(transitive)
+ Added@solana/errors@2.1.0-canary-20241211084257(transitive)
+ Added@solana/functional@2.1.0-canary-20241211084257(transitive)
+ Added@solana/instructions@2.1.0-canary-20241211084257(transitive)
+ Added@solana/rpc-types@2.1.0-canary-20241211084257(transitive)
- Removed@solana/addresses@2.1.0-canary-20241210160712(transitive)
- Removed@solana/assertions@2.1.0-canary-20241210160712(transitive)
- Removed@solana/codecs-core@2.1.0-canary-20241210160712(transitive)
- Removed@solana/codecs-data-structures@2.1.0-canary-20241210160712(transitive)
- Removed@solana/codecs-numbers@2.1.0-canary-20241210160712(transitive)
- Removed@solana/codecs-strings@2.1.0-canary-20241210160712(transitive)
- Removed@solana/errors@2.1.0-canary-20241210160712(transitive)
- Removed@solana/functional@2.1.0-canary-20241210160712(transitive)
- Removed@solana/instructions@2.1.0-canary-20241210160712(transitive)
- Removed@solana/rpc-types@2.1.0-canary-20241210160712(transitive)
Updated@solana/codecs-data-structures@2.1.0-canary-20241211084257