@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.
@@ -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", lifetimeTokenEncoder],
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
  };