@solana/kit 4.0.0-canary-20251002191331 → 4.0.0-canary-20251003105839

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.
@@ -164,6 +164,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
164
164
  var SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT = 5663019;
165
165
  var SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT = 5663020;
166
166
  var SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED = 5663021;
167
+ var SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE = 5663022;
167
168
  var SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN = 705e4;
168
169
  var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE = 7050001;
169
170
  var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE = 7050002;
@@ -481,7 +482,8 @@ this.globalThis.solanaWeb3 = (function (exports) {
481
482
  [SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH]: "The transaction message expected the transaction to have $numRequiredSignatures signatures, got $signaturesLength.",
482
483
  [SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING]: "Transaction is missing signatures for addresses: $addresses.",
483
484
  [SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE]: "Transaction version must be in the range [0, 127]. `$actualVersion` given",
484
- [SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED]: "This version of Kit does not support decoding transactions with version $unsupportedVersion. The current max supported version is 0."
485
+ [SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED]: "This version of Kit does not support decoding transactions with version $unsupportedVersion. The current max supported version is 0.",
486
+ [SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE]: "The transaction has a durable nonce lifetime (with nonce `$nonce`), but the nonce account address is in a lookup table. The lifetime constraint cannot be constructed without fetching the lookup tables for the transaction."
485
487
  };
486
488
  var START_INDEX = "i";
487
489
  var TYPE = "t";
@@ -4483,6 +4485,38 @@ this.globalThis.solanaWeb3 = (function (exports) {
4483
4485
  signatures: Object.freeze(signaturesMap)
4484
4486
  };
4485
4487
  }
4488
+ var SYSTEM_PROGRAM_ADDRESS2 = "11111111111111111111111111111111";
4489
+ function compiledInstructionIsAdvanceNonceInstruction(instruction, staticAddresses) {
4490
+ var _a;
4491
+ return staticAddresses[instruction.programAddressIndex] === SYSTEM_PROGRAM_ADDRESS2 && // Test for `AdvanceNonceAccount` instruction data
4492
+ instruction.data != null && isAdvanceNonceAccountInstructionData2(instruction.data) && // Test for exactly 3 accounts
4493
+ ((_a = instruction.accountIndices) == null ? void 0 : _a.length) === 3;
4494
+ }
4495
+ function isAdvanceNonceAccountInstructionData2(data) {
4496
+ return data.byteLength === 4 && data[0] === 4 && data[1] === 0 && data[2] === 0 && data[3] === 0;
4497
+ }
4498
+ async function getTransactionLifetimeConstraintFromCompiledTransactionMessage(compiledTransactionMessage) {
4499
+ const firstInstruction = compiledTransactionMessage.instructions[0];
4500
+ const { staticAccounts } = compiledTransactionMessage;
4501
+ if (firstInstruction && compiledInstructionIsAdvanceNonceInstruction(firstInstruction, staticAccounts)) {
4502
+ const nonceAccountAddress = staticAccounts[firstInstruction.accountIndices[0]];
4503
+ if (!nonceAccountAddress) {
4504
+ throw new SolanaError(SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE, {
4505
+ nonce: compiledTransactionMessage.lifetimeToken
4506
+ });
4507
+ }
4508
+ return {
4509
+ nonce: compiledTransactionMessage.lifetimeToken,
4510
+ nonceAccountAddress
4511
+ };
4512
+ } else {
4513
+ return {
4514
+ blockhash: compiledTransactionMessage.lifetimeToken,
4515
+ // This is not known from the compiled message, so we set it to the maximum possible value
4516
+ lastValidBlockHeight: 0xffffffffffffffffn
4517
+ };
4518
+ }
4519
+ }
4486
4520
  function compileTransaction(transactionMessage) {
4487
4521
  const compiledMessage = compileTransactionMessage(transactionMessage);
4488
4522
  const messageBytes = getCompiledTransactionMessageEncoder().encode(compiledMessage);
@@ -6140,7 +6174,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
6140
6174
  ...config.headers ? normalizeHeaders2(config.headers) : void 0,
6141
6175
  ...{
6142
6176
  // Keep these headers lowercase so they will override any user-supplied headers above.
6143
- "solana-client": `js/${"4.0.0-canary-20251002191331"}`
6177
+ "solana-client": `js/${"4.0.0-canary-20251003105839"}`
6144
6178
  }
6145
6179
  }
6146
6180
  }),
@@ -8287,6 +8321,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
8287
8321
  exports.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES = SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES;
8288
8322
  exports.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE = SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE;
8289
8323
  exports.SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH = SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH;
8324
+ exports.SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE = SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE;
8290
8325
  exports.SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING = SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING;
8291
8326
  exports.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED = SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED;
8292
8327
  exports.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE = SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE;
@@ -8534,6 +8569,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
8534
8569
  exports.getTransactionCodec = getTransactionCodec;
8535
8570
  exports.getTransactionDecoder = getTransactionDecoder;
8536
8571
  exports.getTransactionEncoder = getTransactionEncoder;
8572
+ exports.getTransactionLifetimeConstraintFromCompiledTransactionMessage = getTransactionLifetimeConstraintFromCompiledTransactionMessage;
8537
8573
  exports.getTransactionMessageSize = getTransactionMessageSize;
8538
8574
  exports.getTransactionSize = getTransactionSize;
8539
8575
  exports.getTransactionVersionCodec = getTransactionVersionCodec;