@shunt-network/sdk 1.0.0
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/clients/typescript/src/__tests__/instruction-parsers.test.d.ts +1 -0
- package/dist/clients/typescript/src/__tests__/voucher-numeric-safety.test.d.ts +1 -0
- package/dist/clients/typescript/src/__tests__/voucher-types.test-d.d.ts +1 -0
- package/dist/clients/typescript/src/generated/accounts/channel.d.ts +59 -0
- package/dist/clients/typescript/src/generated/accounts/index.d.ts +8 -0
- package/dist/clients/typescript/src/generated/errors/index.d.ts +8 -0
- package/dist/clients/typescript/src/generated/errors/paymentChannels.d.ts +84 -0
- package/dist/clients/typescript/src/generated/index.d.ts +13 -0
- package/dist/clients/typescript/src/generated/instructions/distribute.d.ts +90 -0
- package/dist/clients/typescript/src/generated/instructions/emitEvent.d.ts +42 -0
- package/dist/clients/typescript/src/generated/instructions/index.d.ts +17 -0
- package/dist/clients/typescript/src/generated/instructions/open.d.ts +100 -0
- package/dist/clients/typescript/src/generated/instructions/reclaim.d.ts +39 -0
- package/dist/clients/typescript/src/generated/instructions/requestClose.d.ts +39 -0
- package/dist/clients/typescript/src/generated/instructions/seal.d.ts +36 -0
- package/dist/clients/typescript/src/generated/instructions/settle.d.ts +39 -0
- package/dist/clients/typescript/src/generated/instructions/settleAndSeal.d.ts +47 -0
- package/dist/clients/typescript/src/generated/instructions/topUp.d.ts +56 -0
- package/dist/clients/typescript/src/generated/instructions/withdrawPayer.d.ts +51 -0
- package/dist/clients/typescript/src/generated/pdas/eventAuthority.d.ts +11 -0
- package/dist/clients/typescript/src/generated/pdas/index.d.ts +8 -0
- package/dist/clients/typescript/src/generated/programs/index.d.ts +8 -0
- package/dist/clients/typescript/src/generated/programs/paymentChannels.d.ts +80 -0
- package/dist/clients/typescript/src/generated/types/accountDiscriminator.d.ts +16 -0
- package/dist/clients/typescript/src/generated/types/channelStatus.d.ts +18 -0
- package/dist/clients/typescript/src/generated/types/distributeArgs.d.ts +18 -0
- package/dist/clients/typescript/src/generated/types/distributionEntry.d.ts +16 -0
- package/dist/clients/typescript/src/generated/types/index.d.ts +20 -0
- package/dist/clients/typescript/src/generated/types/openArgs.d.ts +26 -0
- package/dist/clients/typescript/src/generated/types/opened.d.ts +19 -0
- package/dist/clients/typescript/src/generated/types/payoutBeneficiary.d.ts +17 -0
- package/dist/clients/typescript/src/generated/types/payoutRedirected.d.ts +26 -0
- package/dist/clients/typescript/src/generated/types/redirectReason.d.ts +18 -0
- package/dist/clients/typescript/src/generated/types/settleAndSealArgs.d.ts +15 -0
- package/dist/clients/typescript/src/generated/types/settlementWatermarks.d.ts +19 -0
- package/dist/clients/typescript/src/generated/types/topUpArgs.d.ts +17 -0
- package/dist/clients/typescript/src/generated/types/voucherArgs.d.ts +23 -0
- package/dist/clients/typescript/src/index.d.ts +1 -0
- package/dist/clients/typescript/src/safe-codecs.d.ts +6 -0
- package/dist/clients/typescript/tsup.config.d.ts +2 -0
- package/dist/index.cjs +1399 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1549 -0
- package/dist/sdk/channel.d.ts +10 -0
- package/dist/sdk/client.d.ts +31 -0
- package/dist/sdk/utils.d.ts +3 -0
- package/dist/sdk/voucher.d.ts +14 -0
- package/package.json +36 -0
- package/src/clients/typescript/package.json +32 -0
- package/src/clients/typescript/src/__tests__/instruction-parsers.test.ts +81 -0
- package/src/clients/typescript/src/__tests__/voucher-numeric-safety.test.ts +176 -0
- package/src/clients/typescript/src/__tests__/voucher-types.test-d.ts +8 -0
- package/src/clients/typescript/src/generated/accounts/channel.ts +192 -0
- package/src/clients/typescript/src/generated/accounts/index.ts +9 -0
- package/src/clients/typescript/src/generated/errors/index.ts +9 -0
- package/src/clients/typescript/src/generated/errors/paymentChannels.ts +251 -0
- package/src/clients/typescript/src/generated/index.ts +14 -0
- package/src/clients/typescript/src/generated/instructions/distribute.ts +517 -0
- package/src/clients/typescript/src/generated/instructions/emitEvent.ts +194 -0
- package/src/clients/typescript/src/generated/instructions/index.ts +18 -0
- package/src/clients/typescript/src/generated/instructions/open.ts +577 -0
- package/src/clients/typescript/src/generated/instructions/reclaim.ts +165 -0
- package/src/clients/typescript/src/generated/instructions/requestClose.ts +173 -0
- package/src/clients/typescript/src/generated/instructions/seal.ts +151 -0
- package/src/clients/typescript/src/generated/instructions/settle.ts +180 -0
- package/src/clients/typescript/src/generated/instructions/settleAndSeal.ts +224 -0
- package/src/clients/typescript/src/generated/instructions/topUp.ts +267 -0
- package/src/clients/typescript/src/generated/instructions/withdrawPayer.ts +246 -0
- package/src/clients/typescript/src/generated/pdas/eventAuthority.ts +26 -0
- package/src/clients/typescript/src/generated/pdas/index.ts +9 -0
- package/src/clients/typescript/src/generated/programs/index.ts +9 -0
- package/src/clients/typescript/src/generated/programs/paymentChannels.ts +366 -0
- package/src/clients/typescript/src/generated/types/accountDiscriminator.ts +41 -0
- package/src/clients/typescript/src/generated/types/channelStatus.ts +40 -0
- package/src/clients/typescript/src/generated/types/distributeArgs.ts +47 -0
- package/src/clients/typescript/src/generated/types/distributionEntry.ts +48 -0
- package/src/clients/typescript/src/generated/types/index.ts +21 -0
- package/src/clients/typescript/src/generated/types/openArgs.ts +70 -0
- package/src/clients/typescript/src/generated/types/opened.ts +42 -0
- package/src/clients/typescript/src/generated/types/payoutBeneficiary.ts +42 -0
- package/src/clients/typescript/src/generated/types/payoutRedirected.ts +76 -0
- package/src/clients/typescript/src/generated/types/redirectReason.ts +40 -0
- package/src/clients/typescript/src/generated/types/settleAndSealArgs.ts +39 -0
- package/src/clients/typescript/src/generated/types/settlementWatermarks.ts +48 -0
- package/src/clients/typescript/src/generated/types/topUpArgs.ts +33 -0
- package/src/clients/typescript/src/generated/types/voucherArgs.ts +68 -0
- package/src/clients/typescript/src/index.ts +1 -0
- package/src/clients/typescript/src/safe-codecs.ts +82 -0
- package/src/clients/typescript/tsconfig.json +11 -0
- package/src/clients/typescript/tsup.config.ts +9 -0
- package/src/index.ts +4 -0
- package/src/sdk/channel.ts +128 -0
- package/src/sdk/client.ts +22 -0
- package/src/sdk/utils.ts +29 -0
- package/src/sdk/voucher.ts +50 -0
- package/tsconfig.json +15 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1549 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
|
|
19
|
+
// src/sdk/utils.ts
|
|
20
|
+
import { pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, getBase64EncodedWireTransaction } from "@solana/kit";
|
|
21
|
+
async function sendInstructions(client, instructions) {
|
|
22
|
+
const { value: latestBlockhash } = await client.rpc.getLatestBlockhash().send();
|
|
23
|
+
const transactionMessage = pipe(
|
|
24
|
+
createTransactionMessage({ version: 0 }),
|
|
25
|
+
(tx) => setTransactionMessageFeePayerSigner(client.payer, tx),
|
|
26
|
+
(tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),
|
|
27
|
+
(tx) => appendTransactionMessageInstructions(instructions, tx)
|
|
28
|
+
);
|
|
29
|
+
const signedTransaction = await signTransactionMessageWithSigners(transactionMessage);
|
|
30
|
+
const transactionSignature = getSignatureFromTransaction(signedTransaction);
|
|
31
|
+
const base64WireTransaction = getBase64EncodedWireTransaction(signedTransaction);
|
|
32
|
+
await client.rpc.sendTransaction(base64WireTransaction, {
|
|
33
|
+
encoding: "base64"
|
|
34
|
+
}).send();
|
|
35
|
+
return transactionSignature;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/sdk/client.ts
|
|
39
|
+
import { createClient } from "@solana/kit";
|
|
40
|
+
import { solanaMainnetRpc, solanaDevnetRpc } from "@solana/kit-plugin-rpc";
|
|
41
|
+
import { signerFromFile } from "@solana/kit-plugin-signer";
|
|
42
|
+
import { systemProgram } from "@solana-program/system";
|
|
43
|
+
import { tokenProgram } from "@solana-program/token";
|
|
44
|
+
var devnet = true;
|
|
45
|
+
async function createShuntClient(signerFilePath) {
|
|
46
|
+
const rpc = devnet ? solanaDevnetRpc({ rpcUrl: "https://api.devnet.solana.com" }) : solanaMainnetRpc({ rpcUrl: "https://api.mainnet-beta.solana.com" });
|
|
47
|
+
const client = await createClient().use(signerFromFile(signerFilePath)).use(rpc).use(systemProgram()).use(tokenProgram());
|
|
48
|
+
return client;
|
|
49
|
+
}
|
|
50
|
+
var SHUNT_TREASURY = "4gNrRt7FKoetTTGbJuzp6WYtgqqmKLpjXybPqY3zbVCh";
|
|
51
|
+
|
|
52
|
+
// src/sdk/channel.ts
|
|
53
|
+
import { address, getAddressEncoder as getAddressEncoder6, getU64Encoder as getU64Encoder2, getProgramDerivedAddress as getProgramDerivedAddress2 } from "@solana/kit";
|
|
54
|
+
import { findAssociatedTokenPda, TOKEN_PROGRAM_ADDRESS, ASSOCIATED_TOKEN_PROGRAM_ADDRESS } from "@solana-program/token";
|
|
55
|
+
|
|
56
|
+
// src/clients/typescript/src/generated/instructions/open.ts
|
|
57
|
+
import {
|
|
58
|
+
combineCodec as combineCodec24,
|
|
59
|
+
getStructDecoder as getStructDecoder20,
|
|
60
|
+
getStructEncoder as getStructEncoder20,
|
|
61
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS11,
|
|
62
|
+
SolanaError as SolanaError12,
|
|
63
|
+
transformEncoder as transformEncoder10
|
|
64
|
+
} from "@solana/kit";
|
|
65
|
+
|
|
66
|
+
// node_modules/@solana/errors/dist/index.node.mjs
|
|
67
|
+
var SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED = 1;
|
|
68
|
+
var SOLANA_ERROR__INVALID_NONCE = 2;
|
|
69
|
+
var SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND = 3;
|
|
70
|
+
var SOLANA_ERROR__BLOCKHASH_STRING_LENGTH_OUT_OF_RANGE = 4;
|
|
71
|
+
var SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH = 5;
|
|
72
|
+
var SOLANA_ERROR__LAMPORTS_OUT_OF_RANGE = 6;
|
|
73
|
+
var SOLANA_ERROR__MALFORMED_BIGINT_STRING = 7;
|
|
74
|
+
var SOLANA_ERROR__MALFORMED_NUMBER_STRING = 8;
|
|
75
|
+
var SOLANA_ERROR__TIMESTAMP_OUT_OF_RANGE = 9;
|
|
76
|
+
var SOLANA_ERROR__MALFORMED_JSON_RPC_ERROR = 10;
|
|
77
|
+
var SOLANA_ERROR__FAILED_TO_SEND_TRANSACTION = 11;
|
|
78
|
+
var SOLANA_ERROR__FAILED_TO_SEND_TRANSACTIONS = 12;
|
|
79
|
+
var SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTION = 13;
|
|
80
|
+
var SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTIONS = 14;
|
|
81
|
+
var SOLANA_ERROR__JSON_RPC__PARSE_ERROR = -32700;
|
|
82
|
+
var SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR = -32603;
|
|
83
|
+
var SOLANA_ERROR__JSON_RPC__INVALID_PARAMS = -32602;
|
|
84
|
+
var SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND = -32601;
|
|
85
|
+
var SOLANA_ERROR__JSON_RPC__INVALID_REQUEST = -32600;
|
|
86
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SLOT_HISTORY = -32021;
|
|
87
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_FILTER_TRANSACTION_NOT_FOUND = -32020;
|
|
88
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_UNREACHABLE = -32019;
|
|
89
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_NOT_EPOCH_BOUNDARY = -32018;
|
|
90
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_EPOCH_REWARDS_PERIOD_ACTIVE = -32017;
|
|
91
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED = -32016;
|
|
92
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION = -32015;
|
|
93
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET = -32014;
|
|
94
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH = -32013;
|
|
95
|
+
var SOLANA_ERROR__JSON_RPC__SCAN_ERROR = -32012;
|
|
96
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE = -32011;
|
|
97
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX = -32010;
|
|
98
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED = -32009;
|
|
99
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT = -32008;
|
|
100
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED = -32007;
|
|
101
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE = -32006;
|
|
102
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY = -32005;
|
|
103
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE = -32004;
|
|
104
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE = -32003;
|
|
105
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE = -32002;
|
|
106
|
+
var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP = -32001;
|
|
107
|
+
var SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH = 28e5;
|
|
108
|
+
var SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE = 2800001;
|
|
109
|
+
var SOLANA_ERROR__ADDRESSES__INVALID_BASE58_ENCODED_ADDRESS = 2800002;
|
|
110
|
+
var SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY = 2800003;
|
|
111
|
+
var SOLANA_ERROR__ADDRESSES__MALFORMED_PDA = 2800004;
|
|
112
|
+
var SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE = 2800005;
|
|
113
|
+
var SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED = 2800006;
|
|
114
|
+
var SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED = 2800007;
|
|
115
|
+
var SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE = 2800008;
|
|
116
|
+
var SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED = 2800009;
|
|
117
|
+
var SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER = 2800010;
|
|
118
|
+
var SOLANA_ERROR__ADDRESSES__INVALID_OFF_CURVE_ADDRESS = 2800011;
|
|
119
|
+
var SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND = 323e4;
|
|
120
|
+
var SOLANA_ERROR__ACCOUNTS__ONE_OR_MORE_ACCOUNTS_NOT_FOUND = 32300001;
|
|
121
|
+
var SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT = 3230002;
|
|
122
|
+
var SOLANA_ERROR__ACCOUNTS__EXPECTED_DECODED_ACCOUNT = 3230003;
|
|
123
|
+
var SOLANA_ERROR__ACCOUNTS__EXPECTED_ALL_ACCOUNTS_TO_BE_DECODED = 3230004;
|
|
124
|
+
var SOLANA_ERROR__SUBTLE_CRYPTO__DISALLOWED_IN_INSECURE_CONTEXT = 361e4;
|
|
125
|
+
var SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED = 3610001;
|
|
126
|
+
var SOLANA_ERROR__SUBTLE_CRYPTO__ED25519_ALGORITHM_UNIMPLEMENTED = 3610002;
|
|
127
|
+
var SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED = 3610003;
|
|
128
|
+
var SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED = 3610004;
|
|
129
|
+
var SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED = 3610005;
|
|
130
|
+
var SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED = 3610006;
|
|
131
|
+
var SOLANA_ERROR__SUBTLE_CRYPTO__CANNOT_EXPORT_NON_EXTRACTABLE_KEY = 3610007;
|
|
132
|
+
var SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED = 3611e3;
|
|
133
|
+
var SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH = 3704e3;
|
|
134
|
+
var SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH = 3704001;
|
|
135
|
+
var SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH = 3704002;
|
|
136
|
+
var SOLANA_ERROR__KEYS__SIGNATURE_STRING_LENGTH_OUT_OF_RANGE = 3704003;
|
|
137
|
+
var SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY = 3704004;
|
|
138
|
+
var SOLANA_ERROR__KEYS__INVALID_BASE58_IN_GRIND_REGEX = 3704005;
|
|
139
|
+
var SOLANA_ERROR__KEYS__WRITE_KEY_PAIR_UNSUPPORTED_ENVIRONMENT = 3704006;
|
|
140
|
+
var SOLANA_ERROR__FS__UNSUPPORTED_ENVIRONMENT = 3712e3;
|
|
141
|
+
var SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_ACCOUNTS = 4128e3;
|
|
142
|
+
var SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_DATA = 4128001;
|
|
143
|
+
var SOLANA_ERROR__INSTRUCTION__PROGRAM_ID_MISMATCH = 4128002;
|
|
144
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN = 4615e3;
|
|
145
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR = 4615001;
|
|
146
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ARGUMENT = 4615002;
|
|
147
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_INSTRUCTION_DATA = 4615003;
|
|
148
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_DATA = 4615004;
|
|
149
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_TOO_SMALL = 4615005;
|
|
150
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INSUFFICIENT_FUNDS = 4615006;
|
|
151
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_PROGRAM_ID = 4615007;
|
|
152
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_REQUIRED_SIGNATURE = 4615008;
|
|
153
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_ALREADY_INITIALIZED = 4615009;
|
|
154
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__UNINITIALIZED_ACCOUNT = 4615010;
|
|
155
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__UNBALANCED_INSTRUCTION = 4615011;
|
|
156
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__MODIFIED_PROGRAM_ID = 4615012;
|
|
157
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_LAMPORT_SPEND = 4615013;
|
|
158
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_DATA_MODIFIED = 4615014;
|
|
159
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_LAMPORT_CHANGE = 4615015;
|
|
160
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_DATA_MODIFIED = 4615016;
|
|
161
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_INDEX = 4615017;
|
|
162
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_MODIFIED = 4615018;
|
|
163
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__RENT_EPOCH_MODIFIED = 4615019;
|
|
164
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__NOT_ENOUGH_ACCOUNT_KEYS = 4615020;
|
|
165
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_SIZE_CHANGED = 4615021;
|
|
166
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_EXECUTABLE = 4615022;
|
|
167
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_FAILED = 4615023;
|
|
168
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_OUTSTANDING = 4615024;
|
|
169
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_OUT_OF_SYNC = 4615025;
|
|
170
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM = 4615026;
|
|
171
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ERROR = 4615027;
|
|
172
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_DATA_MODIFIED = 4615028;
|
|
173
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_LAMPORT_CHANGE = 4615029;
|
|
174
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_ACCOUNT_NOT_RENT_EXEMPT = 4615030;
|
|
175
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_PROGRAM_ID = 4615031;
|
|
176
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__CALL_DEPTH = 4615032;
|
|
177
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_ACCOUNT = 4615033;
|
|
178
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__REENTRANCY_NOT_ALLOWED = 4615034;
|
|
179
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__MAX_SEED_LENGTH_EXCEEDED = 4615035;
|
|
180
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_SEEDS = 4615036;
|
|
181
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_REALLOC = 4615037;
|
|
182
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__COMPUTATIONAL_BUDGET_EXCEEDED = 4615038;
|
|
183
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__PRIVILEGE_ESCALATION = 4615039;
|
|
184
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_ENVIRONMENT_SETUP_FAILURE = 4615040;
|
|
185
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPLETE = 4615041;
|
|
186
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPILE = 4615042;
|
|
187
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__IMMUTABLE = 4615043;
|
|
188
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_AUTHORITY = 4615044;
|
|
189
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__BORSH_IO_ERROR = 4615045;
|
|
190
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_RENT_EXEMPT = 4615046;
|
|
191
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_OWNER = 4615047;
|
|
192
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ARITHMETIC_OVERFLOW = 4615048;
|
|
193
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_SYSVAR = 4615049;
|
|
194
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__ILLEGAL_OWNER = 4615050;
|
|
195
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEEDED = 4615051;
|
|
196
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_EXCEEDED = 4615052;
|
|
197
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED = 4615053;
|
|
198
|
+
var SOLANA_ERROR__INSTRUCTION_ERROR__BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS = 4615054;
|
|
199
|
+
var SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS = 5508e3;
|
|
200
|
+
var SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER = 5508001;
|
|
201
|
+
var SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER = 5508002;
|
|
202
|
+
var SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER = 5508003;
|
|
203
|
+
var SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER = 5508004;
|
|
204
|
+
var SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER = 5508005;
|
|
205
|
+
var SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER = 5508006;
|
|
206
|
+
var SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER = 5508007;
|
|
207
|
+
var SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER = 5508008;
|
|
208
|
+
var SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS = 5508009;
|
|
209
|
+
var SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING = 5508010;
|
|
210
|
+
var SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED = 5508011;
|
|
211
|
+
var SOLANA_ERROR__SIGNER__WALLET_ACCOUNT_CANNOT_SIGN_TRANSACTION = 5508012;
|
|
212
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__MAXIMUM_LENGTH_EXCEEDED = 5607e3;
|
|
213
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__RESTRICTED_ASCII_BODY_CHARACTER_OUT_OF_RANGE = 5607001;
|
|
214
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__APPLICATION_DOMAIN_STRING_LENGTH_OUT_OF_RANGE = 5607002;
|
|
215
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__INVALID_APPLICATION_DOMAIN_BYTE_LENGTH = 5607003;
|
|
216
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_SIGNATURES_MISMATCH = 5607004;
|
|
217
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_REQUIRED_SIGNERS_CANNOT_BE_ZERO = 5607005;
|
|
218
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__VERSION_NUMBER_NOT_SUPPORTED = 5607006;
|
|
219
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_FORMAT_MISMATCH = 5607007;
|
|
220
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_LENGTH_MISMATCH = 5607008;
|
|
221
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_MUST_BE_NON_EMPTY = 5607009;
|
|
222
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_ENVELOPE_SIGNATURES_CANNOT_BE_ZERO = 5607010;
|
|
223
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATURES_MISSING = 5607011;
|
|
224
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__ENVELOPE_SIGNERS_MISMATCH = 5607012;
|
|
225
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__ADDRESSES_CANNOT_SIGN_OFFCHAIN_MESSAGE = 5607013;
|
|
226
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__UNEXPECTED_VERSION = 5607014;
|
|
227
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATORIES_MUST_BE_SORTED = 5607015;
|
|
228
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATORIES_MUST_BE_UNIQUE = 5607016;
|
|
229
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATURE_VERIFICATION_FAILURE = 5607017;
|
|
230
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__CONTENT_DOES_NOT_MATCH_EXPECTED = 5607018;
|
|
231
|
+
var SOLANA_ERROR__OFFCHAIN_MESSAGE__REQUIRED_SIGNATORIES_DO_NOT_MATCH_EXPECTED = 5607019;
|
|
232
|
+
var SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES = 5663e3;
|
|
233
|
+
var SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE = 5663001;
|
|
234
|
+
var SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME = 5663002;
|
|
235
|
+
var SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME = 5663003;
|
|
236
|
+
var SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE = 5663004;
|
|
237
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING = 5663005;
|
|
238
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE = 5663006;
|
|
239
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND = 5663007;
|
|
240
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING = 5663008;
|
|
241
|
+
var SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING = 5663009;
|
|
242
|
+
var SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING = 5663010;
|
|
243
|
+
var SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING = 5663011;
|
|
244
|
+
var SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING = 5663012;
|
|
245
|
+
var SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING = 5663013;
|
|
246
|
+
var SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE = 5663014;
|
|
247
|
+
var SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION = 5663015;
|
|
248
|
+
var SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES = 5663016;
|
|
249
|
+
var SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH = 5663017;
|
|
250
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT = 5663018;
|
|
251
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT = 5663019;
|
|
252
|
+
var SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT = 5663020;
|
|
253
|
+
var SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED = 5663021;
|
|
254
|
+
var SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE = 5663022;
|
|
255
|
+
var SOLANA_ERROR__TRANSACTION__MALFORMED_MESSAGE_BYTES = 5663023;
|
|
256
|
+
var SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_MESSAGE_BYTES = 5663024;
|
|
257
|
+
var SOLANA_ERROR__TRANSACTION__CANNOT_DECODE_EMPTY_TRANSACTION_BYTES = 5663025;
|
|
258
|
+
var SOLANA_ERROR__TRANSACTION__VERSION_ZERO_MUST_BE_ENCODED_WITH_SIGNATURES_FIRST = 5663026;
|
|
259
|
+
var SOLANA_ERROR__TRANSACTION__SIGNATURE_COUNT_TOO_HIGH_FOR_TRANSACTION_BYTES = 5663027;
|
|
260
|
+
var SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_MASK_PRIORITY_FEE_BITS = 5663028;
|
|
261
|
+
var SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX = 5663029;
|
|
262
|
+
var SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_VALUE_KIND = 5663030;
|
|
263
|
+
var SOLANA_ERROR__TRANSACTION__INSTRUCTION_HEADERS_PAYLOADS_MISMATCH = 5663031;
|
|
264
|
+
var SOLANA_ERROR__TRANSACTION__TOO_MANY_SIGNER_ADDRESSES = 5663032;
|
|
265
|
+
var SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNT_ADDRESSES = 5663033;
|
|
266
|
+
var SOLANA_ERROR__TRANSACTION__TOO_MANY_INSTRUCTIONS = 5663034;
|
|
267
|
+
var SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNTS_IN_INSTRUCTION = 5663035;
|
|
268
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_LOADED_ACCOUNTS_DATA_SIZE_LIMIT = 5663036;
|
|
269
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_RESOURCE_LIMITS = 5663037;
|
|
270
|
+
var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_ACCOUNT_INDEX_OUT_OF_RANGE = 5663038;
|
|
271
|
+
var SOLANA_ERROR__TRANSACTION__COMPUTE_UNIT_LIMIT_OUT_OF_RANGE = 5663039;
|
|
272
|
+
var SOLANA_ERROR__TRANSACTION__INVALID_HEAP_SIZE = 5663040;
|
|
273
|
+
var SOLANA_ERROR__TRANSACTION_INTROSPECTION__CANNOT_DECODE_JSON_PARSED_TRANSACTION = 5664e3;
|
|
274
|
+
var SOLANA_ERROR__TRANSACTION_INTROSPECTION__UNRECOGNIZED_GET_TRANSACTION_RESPONSE = 5664001;
|
|
275
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN = 705e4;
|
|
276
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE = 7050001;
|
|
277
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE = 7050002;
|
|
278
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_NOT_FOUND = 7050003;
|
|
279
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_ACCOUNT_NOT_FOUND = 7050004;
|
|
280
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_FEE = 7050005;
|
|
281
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_FOR_FEE = 7050006;
|
|
282
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED = 7050007;
|
|
283
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND = 7050008;
|
|
284
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__CALL_CHAIN_TOO_DEEP = 7050009;
|
|
285
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__MISSING_SIGNATURE_FOR_FEE = 7050010;
|
|
286
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_INDEX = 7050011;
|
|
287
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__SIGNATURE_FAILURE = 7050012;
|
|
288
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_PROGRAM_FOR_EXECUTION = 7050013;
|
|
289
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__SANITIZE_FAILURE = 7050014;
|
|
290
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__CLUSTER_MAINTENANCE = 7050015;
|
|
291
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_BORROW_OUTSTANDING = 7050016;
|
|
292
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_BLOCK_COST_LIMIT = 7050017;
|
|
293
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__UNSUPPORTED_VERSION = 7050018;
|
|
294
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_WRITABLE_ACCOUNT = 7050019;
|
|
295
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_ACCOUNT_COST_LIMIT = 7050020;
|
|
296
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_BLOCK_LIMIT = 7050021;
|
|
297
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__TOO_MANY_ACCOUNT_LOCKS = 7050022;
|
|
298
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__ADDRESS_LOOKUP_TABLE_NOT_FOUND = 7050023;
|
|
299
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_OWNER = 7050024;
|
|
300
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_DATA = 7050025;
|
|
301
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_INDEX = 7050026;
|
|
302
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_RENT_PAYING_ACCOUNT = 7050027;
|
|
303
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_VOTE_COST_LIMIT = 7050028;
|
|
304
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_TOTAL_LIMIT = 7050029;
|
|
305
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__DUPLICATE_INSTRUCTION = 7050030;
|
|
306
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_RENT = 7050031;
|
|
307
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED = 7050032;
|
|
308
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT = 7050033;
|
|
309
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__RESANITIZATION_NEEDED = 7050034;
|
|
310
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED = 7050035;
|
|
311
|
+
var SOLANA_ERROR__TRANSACTION_ERROR__UNBALANCED_TRANSACTION = 7050036;
|
|
312
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_CANNOT_ACCOMMODATE_PLAN = 7618e3;
|
|
313
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_PACKER_ALREADY_COMPLETE = 7618001;
|
|
314
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__EMPTY_INSTRUCTION_PLAN = 7618002;
|
|
315
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_TO_EXECUTE_TRANSACTION_PLAN = 7618003;
|
|
316
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__NON_DIVISIBLE_TRANSACTION_PLANS_NOT_SUPPORTED = 7618004;
|
|
317
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_SINGLE_TRANSACTION_PLAN_RESULT_NOT_FOUND = 7618005;
|
|
318
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_INSTRUCTION_PLAN = 7618006;
|
|
319
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN = 7618007;
|
|
320
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN_RESULT = 7618008;
|
|
321
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__EXPECTED_SUCCESSFUL_TRANSACTION_PLAN_RESULT = 7618009;
|
|
322
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__MAX_INSTRUCTIONS_PER_TRANSACTION_EXCEEDED = 7618010;
|
|
323
|
+
var SOLANA_ERROR__INSTRUCTION_PLANS__INVALID_MAX_INSTRUCTIONS_PER_TRANSACTION = 7618011;
|
|
324
|
+
var SOLANA_ERROR__CODECS__CANNOT_DECODE_EMPTY_BYTE_ARRAY = 8078e3;
|
|
325
|
+
var SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH = 8078001;
|
|
326
|
+
var SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH = 8078002;
|
|
327
|
+
var SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH = 8078003;
|
|
328
|
+
var SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH = 8078004;
|
|
329
|
+
var SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH = 8078005;
|
|
330
|
+
var SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH = 8078006;
|
|
331
|
+
var SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS = 8078007;
|
|
332
|
+
var SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE = 8078008;
|
|
333
|
+
var SOLANA_ERROR__CODECS__INVALID_DISCRIMINATED_UNION_VARIANT = 8078009;
|
|
334
|
+
var SOLANA_ERROR__CODECS__INVALID_ENUM_VARIANT = 8078010;
|
|
335
|
+
var SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE = 8078011;
|
|
336
|
+
var SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE = 8078012;
|
|
337
|
+
var SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH = 8078013;
|
|
338
|
+
var SOLANA_ERROR__CODECS__OFFSET_OUT_OF_RANGE = 8078014;
|
|
339
|
+
var SOLANA_ERROR__CODECS__INVALID_LITERAL_UNION_VARIANT = 8078015;
|
|
340
|
+
var SOLANA_ERROR__CODECS__LITERAL_UNION_DISCRIMINATOR_OUT_OF_RANGE = 8078016;
|
|
341
|
+
var SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE = 8078017;
|
|
342
|
+
var SOLANA_ERROR__CODECS__INVALID_CONSTANT = 8078018;
|
|
343
|
+
var SOLANA_ERROR__CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_SIZE = 8078019;
|
|
344
|
+
var SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL = 8078020;
|
|
345
|
+
var SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES = 8078021;
|
|
346
|
+
var SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS = 8078022;
|
|
347
|
+
var SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY = 8078023;
|
|
348
|
+
var SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_VALUE = 8078024;
|
|
349
|
+
var SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_BYTES = 8078025;
|
|
350
|
+
var SOLANA_ERROR__FIXED_POINTS__INVALID_TOTAL_BITS = 809e4;
|
|
351
|
+
var SOLANA_ERROR__FIXED_POINTS__INVALID_FRACTIONAL_BITS = 8090001;
|
|
352
|
+
var SOLANA_ERROR__FIXED_POINTS__INVALID_DECIMALS = 8090002;
|
|
353
|
+
var SOLANA_ERROR__FIXED_POINTS__FRACTIONAL_BITS_EXCEED_TOTAL_BITS = 8090003;
|
|
354
|
+
var SOLANA_ERROR__FIXED_POINTS__VALUE_OUT_OF_RANGE = 8090004;
|
|
355
|
+
var SOLANA_ERROR__FIXED_POINTS__INVALID_STRING = 8090005;
|
|
356
|
+
var SOLANA_ERROR__FIXED_POINTS__INVALID_ZERO_DENOMINATOR_RATIO = 8090006;
|
|
357
|
+
var SOLANA_ERROR__FIXED_POINTS__ARITHMETIC_OVERFLOW = 8090007;
|
|
358
|
+
var SOLANA_ERROR__FIXED_POINTS__SHAPE_MISMATCH = 8090008;
|
|
359
|
+
var SOLANA_ERROR__FIXED_POINTS__DIVISION_BY_ZERO = 8090009;
|
|
360
|
+
var SOLANA_ERROR__FIXED_POINTS__STRICT_MODE_PRECISION_LOSS = 8090010;
|
|
361
|
+
var SOLANA_ERROR__FIXED_POINTS__MALFORMED_RAW_VALUE = 8090011;
|
|
362
|
+
var SOLANA_ERROR__FIXED_POINTS__TOTAL_BITS_NOT_BYTE_ALIGNED = 8090012;
|
|
363
|
+
var SOLANA_ERROR__RPC__INTEGER_OVERFLOW = 81e5;
|
|
364
|
+
var SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN = 8100001;
|
|
365
|
+
var SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR = 8100002;
|
|
366
|
+
var SOLANA_ERROR__RPC__API_PLAN_MISSING_FOR_RPC_METHOD = 8100003;
|
|
367
|
+
var SOLANA_ERROR__RPC_SUBSCRIPTIONS__CANNOT_CREATE_SUBSCRIPTION_PLAN = 819e4;
|
|
368
|
+
var SOLANA_ERROR__RPC_SUBSCRIPTIONS__EXPECTED_SERVER_SUBSCRIPTION_ID = 8190001;
|
|
369
|
+
var SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED = 8190002;
|
|
370
|
+
var SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED = 8190003;
|
|
371
|
+
var SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT = 8190004;
|
|
372
|
+
var SOLANA_ERROR__SUBSCRIBABLE__RETRY_NOT_SUPPORTED = 8195e3;
|
|
373
|
+
var SOLANA_ERROR__SUBSCRIBABLE__STREAM_CLOSED_WITHOUT_ERROR = 8195001;
|
|
374
|
+
var SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS = 85e5;
|
|
375
|
+
var SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE = 8500001;
|
|
376
|
+
var SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION = 8500002;
|
|
377
|
+
var SOLANA_ERROR__PROGRAM_CLIENTS__UNEXPECTED_RESOLVED_INSTRUCTION_INPUT_TYPE = 8500003;
|
|
378
|
+
var SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_NON_NULL = 8500004;
|
|
379
|
+
var SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_ACCOUNT_TYPE = 8500005;
|
|
380
|
+
var SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT = 8500006;
|
|
381
|
+
var SOLANA_ERROR__WALLET__NOT_CONNECTED = 89e5;
|
|
382
|
+
var SOLANA_ERROR__WALLET__NO_SIGNER_CONNECTED = 8900001;
|
|
383
|
+
var SOLANA_ERROR__WALLET__SIGNER_NOT_AVAILABLE = 8900002;
|
|
384
|
+
var SOLANA_ERROR__WALLET__ACCOUNT_NOT_AVAILABLE = 8900003;
|
|
385
|
+
var SOLANA_ERROR__REACT__MISSING_PROVIDER = 9e6;
|
|
386
|
+
var SOLANA_ERROR__REACT__MISSING_CAPABILITY = 9000001;
|
|
387
|
+
var SOLANA_ERROR__REACT__SUBSCRIPTION_CLOSED_WITHOUT_ERROR = 9000002;
|
|
388
|
+
var SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_STATE_MISSING = 99e5;
|
|
389
|
+
var SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE = 9900001;
|
|
390
|
+
var SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING = 9900002;
|
|
391
|
+
var SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE = 9900003;
|
|
392
|
+
var SOLANA_ERROR__INVARIANT_VIOLATION__DATA_PUBLISHER_CHANNEL_UNIMPLEMENTED = 9900004;
|
|
393
|
+
var SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_INSTRUCTION_PLAN_KIND = 9900005;
|
|
394
|
+
var SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_TRANSACTION_PLAN_KIND = 9900006;
|
|
395
|
+
function encodeValue(value) {
|
|
396
|
+
if (Array.isArray(value)) {
|
|
397
|
+
const commaSeparatedValues = value.map(encodeValue).join(
|
|
398
|
+
"%2C%20"
|
|
399
|
+
/* ", " */
|
|
400
|
+
);
|
|
401
|
+
return "%5B" + commaSeparatedValues + /* "]" */
|
|
402
|
+
"%5D";
|
|
403
|
+
} else if (typeof value === "bigint") {
|
|
404
|
+
return `${value}n`;
|
|
405
|
+
} else {
|
|
406
|
+
return encodeURIComponent(
|
|
407
|
+
String(
|
|
408
|
+
value != null && Object.getPrototypeOf(value) === null ? (
|
|
409
|
+
// Plain objects with no prototype don't have a `toString` method.
|
|
410
|
+
// Convert them before stringifying them.
|
|
411
|
+
{ ...value }
|
|
412
|
+
) : value
|
|
413
|
+
)
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function encodeObjectContextEntry([key, value]) {
|
|
418
|
+
return `${key}=${encodeValue(value)}`;
|
|
419
|
+
}
|
|
420
|
+
function encodeContextObject(context) {
|
|
421
|
+
const searchParamsString = Object.entries(context).map(encodeObjectContextEntry).join("&");
|
|
422
|
+
return Buffer.from(searchParamsString, "utf8").toString("base64");
|
|
423
|
+
}
|
|
424
|
+
var SolanaErrorMessages = {
|
|
425
|
+
[SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND]: "Account not found at address: $address",
|
|
426
|
+
[SOLANA_ERROR__ACCOUNTS__EXPECTED_ALL_ACCOUNTS_TO_BE_DECODED]: "Not all accounts were decoded. Encoded accounts found at addresses: $addresses.",
|
|
427
|
+
[SOLANA_ERROR__ACCOUNTS__EXPECTED_DECODED_ACCOUNT]: "Expected decoded account at address: $address",
|
|
428
|
+
[SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT]: "Failed to decode account data at address: $address",
|
|
429
|
+
[SOLANA_ERROR__ACCOUNTS__ONE_OR_MORE_ACCOUNTS_NOT_FOUND]: "Accounts not found at addresses: $addresses",
|
|
430
|
+
[SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED]: "Unable to find a viable program address bump seed.",
|
|
431
|
+
[SOLANA_ERROR__ADDRESSES__INVALID_BASE58_ENCODED_ADDRESS]: "$putativeAddress is not a base58-encoded address.",
|
|
432
|
+
[SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH]: "Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.",
|
|
433
|
+
[SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY]: "The `CryptoKey` must be an `Ed25519` public key.",
|
|
434
|
+
[SOLANA_ERROR__ADDRESSES__INVALID_OFF_CURVE_ADDRESS]: "$putativeOffCurveAddress is not a base58-encoded off-curve address.",
|
|
435
|
+
[SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE]: "Invalid seeds; point must fall off the Ed25519 curve.",
|
|
436
|
+
[SOLANA_ERROR__ADDRESSES__MALFORMED_PDA]: "Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].",
|
|
437
|
+
[SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED]: "A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.",
|
|
438
|
+
[SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED]: "The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.",
|
|
439
|
+
[SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE]: "Expected program derived address bump to be in the range [0, 255], got: $bump.",
|
|
440
|
+
[SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER]: "Program address cannot end with PDA marker.",
|
|
441
|
+
[SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE]: "Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.",
|
|
442
|
+
[SOLANA_ERROR__BLOCKHASH_STRING_LENGTH_OUT_OF_RANGE]: "Expected base58-encoded blockhash string of length in the range [32, 44]. Actual length: $actualLength.",
|
|
443
|
+
[SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED]: "The network has progressed past the last block for which this transaction could have been committed.",
|
|
444
|
+
[SOLANA_ERROR__CODECS__CANNOT_DECODE_EMPTY_BYTE_ARRAY]: "Codec [$codecDescription] cannot decode empty byte arrays.",
|
|
445
|
+
[SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS]: "Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",
|
|
446
|
+
[SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL]: "Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].",
|
|
447
|
+
[SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH]: "Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].",
|
|
448
|
+
[SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH]: "Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].",
|
|
449
|
+
[SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH]: "Encoder and decoder must either both be fixed-size or variable-size.",
|
|
450
|
+
[SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE]: "Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.",
|
|
451
|
+
[SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH]: "Expected a fixed-size codec, got a variable-size one.",
|
|
452
|
+
[SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH]: "Codec [$codecDescription] expected a positive byte length, got $bytesLength.",
|
|
453
|
+
[SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH]: "Expected a variable-size codec, got a fixed-size one.",
|
|
454
|
+
[SOLANA_ERROR__CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_SIZE]: "Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].",
|
|
455
|
+
[SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH]: "Codec [$codecDescription] expected $expected bytes, got $bytesLength.",
|
|
456
|
+
[SOLANA_ERROR__CODECS__INVALID_CONSTANT]: "Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].",
|
|
457
|
+
[SOLANA_ERROR__CODECS__INVALID_DISCRIMINATED_UNION_VARIANT]: "Invalid discriminated union variant. Expected one of [$variants], got $value.",
|
|
458
|
+
[SOLANA_ERROR__CODECS__INVALID_ENUM_VARIANT]: "Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.",
|
|
459
|
+
[SOLANA_ERROR__CODECS__INVALID_LITERAL_UNION_VARIANT]: "Invalid literal union variant. Expected one of [$variants], got $value.",
|
|
460
|
+
[SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS]: "Expected [$codecDescription] to have $expected items, got $actual.",
|
|
461
|
+
[SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE]: "Invalid value $value for base $base with alphabet $alphabet.",
|
|
462
|
+
[SOLANA_ERROR__CODECS__LITERAL_UNION_DISCRIMINATOR_OUT_OF_RANGE]: "Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.",
|
|
463
|
+
[SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE]: "Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.",
|
|
464
|
+
[SOLANA_ERROR__CODECS__OFFSET_OUT_OF_RANGE]: "Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.",
|
|
465
|
+
[SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES]: "Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",
|
|
466
|
+
[SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE]: "Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",
|
|
467
|
+
[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?",
|
|
468
|
+
[SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_VALUE]: "Invalid pattern match value. The provided value does not match any of the specified patterns.",
|
|
469
|
+
[SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_BYTES]: "Invalid pattern match bytes. The provided byte array does not match any of the specified patterns.",
|
|
470
|
+
[SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED]: "No random values implementation could be found.",
|
|
471
|
+
[SOLANA_ERROR__FAILED_TO_SEND_TRANSACTION]: "Failed to send transaction$causeMessage",
|
|
472
|
+
[SOLANA_ERROR__FAILED_TO_SEND_TRANSACTIONS]: "Failed to send transactions$causeMessages",
|
|
473
|
+
[SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTION]: "Failed to sign transaction$causeMessage",
|
|
474
|
+
[SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTIONS]: "Failed to sign transactions$causeMessages",
|
|
475
|
+
[SOLANA_ERROR__FIXED_POINTS__ARITHMETIC_OVERFLOW]: "Fixed-point operation `$operation` of kind `$kind` overflowed. Expected a raw bigint in [$min, $max], got $result.",
|
|
476
|
+
[SOLANA_ERROR__FIXED_POINTS__DIVISION_BY_ZERO]: "Fixed-point division by zero for value of kind `$kind` ($signedness, $totalBits bits).",
|
|
477
|
+
[SOLANA_ERROR__FIXED_POINTS__FRACTIONAL_BITS_EXCEED_TOTAL_BITS]: "`fractionalBits` ($fractionalBits) must not exceed `totalBits` ($totalBits).",
|
|
478
|
+
[SOLANA_ERROR__FIXED_POINTS__INVALID_DECIMALS]: "Invalid `decimals`. Expected a non-negative integer, got $decimals.",
|
|
479
|
+
[SOLANA_ERROR__FIXED_POINTS__INVALID_FRACTIONAL_BITS]: "Invalid `fractionalBits`. Expected a non-negative integer, got $fractionalBits.",
|
|
480
|
+
[SOLANA_ERROR__FIXED_POINTS__INVALID_STRING]: "Invalid string `$input` for fixed-point value of kind `$kind`.",
|
|
481
|
+
[SOLANA_ERROR__FIXED_POINTS__INVALID_TOTAL_BITS]: "Invalid `totalBits`. Expected a positive integer, got $totalBits.",
|
|
482
|
+
[SOLANA_ERROR__FIXED_POINTS__INVALID_ZERO_DENOMINATOR_RATIO]: "Invalid ratio $numerator/$denominator for fixed-point value of kind `$kind`. Denominator must be non-zero.",
|
|
483
|
+
[SOLANA_ERROR__FIXED_POINTS__MALFORMED_RAW_VALUE]: "Fixed-point value of kind `$kind` has a malformed `raw` field. Expected a bigint, got `$raw`.",
|
|
484
|
+
[SOLANA_ERROR__FIXED_POINTS__SHAPE_MISMATCH]: "Fixed-point `$operation` operation expected $expectedKind ($expectedSignedness, $expectedTotalBits bits, $expectedScale $expectedScaleLabel); got $actualKind ($actualSignedness, $actualTotalBits bits, $actualScale $actualScaleLabel).",
|
|
485
|
+
[SOLANA_ERROR__FIXED_POINTS__STRICT_MODE_PRECISION_LOSS]: "Fixed-point operation `$operation` of kind `$kind` cannot be performed exactly; pass a rounding mode other than `strict` to allow a rounded result.",
|
|
486
|
+
[SOLANA_ERROR__FIXED_POINTS__TOTAL_BITS_NOT_BYTE_ALIGNED]: "Fixed-point codec of kind `$kind` requires `totalBits` to be a multiple of 8; got $totalBits.",
|
|
487
|
+
[SOLANA_ERROR__FIXED_POINTS__VALUE_OUT_OF_RANGE]: "Fixed-point value of kind `$kind` is out of range for $signedness $totalBits-bit storage. Expected a raw bigint in [$min, $max], got $raw.",
|
|
488
|
+
[SOLANA_ERROR__FS__UNSUPPORTED_ENVIRONMENT]: "Filesystem operation `$operation` is not supported in this environment.",
|
|
489
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_ALREADY_INITIALIZED]: "Instruction requires an uninitialized account",
|
|
490
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_FAILED]: "Instruction tries to borrow reference for an account which is already borrowed",
|
|
491
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_OUTSTANDING]: "Instruction left account with an outstanding borrowed reference",
|
|
492
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_SIZE_CHANGED]: "Program other than the account's owner changed the size of the account data",
|
|
493
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_TOO_SMALL]: "Account data too small for instruction",
|
|
494
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_EXECUTABLE]: "Instruction expected an executable account",
|
|
495
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_RENT_EXEMPT]: "An account does not have enough lamports to be rent-exempt",
|
|
496
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ARITHMETIC_OVERFLOW]: "Program arithmetic overflowed",
|
|
497
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__BORSH_IO_ERROR]: "Failed to serialize or deserialize account data",
|
|
498
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS]: "Builtin programs must consume compute units",
|
|
499
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__CALL_DEPTH]: "Cross-program invocation call depth too deep",
|
|
500
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__COMPUTATIONAL_BUDGET_EXCEEDED]: "Computational budget exceeded",
|
|
501
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM]: "Custom program error: #$code",
|
|
502
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_INDEX]: "Instruction contains duplicate accounts",
|
|
503
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_OUT_OF_SYNC]: "Instruction modifications of multiply-passed account differ",
|
|
504
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_ACCOUNT_NOT_RENT_EXEMPT]: "Executable accounts must be rent exempt",
|
|
505
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_DATA_MODIFIED]: "Instruction changed executable accounts data",
|
|
506
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_LAMPORT_CHANGE]: "Instruction changed the balance of an executable account",
|
|
507
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_MODIFIED]: "Instruction changed executable bit of an account",
|
|
508
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_DATA_MODIFIED]: "Instruction modified data of an account it does not own",
|
|
509
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_LAMPORT_SPEND]: "Instruction spent from the balance of an account it does not own",
|
|
510
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR]: "Generic instruction error",
|
|
511
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__ILLEGAL_OWNER]: "Provided owner is not allowed",
|
|
512
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__IMMUTABLE]: "Account is immutable",
|
|
513
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_AUTHORITY]: "Incorrect authority provided",
|
|
514
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_PROGRAM_ID]: "Incorrect program id for instruction",
|
|
515
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INSUFFICIENT_FUNDS]: "Insufficient funds for instruction",
|
|
516
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_DATA]: "Invalid account data for instruction",
|
|
517
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_OWNER]: "Invalid account owner",
|
|
518
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ARGUMENT]: "Invalid program argument",
|
|
519
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ERROR]: "Program returned invalid error code",
|
|
520
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_INSTRUCTION_DATA]: "Invalid instruction data",
|
|
521
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_REALLOC]: "Failed to reallocate account data",
|
|
522
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_SEEDS]: "Provided seeds do not result in a valid address",
|
|
523
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEEDED]: "Accounts data allocations exceeded the maximum allowed per transaction",
|
|
524
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_EXCEEDED]: "Max accounts exceeded",
|
|
525
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED]: "Max instruction trace length exceeded",
|
|
526
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__MAX_SEED_LENGTH_EXCEEDED]: "Length of the seed is too long for address generation",
|
|
527
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_ACCOUNT]: "An account required by the instruction is missing",
|
|
528
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_REQUIRED_SIGNATURE]: "Missing required signature for instruction",
|
|
529
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__MODIFIED_PROGRAM_ID]: "Instruction illegally modified the program id of an account",
|
|
530
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__NOT_ENOUGH_ACCOUNT_KEYS]: "Insufficient account keys for instruction",
|
|
531
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__PRIVILEGE_ESCALATION]: "Cross-program invocation with unauthorized signer or writable account",
|
|
532
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_ENVIRONMENT_SETUP_FAILURE]: "Failed to create program execution environment",
|
|
533
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPILE]: "Program failed to compile",
|
|
534
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPLETE]: "Program failed to complete",
|
|
535
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_DATA_MODIFIED]: "Instruction modified data of a read-only account",
|
|
536
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_LAMPORT_CHANGE]: "Instruction changed the balance of a read-only account",
|
|
537
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__REENTRANCY_NOT_ALLOWED]: "Cross-program invocation reentrancy not allowed for this instruction",
|
|
538
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__RENT_EPOCH_MODIFIED]: "Instruction modified rent epoch of an account",
|
|
539
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__UNBALANCED_INSTRUCTION]: "Sum of account balances before and after instruction do not match",
|
|
540
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__UNINITIALIZED_ACCOUNT]: "Instruction requires an initialized account",
|
|
541
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN]: "The instruction failed with the error: $errorName",
|
|
542
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_PROGRAM_ID]: "Unsupported program id",
|
|
543
|
+
[SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_SYSVAR]: "Unsupported sysvar",
|
|
544
|
+
[SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_INSTRUCTION_PLAN_KIND]: "Invalid instruction plan kind: $kind.",
|
|
545
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__EMPTY_INSTRUCTION_PLAN]: "The provided instruction plan is empty.",
|
|
546
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_SINGLE_TRANSACTION_PLAN_RESULT_NOT_FOUND]: "No failed transaction plan result was found in the provided transaction plan result.",
|
|
547
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__NON_DIVISIBLE_TRANSACTION_PLANS_NOT_SUPPORTED]: "This transaction plan executor does not support non-divisible sequential plans. To support them, you may create your own executor such that multi-transaction atomicity is preserved \u2014 e.g. by targetting RPCs that support transaction bundles.",
|
|
548
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_TO_EXECUTE_TRANSACTION_PLAN]: "The provided transaction plan failed to execute. See the `transactionPlanResult` attribute for more details. Note that the `cause` property is deprecated, and a future version will not set it.",
|
|
549
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__INVALID_MAX_INSTRUCTIONS_PER_TRANSACTION]: "The configured maximum of $maxInstructions instructions per transaction is invalid. It must be a positive integer no greater than the transaction format limit of $transactionInstructionLimit instructions per transaction. Provide a `maxInstructionsPerTransaction` (on the transaction planner) or `maxInstructions` (on the message packer) value between 1 and $transactionInstructionLimit.",
|
|
550
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__MAX_INSTRUCTIONS_PER_TRANSACTION_EXCEEDED]: "Planning this transaction message would require $numInstructions instructions, which exceeds the configured maximum of $maxInstructions instructions per transaction. This limit is configurable, and intended to leave headroom for inner instructions which are included in the maximum instruction limit for transactions. Increase `maxInstructionsPerTransaction` on the transaction planner (or `maxInstructions` on the message packer) to allow more instructions per transaction.",
|
|
551
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_CANNOT_ACCOMMODATE_PLAN]: "The provided message has insufficient capacity to accommodate the next instruction(s) in this plan. Expected at least $numBytesRequired free byte(s), got $numFreeBytes byte(s).",
|
|
552
|
+
[SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_TRANSACTION_PLAN_KIND]: "Invalid transaction plan kind: $kind.",
|
|
553
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_PACKER_ALREADY_COMPLETE]: "No more instructions to pack; the message packer has completed the instruction plan.",
|
|
554
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_INSTRUCTION_PLAN]: "Unexpected instruction plan. Expected $expectedKind plan, got $actualKind plan.",
|
|
555
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN]: "Unexpected transaction plan. Expected $expectedKind plan, got $actualKind plan.",
|
|
556
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN_RESULT]: "Unexpected transaction plan result. Expected $expectedKind plan, got $actualKind plan.",
|
|
557
|
+
[SOLANA_ERROR__INSTRUCTION_PLANS__EXPECTED_SUCCESSFUL_TRANSACTION_PLAN_RESULT]: "Expected a successful transaction plan result. I.e. there is at least one failed or cancelled transaction in the plan.",
|
|
558
|
+
[SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_ACCOUNTS]: "The instruction does not have any accounts.",
|
|
559
|
+
[SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_DATA]: "The instruction does not have any data.",
|
|
560
|
+
[SOLANA_ERROR__INSTRUCTION__PROGRAM_ID_MISMATCH]: "Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.",
|
|
561
|
+
[SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH]: "Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.",
|
|
562
|
+
[SOLANA_ERROR__INVALID_NONCE]: "The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",
|
|
563
|
+
[SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING]: "Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",
|
|
564
|
+
[SOLANA_ERROR__INVARIANT_VIOLATION__DATA_PUBLISHER_CHANNEL_UNIMPLEMENTED]: "Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",
|
|
565
|
+
[SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE]: "Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",
|
|
566
|
+
[SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_STATE_MISSING]: "Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",
|
|
567
|
+
[SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE]: "Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",
|
|
568
|
+
[SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR]: "JSON-RPC error: Internal JSON-RPC error ($__serverMessage)",
|
|
569
|
+
[SOLANA_ERROR__JSON_RPC__INVALID_PARAMS]: "JSON-RPC error: Invalid method parameter(s) ($__serverMessage)",
|
|
570
|
+
[SOLANA_ERROR__JSON_RPC__INVALID_REQUEST]: "JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",
|
|
571
|
+
[SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND]: "JSON-RPC error: The method does not exist / is not available ($__serverMessage)",
|
|
572
|
+
[SOLANA_ERROR__JSON_RPC__PARSE_ERROR]: "JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)",
|
|
573
|
+
[SOLANA_ERROR__JSON_RPC__SCAN_ERROR]: "$__serverMessage",
|
|
574
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP]: "$__serverMessage",
|
|
575
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE]: "$__serverMessage",
|
|
576
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET]: "$__serverMessage",
|
|
577
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_EPOCH_REWARDS_PERIOD_ACTIVE]: "Epoch rewards period still active at slot $slot",
|
|
578
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_FILTER_TRANSACTION_NOT_FOUND]: "$__serverMessage",
|
|
579
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX]: "$__serverMessage",
|
|
580
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED]: "$__serverMessage",
|
|
581
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_UNREACHABLE]: "Failed to query long-term storage; please try again",
|
|
582
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED]: "Minimum context slot has not been reached",
|
|
583
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY]: "Node is unhealthy; behind by $numSlotsBehind slots",
|
|
584
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SLOT_HISTORY]: "No slot history",
|
|
585
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT]: "No snapshot",
|
|
586
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE]: "Transaction simulation failed",
|
|
587
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_NOT_EPOCH_BOUNDARY]: "Rewards cannot be found because slot $slot is not the epoch boundary. This may be due to gap in the queried node's local ledger or long-term storage",
|
|
588
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED]: "$__serverMessage",
|
|
589
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE]: "Transaction history is not available from this node",
|
|
590
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE]: "$__serverMessage",
|
|
591
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH]: "Transaction signature length mismatch",
|
|
592
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE]: "Transaction signature verification failure",
|
|
593
|
+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION]: "$__serverMessage",
|
|
594
|
+
[SOLANA_ERROR__KEYS__INVALID_BASE58_IN_GRIND_REGEX]: "The grind regex `/$source/` contains the character `$character`, which is not in the base58 alphabet and can never match a Solana address.",
|
|
595
|
+
[SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH]: "Key pair bytes must be of length 64, got $byteLength.",
|
|
596
|
+
[SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH]: "Expected private key bytes with length 32. Actual length: $actualLength.",
|
|
597
|
+
[SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH]: "Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.",
|
|
598
|
+
[SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY]: "The provided private key does not match the provided public key.",
|
|
599
|
+
[SOLANA_ERROR__KEYS__SIGNATURE_STRING_LENGTH_OUT_OF_RANGE]: "Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.",
|
|
600
|
+
[SOLANA_ERROR__KEYS__WRITE_KEY_PAIR_UNSUPPORTED_ENVIRONMENT]: "Writing a key pair to disk is not supported in this environment.",
|
|
601
|
+
[SOLANA_ERROR__LAMPORTS_OUT_OF_RANGE]: "Lamports value must be in the range [0, 2e64-1]",
|
|
602
|
+
[SOLANA_ERROR__MALFORMED_BIGINT_STRING]: "`$value` cannot be parsed as a `BigInt`",
|
|
603
|
+
[SOLANA_ERROR__MALFORMED_JSON_RPC_ERROR]: "$message",
|
|
604
|
+
[SOLANA_ERROR__MALFORMED_NUMBER_STRING]: "`$value` cannot be parsed as a `Number`",
|
|
605
|
+
[SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND]: "No nonce account could be found at address `$nonceAccountAddress`",
|
|
606
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__INVALID_APPLICATION_DOMAIN_BYTE_LENGTH]: "Expected base58 encoded application domain to decode to a byte array of length 32. Actual length: $actualLength.",
|
|
607
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__ADDRESSES_CANNOT_SIGN_OFFCHAIN_MESSAGE]: "Attempted to sign an offchain message with an address that is not a signer for it",
|
|
608
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__APPLICATION_DOMAIN_STRING_LENGTH_OUT_OF_RANGE]: "Expected base58-encoded application domain string of length in the range [32, 44]. Actual length: $actualLength.",
|
|
609
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__CONTENT_DOES_NOT_MATCH_EXPECTED]: "The content of the offchain message does not match the content that was expected. Expected content with a byte-length of $expectedBytes; got content with a byte-length of $actualBytes. The signer may have signed different data than was requested; do not trust its signature.",
|
|
610
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__ENVELOPE_SIGNERS_MISMATCH]: "The signer addresses in this offchain message envelope do not match the list of required signers in the message preamble. These unexpected signers were present in the envelope: `[$unexpectedSigners]`. These required signers were missing from the envelope `[$missingSigners]`.",
|
|
611
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__MAXIMUM_LENGTH_EXCEEDED]: "The message body provided has a byte-length of $actualBytes. The maximum allowable byte-length is $maxBytes",
|
|
612
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_FORMAT_MISMATCH]: "Expected message format $expectedMessageFormat, got $actualMessageFormat",
|
|
613
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_LENGTH_MISMATCH]: "The message length specified in the message preamble is $specifiedLength bytes. The actual length of the message is $actualLength bytes.",
|
|
614
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_MUST_BE_NON_EMPTY]: "Offchain message content must be non-empty",
|
|
615
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_REQUIRED_SIGNERS_CANNOT_BE_ZERO]: "Offchain message must specify the address of at least one required signer",
|
|
616
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_ENVELOPE_SIGNATURES_CANNOT_BE_ZERO]: "Offchain message envelope must reserve space for at least one signature",
|
|
617
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_SIGNATURES_MISMATCH]: "The offchain message preamble specifies $numRequiredSignatures required signature(s), got $signaturesLength.",
|
|
618
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__REQUIRED_SIGNATORIES_DO_NOT_MATCH_EXPECTED]: "The offchain message lists different required signatories than was expected. Expected [$expectedAddresses]. Got [$actualAddresses]. The signer may have signed different data than was requested; do not trust its signature.",
|
|
619
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATORIES_MUST_BE_SORTED]: "The signatories of this offchain message must be listed in lexicographical order",
|
|
620
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATORIES_MUST_BE_UNIQUE]: "An address must be listed no more than once among the signatories of an offchain message",
|
|
621
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATURES_MISSING]: "Offchain message is missing signatures for addresses: $addresses.",
|
|
622
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATURE_VERIFICATION_FAILURE]: "Offchain message signature verification failed. Signature mismatch for required signatories [$signatoriesWithInvalidSignatures]. Missing signatures for signatories [$signatoriesWithMissingSignatures]",
|
|
623
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__RESTRICTED_ASCII_BODY_CHARACTER_OUT_OF_RANGE]: "The message body provided contains characters whose codes fall outside the allowed range. In order to ensure clear-signing compatiblity with hardware wallets, the message may only contain line feeds and characters in the range [\\x20-\\x7e].",
|
|
624
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__UNEXPECTED_VERSION]: "Expected offchain message version $expectedVersion. Got $actualVersion.",
|
|
625
|
+
[SOLANA_ERROR__OFFCHAIN_MESSAGE__VERSION_NUMBER_NOT_SUPPORTED]: "This version of Kit does not support decoding offchain messages with version $unsupportedVersion. The current max supported version is 0.",
|
|
626
|
+
[SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT]: "The provided account could not be identified as an account from the $programName program.",
|
|
627
|
+
[SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION]: "The provided instruction could not be identified as an instruction from the $programName program.",
|
|
628
|
+
[SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS]: "The provided instruction is missing some accounts. Expected at least $expectedAccountMetas account(s), got $actualAccountMetas.",
|
|
629
|
+
[SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_NON_NULL]: "Expected resolved instruction input '$inputName' to be non-null.",
|
|
630
|
+
[SOLANA_ERROR__PROGRAM_CLIENTS__UNEXPECTED_RESOLVED_INSTRUCTION_INPUT_TYPE]: "Expected resolved instruction input '$inputName' to be of type `$expectedType`.",
|
|
631
|
+
[SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_ACCOUNT_TYPE]: "Unrecognized account type '$accountType' for the $programName program.",
|
|
632
|
+
[SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE]: "Unrecognized instruction type '$instructionType' for the $programName program.",
|
|
633
|
+
[SOLANA_ERROR__RPC_SUBSCRIPTIONS__CANNOT_CREATE_SUBSCRIPTION_PLAN]: "The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.",
|
|
634
|
+
[SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED]: "WebSocket was closed before payload could be added to the send buffer",
|
|
635
|
+
[SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED]: "WebSocket connection closed",
|
|
636
|
+
[SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT]: "WebSocket failed to connect",
|
|
637
|
+
[SOLANA_ERROR__RPC_SUBSCRIPTIONS__EXPECTED_SERVER_SUBSCRIPTION_ID]: "Failed to obtain a subscription id from the server",
|
|
638
|
+
[SOLANA_ERROR__RPC__API_PLAN_MISSING_FOR_RPC_METHOD]: "Could not find an API plan for RPC method: `$method`",
|
|
639
|
+
[SOLANA_ERROR__RPC__INTEGER_OVERFLOW]: "The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.",
|
|
640
|
+
[SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR]: "HTTP error ($statusCode): $message",
|
|
641
|
+
[SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN]: "HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.",
|
|
642
|
+
[SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS]: "Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",
|
|
643
|
+
[SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER]: "The provided value does not implement the `KeyPairSigner` interface",
|
|
644
|
+
[SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER]: "The provided value does not implement the `MessageModifyingSigner` interface",
|
|
645
|
+
[SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER]: "The provided value does not implement the `MessagePartialSigner` interface",
|
|
646
|
+
[SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER]: "The provided value does not implement any of the `MessageSigner` interfaces",
|
|
647
|
+
[SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER]: "The provided value does not implement the `TransactionModifyingSigner` interface",
|
|
648
|
+
[SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER]: "The provided value does not implement the `TransactionPartialSigner` interface",
|
|
649
|
+
[SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER]: "The provided value does not implement the `TransactionSendingSigner` interface",
|
|
650
|
+
[SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER]: "The provided value does not implement any of the `TransactionSigner` interfaces",
|
|
651
|
+
[SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS]: "More than one `TransactionSendingSigner` was identified.",
|
|
652
|
+
[SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING]: "No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.",
|
|
653
|
+
[SOLANA_ERROR__SIGNER__WALLET_ACCOUNT_CANNOT_SIGN_TRANSACTION]: "The wallet account $address cannot be used to create a transaction signer because it does not implement either the `solana:signTransaction` or `solana:signAndSendTransaction` feature. At least one of these features is required. The account supports the following features: $supportedFeatures.",
|
|
654
|
+
[SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED]: "Wallet account signers do not support signing multiple messages/transactions in a single operation",
|
|
655
|
+
[SOLANA_ERROR__SUBSCRIBABLE__RETRY_NOT_SUPPORTED]: "This `ReactiveStreamStore` does not support retry. Use `createReactiveStoreFromDataPublisherFactory` to construct a retryable store.",
|
|
656
|
+
[SOLANA_ERROR__SUBSCRIBABLE__STREAM_CLOSED_WITHOUT_ERROR]: "The stream store closed in an error state but did not report an error.",
|
|
657
|
+
[SOLANA_ERROR__SUBTLE_CRYPTO__CANNOT_EXPORT_NON_EXTRACTABLE_KEY]: "Cannot export a non-extractable key.",
|
|
658
|
+
[SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED]: "No digest implementation could be found.",
|
|
659
|
+
[SOLANA_ERROR__SUBTLE_CRYPTO__DISALLOWED_IN_INSECURE_CONTEXT]: "Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.",
|
|
660
|
+
[SOLANA_ERROR__SUBTLE_CRYPTO__ED25519_ALGORITHM_UNIMPLEMENTED]: "This runtime does not support the generation of Ed25519 key pairs.\n\nInstall @solana/webcrypto-ed25519-polyfill and call its `install` function before generating keys in environments that do not support Ed25519.\n\nFor a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.",
|
|
661
|
+
[SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED]: "No key export implementation could be found.",
|
|
662
|
+
[SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED]: "No key generation implementation could be found.",
|
|
663
|
+
[SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED]: "No signing implementation could be found.",
|
|
664
|
+
[SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED]: "No signature verification implementation could be found.",
|
|
665
|
+
[SOLANA_ERROR__TIMESTAMP_OUT_OF_RANGE]: "Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given",
|
|
666
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_BORROW_OUTSTANDING]: "Transaction processing left an account with an outstanding borrowed reference",
|
|
667
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE]: "Account in use",
|
|
668
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE]: "Account loaded twice",
|
|
669
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_NOT_FOUND]: "Attempt to debit an account but found no record of a prior credit.",
|
|
670
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__ADDRESS_LOOKUP_TABLE_NOT_FOUND]: "Transaction loads an address table account that doesn't exist",
|
|
671
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED]: "This transaction has already been processed",
|
|
672
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND]: "Blockhash not found",
|
|
673
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__CALL_CHAIN_TOO_DEEP]: "Loader call chain is too deep",
|
|
674
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__CLUSTER_MAINTENANCE]: "Transactions are currently disabled due to cluster maintenance",
|
|
675
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__DUPLICATE_INSTRUCTION]: "Transaction contains a duplicate instruction ($index) that is not allowed",
|
|
676
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_FEE]: "Insufficient funds for fee",
|
|
677
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_RENT]: "Transaction results in an account ($accountIndex) with insufficient funds for rent",
|
|
678
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_FOR_FEE]: "This account may not be used to pay transaction fees",
|
|
679
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_INDEX]: "Transaction contains an invalid account reference",
|
|
680
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_DATA]: "Transaction loads an address table account with invalid data",
|
|
681
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_INDEX]: "Transaction address table lookup uses an invalid index",
|
|
682
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_OWNER]: "Transaction loads an address table account with an invalid owner",
|
|
683
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT]: "LoadedAccountsDataSizeLimit set for transaction must be greater than 0.",
|
|
684
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_PROGRAM_FOR_EXECUTION]: "This program may not be used for executing instructions",
|
|
685
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_RENT_PAYING_ACCOUNT]: "Transaction leaves an account with a lower balance than rent-exempt minimum",
|
|
686
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__INVALID_WRITABLE_ACCOUNT]: "Transaction loads a writable account that cannot be written",
|
|
687
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED]: "Transaction exceeded max loaded accounts data size cap",
|
|
688
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__MISSING_SIGNATURE_FOR_FEE]: "Transaction requires a fee but has no signature present",
|
|
689
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_ACCOUNT_NOT_FOUND]: "Attempt to load a program that does not exist",
|
|
690
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED]: "Execution of the program referenced by account at index $accountIndex is temporarily restricted.",
|
|
691
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__RESANITIZATION_NEEDED]: "ResanitizationNeeded",
|
|
692
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__SANITIZE_FAILURE]: "Transaction failed to sanitize accounts offsets correctly",
|
|
693
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__SIGNATURE_FAILURE]: "Transaction did not pass signature verification",
|
|
694
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__TOO_MANY_ACCOUNT_LOCKS]: "Transaction locked too many accounts",
|
|
695
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__UNBALANCED_TRANSACTION]: "Sum of account balances before and after transaction do not match",
|
|
696
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN]: "The transaction failed with the error `$errorName`",
|
|
697
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__UNSUPPORTED_VERSION]: "Transaction version is unsupported",
|
|
698
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_BLOCK_LIMIT]: "Transaction would exceed account data limit within the block",
|
|
699
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_TOTAL_LIMIT]: "Transaction would exceed total account data limit",
|
|
700
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_ACCOUNT_COST_LIMIT]: "Transaction would exceed max account limit within the block",
|
|
701
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_BLOCK_COST_LIMIT]: "Transaction would exceed max Block Cost Limit",
|
|
702
|
+
[SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_VOTE_COST_LIMIT]: "Transaction would exceed max Vote Cost Limit",
|
|
703
|
+
[SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION]: "Attempted to sign a transaction with an address that is not a signer for it",
|
|
704
|
+
[SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING]: "Transaction is missing an address at index: $index.",
|
|
705
|
+
[SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES]: "Transaction has no expected signers therefore it cannot be encoded",
|
|
706
|
+
[SOLANA_ERROR__TRANSACTION__COMPUTE_UNIT_LIMIT_OUT_OF_RANGE]: "Transaction compute unit limit must be an integer in the range [0, $maxComputeUnitLimit]. `$computeUnitLimit` given",
|
|
707
|
+
[SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT]: "Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes",
|
|
708
|
+
[SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME]: "Transaction does not have a blockhash lifetime",
|
|
709
|
+
[SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME]: "Transaction is not a durable nonce transaction",
|
|
710
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING]: "Contents of these address lookup tables unknown: $lookupTableAddresses",
|
|
711
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE]: "Lookup of address at index $highestRequestedIndex failed for lookup table `$lookupTableAddress`. Highest known index is $highestKnownIndex. The lookup table may have been extended since its contents were retrieved",
|
|
712
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING]: "No fee payer set in CompiledTransaction",
|
|
713
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND]: "Could not find program address at index $index",
|
|
714
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT]: "Failed to estimate the compute unit consumption for this transaction message. This is likely because simulating the transaction failed. Inspect the `cause` property of this error to learn more",
|
|
715
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_LOADED_ACCOUNTS_DATA_SIZE_LIMIT]: "Failed to estimate the loaded accounts data size for this transaction message. The RPC did not return a `loadedAccountsDataSize` value from simulation. This value is required for version 1 transactions",
|
|
716
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT]: "Transaction failed when it was simulated in order to estimate the compute unit consumption. The compute unit estimate provided is for a transaction that failed when simulated and may not be representative of the compute units this transaction would consume if successful. Inspect the `cause` property of this error to learn more",
|
|
717
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_RESOURCE_LIMITS]: "Transaction failed when it was simulated in order to estimate its resource limits. The resource limit estimates provided are for a transaction that failed when simulated and may not be representative of the resources this transaction would consume if successful. Inspect the `cause` property of this error to learn more",
|
|
718
|
+
[SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING]: "Transaction is missing a fee payer.",
|
|
719
|
+
[SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING]: "Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.",
|
|
720
|
+
[SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE]: "Transaction first instruction is not advance nonce account instruction.",
|
|
721
|
+
[SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING]: "Transaction with no instructions cannot be durable nonce transaction.",
|
|
722
|
+
[SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES]: "This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees",
|
|
723
|
+
[SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE]: "This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable",
|
|
724
|
+
[SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH]: "The transaction message expected the transaction to have $numRequiredSignatures signatures, got $signaturesLength.",
|
|
725
|
+
[SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING]: "Transaction is missing signatures for addresses: $addresses.",
|
|
726
|
+
[SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE]: "Transaction version must be in the range [0, 127]. `$actualVersion` given",
|
|
727
|
+
[SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED]: "This version of Kit does not support decoding transactions with version $unsupportedVersion. The current max supported version is 1.",
|
|
728
|
+
[SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE]: "The transaction has a durable nonce lifetime (with nonce `$nonce`), but the nonce account address is in a lookup table. The lifetime constraint cannot be constructed without fetching the lookup tables for the transaction.",
|
|
729
|
+
[SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_MASK_PRIORITY_FEE_BITS]: "Invalid transaction config mask: $mask. Bits 0 and 1 must match (both set or both unset)",
|
|
730
|
+
[SOLANA_ERROR__TRANSACTION__MALFORMED_MESSAGE_BYTES]: "Transaction message bytes are malformed: $messageBytes",
|
|
731
|
+
[SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_MESSAGE_BYTES]: "Transaction message bytes are empty, so the transaction cannot be encoded",
|
|
732
|
+
[SOLANA_ERROR__TRANSACTION__CANNOT_DECODE_EMPTY_TRANSACTION_BYTES]: "Transaction bytes are empty, so no transaction can be decoded",
|
|
733
|
+
[SOLANA_ERROR__TRANSACTION__VERSION_ZERO_MUST_BE_ENCODED_WITH_SIGNATURES_FIRST]: "Transaction version 0 must be encoded with signatures first. This transaction was encoded with first byte $firstByte, which is expected to be a signature count for v0 transactions.",
|
|
734
|
+
[SOLANA_ERROR__TRANSACTION__SIGNATURE_COUNT_TOO_HIGH_FOR_TRANSACTION_BYTES]: "The provided transaction bytes expect that there should be $numExpectedSignatures signatures, but the bytes are not long enough to contain a transaction message with this many signatures. The provided bytes are $transactionBytesLength bytes long.",
|
|
735
|
+
[SOLANA_ERROR__TRANSACTION__INVALID_HEAP_SIZE]: "Transaction heap size must be an integer multiple of $multipleOf bytes in the range [$minHeapSize, $maxHeapSize]. `$heapSize` given",
|
|
736
|
+
[SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX]: "The transaction has a durable nonce lifetime, but the nonce account index is invalid. Expected a nonce account index less than $numberOfStaticAccounts, got $nonceAccountIndex.",
|
|
737
|
+
[SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_VALUE_KIND]: "The transaction config value for $configName has the incorrect kind. Expected $expectedKind, got $actualKind.",
|
|
738
|
+
[SOLANA_ERROR__TRANSACTION__INSTRUCTION_HEADERS_PAYLOADS_MISMATCH]: "The transaction does not have the same number of instruction headers and instruction payloads. Got $numInstructionHeaders instruction headers, and $numInstructionPayloads instruction payloads.",
|
|
739
|
+
[SOLANA_ERROR__TRANSACTION__TOO_MANY_SIGNER_ADDRESSES]: "Transaction has $actualCount unique signer addresses but the maximum allowed is $maxAllowed",
|
|
740
|
+
[SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNT_ADDRESSES]: "Transaction has $actualCount unique account addresses but the maximum allowed is $maxAllowed",
|
|
741
|
+
[SOLANA_ERROR__TRANSACTION__TOO_MANY_INSTRUCTIONS]: "Transaction has $actualCount instructions but the maximum allowed is $maxAllowed",
|
|
742
|
+
[SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNTS_IN_INSTRUCTION]: "The instruction at index $instructionIndex has $actualCount account references but the maximum allowed is $maxAllowed",
|
|
743
|
+
[SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_ACCOUNT_INDEX_OUT_OF_RANGE]: "Could not find an account address at index $index while decompiling an instruction",
|
|
744
|
+
[SOLANA_ERROR__TRANSACTION_INTROSPECTION__CANNOT_DECODE_JSON_PARSED_TRANSACTION]: "`getTransaction` responses fetched with `encoding: 'jsonParsed'` cannot be decoded. Re-fetch the transaction with `encoding: 'base64'`, `'base58'`, or `'json'`",
|
|
745
|
+
[SOLANA_ERROR__TRANSACTION_INTROSPECTION__UNRECOGNIZED_GET_TRANSACTION_RESPONSE]: "Could not recognize the shape of this `getTransaction` response. Expected a response fetched with `encoding: 'base64'`, `'base58'`, or `'json'`",
|
|
746
|
+
[SOLANA_ERROR__REACT__MISSING_CAPABILITY]: "`$hookName` requires the following capabilities to be installed on the client: [$capabilities]. $providerHint",
|
|
747
|
+
[SOLANA_ERROR__REACT__MISSING_PROVIDER]: "`$hookName` was called outside of a `ClientProvider`. Mount a `<ClientProvider client={client}>` in the ancestor tree.",
|
|
748
|
+
[SOLANA_ERROR__REACT__SUBSCRIPTION_CLOSED_WITHOUT_ERROR]: "The subscription closed in an error state but did not report an error.",
|
|
749
|
+
[SOLANA_ERROR__WALLET__NOT_CONNECTED]: "Cannot $operation: no wallet connected",
|
|
750
|
+
[SOLANA_ERROR__WALLET__NO_SIGNER_CONNECTED]: "No signing wallet connected (status: $status)",
|
|
751
|
+
[SOLANA_ERROR__WALLET__SIGNER_NOT_AVAILABLE]: "Connected wallet does not support signing",
|
|
752
|
+
[SOLANA_ERROR__WALLET__ACCOUNT_NOT_AVAILABLE]: 'Account $address is not available in wallet "$walletName"'
|
|
753
|
+
};
|
|
754
|
+
var INSTRUCTION_ERROR_RANGE_SIZE = 1e3;
|
|
755
|
+
var START_INDEX = "i";
|
|
756
|
+
var TYPE = "t";
|
|
757
|
+
function getHumanReadableErrorMessage(code, context = {}) {
|
|
758
|
+
const messageFormatString = SolanaErrorMessages[code];
|
|
759
|
+
if (messageFormatString.length === 0) {
|
|
760
|
+
return "";
|
|
761
|
+
}
|
|
762
|
+
let state;
|
|
763
|
+
function commitStateUpTo(endIndex) {
|
|
764
|
+
if (state[TYPE] === 2) {
|
|
765
|
+
const variableName = messageFormatString.slice(state[START_INDEX] + 1, endIndex);
|
|
766
|
+
fragments.push(
|
|
767
|
+
variableName in context ? (
|
|
768
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
769
|
+
`${context[variableName]}`
|
|
770
|
+
) : `$${variableName}`
|
|
771
|
+
);
|
|
772
|
+
} else if (state[TYPE] === 1) {
|
|
773
|
+
fragments.push(messageFormatString.slice(state[START_INDEX], endIndex));
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
const fragments = [];
|
|
777
|
+
messageFormatString.split("").forEach((char, ii) => {
|
|
778
|
+
if (ii === 0) {
|
|
779
|
+
state = {
|
|
780
|
+
[START_INDEX]: 0,
|
|
781
|
+
[TYPE]: messageFormatString[0] === "\\" ? 0 : messageFormatString[0] === "$" ? 2 : 1
|
|
782
|
+
/* Text */
|
|
783
|
+
};
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
let nextState;
|
|
787
|
+
switch (state[TYPE]) {
|
|
788
|
+
case 0:
|
|
789
|
+
nextState = {
|
|
790
|
+
[START_INDEX]: ii,
|
|
791
|
+
[TYPE]: 1
|
|
792
|
+
/* Text */
|
|
793
|
+
};
|
|
794
|
+
break;
|
|
795
|
+
case 1:
|
|
796
|
+
if (char === "\\") {
|
|
797
|
+
nextState = {
|
|
798
|
+
[START_INDEX]: ii,
|
|
799
|
+
[TYPE]: 0
|
|
800
|
+
/* EscapeSequence */
|
|
801
|
+
};
|
|
802
|
+
} else if (char === "$") {
|
|
803
|
+
nextState = {
|
|
804
|
+
[START_INDEX]: ii,
|
|
805
|
+
[TYPE]: 2
|
|
806
|
+
/* Variable */
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
break;
|
|
810
|
+
case 2:
|
|
811
|
+
if (char === "\\") {
|
|
812
|
+
nextState = {
|
|
813
|
+
[START_INDEX]: ii,
|
|
814
|
+
[TYPE]: 0
|
|
815
|
+
/* EscapeSequence */
|
|
816
|
+
};
|
|
817
|
+
} else if (char === "$") {
|
|
818
|
+
nextState = {
|
|
819
|
+
[START_INDEX]: ii,
|
|
820
|
+
[TYPE]: 2
|
|
821
|
+
/* Variable */
|
|
822
|
+
};
|
|
823
|
+
} else if (!char.match(/\w/)) {
|
|
824
|
+
nextState = {
|
|
825
|
+
[START_INDEX]: ii,
|
|
826
|
+
[TYPE]: 1
|
|
827
|
+
/* Text */
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
break;
|
|
831
|
+
}
|
|
832
|
+
if (nextState) {
|
|
833
|
+
if (state !== nextState) {
|
|
834
|
+
commitStateUpTo(ii);
|
|
835
|
+
}
|
|
836
|
+
state = nextState;
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
commitStateUpTo();
|
|
840
|
+
let message = fragments.join("");
|
|
841
|
+
if (code >= SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN && code < SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN + INSTRUCTION_ERROR_RANGE_SIZE && "index" in context) {
|
|
842
|
+
message += ` (instruction #${context.index + 1})`;
|
|
843
|
+
}
|
|
844
|
+
return message;
|
|
845
|
+
}
|
|
846
|
+
function getErrorMessage(code, context = {}) {
|
|
847
|
+
if (process.env.NODE_ENV !== "production") {
|
|
848
|
+
return getHumanReadableErrorMessage(code, context);
|
|
849
|
+
} else {
|
|
850
|
+
let decodingAdviceMessage = `Solana error #${code}; Decode this error by running \`npx @solana/errors decode -- ${code}`;
|
|
851
|
+
if (Object.keys(context).length) {
|
|
852
|
+
decodingAdviceMessage += ` '${encodeContextObject(context)}'`;
|
|
853
|
+
}
|
|
854
|
+
return `${decodingAdviceMessage}\``;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
var SolanaError = class extends Error {
|
|
858
|
+
/**
|
|
859
|
+
* Indicates the root cause of this {@link SolanaError}, if any.
|
|
860
|
+
*
|
|
861
|
+
* For example, a transaction error might have an instruction error as its root cause. In this
|
|
862
|
+
* case, you will be able to access the instruction error on the transaction error as `cause`.
|
|
863
|
+
*/
|
|
864
|
+
cause = this.cause;
|
|
865
|
+
/**
|
|
866
|
+
* Contains context that can assist in understanding or recovering from a {@link SolanaError}.
|
|
867
|
+
*/
|
|
868
|
+
context;
|
|
869
|
+
constructor(...[code, contextAndErrorOptions]) {
|
|
870
|
+
let context;
|
|
871
|
+
let errorOptions;
|
|
872
|
+
if (contextAndErrorOptions) {
|
|
873
|
+
Object.entries(Object.getOwnPropertyDescriptors(contextAndErrorOptions)).forEach(([name, descriptor]) => {
|
|
874
|
+
if (name === "cause") {
|
|
875
|
+
errorOptions = { cause: descriptor.value };
|
|
876
|
+
} else {
|
|
877
|
+
if (context === void 0) {
|
|
878
|
+
context = {
|
|
879
|
+
__code: code
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
Object.defineProperty(context, name, descriptor);
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
const message = getErrorMessage(code, context);
|
|
887
|
+
super(message, errorOptions);
|
|
888
|
+
this.context = Object.freeze(
|
|
889
|
+
context === void 0 ? {
|
|
890
|
+
__code: code
|
|
891
|
+
} : context
|
|
892
|
+
);
|
|
893
|
+
this.name = "SolanaError";
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
// node_modules/@solana/instructions/dist/index.node.mjs
|
|
898
|
+
var AccountRole = /* @__PURE__ */ ((AccountRole22) => {
|
|
899
|
+
AccountRole22[AccountRole22["WRITABLE_SIGNER"] = /* 3 */
|
|
900
|
+
3] = "WRITABLE_SIGNER";
|
|
901
|
+
AccountRole22[AccountRole22["READONLY_SIGNER"] = /* 2 */
|
|
902
|
+
2] = "READONLY_SIGNER";
|
|
903
|
+
AccountRole22[AccountRole22["WRITABLE"] = /* 1 */
|
|
904
|
+
1] = "WRITABLE";
|
|
905
|
+
AccountRole22[AccountRole22["READONLY"] = /* 0 */
|
|
906
|
+
0] = "READONLY";
|
|
907
|
+
return AccountRole22;
|
|
908
|
+
})(AccountRole || {});
|
|
909
|
+
var IS_SIGNER_BITMASK = 2;
|
|
910
|
+
function upgradeRoleToSigner(role) {
|
|
911
|
+
return role | IS_SIGNER_BITMASK;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// node_modules/@solana/signers/dist/index.node.mjs
|
|
915
|
+
function isTransactionModifyingSigner(value) {
|
|
916
|
+
return "modifyAndSignTransactions" in value && typeof value.modifyAndSignTransactions === "function";
|
|
917
|
+
}
|
|
918
|
+
function isTransactionPartialSigner(value) {
|
|
919
|
+
return "signTransactions" in value && typeof value.signTransactions === "function";
|
|
920
|
+
}
|
|
921
|
+
function isTransactionSendingSigner(value) {
|
|
922
|
+
return "signAndSendTransactions" in value && typeof value.signAndSendTransactions === "function";
|
|
923
|
+
}
|
|
924
|
+
function isTransactionSigner(value) {
|
|
925
|
+
return isTransactionPartialSigner(value) || isTransactionModifyingSigner(value) || isTransactionSendingSigner(value);
|
|
926
|
+
}
|
|
927
|
+
var o = globalThis.TextEncoder;
|
|
928
|
+
|
|
929
|
+
// node_modules/@solana/program-client-core/dist/index.node.mjs
|
|
930
|
+
function getNonNullResolvedInstructionInput(inputName, value) {
|
|
931
|
+
if (value === null || value === void 0) {
|
|
932
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_NON_NULL, {
|
|
933
|
+
inputName
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
return value;
|
|
937
|
+
}
|
|
938
|
+
function getAddressFromResolvedInstructionAccount(inputName, value) {
|
|
939
|
+
const nonNullValue = getNonNullResolvedInstructionInput(inputName, value);
|
|
940
|
+
if (typeof value === "object" && "address" in nonNullValue) {
|
|
941
|
+
return nonNullValue.address;
|
|
942
|
+
}
|
|
943
|
+
if (Array.isArray(nonNullValue)) {
|
|
944
|
+
return nonNullValue[0];
|
|
945
|
+
}
|
|
946
|
+
return nonNullValue;
|
|
947
|
+
}
|
|
948
|
+
function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
949
|
+
return (inputName, account) => {
|
|
950
|
+
if (!account.value) {
|
|
951
|
+
if (optionalAccountStrategy === "omitted") return;
|
|
952
|
+
return Object.freeze({ address: programAddress, role: AccountRole.READONLY });
|
|
953
|
+
}
|
|
954
|
+
const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
|
|
955
|
+
const isSigner = isResolvedInstructionAccountSigner(account.value);
|
|
956
|
+
return Object.freeze({
|
|
957
|
+
address: getAddressFromResolvedInstructionAccount(inputName, account.value),
|
|
958
|
+
role: isSigner ? upgradeRoleToSigner(writableRole) : writableRole,
|
|
959
|
+
...isSigner ? { signer: account.value } : {}
|
|
960
|
+
});
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
function isResolvedInstructionAccountSigner(value) {
|
|
964
|
+
return !!value && typeof value === "object" && "address" in value && typeof value.address === "string" && isTransactionSigner(value);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
// src/clients/typescript/src/safe-codecs.ts
|
|
968
|
+
var safe_codecs_exports = {};
|
|
969
|
+
__export(safe_codecs_exports, {
|
|
970
|
+
getI128Encoder: () => getI128Encoder,
|
|
971
|
+
getI64Encoder: () => getI64Encoder,
|
|
972
|
+
getU128Encoder: () => getU128Encoder,
|
|
973
|
+
getU64Encoder: () => getU64Encoder
|
|
974
|
+
});
|
|
975
|
+
__reExport(safe_codecs_exports, kit_star);
|
|
976
|
+
import {
|
|
977
|
+
getI64Encoder as kitI64Encoder,
|
|
978
|
+
getI128Encoder as kitI128Encoder,
|
|
979
|
+
getU64Encoder as kitU64Encoder,
|
|
980
|
+
getU128Encoder as kitU128Encoder
|
|
981
|
+
} from "@solana/kit";
|
|
982
|
+
import * as kit_star from "@solana/kit";
|
|
983
|
+
var U64_MAX = 0xffffffffffffffffn;
|
|
984
|
+
var U128_MAX = 0xffffffffffffffffffffffffffffffffn;
|
|
985
|
+
var I64_MIN = -0x8000000000000000n;
|
|
986
|
+
var I64_MAX = 0x7fffffffffffffffn;
|
|
987
|
+
var I128_MIN = -0x80000000000000000000000000000000n;
|
|
988
|
+
var I128_MAX = 0x7fffffffffffffffffffffffffffffffn;
|
|
989
|
+
function coerce(label, value, min, max) {
|
|
990
|
+
if (typeof value === "bigint") {
|
|
991
|
+
if (value < min || value > max) {
|
|
992
|
+
throw new RangeError(`${label}: value ${value} out of range [${min}, ${max}]`);
|
|
993
|
+
}
|
|
994
|
+
return value;
|
|
995
|
+
}
|
|
996
|
+
if (typeof value !== "number") {
|
|
997
|
+
throw new TypeError(`${label}: expected bigint, got ${typeof value}`);
|
|
998
|
+
}
|
|
999
|
+
if (!Number.isSafeInteger(value)) {
|
|
1000
|
+
throw new TypeError(
|
|
1001
|
+
`${label}: expected bigint; got number ${value}. JS numbers above 2^53-1 round silently, pass BigInt(...) instead.`
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
1004
|
+
const bn = BigInt(value);
|
|
1005
|
+
if (bn < min || bn > max) {
|
|
1006
|
+
throw new RangeError(`${label}: value ${bn} out of range [${min}, ${max}]`);
|
|
1007
|
+
}
|
|
1008
|
+
return bn;
|
|
1009
|
+
}
|
|
1010
|
+
function guardEncoder(label, inner, min, max) {
|
|
1011
|
+
return {
|
|
1012
|
+
fixedSize: inner.fixedSize,
|
|
1013
|
+
write(value, bytes, offset) {
|
|
1014
|
+
return inner.write(coerce(label, value, min, max), bytes, offset);
|
|
1015
|
+
},
|
|
1016
|
+
encode(value) {
|
|
1017
|
+
return inner.encode(coerce(label, value, min, max));
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
function getU64Encoder() {
|
|
1022
|
+
return guardEncoder("u64", kitU64Encoder(), 0n, U64_MAX);
|
|
1023
|
+
}
|
|
1024
|
+
function getU128Encoder() {
|
|
1025
|
+
return guardEncoder("u128", kitU128Encoder(), 0n, U128_MAX);
|
|
1026
|
+
}
|
|
1027
|
+
function getI64Encoder() {
|
|
1028
|
+
return guardEncoder("i64", kitI64Encoder(), I64_MIN, I64_MAX);
|
|
1029
|
+
}
|
|
1030
|
+
function getI128Encoder() {
|
|
1031
|
+
return guardEncoder("i128", kitI128Encoder(), I128_MIN, I128_MAX);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
// src/clients/typescript/src/generated/pdas/eventAuthority.ts
|
|
1035
|
+
import {
|
|
1036
|
+
getProgramDerivedAddress,
|
|
1037
|
+
getUtf8Encoder
|
|
1038
|
+
} from "@solana/kit";
|
|
1039
|
+
async function findEventAuthorityPda(config = {}) {
|
|
1040
|
+
const {
|
|
1041
|
+
programAddress = "CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX"
|
|
1042
|
+
} = config;
|
|
1043
|
+
return await getProgramDerivedAddress({
|
|
1044
|
+
programAddress,
|
|
1045
|
+
seeds: [getUtf8Encoder().encode("event_authority")]
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
// src/clients/typescript/src/generated/programs/paymentChannels.ts
|
|
1050
|
+
import {
|
|
1051
|
+
assertIsInstructionWithAccounts,
|
|
1052
|
+
containsBytes,
|
|
1053
|
+
extendClient,
|
|
1054
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION as SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION2,
|
|
1055
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE as SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE2,
|
|
1056
|
+
SolanaError as SolanaError11
|
|
1057
|
+
} from "@solana/kit";
|
|
1058
|
+
|
|
1059
|
+
// src/clients/typescript/src/generated/accounts/channel.ts
|
|
1060
|
+
import {
|
|
1061
|
+
assertAccountExists,
|
|
1062
|
+
assertAccountsExist,
|
|
1063
|
+
combineCodec as combineCodec14,
|
|
1064
|
+
decodeAccount,
|
|
1065
|
+
fetchEncodedAccount,
|
|
1066
|
+
fetchEncodedAccounts,
|
|
1067
|
+
getAddressDecoder as getAddressDecoder5,
|
|
1068
|
+
getAddressEncoder as getAddressEncoder5,
|
|
1069
|
+
getArrayDecoder as getArrayDecoder4,
|
|
1070
|
+
getArrayEncoder as getArrayEncoder4,
|
|
1071
|
+
getStructDecoder as getStructDecoder10,
|
|
1072
|
+
getStructEncoder as getStructEncoder10
|
|
1073
|
+
} from "@solana/kit";
|
|
1074
|
+
|
|
1075
|
+
// src/clients/typescript/src/generated/types/accountDiscriminator.ts
|
|
1076
|
+
import {
|
|
1077
|
+
combineCodec,
|
|
1078
|
+
getEnumDecoder,
|
|
1079
|
+
getEnumEncoder
|
|
1080
|
+
} from "@solana/kit";
|
|
1081
|
+
|
|
1082
|
+
// src/clients/typescript/src/generated/types/channelStatus.ts
|
|
1083
|
+
import {
|
|
1084
|
+
combineCodec as combineCodec2,
|
|
1085
|
+
getEnumDecoder as getEnumDecoder2,
|
|
1086
|
+
getEnumEncoder as getEnumEncoder2
|
|
1087
|
+
} from "@solana/kit";
|
|
1088
|
+
|
|
1089
|
+
// src/clients/typescript/src/generated/types/distributeArgs.ts
|
|
1090
|
+
import {
|
|
1091
|
+
combineCodec as combineCodec3,
|
|
1092
|
+
getArrayDecoder,
|
|
1093
|
+
getArrayEncoder,
|
|
1094
|
+
getStructDecoder,
|
|
1095
|
+
getStructEncoder
|
|
1096
|
+
} from "@solana/kit";
|
|
1097
|
+
|
|
1098
|
+
// src/clients/typescript/src/generated/types/distributionEntry.ts
|
|
1099
|
+
import {
|
|
1100
|
+
combineCodec as combineCodec4,
|
|
1101
|
+
getAddressDecoder,
|
|
1102
|
+
getAddressEncoder,
|
|
1103
|
+
getStructDecoder as getStructDecoder2,
|
|
1104
|
+
getStructEncoder as getStructEncoder2
|
|
1105
|
+
} from "@solana/kit";
|
|
1106
|
+
function getDistributionEntryEncoder() {
|
|
1107
|
+
return getStructEncoder2([
|
|
1108
|
+
["recipient", getAddressEncoder()],
|
|
1109
|
+
["bps", (0, safe_codecs_exports.getU16Encoder)()]
|
|
1110
|
+
]);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
// src/clients/typescript/src/generated/types/openArgs.ts
|
|
1114
|
+
import {
|
|
1115
|
+
combineCodec as combineCodec5,
|
|
1116
|
+
getArrayDecoder as getArrayDecoder2,
|
|
1117
|
+
getArrayEncoder as getArrayEncoder2,
|
|
1118
|
+
getStructDecoder as getStructDecoder3,
|
|
1119
|
+
getStructEncoder as getStructEncoder3
|
|
1120
|
+
} from "@solana/kit";
|
|
1121
|
+
function getOpenArgsEncoder() {
|
|
1122
|
+
return getStructEncoder3([
|
|
1123
|
+
["salt", getU64Encoder()],
|
|
1124
|
+
["deposit", getU64Encoder()],
|
|
1125
|
+
["gracePeriod", (0, safe_codecs_exports.getU32Encoder)()],
|
|
1126
|
+
["openSlot", getU64Encoder()],
|
|
1127
|
+
["recipients", getArrayEncoder2(getDistributionEntryEncoder())]
|
|
1128
|
+
]);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
// src/clients/typescript/src/generated/types/opened.ts
|
|
1132
|
+
import {
|
|
1133
|
+
combineCodec as combineCodec6,
|
|
1134
|
+
getAddressDecoder as getAddressDecoder2,
|
|
1135
|
+
getAddressEncoder as getAddressEncoder2,
|
|
1136
|
+
getStructDecoder as getStructDecoder4,
|
|
1137
|
+
getStructEncoder as getStructEncoder4
|
|
1138
|
+
} from "@solana/kit";
|
|
1139
|
+
|
|
1140
|
+
// src/clients/typescript/src/generated/types/payoutBeneficiary.ts
|
|
1141
|
+
import {
|
|
1142
|
+
combineCodec as combineCodec7,
|
|
1143
|
+
getEnumDecoder as getEnumDecoder3,
|
|
1144
|
+
getEnumEncoder as getEnumEncoder3
|
|
1145
|
+
} from "@solana/kit";
|
|
1146
|
+
|
|
1147
|
+
// src/clients/typescript/src/generated/types/payoutRedirected.ts
|
|
1148
|
+
import {
|
|
1149
|
+
combineCodec as combineCodec8,
|
|
1150
|
+
getAddressDecoder as getAddressDecoder3,
|
|
1151
|
+
getAddressEncoder as getAddressEncoder3,
|
|
1152
|
+
getStructDecoder as getStructDecoder5,
|
|
1153
|
+
getStructEncoder as getStructEncoder5
|
|
1154
|
+
} from "@solana/kit";
|
|
1155
|
+
|
|
1156
|
+
// src/clients/typescript/src/generated/types/redirectReason.ts
|
|
1157
|
+
import {
|
|
1158
|
+
combineCodec as combineCodec9,
|
|
1159
|
+
getEnumDecoder as getEnumDecoder4,
|
|
1160
|
+
getEnumEncoder as getEnumEncoder4
|
|
1161
|
+
} from "@solana/kit";
|
|
1162
|
+
|
|
1163
|
+
// src/clients/typescript/src/generated/types/settleAndSealArgs.ts
|
|
1164
|
+
import {
|
|
1165
|
+
combineCodec as combineCodec10,
|
|
1166
|
+
getStructDecoder as getStructDecoder6,
|
|
1167
|
+
getStructEncoder as getStructEncoder6
|
|
1168
|
+
} from "@solana/kit";
|
|
1169
|
+
|
|
1170
|
+
// src/clients/typescript/src/generated/types/settlementWatermarks.ts
|
|
1171
|
+
import {
|
|
1172
|
+
combineCodec as combineCodec11,
|
|
1173
|
+
getStructDecoder as getStructDecoder7,
|
|
1174
|
+
getStructEncoder as getStructEncoder7
|
|
1175
|
+
} from "@solana/kit";
|
|
1176
|
+
|
|
1177
|
+
// src/clients/typescript/src/generated/types/topUpArgs.ts
|
|
1178
|
+
import {
|
|
1179
|
+
combineCodec as combineCodec12,
|
|
1180
|
+
getStructDecoder as getStructDecoder8,
|
|
1181
|
+
getStructEncoder as getStructEncoder8
|
|
1182
|
+
} from "@solana/kit";
|
|
1183
|
+
function getTopUpArgsEncoder() {
|
|
1184
|
+
return getStructEncoder8([["amount", getU64Encoder()]]);
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
// src/clients/typescript/src/generated/types/voucherArgs.ts
|
|
1188
|
+
import {
|
|
1189
|
+
combineCodec as combineCodec13,
|
|
1190
|
+
getAddressDecoder as getAddressDecoder4,
|
|
1191
|
+
getAddressEncoder as getAddressEncoder4,
|
|
1192
|
+
getArrayDecoder as getArrayDecoder3,
|
|
1193
|
+
getArrayEncoder as getArrayEncoder3,
|
|
1194
|
+
getStructDecoder as getStructDecoder9,
|
|
1195
|
+
getStructEncoder as getStructEncoder9
|
|
1196
|
+
} from "@solana/kit";
|
|
1197
|
+
|
|
1198
|
+
// src/clients/typescript/src/generated/instructions/distribute.ts
|
|
1199
|
+
import {
|
|
1200
|
+
AccountRole as AccountRole2,
|
|
1201
|
+
combineCodec as combineCodec15,
|
|
1202
|
+
getStructDecoder as getStructDecoder11,
|
|
1203
|
+
getStructEncoder as getStructEncoder11,
|
|
1204
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS2,
|
|
1205
|
+
SolanaError as SolanaError2,
|
|
1206
|
+
transformEncoder
|
|
1207
|
+
} from "@solana/kit";
|
|
1208
|
+
|
|
1209
|
+
// src/clients/typescript/src/generated/instructions/emitEvent.ts
|
|
1210
|
+
import {
|
|
1211
|
+
combineCodec as combineCodec16,
|
|
1212
|
+
getStructDecoder as getStructDecoder12,
|
|
1213
|
+
getStructEncoder as getStructEncoder12,
|
|
1214
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS3,
|
|
1215
|
+
SolanaError as SolanaError3,
|
|
1216
|
+
transformEncoder as transformEncoder2
|
|
1217
|
+
} from "@solana/kit";
|
|
1218
|
+
|
|
1219
|
+
// src/clients/typescript/src/generated/instructions/reclaim.ts
|
|
1220
|
+
import {
|
|
1221
|
+
combineCodec as combineCodec17,
|
|
1222
|
+
getStructDecoder as getStructDecoder13,
|
|
1223
|
+
getStructEncoder as getStructEncoder13,
|
|
1224
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS4,
|
|
1225
|
+
SolanaError as SolanaError4,
|
|
1226
|
+
transformEncoder as transformEncoder3
|
|
1227
|
+
} from "@solana/kit";
|
|
1228
|
+
|
|
1229
|
+
// src/clients/typescript/src/generated/instructions/requestClose.ts
|
|
1230
|
+
import {
|
|
1231
|
+
combineCodec as combineCodec18,
|
|
1232
|
+
getStructDecoder as getStructDecoder14,
|
|
1233
|
+
getStructEncoder as getStructEncoder14,
|
|
1234
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS5,
|
|
1235
|
+
SolanaError as SolanaError5,
|
|
1236
|
+
transformEncoder as transformEncoder4
|
|
1237
|
+
} from "@solana/kit";
|
|
1238
|
+
|
|
1239
|
+
// src/clients/typescript/src/generated/instructions/seal.ts
|
|
1240
|
+
import {
|
|
1241
|
+
combineCodec as combineCodec19,
|
|
1242
|
+
getStructDecoder as getStructDecoder15,
|
|
1243
|
+
getStructEncoder as getStructEncoder15,
|
|
1244
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS6,
|
|
1245
|
+
SolanaError as SolanaError6,
|
|
1246
|
+
transformEncoder as transformEncoder5
|
|
1247
|
+
} from "@solana/kit";
|
|
1248
|
+
|
|
1249
|
+
// src/clients/typescript/src/generated/instructions/settle.ts
|
|
1250
|
+
import {
|
|
1251
|
+
combineCodec as combineCodec20,
|
|
1252
|
+
getStructDecoder as getStructDecoder16,
|
|
1253
|
+
getStructEncoder as getStructEncoder16,
|
|
1254
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS7,
|
|
1255
|
+
SolanaError as SolanaError7,
|
|
1256
|
+
transformEncoder as transformEncoder6
|
|
1257
|
+
} from "@solana/kit";
|
|
1258
|
+
|
|
1259
|
+
// src/clients/typescript/src/generated/instructions/settleAndSeal.ts
|
|
1260
|
+
import {
|
|
1261
|
+
combineCodec as combineCodec21,
|
|
1262
|
+
getStructDecoder as getStructDecoder17,
|
|
1263
|
+
getStructEncoder as getStructEncoder17,
|
|
1264
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS8,
|
|
1265
|
+
SolanaError as SolanaError8,
|
|
1266
|
+
transformEncoder as transformEncoder7
|
|
1267
|
+
} from "@solana/kit";
|
|
1268
|
+
|
|
1269
|
+
// src/clients/typescript/src/generated/instructions/topUp.ts
|
|
1270
|
+
import {
|
|
1271
|
+
combineCodec as combineCodec22,
|
|
1272
|
+
getStructDecoder as getStructDecoder18,
|
|
1273
|
+
getStructEncoder as getStructEncoder18,
|
|
1274
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS9,
|
|
1275
|
+
SolanaError as SolanaError9,
|
|
1276
|
+
transformEncoder as transformEncoder8
|
|
1277
|
+
} from "@solana/kit";
|
|
1278
|
+
var TOP_UP_DISCRIMINATOR = 3;
|
|
1279
|
+
function getTopUpInstructionDataEncoder() {
|
|
1280
|
+
return transformEncoder8(
|
|
1281
|
+
getStructEncoder18([
|
|
1282
|
+
["discriminator", (0, safe_codecs_exports.getU8Encoder)()],
|
|
1283
|
+
["topUpArgs", getTopUpArgsEncoder()]
|
|
1284
|
+
]),
|
|
1285
|
+
(value) => ({ ...value, discriminator: TOP_UP_DISCRIMINATOR })
|
|
1286
|
+
);
|
|
1287
|
+
}
|
|
1288
|
+
function getTopUpInstruction(input, config) {
|
|
1289
|
+
const programAddress = config?.programAddress ?? PAYMENT_CHANNELS_PROGRAM_ADDRESS;
|
|
1290
|
+
const originalAccounts = {
|
|
1291
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
1292
|
+
channel: { value: input.channel ?? null, isWritable: true },
|
|
1293
|
+
payerTokenAccount: {
|
|
1294
|
+
value: input.payerTokenAccount ?? null,
|
|
1295
|
+
isWritable: true
|
|
1296
|
+
},
|
|
1297
|
+
channelTokenAccount: {
|
|
1298
|
+
value: input.channelTokenAccount ?? null,
|
|
1299
|
+
isWritable: true
|
|
1300
|
+
},
|
|
1301
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1302
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false }
|
|
1303
|
+
};
|
|
1304
|
+
const accounts = originalAccounts;
|
|
1305
|
+
const args = { ...input };
|
|
1306
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1307
|
+
return Object.freeze({
|
|
1308
|
+
accounts: [
|
|
1309
|
+
getAccountMeta("payer", accounts.payer),
|
|
1310
|
+
getAccountMeta("channel", accounts.channel),
|
|
1311
|
+
getAccountMeta("payerTokenAccount", accounts.payerTokenAccount),
|
|
1312
|
+
getAccountMeta("channelTokenAccount", accounts.channelTokenAccount),
|
|
1313
|
+
getAccountMeta("mint", accounts.mint),
|
|
1314
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram)
|
|
1315
|
+
],
|
|
1316
|
+
data: getTopUpInstructionDataEncoder().encode(
|
|
1317
|
+
args
|
|
1318
|
+
),
|
|
1319
|
+
programAddress
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
// src/clients/typescript/src/generated/instructions/withdrawPayer.ts
|
|
1324
|
+
import {
|
|
1325
|
+
combineCodec as combineCodec23,
|
|
1326
|
+
getStructDecoder as getStructDecoder19,
|
|
1327
|
+
getStructEncoder as getStructEncoder19,
|
|
1328
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS as SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS10,
|
|
1329
|
+
SolanaError as SolanaError10,
|
|
1330
|
+
transformEncoder as transformEncoder9
|
|
1331
|
+
} from "@solana/kit";
|
|
1332
|
+
|
|
1333
|
+
// src/clients/typescript/src/generated/programs/paymentChannels.ts
|
|
1334
|
+
var PAYMENT_CHANNELS_PROGRAM_ADDRESS = "CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX";
|
|
1335
|
+
|
|
1336
|
+
// src/clients/typescript/src/generated/instructions/open.ts
|
|
1337
|
+
var OPEN_DISCRIMINATOR = 1;
|
|
1338
|
+
function getOpenInstructionDataEncoder() {
|
|
1339
|
+
return transformEncoder10(
|
|
1340
|
+
getStructEncoder20([
|
|
1341
|
+
["discriminator", (0, safe_codecs_exports.getU8Encoder)()],
|
|
1342
|
+
["openArgs", getOpenArgsEncoder()]
|
|
1343
|
+
]),
|
|
1344
|
+
(value) => ({ ...value, discriminator: OPEN_DISCRIMINATOR })
|
|
1345
|
+
);
|
|
1346
|
+
}
|
|
1347
|
+
async function getOpenInstructionAsync(input, config) {
|
|
1348
|
+
const programAddress = config?.programAddress ?? PAYMENT_CHANNELS_PROGRAM_ADDRESS;
|
|
1349
|
+
const originalAccounts = {
|
|
1350
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
1351
|
+
rentPayer: { value: input.rentPayer ?? null, isWritable: true },
|
|
1352
|
+
payee: { value: input.payee ?? null, isWritable: false },
|
|
1353
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1354
|
+
authorizedSigner: {
|
|
1355
|
+
value: input.authorizedSigner ?? null,
|
|
1356
|
+
isWritable: false
|
|
1357
|
+
},
|
|
1358
|
+
channel: { value: input.channel ?? null, isWritable: true },
|
|
1359
|
+
payerTokenAccount: {
|
|
1360
|
+
value: input.payerTokenAccount ?? null,
|
|
1361
|
+
isWritable: true
|
|
1362
|
+
},
|
|
1363
|
+
channelTokenAccount: {
|
|
1364
|
+
value: input.channelTokenAccount ?? null,
|
|
1365
|
+
isWritable: true
|
|
1366
|
+
},
|
|
1367
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1368
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1369
|
+
rent: { value: input.rent ?? null, isWritable: false },
|
|
1370
|
+
associatedTokenProgram: {
|
|
1371
|
+
value: input.associatedTokenProgram ?? null,
|
|
1372
|
+
isWritable: false
|
|
1373
|
+
},
|
|
1374
|
+
eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },
|
|
1375
|
+
selfProgram: { value: input.selfProgram ?? null, isWritable: false }
|
|
1376
|
+
};
|
|
1377
|
+
const accounts = originalAccounts;
|
|
1378
|
+
const args = { ...input };
|
|
1379
|
+
if (!accounts.systemProgram.value) {
|
|
1380
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1381
|
+
}
|
|
1382
|
+
if (!accounts.eventAuthority.value) {
|
|
1383
|
+
accounts.eventAuthority.value = await findEventAuthorityPda();
|
|
1384
|
+
}
|
|
1385
|
+
if (!accounts.selfProgram.value) {
|
|
1386
|
+
accounts.selfProgram.value = "CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX";
|
|
1387
|
+
}
|
|
1388
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1389
|
+
return Object.freeze({
|
|
1390
|
+
accounts: [
|
|
1391
|
+
getAccountMeta("payer", accounts.payer),
|
|
1392
|
+
getAccountMeta("rentPayer", accounts.rentPayer),
|
|
1393
|
+
getAccountMeta("payee", accounts.payee),
|
|
1394
|
+
getAccountMeta("mint", accounts.mint),
|
|
1395
|
+
getAccountMeta("authorizedSigner", accounts.authorizedSigner),
|
|
1396
|
+
getAccountMeta("channel", accounts.channel),
|
|
1397
|
+
getAccountMeta("payerTokenAccount", accounts.payerTokenAccount),
|
|
1398
|
+
getAccountMeta("channelTokenAccount", accounts.channelTokenAccount),
|
|
1399
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1400
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1401
|
+
getAccountMeta("rent", accounts.rent),
|
|
1402
|
+
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
1403
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
1404
|
+
getAccountMeta("selfProgram", accounts.selfProgram)
|
|
1405
|
+
],
|
|
1406
|
+
data: getOpenInstructionDataEncoder().encode(
|
|
1407
|
+
args
|
|
1408
|
+
),
|
|
1409
|
+
programAddress
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
// src/sdk/channel.ts
|
|
1414
|
+
var USDC_MAINNET = address("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
|
|
1415
|
+
var USDC_DEVNET = address("4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU");
|
|
1416
|
+
async function findChannelPda(client, mint, salt, openSlot) {
|
|
1417
|
+
const addressEncoder = getAddressEncoder6();
|
|
1418
|
+
const u64Encoder = getU64Encoder2();
|
|
1419
|
+
const [pda] = await getProgramDerivedAddress2({
|
|
1420
|
+
programAddress: address("CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX"),
|
|
1421
|
+
seeds: [
|
|
1422
|
+
new TextEncoder().encode("channel"),
|
|
1423
|
+
addressEncoder.encode(client.payer.address),
|
|
1424
|
+
addressEncoder.encode(address(SHUNT_TREASURY)),
|
|
1425
|
+
addressEncoder.encode(mint),
|
|
1426
|
+
addressEncoder.encode(client.payer.address),
|
|
1427
|
+
u64Encoder.encode(salt),
|
|
1428
|
+
u64Encoder.encode(openSlot)
|
|
1429
|
+
]
|
|
1430
|
+
});
|
|
1431
|
+
return pda;
|
|
1432
|
+
}
|
|
1433
|
+
async function openPaymentChannel(client, depositAmount) {
|
|
1434
|
+
const USDC_MINT = devnet ? USDC_DEVNET : USDC_MAINNET;
|
|
1435
|
+
const salt = BigInt(Math.floor(Math.random() * 1e9));
|
|
1436
|
+
const gracePeriod = 86400;
|
|
1437
|
+
const currentSlot = await client.rpc.getSlot().send();
|
|
1438
|
+
const openSlot = BigInt(currentSlot);
|
|
1439
|
+
const channelPda = await findChannelPda(
|
|
1440
|
+
client,
|
|
1441
|
+
USDC_MINT,
|
|
1442
|
+
salt,
|
|
1443
|
+
openSlot
|
|
1444
|
+
);
|
|
1445
|
+
const [payerTokenAccount] = await findAssociatedTokenPda({
|
|
1446
|
+
owner: client.payer.address,
|
|
1447
|
+
mint: USDC_MINT,
|
|
1448
|
+
tokenProgram: TOKEN_PROGRAM_ADDRESS
|
|
1449
|
+
});
|
|
1450
|
+
const [channelTokenAccount] = await findAssociatedTokenPda({
|
|
1451
|
+
owner: channelPda,
|
|
1452
|
+
mint: USDC_MINT,
|
|
1453
|
+
tokenProgram: TOKEN_PROGRAM_ADDRESS
|
|
1454
|
+
});
|
|
1455
|
+
const openIx = await getOpenInstructionAsync({
|
|
1456
|
+
payer: client.payer,
|
|
1457
|
+
rentPayer: client.payer,
|
|
1458
|
+
payee: address(SHUNT_TREASURY),
|
|
1459
|
+
mint: USDC_MINT,
|
|
1460
|
+
authorizedSigner: client.payer.address,
|
|
1461
|
+
channel: channelPda,
|
|
1462
|
+
payerTokenAccount,
|
|
1463
|
+
channelTokenAccount,
|
|
1464
|
+
systemProgram: address("11111111111111111111111111111111"),
|
|
1465
|
+
tokenProgram: TOKEN_PROGRAM_ADDRESS,
|
|
1466
|
+
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
|
|
1467
|
+
rent: address("SysvarRent111111111111111111111111111111111"),
|
|
1468
|
+
// Arguments
|
|
1469
|
+
openArgs: {
|
|
1470
|
+
salt,
|
|
1471
|
+
deposit: depositAmount,
|
|
1472
|
+
gracePeriod,
|
|
1473
|
+
openSlot,
|
|
1474
|
+
recipients: []
|
|
1475
|
+
}
|
|
1476
|
+
});
|
|
1477
|
+
const signature = await sendInstructions(client, [openIx]);
|
|
1478
|
+
return { channel: channelPda, signature };
|
|
1479
|
+
}
|
|
1480
|
+
async function topUpPaymentChannel(client, channelAddress, topUpAmount) {
|
|
1481
|
+
const USDC_MINT = devnet ? USDC_DEVNET : USDC_MAINNET;
|
|
1482
|
+
const [payerTokenAccount] = await findAssociatedTokenPda({
|
|
1483
|
+
owner: client.payer.address,
|
|
1484
|
+
mint: USDC_MINT,
|
|
1485
|
+
tokenProgram: TOKEN_PROGRAM_ADDRESS
|
|
1486
|
+
});
|
|
1487
|
+
const [channelTokenAccount] = await findAssociatedTokenPda({
|
|
1488
|
+
owner: channelAddress,
|
|
1489
|
+
mint: USDC_MINT,
|
|
1490
|
+
tokenProgram: TOKEN_PROGRAM_ADDRESS
|
|
1491
|
+
});
|
|
1492
|
+
const topUpIx = getTopUpInstruction({
|
|
1493
|
+
payer: client.payer,
|
|
1494
|
+
channel: channelAddress,
|
|
1495
|
+
payerTokenAccount,
|
|
1496
|
+
channelTokenAccount,
|
|
1497
|
+
mint: USDC_MINT,
|
|
1498
|
+
tokenProgram: TOKEN_PROGRAM_ADDRESS,
|
|
1499
|
+
topUpArgs: {
|
|
1500
|
+
amount: topUpAmount
|
|
1501
|
+
}
|
|
1502
|
+
});
|
|
1503
|
+
const signature = await sendInstructions(client, [topUpIx]);
|
|
1504
|
+
return { channel: channelAddress, signature };
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
// src/sdk/voucher.ts
|
|
1508
|
+
import { getAddressEncoder as getAddressEncoder7, isMessagePartialSigner, getBase58Decoder } from "@solana/kit";
|
|
1509
|
+
async function createSignedVoucher(client, channelAddress, cumulativeAmount, expiresAtUnixTimestamp) {
|
|
1510
|
+
if (!client.payer || !isMessagePartialSigner(client.payer)) {
|
|
1511
|
+
throw new Error("The client's payer does not support message signing.");
|
|
1512
|
+
}
|
|
1513
|
+
const expiresAt = expiresAtUnixTimestamp ?? 0n;
|
|
1514
|
+
const payload = new Uint8Array(50);
|
|
1515
|
+
const dataView = new DataView(payload.buffer);
|
|
1516
|
+
payload.set([86, 1], 0);
|
|
1517
|
+
const addressEncoder = getAddressEncoder7();
|
|
1518
|
+
const channelBytes = addressEncoder.encode(channelAddress);
|
|
1519
|
+
payload.set(channelBytes, 2);
|
|
1520
|
+
dataView.setBigUint64(34, cumulativeAmount, true);
|
|
1521
|
+
dataView.setBigInt64(42, expiresAt, true);
|
|
1522
|
+
const signedMessages = await client.payer.signMessages([{ content: payload, signatures: {} }]);
|
|
1523
|
+
const signatureBytes = signedMessages[0][client.payer.address];
|
|
1524
|
+
const base58Decoder = getBase58Decoder();
|
|
1525
|
+
return {
|
|
1526
|
+
voucher: {
|
|
1527
|
+
voucher: {
|
|
1528
|
+
channelId: channelAddress,
|
|
1529
|
+
cumulativeAmount: cumulativeAmount.toString(),
|
|
1530
|
+
// Only include expiresAt in the JSON if it is non-zero
|
|
1531
|
+
...expiresAt !== 0n && {
|
|
1532
|
+
expiresAt: new Date(Number(expiresAt) * 1e3).toISOString()
|
|
1533
|
+
}
|
|
1534
|
+
},
|
|
1535
|
+
signer: client.payer.address,
|
|
1536
|
+
signature: base58Decoder.decode(signatureBytes),
|
|
1537
|
+
signatureType: "ed25519"
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
export {
|
|
1542
|
+
SHUNT_TREASURY,
|
|
1543
|
+
createShuntClient,
|
|
1544
|
+
createSignedVoucher,
|
|
1545
|
+
devnet,
|
|
1546
|
+
openPaymentChannel,
|
|
1547
|
+
sendInstructions,
|
|
1548
|
+
topUpPaymentChannel
|
|
1549
|
+
};
|