@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 +4 -4
- package/dist/index.browser.cjs +10 -4
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +9 -5
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +9 -5
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +10 -4
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +9 -5
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/compilable-transaction-message.d.ts +2 -2
- package/dist/types/compilable-transaction-message.d.ts.map +1 -1
- package/dist/types/deprecated.d.ts +65 -0
- package/dist/types/deprecated.d.ts.map +1 -0
- package/dist/types/durable-nonce.d.ts +4 -4
- package/dist/types/durable-nonce.d.ts.map +1 -1
- package/dist/types/fee-payer.d.ts +3 -3
- package/dist/types/fee-payer.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,8 +668,8 @@ function createTransactionMessage({
|
|
|
668
668
|
}
|
|
669
669
|
var RECENT_BLOCKHASHES_SYSVAR_ADDRESS = "SysvarRecentB1ockHashes11111111111111111111";
|
|
670
670
|
var SYSTEM_PROGRAM_ADDRESS = "11111111111111111111111111111111";
|
|
671
|
-
function
|
|
672
|
-
if (!
|
|
671
|
+
function assertIsTransactionMessageWithDurableNonceLifetime(transactionMessage) {
|
|
672
|
+
if (!isTransactionMessageWithDurableNonceLifetime(transactionMessage)) {
|
|
673
673
|
throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME);
|
|
674
674
|
}
|
|
675
675
|
}
|
|
@@ -698,7 +698,7 @@ function isAdvanceNonceAccountInstruction(instruction) {
|
|
|
698
698
|
function isAdvanceNonceAccountInstructionData(data) {
|
|
699
699
|
return data.byteLength === 4 && data[0] === 4 && data[1] === 0 && data[2] === 0 && data[3] === 0;
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function isTransactionMessageWithDurableNonceLifetime(transactionMessage) {
|
|
702
702
|
return "lifetimeConstraint" in transactionMessage && typeof transactionMessage.lifetimeConstraint.nonce === "string" && transactionMessage.instructions[0] != null && isAdvanceNonceAccountInstruction(transactionMessage.instructions[0]);
|
|
703
703
|
}
|
|
704
704
|
function isAdvanceNonceAccountInstructionForNonce(instruction, nonceAccountAddress, nonceAuthorityAddress) {
|
|
@@ -713,7 +713,7 @@ function setTransactionMessageLifetimeUsingDurableNonce({
|
|
|
713
713
|
const firstInstruction = transactionMessage.instructions[0];
|
|
714
714
|
if (firstInstruction && isAdvanceNonceAccountInstruction(firstInstruction)) {
|
|
715
715
|
if (isAdvanceNonceAccountInstructionForNonce(firstInstruction, nonceAccountAddress, nonceAuthorityAddress)) {
|
|
716
|
-
if (
|
|
716
|
+
if (isTransactionMessageWithDurableNonceLifetime(transactionMessage) && transactionMessage.lifetimeConstraint.nonce === nonce) {
|
|
717
717
|
return transactionMessage;
|
|
718
718
|
} else {
|
|
719
719
|
newInstructions = [firstInstruction, ...transactionMessage.instructions.slice(1)];
|
|
@@ -920,6 +920,10 @@ function decompileTransactionMessage(compiledTransactionMessage, config) {
|
|
|
920
920
|
);
|
|
921
921
|
}
|
|
922
922
|
|
|
923
|
-
|
|
923
|
+
// src/deprecated.ts
|
|
924
|
+
var assertIsDurableNonceTransactionMessage = assertIsTransactionMessageWithDurableNonceLifetime;
|
|
925
|
+
var isDurableNonceTransaction = isTransactionMessageWithDurableNonceLifetime;
|
|
926
|
+
|
|
927
|
+
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
928
|
//# sourceMappingURL=index.native.mjs.map
|
|
925
929
|
//# sourceMappingURL=index.native.mjs.map
|