@solana/kit 2.1.0 → 2.1.1-canary-20250310215239
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/README.md +27 -23
- package/dist/index.browser.cjs +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.development.js +93 -97
- package/dist/index.development.js.map +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +1 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +1 -1
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.production.min.js +27 -27
- package/dist/types/airdrop.d.ts +26 -0
- package/dist/types/airdrop.d.ts.map +1 -1
- package/dist/types/compute-limit.d.ts +63 -0
- package/dist/types/compute-limit.d.ts.map +1 -1
- package/dist/types/decompile-transaction-message-fetching-lookup-tables.d.ts +9 -0
- package/dist/types/decompile-transaction-message-fetching-lookup-tables.d.ts.map +1 -1
- package/dist/types/fetch-lookup-tables.d.ts +7 -0
- package/dist/types/fetch-lookup-tables.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/send-and-confirm-durable-nonce-transaction.d.ts +35 -0
- package/dist/types/send-and-confirm-durable-nonce-transaction.d.ts.map +1 -1
- package/dist/types/send-and-confirm-transaction.d.ts +25 -0
- package/dist/types/send-and-confirm-transaction.d.ts.map +1 -1
- package/dist/types/send-transaction-without-confirming.d.ts +27 -0
- package/dist/types/send-transaction-without-confirming.d.ts.map +1 -1
- package/package.json +19 -19
|
@@ -554,7 +554,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
554
554
|
function isSolanaError(e3, code) {
|
|
555
555
|
const isSolanaError2 = e3 instanceof Error && e3.name === "SolanaError";
|
|
556
556
|
if (isSolanaError2) {
|
|
557
|
-
if (code !==
|
|
557
|
+
if (code !== void 0) {
|
|
558
558
|
return e3.context.__code === code;
|
|
559
559
|
}
|
|
560
560
|
return true;
|
|
@@ -684,7 +684,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
684
684
|
return {
|
|
685
685
|
errorName: rpcErrorName,
|
|
686
686
|
index: numberIndex,
|
|
687
|
-
...rpcErrorContext !==
|
|
687
|
+
...rpcErrorContext !== void 0 ? { instructionErrorContext: rpcErrorContext } : null
|
|
688
688
|
};
|
|
689
689
|
} else if (errorCode === SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM) {
|
|
690
690
|
return {
|
|
@@ -760,7 +760,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
760
760
|
if (errorCode === SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN) {
|
|
761
761
|
return {
|
|
762
762
|
errorName: rpcErrorName,
|
|
763
|
-
...rpcErrorContext !==
|
|
763
|
+
...rpcErrorContext !== void 0 ? { transactionErrorContext: rpcErrorContext } : null
|
|
764
764
|
};
|
|
765
765
|
} else if (errorCode === SOLANA_ERROR__TRANSACTION_ERROR__DUPLICATE_INSTRUCTION) {
|
|
766
766
|
return {
|
|
@@ -1365,7 +1365,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
1365
1365
|
if (len === 1) {
|
|
1366
1366
|
const c = value.charCodeAt(0);
|
|
1367
1367
|
const n = charCodeToBase16(c);
|
|
1368
|
-
if (n ===
|
|
1368
|
+
if (n === void 0) {
|
|
1369
1369
|
throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE, {
|
|
1370
1370
|
...INVALID_STRING_ERROR_BASE_CONFIG,
|
|
1371
1371
|
value
|
|
@@ -1380,7 +1380,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
1380
1380
|
const c2 = value.charCodeAt(j++);
|
|
1381
1381
|
const n1 = charCodeToBase16(c1);
|
|
1382
1382
|
const n2 = charCodeToBase16(c2);
|
|
1383
|
-
if (n1 ===
|
|
1383
|
+
if (n1 === void 0 || n2 === void 0 && !Number.isNaN(c2)) {
|
|
1384
1384
|
throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE, {
|
|
1385
1385
|
...INVALID_STRING_ERROR_BASE_CONFIG,
|
|
1386
1386
|
value
|
|
@@ -1617,7 +1617,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
1617
1617
|
}
|
|
1618
1618
|
var cachedEd25519Decision;
|
|
1619
1619
|
async function isEd25519CurveSupported(subtle) {
|
|
1620
|
-
if (cachedEd25519Decision ===
|
|
1620
|
+
if (cachedEd25519Decision === void 0) {
|
|
1621
1621
|
cachedEd25519Decision = new Promise((resolve) => {
|
|
1622
1622
|
subtle.generateKey(
|
|
1623
1623
|
"Ed25519",
|
|
@@ -1640,14 +1640,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
1640
1640
|
function assertDigestCapabilityIsAvailable() {
|
|
1641
1641
|
var _a;
|
|
1642
1642
|
assertIsSecureContext();
|
|
1643
|
-
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ?
|
|
1643
|
+
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ? void 0 : _a.digest) !== "function") {
|
|
1644
1644
|
throw new SolanaError(SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED);
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
1647
|
async function assertKeyGenerationIsAvailable() {
|
|
1648
1648
|
var _a;
|
|
1649
1649
|
assertIsSecureContext();
|
|
1650
|
-
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ?
|
|
1650
|
+
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ? void 0 : _a.generateKey) !== "function") {
|
|
1651
1651
|
throw new SolanaError(SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED);
|
|
1652
1652
|
}
|
|
1653
1653
|
if (!await isEd25519CurveSupported(globalThis.crypto.subtle)) {
|
|
@@ -1657,21 +1657,21 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
1657
1657
|
function assertKeyExporterIsAvailable() {
|
|
1658
1658
|
var _a;
|
|
1659
1659
|
assertIsSecureContext();
|
|
1660
|
-
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ?
|
|
1660
|
+
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ? void 0 : _a.exportKey) !== "function") {
|
|
1661
1661
|
throw new SolanaError(SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED);
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
1664
|
function assertSigningCapabilityIsAvailable() {
|
|
1665
1665
|
var _a;
|
|
1666
1666
|
assertIsSecureContext();
|
|
1667
|
-
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ?
|
|
1667
|
+
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ? void 0 : _a.sign) !== "function") {
|
|
1668
1668
|
throw new SolanaError(SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED);
|
|
1669
1669
|
}
|
|
1670
1670
|
}
|
|
1671
1671
|
function assertVerificationCapabilityIsAvailable() {
|
|
1672
1672
|
var _a;
|
|
1673
1673
|
assertIsSecureContext();
|
|
1674
|
-
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ?
|
|
1674
|
+
if (typeof globalThis.crypto === "undefined" || typeof ((_a = globalThis.crypto.subtle) == null ? void 0 : _a.verify) !== "function") {
|
|
1675
1675
|
throw new SolanaError(SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED);
|
|
1676
1676
|
}
|
|
1677
1677
|
}
|
|
@@ -1977,7 +1977,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
1977
1977
|
return Endian2;
|
|
1978
1978
|
})(Endian || {});
|
|
1979
1979
|
function isLittleEndian(config) {
|
|
1980
|
-
return (config == null ?
|
|
1980
|
+
return (config == null ? void 0 : config.endian) === 1 ? false : true;
|
|
1981
1981
|
}
|
|
1982
1982
|
function numberEncoderFactory(input) {
|
|
1983
1983
|
return createEncoder({
|
|
@@ -2269,7 +2269,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2269
2269
|
var _a, _b;
|
|
2270
2270
|
const size = (_a = config.size) != null ? _a : getU32Encoder();
|
|
2271
2271
|
const fixedSize = computeArrayLikeCodecSize(size, getFixedSize(item));
|
|
2272
|
-
const maxSize = (_b = computeArrayLikeCodecSize(size, getMaxSize(item))) != null ? _b :
|
|
2272
|
+
const maxSize = (_b = computeArrayLikeCodecSize(size, getMaxSize(item))) != null ? _b : void 0;
|
|
2273
2273
|
return createEncoder({
|
|
2274
2274
|
...fixedSize !== null ? { fixedSize } : {
|
|
2275
2275
|
getSizeFromValue: (array) => {
|
|
@@ -2297,7 +2297,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2297
2297
|
const size = (_a = config.size) != null ? _a : getU32Decoder();
|
|
2298
2298
|
const itemSize = getFixedSize(item);
|
|
2299
2299
|
const fixedSize = computeArrayLikeCodecSize(size, itemSize);
|
|
2300
|
-
const maxSize = (_b = computeArrayLikeCodecSize(size, getMaxSize(item))) != null ? _b :
|
|
2300
|
+
const maxSize = (_b = computeArrayLikeCodecSize(size, getMaxSize(item))) != null ? _b : void 0;
|
|
2301
2301
|
return createDecoder({
|
|
2302
2302
|
...fixedSize !== null ? { fixedSize } : { maxSize },
|
|
2303
2303
|
read: (bytes, offset) => {
|
|
@@ -2447,7 +2447,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2447
2447
|
offset
|
|
2448
2448
|
});
|
|
2449
2449
|
}
|
|
2450
|
-
return [
|
|
2450
|
+
return [void 0, offset + constant.length];
|
|
2451
2451
|
}
|
|
2452
2452
|
});
|
|
2453
2453
|
}
|
|
@@ -2457,7 +2457,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2457
2457
|
function getTupleEncoder(items) {
|
|
2458
2458
|
var _a;
|
|
2459
2459
|
const fixedSize = sumCodecSizes(items.map(getFixedSize));
|
|
2460
|
-
const maxSize = (_a = sumCodecSizes(items.map(getMaxSize))) != null ? _a :
|
|
2460
|
+
const maxSize = (_a = sumCodecSizes(items.map(getMaxSize))) != null ? _a : void 0;
|
|
2461
2461
|
return createEncoder({
|
|
2462
2462
|
...fixedSize === null ? {
|
|
2463
2463
|
getSizeFromValue: (value) => items.map((item, index) => getEncodedSize(value[index], item)).reduce((all, one) => all + one, 0),
|
|
@@ -2475,7 +2475,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2475
2475
|
function getTupleDecoder(items) {
|
|
2476
2476
|
var _a;
|
|
2477
2477
|
const fixedSize = sumCodecSizes(items.map(getFixedSize));
|
|
2478
|
-
const maxSize = (_a = sumCodecSizes(items.map(getMaxSize))) != null ? _a :
|
|
2478
|
+
const maxSize = (_a = sumCodecSizes(items.map(getMaxSize))) != null ? _a : void 0;
|
|
2479
2479
|
return createDecoder({
|
|
2480
2480
|
...fixedSize === null ? { maxSize } : { fixedSize },
|
|
2481
2481
|
read: (bytes, offset) => {
|
|
@@ -2712,7 +2712,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2712
2712
|
function getHiddenPrefixEncoder(encoder, prefixedEncoders) {
|
|
2713
2713
|
return transformEncoder(
|
|
2714
2714
|
getTupleEncoder([...prefixedEncoders, encoder]),
|
|
2715
|
-
(value) => [...prefixedEncoders.map(() =>
|
|
2715
|
+
(value) => [...prefixedEncoders.map(() => void 0), value]
|
|
2716
2716
|
);
|
|
2717
2717
|
}
|
|
2718
2718
|
function getHiddenPrefixDecoder(decoder, prefixedDecoders) {
|
|
@@ -2727,7 +2727,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2727
2727
|
function getHiddenSuffixEncoder(encoder, suffixedEncoders) {
|
|
2728
2728
|
return transformEncoder(
|
|
2729
2729
|
getTupleEncoder([encoder, ...suffixedEncoders]),
|
|
2730
|
-
(value) => [value, ...suffixedEncoders.map(() =>
|
|
2730
|
+
(value) => [value, ...suffixedEncoders.map(() => void 0)]
|
|
2731
2731
|
);
|
|
2732
2732
|
}
|
|
2733
2733
|
function getHiddenSuffixDecoder(decoder, suffixedDecoders) {
|
|
@@ -2794,7 +2794,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2794
2794
|
function getUnitDecoder() {
|
|
2795
2795
|
return createDecoder({
|
|
2796
2796
|
fixedSize: 0,
|
|
2797
|
-
read: (_bytes, offset) => [
|
|
2797
|
+
read: (_bytes, offset) => [void 0, offset]
|
|
2798
2798
|
});
|
|
2799
2799
|
}
|
|
2800
2800
|
function getUnitCodec() {
|
|
@@ -2804,7 +2804,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2804
2804
|
const prefix = (() => {
|
|
2805
2805
|
var _a;
|
|
2806
2806
|
if (config.prefix === null) {
|
|
2807
|
-
return transformEncoder(getUnitEncoder(), (_boolean) =>
|
|
2807
|
+
return transformEncoder(getUnitEncoder(), (_boolean) => void 0);
|
|
2808
2808
|
}
|
|
2809
2809
|
return getBooleanEncoder({ size: (_a = config.prefix) != null ? _a : getU8Encoder() });
|
|
2810
2810
|
})();
|
|
@@ -2822,7 +2822,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2822
2822
|
[
|
|
2823
2823
|
transformEncoder(getTupleEncoder([prefix, noneValue]), (_value) => [
|
|
2824
2824
|
false,
|
|
2825
|
-
|
|
2825
|
+
void 0
|
|
2826
2826
|
]),
|
|
2827
2827
|
transformEncoder(getTupleEncoder([prefix, item]), (value) => [true, value])
|
|
2828
2828
|
],
|
|
@@ -2883,7 +2883,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2883
2883
|
var _a;
|
|
2884
2884
|
const fieldCodecs = fields.map(([, codec]) => codec);
|
|
2885
2885
|
const fixedSize = sumCodecSizes(fieldCodecs.map(getFixedSize));
|
|
2886
|
-
const maxSize = (_a = sumCodecSizes(fieldCodecs.map(getMaxSize))) != null ? _a :
|
|
2886
|
+
const maxSize = (_a = sumCodecSizes(fieldCodecs.map(getMaxSize))) != null ? _a : void 0;
|
|
2887
2887
|
return createEncoder({
|
|
2888
2888
|
...fixedSize === null ? {
|
|
2889
2889
|
getSizeFromValue: (value) => fields.map(([key, codec]) => getEncodedSize(value[key], codec)).reduce((all, one) => all + one, 0),
|
|
@@ -2901,7 +2901,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2901
2901
|
var _a;
|
|
2902
2902
|
const fieldCodecs = fields.map(([, codec]) => codec);
|
|
2903
2903
|
const fixedSize = sumCodecSizes(fieldCodecs.map(getFixedSize));
|
|
2904
|
-
const maxSize = (_a = sumCodecSizes(fieldCodecs.map(getMaxSize))) != null ? _a :
|
|
2904
|
+
const maxSize = (_a = sumCodecSizes(fieldCodecs.map(getMaxSize))) != null ? _a : void 0;
|
|
2905
2905
|
return createDecoder({
|
|
2906
2906
|
...fixedSize === null ? { maxSize } : { fixedSize },
|
|
2907
2907
|
read: (bytes, offset) => {
|
|
@@ -2937,7 +2937,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2937
2937
|
const prefix = (() => {
|
|
2938
2938
|
var _a;
|
|
2939
2939
|
if (config.prefix === null) {
|
|
2940
|
-
return transformEncoder(getUnitEncoder(), (_boolean) =>
|
|
2940
|
+
return transformEncoder(getUnitEncoder(), (_boolean) => void 0);
|
|
2941
2941
|
}
|
|
2942
2942
|
return getBooleanEncoder({ size: (_a = config.prefix) != null ? _a : getU8Encoder() });
|
|
2943
2943
|
})();
|
|
@@ -2955,7 +2955,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
2955
2955
|
[
|
|
2956
2956
|
transformEncoder(getTupleEncoder([prefix, noneValue]), (_value) => [
|
|
2957
2957
|
false,
|
|
2958
|
-
|
|
2958
|
+
void 0
|
|
2959
2959
|
]),
|
|
2960
2960
|
transformEncoder(getTupleEncoder([prefix, item]), (value) => [
|
|
2961
2961
|
true,
|
|
@@ -3045,10 +3045,10 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3045
3045
|
}
|
|
3046
3046
|
}
|
|
3047
3047
|
function isInstructionWithAccounts(instruction) {
|
|
3048
|
-
return instruction.accounts !==
|
|
3048
|
+
return instruction.accounts !== void 0;
|
|
3049
3049
|
}
|
|
3050
3050
|
function assertIsInstructionWithAccounts(instruction) {
|
|
3051
|
-
if (instruction.accounts ===
|
|
3051
|
+
if (instruction.accounts === void 0) {
|
|
3052
3052
|
throw new SolanaError(SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_ACCOUNTS, {
|
|
3053
3053
|
data: instruction.data,
|
|
3054
3054
|
programAddress: instruction.programAddress
|
|
@@ -3056,13 +3056,13 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3056
3056
|
}
|
|
3057
3057
|
}
|
|
3058
3058
|
function isInstructionWithData(instruction) {
|
|
3059
|
-
return instruction.data !==
|
|
3059
|
+
return instruction.data !== void 0;
|
|
3060
3060
|
}
|
|
3061
3061
|
function assertIsInstructionWithData(instruction) {
|
|
3062
3062
|
var _a;
|
|
3063
|
-
if (instruction.data ===
|
|
3063
|
+
if (instruction.data === void 0) {
|
|
3064
3064
|
throw new SolanaError(SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_DATA, {
|
|
3065
|
-
accountAddresses: (_a = instruction.accounts) == null ?
|
|
3065
|
+
accountAddresses: (_a = instruction.accounts) == null ? void 0 : _a.map((a) => a.address),
|
|
3066
3066
|
programAddress: instruction.programAddress
|
|
3067
3067
|
});
|
|
3068
3068
|
}
|
|
@@ -3154,7 +3154,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3154
3154
|
...bytes
|
|
3155
3155
|
]);
|
|
3156
3156
|
}
|
|
3157
|
-
async function createPrivateKeyFromBytes(bytes, extractable) {
|
|
3157
|
+
async function createPrivateKeyFromBytes(bytes, extractable = false) {
|
|
3158
3158
|
const actualLength = bytes.byteLength;
|
|
3159
3159
|
if (actualLength !== 32) {
|
|
3160
3160
|
throw new SolanaError(SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH, {
|
|
@@ -3162,13 +3162,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3162
3162
|
});
|
|
3163
3163
|
}
|
|
3164
3164
|
const privateKeyBytesPkcs8 = addPkcs8Header(bytes);
|
|
3165
|
-
return await crypto.subtle.importKey(
|
|
3166
|
-
"
|
|
3167
|
-
|
|
3168
|
-
ED25519_ALGORITHM_IDENTIFIER,
|
|
3169
|
-
extractable != null ? extractable : false,
|
|
3170
|
-
["sign"]
|
|
3171
|
-
);
|
|
3165
|
+
return await crypto.subtle.importKey("pkcs8", privateKeyBytesPkcs8, ED25519_ALGORITHM_IDENTIFIER, extractable, [
|
|
3166
|
+
"sign"
|
|
3167
|
+
]);
|
|
3172
3168
|
}
|
|
3173
3169
|
async function getPublicKeyFromPrivateKey(privateKey, extractable = false) {
|
|
3174
3170
|
assertKeyExporterIsAvailable();
|
|
@@ -3253,7 +3249,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3253
3249
|
);
|
|
3254
3250
|
return keyPair;
|
|
3255
3251
|
}
|
|
3256
|
-
async function createKeyPairFromBytes(bytes, extractable) {
|
|
3252
|
+
async function createKeyPairFromBytes(bytes, extractable = false) {
|
|
3257
3253
|
assertPRNGIsAvailable();
|
|
3258
3254
|
if (bytes.byteLength !== 64) {
|
|
3259
3255
|
throw new SolanaError(SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH, { byteLength: bytes.byteLength });
|
|
@@ -3308,7 +3304,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3308
3304
|
if (!isSolanaError(error, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM)) {
|
|
3309
3305
|
return false;
|
|
3310
3306
|
}
|
|
3311
|
-
const instructionProgramAddress = (_a = transactionMessage.instructions[error.context.index]) == null ?
|
|
3307
|
+
const instructionProgramAddress = (_a = transactionMessage.instructions[error.context.index]) == null ? void 0 : _a.programAddress;
|
|
3312
3308
|
if (!instructionProgramAddress || instructionProgramAddress !== programAddress) {
|
|
3313
3309
|
return false;
|
|
3314
3310
|
}
|
|
@@ -3339,7 +3335,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3339
3335
|
}
|
|
3340
3336
|
if (!inQuote) {
|
|
3341
3337
|
const consumedNumber = consumeNumber(json, ii);
|
|
3342
|
-
if (consumedNumber == null ?
|
|
3338
|
+
if (consumedNumber == null ? void 0 : consumedNumber.length) {
|
|
3343
3339
|
ii += consumedNumber.length - 1;
|
|
3344
3340
|
if (consumedNumber.match(/\.|[eE]-/)) {
|
|
3345
3341
|
out.push(consumedNumber);
|
|
@@ -3356,7 +3352,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3356
3352
|
function consumeNumber(json, ii) {
|
|
3357
3353
|
var _a;
|
|
3358
3354
|
const JSON_NUMBER_REGEX = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/;
|
|
3359
|
-
if (!((_a = json[ii]) == null ?
|
|
3355
|
+
if (!((_a = json[ii]) == null ? void 0 : _a.match(/[-\d]/))) {
|
|
3360
3356
|
return null;
|
|
3361
3357
|
}
|
|
3362
3358
|
const numberMatch = json.slice(ii).match(JSON_NUMBER_REGEX);
|
|
@@ -3432,7 +3428,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3432
3428
|
function createPendingRpcRequest({ transport }, plan) {
|
|
3433
3429
|
return {
|
|
3434
3430
|
async send(options) {
|
|
3435
|
-
return await plan.execute({ signal: options == null ?
|
|
3431
|
+
return await plan.execute({ signal: options == null ? void 0 : options.abortSignal, transport });
|
|
3436
3432
|
}
|
|
3437
3433
|
};
|
|
3438
3434
|
}
|
|
@@ -3449,12 +3445,12 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3449
3445
|
const methodName = p.toString();
|
|
3450
3446
|
return function(...rawParams) {
|
|
3451
3447
|
const rawRequest = Object.freeze({ methodName, params: rawParams });
|
|
3452
|
-
const request = (config == null ?
|
|
3448
|
+
const request = (config == null ? void 0 : config.requestTransformer) ? config == null ? void 0 : config.requestTransformer(rawRequest) : rawRequest;
|
|
3453
3449
|
return Object.freeze({
|
|
3454
3450
|
execute: async ({ signal, transport }) => {
|
|
3455
3451
|
const payload = createRpcMessage(request);
|
|
3456
3452
|
const response = await transport({ payload, signal });
|
|
3457
|
-
if (!(config == null ?
|
|
3453
|
+
if (!(config == null ? void 0 : config.responseTransformer)) {
|
|
3458
3454
|
return response;
|
|
3459
3455
|
}
|
|
3460
3456
|
return config.responseTransformer(response, request);
|
|
@@ -3557,7 +3553,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3557
3553
|
const paramInTargetPosition = params[optionsObjectPositionInParams];
|
|
3558
3554
|
if (
|
|
3559
3555
|
// There's no config.
|
|
3560
|
-
paramInTargetPosition ===
|
|
3556
|
+
paramInTargetPosition === void 0 || // There is a config object.
|
|
3561
3557
|
paramInTargetPosition && typeof paramInTargetPosition === "object" && !Array.isArray(paramInTargetPosition)
|
|
3562
3558
|
) {
|
|
3563
3559
|
if (
|
|
@@ -3577,7 +3573,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3577
3573
|
if (optionsObjectPositionInParams === nextParams.length - 1) {
|
|
3578
3574
|
nextParams.length--;
|
|
3579
3575
|
} else {
|
|
3580
|
-
nextParams[optionsObjectPositionInParams] =
|
|
3576
|
+
nextParams[optionsObjectPositionInParams] = void 0;
|
|
3581
3577
|
}
|
|
3582
3578
|
}
|
|
3583
3579
|
return nextParams;
|
|
@@ -3654,14 +3650,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3654
3650
|
simulateTransaction: 1
|
|
3655
3651
|
};
|
|
3656
3652
|
function getDefaultRequestTransformerForSolanaRpc(config) {
|
|
3657
|
-
const handleIntegerOverflow = config == null ?
|
|
3653
|
+
const handleIntegerOverflow = config == null ? void 0 : config.onIntegerOverflow;
|
|
3658
3654
|
return (request) => {
|
|
3659
3655
|
return pipe(
|
|
3660
3656
|
request,
|
|
3661
3657
|
handleIntegerOverflow ? getIntegerOverflowRequestTransformer(handleIntegerOverflow) : (r) => r,
|
|
3662
3658
|
getBigIntDowncastRequestTransformer(),
|
|
3663
3659
|
getDefaultCommitmentRequestTransformer({
|
|
3664
|
-
defaultCommitment: config == null ?
|
|
3660
|
+
defaultCommitment: config == null ? void 0 : config.defaultCommitment,
|
|
3665
3661
|
optionsObjectPositionByMethod: OPTIONS_OBJECT_POSITION_BY_METHOD
|
|
3666
3662
|
})
|
|
3667
3663
|
);
|
|
@@ -3711,7 +3707,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3711
3707
|
function getDefaultResponseTransformerForSolanaRpc(config) {
|
|
3712
3708
|
return (response, request) => {
|
|
3713
3709
|
const methodName = request.methodName;
|
|
3714
|
-
const keyPaths = (config == null ?
|
|
3710
|
+
const keyPaths = (config == null ? void 0 : config.allowedNumericKeyPaths) && methodName ? config.allowedNumericKeyPaths[methodName] : void 0;
|
|
3715
3711
|
return pipe(
|
|
3716
3712
|
response,
|
|
3717
3713
|
(r) => getThrowSolanaErrorResponseTransformer()(r, request),
|
|
@@ -3723,7 +3719,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3723
3719
|
function getDefaultResponseTransformerForSolanaRpcSubscriptions(config) {
|
|
3724
3720
|
return (response, request) => {
|
|
3725
3721
|
const methodName = request.methodName;
|
|
3726
|
-
const keyPaths = (config == null ?
|
|
3722
|
+
const keyPaths = (config == null ? void 0 : config.allowedNumericKeyPaths) && methodName ? config.allowedNumericKeyPaths[methodName] : void 0;
|
|
3727
3723
|
return pipe(response, (r) => getBigIntUpcastResponseTransformer(keyPaths != null ? keyPaths : [])(r, request));
|
|
3728
3724
|
};
|
|
3729
3725
|
}
|
|
@@ -4097,7 +4093,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4097
4093
|
while (i < max) {
|
|
4098
4094
|
key = keys[i];
|
|
4099
4095
|
propVal = stringify(val[key], false);
|
|
4100
|
-
if (propVal !==
|
|
4096
|
+
if (propVal !== void 0) {
|
|
4101
4097
|
if (str) {
|
|
4102
4098
|
str += ",";
|
|
4103
4099
|
}
|
|
@@ -4112,7 +4108,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4112
4108
|
}
|
|
4113
4109
|
case "function":
|
|
4114
4110
|
case "undefined":
|
|
4115
|
-
return isArrayProp ? null :
|
|
4111
|
+
return isArrayProp ? null : void 0;
|
|
4116
4112
|
case "bigint":
|
|
4117
4113
|
return `${val.toString()}n`;
|
|
4118
4114
|
case "string":
|
|
@@ -4123,7 +4119,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4123
4119
|
}
|
|
4124
4120
|
function index_default(val) {
|
|
4125
4121
|
const returnVal = stringify(val, false);
|
|
4126
|
-
if (returnVal !==
|
|
4122
|
+
if (returnVal !== void 0) {
|
|
4127
4123
|
return "" + returnVal;
|
|
4128
4124
|
}
|
|
4129
4125
|
}
|
|
@@ -4147,14 +4143,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4147
4143
|
} else {
|
|
4148
4144
|
argumentLabel = `\`${keyPath[0].toString()}\``;
|
|
4149
4145
|
}
|
|
4150
|
-
const path = keyPath.length > 1 ? keyPath.slice(1).map((pathPart) => typeof pathPart === "number" ? `[${pathPart}]` : pathPart).join(".") :
|
|
4146
|
+
const path = keyPath.length > 1 ? keyPath.slice(1).map((pathPart) => typeof pathPart === "number" ? `[${pathPart}]` : pathPart).join(".") : void 0;
|
|
4151
4147
|
const error = new SolanaError(SOLANA_ERROR__RPC__INTEGER_OVERFLOW, {
|
|
4152
4148
|
argumentLabel,
|
|
4153
4149
|
keyPath,
|
|
4154
4150
|
methodName,
|
|
4155
4151
|
optionalPathLabel: path ? ` at path \`${path}\`` : "",
|
|
4156
4152
|
value,
|
|
4157
|
-
...path !==
|
|
4153
|
+
...path !== void 0 ? { path } : void 0
|
|
4158
4154
|
});
|
|
4159
4155
|
safeCaptureStackTrace(error, createSolanaJsonRpcIntegerOverflowError);
|
|
4160
4156
|
return error;
|
|
@@ -4177,12 +4173,12 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4177
4173
|
return async function makeCoalescedHttpRequest(request) {
|
|
4178
4174
|
const { payload, signal } = request;
|
|
4179
4175
|
const deduplicationKey = getDeduplicationKey(payload);
|
|
4180
|
-
if (deduplicationKey ===
|
|
4176
|
+
if (deduplicationKey === void 0) {
|
|
4181
4177
|
return await transport(request);
|
|
4182
4178
|
}
|
|
4183
4179
|
if (!coalescedRequestsByDeduplicationKey) {
|
|
4184
4180
|
queueMicrotask(() => {
|
|
4185
|
-
coalescedRequestsByDeduplicationKey =
|
|
4181
|
+
coalescedRequestsByDeduplicationKey = void 0;
|
|
4186
4182
|
});
|
|
4187
4183
|
coalescedRequestsByDeduplicationKey = {};
|
|
4188
4184
|
}
|
|
@@ -4234,7 +4230,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4234
4230
|
};
|
|
4235
4231
|
}
|
|
4236
4232
|
function getSolanaRpcPayloadDeduplicationKey(payload) {
|
|
4237
|
-
return isJsonRpcPayload(payload) ? index_default([payload.method, payload.params]) :
|
|
4233
|
+
return isJsonRpcPayload(payload) ? index_default([payload.method, payload.params]) : void 0;
|
|
4238
4234
|
}
|
|
4239
4235
|
function normalizeHeaders2(headers) {
|
|
4240
4236
|
const out = {};
|
|
@@ -4249,10 +4245,10 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4249
4245
|
...config,
|
|
4250
4246
|
headers: {
|
|
4251
4247
|
...false,
|
|
4252
|
-
...config.headers ? normalizeHeaders2(config.headers) :
|
|
4248
|
+
...config.headers ? normalizeHeaders2(config.headers) : void 0,
|
|
4253
4249
|
...{
|
|
4254
4250
|
// Keep these headers lowercase so they will override any user-supplied headers above.
|
|
4255
|
-
"solana-client": `js/${"2.1.
|
|
4251
|
+
"solana-client": `js/${"2.1.1-canary-20250310215239"}`
|
|
4256
4252
|
}
|
|
4257
4253
|
}
|
|
4258
4254
|
}),
|
|
@@ -4441,15 +4437,15 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4441
4437
|
return;
|
|
4442
4438
|
}
|
|
4443
4439
|
isActive = false;
|
|
4444
|
-
options == null ?
|
|
4440
|
+
options == null ? void 0 : options.signal.removeEventListener("abort", handleUnsubscribe);
|
|
4445
4441
|
innerPublisherState.numSubscribers--;
|
|
4446
4442
|
if (innerPublisherState.numSubscribers === 0) {
|
|
4447
4443
|
innerPublisherState.dispose();
|
|
4448
|
-
innerPublisherState =
|
|
4444
|
+
innerPublisherState = void 0;
|
|
4449
4445
|
}
|
|
4450
4446
|
unsubscribe();
|
|
4451
4447
|
}
|
|
4452
|
-
options == null ?
|
|
4448
|
+
options == null ? void 0 : options.signal.addEventListener("abort", handleUnsubscribe);
|
|
4453
4449
|
return handleUnsubscribe;
|
|
4454
4450
|
}
|
|
4455
4451
|
};
|
|
@@ -4491,7 +4487,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4491
4487
|
continue;
|
|
4492
4488
|
}
|
|
4493
4489
|
let record = wm.get(contender);
|
|
4494
|
-
if (record ===
|
|
4490
|
+
if (record === void 0) {
|
|
4495
4491
|
record = addRaceContender(contender);
|
|
4496
4492
|
record.deferreds.add(deferred);
|
|
4497
4493
|
wm.set(contender, record);
|
|
@@ -4610,7 +4606,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4610
4606
|
augmentSubscriberCountAndReturnNewCount(1, channel, subscriptionId);
|
|
4611
4607
|
}
|
|
4612
4608
|
function augmentSubscriberCountAndReturnNewCount(amount, channel, subscriptionId) {
|
|
4613
|
-
if (subscriptionId ===
|
|
4609
|
+
if (subscriptionId === void 0) {
|
|
4614
4610
|
return;
|
|
4615
4611
|
}
|
|
4616
4612
|
let subscriberCountBySubscriptionId = subscriberCountBySubscriptionIdByChannel.get(channel);
|
|
@@ -4620,7 +4616,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4620
4616
|
subscriberCountBySubscriptionId = { [subscriptionId]: 0 }
|
|
4621
4617
|
);
|
|
4622
4618
|
}
|
|
4623
|
-
if ((subscriberCountBySubscriptionId == null ?
|
|
4619
|
+
if ((subscriberCountBySubscriptionId == null ? void 0 : subscriberCountBySubscriptionId[subscriptionId]) !== void 0) {
|
|
4624
4620
|
return subscriberCountBySubscriptionId[subscriptionId] = amount + subscriberCountBySubscriptionId[subscriptionId];
|
|
4625
4621
|
}
|
|
4626
4622
|
}
|
|
@@ -4658,7 +4654,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4658
4654
|
channel.on(
|
|
4659
4655
|
"error",
|
|
4660
4656
|
() => {
|
|
4661
|
-
subscriptionId =
|
|
4657
|
+
subscriptionId = void 0;
|
|
4662
4658
|
subscriberCountBySubscriptionIdByChannel.delete(channel);
|
|
4663
4659
|
},
|
|
4664
4660
|
{ signal }
|
|
@@ -4670,7 +4666,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4670
4666
|
methodName: unsubscribeMethodName,
|
|
4671
4667
|
params: [subscriptionId]
|
|
4672
4668
|
});
|
|
4673
|
-
subscriptionId =
|
|
4669
|
+
subscriptionId = void 0;
|
|
4674
4670
|
channel.send(unsubscribePayload).catch(() => {
|
|
4675
4671
|
});
|
|
4676
4672
|
}
|
|
@@ -4977,7 +4973,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4977
4973
|
}
|
|
4978
4974
|
function handleClose(ev) {
|
|
4979
4975
|
cleanupListeners();
|
|
4980
|
-
bufferDrainWatcher == null ?
|
|
4976
|
+
bufferDrainWatcher == null ? void 0 : bufferDrainWatcher.onCancel();
|
|
4981
4977
|
signal.removeEventListener("abort", handleAbort);
|
|
4982
4978
|
webSocket.removeEventListener("close", handleClose);
|
|
4983
4979
|
webSocket.removeEventListener("error", handleError);
|
|
@@ -5031,12 +5027,12 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5031
5027
|
const intervalId = setInterval(() => {
|
|
5032
5028
|
if (webSocket.readyState !== e2.OPEN || !(webSocket.bufferedAmount > sendBufferHighWatermark)) {
|
|
5033
5029
|
clearInterval(intervalId);
|
|
5034
|
-
bufferDrainWatcher =
|
|
5030
|
+
bufferDrainWatcher = void 0;
|
|
5035
5031
|
resolve();
|
|
5036
5032
|
}
|
|
5037
5033
|
}, 16);
|
|
5038
5034
|
onCancel = () => {
|
|
5039
|
-
bufferDrainWatcher =
|
|
5035
|
+
bufferDrainWatcher = void 0;
|
|
5040
5036
|
clearInterval(intervalId);
|
|
5041
5037
|
reject(
|
|
5042
5038
|
new SolanaError(
|
|
@@ -5094,14 +5090,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5094
5090
|
} else {
|
|
5095
5091
|
argumentLabel = `\`${keyPath[0].toString()}\``;
|
|
5096
5092
|
}
|
|
5097
|
-
const path = keyPath.length > 1 ? keyPath.slice(1).map((pathPart) => typeof pathPart === "number" ? `[${pathPart}]` : pathPart).join(".") :
|
|
5093
|
+
const path = keyPath.length > 1 ? keyPath.slice(1).map((pathPart) => typeof pathPart === "number" ? `[${pathPart}]` : pathPart).join(".") : void 0;
|
|
5098
5094
|
const error = new SolanaError(SOLANA_ERROR__RPC__INTEGER_OVERFLOW, {
|
|
5099
5095
|
argumentLabel,
|
|
5100
5096
|
keyPath,
|
|
5101
5097
|
methodName,
|
|
5102
5098
|
optionalPathLabel: path ? ` at path \`${path}\`` : "",
|
|
5103
5099
|
value,
|
|
5104
|
-
...path !==
|
|
5100
|
+
...path !== void 0 ? { path } : void 0
|
|
5105
5101
|
});
|
|
5106
5102
|
safeCaptureStackTrace(error, createSolanaJsonRpcIntegerOverflowError2);
|
|
5107
5103
|
return error;
|
|
@@ -5210,7 +5206,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5210
5206
|
};
|
|
5211
5207
|
}
|
|
5212
5208
|
}
|
|
5213
|
-
pool.freeChannelIndex = (_a = mostFreeChannel == null ?
|
|
5209
|
+
pool.freeChannelIndex = (_a = mostFreeChannel == null ? void 0 : mostFreeChannel.poolIndex) != null ? _a : -1;
|
|
5214
5210
|
}
|
|
5215
5211
|
return function getExistingChannelWithMostCapacityOrCreateChannel({ abortSignal }) {
|
|
5216
5212
|
let poolEntry;
|
|
@@ -5772,7 +5768,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5772
5768
|
// Convert an instruction to have all fields defined
|
|
5773
5769
|
(instruction) => {
|
|
5774
5770
|
var _a, _b;
|
|
5775
|
-
if (instruction.accountIndices !==
|
|
5771
|
+
if (instruction.accountIndices !== void 0 && instruction.data !== void 0) {
|
|
5776
5772
|
return instruction;
|
|
5777
5773
|
}
|
|
5778
5774
|
return {
|
|
@@ -5917,7 +5913,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5917
5913
|
return transformDecoder(
|
|
5918
5914
|
getStructDecoder(getPreludeStructDecoderTuple()),
|
|
5919
5915
|
({ addressTableLookups, ...restOfMessage }) => {
|
|
5920
|
-
if (restOfMessage.version === "legacy" || !(addressTableLookups == null ?
|
|
5916
|
+
if (restOfMessage.version === "legacy" || !(addressTableLookups == null ? void 0 : addressTableLookups.length)) {
|
|
5921
5917
|
return restOfMessage;
|
|
5922
5918
|
}
|
|
5923
5919
|
return { ...restOfMessage, addressTableLookups };
|
|
@@ -6269,7 +6265,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6269
6265
|
var _a;
|
|
6270
6266
|
return instruction.programAddress === SYSTEM_PROGRAM_ADDRESS && // Test for `AdvanceNonceAccount` instruction data
|
|
6271
6267
|
instruction.data != null && isAdvanceNonceAccountInstructionData(instruction.data) && // Test for exactly 3 accounts
|
|
6272
|
-
((_a = instruction.accounts) == null ?
|
|
6268
|
+
((_a = instruction.accounts) == null ? void 0 : _a.length) === 3 && // First account is nonce account address
|
|
6273
6269
|
instruction.accounts[0].address != null && instruction.accounts[0].role === AccountRole.WRITABLE && // Second account is recent blockhashes sysvar
|
|
6274
6270
|
instruction.accounts[1].address === RECENT_BLOCKHASHES_SYSVAR_ADDRESS && instruction.accounts[1].role === AccountRole.READONLY && // Third account is nonce authority account
|
|
6275
6271
|
instruction.accounts[2].address != null && isSignerRole(instruction.accounts[2].role);
|
|
@@ -6319,7 +6315,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6319
6315
|
}
|
|
6320
6316
|
function setTransactionMessageFeePayer(feePayer, transactionMessage) {
|
|
6321
6317
|
var _a;
|
|
6322
|
-
if ("feePayer" in transactionMessage && feePayer === ((_a = transactionMessage.feePayer) == null ?
|
|
6318
|
+
if ("feePayer" in transactionMessage && feePayer === ((_a = transactionMessage.feePayer) == null ? void 0 : _a.address) && isAddressOnlyFeePayer(transactionMessage.feePayer)) {
|
|
6323
6319
|
return transactionMessage;
|
|
6324
6320
|
}
|
|
6325
6321
|
const out = {
|
|
@@ -6388,7 +6384,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6388
6384
|
}
|
|
6389
6385
|
function getAddressLookupMetas(compiledAddressTableLookups, addressesByLookupTableAddress) {
|
|
6390
6386
|
const compiledAddressTableLookupAddresses = compiledAddressTableLookups.map((l) => l.lookupTableAddress);
|
|
6391
|
-
const missing = compiledAddressTableLookupAddresses.filter((a) => addressesByLookupTableAddress[a] ===
|
|
6387
|
+
const missing = compiledAddressTableLookupAddresses.filter((a) => addressesByLookupTableAddress[a] === void 0);
|
|
6392
6388
|
if (missing.length > 0) {
|
|
6393
6389
|
throw new SolanaError(SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING, {
|
|
6394
6390
|
lookupTableAddresses: missing
|
|
@@ -6428,13 +6424,13 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6428
6424
|
}
|
|
6429
6425
|
function convertInstruction(instruction, accountMetas) {
|
|
6430
6426
|
var _a, _b;
|
|
6431
|
-
const programAddress = (_a = accountMetas[instruction.programAddressIndex]) == null ?
|
|
6427
|
+
const programAddress = (_a = accountMetas[instruction.programAddressIndex]) == null ? void 0 : _a.address;
|
|
6432
6428
|
if (!programAddress) {
|
|
6433
6429
|
throw new SolanaError(SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND, {
|
|
6434
6430
|
index: instruction.programAddressIndex
|
|
6435
6431
|
});
|
|
6436
6432
|
}
|
|
6437
|
-
const accounts = (_b = instruction.accountIndices) == null ?
|
|
6433
|
+
const accounts = (_b = instruction.accountIndices) == null ? void 0 : _b.map((accountIndex) => accountMetas[accountIndex]);
|
|
6438
6434
|
const { data } = instruction;
|
|
6439
6435
|
return Object.freeze({
|
|
6440
6436
|
programAddress,
|
|
@@ -6468,9 +6464,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6468
6464
|
throw new SolanaError(SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING);
|
|
6469
6465
|
}
|
|
6470
6466
|
const accountMetas = getAccountMetas(compiledTransactionMessage);
|
|
6471
|
-
const accountLookupMetas = "addressTableLookups" in compiledTransactionMessage && compiledTransactionMessage.addressTableLookups !==
|
|
6467
|
+
const accountLookupMetas = "addressTableLookups" in compiledTransactionMessage && compiledTransactionMessage.addressTableLookups !== void 0 && compiledTransactionMessage.addressTableLookups.length > 0 ? getAddressLookupMetas(
|
|
6472
6468
|
compiledTransactionMessage.addressTableLookups,
|
|
6473
|
-
(_a = config == null ?
|
|
6469
|
+
(_a = config == null ? void 0 : config.addressesByLookupTableAddress) != null ? _a : {}
|
|
6474
6470
|
) : [];
|
|
6475
6471
|
const transactionMetas = [...accountMetas, ...accountLookupMetas];
|
|
6476
6472
|
const instructions = compiledTransactionMessage.instructions.map(
|
|
@@ -6480,7 +6476,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6480
6476
|
const lifetimeConstraint = getLifetimeConstraint(
|
|
6481
6477
|
compiledTransactionMessage.lifetimeToken,
|
|
6482
6478
|
firstInstruction,
|
|
6483
|
-
config == null ?
|
|
6479
|
+
config == null ? void 0 : config.lastValidBlockHeight
|
|
6484
6480
|
);
|
|
6485
6481
|
return pipe(
|
|
6486
6482
|
createTransactionMessage({ version: compiledTransactionMessage.version }),
|
|
@@ -6610,7 +6606,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6610
6606
|
keyPairs.map(async (keyPair) => {
|
|
6611
6607
|
const address2 = await getAddressFromPublicKey(keyPair.publicKey);
|
|
6612
6608
|
const existingSignature = transaction.signatures[address2];
|
|
6613
|
-
if (existingSignature ===
|
|
6609
|
+
if (existingSignature === void 0) {
|
|
6614
6610
|
unexpectedSigners || (unexpectedSigners = /* @__PURE__ */ new Set());
|
|
6615
6611
|
unexpectedSigners.add(address2);
|
|
6616
6612
|
return;
|
|
@@ -6751,7 +6747,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6751
6747
|
});
|
|
6752
6748
|
}
|
|
6753
6749
|
function addSignersToTransactionMessage(signers, transactionMessage) {
|
|
6754
|
-
const feePayerSigner = hasAddressOnlyFeePayer(transactionMessage) ? signers.find((signer) => signer.address === transactionMessage.feePayer.address) :
|
|
6750
|
+
const feePayerSigner = hasAddressOnlyFeePayer(transactionMessage) ? signers.find((signer) => signer.address === transactionMessage.feePayer.address) : void 0;
|
|
6755
6751
|
if (!feePayerSigner && transactionMessage.instructions.length === 0) {
|
|
6756
6752
|
return transactionMessage;
|
|
6757
6753
|
}
|
|
@@ -6886,11 +6882,11 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6886
6882
|
}
|
|
6887
6883
|
async function signAndSendTransactionMessageWithSigners(transaction, config) {
|
|
6888
6884
|
assertIsTransactionMessageWithSingleSendingSigner(transaction);
|
|
6889
|
-
const abortSignal = config == null ?
|
|
6885
|
+
const abortSignal = config == null ? void 0 : config.abortSignal;
|
|
6890
6886
|
const { partialSigners, modifyingSigners, sendingSigner } = categorizeTransactionSigners(
|
|
6891
6887
|
deduplicateSigners(getSignersFromTransactionMessage(transaction).filter(isTransactionSigner))
|
|
6892
6888
|
);
|
|
6893
|
-
abortSignal == null ?
|
|
6889
|
+
abortSignal == null ? void 0 : abortSignal.throwIfAborted();
|
|
6894
6890
|
const signedTransaction = await signModifyingAndPartialTransactionSigners(
|
|
6895
6891
|
transaction,
|
|
6896
6892
|
modifyingSigners,
|
|
@@ -6900,9 +6896,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6900
6896
|
if (!sendingSigner) {
|
|
6901
6897
|
throw new SolanaError(SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING);
|
|
6902
6898
|
}
|
|
6903
|
-
abortSignal == null ?
|
|
6899
|
+
abortSignal == null ? void 0 : abortSignal.throwIfAborted();
|
|
6904
6900
|
const [signature2] = await sendingSigner.signAndSendTransactions([signedTransaction], config);
|
|
6905
|
-
abortSignal == null ?
|
|
6901
|
+
abortSignal == null ? void 0 : abortSignal.throwIfAborted();
|
|
6906
6902
|
return signature2;
|
|
6907
6903
|
}
|
|
6908
6904
|
function categorizeTransactionSigners(signers, config = {}) {
|
|
@@ -6940,13 +6936,13 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6940
6936
|
const modifiedTransaction = await modifyingSigners.reduce(
|
|
6941
6937
|
async (transaction2, modifyingSigner) => {
|
|
6942
6938
|
var _a2;
|
|
6943
|
-
(_a2 = config == null ?
|
|
6939
|
+
(_a2 = config == null ? void 0 : config.abortSignal) == null ? void 0 : _a2.throwIfAborted();
|
|
6944
6940
|
const [tx] = await modifyingSigner.modifyAndSignTransactions([await transaction2], config);
|
|
6945
6941
|
return Object.freeze(tx);
|
|
6946
6942
|
},
|
|
6947
6943
|
Promise.resolve(transaction)
|
|
6948
6944
|
);
|
|
6949
|
-
(_a = config == null ?
|
|
6945
|
+
(_a = config == null ? void 0 : config.abortSignal) == null ? void 0 : _a.throwIfAborted();
|
|
6950
6946
|
const signatureDictionaries = await Promise.all(
|
|
6951
6947
|
partialSigners.map(async (partialSigner) => {
|
|
6952
6948
|
const [signatures] = await partialSigner.signTransactions([modifiedTransaction], config);
|
|
@@ -7164,7 +7160,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7164
7160
|
}
|
|
7165
7161
|
async function raceStrategies(signature2, config, getSpecificStrategiesForRace) {
|
|
7166
7162
|
const { abortSignal: callerAbortSignal, commitment, getRecentSignatureConfirmationPromise } = config;
|
|
7167
|
-
callerAbortSignal == null ?
|
|
7163
|
+
callerAbortSignal == null ? void 0 : callerAbortSignal.throwIfAborted();
|
|
7168
7164
|
const abortController = new o7();
|
|
7169
7165
|
if (callerAbortSignal) {
|
|
7170
7166
|
const handleAbort = () => {
|
|
@@ -7407,7 +7403,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7407
7403
|
|
|
7408
7404
|
// src/decompile-transaction-message-fetching-lookup-tables.ts
|
|
7409
7405
|
async function decompileTransactionMessageFetchingLookupTables(compiledTransactionMessage, rpc, config) {
|
|
7410
|
-
const lookupTables = "addressTableLookups" in compiledTransactionMessage && compiledTransactionMessage.addressTableLookups !==
|
|
7406
|
+
const lookupTables = "addressTableLookups" in compiledTransactionMessage && compiledTransactionMessage.addressTableLookups !== void 0 && compiledTransactionMessage.addressTableLookups.length > 0 ? compiledTransactionMessage.addressTableLookups : [];
|
|
7411
7407
|
const lookupTableAddresses = lookupTables.map((l) => l.lookupTableAddress);
|
|
7412
7408
|
const { lastValidBlockHeight, ...fetchAccountsConfig } = config != null ? config : {};
|
|
7413
7409
|
const addressesByLookupTableAddress = lookupTableAddresses.length > 0 ? await fetchAddressesForLookupTables(lookupTableAddresses, rpc, fetchAccountsConfig) : {};
|
|
@@ -7421,7 +7417,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7421
7417
|
function getSendTransactionConfigWithAdjustedPreflightCommitment(commitment, config) {
|
|
7422
7418
|
if (
|
|
7423
7419
|
// The developer has supplied no value for `preflightCommitment`.
|
|
7424
|
-
!(config == null ?
|
|
7420
|
+
!(config == null ? void 0 : config.preflightCommitment) && // The value of `commitment` is lower than the server default of `preflightCommitment`.
|
|
7425
7421
|
commitmentComparator(
|
|
7426
7422
|
commitment,
|
|
7427
7423
|
"finalized"
|