@solana/transaction-messages 2.2.0-canary-20250514101928 → 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/dist/index.browser.cjs +7 -5
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +7 -5
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +7 -5
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +7 -5
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +7 -5
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/decompile-message.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 +25 -48
- 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.browser.cjs
CHANGED
|
@@ -670,11 +670,6 @@ function createTransactionMessage({
|
|
|
670
670
|
}
|
|
671
671
|
var RECENT_BLOCKHASHES_SYSVAR_ADDRESS = "SysvarRecentB1ockHashes11111111111111111111";
|
|
672
672
|
var SYSTEM_PROGRAM_ADDRESS = "11111111111111111111111111111111";
|
|
673
|
-
function assertIsTransactionMessageWithDurableNonceLifetime(transactionMessage) {
|
|
674
|
-
if (!isTransactionMessageWithDurableNonceLifetime(transactionMessage)) {
|
|
675
|
-
throw new errors.SolanaError(errors.SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
673
|
function createAdvanceNonceAccountInstruction(nonceAccountAddress, nonceAuthorityAddress) {
|
|
679
674
|
return {
|
|
680
675
|
accounts: [
|
|
@@ -700,9 +695,16 @@ function isAdvanceNonceAccountInstruction(instruction) {
|
|
|
700
695
|
function isAdvanceNonceAccountInstructionData(data) {
|
|
701
696
|
return data.byteLength === 4 && data[0] === 4 && data[1] === 0 && data[2] === 0 && data[3] === 0;
|
|
702
697
|
}
|
|
698
|
+
|
|
699
|
+
// src/durable-nonce.ts
|
|
703
700
|
function isTransactionMessageWithDurableNonceLifetime(transactionMessage) {
|
|
704
701
|
return "lifetimeConstraint" in transactionMessage && typeof transactionMessage.lifetimeConstraint.nonce === "string" && transactionMessage.instructions[0] != null && isAdvanceNonceAccountInstruction(transactionMessage.instructions[0]);
|
|
705
702
|
}
|
|
703
|
+
function assertIsTransactionMessageWithDurableNonceLifetime(transactionMessage) {
|
|
704
|
+
if (!isTransactionMessageWithDurableNonceLifetime(transactionMessage)) {
|
|
705
|
+
throw new errors.SolanaError(errors.SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
706
708
|
function isAdvanceNonceAccountInstructionForNonce(instruction, nonceAccountAddress, nonceAuthorityAddress) {
|
|
707
709
|
return instruction.accounts[0].address === nonceAccountAddress && instruction.accounts[2].address === nonceAuthorityAddress;
|
|
708
710
|
}
|