@solana/kit 8.4.0 → 8.5.0-canary-20261006083550
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.development.js +21 -6
- package/dist/index.development.js.map +1 -1
- package/dist/index.production.min.js +753 -752
- package/package.json +28 -28
|
@@ -295,6 +295,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
295
295
|
var SOLANA_ERROR__CODECS__INVALID_UTF8_STRING = 8078027;
|
|
296
296
|
var SOLANA_ERROR__CODECS__SENTINEL_MISSING_AT_END_OF_BYTES = 8078028;
|
|
297
297
|
var SOLANA_ERROR__CODECS__SENTINEL_MUST_NOT_BE_EMPTY = 8078029;
|
|
298
|
+
var SOLANA_ERROR__CODECS__UNEXPECTED_ZERO_FIXED_SIZE_ITEM_FOR_ARRAY_LIKE_SIZE_STRATEGY = 8078030;
|
|
298
299
|
var SOLANA_ERROR__FIXED_POINTS__INVALID_TOTAL_BITS = 809e4;
|
|
299
300
|
var SOLANA_ERROR__FIXED_POINTS__INVALID_FRACTIONAL_BITS = 8090001;
|
|
300
301
|
var SOLANA_ERROR__FIXED_POINTS__INVALID_DECIMALS = 8090002;
|
|
@@ -387,6 +388,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
387
388
|
[SOLANA_ERROR__CODECS__SENTINEL_MISSING_AT_END_OF_BYTES]: "Codec [$codecDescription] expected sentinel [$hexSentinel] to terminate the collection, but reached the end of the byte array without it.",
|
|
388
389
|
[SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES]: "Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",
|
|
389
390
|
[SOLANA_ERROR__CODECS__SENTINEL_MUST_NOT_BE_EMPTY]: "The sentinel must not be empty.",
|
|
391
|
+
[SOLANA_ERROR__CODECS__UNEXPECTED_ZERO_FIXED_SIZE_ITEM_FOR_ARRAY_LIKE_SIZE_STRATEGY]: "Codec [$codecDescription] cannot use the [$sizeStrategy] size strategy: the item codec has a fixed size of zero and consumes no bytes.",
|
|
390
392
|
[SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE]: "Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",
|
|
391
393
|
[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?",
|
|
392
394
|
[SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_VALUE]: "Invalid pattern match value. The provided value does not match any of the specified patterns.",
|
|
@@ -2746,11 +2748,13 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2746
2748
|
return isFixedSize(codec) ? codec.fixedSize : (_a = codec.maxSize) != null ? _a : null;
|
|
2747
2749
|
}
|
|
2748
2750
|
function getArrayEncoder(item, config = {}) {
|
|
2749
|
-
var _a, _b;
|
|
2751
|
+
var _a, _b, _c;
|
|
2750
2752
|
const size = (_a = config.size) != null ? _a : getU32Encoder();
|
|
2751
2753
|
assertValidSize(size);
|
|
2752
|
-
const
|
|
2753
|
-
|
|
2754
|
+
const itemSize = getFixedSize(item);
|
|
2755
|
+
assertItemCodecSupportsSizeStrategy((_b = config.description) != null ? _b : "array", size, itemSize);
|
|
2756
|
+
const fixedSize = computeArrayLikeCodecSize(size, itemSize);
|
|
2757
|
+
const maxSize = (_c = computeArrayLikeCodecSize(size, getMaxSize(item))) != null ? _c : void 0;
|
|
2754
2758
|
return createEncoder({
|
|
2755
2759
|
...fixedSize !== null ? { fixedSize } : {
|
|
2756
2760
|
getSizeFromValue: (array) => {
|
|
@@ -2780,12 +2784,13 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2780
2784
|
});
|
|
2781
2785
|
}
|
|
2782
2786
|
function getArrayDecoder(item, config = {}) {
|
|
2783
|
-
var _a, _b;
|
|
2787
|
+
var _a, _b, _c;
|
|
2784
2788
|
const size = (_a = config.size) != null ? _a : getU32Decoder();
|
|
2785
2789
|
assertValidSize(size);
|
|
2786
2790
|
const itemSize = getFixedSize(item);
|
|
2791
|
+
assertItemCodecSupportsSizeStrategy((_b = config.description) != null ? _b : "array", size, itemSize);
|
|
2787
2792
|
const fixedSize = computeArrayLikeCodecSize(size, itemSize);
|
|
2788
|
-
const maxSize = (
|
|
2793
|
+
const maxSize = (_c = computeArrayLikeCodecSize(size, getMaxSize(item))) != null ? _c : void 0;
|
|
2789
2794
|
return createDecoder({
|
|
2790
2795
|
...fixedSize !== null ? { fixedSize } : { maxSize },
|
|
2791
2796
|
read: (bytes, offset) => {
|
|
@@ -2855,6 +2860,15 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2855
2860
|
throw new SolanaError(SOLANA_ERROR__CODECS__SENTINEL_MUST_NOT_BE_EMPTY);
|
|
2856
2861
|
}
|
|
2857
2862
|
}
|
|
2863
|
+
function assertItemCodecSupportsSizeStrategy(codecDescription, size, itemFixedSize) {
|
|
2864
|
+
if (itemFixedSize !== 0) return;
|
|
2865
|
+
if (size === "remainder" || isSentinelSize(size)) {
|
|
2866
|
+
throw new SolanaError(SOLANA_ERROR__CODECS__UNEXPECTED_ZERO_FIXED_SIZE_ITEM_FOR_ARRAY_LIKE_SIZE_STRATEGY, {
|
|
2867
|
+
codecDescription,
|
|
2868
|
+
sizeStrategy: size === "remainder" ? "remainder" : "sentinel"
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2858
2872
|
function hexBytes2(bytes) {
|
|
2859
2873
|
return bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, "0"), "");
|
|
2860
2874
|
}
|
|
@@ -11020,7 +11034,7 @@ ${lastLines.map((line) => ` > ${line}
|
|
|
11020
11034
|
...config.headers ? normalizeHeaders2(config.headers) : void 0,
|
|
11021
11035
|
...{
|
|
11022
11036
|
// Keep these headers lowercase so they will override any user-supplied headers above.
|
|
11023
|
-
"solana-client": `js/${"8.
|
|
11037
|
+
"solana-client": `js/${"8.5.0-canary-20261006083550"}`
|
|
11024
11038
|
}
|
|
11025
11039
|
}
|
|
11026
11040
|
}),
|
|
@@ -13505,6 +13519,7 @@ ${lastLines.map((line) => ` > ${line}
|
|
|
13505
13519
|
exports.SOLANA_ERROR__CODECS__SENTINEL_MISSING_AT_END_OF_BYTES = SOLANA_ERROR__CODECS__SENTINEL_MISSING_AT_END_OF_BYTES;
|
|
13506
13520
|
exports.SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES = SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES;
|
|
13507
13521
|
exports.SOLANA_ERROR__CODECS__SENTINEL_MUST_NOT_BE_EMPTY = SOLANA_ERROR__CODECS__SENTINEL_MUST_NOT_BE_EMPTY;
|
|
13522
|
+
exports.SOLANA_ERROR__CODECS__UNEXPECTED_ZERO_FIXED_SIZE_ITEM_FOR_ARRAY_LIKE_SIZE_STRATEGY = SOLANA_ERROR__CODECS__UNEXPECTED_ZERO_FIXED_SIZE_ITEM_FOR_ARRAY_LIKE_SIZE_STRATEGY;
|
|
13508
13523
|
exports.SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE = SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE;
|
|
13509
13524
|
exports.SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED = SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED;
|
|
13510
13525
|
exports.SOLANA_ERROR__FAILED_TO_SEND_TRANSACTION = SOLANA_ERROR__FAILED_TO_SEND_TRANSACTION;
|