@solana-program/system 0.15.0 → 0.16.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/src/index.js +125 -35
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +125 -35
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/generated/accounts/nonce.d.ts +7 -7
- package/dist/types/generated/accounts/nonce.d.ts.map +1 -1
- package/dist/types/generated/errors/system.d.ts +4 -2
- package/dist/types/generated/errors/system.d.ts.map +1 -1
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts +3 -1
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocate.d.ts +3 -1
- package/dist/types/generated/instructions/allocate.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocateWithSeed.d.ts +6 -4
- package/dist/types/generated/instructions/allocateWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/assign.d.ts +5 -3
- package/dist/types/generated/instructions/assign.d.ts.map +1 -1
- package/dist/types/generated/instructions/assignWithSeed.d.ts +6 -4
- package/dist/types/generated/instructions/assignWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts +5 -3
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccount.d.ts +5 -3
- package/dist/types/generated/instructions/createAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccountAllowPrefund.d.ts +5 -3
- package/dist/types/generated/instructions/createAccountAllowPrefund.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts +6 -4
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts +5 -3
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSol.d.ts +3 -1
- package/dist/types/generated/instructions/transferSol.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts +5 -3
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts +3 -1
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts +3 -1
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/programs/system.d.ts +46 -16
- package/dist/types/generated/programs/system.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/generated/accounts/nonce.ts +17 -8
- package/src/generated/errors/system.ts +5 -1
- package/src/generated/instructions/advanceNonceAccount.ts +3 -2
- package/src/generated/instructions/allocate.ts +3 -2
- package/src/generated/instructions/allocateWithSeed.ts +6 -4
- package/src/generated/instructions/assign.ts +5 -3
- package/src/generated/instructions/assignWithSeed.ts +9 -3
- package/src/generated/instructions/authorizeNonceAccount.ts +5 -3
- package/src/generated/instructions/createAccount.ts +5 -3
- package/src/generated/instructions/createAccountAllowPrefund.ts +5 -3
- package/src/generated/instructions/createAccountWithSeed.ts +6 -4
- package/src/generated/instructions/initializeNonceAccount.ts +5 -3
- package/src/generated/instructions/transferSol.ts +3 -2
- package/src/generated/instructions/transferSolWithSeed.ts +9 -3
- package/src/generated/instructions/upgradeNonceAccount.ts +3 -2
- package/src/generated/instructions/withdrawNonceAccount.ts +3 -2
- package/src/generated/programs/system.ts +119 -28
package/dist/src/index.mjs
CHANGED
|
@@ -62,7 +62,11 @@ async function fetchNonce(rpc, address, config) {
|
|
|
62
62
|
return maybeAccount;
|
|
63
63
|
}
|
|
64
64
|
async function fetchMaybeNonce(rpc, address, config) {
|
|
65
|
-
const maybeAccount = await fetchEncodedAccount(
|
|
65
|
+
const maybeAccount = await fetchEncodedAccount(
|
|
66
|
+
rpc,
|
|
67
|
+
typeof address === "string" ? address : address.address,
|
|
68
|
+
config
|
|
69
|
+
);
|
|
66
70
|
return decodeNonce(maybeAccount);
|
|
67
71
|
}
|
|
68
72
|
async function fetchAllNonce(rpc, addresses, config) {
|
|
@@ -71,7 +75,11 @@ async function fetchAllNonce(rpc, addresses, config) {
|
|
|
71
75
|
return maybeAccounts;
|
|
72
76
|
}
|
|
73
77
|
async function fetchAllMaybeNonce(rpc, addresses, config) {
|
|
74
|
-
const maybeAccounts = await fetchEncodedAccounts(
|
|
78
|
+
const maybeAccounts = await fetchEncodedAccounts(
|
|
79
|
+
rpc,
|
|
80
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
81
|
+
config
|
|
82
|
+
);
|
|
75
83
|
return maybeAccounts.map((maybeAccount) => decodeNonce(maybeAccount));
|
|
76
84
|
}
|
|
77
85
|
function getNonceSize() {
|
|
@@ -94,7 +102,8 @@ function getAdvanceNonceAccountInstructionDataCodec() {
|
|
|
94
102
|
return combineCodec(getAdvanceNonceAccountInstructionDataEncoder(), getAdvanceNonceAccountInstructionDataDecoder());
|
|
95
103
|
}
|
|
96
104
|
function getAdvanceNonceAccountInstruction(input, config) {
|
|
97
|
-
const
|
|
105
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
106
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
98
107
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
99
108
|
const originalAccounts = {
|
|
100
109
|
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -161,7 +170,8 @@ function getAllocateInstructionDataCodec() {
|
|
|
161
170
|
return combineCodec(getAllocateInstructionDataEncoder(), getAllocateInstructionDataDecoder());
|
|
162
171
|
}
|
|
163
172
|
function getAllocateInstruction(input, config) {
|
|
164
|
-
const
|
|
173
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
174
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
165
175
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
166
176
|
const originalAccounts = { newAccount: { value: input.newAccount ?? null, isSigner: true, isWritable: true } };
|
|
167
177
|
const accounts = originalAccounts;
|
|
@@ -220,7 +230,8 @@ function getAllocateWithSeedInstructionDataCodec() {
|
|
|
220
230
|
return combineCodec(getAllocateWithSeedInstructionDataEncoder(), getAllocateWithSeedInstructionDataDecoder());
|
|
221
231
|
}
|
|
222
232
|
function getAllocateWithSeedInstruction(input, config) {
|
|
223
|
-
const
|
|
233
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
234
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
224
235
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
225
236
|
const originalAccounts = {
|
|
226
237
|
newAccount: { value: input.newAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -279,7 +290,8 @@ function getAssignInstructionDataCodec() {
|
|
|
279
290
|
return combineCodec(getAssignInstructionDataEncoder(), getAssignInstructionDataDecoder());
|
|
280
291
|
}
|
|
281
292
|
function getAssignInstruction(input, config) {
|
|
282
|
-
const
|
|
293
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
294
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
283
295
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
284
296
|
const originalAccounts = { account: { value: input.account ?? null, isSigner: true, isWritable: true } };
|
|
285
297
|
const accounts = originalAccounts;
|
|
@@ -336,7 +348,8 @@ function getAssignWithSeedInstructionDataCodec() {
|
|
|
336
348
|
return combineCodec(getAssignWithSeedInstructionDataEncoder(), getAssignWithSeedInstructionDataDecoder());
|
|
337
349
|
}
|
|
338
350
|
function getAssignWithSeedInstruction(input, config) {
|
|
339
|
-
const
|
|
351
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
352
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
340
353
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
341
354
|
const originalAccounts = {
|
|
342
355
|
account: { value: input.account ?? null, isSigner: false, isWritable: true },
|
|
@@ -395,7 +408,8 @@ function getAuthorizeNonceAccountInstructionDataCodec() {
|
|
|
395
408
|
);
|
|
396
409
|
}
|
|
397
410
|
function getAuthorizeNonceAccountInstruction(input, config) {
|
|
398
|
-
const
|
|
411
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
412
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
399
413
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
400
414
|
const originalAccounts = {
|
|
401
415
|
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -458,7 +472,8 @@ function getCreateAccountInstructionDataCodec() {
|
|
|
458
472
|
return combineCodec(getCreateAccountInstructionDataEncoder(), getCreateAccountInstructionDataDecoder());
|
|
459
473
|
}
|
|
460
474
|
function getCreateAccountInstruction(input, config) {
|
|
461
|
-
const
|
|
475
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
476
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
462
477
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
463
478
|
const originalAccounts = {
|
|
464
479
|
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
@@ -527,7 +542,8 @@ function getCreateAccountAllowPrefundInstructionDataCodec() {
|
|
|
527
542
|
);
|
|
528
543
|
}
|
|
529
544
|
function getCreateAccountAllowPrefundInstruction(input, config) {
|
|
530
|
-
const
|
|
545
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
546
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
531
547
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
532
548
|
const originalAccounts = {
|
|
533
549
|
newAccount: { value: input.newAccount ?? null, isSigner: true, isWritable: true },
|
|
@@ -606,7 +622,8 @@ function getCreateAccountWithSeedInstructionDataCodec() {
|
|
|
606
622
|
);
|
|
607
623
|
}
|
|
608
624
|
function getCreateAccountWithSeedInstruction(input, config) {
|
|
609
|
-
const
|
|
625
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
626
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
610
627
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
611
628
|
const originalAccounts = {
|
|
612
629
|
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
@@ -676,7 +693,8 @@ function getInitializeNonceAccountInstructionDataCodec() {
|
|
|
676
693
|
);
|
|
677
694
|
}
|
|
678
695
|
function getInitializeNonceAccountInstruction(input, config) {
|
|
679
|
-
const
|
|
696
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
697
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
680
698
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
681
699
|
const originalAccounts = {
|
|
682
700
|
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -749,7 +767,8 @@ function getTransferSolInstructionDataCodec() {
|
|
|
749
767
|
return combineCodec(getTransferSolInstructionDataEncoder(), getTransferSolInstructionDataDecoder());
|
|
750
768
|
}
|
|
751
769
|
function getTransferSolInstruction(input, config) {
|
|
752
|
-
const
|
|
770
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
771
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
753
772
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
754
773
|
const originalAccounts = {
|
|
755
774
|
source: { value: input.source ?? null, isSigner: true, isWritable: true },
|
|
@@ -809,7 +828,8 @@ function getTransferSolWithSeedInstructionDataCodec() {
|
|
|
809
828
|
return combineCodec(getTransferSolWithSeedInstructionDataEncoder(), getTransferSolWithSeedInstructionDataDecoder());
|
|
810
829
|
}
|
|
811
830
|
function getTransferSolWithSeedInstruction(input, config) {
|
|
812
|
-
const
|
|
831
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
832
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
813
833
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
814
834
|
const originalAccounts = {
|
|
815
835
|
source: { value: input.source ?? null, isSigner: false, isWritable: true },
|
|
@@ -864,7 +884,8 @@ function getUpgradeNonceAccountInstructionDataCodec() {
|
|
|
864
884
|
return combineCodec(getUpgradeNonceAccountInstructionDataEncoder(), getUpgradeNonceAccountInstructionDataDecoder());
|
|
865
885
|
}
|
|
866
886
|
function getUpgradeNonceAccountInstruction(input, config) {
|
|
867
|
-
const
|
|
887
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
888
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
868
889
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
869
890
|
const originalAccounts = { nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true } };
|
|
870
891
|
const accounts = originalAccounts;
|
|
@@ -919,7 +940,8 @@ function getWithdrawNonceAccountInstructionDataCodec() {
|
|
|
919
940
|
);
|
|
920
941
|
}
|
|
921
942
|
function getWithdrawNonceAccountInstruction(input, config) {
|
|
922
|
-
const
|
|
943
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
944
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
923
945
|
const getAccountMeta = getAccountMetaFactory(programAddress, "omitted");
|
|
924
946
|
const originalAccounts = {
|
|
925
947
|
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -1142,32 +1164,98 @@ function parseSystemInstruction(instruction) {
|
|
|
1142
1164
|
});
|
|
1143
1165
|
}
|
|
1144
1166
|
}
|
|
1145
|
-
function systemProgram() {
|
|
1167
|
+
function systemProgram(config = {}) {
|
|
1146
1168
|
return (client) => {
|
|
1147
1169
|
return extendClient(client, {
|
|
1148
1170
|
system: {
|
|
1149
1171
|
accounts: { nonce: addSelfFetchFunctions(client, getNonceCodec()) },
|
|
1150
1172
|
instructions: {
|
|
1151
|
-
createAccount: (input) => addSelfPlanAndSendFunctions(
|
|
1173
|
+
createAccount: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1174
|
+
client,
|
|
1175
|
+
getCreateAccountInstruction(
|
|
1176
|
+
{ ...input, payer: input.payer ?? client.payer },
|
|
1177
|
+
{ programAddress: instructionConfig?.programAddress ?? config.programAddress }
|
|
1178
|
+
)
|
|
1179
|
+
),
|
|
1180
|
+
assign: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1152
1181
|
client,
|
|
1153
|
-
|
|
1182
|
+
getAssignInstruction(input, {
|
|
1183
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1184
|
+
})
|
|
1154
1185
|
),
|
|
1155
|
-
|
|
1156
|
-
transferSol: (input) => addSelfPlanAndSendFunctions(client, getTransferSolInstruction(input)),
|
|
1157
|
-
createAccountWithSeed: (input) => addSelfPlanAndSendFunctions(
|
|
1186
|
+
transferSol: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1158
1187
|
client,
|
|
1159
|
-
|
|
1188
|
+
getTransferSolInstruction(input, {
|
|
1189
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1190
|
+
})
|
|
1160
1191
|
),
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1192
|
+
createAccountWithSeed: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1193
|
+
client,
|
|
1194
|
+
getCreateAccountWithSeedInstruction(
|
|
1195
|
+
{ ...input, payer: input.payer ?? client.payer },
|
|
1196
|
+
{ programAddress: instructionConfig?.programAddress ?? config.programAddress }
|
|
1197
|
+
)
|
|
1198
|
+
),
|
|
1199
|
+
advanceNonceAccount: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1200
|
+
client,
|
|
1201
|
+
getAdvanceNonceAccountInstruction(input, {
|
|
1202
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1203
|
+
})
|
|
1204
|
+
),
|
|
1205
|
+
withdrawNonceAccount: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1206
|
+
client,
|
|
1207
|
+
getWithdrawNonceAccountInstruction(input, {
|
|
1208
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1209
|
+
})
|
|
1210
|
+
),
|
|
1211
|
+
initializeNonceAccount: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1212
|
+
client,
|
|
1213
|
+
getInitializeNonceAccountInstruction(input, {
|
|
1214
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1215
|
+
})
|
|
1216
|
+
),
|
|
1217
|
+
authorizeNonceAccount: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1218
|
+
client,
|
|
1219
|
+
getAuthorizeNonceAccountInstruction(input, {
|
|
1220
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1221
|
+
})
|
|
1222
|
+
),
|
|
1223
|
+
allocate: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1224
|
+
client,
|
|
1225
|
+
getAllocateInstruction(input, {
|
|
1226
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1227
|
+
})
|
|
1228
|
+
),
|
|
1229
|
+
allocateWithSeed: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1230
|
+
client,
|
|
1231
|
+
getAllocateWithSeedInstruction(input, {
|
|
1232
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1233
|
+
})
|
|
1234
|
+
),
|
|
1235
|
+
assignWithSeed: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1236
|
+
client,
|
|
1237
|
+
getAssignWithSeedInstruction(input, {
|
|
1238
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1239
|
+
})
|
|
1240
|
+
),
|
|
1241
|
+
transferSolWithSeed: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1242
|
+
client,
|
|
1243
|
+
getTransferSolWithSeedInstruction(input, {
|
|
1244
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1245
|
+
})
|
|
1246
|
+
),
|
|
1247
|
+
upgradeNonceAccount: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1248
|
+
client,
|
|
1249
|
+
getUpgradeNonceAccountInstruction(input, {
|
|
1250
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1251
|
+
})
|
|
1252
|
+
),
|
|
1253
|
+
createAccountAllowPrefund: (input, instructionConfig) => addSelfPlanAndSendFunctions(
|
|
1254
|
+
client,
|
|
1255
|
+
getCreateAccountAllowPrefundInstruction(input, {
|
|
1256
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1257
|
+
})
|
|
1258
|
+
)
|
|
1171
1259
|
},
|
|
1172
1260
|
identifyInstruction: identifySystemInstruction,
|
|
1173
1261
|
parseInstruction: parseSystemInstruction
|
|
@@ -1206,8 +1294,10 @@ function getSystemErrorMessage(code) {
|
|
|
1206
1294
|
}
|
|
1207
1295
|
return "Error message not available in production bundles.";
|
|
1208
1296
|
}
|
|
1209
|
-
function isSystemError(error, transactionMessage, code) {
|
|
1210
|
-
|
|
1297
|
+
function isSystemError(error, transactionMessage, code, config = {}) {
|
|
1298
|
+
const programAddressInput = config.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
1299
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1300
|
+
return isProgramError(error, transactionMessage, programAddress, code);
|
|
1211
1301
|
}
|
|
1212
1302
|
|
|
1213
1303
|
export { ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR, ALLOCATE_DISCRIMINATOR, ALLOCATE_WITH_SEED_DISCRIMINATOR, ASSIGN_DISCRIMINATOR, ASSIGN_WITH_SEED_DISCRIMINATOR, AUTHORIZE_NONCE_ACCOUNT_DISCRIMINATOR, CREATE_ACCOUNT_ALLOW_PREFUND_DISCRIMINATOR, CREATE_ACCOUNT_DISCRIMINATOR, CREATE_ACCOUNT_WITH_SEED_DISCRIMINATOR, INITIALIZE_NONCE_ACCOUNT_DISCRIMINATOR, NonceState, NonceVersion, SYSTEM_ERROR__ACCOUNT_ALREADY_IN_USE, SYSTEM_ERROR__ADDRESS_WITH_SEED_MISMATCH, SYSTEM_ERROR__INVALID_ACCOUNT_DATA_LENGTH, SYSTEM_ERROR__INVALID_PROGRAM_ID, SYSTEM_ERROR__MAX_SEED_LENGTH_EXCEEDED, SYSTEM_ERROR__NONCE_BLOCKHASH_NOT_EXPIRED, SYSTEM_ERROR__NONCE_NO_RECENT_BLOCKHASHES, SYSTEM_ERROR__NONCE_UNEXPECTED_BLOCKHASH_VALUE, SYSTEM_ERROR__RESULT_WITH_NEGATIVE_LAMPORTS, SYSTEM_PROGRAM_ADDRESS, SystemAccount, SystemInstruction, TRANSFER_SOL_DISCRIMINATOR, TRANSFER_SOL_WITH_SEED_DISCRIMINATOR, UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR, WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR, decodeNonce, fetchAllMaybeNonce, fetchAllNonce, fetchMaybeNonce, fetchNonce, getAdvanceNonceAccountDiscriminatorBytes, getAdvanceNonceAccountInstruction, getAdvanceNonceAccountInstructionDataCodec, getAdvanceNonceAccountInstructionDataDecoder, getAdvanceNonceAccountInstructionDataEncoder, getAllocateDiscriminatorBytes, getAllocateInstruction, getAllocateInstructionDataCodec, getAllocateInstructionDataDecoder, getAllocateInstructionDataEncoder, getAllocateWithSeedDiscriminatorBytes, getAllocateWithSeedInstruction, getAllocateWithSeedInstructionDataCodec, getAllocateWithSeedInstructionDataDecoder, getAllocateWithSeedInstructionDataEncoder, getAssignDiscriminatorBytes, getAssignInstruction, getAssignInstructionDataCodec, getAssignInstructionDataDecoder, getAssignInstructionDataEncoder, getAssignWithSeedDiscriminatorBytes, getAssignWithSeedInstruction, getAssignWithSeedInstructionDataCodec, getAssignWithSeedInstructionDataDecoder, getAssignWithSeedInstructionDataEncoder, getAuthorizeNonceAccountDiscriminatorBytes, getAuthorizeNonceAccountInstruction, getAuthorizeNonceAccountInstructionDataCodec, getAuthorizeNonceAccountInstructionDataDecoder, getAuthorizeNonceAccountInstructionDataEncoder, getCreateAccountAllowPrefundDiscriminatorBytes, getCreateAccountAllowPrefundInstruction, getCreateAccountAllowPrefundInstructionDataCodec, getCreateAccountAllowPrefundInstructionDataDecoder, getCreateAccountAllowPrefundInstructionDataEncoder, getCreateAccountDiscriminatorBytes, getCreateAccountInstruction, getCreateAccountInstructionDataCodec, getCreateAccountInstructionDataDecoder, getCreateAccountInstructionDataEncoder, getCreateAccountWithSeedDiscriminatorBytes, getCreateAccountWithSeedInstruction, getCreateAccountWithSeedInstructionDataCodec, getCreateAccountWithSeedInstructionDataDecoder, getCreateAccountWithSeedInstructionDataEncoder, getInitializeNonceAccountDiscriminatorBytes, getInitializeNonceAccountInstruction, getInitializeNonceAccountInstructionDataCodec, getInitializeNonceAccountInstructionDataDecoder, getInitializeNonceAccountInstructionDataEncoder, getNonceCodec, getNonceDecoder, getNonceEncoder, getNonceSize, getNonceStateCodec, getNonceStateDecoder, getNonceStateEncoder, getNonceVersionCodec, getNonceVersionDecoder, getNonceVersionEncoder, getSystemErrorMessage, getTransferSolDiscriminatorBytes, getTransferSolInstruction, getTransferSolInstructionDataCodec, getTransferSolInstructionDataDecoder, getTransferSolInstructionDataEncoder, getTransferSolWithSeedDiscriminatorBytes, getTransferSolWithSeedInstruction, getTransferSolWithSeedInstructionDataCodec, getTransferSolWithSeedInstructionDataDecoder, getTransferSolWithSeedInstructionDataEncoder, getUpgradeNonceAccountDiscriminatorBytes, getUpgradeNonceAccountInstruction, getUpgradeNonceAccountInstructionDataCodec, getUpgradeNonceAccountInstructionDataDecoder, getUpgradeNonceAccountInstructionDataEncoder, getWithdrawNonceAccountDiscriminatorBytes, getWithdrawNonceAccountInstruction, getWithdrawNonceAccountInstructionDataCodec, getWithdrawNonceAccountInstructionDataDecoder, getWithdrawNonceAccountInstructionDataEncoder, identifySystemInstruction, isSystemError, parseAdvanceNonceAccountInstruction, parseAllocateInstruction, parseAllocateWithSeedInstruction, parseAssignInstruction, parseAssignWithSeedInstruction, parseAuthorizeNonceAccountInstruction, parseCreateAccountAllowPrefundInstruction, parseCreateAccountInstruction, parseCreateAccountWithSeedInstruction, parseInitializeNonceAccountInstruction, parseSystemInstruction, parseTransferSolInstruction, parseTransferSolWithSeedInstruction, parseUpgradeNonceAccountInstruction, parseWithdrawNonceAccountInstruction, systemProgram };
|