@solana/transaction-messages 2.4.0-canary-20250709085912 → 2.4.0-canary-20250709085504
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 -12
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +8 -13
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +8 -13
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +7 -12
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +8 -13
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/codecs/message.d.ts +4 -4
- package/dist/types/codecs/message.d.ts.map +1 -1
- package/dist/types/compile/message.d.ts +11 -16
- package/dist/types/compile/message.d.ts.map +1 -1
- package/dist/types/decompile-message.d.ts +2 -2
- package/dist/types/decompile-message.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/index.node.cjs
CHANGED
|
@@ -271,20 +271,11 @@ function getCompiledMessageVersionedEncoder() {
|
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
273
|
function getPreludeStructEncoderTuple() {
|
|
274
|
-
const lifetimeTokenEncoder = codecsDataStructures.getUnionEncoder(
|
|
275
|
-
[
|
|
276
|
-
// Use a 32-byte constant encoder for a missing lifetime token (index 0).
|
|
277
|
-
codecsDataStructures.getConstantEncoder(new Uint8Array(32)),
|
|
278
|
-
// Use a 32-byte base58 encoder for a valid lifetime token (index 1).
|
|
279
|
-
codecsCore.fixEncoderSize(getBase58Encoder(), 32)
|
|
280
|
-
],
|
|
281
|
-
(value) => value === void 0 ? 0 : 1
|
|
282
|
-
);
|
|
283
274
|
return [
|
|
284
275
|
["version", getTransactionVersionEncoder()],
|
|
285
276
|
["header", getMessageHeaderEncoder()],
|
|
286
277
|
["staticAccounts", codecsDataStructures.getArrayEncoder(addresses.getAddressEncoder(), { size: codecsNumbers.getShortU16Encoder() })],
|
|
287
|
-
["lifetimeToken",
|
|
278
|
+
["lifetimeToken", codecsCore.fixEncoderSize(getBase58Encoder(), 32)],
|
|
288
279
|
["instructions", codecsDataStructures.getArrayEncoder(getInstructionEncoder(), { size: codecsNumbers.getShortU16Encoder() })]
|
|
289
280
|
];
|
|
290
281
|
}
|
|
@@ -596,18 +587,22 @@ function getCompiledStaticAccounts(orderedAccounts) {
|
|
|
596
587
|
}
|
|
597
588
|
|
|
598
589
|
// src/compile/message.ts
|
|
590
|
+
var EMPTY_BLOCKHASH_LIFETIME_CONSTRAINT = {
|
|
591
|
+
blockhash: "11111111111111111111111111111111",
|
|
592
|
+
lastValidBlockHeight: 0n
|
|
593
|
+
};
|
|
599
594
|
function compileTransactionMessage(transactionMessage) {
|
|
600
595
|
const addressMap = getAddressMapFromInstructions(
|
|
601
596
|
transactionMessage.feePayer.address,
|
|
602
597
|
transactionMessage.instructions
|
|
603
598
|
);
|
|
604
599
|
const orderedAccounts = getOrderedAccountsFromAddressMap(addressMap);
|
|
605
|
-
const lifetimeConstraint = transactionMessage.lifetimeConstraint;
|
|
600
|
+
const lifetimeConstraint = transactionMessage.lifetimeConstraint ?? EMPTY_BLOCKHASH_LIFETIME_CONSTRAINT;
|
|
606
601
|
return {
|
|
607
602
|
...transactionMessage.version !== "legacy" ? { addressTableLookups: getCompiledAddressTableLookups(orderedAccounts) } : null,
|
|
608
|
-
...lifetimeConstraint ? { lifetimeToken: getCompiledLifetimeToken(lifetimeConstraint) } : null,
|
|
609
603
|
header: getCompiledMessageHeader(orderedAccounts),
|
|
610
604
|
instructions: getCompiledInstructions(transactionMessage.instructions, orderedAccounts),
|
|
605
|
+
lifetimeToken: getCompiledLifetimeToken(lifetimeConstraint),
|
|
611
606
|
staticAccounts: getCompiledStaticAccounts(orderedAccounts),
|
|
612
607
|
version: transactionMessage.version
|
|
613
608
|
};
|