@solana/kit 4.0.0-canary-20251006190045 → 4.0.0-canary-20251008101046

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.
@@ -229,6 +229,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
229
229
  var SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL = 8078020;
230
230
  var SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES = 8078021;
231
231
  var SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS = 8078022;
232
+ var SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY = 8078023;
232
233
  var SOLANA_ERROR__RPC__INTEGER_OVERFLOW = 81e5;
233
234
  var SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN = 8100001;
234
235
  var SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR = 8100002;
@@ -288,6 +289,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
288
289
  [SOLANA_ERROR__CODECS__OFFSET_OUT_OF_RANGE]: "Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.",
289
290
  [SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES]: "Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",
290
291
  [SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE]: "Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",
292
+ [SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY]: "This decoder expected a byte array of exactly $expectedLength bytes, but $numExcessBytes unexpected excess bytes remained after decoding. Are you sure that you have chosen the correct decoder for this data?",
291
293
  [SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED]: "No random values implementation could be found.",
292
294
  [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_ALREADY_INITIALIZED]: "instruction requires an uninitialized account",
293
295
  [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_FAILED]: "instruction tries to borrow reference for an account which is already borrowed",
@@ -1091,6 +1093,21 @@ this.globalThis.solanaWeb3 = (function (exports) {
1091
1093
  function addCodecSizePrefix(codec, prefix) {
1092
1094
  return combineCodec(addEncoderSizePrefix(codec, prefix), addDecoderSizePrefix(codec, prefix));
1093
1095
  }
1096
+ function createDecoderThatConsumesEntireByteArray(decoder) {
1097
+ return createDecoder({
1098
+ ...decoder,
1099
+ read(bytes, offset) {
1100
+ const [value, newOffset] = decoder.read(bytes, offset);
1101
+ if (bytes.length > newOffset) {
1102
+ throw new SolanaError(SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY, {
1103
+ expectedLength: newOffset,
1104
+ numExcessBytes: bytes.length - newOffset
1105
+ });
1106
+ }
1107
+ return [value, newOffset];
1108
+ }
1109
+ });
1110
+ }
1094
1111
  function fixEncoderSize(encoder, fixedBytes) {
1095
1112
  return createEncoder({
1096
1113
  fixedSize: fixedBytes,
@@ -6190,7 +6207,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
6190
6207
  ...config.headers ? normalizeHeaders2(config.headers) : void 0,
6191
6208
  ...{
6192
6209
  // Keep these headers lowercase so they will override any user-supplied headers above.
6193
- "solana-client": `js/${"4.0.0-canary-20251006190045"}`
6210
+ "solana-client": `js/${"4.0.0-canary-20251008101046"}`
6194
6211
  }
6195
6212
  }
6196
6213
  }),
@@ -8129,6 +8146,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
8129
8146
  exports.SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH = SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH;
8130
8147
  exports.SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH = SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH;
8131
8148
  exports.SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE = SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE;
8149
+ exports.SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY = SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY;
8132
8150
  exports.SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH = SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH;
8133
8151
  exports.SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH = SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH;
8134
8152
  exports.SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH = SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH;
@@ -8410,6 +8428,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
8410
8428
  exports.createAddressWithSeed = createAddressWithSeed;
8411
8429
  exports.createCodec = createCodec;
8412
8430
  exports.createDecoder = createDecoder;
8431
+ exports.createDecoderThatConsumesEntireByteArray = createDecoderThatConsumesEntireByteArray;
8413
8432
  exports.createDefaultRpcSubscriptionsChannelCreator = createDefaultRpcSubscriptionsChannelCreator;
8414
8433
  exports.createDefaultRpcSubscriptionsTransport = createDefaultRpcSubscriptionsTransport;
8415
8434
  exports.createDefaultRpcTransport = createDefaultRpcTransport;