@solana/transaction-messages 2.1.2-canary-20250514101103 → 2.2.0-canary-20250514101928

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.
package/README.md CHANGED
@@ -56,7 +56,7 @@ const message = createTransactionMessage({ version: 0 });
56
56
 
57
57
  ### Types
58
58
 
59
- #### `ITransactionMessageWithFeePayer`
59
+ #### `TransactionMessageWithFeePayer`
60
60
 
61
61
  This type represents a transaction message for which a fee payer has been declared. A transaction must conform to this type to be compiled and landed on the network.
62
62
 
@@ -64,7 +64,7 @@ This type represents a transaction message for which a fee payer has been declar
64
64
 
65
65
  #### `setTransactionMessageFeePayer()`
66
66
 
67
- Given a base58-encoded address of a system account, this method will return a new transaction message having the same type as the one supplied plus the `ITransactionMessageWithFeePayer` type.
67
+ Given a base58-encoded address of a system account, this method will return a new transaction message having the same type as the one supplied plus the `TransactionMessageWithFeePayer` type.
68
68
 
69
69
  ```ts
70
70
  import { address } from '@solana/addresses';
@@ -171,9 +171,9 @@ function handleSubmit() {
171
171
  }
172
172
  ```
173
173
 
174
- #### `assertIsDurableNonceTransactionMessage()`
174
+ #### `assertIsTransactionMessageWithDurableNonceLifetime()`
175
175
 
176
- From time to time you might acquire a transaction message that you expect to be a durable nonce transaction, from an untrusted network API or user input. To assert that such an arbitrary transaction is in fact a durable nonce transaction, use the `assertIsDurableNonceTransactionMessage` function.
176
+ From time to time you might acquire a transaction message that you expect to be a durable nonce transaction, from an untrusted network API or user input. To assert that such an arbitrary transaction is in fact a durable nonce transaction, use the `assertIsTransactionMessageWithDurableNonceLifetime` function.
177
177
 
178
178
  See [`assertIsBlockhash()`](#assertisblockhash) for an example of how to use an assertion function.
179
179
 
@@ -670,8 +670,8 @@ function createTransactionMessage({
670
670
  }
671
671
  var RECENT_BLOCKHASHES_SYSVAR_ADDRESS = "SysvarRecentB1ockHashes11111111111111111111";
672
672
  var SYSTEM_PROGRAM_ADDRESS = "11111111111111111111111111111111";
673
- function assertIsDurableNonceTransactionMessage(transactionMessage) {
674
- if (!isDurableNonceTransaction(transactionMessage)) {
673
+ function assertIsTransactionMessageWithDurableNonceLifetime(transactionMessage) {
674
+ if (!isTransactionMessageWithDurableNonceLifetime(transactionMessage)) {
675
675
  throw new errors.SolanaError(errors.SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME);
676
676
  }
677
677
  }
@@ -700,7 +700,7 @@ function isAdvanceNonceAccountInstruction(instruction) {
700
700
  function isAdvanceNonceAccountInstructionData(data) {
701
701
  return data.byteLength === 4 && data[0] === 4 && data[1] === 0 && data[2] === 0 && data[3] === 0;
702
702
  }
703
- function isDurableNonceTransaction(transactionMessage) {
703
+ function isTransactionMessageWithDurableNonceLifetime(transactionMessage) {
704
704
  return "lifetimeConstraint" in transactionMessage && typeof transactionMessage.lifetimeConstraint.nonce === "string" && transactionMessage.instructions[0] != null && isAdvanceNonceAccountInstruction(transactionMessage.instructions[0]);
705
705
  }
706
706
  function isAdvanceNonceAccountInstructionForNonce(instruction, nonceAccountAddress, nonceAuthorityAddress) {
@@ -715,7 +715,7 @@ function setTransactionMessageLifetimeUsingDurableNonce({
715
715
  const firstInstruction = transactionMessage.instructions[0];
716
716
  if (firstInstruction && isAdvanceNonceAccountInstruction(firstInstruction)) {
717
717
  if (isAdvanceNonceAccountInstructionForNonce(firstInstruction, nonceAccountAddress, nonceAuthorityAddress)) {
718
- if (isDurableNonceTransaction(transactionMessage) && transactionMessage.lifetimeConstraint.nonce === nonce) {
718
+ if (isTransactionMessageWithDurableNonceLifetime(transactionMessage) && transactionMessage.lifetimeConstraint.nonce === nonce) {
719
719
  return transactionMessage;
720
720
  } else {
721
721
  newInstructions = [firstInstruction, ...transactionMessage.instructions.slice(1)];
@@ -922,10 +922,15 @@ function decompileTransactionMessage(compiledTransactionMessage, config) {
922
922
  );
923
923
  }
924
924
 
925
+ // src/deprecated.ts
926
+ var assertIsDurableNonceTransactionMessage = assertIsTransactionMessageWithDurableNonceLifetime;
927
+ var isDurableNonceTransaction = isTransactionMessageWithDurableNonceLifetime;
928
+
925
929
  exports.appendTransactionMessageInstruction = appendTransactionMessageInstruction;
926
930
  exports.appendTransactionMessageInstructions = appendTransactionMessageInstructions;
927
931
  exports.assertIsDurableNonceTransactionMessage = assertIsDurableNonceTransactionMessage;
928
932
  exports.assertIsTransactionMessageWithBlockhashLifetime = assertIsTransactionMessageWithBlockhashLifetime;
933
+ exports.assertIsTransactionMessageWithDurableNonceLifetime = assertIsTransactionMessageWithDurableNonceLifetime;
929
934
  exports.compileTransactionMessage = compileTransactionMessage;
930
935
  exports.compressTransactionMessageUsingAddressLookupTables = compressTransactionMessageUsingAddressLookupTables;
931
936
  exports.createTransactionMessage = createTransactionMessage;
@@ -939,6 +944,7 @@ exports.getTransactionVersionEncoder = getTransactionVersionEncoder;
939
944
  exports.isAdvanceNonceAccountInstruction = isAdvanceNonceAccountInstruction;
940
945
  exports.isDurableNonceTransaction = isDurableNonceTransaction;
941
946
  exports.isTransactionMessageWithBlockhashLifetime = isTransactionMessageWithBlockhashLifetime;
947
+ exports.isTransactionMessageWithDurableNonceLifetime = isTransactionMessageWithDurableNonceLifetime;
942
948
  exports.prependTransactionMessageInstruction = prependTransactionMessageInstruction;
943
949
  exports.prependTransactionMessageInstructions = prependTransactionMessageInstructions;
944
950
  exports.setTransactionMessageFeePayer = setTransactionMessageFeePayer;