@solana-program/system 0.14.1 → 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 +171 -81
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +171 -81
- 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 +11 -8
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocate.d.ts +9 -6
- package/dist/types/generated/instructions/allocate.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocateWithSeed.d.ts +12 -9
- package/dist/types/generated/instructions/allocateWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/assign.d.ts +10 -7
- package/dist/types/generated/instructions/assign.d.ts.map +1 -1
- package/dist/types/generated/instructions/assignWithSeed.d.ts +12 -9
- package/dist/types/generated/instructions/assignWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts +11 -8
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccount.d.ts +11 -9
- package/dist/types/generated/instructions/createAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccountAllowPrefund.d.ts +11 -9
- package/dist/types/generated/instructions/createAccountAllowPrefund.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts +13 -10
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts +12 -9
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSol.d.ts +10 -7
- package/dist/types/generated/instructions/transferSol.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts +12 -9
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts +8 -5
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts +13 -10
- 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 +38 -23
- package/src/generated/instructions/allocate.ts +25 -11
- package/src/generated/instructions/allocateWithSeed.ts +35 -17
- package/src/generated/instructions/assign.ts +27 -12
- package/src/generated/instructions/assignWithSeed.ts +38 -16
- package/src/generated/instructions/authorizeNonceAccount.ts +34 -16
- package/src/generated/instructions/createAccount.ts +33 -14
- package/src/generated/instructions/createAccountAllowPrefund.ts +30 -15
- package/src/generated/instructions/createAccountWithSeed.ts +41 -21
- package/src/generated/instructions/initializeNonceAccount.ts +39 -23
- package/src/generated/instructions/transferSol.ts +34 -14
- package/src/generated/instructions/transferSolWithSeed.ts +44 -20
- package/src/generated/instructions/upgradeNonceAccount.ts +25 -10
- package/src/generated/instructions/withdrawNonceAccount.ts +53 -35
- package/src/generated/programs/system.ts +119 -28
|
@@ -26,7 +26,13 @@ import {
|
|
|
26
26
|
type ReadonlyUint8Array,
|
|
27
27
|
type WritableAccount,
|
|
28
28
|
} from '@solana/kit';
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
getAccountMetaFactory,
|
|
31
|
+
type InstructionAccountInput,
|
|
32
|
+
type InstructionAccountInputAddress,
|
|
33
|
+
type ResolvedInstructionAccount,
|
|
34
|
+
type ResolvedInstructionAccountMeta,
|
|
35
|
+
} from '@solana/kit/program-client-core';
|
|
30
36
|
import { SYSTEM_PROGRAM_ADDRESS } from '../programs';
|
|
31
37
|
|
|
32
38
|
export const UPGRADE_NONCE_ACCOUNT_DISCRIMINATOR = 12;
|
|
@@ -70,30 +76,39 @@ export function getUpgradeNonceAccountInstructionDataCodec(): FixedSizeCodec<
|
|
|
70
76
|
return combineCodec(getUpgradeNonceAccountInstructionDataEncoder(), getUpgradeNonceAccountInstructionDataDecoder());
|
|
71
77
|
}
|
|
72
78
|
|
|
73
|
-
export type UpgradeNonceAccountInput<TAccountNonceAccount extends
|
|
74
|
-
nonceAccount:
|
|
79
|
+
export type UpgradeNonceAccountInput<TAccountNonceAccount extends InstructionAccountInput = InstructionAccountInput> = {
|
|
80
|
+
nonceAccount: TAccountNonceAccount;
|
|
75
81
|
};
|
|
76
82
|
|
|
77
83
|
export function getUpgradeNonceAccountInstruction<
|
|
78
|
-
TAccountNonceAccount extends
|
|
84
|
+
TAccountNonceAccount extends InstructionAccountInput,
|
|
79
85
|
TProgramAddress extends Address = typeof SYSTEM_PROGRAM_ADDRESS,
|
|
80
86
|
>(
|
|
81
87
|
input: UpgradeNonceAccountInput<TAccountNonceAccount>,
|
|
82
|
-
config?: { programAddress?: TProgramAddress },
|
|
83
|
-
): UpgradeNonceAccountInstruction<
|
|
88
|
+
config?: { programAddress?: TProgramAddress | { readonly address: TProgramAddress } },
|
|
89
|
+
): UpgradeNonceAccountInstruction<
|
|
90
|
+
TProgramAddress,
|
|
91
|
+
ResolvedInstructionAccountMeta<TAccountNonceAccount, InstructionAccountInputAddress<TAccountNonceAccount>>
|
|
92
|
+
> {
|
|
84
93
|
// Program address.
|
|
85
|
-
const
|
|
94
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
95
|
+
const programAddress = typeof programAddressInput === 'string' ? programAddressInput : programAddressInput.address;
|
|
96
|
+
|
|
97
|
+
// Account meta helper.
|
|
98
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');
|
|
86
99
|
|
|
87
100
|
// Original accounts.
|
|
88
|
-
const originalAccounts = { nonceAccount: { value: input.nonceAccount ?? null, isWritable: true } };
|
|
101
|
+
const originalAccounts = { nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true } };
|
|
89
102
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
90
103
|
|
|
91
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');
|
|
92
104
|
return Object.freeze({
|
|
93
105
|
accounts: [getAccountMeta('nonceAccount', accounts.nonceAccount)],
|
|
94
106
|
data: getUpgradeNonceAccountInstructionDataEncoder().encode({}),
|
|
95
107
|
programAddress,
|
|
96
|
-
} as UpgradeNonceAccountInstruction<
|
|
108
|
+
} as UpgradeNonceAccountInstruction<
|
|
109
|
+
TProgramAddress,
|
|
110
|
+
ResolvedInstructionAccountMeta<TAccountNonceAccount, InstructionAccountInputAddress<TAccountNonceAccount>>
|
|
111
|
+
>);
|
|
97
112
|
}
|
|
98
113
|
|
|
99
114
|
export type ParsedUpgradeNonceAccountInstruction<
|
|
@@ -29,10 +29,16 @@ import {
|
|
|
29
29
|
type ReadonlyAccount,
|
|
30
30
|
type ReadonlySignerAccount,
|
|
31
31
|
type ReadonlyUint8Array,
|
|
32
|
-
type TransactionSigner,
|
|
33
32
|
type WritableAccount,
|
|
34
33
|
} from '@solana/kit';
|
|
35
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
getAccountMetaFactory,
|
|
36
|
+
type InstructionAccountInput,
|
|
37
|
+
type InstructionAccountInputAddress,
|
|
38
|
+
type InstructionSignerInput,
|
|
39
|
+
type ResolvedInstructionAccount,
|
|
40
|
+
type ResolvedInstructionAccountMeta,
|
|
41
|
+
} from '@solana/kit/program-client-core';
|
|
36
42
|
import { SYSTEM_PROGRAM_ADDRESS } from '../programs';
|
|
37
43
|
|
|
38
44
|
export const WITHDRAW_NONCE_ACCOUNT_DISCRIMINATOR = 5;
|
|
@@ -101,26 +107,26 @@ export function getWithdrawNonceAccountInstructionDataCodec(): FixedSizeCodec<
|
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
export type WithdrawNonceAccountInput<
|
|
104
|
-
TAccountNonceAccount extends
|
|
105
|
-
TAccountRecipientAccount extends
|
|
106
|
-
TAccountRecentBlockhashesSysvar extends
|
|
107
|
-
TAccountRentSysvar extends
|
|
108
|
-
TAccountNonceAuthority extends
|
|
110
|
+
TAccountNonceAccount extends InstructionAccountInput = InstructionAccountInput,
|
|
111
|
+
TAccountRecipientAccount extends InstructionAccountInput = InstructionAccountInput,
|
|
112
|
+
TAccountRecentBlockhashesSysvar extends InstructionAccountInput = InstructionAccountInput,
|
|
113
|
+
TAccountRentSysvar extends InstructionAccountInput = InstructionAccountInput,
|
|
114
|
+
TAccountNonceAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
109
115
|
> = {
|
|
110
|
-
nonceAccount:
|
|
111
|
-
recipientAccount:
|
|
112
|
-
recentBlockhashesSysvar?:
|
|
113
|
-
rentSysvar?:
|
|
114
|
-
nonceAuthority:
|
|
116
|
+
nonceAccount: TAccountNonceAccount;
|
|
117
|
+
recipientAccount: TAccountRecipientAccount;
|
|
118
|
+
recentBlockhashesSysvar?: TAccountRecentBlockhashesSysvar;
|
|
119
|
+
rentSysvar?: TAccountRentSysvar;
|
|
120
|
+
nonceAuthority: TAccountNonceAuthority;
|
|
115
121
|
withdrawAmount: WithdrawNonceAccountInstructionDataArgs['withdrawAmount'];
|
|
116
122
|
};
|
|
117
123
|
|
|
118
124
|
export function getWithdrawNonceAccountInstruction<
|
|
119
|
-
TAccountNonceAccount extends
|
|
120
|
-
TAccountRecipientAccount extends
|
|
121
|
-
TAccountRecentBlockhashesSysvar extends
|
|
122
|
-
TAccountRentSysvar extends
|
|
123
|
-
TAccountNonceAuthority extends
|
|
125
|
+
TAccountNonceAccount extends InstructionAccountInput,
|
|
126
|
+
TAccountRecipientAccount extends InstructionAccountInput,
|
|
127
|
+
TAccountRecentBlockhashesSysvar extends InstructionAccountInput,
|
|
128
|
+
TAccountRentSysvar extends InstructionAccountInput,
|
|
129
|
+
TAccountNonceAuthority extends InstructionSignerInput,
|
|
124
130
|
TProgramAddress extends Address = typeof SYSTEM_PROGRAM_ADDRESS,
|
|
125
131
|
>(
|
|
126
132
|
input: WithdrawNonceAccountInput<
|
|
@@ -130,25 +136,32 @@ export function getWithdrawNonceAccountInstruction<
|
|
|
130
136
|
TAccountRentSysvar,
|
|
131
137
|
TAccountNonceAuthority
|
|
132
138
|
>,
|
|
133
|
-
config?: { programAddress?: TProgramAddress },
|
|
139
|
+
config?: { programAddress?: TProgramAddress | { readonly address: TProgramAddress } },
|
|
134
140
|
): WithdrawNonceAccountInstruction<
|
|
135
141
|
TProgramAddress,
|
|
136
|
-
TAccountNonceAccount,
|
|
137
|
-
TAccountRecipientAccount,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
ResolvedInstructionAccountMeta<TAccountNonceAccount, InstructionAccountInputAddress<TAccountNonceAccount>>,
|
|
143
|
+
ResolvedInstructionAccountMeta<TAccountRecipientAccount, InstructionAccountInputAddress<TAccountRecipientAccount>>,
|
|
144
|
+
ResolvedInstructionAccountMeta<
|
|
145
|
+
TAccountRecentBlockhashesSysvar,
|
|
146
|
+
InstructionAccountInputAddress<TAccountRecentBlockhashesSysvar>
|
|
147
|
+
>,
|
|
148
|
+
ResolvedInstructionAccountMeta<TAccountRentSysvar, InstructionAccountInputAddress<TAccountRentSysvar>>,
|
|
149
|
+
ResolvedInstructionAccountMeta<TAccountNonceAuthority, InstructionAccountInputAddress<TAccountNonceAuthority>>
|
|
141
150
|
> {
|
|
142
151
|
// Program address.
|
|
143
|
-
const
|
|
152
|
+
const programAddressInput = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
153
|
+
const programAddress = typeof programAddressInput === 'string' ? programAddressInput : programAddressInput.address;
|
|
154
|
+
|
|
155
|
+
// Account meta helper.
|
|
156
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');
|
|
144
157
|
|
|
145
158
|
// Original accounts.
|
|
146
159
|
const originalAccounts = {
|
|
147
|
-
nonceAccount: { value: input.nonceAccount ?? null, isWritable: true },
|
|
148
|
-
recipientAccount: { value: input.recipientAccount ?? null, isWritable: true },
|
|
149
|
-
recentBlockhashesSysvar: { value: input.recentBlockhashesSysvar ?? null, isWritable: false },
|
|
150
|
-
rentSysvar: { value: input.rentSysvar ?? null, isWritable: false },
|
|
151
|
-
nonceAuthority: { value: input.nonceAuthority ?? null, isWritable: false },
|
|
160
|
+
nonceAccount: { value: input.nonceAccount ?? null, isSigner: false, isWritable: true },
|
|
161
|
+
recipientAccount: { value: input.recipientAccount ?? null, isSigner: false, isWritable: true },
|
|
162
|
+
recentBlockhashesSysvar: { value: input.recentBlockhashesSysvar ?? null, isSigner: false, isWritable: false },
|
|
163
|
+
rentSysvar: { value: input.rentSysvar ?? null, isSigner: false, isWritable: false },
|
|
164
|
+
nonceAuthority: { value: input.nonceAuthority ?? null, isSigner: true, isWritable: false },
|
|
152
165
|
};
|
|
153
166
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
154
167
|
|
|
@@ -165,7 +178,6 @@ export function getWithdrawNonceAccountInstruction<
|
|
|
165
178
|
'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;
|
|
166
179
|
}
|
|
167
180
|
|
|
168
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');
|
|
169
181
|
return Object.freeze({
|
|
170
182
|
accounts: [
|
|
171
183
|
getAccountMeta('nonceAccount', accounts.nonceAccount),
|
|
@@ -178,11 +190,17 @@ export function getWithdrawNonceAccountInstruction<
|
|
|
178
190
|
programAddress,
|
|
179
191
|
} as WithdrawNonceAccountInstruction<
|
|
180
192
|
TProgramAddress,
|
|
181
|
-
TAccountNonceAccount,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
193
|
+
ResolvedInstructionAccountMeta<TAccountNonceAccount, InstructionAccountInputAddress<TAccountNonceAccount>>,
|
|
194
|
+
ResolvedInstructionAccountMeta<
|
|
195
|
+
TAccountRecipientAccount,
|
|
196
|
+
InstructionAccountInputAddress<TAccountRecipientAccount>
|
|
197
|
+
>,
|
|
198
|
+
ResolvedInstructionAccountMeta<
|
|
199
|
+
TAccountRecentBlockhashesSysvar,
|
|
200
|
+
InstructionAccountInputAddress<TAccountRecentBlockhashesSysvar>
|
|
201
|
+
>,
|
|
202
|
+
ResolvedInstructionAccountMeta<TAccountRentSysvar, InstructionAccountInputAddress<TAccountRentSysvar>>,
|
|
203
|
+
ResolvedInstructionAccountMeta<TAccountNonceAuthority, InstructionAccountInputAddress<TAccountNonceAuthority>>
|
|
186
204
|
>);
|
|
187
205
|
}
|
|
188
206
|
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
type ExtendedClient,
|
|
23
23
|
type GetAccountInfoApi,
|
|
24
24
|
type GetMultipleAccountsApi,
|
|
25
|
+
type HasAddress,
|
|
25
26
|
type Instruction,
|
|
26
27
|
type InstructionWithData,
|
|
27
28
|
type ReadonlyUint8Array,
|
|
@@ -298,39 +299,59 @@ export type SystemPluginAccounts = { nonce: ReturnType<typeof getNonceCodec> & S
|
|
|
298
299
|
export type SystemPluginInstructions = {
|
|
299
300
|
createAccount: (
|
|
300
301
|
input: MakeOptional<CreateAccountInput, 'payer'>,
|
|
302
|
+
config?: { programAddress?: Address | HasAddress },
|
|
301
303
|
) => ReturnType<typeof getCreateAccountInstruction> & SelfPlanAndSendFunctions;
|
|
302
|
-
assign: (
|
|
303
|
-
|
|
304
|
+
assign: (
|
|
305
|
+
input: AssignInput,
|
|
306
|
+
config?: { programAddress?: Address | HasAddress },
|
|
307
|
+
) => ReturnType<typeof getAssignInstruction> & SelfPlanAndSendFunctions;
|
|
308
|
+
transferSol: (
|
|
309
|
+
input: TransferSolInput,
|
|
310
|
+
config?: { programAddress?: Address | HasAddress },
|
|
311
|
+
) => ReturnType<typeof getTransferSolInstruction> & SelfPlanAndSendFunctions;
|
|
304
312
|
createAccountWithSeed: (
|
|
305
313
|
input: MakeOptional<CreateAccountWithSeedInput, 'payer'>,
|
|
314
|
+
config?: { programAddress?: Address | HasAddress },
|
|
306
315
|
) => ReturnType<typeof getCreateAccountWithSeedInstruction> & SelfPlanAndSendFunctions;
|
|
307
316
|
advanceNonceAccount: (
|
|
308
317
|
input: AdvanceNonceAccountInput,
|
|
318
|
+
config?: { programAddress?: Address | HasAddress },
|
|
309
319
|
) => ReturnType<typeof getAdvanceNonceAccountInstruction> & SelfPlanAndSendFunctions;
|
|
310
320
|
withdrawNonceAccount: (
|
|
311
321
|
input: WithdrawNonceAccountInput,
|
|
322
|
+
config?: { programAddress?: Address | HasAddress },
|
|
312
323
|
) => ReturnType<typeof getWithdrawNonceAccountInstruction> & SelfPlanAndSendFunctions;
|
|
313
324
|
initializeNonceAccount: (
|
|
314
325
|
input: InitializeNonceAccountInput,
|
|
326
|
+
config?: { programAddress?: Address | HasAddress },
|
|
315
327
|
) => ReturnType<typeof getInitializeNonceAccountInstruction> & SelfPlanAndSendFunctions;
|
|
316
328
|
authorizeNonceAccount: (
|
|
317
329
|
input: AuthorizeNonceAccountInput,
|
|
330
|
+
config?: { programAddress?: Address | HasAddress },
|
|
318
331
|
) => ReturnType<typeof getAuthorizeNonceAccountInstruction> & SelfPlanAndSendFunctions;
|
|
319
|
-
allocate: (
|
|
332
|
+
allocate: (
|
|
333
|
+
input: AllocateInput,
|
|
334
|
+
config?: { programAddress?: Address | HasAddress },
|
|
335
|
+
) => ReturnType<typeof getAllocateInstruction> & SelfPlanAndSendFunctions;
|
|
320
336
|
allocateWithSeed: (
|
|
321
337
|
input: AllocateWithSeedInput,
|
|
338
|
+
config?: { programAddress?: Address | HasAddress },
|
|
322
339
|
) => ReturnType<typeof getAllocateWithSeedInstruction> & SelfPlanAndSendFunctions;
|
|
323
340
|
assignWithSeed: (
|
|
324
341
|
input: AssignWithSeedInput,
|
|
342
|
+
config?: { programAddress?: Address | HasAddress },
|
|
325
343
|
) => ReturnType<typeof getAssignWithSeedInstruction> & SelfPlanAndSendFunctions;
|
|
326
344
|
transferSolWithSeed: (
|
|
327
345
|
input: TransferSolWithSeedInput,
|
|
346
|
+
config?: { programAddress?: Address | HasAddress },
|
|
328
347
|
) => ReturnType<typeof getTransferSolWithSeedInstruction> & SelfPlanAndSendFunctions;
|
|
329
348
|
upgradeNonceAccount: (
|
|
330
349
|
input: UpgradeNonceAccountInput,
|
|
350
|
+
config?: { programAddress?: Address | HasAddress },
|
|
331
351
|
) => ReturnType<typeof getUpgradeNonceAccountInstruction> & SelfPlanAndSendFunctions;
|
|
332
352
|
createAccountAllowPrefund: (
|
|
333
353
|
input: CreateAccountAllowPrefundInput,
|
|
354
|
+
config?: { programAddress?: Address | HasAddress },
|
|
334
355
|
) => ReturnType<typeof getCreateAccountAllowPrefundInstruction> & SelfPlanAndSendFunctions;
|
|
335
356
|
};
|
|
336
357
|
|
|
@@ -339,42 +360,112 @@ export type SystemPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMult
|
|
|
339
360
|
ClientWithTransactionPlanning &
|
|
340
361
|
ClientWithTransactionSending;
|
|
341
362
|
|
|
342
|
-
export function systemProgram() {
|
|
363
|
+
export function systemProgram(config: { programAddress?: Address | HasAddress } = {}) {
|
|
343
364
|
return <T extends SystemPluginRequirements>(client: T): ExtendedClient<T, { system: SystemPlugin }> => {
|
|
344
365
|
return extendClient(client, {
|
|
345
366
|
system: <SystemPlugin>{
|
|
346
367
|
accounts: { nonce: addSelfFetchFunctions(client, getNonceCodec()) },
|
|
347
368
|
instructions: {
|
|
348
|
-
createAccount: input =>
|
|
369
|
+
createAccount: (input, instructionConfig) =>
|
|
349
370
|
addSelfPlanAndSendFunctions(
|
|
350
371
|
client,
|
|
351
|
-
getCreateAccountInstruction(
|
|
372
|
+
getCreateAccountInstruction(
|
|
373
|
+
{ ...input, payer: input.payer ?? client.payer },
|
|
374
|
+
{ programAddress: instructionConfig?.programAddress ?? config.programAddress },
|
|
375
|
+
),
|
|
352
376
|
),
|
|
353
|
-
assign: input
|
|
354
|
-
transferSol: input => addSelfPlanAndSendFunctions(client, getTransferSolInstruction(input)),
|
|
355
|
-
createAccountWithSeed: input =>
|
|
377
|
+
assign: (input, instructionConfig) =>
|
|
356
378
|
addSelfPlanAndSendFunctions(
|
|
357
379
|
client,
|
|
358
|
-
|
|
380
|
+
getAssignInstruction(input, {
|
|
381
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
382
|
+
}),
|
|
383
|
+
),
|
|
384
|
+
transferSol: (input, instructionConfig) =>
|
|
385
|
+
addSelfPlanAndSendFunctions(
|
|
386
|
+
client,
|
|
387
|
+
getTransferSolInstruction(input, {
|
|
388
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
389
|
+
}),
|
|
390
|
+
),
|
|
391
|
+
createAccountWithSeed: (input, instructionConfig) =>
|
|
392
|
+
addSelfPlanAndSendFunctions(
|
|
393
|
+
client,
|
|
394
|
+
getCreateAccountWithSeedInstruction(
|
|
395
|
+
{ ...input, payer: input.payer ?? client.payer },
|
|
396
|
+
{ programAddress: instructionConfig?.programAddress ?? config.programAddress },
|
|
397
|
+
),
|
|
398
|
+
),
|
|
399
|
+
advanceNonceAccount: (input, instructionConfig) =>
|
|
400
|
+
addSelfPlanAndSendFunctions(
|
|
401
|
+
client,
|
|
402
|
+
getAdvanceNonceAccountInstruction(input, {
|
|
403
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
404
|
+
}),
|
|
405
|
+
),
|
|
406
|
+
withdrawNonceAccount: (input, instructionConfig) =>
|
|
407
|
+
addSelfPlanAndSendFunctions(
|
|
408
|
+
client,
|
|
409
|
+
getWithdrawNonceAccountInstruction(input, {
|
|
410
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
411
|
+
}),
|
|
412
|
+
),
|
|
413
|
+
initializeNonceAccount: (input, instructionConfig) =>
|
|
414
|
+
addSelfPlanAndSendFunctions(
|
|
415
|
+
client,
|
|
416
|
+
getInitializeNonceAccountInstruction(input, {
|
|
417
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
418
|
+
}),
|
|
419
|
+
),
|
|
420
|
+
authorizeNonceAccount: (input, instructionConfig) =>
|
|
421
|
+
addSelfPlanAndSendFunctions(
|
|
422
|
+
client,
|
|
423
|
+
getAuthorizeNonceAccountInstruction(input, {
|
|
424
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
425
|
+
}),
|
|
426
|
+
),
|
|
427
|
+
allocate: (input, instructionConfig) =>
|
|
428
|
+
addSelfPlanAndSendFunctions(
|
|
429
|
+
client,
|
|
430
|
+
getAllocateInstruction(input, {
|
|
431
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
432
|
+
}),
|
|
433
|
+
),
|
|
434
|
+
allocateWithSeed: (input, instructionConfig) =>
|
|
435
|
+
addSelfPlanAndSendFunctions(
|
|
436
|
+
client,
|
|
437
|
+
getAllocateWithSeedInstruction(input, {
|
|
438
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
439
|
+
}),
|
|
440
|
+
),
|
|
441
|
+
assignWithSeed: (input, instructionConfig) =>
|
|
442
|
+
addSelfPlanAndSendFunctions(
|
|
443
|
+
client,
|
|
444
|
+
getAssignWithSeedInstruction(input, {
|
|
445
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
446
|
+
}),
|
|
447
|
+
),
|
|
448
|
+
transferSolWithSeed: (input, instructionConfig) =>
|
|
449
|
+
addSelfPlanAndSendFunctions(
|
|
450
|
+
client,
|
|
451
|
+
getTransferSolWithSeedInstruction(input, {
|
|
452
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
453
|
+
}),
|
|
454
|
+
),
|
|
455
|
+
upgradeNonceAccount: (input, instructionConfig) =>
|
|
456
|
+
addSelfPlanAndSendFunctions(
|
|
457
|
+
client,
|
|
458
|
+
getUpgradeNonceAccountInstruction(input, {
|
|
459
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
460
|
+
}),
|
|
461
|
+
),
|
|
462
|
+
createAccountAllowPrefund: (input, instructionConfig) =>
|
|
463
|
+
addSelfPlanAndSendFunctions(
|
|
464
|
+
client,
|
|
465
|
+
getCreateAccountAllowPrefundInstruction(input, {
|
|
466
|
+
programAddress: instructionConfig?.programAddress ?? config.programAddress,
|
|
467
|
+
}),
|
|
359
468
|
),
|
|
360
|
-
advanceNonceAccount: input =>
|
|
361
|
-
addSelfPlanAndSendFunctions(client, getAdvanceNonceAccountInstruction(input)),
|
|
362
|
-
withdrawNonceAccount: input =>
|
|
363
|
-
addSelfPlanAndSendFunctions(client, getWithdrawNonceAccountInstruction(input)),
|
|
364
|
-
initializeNonceAccount: input =>
|
|
365
|
-
addSelfPlanAndSendFunctions(client, getInitializeNonceAccountInstruction(input)),
|
|
366
|
-
authorizeNonceAccount: input =>
|
|
367
|
-
addSelfPlanAndSendFunctions(client, getAuthorizeNonceAccountInstruction(input)),
|
|
368
|
-
allocate: input => addSelfPlanAndSendFunctions(client, getAllocateInstruction(input)),
|
|
369
|
-
allocateWithSeed: input =>
|
|
370
|
-
addSelfPlanAndSendFunctions(client, getAllocateWithSeedInstruction(input)),
|
|
371
|
-
assignWithSeed: input => addSelfPlanAndSendFunctions(client, getAssignWithSeedInstruction(input)),
|
|
372
|
-
transferSolWithSeed: input =>
|
|
373
|
-
addSelfPlanAndSendFunctions(client, getTransferSolWithSeedInstruction(input)),
|
|
374
|
-
upgradeNonceAccount: input =>
|
|
375
|
-
addSelfPlanAndSendFunctions(client, getUpgradeNonceAccountInstruction(input)),
|
|
376
|
-
createAccountAllowPrefund: input =>
|
|
377
|
-
addSelfPlanAndSendFunctions(client, getCreateAccountAllowPrefundInstruction(input)),
|
|
378
469
|
},
|
|
379
470
|
identifyInstruction: identifySystemInstruction,
|
|
380
471
|
parseInstruction: parseSystemInstruction,
|