@picon-finance/dlmm-sdk 2.0.3 → 2.0.4
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/generated/instructions/acceptAdminAuthority.d.ts +12 -11
- package/dist/generated/instructions/acceptAdminAuthority.d.ts.map +1 -1
- package/dist/generated/instructions/acceptAdminAuthority.js +16 -4
- package/dist/generated/instructions/claimFee.d.ts +19 -18
- package/dist/generated/instructions/claimFee.d.ts.map +1 -1
- package/dist/generated/instructions/claimFee.js +52 -12
- package/dist/generated/instructions/claimProtocolFee.d.ts +30 -29
- package/dist/generated/instructions/claimProtocolFee.d.ts.map +1 -1
- package/dist/generated/instructions/claimProtocolFee.js +90 -20
- package/dist/generated/instructions/closePosition.d.ts +18 -17
- package/dist/generated/instructions/closePosition.d.ts.map +1 -1
- package/dist/generated/instructions/closePosition.js +38 -10
- package/dist/generated/instructions/createAdminConfig.d.ts +18 -17
- package/dist/generated/instructions/createAdminConfig.d.ts.map +1 -1
- package/dist/generated/instructions/createAdminConfig.js +54 -12
- package/dist/generated/instructions/createBinArray.d.ts +16 -15
- package/dist/generated/instructions/createBinArray.d.ts.map +1 -1
- package/dist/generated/instructions/createBinArray.js +28 -10
- package/dist/generated/instructions/createPool.d.ts +30 -29
- package/dist/generated/instructions/createPool.d.ts.map +1 -1
- package/dist/generated/instructions/createPool.js +98 -22
- package/dist/generated/instructions/deleteBinArray.d.ts +18 -17
- package/dist/generated/instructions/deleteBinArray.d.ts.map +1 -1
- package/dist/generated/instructions/deleteBinArray.js +54 -12
- package/dist/generated/instructions/depositByWeight.d.ts +19 -18
- package/dist/generated/instructions/depositByWeight.d.ts.map +1 -1
- package/dist/generated/instructions/depositByWeight.js +52 -12
- package/dist/generated/instructions/openPosition.d.ts +28 -27
- package/dist/generated/instructions/openPosition.d.ts.map +1 -1
- package/dist/generated/instructions/openPosition.js +64 -16
- package/dist/generated/instructions/resetAdminAuthority.d.ts +16 -15
- package/dist/generated/instructions/resetAdminAuthority.d.ts.map +1 -1
- package/dist/generated/instructions/resetAdminAuthority.js +44 -10
- package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts +12 -11
- package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts.map +1 -1
- package/dist/generated/instructions/setMetadataUpdateAuthority.js +24 -6
- package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts +14 -13
- package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts.map +1 -1
- package/dist/generated/instructions/setPoolDynamicFeeConfig.js +26 -8
- package/dist/generated/instructions/setPoolProtocolShare.d.ts +14 -13
- package/dist/generated/instructions/setPoolProtocolShare.d.ts.map +1 -1
- package/dist/generated/instructions/setPoolProtocolShare.js +26 -8
- package/dist/generated/instructions/swapExactIn.d.ts +15 -14
- package/dist/generated/instructions/swapExactIn.d.ts.map +1 -1
- package/dist/generated/instructions/swapExactIn.js +36 -9
- package/dist/generated/instructions/swapExactOut.d.ts +15 -14
- package/dist/generated/instructions/swapExactOut.d.ts.map +1 -1
- package/dist/generated/instructions/swapExactOut.js +36 -9
- package/dist/generated/instructions/syncPool.d.ts +7 -6
- package/dist/generated/instructions/syncPool.d.ts.map +1 -1
- package/dist/generated/instructions/syncPool.js +4 -3
- package/dist/generated/instructions/transferAdminAuthority.d.ts +12 -11
- package/dist/generated/instructions/transferAdminAuthority.d.ts.map +1 -1
- package/dist/generated/instructions/transferAdminAuthority.js +24 -6
- package/dist/generated/instructions/withdraw.d.ts +19 -18
- package/dist/generated/instructions/withdraw.d.ts.map +1 -1
- package/dist/generated/instructions/withdraw.js +52 -12
- package/package.json +5 -5
- package/src/generated/instructions/acceptAdminAuthority.ts +68 -25
- package/src/generated/instructions/claimFee.ts +218 -83
- package/src/generated/instructions/claimProtocolFee.ts +346 -131
- package/src/generated/instructions/closePosition.ts +160 -61
- package/src/generated/instructions/createAdminConfig.ts +172 -63
- package/src/generated/instructions/createBinArray.ts +124 -51
- package/src/generated/instructions/createPool.ts +354 -133
- package/src/generated/instructions/deleteBinArray.ts +172 -63
- package/src/generated/instructions/depositByWeight.ts +218 -83
- package/src/generated/instructions/openPosition.ts +300 -117
- package/src/generated/instructions/resetAdminAuthority.ts +138 -51
- package/src/generated/instructions/setMetadataUpdateAuthority.ts +74 -27
- package/src/generated/instructions/setPoolDynamicFeeConfig.ts +98 -39
- package/src/generated/instructions/setPoolProtocolShare.ts +98 -39
- package/src/generated/instructions/swapExactIn.ts +155 -60
- package/src/generated/instructions/swapExactOut.ts +155 -60
- package/src/generated/instructions/syncPool.ts +37 -12
- package/src/generated/instructions/transferAdminAuthority.ts +74 -27
- package/src/generated/instructions/withdraw.ts +218 -83
|
@@ -28,14 +28,17 @@ import {
|
|
|
28
28
|
type InstructionWithData,
|
|
29
29
|
type ReadonlyAccount,
|
|
30
30
|
type ReadonlyUint8Array,
|
|
31
|
-
type TransactionSigner,
|
|
32
31
|
type WritableAccount,
|
|
33
32
|
type WritableSignerAccount,
|
|
34
33
|
} from "@solana/kit";
|
|
35
34
|
import {
|
|
36
35
|
getAccountMetaFactory,
|
|
37
36
|
getAddressFromResolvedInstructionAccount,
|
|
37
|
+
type InstructionAccountInput,
|
|
38
|
+
type InstructionAccountInputAddress,
|
|
39
|
+
type InstructionSignerInput,
|
|
38
40
|
type ResolvedInstructionAccount,
|
|
41
|
+
type ResolvedInstructionAccountMeta,
|
|
39
42
|
} from "@solana/program-client-core";
|
|
40
43
|
import { findPositionPda } from "../pdas/index.js";
|
|
41
44
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
@@ -113,25 +116,28 @@ export function getClosePositionInstructionDataCodec(): FixedSizeCodec<
|
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
export type ClosePositionAsyncInput<
|
|
116
|
-
TAccountOwner extends
|
|
117
|
-
TAccountPosition extends
|
|
118
|
-
TAccountPositionMint extends
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
TAccountOwner extends InstructionSignerInput = InstructionSignerInput,
|
|
120
|
+
TAccountPosition extends InstructionAccountInput = InstructionAccountInput,
|
|
121
|
+
TAccountPositionMint extends InstructionAccountInput =
|
|
122
|
+
InstructionAccountInput,
|
|
123
|
+
TAccountPositionTokenAccount extends InstructionAccountInput =
|
|
124
|
+
InstructionAccountInput,
|
|
125
|
+
TAccountTokenProgram extends InstructionAccountInput =
|
|
126
|
+
InstructionAccountInput,
|
|
121
127
|
> = {
|
|
122
|
-
owner:
|
|
123
|
-
position?:
|
|
124
|
-
positionMint:
|
|
125
|
-
positionTokenAccount:
|
|
126
|
-
tokenProgram?:
|
|
128
|
+
owner: TAccountOwner;
|
|
129
|
+
position?: TAccountPosition;
|
|
130
|
+
positionMint: TAccountPositionMint;
|
|
131
|
+
positionTokenAccount: TAccountPositionTokenAccount;
|
|
132
|
+
tokenProgram?: TAccountTokenProgram;
|
|
127
133
|
};
|
|
128
134
|
|
|
129
135
|
export async function getClosePositionInstructionAsync<
|
|
130
|
-
TAccountOwner extends
|
|
131
|
-
TAccountPosition extends
|
|
132
|
-
TAccountPositionMint extends
|
|
133
|
-
TAccountPositionTokenAccount extends
|
|
134
|
-
TAccountTokenProgram extends
|
|
136
|
+
TAccountOwner extends InstructionSignerInput,
|
|
137
|
+
TAccountPosition extends InstructionAccountInput,
|
|
138
|
+
TAccountPositionMint extends InstructionAccountInput,
|
|
139
|
+
TAccountPositionTokenAccount extends InstructionAccountInput,
|
|
140
|
+
TAccountTokenProgram extends InstructionAccountInput,
|
|
135
141
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
136
142
|
>(
|
|
137
143
|
input: ClosePositionAsyncInput<
|
|
@@ -145,26 +151,57 @@ export async function getClosePositionInstructionAsync<
|
|
|
145
151
|
): Promise<
|
|
146
152
|
ClosePositionInstruction<
|
|
147
153
|
TProgramAddress,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
ResolvedInstructionAccountMeta<
|
|
155
|
+
TAccountOwner,
|
|
156
|
+
InstructionAccountInputAddress<TAccountOwner>
|
|
157
|
+
>,
|
|
158
|
+
ResolvedInstructionAccountMeta<
|
|
159
|
+
TAccountPosition,
|
|
160
|
+
InstructionAccountInputAddress<TAccountPosition>
|
|
161
|
+
>,
|
|
162
|
+
ResolvedInstructionAccountMeta<
|
|
163
|
+
TAccountPositionMint,
|
|
164
|
+
InstructionAccountInputAddress<TAccountPositionMint>
|
|
165
|
+
>,
|
|
166
|
+
ResolvedInstructionAccountMeta<
|
|
167
|
+
TAccountPositionTokenAccount,
|
|
168
|
+
InstructionAccountInputAddress<TAccountPositionTokenAccount>
|
|
169
|
+
>,
|
|
170
|
+
ResolvedInstructionAccountMeta<
|
|
171
|
+
TAccountTokenProgram,
|
|
172
|
+
InstructionAccountInputAddress<TAccountTokenProgram>
|
|
173
|
+
>
|
|
153
174
|
>
|
|
154
175
|
> {
|
|
155
176
|
// Program address.
|
|
156
177
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
157
178
|
|
|
179
|
+
// Account meta helper.
|
|
180
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
181
|
+
|
|
158
182
|
// Original accounts.
|
|
159
183
|
const originalAccounts = {
|
|
160
|
-
owner: { value: input.owner ?? null, isWritable: true },
|
|
161
|
-
position: {
|
|
162
|
-
|
|
184
|
+
owner: { value: input.owner ?? null, isSigner: true, isWritable: true },
|
|
185
|
+
position: {
|
|
186
|
+
value: input.position ?? null,
|
|
187
|
+
isSigner: false,
|
|
188
|
+
isWritable: true,
|
|
189
|
+
},
|
|
190
|
+
positionMint: {
|
|
191
|
+
value: input.positionMint ?? null,
|
|
192
|
+
isSigner: false,
|
|
193
|
+
isWritable: true,
|
|
194
|
+
},
|
|
163
195
|
positionTokenAccount: {
|
|
164
196
|
value: input.positionTokenAccount ?? null,
|
|
197
|
+
isSigner: false,
|
|
165
198
|
isWritable: true,
|
|
166
199
|
},
|
|
167
|
-
tokenProgram: {
|
|
200
|
+
tokenProgram: {
|
|
201
|
+
value: input.tokenProgram ?? null,
|
|
202
|
+
isSigner: false,
|
|
203
|
+
isWritable: false,
|
|
204
|
+
},
|
|
168
205
|
};
|
|
169
206
|
const accounts = originalAccounts as Record<
|
|
170
207
|
keyof typeof originalAccounts,
|
|
@@ -188,7 +225,6 @@ export async function getClosePositionInstructionAsync<
|
|
|
188
225
|
"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" as Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">;
|
|
189
226
|
}
|
|
190
227
|
|
|
191
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
192
228
|
return Object.freeze({
|
|
193
229
|
accounts: [
|
|
194
230
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -201,34 +237,52 @@ export async function getClosePositionInstructionAsync<
|
|
|
201
237
|
programAddress,
|
|
202
238
|
} as ClosePositionInstruction<
|
|
203
239
|
TProgramAddress,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
240
|
+
ResolvedInstructionAccountMeta<
|
|
241
|
+
TAccountOwner,
|
|
242
|
+
InstructionAccountInputAddress<TAccountOwner>
|
|
243
|
+
>,
|
|
244
|
+
ResolvedInstructionAccountMeta<
|
|
245
|
+
TAccountPosition,
|
|
246
|
+
InstructionAccountInputAddress<TAccountPosition>
|
|
247
|
+
>,
|
|
248
|
+
ResolvedInstructionAccountMeta<
|
|
249
|
+
TAccountPositionMint,
|
|
250
|
+
InstructionAccountInputAddress<TAccountPositionMint>
|
|
251
|
+
>,
|
|
252
|
+
ResolvedInstructionAccountMeta<
|
|
253
|
+
TAccountPositionTokenAccount,
|
|
254
|
+
InstructionAccountInputAddress<TAccountPositionTokenAccount>
|
|
255
|
+
>,
|
|
256
|
+
ResolvedInstructionAccountMeta<
|
|
257
|
+
TAccountTokenProgram,
|
|
258
|
+
InstructionAccountInputAddress<TAccountTokenProgram>
|
|
259
|
+
>
|
|
209
260
|
>);
|
|
210
261
|
}
|
|
211
262
|
|
|
212
263
|
export type ClosePositionInput<
|
|
213
|
-
TAccountOwner extends
|
|
214
|
-
TAccountPosition extends
|
|
215
|
-
TAccountPositionMint extends
|
|
216
|
-
|
|
217
|
-
|
|
264
|
+
TAccountOwner extends InstructionSignerInput = InstructionSignerInput,
|
|
265
|
+
TAccountPosition extends InstructionAccountInput = InstructionAccountInput,
|
|
266
|
+
TAccountPositionMint extends InstructionAccountInput =
|
|
267
|
+
InstructionAccountInput,
|
|
268
|
+
TAccountPositionTokenAccount extends InstructionAccountInput =
|
|
269
|
+
InstructionAccountInput,
|
|
270
|
+
TAccountTokenProgram extends InstructionAccountInput =
|
|
271
|
+
InstructionAccountInput,
|
|
218
272
|
> = {
|
|
219
|
-
owner:
|
|
220
|
-
position:
|
|
221
|
-
positionMint:
|
|
222
|
-
positionTokenAccount:
|
|
223
|
-
tokenProgram?:
|
|
273
|
+
owner: TAccountOwner;
|
|
274
|
+
position: TAccountPosition;
|
|
275
|
+
positionMint: TAccountPositionMint;
|
|
276
|
+
positionTokenAccount: TAccountPositionTokenAccount;
|
|
277
|
+
tokenProgram?: TAccountTokenProgram;
|
|
224
278
|
};
|
|
225
279
|
|
|
226
280
|
export function getClosePositionInstruction<
|
|
227
|
-
TAccountOwner extends
|
|
228
|
-
TAccountPosition extends
|
|
229
|
-
TAccountPositionMint extends
|
|
230
|
-
TAccountPositionTokenAccount extends
|
|
231
|
-
TAccountTokenProgram extends
|
|
281
|
+
TAccountOwner extends InstructionSignerInput,
|
|
282
|
+
TAccountPosition extends InstructionAccountInput,
|
|
283
|
+
TAccountPositionMint extends InstructionAccountInput,
|
|
284
|
+
TAccountPositionTokenAccount extends InstructionAccountInput,
|
|
285
|
+
TAccountTokenProgram extends InstructionAccountInput,
|
|
232
286
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
233
287
|
>(
|
|
234
288
|
input: ClosePositionInput<
|
|
@@ -241,25 +295,56 @@ export function getClosePositionInstruction<
|
|
|
241
295
|
config?: { programAddress?: TProgramAddress },
|
|
242
296
|
): ClosePositionInstruction<
|
|
243
297
|
TProgramAddress,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
298
|
+
ResolvedInstructionAccountMeta<
|
|
299
|
+
TAccountOwner,
|
|
300
|
+
InstructionAccountInputAddress<TAccountOwner>
|
|
301
|
+
>,
|
|
302
|
+
ResolvedInstructionAccountMeta<
|
|
303
|
+
TAccountPosition,
|
|
304
|
+
InstructionAccountInputAddress<TAccountPosition>
|
|
305
|
+
>,
|
|
306
|
+
ResolvedInstructionAccountMeta<
|
|
307
|
+
TAccountPositionMint,
|
|
308
|
+
InstructionAccountInputAddress<TAccountPositionMint>
|
|
309
|
+
>,
|
|
310
|
+
ResolvedInstructionAccountMeta<
|
|
311
|
+
TAccountPositionTokenAccount,
|
|
312
|
+
InstructionAccountInputAddress<TAccountPositionTokenAccount>
|
|
313
|
+
>,
|
|
314
|
+
ResolvedInstructionAccountMeta<
|
|
315
|
+
TAccountTokenProgram,
|
|
316
|
+
InstructionAccountInputAddress<TAccountTokenProgram>
|
|
317
|
+
>
|
|
249
318
|
> {
|
|
250
319
|
// Program address.
|
|
251
320
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
252
321
|
|
|
322
|
+
// Account meta helper.
|
|
323
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
324
|
+
|
|
253
325
|
// Original accounts.
|
|
254
326
|
const originalAccounts = {
|
|
255
|
-
owner: { value: input.owner ?? null, isWritable: true },
|
|
256
|
-
position: {
|
|
257
|
-
|
|
327
|
+
owner: { value: input.owner ?? null, isSigner: true, isWritable: true },
|
|
328
|
+
position: {
|
|
329
|
+
value: input.position ?? null,
|
|
330
|
+
isSigner: false,
|
|
331
|
+
isWritable: true,
|
|
332
|
+
},
|
|
333
|
+
positionMint: {
|
|
334
|
+
value: input.positionMint ?? null,
|
|
335
|
+
isSigner: false,
|
|
336
|
+
isWritable: true,
|
|
337
|
+
},
|
|
258
338
|
positionTokenAccount: {
|
|
259
339
|
value: input.positionTokenAccount ?? null,
|
|
340
|
+
isSigner: false,
|
|
260
341
|
isWritable: true,
|
|
261
342
|
},
|
|
262
|
-
tokenProgram: {
|
|
343
|
+
tokenProgram: {
|
|
344
|
+
value: input.tokenProgram ?? null,
|
|
345
|
+
isSigner: false,
|
|
346
|
+
isWritable: false,
|
|
347
|
+
},
|
|
263
348
|
};
|
|
264
349
|
const accounts = originalAccounts as Record<
|
|
265
350
|
keyof typeof originalAccounts,
|
|
@@ -272,7 +357,6 @@ export function getClosePositionInstruction<
|
|
|
272
357
|
"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" as Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">;
|
|
273
358
|
}
|
|
274
359
|
|
|
275
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
276
360
|
return Object.freeze({
|
|
277
361
|
accounts: [
|
|
278
362
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -285,11 +369,26 @@ export function getClosePositionInstruction<
|
|
|
285
369
|
programAddress,
|
|
286
370
|
} as ClosePositionInstruction<
|
|
287
371
|
TProgramAddress,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
372
|
+
ResolvedInstructionAccountMeta<
|
|
373
|
+
TAccountOwner,
|
|
374
|
+
InstructionAccountInputAddress<TAccountOwner>
|
|
375
|
+
>,
|
|
376
|
+
ResolvedInstructionAccountMeta<
|
|
377
|
+
TAccountPosition,
|
|
378
|
+
InstructionAccountInputAddress<TAccountPosition>
|
|
379
|
+
>,
|
|
380
|
+
ResolvedInstructionAccountMeta<
|
|
381
|
+
TAccountPositionMint,
|
|
382
|
+
InstructionAccountInputAddress<TAccountPositionMint>
|
|
383
|
+
>,
|
|
384
|
+
ResolvedInstructionAccountMeta<
|
|
385
|
+
TAccountPositionTokenAccount,
|
|
386
|
+
InstructionAccountInputAddress<TAccountPositionTokenAccount>
|
|
387
|
+
>,
|
|
388
|
+
ResolvedInstructionAccountMeta<
|
|
389
|
+
TAccountTokenProgram,
|
|
390
|
+
InstructionAccountInputAddress<TAccountTokenProgram>
|
|
391
|
+
>
|
|
293
392
|
>);
|
|
294
393
|
}
|
|
295
394
|
|
|
@@ -28,13 +28,16 @@ import {
|
|
|
28
28
|
type InstructionWithData,
|
|
29
29
|
type ReadonlyAccount,
|
|
30
30
|
type ReadonlyUint8Array,
|
|
31
|
-
type TransactionSigner,
|
|
32
31
|
type WritableAccount,
|
|
33
32
|
type WritableSignerAccount,
|
|
34
33
|
} from "@solana/kit";
|
|
35
34
|
import {
|
|
36
35
|
getAccountMetaFactory,
|
|
36
|
+
type InstructionAccountInput,
|
|
37
|
+
type InstructionAccountInputAddress,
|
|
38
|
+
type InstructionSignerInput,
|
|
37
39
|
type ResolvedInstructionAccount,
|
|
40
|
+
type ResolvedInstructionAccountMeta,
|
|
38
41
|
} from "@solana/program-client-core";
|
|
39
42
|
import { findAdminConfigPda } from "../pdas/index.js";
|
|
40
43
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
@@ -112,25 +115,26 @@ export function getCreateAdminConfigInstructionDataCodec(): FixedSizeCodec<
|
|
|
112
115
|
}
|
|
113
116
|
|
|
114
117
|
export type CreateAdminConfigAsyncInput<
|
|
115
|
-
TAccountDeployer extends
|
|
116
|
-
TAccountAdminConfig extends
|
|
117
|
-
TAccountProgram extends
|
|
118
|
-
TAccountProgramData extends
|
|
119
|
-
TAccountSystemProgram extends
|
|
118
|
+
TAccountDeployer extends InstructionSignerInput = InstructionSignerInput,
|
|
119
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
120
|
+
TAccountProgram extends InstructionAccountInput = InstructionAccountInput,
|
|
121
|
+
TAccountProgramData extends InstructionAccountInput = InstructionAccountInput,
|
|
122
|
+
TAccountSystemProgram extends InstructionAccountInput =
|
|
123
|
+
InstructionAccountInput,
|
|
120
124
|
> = {
|
|
121
|
-
deployer:
|
|
122
|
-
adminConfig?:
|
|
123
|
-
program?:
|
|
124
|
-
programData:
|
|
125
|
-
systemProgram?:
|
|
125
|
+
deployer: TAccountDeployer;
|
|
126
|
+
adminConfig?: TAccountAdminConfig;
|
|
127
|
+
program?: TAccountProgram;
|
|
128
|
+
programData: TAccountProgramData;
|
|
129
|
+
systemProgram?: TAccountSystemProgram;
|
|
126
130
|
};
|
|
127
131
|
|
|
128
132
|
export async function getCreateAdminConfigInstructionAsync<
|
|
129
|
-
TAccountDeployer extends
|
|
130
|
-
TAccountAdminConfig extends
|
|
131
|
-
TAccountProgram extends
|
|
132
|
-
TAccountProgramData extends
|
|
133
|
-
TAccountSystemProgram extends
|
|
133
|
+
TAccountDeployer extends InstructionSignerInput,
|
|
134
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
135
|
+
TAccountProgram extends InstructionAccountInput,
|
|
136
|
+
TAccountProgramData extends InstructionAccountInput,
|
|
137
|
+
TAccountSystemProgram extends InstructionAccountInput,
|
|
134
138
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
135
139
|
>(
|
|
136
140
|
input: CreateAdminConfigAsyncInput<
|
|
@@ -144,23 +148,61 @@ export async function getCreateAdminConfigInstructionAsync<
|
|
|
144
148
|
): Promise<
|
|
145
149
|
CreateAdminConfigInstruction<
|
|
146
150
|
TProgramAddress,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
ResolvedInstructionAccountMeta<
|
|
152
|
+
TAccountDeployer,
|
|
153
|
+
InstructionAccountInputAddress<TAccountDeployer>
|
|
154
|
+
>,
|
|
155
|
+
ResolvedInstructionAccountMeta<
|
|
156
|
+
TAccountAdminConfig,
|
|
157
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
158
|
+
>,
|
|
159
|
+
ResolvedInstructionAccountMeta<
|
|
160
|
+
TAccountProgram,
|
|
161
|
+
InstructionAccountInputAddress<TAccountProgram>
|
|
162
|
+
>,
|
|
163
|
+
ResolvedInstructionAccountMeta<
|
|
164
|
+
TAccountProgramData,
|
|
165
|
+
InstructionAccountInputAddress<TAccountProgramData>
|
|
166
|
+
>,
|
|
167
|
+
ResolvedInstructionAccountMeta<
|
|
168
|
+
TAccountSystemProgram,
|
|
169
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
170
|
+
>
|
|
152
171
|
>
|
|
153
172
|
> {
|
|
154
173
|
// Program address.
|
|
155
174
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
156
175
|
|
|
176
|
+
// Account meta helper.
|
|
177
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
178
|
+
|
|
157
179
|
// Original accounts.
|
|
158
180
|
const originalAccounts = {
|
|
159
|
-
deployer: {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
181
|
+
deployer: {
|
|
182
|
+
value: input.deployer ?? null,
|
|
183
|
+
isSigner: true,
|
|
184
|
+
isWritable: true,
|
|
185
|
+
},
|
|
186
|
+
adminConfig: {
|
|
187
|
+
value: input.adminConfig ?? null,
|
|
188
|
+
isSigner: false,
|
|
189
|
+
isWritable: true,
|
|
190
|
+
},
|
|
191
|
+
program: {
|
|
192
|
+
value: input.program ?? null,
|
|
193
|
+
isSigner: false,
|
|
194
|
+
isWritable: false,
|
|
195
|
+
},
|
|
196
|
+
programData: {
|
|
197
|
+
value: input.programData ?? null,
|
|
198
|
+
isSigner: false,
|
|
199
|
+
isWritable: false,
|
|
200
|
+
},
|
|
201
|
+
systemProgram: {
|
|
202
|
+
value: input.systemProgram ?? null,
|
|
203
|
+
isSigner: false,
|
|
204
|
+
isWritable: false,
|
|
205
|
+
},
|
|
164
206
|
};
|
|
165
207
|
const accounts = originalAccounts as Record<
|
|
166
208
|
keyof typeof originalAccounts,
|
|
@@ -180,7 +222,6 @@ export async function getCreateAdminConfigInstructionAsync<
|
|
|
180
222
|
"11111111111111111111111111111111" as Address<"11111111111111111111111111111111">;
|
|
181
223
|
}
|
|
182
224
|
|
|
183
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
184
225
|
return Object.freeze({
|
|
185
226
|
accounts: [
|
|
186
227
|
getAccountMeta("deployer", accounts.deployer),
|
|
@@ -193,34 +234,50 @@ export async function getCreateAdminConfigInstructionAsync<
|
|
|
193
234
|
programAddress,
|
|
194
235
|
} as CreateAdminConfigInstruction<
|
|
195
236
|
TProgramAddress,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
237
|
+
ResolvedInstructionAccountMeta<
|
|
238
|
+
TAccountDeployer,
|
|
239
|
+
InstructionAccountInputAddress<TAccountDeployer>
|
|
240
|
+
>,
|
|
241
|
+
ResolvedInstructionAccountMeta<
|
|
242
|
+
TAccountAdminConfig,
|
|
243
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
244
|
+
>,
|
|
245
|
+
ResolvedInstructionAccountMeta<
|
|
246
|
+
TAccountProgram,
|
|
247
|
+
InstructionAccountInputAddress<TAccountProgram>
|
|
248
|
+
>,
|
|
249
|
+
ResolvedInstructionAccountMeta<
|
|
250
|
+
TAccountProgramData,
|
|
251
|
+
InstructionAccountInputAddress<TAccountProgramData>
|
|
252
|
+
>,
|
|
253
|
+
ResolvedInstructionAccountMeta<
|
|
254
|
+
TAccountSystemProgram,
|
|
255
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
256
|
+
>
|
|
201
257
|
>);
|
|
202
258
|
}
|
|
203
259
|
|
|
204
260
|
export type CreateAdminConfigInput<
|
|
205
|
-
TAccountDeployer extends
|
|
206
|
-
TAccountAdminConfig extends
|
|
207
|
-
TAccountProgram extends
|
|
208
|
-
TAccountProgramData extends
|
|
209
|
-
TAccountSystemProgram extends
|
|
261
|
+
TAccountDeployer extends InstructionSignerInput = InstructionSignerInput,
|
|
262
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
263
|
+
TAccountProgram extends InstructionAccountInput = InstructionAccountInput,
|
|
264
|
+
TAccountProgramData extends InstructionAccountInput = InstructionAccountInput,
|
|
265
|
+
TAccountSystemProgram extends InstructionAccountInput =
|
|
266
|
+
InstructionAccountInput,
|
|
210
267
|
> = {
|
|
211
|
-
deployer:
|
|
212
|
-
adminConfig:
|
|
213
|
-
program?:
|
|
214
|
-
programData:
|
|
215
|
-
systemProgram?:
|
|
268
|
+
deployer: TAccountDeployer;
|
|
269
|
+
adminConfig: TAccountAdminConfig;
|
|
270
|
+
program?: TAccountProgram;
|
|
271
|
+
programData: TAccountProgramData;
|
|
272
|
+
systemProgram?: TAccountSystemProgram;
|
|
216
273
|
};
|
|
217
274
|
|
|
218
275
|
export function getCreateAdminConfigInstruction<
|
|
219
|
-
TAccountDeployer extends
|
|
220
|
-
TAccountAdminConfig extends
|
|
221
|
-
TAccountProgram extends
|
|
222
|
-
TAccountProgramData extends
|
|
223
|
-
TAccountSystemProgram extends
|
|
276
|
+
TAccountDeployer extends InstructionSignerInput,
|
|
277
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
278
|
+
TAccountProgram extends InstructionAccountInput,
|
|
279
|
+
TAccountProgramData extends InstructionAccountInput,
|
|
280
|
+
TAccountSystemProgram extends InstructionAccountInput,
|
|
224
281
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
225
282
|
>(
|
|
226
283
|
input: CreateAdminConfigInput<
|
|
@@ -233,22 +290,60 @@ export function getCreateAdminConfigInstruction<
|
|
|
233
290
|
config?: { programAddress?: TProgramAddress },
|
|
234
291
|
): CreateAdminConfigInstruction<
|
|
235
292
|
TProgramAddress,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
293
|
+
ResolvedInstructionAccountMeta<
|
|
294
|
+
TAccountDeployer,
|
|
295
|
+
InstructionAccountInputAddress<TAccountDeployer>
|
|
296
|
+
>,
|
|
297
|
+
ResolvedInstructionAccountMeta<
|
|
298
|
+
TAccountAdminConfig,
|
|
299
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
300
|
+
>,
|
|
301
|
+
ResolvedInstructionAccountMeta<
|
|
302
|
+
TAccountProgram,
|
|
303
|
+
InstructionAccountInputAddress<TAccountProgram>
|
|
304
|
+
>,
|
|
305
|
+
ResolvedInstructionAccountMeta<
|
|
306
|
+
TAccountProgramData,
|
|
307
|
+
InstructionAccountInputAddress<TAccountProgramData>
|
|
308
|
+
>,
|
|
309
|
+
ResolvedInstructionAccountMeta<
|
|
310
|
+
TAccountSystemProgram,
|
|
311
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
312
|
+
>
|
|
241
313
|
> {
|
|
242
314
|
// Program address.
|
|
243
315
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
244
316
|
|
|
317
|
+
// Account meta helper.
|
|
318
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
319
|
+
|
|
245
320
|
// Original accounts.
|
|
246
321
|
const originalAccounts = {
|
|
247
|
-
deployer: {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
322
|
+
deployer: {
|
|
323
|
+
value: input.deployer ?? null,
|
|
324
|
+
isSigner: true,
|
|
325
|
+
isWritable: true,
|
|
326
|
+
},
|
|
327
|
+
adminConfig: {
|
|
328
|
+
value: input.adminConfig ?? null,
|
|
329
|
+
isSigner: false,
|
|
330
|
+
isWritable: true,
|
|
331
|
+
},
|
|
332
|
+
program: {
|
|
333
|
+
value: input.program ?? null,
|
|
334
|
+
isSigner: false,
|
|
335
|
+
isWritable: false,
|
|
336
|
+
},
|
|
337
|
+
programData: {
|
|
338
|
+
value: input.programData ?? null,
|
|
339
|
+
isSigner: false,
|
|
340
|
+
isWritable: false,
|
|
341
|
+
},
|
|
342
|
+
systemProgram: {
|
|
343
|
+
value: input.systemProgram ?? null,
|
|
344
|
+
isSigner: false,
|
|
345
|
+
isWritable: false,
|
|
346
|
+
},
|
|
252
347
|
};
|
|
253
348
|
const accounts = originalAccounts as Record<
|
|
254
349
|
keyof typeof originalAccounts,
|
|
@@ -265,7 +360,6 @@ export function getCreateAdminConfigInstruction<
|
|
|
265
360
|
"11111111111111111111111111111111" as Address<"11111111111111111111111111111111">;
|
|
266
361
|
}
|
|
267
362
|
|
|
268
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
269
363
|
return Object.freeze({
|
|
270
364
|
accounts: [
|
|
271
365
|
getAccountMeta("deployer", accounts.deployer),
|
|
@@ -278,11 +372,26 @@ export function getCreateAdminConfigInstruction<
|
|
|
278
372
|
programAddress,
|
|
279
373
|
} as CreateAdminConfigInstruction<
|
|
280
374
|
TProgramAddress,
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
375
|
+
ResolvedInstructionAccountMeta<
|
|
376
|
+
TAccountDeployer,
|
|
377
|
+
InstructionAccountInputAddress<TAccountDeployer>
|
|
378
|
+
>,
|
|
379
|
+
ResolvedInstructionAccountMeta<
|
|
380
|
+
TAccountAdminConfig,
|
|
381
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
382
|
+
>,
|
|
383
|
+
ResolvedInstructionAccountMeta<
|
|
384
|
+
TAccountProgram,
|
|
385
|
+
InstructionAccountInputAddress<TAccountProgram>
|
|
386
|
+
>,
|
|
387
|
+
ResolvedInstructionAccountMeta<
|
|
388
|
+
TAccountProgramData,
|
|
389
|
+
InstructionAccountInputAddress<TAccountProgramData>
|
|
390
|
+
>,
|
|
391
|
+
ResolvedInstructionAccountMeta<
|
|
392
|
+
TAccountSystemProgram,
|
|
393
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
394
|
+
>
|
|
286
395
|
>);
|
|
287
396
|
}
|
|
288
397
|
|