@solana/kit 2.1.1 → 2.1.2-canary-20250514101103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -158,6 +158,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
158
158
  var SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH = 5663017;
159
159
  var SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT = 5663018;
160
160
  var SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT = 5663019;
161
+ var SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT = 5663020;
161
162
  var SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN = 705e4;
162
163
  var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE = 7050001;
163
164
  var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE = 7050002;
@@ -441,6 +442,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
441
442
  [SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION]: "Attempted to sign a transaction with an address that is not a signer for it",
442
443
  [SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING]: "Transaction is missing an address at index: $index.",
443
444
  [SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES]: "Transaction has no expected signers therefore it cannot be encoded",
445
+ [SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT]: "Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes",
444
446
  [SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME]: "Transaction does not have a blockhash lifetime",
445
447
  [SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME]: "Transaction is not a durable nonce transaction",
446
448
  [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING]: "Contents of these address lookup tables unknown: $lookupTableAddresses",
@@ -4248,7 +4250,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
4248
4250
  ...config.headers ? normalizeHeaders2(config.headers) : void 0,
4249
4251
  ...{
4250
4252
  // Keep these headers lowercase so they will override any user-supplied headers above.
4251
- "solana-client": `js/${"2.1.1"}`
4253
+ "solana-client": `js/${"2.1.2-canary-20250514101103"}`
4252
4254
  }
4253
4255
  }
4254
4256
  }),
@@ -6685,6 +6687,39 @@ this.globalThis.solanaWeb3 = (function (exports) {
6685
6687
  const wireTransactionBytes = getTransactionEncoder().encode(transaction);
6686
6688
  return getBase64Decoder().decode(wireTransactionBytes);
6687
6689
  }
6690
+ var TRANSACTION_PACKET_SIZE = 1280;
6691
+ var TRANSACTION_PACKET_HEADER = 40 + 8;
6692
+ var TRANSACTION_SIZE_LIMIT = TRANSACTION_PACKET_SIZE - TRANSACTION_PACKET_HEADER;
6693
+ function getTransactionSize(transaction) {
6694
+ return getTransactionEncoder().getSizeFromValue(transaction);
6695
+ }
6696
+ function isTransactionWithinSizeLimit(transaction) {
6697
+ return getTransactionSize(transaction) <= TRANSACTION_SIZE_LIMIT;
6698
+ }
6699
+ function assertIsTransactionWithinSizeLimit(transaction) {
6700
+ const transactionSize = getTransactionSize(transaction);
6701
+ if (transactionSize > TRANSACTION_SIZE_LIMIT) {
6702
+ throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT, {
6703
+ transactionSize,
6704
+ transactionSizeLimit: TRANSACTION_SIZE_LIMIT
6705
+ });
6706
+ }
6707
+ }
6708
+ function getTransactionMessageSize(transactionMessage) {
6709
+ return getTransactionSize(compileTransaction(transactionMessage));
6710
+ }
6711
+ function isTransactionMessageWithinSizeLimit(transactionMessage) {
6712
+ return getTransactionMessageSize(transactionMessage) <= TRANSACTION_SIZE_LIMIT;
6713
+ }
6714
+ function assertIsTransactionMessageWithinSizeLimit(transactionMessage) {
6715
+ const transactionSize = getTransactionMessageSize(transactionMessage);
6716
+ if (transactionSize > TRANSACTION_SIZE_LIMIT) {
6717
+ throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT, {
6718
+ transactionSize,
6719
+ transactionSizeLimit: TRANSACTION_SIZE_LIMIT
6720
+ });
6721
+ }
6722
+ }
6688
6723
 
6689
6724
  // ../signers/dist/index.browser.mjs
6690
6725
  function deduplicateSigners(signers) {
@@ -7798,6 +7833,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
7798
7833
  exports.SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION = SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION;
7799
7834
  exports.SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING = SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING;
7800
7835
  exports.SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES = SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES;
7836
+ exports.SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT = SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT;
7801
7837
  exports.SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME = SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME;
7802
7838
  exports.SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME = SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME;
7803
7839
  exports.SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING = SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING;
@@ -7816,6 +7852,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
7816
7852
  exports.SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING = SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING;
7817
7853
  exports.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE = SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE;
7818
7854
  exports.SolanaError = SolanaError;
7855
+ exports.TRANSACTION_PACKET_HEADER = TRANSACTION_PACKET_HEADER;
7856
+ exports.TRANSACTION_PACKET_SIZE = TRANSACTION_PACKET_SIZE;
7857
+ exports.TRANSACTION_SIZE_LIMIT = TRANSACTION_SIZE_LIMIT;
7819
7858
  exports.addCodecSentinel = addCodecSentinel;
7820
7859
  exports.addCodecSizePrefix = addCodecSizePrefix;
7821
7860
  exports.addDecoderSentinel = addDecoderSentinel;
@@ -7853,10 +7892,12 @@ this.globalThis.solanaWeb3 = (function (exports) {
7853
7892
  exports.assertIsStringifiedNumber = assertIsStringifiedNumber;
7854
7893
  exports.assertIsTransactionMessageWithBlockhashLifetime = assertIsTransactionMessageWithBlockhashLifetime;
7855
7894
  exports.assertIsTransactionMessageWithSingleSendingSigner = assertIsTransactionMessageWithSingleSendingSigner;
7895
+ exports.assertIsTransactionMessageWithinSizeLimit = assertIsTransactionMessageWithinSizeLimit;
7856
7896
  exports.assertIsTransactionModifyingSigner = assertIsTransactionModifyingSigner;
7857
7897
  exports.assertIsTransactionPartialSigner = assertIsTransactionPartialSigner;
7858
7898
  exports.assertIsTransactionSendingSigner = assertIsTransactionSendingSigner;
7859
7899
  exports.assertIsTransactionSigner = assertIsTransactionSigner;
7900
+ exports.assertIsTransactionWithinSizeLimit = assertIsTransactionWithinSizeLimit;
7860
7901
  exports.assertIsUnixTimestamp = assertIsUnixTimestamp;
7861
7902
  exports.assertIsVariableSize = assertIsVariableSize;
7862
7903
  exports.assertNumberIsBetweenForCodec = assertNumberIsBetweenForCodec;
@@ -8046,6 +8087,8 @@ this.globalThis.solanaWeb3 = (function (exports) {
8046
8087
  exports.getTransactionCodec = getTransactionCodec;
8047
8088
  exports.getTransactionDecoder = getTransactionDecoder;
8048
8089
  exports.getTransactionEncoder = getTransactionEncoder;
8090
+ exports.getTransactionMessageSize = getTransactionMessageSize;
8091
+ exports.getTransactionSize = getTransactionSize;
8049
8092
  exports.getTransactionVersionCodec = getTransactionVersionCodec;
8050
8093
  exports.getTransactionVersionDecoder = getTransactionVersionDecoder;
8051
8094
  exports.getTransactionVersionEncoder = getTransactionVersionEncoder;
@@ -8102,10 +8145,12 @@ this.globalThis.solanaWeb3 = (function (exports) {
8102
8145
  exports.isStringifiedNumber = isStringifiedNumber;
8103
8146
  exports.isTransactionMessageWithBlockhashLifetime = isTransactionMessageWithBlockhashLifetime;
8104
8147
  exports.isTransactionMessageWithSingleSendingSigner = isTransactionMessageWithSingleSendingSigner;
8148
+ exports.isTransactionMessageWithinSizeLimit = isTransactionMessageWithinSizeLimit;
8105
8149
  exports.isTransactionModifyingSigner = isTransactionModifyingSigner;
8106
8150
  exports.isTransactionPartialSigner = isTransactionPartialSigner;
8107
8151
  exports.isTransactionSendingSigner = isTransactionSendingSigner;
8108
8152
  exports.isTransactionSigner = isTransactionSigner;
8153
+ exports.isTransactionWithinSizeLimit = isTransactionWithinSizeLimit;
8109
8154
  exports.isUnixTimestamp = isUnixTimestamp;
8110
8155
  exports.isVariableSize = isVariableSize;
8111
8156
  exports.isWritableRole = isWritableRole;