@picon-finance/dlmm-sdk 2.0.2 → 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/entities/dlmm_program.d.ts +1 -1
- package/dist/entities/dlmm_program.d.ts.map +1 -1
- package/dist/entities/dlmm_program.js +2 -2
- package/dist/entities/pool.d.ts +1 -1
- package/dist/entities/pool.d.ts.map +1 -1
- 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 +8 -8
- package/src/entities/dlmm_program.ts +3 -3
- 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
|
@@ -33,12 +33,15 @@ import {
|
|
|
33
33
|
type ReadonlyAccount,
|
|
34
34
|
type ReadonlySignerAccount,
|
|
35
35
|
type ReadonlyUint8Array,
|
|
36
|
-
type TransactionSigner,
|
|
37
36
|
type WritableAccount,
|
|
38
37
|
} from "@solana/kit";
|
|
39
38
|
import {
|
|
40
39
|
getAccountMetaFactory,
|
|
40
|
+
type InstructionAccountInput,
|
|
41
|
+
type InstructionAccountInputAddress,
|
|
42
|
+
type InstructionSignerInput,
|
|
41
43
|
type ResolvedInstructionAccount,
|
|
44
|
+
type ResolvedInstructionAccountMeta,
|
|
42
45
|
} from "@solana/program-client-core";
|
|
43
46
|
import { findAdminConfigPda } from "../pdas/index.js";
|
|
44
47
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
@@ -157,44 +160,48 @@ export function getClaimProtocolFeeInstructionDataCodec(): Codec<
|
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
export type ClaimProtocolFeeAsyncInput<
|
|
160
|
-
TAccountAuthority extends
|
|
161
|
-
TAccountAdminConfig extends
|
|
162
|
-
TAccountPool extends
|
|
163
|
-
TAccountTokenMintX extends
|
|
164
|
-
TAccountTokenMintY extends
|
|
165
|
-
TAccountTokenVaultX extends
|
|
166
|
-
TAccountTokenVaultY extends
|
|
167
|
-
TAccountTokenAdminAccountX extends
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
164
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
165
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
166
|
+
TAccountTokenMintX extends InstructionAccountInput = InstructionAccountInput,
|
|
167
|
+
TAccountTokenMintY extends InstructionAccountInput = InstructionAccountInput,
|
|
168
|
+
TAccountTokenVaultX extends InstructionAccountInput = InstructionAccountInput,
|
|
169
|
+
TAccountTokenVaultY extends InstructionAccountInput = InstructionAccountInput,
|
|
170
|
+
TAccountTokenAdminAccountX extends InstructionAccountInput =
|
|
171
|
+
InstructionAccountInput,
|
|
172
|
+
TAccountTokenAdminAccountY extends InstructionAccountInput =
|
|
173
|
+
InstructionAccountInput,
|
|
174
|
+
TAccountTokenProgramX extends InstructionAccountInput =
|
|
175
|
+
InstructionAccountInput,
|
|
176
|
+
TAccountTokenProgramY extends InstructionAccountInput =
|
|
177
|
+
InstructionAccountInput,
|
|
171
178
|
> = {
|
|
172
|
-
authority:
|
|
173
|
-
adminConfig?:
|
|
174
|
-
pool:
|
|
175
|
-
tokenMintX:
|
|
176
|
-
tokenMintY:
|
|
177
|
-
tokenVaultX:
|
|
178
|
-
tokenVaultY:
|
|
179
|
-
tokenAdminAccountX:
|
|
180
|
-
tokenAdminAccountY:
|
|
181
|
-
tokenProgramX:
|
|
182
|
-
tokenProgramY:
|
|
179
|
+
authority: TAccountAuthority;
|
|
180
|
+
adminConfig?: TAccountAdminConfig;
|
|
181
|
+
pool: TAccountPool;
|
|
182
|
+
tokenMintX: TAccountTokenMintX;
|
|
183
|
+
tokenMintY: TAccountTokenMintY;
|
|
184
|
+
tokenVaultX: TAccountTokenVaultX;
|
|
185
|
+
tokenVaultY: TAccountTokenVaultY;
|
|
186
|
+
tokenAdminAccountX: TAccountTokenAdminAccountX;
|
|
187
|
+
tokenAdminAccountY: TAccountTokenAdminAccountY;
|
|
188
|
+
tokenProgramX: TAccountTokenProgramX;
|
|
189
|
+
tokenProgramY: TAccountTokenProgramY;
|
|
183
190
|
remainingAccountsScheme: ClaimProtocolFeeInstructionDataArgs["remainingAccountsScheme"];
|
|
184
191
|
};
|
|
185
192
|
|
|
186
193
|
export async function getClaimProtocolFeeInstructionAsync<
|
|
187
|
-
TAccountAuthority extends
|
|
188
|
-
TAccountAdminConfig extends
|
|
189
|
-
TAccountPool extends
|
|
190
|
-
TAccountTokenMintX extends
|
|
191
|
-
TAccountTokenMintY extends
|
|
192
|
-
TAccountTokenVaultX extends
|
|
193
|
-
TAccountTokenVaultY extends
|
|
194
|
-
TAccountTokenAdminAccountX extends
|
|
195
|
-
TAccountTokenAdminAccountY extends
|
|
196
|
-
TAccountTokenProgramX extends
|
|
197
|
-
TAccountTokenProgramY extends
|
|
194
|
+
TAccountAuthority extends InstructionSignerInput,
|
|
195
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
196
|
+
TAccountPool extends InstructionAccountInput,
|
|
197
|
+
TAccountTokenMintX extends InstructionAccountInput,
|
|
198
|
+
TAccountTokenMintY extends InstructionAccountInput,
|
|
199
|
+
TAccountTokenVaultX extends InstructionAccountInput,
|
|
200
|
+
TAccountTokenVaultY extends InstructionAccountInput,
|
|
201
|
+
TAccountTokenAdminAccountX extends InstructionAccountInput,
|
|
202
|
+
TAccountTokenAdminAccountY extends InstructionAccountInput,
|
|
203
|
+
TAccountTokenProgramX extends InstructionAccountInput,
|
|
204
|
+
TAccountTokenProgramY extends InstructionAccountInput,
|
|
198
205
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
199
206
|
>(
|
|
200
207
|
input: ClaimProtocolFeeAsyncInput<
|
|
@@ -214,41 +221,111 @@ export async function getClaimProtocolFeeInstructionAsync<
|
|
|
214
221
|
): Promise<
|
|
215
222
|
ClaimProtocolFeeInstruction<
|
|
216
223
|
TProgramAddress,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
ResolvedInstructionAccountMeta<
|
|
225
|
+
TAccountAuthority,
|
|
226
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
227
|
+
>,
|
|
228
|
+
ResolvedInstructionAccountMeta<
|
|
229
|
+
TAccountAdminConfig,
|
|
230
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
231
|
+
>,
|
|
232
|
+
ResolvedInstructionAccountMeta<
|
|
233
|
+
TAccountPool,
|
|
234
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
235
|
+
>,
|
|
236
|
+
ResolvedInstructionAccountMeta<
|
|
237
|
+
TAccountTokenMintX,
|
|
238
|
+
InstructionAccountInputAddress<TAccountTokenMintX>
|
|
239
|
+
>,
|
|
240
|
+
ResolvedInstructionAccountMeta<
|
|
241
|
+
TAccountTokenMintY,
|
|
242
|
+
InstructionAccountInputAddress<TAccountTokenMintY>
|
|
243
|
+
>,
|
|
244
|
+
ResolvedInstructionAccountMeta<
|
|
245
|
+
TAccountTokenVaultX,
|
|
246
|
+
InstructionAccountInputAddress<TAccountTokenVaultX>
|
|
247
|
+
>,
|
|
248
|
+
ResolvedInstructionAccountMeta<
|
|
249
|
+
TAccountTokenVaultY,
|
|
250
|
+
InstructionAccountInputAddress<TAccountTokenVaultY>
|
|
251
|
+
>,
|
|
252
|
+
ResolvedInstructionAccountMeta<
|
|
253
|
+
TAccountTokenAdminAccountX,
|
|
254
|
+
InstructionAccountInputAddress<TAccountTokenAdminAccountX>
|
|
255
|
+
>,
|
|
256
|
+
ResolvedInstructionAccountMeta<
|
|
257
|
+
TAccountTokenAdminAccountY,
|
|
258
|
+
InstructionAccountInputAddress<TAccountTokenAdminAccountY>
|
|
259
|
+
>,
|
|
260
|
+
ResolvedInstructionAccountMeta<
|
|
261
|
+
TAccountTokenProgramX,
|
|
262
|
+
InstructionAccountInputAddress<TAccountTokenProgramX>
|
|
263
|
+
>,
|
|
264
|
+
ResolvedInstructionAccountMeta<
|
|
265
|
+
TAccountTokenProgramY,
|
|
266
|
+
InstructionAccountInputAddress<TAccountTokenProgramY>
|
|
267
|
+
>
|
|
228
268
|
>
|
|
229
269
|
> {
|
|
230
270
|
// Program address.
|
|
231
271
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
232
272
|
|
|
273
|
+
// Account meta helper.
|
|
274
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
275
|
+
|
|
233
276
|
// Original accounts.
|
|
234
277
|
const originalAccounts = {
|
|
235
|
-
authority: {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
278
|
+
authority: {
|
|
279
|
+
value: input.authority ?? null,
|
|
280
|
+
isSigner: true,
|
|
281
|
+
isWritable: false,
|
|
282
|
+
},
|
|
283
|
+
adminConfig: {
|
|
284
|
+
value: input.adminConfig ?? null,
|
|
285
|
+
isSigner: false,
|
|
286
|
+
isWritable: false,
|
|
287
|
+
},
|
|
288
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: true },
|
|
289
|
+
tokenMintX: {
|
|
290
|
+
value: input.tokenMintX ?? null,
|
|
291
|
+
isSigner: false,
|
|
292
|
+
isWritable: false,
|
|
293
|
+
},
|
|
294
|
+
tokenMintY: {
|
|
295
|
+
value: input.tokenMintY ?? null,
|
|
296
|
+
isSigner: false,
|
|
297
|
+
isWritable: false,
|
|
298
|
+
},
|
|
299
|
+
tokenVaultX: {
|
|
300
|
+
value: input.tokenVaultX ?? null,
|
|
301
|
+
isSigner: false,
|
|
302
|
+
isWritable: true,
|
|
303
|
+
},
|
|
304
|
+
tokenVaultY: {
|
|
305
|
+
value: input.tokenVaultY ?? null,
|
|
306
|
+
isSigner: false,
|
|
307
|
+
isWritable: true,
|
|
308
|
+
},
|
|
242
309
|
tokenAdminAccountX: {
|
|
243
310
|
value: input.tokenAdminAccountX ?? null,
|
|
311
|
+
isSigner: false,
|
|
244
312
|
isWritable: true,
|
|
245
313
|
},
|
|
246
314
|
tokenAdminAccountY: {
|
|
247
315
|
value: input.tokenAdminAccountY ?? null,
|
|
316
|
+
isSigner: false,
|
|
248
317
|
isWritable: true,
|
|
249
318
|
},
|
|
250
|
-
tokenProgramX: {
|
|
251
|
-
|
|
319
|
+
tokenProgramX: {
|
|
320
|
+
value: input.tokenProgramX ?? null,
|
|
321
|
+
isSigner: false,
|
|
322
|
+
isWritable: false,
|
|
323
|
+
},
|
|
324
|
+
tokenProgramY: {
|
|
325
|
+
value: input.tokenProgramY ?? null,
|
|
326
|
+
isSigner: false,
|
|
327
|
+
isWritable: false,
|
|
328
|
+
},
|
|
252
329
|
};
|
|
253
330
|
const accounts = originalAccounts as Record<
|
|
254
331
|
keyof typeof originalAccounts,
|
|
@@ -263,7 +340,6 @@ export async function getClaimProtocolFeeInstructionAsync<
|
|
|
263
340
|
accounts.adminConfig.value = await findAdminConfigPda({ programAddress });
|
|
264
341
|
}
|
|
265
342
|
|
|
266
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
267
343
|
return Object.freeze({
|
|
268
344
|
accounts: [
|
|
269
345
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -284,59 +360,96 @@ export async function getClaimProtocolFeeInstructionAsync<
|
|
|
284
360
|
programAddress,
|
|
285
361
|
} as ClaimProtocolFeeInstruction<
|
|
286
362
|
TProgramAddress,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
363
|
+
ResolvedInstructionAccountMeta<
|
|
364
|
+
TAccountAuthority,
|
|
365
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
366
|
+
>,
|
|
367
|
+
ResolvedInstructionAccountMeta<
|
|
368
|
+
TAccountAdminConfig,
|
|
369
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
370
|
+
>,
|
|
371
|
+
ResolvedInstructionAccountMeta<
|
|
372
|
+
TAccountPool,
|
|
373
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
374
|
+
>,
|
|
375
|
+
ResolvedInstructionAccountMeta<
|
|
376
|
+
TAccountTokenMintX,
|
|
377
|
+
InstructionAccountInputAddress<TAccountTokenMintX>
|
|
378
|
+
>,
|
|
379
|
+
ResolvedInstructionAccountMeta<
|
|
380
|
+
TAccountTokenMintY,
|
|
381
|
+
InstructionAccountInputAddress<TAccountTokenMintY>
|
|
382
|
+
>,
|
|
383
|
+
ResolvedInstructionAccountMeta<
|
|
384
|
+
TAccountTokenVaultX,
|
|
385
|
+
InstructionAccountInputAddress<TAccountTokenVaultX>
|
|
386
|
+
>,
|
|
387
|
+
ResolvedInstructionAccountMeta<
|
|
388
|
+
TAccountTokenVaultY,
|
|
389
|
+
InstructionAccountInputAddress<TAccountTokenVaultY>
|
|
390
|
+
>,
|
|
391
|
+
ResolvedInstructionAccountMeta<
|
|
392
|
+
TAccountTokenAdminAccountX,
|
|
393
|
+
InstructionAccountInputAddress<TAccountTokenAdminAccountX>
|
|
394
|
+
>,
|
|
395
|
+
ResolvedInstructionAccountMeta<
|
|
396
|
+
TAccountTokenAdminAccountY,
|
|
397
|
+
InstructionAccountInputAddress<TAccountTokenAdminAccountY>
|
|
398
|
+
>,
|
|
399
|
+
ResolvedInstructionAccountMeta<
|
|
400
|
+
TAccountTokenProgramX,
|
|
401
|
+
InstructionAccountInputAddress<TAccountTokenProgramX>
|
|
402
|
+
>,
|
|
403
|
+
ResolvedInstructionAccountMeta<
|
|
404
|
+
TAccountTokenProgramY,
|
|
405
|
+
InstructionAccountInputAddress<TAccountTokenProgramY>
|
|
406
|
+
>
|
|
298
407
|
>);
|
|
299
408
|
}
|
|
300
409
|
|
|
301
410
|
export type ClaimProtocolFeeInput<
|
|
302
|
-
TAccountAuthority extends
|
|
303
|
-
TAccountAdminConfig extends
|
|
304
|
-
TAccountPool extends
|
|
305
|
-
TAccountTokenMintX extends
|
|
306
|
-
TAccountTokenMintY extends
|
|
307
|
-
TAccountTokenVaultX extends
|
|
308
|
-
TAccountTokenVaultY extends
|
|
309
|
-
TAccountTokenAdminAccountX extends
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
411
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
412
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
413
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
414
|
+
TAccountTokenMintX extends InstructionAccountInput = InstructionAccountInput,
|
|
415
|
+
TAccountTokenMintY extends InstructionAccountInput = InstructionAccountInput,
|
|
416
|
+
TAccountTokenVaultX extends InstructionAccountInput = InstructionAccountInput,
|
|
417
|
+
TAccountTokenVaultY extends InstructionAccountInput = InstructionAccountInput,
|
|
418
|
+
TAccountTokenAdminAccountX extends InstructionAccountInput =
|
|
419
|
+
InstructionAccountInput,
|
|
420
|
+
TAccountTokenAdminAccountY extends InstructionAccountInput =
|
|
421
|
+
InstructionAccountInput,
|
|
422
|
+
TAccountTokenProgramX extends InstructionAccountInput =
|
|
423
|
+
InstructionAccountInput,
|
|
424
|
+
TAccountTokenProgramY extends InstructionAccountInput =
|
|
425
|
+
InstructionAccountInput,
|
|
313
426
|
> = {
|
|
314
|
-
authority:
|
|
315
|
-
adminConfig:
|
|
316
|
-
pool:
|
|
317
|
-
tokenMintX:
|
|
318
|
-
tokenMintY:
|
|
319
|
-
tokenVaultX:
|
|
320
|
-
tokenVaultY:
|
|
321
|
-
tokenAdminAccountX:
|
|
322
|
-
tokenAdminAccountY:
|
|
323
|
-
tokenProgramX:
|
|
324
|
-
tokenProgramY:
|
|
427
|
+
authority: TAccountAuthority;
|
|
428
|
+
adminConfig: TAccountAdminConfig;
|
|
429
|
+
pool: TAccountPool;
|
|
430
|
+
tokenMintX: TAccountTokenMintX;
|
|
431
|
+
tokenMintY: TAccountTokenMintY;
|
|
432
|
+
tokenVaultX: TAccountTokenVaultX;
|
|
433
|
+
tokenVaultY: TAccountTokenVaultY;
|
|
434
|
+
tokenAdminAccountX: TAccountTokenAdminAccountX;
|
|
435
|
+
tokenAdminAccountY: TAccountTokenAdminAccountY;
|
|
436
|
+
tokenProgramX: TAccountTokenProgramX;
|
|
437
|
+
tokenProgramY: TAccountTokenProgramY;
|
|
325
438
|
remainingAccountsScheme: ClaimProtocolFeeInstructionDataArgs["remainingAccountsScheme"];
|
|
326
439
|
};
|
|
327
440
|
|
|
328
441
|
export function getClaimProtocolFeeInstruction<
|
|
329
|
-
TAccountAuthority extends
|
|
330
|
-
TAccountAdminConfig extends
|
|
331
|
-
TAccountPool extends
|
|
332
|
-
TAccountTokenMintX extends
|
|
333
|
-
TAccountTokenMintY extends
|
|
334
|
-
TAccountTokenVaultX extends
|
|
335
|
-
TAccountTokenVaultY extends
|
|
336
|
-
TAccountTokenAdminAccountX extends
|
|
337
|
-
TAccountTokenAdminAccountY extends
|
|
338
|
-
TAccountTokenProgramX extends
|
|
339
|
-
TAccountTokenProgramY extends
|
|
442
|
+
TAccountAuthority extends InstructionSignerInput,
|
|
443
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
444
|
+
TAccountPool extends InstructionAccountInput,
|
|
445
|
+
TAccountTokenMintX extends InstructionAccountInput,
|
|
446
|
+
TAccountTokenMintY extends InstructionAccountInput,
|
|
447
|
+
TAccountTokenVaultX extends InstructionAccountInput,
|
|
448
|
+
TAccountTokenVaultY extends InstructionAccountInput,
|
|
449
|
+
TAccountTokenAdminAccountX extends InstructionAccountInput,
|
|
450
|
+
TAccountTokenAdminAccountY extends InstructionAccountInput,
|
|
451
|
+
TAccountTokenProgramX extends InstructionAccountInput,
|
|
452
|
+
TAccountTokenProgramY extends InstructionAccountInput,
|
|
340
453
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
341
454
|
>(
|
|
342
455
|
input: ClaimProtocolFeeInput<
|
|
@@ -355,40 +468,110 @@ export function getClaimProtocolFeeInstruction<
|
|
|
355
468
|
config?: { programAddress?: TProgramAddress },
|
|
356
469
|
): ClaimProtocolFeeInstruction<
|
|
357
470
|
TProgramAddress,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
471
|
+
ResolvedInstructionAccountMeta<
|
|
472
|
+
TAccountAuthority,
|
|
473
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
474
|
+
>,
|
|
475
|
+
ResolvedInstructionAccountMeta<
|
|
476
|
+
TAccountAdminConfig,
|
|
477
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
478
|
+
>,
|
|
479
|
+
ResolvedInstructionAccountMeta<
|
|
480
|
+
TAccountPool,
|
|
481
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
482
|
+
>,
|
|
483
|
+
ResolvedInstructionAccountMeta<
|
|
484
|
+
TAccountTokenMintX,
|
|
485
|
+
InstructionAccountInputAddress<TAccountTokenMintX>
|
|
486
|
+
>,
|
|
487
|
+
ResolvedInstructionAccountMeta<
|
|
488
|
+
TAccountTokenMintY,
|
|
489
|
+
InstructionAccountInputAddress<TAccountTokenMintY>
|
|
490
|
+
>,
|
|
491
|
+
ResolvedInstructionAccountMeta<
|
|
492
|
+
TAccountTokenVaultX,
|
|
493
|
+
InstructionAccountInputAddress<TAccountTokenVaultX>
|
|
494
|
+
>,
|
|
495
|
+
ResolvedInstructionAccountMeta<
|
|
496
|
+
TAccountTokenVaultY,
|
|
497
|
+
InstructionAccountInputAddress<TAccountTokenVaultY>
|
|
498
|
+
>,
|
|
499
|
+
ResolvedInstructionAccountMeta<
|
|
500
|
+
TAccountTokenAdminAccountX,
|
|
501
|
+
InstructionAccountInputAddress<TAccountTokenAdminAccountX>
|
|
502
|
+
>,
|
|
503
|
+
ResolvedInstructionAccountMeta<
|
|
504
|
+
TAccountTokenAdminAccountY,
|
|
505
|
+
InstructionAccountInputAddress<TAccountTokenAdminAccountY>
|
|
506
|
+
>,
|
|
507
|
+
ResolvedInstructionAccountMeta<
|
|
508
|
+
TAccountTokenProgramX,
|
|
509
|
+
InstructionAccountInputAddress<TAccountTokenProgramX>
|
|
510
|
+
>,
|
|
511
|
+
ResolvedInstructionAccountMeta<
|
|
512
|
+
TAccountTokenProgramY,
|
|
513
|
+
InstructionAccountInputAddress<TAccountTokenProgramY>
|
|
514
|
+
>
|
|
369
515
|
> {
|
|
370
516
|
// Program address.
|
|
371
517
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
372
518
|
|
|
519
|
+
// Account meta helper.
|
|
520
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
521
|
+
|
|
373
522
|
// Original accounts.
|
|
374
523
|
const originalAccounts = {
|
|
375
|
-
authority: {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
524
|
+
authority: {
|
|
525
|
+
value: input.authority ?? null,
|
|
526
|
+
isSigner: true,
|
|
527
|
+
isWritable: false,
|
|
528
|
+
},
|
|
529
|
+
adminConfig: {
|
|
530
|
+
value: input.adminConfig ?? null,
|
|
531
|
+
isSigner: false,
|
|
532
|
+
isWritable: false,
|
|
533
|
+
},
|
|
534
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: true },
|
|
535
|
+
tokenMintX: {
|
|
536
|
+
value: input.tokenMintX ?? null,
|
|
537
|
+
isSigner: false,
|
|
538
|
+
isWritable: false,
|
|
539
|
+
},
|
|
540
|
+
tokenMintY: {
|
|
541
|
+
value: input.tokenMintY ?? null,
|
|
542
|
+
isSigner: false,
|
|
543
|
+
isWritable: false,
|
|
544
|
+
},
|
|
545
|
+
tokenVaultX: {
|
|
546
|
+
value: input.tokenVaultX ?? null,
|
|
547
|
+
isSigner: false,
|
|
548
|
+
isWritable: true,
|
|
549
|
+
},
|
|
550
|
+
tokenVaultY: {
|
|
551
|
+
value: input.tokenVaultY ?? null,
|
|
552
|
+
isSigner: false,
|
|
553
|
+
isWritable: true,
|
|
554
|
+
},
|
|
382
555
|
tokenAdminAccountX: {
|
|
383
556
|
value: input.tokenAdminAccountX ?? null,
|
|
557
|
+
isSigner: false,
|
|
384
558
|
isWritable: true,
|
|
385
559
|
},
|
|
386
560
|
tokenAdminAccountY: {
|
|
387
561
|
value: input.tokenAdminAccountY ?? null,
|
|
562
|
+
isSigner: false,
|
|
388
563
|
isWritable: true,
|
|
389
564
|
},
|
|
390
|
-
tokenProgramX: {
|
|
391
|
-
|
|
565
|
+
tokenProgramX: {
|
|
566
|
+
value: input.tokenProgramX ?? null,
|
|
567
|
+
isSigner: false,
|
|
568
|
+
isWritable: false,
|
|
569
|
+
},
|
|
570
|
+
tokenProgramY: {
|
|
571
|
+
value: input.tokenProgramY ?? null,
|
|
572
|
+
isSigner: false,
|
|
573
|
+
isWritable: false,
|
|
574
|
+
},
|
|
392
575
|
};
|
|
393
576
|
const accounts = originalAccounts as Record<
|
|
394
577
|
keyof typeof originalAccounts,
|
|
@@ -398,7 +581,6 @@ export function getClaimProtocolFeeInstruction<
|
|
|
398
581
|
// Original args.
|
|
399
582
|
const args = { ...input };
|
|
400
583
|
|
|
401
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
402
584
|
return Object.freeze({
|
|
403
585
|
accounts: [
|
|
404
586
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -419,17 +601,50 @@ export function getClaimProtocolFeeInstruction<
|
|
|
419
601
|
programAddress,
|
|
420
602
|
} as ClaimProtocolFeeInstruction<
|
|
421
603
|
TProgramAddress,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
604
|
+
ResolvedInstructionAccountMeta<
|
|
605
|
+
TAccountAuthority,
|
|
606
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
607
|
+
>,
|
|
608
|
+
ResolvedInstructionAccountMeta<
|
|
609
|
+
TAccountAdminConfig,
|
|
610
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
611
|
+
>,
|
|
612
|
+
ResolvedInstructionAccountMeta<
|
|
613
|
+
TAccountPool,
|
|
614
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
615
|
+
>,
|
|
616
|
+
ResolvedInstructionAccountMeta<
|
|
617
|
+
TAccountTokenMintX,
|
|
618
|
+
InstructionAccountInputAddress<TAccountTokenMintX>
|
|
619
|
+
>,
|
|
620
|
+
ResolvedInstructionAccountMeta<
|
|
621
|
+
TAccountTokenMintY,
|
|
622
|
+
InstructionAccountInputAddress<TAccountTokenMintY>
|
|
623
|
+
>,
|
|
624
|
+
ResolvedInstructionAccountMeta<
|
|
625
|
+
TAccountTokenVaultX,
|
|
626
|
+
InstructionAccountInputAddress<TAccountTokenVaultX>
|
|
627
|
+
>,
|
|
628
|
+
ResolvedInstructionAccountMeta<
|
|
629
|
+
TAccountTokenVaultY,
|
|
630
|
+
InstructionAccountInputAddress<TAccountTokenVaultY>
|
|
631
|
+
>,
|
|
632
|
+
ResolvedInstructionAccountMeta<
|
|
633
|
+
TAccountTokenAdminAccountX,
|
|
634
|
+
InstructionAccountInputAddress<TAccountTokenAdminAccountX>
|
|
635
|
+
>,
|
|
636
|
+
ResolvedInstructionAccountMeta<
|
|
637
|
+
TAccountTokenAdminAccountY,
|
|
638
|
+
InstructionAccountInputAddress<TAccountTokenAdminAccountY>
|
|
639
|
+
>,
|
|
640
|
+
ResolvedInstructionAccountMeta<
|
|
641
|
+
TAccountTokenProgramX,
|
|
642
|
+
InstructionAccountInputAddress<TAccountTokenProgramX>
|
|
643
|
+
>,
|
|
644
|
+
ResolvedInstructionAccountMeta<
|
|
645
|
+
TAccountTokenProgramY,
|
|
646
|
+
InstructionAccountInputAddress<TAccountTokenProgramY>
|
|
647
|
+
>
|
|
433
648
|
>);
|
|
434
649
|
}
|
|
435
650
|
|