@solana/transaction-messages 4.0.0-canary-20250930051855 → 4.0.0-canary-20250930084738

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.
@@ -204,6 +204,11 @@ function getInstructionDecoder() {
204
204
  }
205
205
  return memoizedGetInstructionDecoder;
206
206
  }
207
+
208
+ // src/transaction-message.ts
209
+ var MAX_SUPPORTED_TRANSACTION_VERSION = 0;
210
+
211
+ // src/codecs/transaction-version.ts
207
212
  var VERSION_FLAG_MASK = 128;
208
213
  function getTransactionVersionEncoder() {
209
214
  return codecsCore.createEncoder({
@@ -218,6 +223,11 @@ function getTransactionVersionEncoder() {
218
223
  actualVersion: value
219
224
  });
220
225
  }
226
+ if (value > MAX_SUPPORTED_TRANSACTION_VERSION) {
227
+ throw new errors.SolanaError(errors.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED, {
228
+ unsupportedVersion: value
229
+ });
230
+ }
221
231
  bytes.set([value | VERSION_FLAG_MASK], offset);
222
232
  return offset + 1;
223
233
  }
@@ -232,6 +242,11 @@ function getTransactionVersionDecoder() {
232
242
  return ["legacy", offset];
233
243
  } else {
234
244
  const version = firstByte ^ VERSION_FLAG_MASK;
245
+ if (version > MAX_SUPPORTED_TRANSACTION_VERSION) {
246
+ throw new errors.SolanaError(errors.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED, {
247
+ unsupportedVersion: version
248
+ });
249
+ }
235
250
  return [version, offset + 1];
236
251
  }
237
252
  }
@@ -912,6 +927,7 @@ function decompileTransactionMessage(compiledTransactionMessage, config) {
912
927
  );
913
928
  }
914
929
 
930
+ exports.MAX_SUPPORTED_TRANSACTION_VERSION = MAX_SUPPORTED_TRANSACTION_VERSION;
915
931
  exports.appendTransactionMessageInstruction = appendTransactionMessageInstruction;
916
932
  exports.appendTransactionMessageInstructions = appendTransactionMessageInstructions;
917
933
  exports.assertIsTransactionMessageWithBlockhashLifetime = assertIsTransactionMessageWithBlockhashLifetime;