@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.
- package/README.md +2 -2
- package/dist/index.browser.cjs +15 -7
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +14 -8
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +14 -8
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +15 -7
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +14 -8
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/decompile-message.d.ts.map +1 -1
- package/dist/types/deprecated.d.ts +52 -0
- package/dist/types/deprecated.d.ts.map +1 -1
- package/dist/types/durable-nonce-instruction.d.ts +43 -0
- package/dist/types/durable-nonce-instruction.d.ts.map +1 -0
- package/dist/types/durable-nonce.d.ts +26 -49
- package/dist/types/durable-nonce.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/index.native.mjs
CHANGED
|
@@ -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
|
-
|
|
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 (
|
|
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
|
-
|
|
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.native.mjs.map
|
|
925
931
|
//# sourceMappingURL=index.native.mjs.map
|