@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.js
CHANGED
|
@@ -64,7 +64,11 @@ async function fetchNonce(rpc, address, config) {
|
|
|
64
64
|
return maybeAccount;
|
|
65
65
|
}
|
|
66
66
|
async function fetchMaybeNonce(rpc, address, config) {
|
|
67
|
-
const maybeAccount = await kit.fetchEncodedAccount(
|
|
67
|
+
const maybeAccount = await kit.fetchEncodedAccount(
|
|
68
|
+
rpc,
|
|
69
|
+
typeof address === "string" ? address : address.address,
|
|
70
|
+
config
|
|
71
|
+
);
|
|
68
72
|
return decodeNonce(maybeAccount);
|
|
69
73
|
}
|
|
70
74
|
async function fetchAllNonce(rpc, addresses, config) {
|
|
@@ -73,7 +77,11 @@ async function fetchAllNonce(rpc, addresses, config) {
|
|
|
73
77
|
return maybeAccounts;
|
|
74
78
|
}
|
|
75
79
|
async function fetchAllMaybeNonce(rpc, addresses, config) {
|
|
76
|
-
const maybeAccounts = await kit.fetchEncodedAccounts(
|
|
80
|
+
const maybeAccounts = await kit.fetchEncodedAccounts(
|
|
81
|
+
rpc,
|
|
82
|
+
addresses.map((a) => typeof a === "string" ? a : a.address),
|
|
83
|
+
config
|
|
84
|
+
);
|
|
77
85
|
return maybeAccounts.map((maybeAccount) => decodeNonce(maybeAccount));
|
|
78
86
|
}
|
|
79
87
|
function getNonceSize() {
|
|
@@ -96,7 +104,8 @@ function getAdvanceNonceAccountInstructionDataCodec() {
|
|
|
96
104
|
return kit.combineCodec(getAdvanceNonceAccountInstructionDataEncoder(), getAdvanceNonceAccountInstructionDataDecoder());
|
|
97
105
|
}
|
|
98
106
|
function getAdvanceNonceAccountInstruction(input, config) {
|
|
99
|
-
const
|
|
107
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
108
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
100
109
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
101
110
|
const originalAccounts = {
|
|
102
111
|
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -163,7 +172,8 @@ function getAllocateInstructionDataCodec() {
|
|
|
163
172
|
return kit.combineCodec(getAllocateInstructionDataEncoder(), getAllocateInstructionDataDecoder());
|
|
164
173
|
}
|
|
165
174
|
function getAllocateInstruction(input, config) {
|
|
166
|
-
const
|
|
175
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
176
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
167
177
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
168
178
|
const originalAccounts = { newAccount: { value: input.newAccount ?? null, isSigner: true, isWritable: true } };
|
|
169
179
|
const accounts = originalAccounts;
|
|
@@ -222,7 +232,8 @@ function getAllocateWithSeedInstructionDataCodec() {
|
|
|
222
232
|
return kit.combineCodec(getAllocateWithSeedInstructionDataEncoder(), getAllocateWithSeedInstructionDataDecoder());
|
|
223
233
|
}
|
|
224
234
|
function getAllocateWithSeedInstruction(input, config) {
|
|
225
|
-
const
|
|
235
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
236
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
226
237
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
227
238
|
const originalAccounts = {
|
|
228
239
|
newAccount: { value: input.newAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -281,7 +292,8 @@ function getAssignInstructionDataCodec() {
|
|
|
281
292
|
return kit.combineCodec(getAssignInstructionDataEncoder(), getAssignInstructionDataDecoder());
|
|
282
293
|
}
|
|
283
294
|
function getAssignInstruction(input, config) {
|
|
284
|
-
const
|
|
295
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
296
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
285
297
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
286
298
|
const originalAccounts = { account: { value: input.account ?? null, isSigner: true, isWritable: true } };
|
|
287
299
|
const accounts = originalAccounts;
|
|
@@ -338,7 +350,8 @@ function getAssignWithSeedInstructionDataCodec() {
|
|
|
338
350
|
return kit.combineCodec(getAssignWithSeedInstructionDataEncoder(), getAssignWithSeedInstructionDataDecoder());
|
|
339
351
|
}
|
|
340
352
|
function getAssignWithSeedInstruction(input, config) {
|
|
341
|
-
const
|
|
353
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
354
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
342
355
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
343
356
|
const originalAccounts = {
|
|
344
357
|
account: { value: input.account ?? null, isSigner: false, isWritable: true },
|
|
@@ -397,7 +410,8 @@ function getAuthorizeNonceAccountInstructionDataCodec() {
|
|
|
397
410
|
);
|
|
398
411
|
}
|
|
399
412
|
function getAuthorizeNonceAccountInstruction(input, config) {
|
|
400
|
-
const
|
|
413
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
414
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
401
415
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
402
416
|
const originalAccounts = {
|
|
403
417
|
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -460,7 +474,8 @@ function getCreateAccountInstructionDataCodec() {
|
|
|
460
474
|
return kit.combineCodec(getCreateAccountInstructionDataEncoder(), getCreateAccountInstructionDataDecoder());
|
|
461
475
|
}
|
|
462
476
|
function getCreateAccountInstruction(input, config) {
|
|
463
|
-
const
|
|
477
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
478
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
464
479
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
465
480
|
const originalAccounts = {
|
|
466
481
|
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
@@ -529,7 +544,8 @@ function getCreateAccountAllowPrefundInstructionDataCodec() {
|
|
|
529
544
|
);
|
|
530
545
|
}
|
|
531
546
|
function getCreateAccountAllowPrefundInstruction(input, config) {
|
|
532
|
-
const
|
|
547
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
548
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
533
549
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
534
550
|
const originalAccounts = {
|
|
535
551
|
newAccount: { value: input.newAccount ?? null, isSigner: true, isWritable: true },
|
|
@@ -608,7 +624,8 @@ function getCreateAccountWithSeedInstructionDataCodec() {
|
|
|
608
624
|
);
|
|
609
625
|
}
|
|
610
626
|
function getCreateAccountWithSeedInstruction(input, config) {
|
|
611
|
-
const
|
|
627
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
628
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
612
629
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
613
630
|
const originalAccounts = {
|
|
614
631
|
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
@@ -678,7 +695,8 @@ function getInitializeNonceAccountInstructionDataCodec() {
|
|
|
678
695
|
);
|
|
679
696
|
}
|
|
680
697
|
function getInitializeNonceAccountInstruction(input, config) {
|
|
681
|
-
const
|
|
698
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
699
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
682
700
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
683
701
|
const originalAccounts = {
|
|
684
702
|
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -751,7 +769,8 @@ function getTransferSolInstructionDataCodec() {
|
|
|
751
769
|
return kit.combineCodec(getTransferSolInstructionDataEncoder(), getTransferSolInstructionDataDecoder());
|
|
752
770
|
}
|
|
753
771
|
function getTransferSolInstruction(input, config) {
|
|
754
|
-
const
|
|
772
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
773
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
755
774
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
756
775
|
const originalAccounts = {
|
|
757
776
|
source: { value: input.source ?? null, isSigner: true, isWritable: true },
|
|
@@ -811,7 +830,8 @@ function getTransferSolWithSeedInstructionDataCodec() {
|
|
|
811
830
|
return kit.combineCodec(getTransferSolWithSeedInstructionDataEncoder(), getTransferSolWithSeedInstructionDataDecoder());
|
|
812
831
|
}
|
|
813
832
|
function getTransferSolWithSeedInstruction(input, config) {
|
|
814
|
-
const
|
|
833
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
834
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
815
835
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
816
836
|
const originalAccounts = {
|
|
817
837
|
source: { value: input.source ?? null, isSigner: false, isWritable: true },
|
|
@@ -866,7 +886,8 @@ function getUpgradeNonceAccountInstructionDataCodec() {
|
|
|
866
886
|
return kit.combineCodec(getUpgradeNonceAccountInstructionDataEncoder(), getUpgradeNonceAccountInstructionDataDecoder());
|
|
867
887
|
}
|
|
868
888
|
function getUpgradeNonceAccountInstruction(input, config) {
|
|
869
|
-
const
|
|
889
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
890
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
870
891
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
871
892
|
const originalAccounts = { nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true } };
|
|
872
893
|
const accounts = originalAccounts;
|
|
@@ -921,7 +942,8 @@ function getWithdrawNonceAccountInstructionDataCodec() {
|
|
|
921
942
|
);
|
|
922
943
|
}
|
|
923
944
|
function getWithdrawNonceAccountInstruction(input, config) {
|
|
924
|
-
const
|
|
945
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
946
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
925
947
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "omitted");
|
|
926
948
|
const originalAccounts = {
|
|
927
949
|
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
@@ -1144,32 +1166,98 @@ function parseSystemInstruction(instruction) {
|
|
|
1144
1166
|
});
|
|
1145
1167
|
}
|
|
1146
1168
|
}
|
|
1147
|
-
function systemProgram() {
|
|
1169
|
+
function systemProgram(config = {}) {
|
|
1148
1170
|
return (client) => {
|
|
1149
1171
|
return kit.extendClient(client, {
|
|
1150
1172
|
system: {
|
|
1151
1173
|
accounts: { nonce: programClientCore.addSelfFetchFunctions(client, getNonceCodec()) },
|
|
1152
1174
|
instructions: {
|
|
1153
|
-
createAccount: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1175
|
+
createAccount: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1176
|
+
client,
|
|
1177
|
+
getCreateAccountInstruction(
|
|
1178
|
+
{ ...input, payer: input.payer ?? client.payer },
|
|
1179
|
+
{ programAddress: instructionConfig?.programAddress ?? config.programAddress }
|
|
1180
|
+
)
|
|
1181
|
+
),
|
|
1182
|
+
assign: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1154
1183
|
client,
|
|
1155
|
-
|
|
1184
|
+
getAssignInstruction(input, {
|
|
1185
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1186
|
+
})
|
|
1156
1187
|
),
|
|
1157
|
-
|
|
1158
|
-
transferSol: (input) => programClientCore.addSelfPlanAndSendFunctions(client, getTransferSolInstruction(input)),
|
|
1159
|
-
createAccountWithSeed: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1188
|
+
transferSol: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1160
1189
|
client,
|
|
1161
|
-
|
|
1190
|
+
getTransferSolInstruction(input, {
|
|
1191
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1192
|
+
})
|
|
1162
1193
|
),
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1194
|
+
createAccountWithSeed: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1195
|
+
client,
|
|
1196
|
+
getCreateAccountWithSeedInstruction(
|
|
1197
|
+
{ ...input, payer: input.payer ?? client.payer },
|
|
1198
|
+
{ programAddress: instructionConfig?.programAddress ?? config.programAddress }
|
|
1199
|
+
)
|
|
1200
|
+
),
|
|
1201
|
+
advanceNonceAccount: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1202
|
+
client,
|
|
1203
|
+
getAdvanceNonceAccountInstruction(input, {
|
|
1204
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1205
|
+
})
|
|
1206
|
+
),
|
|
1207
|
+
withdrawNonceAccount: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1208
|
+
client,
|
|
1209
|
+
getWithdrawNonceAccountInstruction(input, {
|
|
1210
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1211
|
+
})
|
|
1212
|
+
),
|
|
1213
|
+
initializeNonceAccount: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1214
|
+
client,
|
|
1215
|
+
getInitializeNonceAccountInstruction(input, {
|
|
1216
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1217
|
+
})
|
|
1218
|
+
),
|
|
1219
|
+
authorizeNonceAccount: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1220
|
+
client,
|
|
1221
|
+
getAuthorizeNonceAccountInstruction(input, {
|
|
1222
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1223
|
+
})
|
|
1224
|
+
),
|
|
1225
|
+
allocate: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1226
|
+
client,
|
|
1227
|
+
getAllocateInstruction(input, {
|
|
1228
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1229
|
+
})
|
|
1230
|
+
),
|
|
1231
|
+
allocateWithSeed: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1232
|
+
client,
|
|
1233
|
+
getAllocateWithSeedInstruction(input, {
|
|
1234
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1235
|
+
})
|
|
1236
|
+
),
|
|
1237
|
+
assignWithSeed: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1238
|
+
client,
|
|
1239
|
+
getAssignWithSeedInstruction(input, {
|
|
1240
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1241
|
+
})
|
|
1242
|
+
),
|
|
1243
|
+
transferSolWithSeed: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1244
|
+
client,
|
|
1245
|
+
getTransferSolWithSeedInstruction(input, {
|
|
1246
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1247
|
+
})
|
|
1248
|
+
),
|
|
1249
|
+
upgradeNonceAccount: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1250
|
+
client,
|
|
1251
|
+
getUpgradeNonceAccountInstruction(input, {
|
|
1252
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1253
|
+
})
|
|
1254
|
+
),
|
|
1255
|
+
createAccountAllowPrefund: (input, instructionConfig) => programClientCore.addSelfPlanAndSendFunctions(
|
|
1256
|
+
client,
|
|
1257
|
+
getCreateAccountAllowPrefundInstruction(input, {
|
|
1258
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress
|
|
1259
|
+
})
|
|
1260
|
+
)
|
|
1173
1261
|
},
|
|
1174
1262
|
identifyInstruction: identifySystemInstruction,
|
|
1175
1263
|
parseInstruction: parseSystemInstruction
|
|
@@ -1208,8 +1296,10 @@ function getSystemErrorMessage(code) {
|
|
|
1208
1296
|
}
|
|
1209
1297
|
return "Error message not available in production bundles.";
|
|
1210
1298
|
}
|
|
1211
|
-
function isSystemError(error, transactionMessage, code) {
|
|
1212
|
-
|
|
1299
|
+
function isSystemError(error, transactionMessage, code, config = {}) {
|
|
1300
|
+
const programAddressInput = config.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
1301
|
+
const programAddress = typeof programAddressInput === "string" ? programAddressInput : programAddressInput.address;
|
|
1302
|
+
return kit.isProgramError(error, transactionMessage, programAddress, code);
|
|
1213
1303
|
}
|
|
1214
1304
|
|
|
1215
1305
|
exports.ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR = ADVANCE_NONCE_ACCOUNT_DISCRIMINATOR;
|