@solana/transaction-messages 2.2.0-canary-20250514101537 → 2.2.0-canary-20250514102324

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.
@@ -668,11 +668,6 @@ function createTransactionMessage({
668
668
  }
669
669
  var RECENT_BLOCKHASHES_SYSVAR_ADDRESS = "SysvarRecentB1ockHashes11111111111111111111";
670
670
  var SYSTEM_PROGRAM_ADDRESS = "11111111111111111111111111111111";
671
- function assertIsDurableNonceTransactionMessage(transactionMessage) {
672
- if (!isDurableNonceTransaction(transactionMessage)) {
673
- throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME);
674
- }
675
- }
676
671
  function createAdvanceNonceAccountInstruction(nonceAccountAddress, nonceAuthorityAddress) {
677
672
  return {
678
673
  accounts: [
@@ -698,9 +693,16 @@ function isAdvanceNonceAccountInstruction(instruction) {
698
693
  function isAdvanceNonceAccountInstructionData(data) {
699
694
  return data.byteLength === 4 && data[0] === 4 && data[1] === 0 && data[2] === 0 && data[3] === 0;
700
695
  }
701
- function isDurableNonceTransaction(transactionMessage) {
696
+
697
+ // src/durable-nonce.ts
698
+ function isTransactionMessageWithDurableNonceLifetime(transactionMessage) {
702
699
  return "lifetimeConstraint" in transactionMessage && typeof transactionMessage.lifetimeConstraint.nonce === "string" && transactionMessage.instructions[0] != null && isAdvanceNonceAccountInstruction(transactionMessage.instructions[0]);
703
700
  }
701
+ function assertIsTransactionMessageWithDurableNonceLifetime(transactionMessage) {
702
+ if (!isTransactionMessageWithDurableNonceLifetime(transactionMessage)) {
703
+ throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME);
704
+ }
705
+ }
704
706
  function isAdvanceNonceAccountInstructionForNonce(instruction, nonceAccountAddress, nonceAuthorityAddress) {
705
707
  return instruction.accounts[0].address === nonceAccountAddress && instruction.accounts[2].address === nonceAuthorityAddress;
706
708
  }
@@ -713,7 +715,7 @@ function setTransactionMessageLifetimeUsingDurableNonce({
713
715
  const firstInstruction = transactionMessage.instructions[0];
714
716
  if (firstInstruction && isAdvanceNonceAccountInstruction(firstInstruction)) {
715
717
  if (isAdvanceNonceAccountInstructionForNonce(firstInstruction, nonceAccountAddress, nonceAuthorityAddress)) {
716
- if (isDurableNonceTransaction(transactionMessage) && transactionMessage.lifetimeConstraint.nonce === nonce) {
718
+ if (isTransactionMessageWithDurableNonceLifetime(transactionMessage) && transactionMessage.lifetimeConstraint.nonce === nonce) {
717
719
  return transactionMessage;
718
720
  } else {
719
721
  newInstructions = [firstInstruction, ...transactionMessage.instructions.slice(1)];
@@ -920,6 +922,10 @@ function decompileTransactionMessage(compiledTransactionMessage, config) {
920
922
  );
921
923
  }
922
924
 
923
- export { appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, compileTransactionMessage, compressTransactionMessageUsingAddressLookupTables, createTransactionMessage, decompileTransactionMessage, getCompiledTransactionMessageCodec, getCompiledTransactionMessageDecoder, getCompiledTransactionMessageEncoder, getTransactionVersionCodec, getTransactionVersionDecoder, getTransactionVersionEncoder, isAdvanceNonceAccountInstruction, isDurableNonceTransaction, isTransactionMessageWithBlockhashLifetime, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
925
+ // src/deprecated.ts
926
+ var assertIsDurableNonceTransactionMessage = assertIsTransactionMessageWithDurableNonceLifetime;
927
+ var isDurableNonceTransaction = isTransactionMessageWithDurableNonceLifetime;
928
+
929
+ export { appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, assertIsTransactionMessageWithDurableNonceLifetime, compileTransactionMessage, compressTransactionMessageUsingAddressLookupTables, createTransactionMessage, decompileTransactionMessage, getCompiledTransactionMessageCodec, getCompiledTransactionMessageDecoder, getCompiledTransactionMessageEncoder, getTransactionVersionCodec, getTransactionVersionDecoder, getTransactionVersionEncoder, isAdvanceNonceAccountInstruction, isDurableNonceTransaction, isTransactionMessageWithBlockhashLifetime, isTransactionMessageWithDurableNonceLifetime, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
924
930
  //# sourceMappingURL=index.node.mjs.map
925
931
  //# sourceMappingURL=index.node.mjs.map