@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,13 +33,16 @@ 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,
|
|
41
40
|
getNonNullResolvedInstructionInput,
|
|
41
|
+
type InstructionAccountInput,
|
|
42
|
+
type InstructionAccountInputAddress,
|
|
43
|
+
type InstructionSignerInput,
|
|
42
44
|
type ResolvedInstructionAccount,
|
|
45
|
+
type ResolvedInstructionAccountMeta,
|
|
43
46
|
} from "@solana/program-client-core";
|
|
44
47
|
import { findAdminConfigPda, findBinArrayPda } from "../pdas/index.js";
|
|
45
48
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
@@ -127,27 +130,28 @@ export function getDeleteBinArrayInstructionDataCodec(): FixedSizeCodec<
|
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
export type DeleteBinArrayAsyncInput<
|
|
130
|
-
TAccountAuthority extends
|
|
131
|
-
TAccountAdminConfig extends
|
|
132
|
-
TAccountReceiver extends
|
|
133
|
-
TAccountBinArray extends
|
|
134
|
-
TAccountSystemProgram extends
|
|
133
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
134
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
135
|
+
TAccountReceiver extends InstructionAccountInput = InstructionAccountInput,
|
|
136
|
+
TAccountBinArray extends InstructionAccountInput = InstructionAccountInput,
|
|
137
|
+
TAccountSystemProgram extends InstructionAccountInput =
|
|
138
|
+
InstructionAccountInput,
|
|
135
139
|
> = {
|
|
136
|
-
authority:
|
|
137
|
-
adminConfig?:
|
|
138
|
-
receiver:
|
|
139
|
-
binArray?:
|
|
140
|
-
systemProgram?:
|
|
140
|
+
authority: TAccountAuthority;
|
|
141
|
+
adminConfig?: TAccountAdminConfig;
|
|
142
|
+
receiver: TAccountReceiver;
|
|
143
|
+
binArray?: TAccountBinArray;
|
|
144
|
+
systemProgram?: TAccountSystemProgram;
|
|
141
145
|
pool: DeleteBinArrayInstructionDataArgs["pool"];
|
|
142
146
|
index: DeleteBinArrayInstructionDataArgs["index"];
|
|
143
147
|
};
|
|
144
148
|
|
|
145
149
|
export async function getDeleteBinArrayInstructionAsync<
|
|
146
|
-
TAccountAuthority extends
|
|
147
|
-
TAccountAdminConfig extends
|
|
148
|
-
TAccountReceiver extends
|
|
149
|
-
TAccountBinArray extends
|
|
150
|
-
TAccountSystemProgram extends
|
|
150
|
+
TAccountAuthority extends InstructionSignerInput,
|
|
151
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
152
|
+
TAccountReceiver extends InstructionAccountInput,
|
|
153
|
+
TAccountBinArray extends InstructionAccountInput,
|
|
154
|
+
TAccountSystemProgram extends InstructionAccountInput,
|
|
151
155
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
152
156
|
>(
|
|
153
157
|
input: DeleteBinArrayAsyncInput<
|
|
@@ -161,23 +165,61 @@ export async function getDeleteBinArrayInstructionAsync<
|
|
|
161
165
|
): Promise<
|
|
162
166
|
DeleteBinArrayInstruction<
|
|
163
167
|
TProgramAddress,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
ResolvedInstructionAccountMeta<
|
|
169
|
+
TAccountAuthority,
|
|
170
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
171
|
+
>,
|
|
172
|
+
ResolvedInstructionAccountMeta<
|
|
173
|
+
TAccountAdminConfig,
|
|
174
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
175
|
+
>,
|
|
176
|
+
ResolvedInstructionAccountMeta<
|
|
177
|
+
TAccountReceiver,
|
|
178
|
+
InstructionAccountInputAddress<TAccountReceiver>
|
|
179
|
+
>,
|
|
180
|
+
ResolvedInstructionAccountMeta<
|
|
181
|
+
TAccountBinArray,
|
|
182
|
+
InstructionAccountInputAddress<TAccountBinArray>
|
|
183
|
+
>,
|
|
184
|
+
ResolvedInstructionAccountMeta<
|
|
185
|
+
TAccountSystemProgram,
|
|
186
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
187
|
+
>
|
|
169
188
|
>
|
|
170
189
|
> {
|
|
171
190
|
// Program address.
|
|
172
191
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
173
192
|
|
|
193
|
+
// Account meta helper.
|
|
194
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
195
|
+
|
|
174
196
|
// Original accounts.
|
|
175
197
|
const originalAccounts = {
|
|
176
|
-
authority: {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
198
|
+
authority: {
|
|
199
|
+
value: input.authority ?? null,
|
|
200
|
+
isSigner: true,
|
|
201
|
+
isWritable: false,
|
|
202
|
+
},
|
|
203
|
+
adminConfig: {
|
|
204
|
+
value: input.adminConfig ?? null,
|
|
205
|
+
isSigner: false,
|
|
206
|
+
isWritable: false,
|
|
207
|
+
},
|
|
208
|
+
receiver: {
|
|
209
|
+
value: input.receiver ?? null,
|
|
210
|
+
isSigner: false,
|
|
211
|
+
isWritable: true,
|
|
212
|
+
},
|
|
213
|
+
binArray: {
|
|
214
|
+
value: input.binArray ?? null,
|
|
215
|
+
isSigner: false,
|
|
216
|
+
isWritable: true,
|
|
217
|
+
},
|
|
218
|
+
systemProgram: {
|
|
219
|
+
value: input.systemProgram ?? null,
|
|
220
|
+
isSigner: false,
|
|
221
|
+
isWritable: false,
|
|
222
|
+
},
|
|
181
223
|
};
|
|
182
224
|
const accounts = originalAccounts as Record<
|
|
183
225
|
keyof typeof originalAccounts,
|
|
@@ -205,7 +247,6 @@ export async function getDeleteBinArrayInstructionAsync<
|
|
|
205
247
|
"11111111111111111111111111111111" as Address<"11111111111111111111111111111111">;
|
|
206
248
|
}
|
|
207
249
|
|
|
208
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
209
250
|
return Object.freeze({
|
|
210
251
|
accounts: [
|
|
211
252
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -220,36 +261,52 @@ export async function getDeleteBinArrayInstructionAsync<
|
|
|
220
261
|
programAddress,
|
|
221
262
|
} as DeleteBinArrayInstruction<
|
|
222
263
|
TProgramAddress,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
264
|
+
ResolvedInstructionAccountMeta<
|
|
265
|
+
TAccountAuthority,
|
|
266
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
267
|
+
>,
|
|
268
|
+
ResolvedInstructionAccountMeta<
|
|
269
|
+
TAccountAdminConfig,
|
|
270
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
271
|
+
>,
|
|
272
|
+
ResolvedInstructionAccountMeta<
|
|
273
|
+
TAccountReceiver,
|
|
274
|
+
InstructionAccountInputAddress<TAccountReceiver>
|
|
275
|
+
>,
|
|
276
|
+
ResolvedInstructionAccountMeta<
|
|
277
|
+
TAccountBinArray,
|
|
278
|
+
InstructionAccountInputAddress<TAccountBinArray>
|
|
279
|
+
>,
|
|
280
|
+
ResolvedInstructionAccountMeta<
|
|
281
|
+
TAccountSystemProgram,
|
|
282
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
283
|
+
>
|
|
228
284
|
>);
|
|
229
285
|
}
|
|
230
286
|
|
|
231
287
|
export type DeleteBinArrayInput<
|
|
232
|
-
TAccountAuthority extends
|
|
233
|
-
TAccountAdminConfig extends
|
|
234
|
-
TAccountReceiver extends
|
|
235
|
-
TAccountBinArray extends
|
|
236
|
-
TAccountSystemProgram extends
|
|
288
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
289
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
290
|
+
TAccountReceiver extends InstructionAccountInput = InstructionAccountInput,
|
|
291
|
+
TAccountBinArray extends InstructionAccountInput = InstructionAccountInput,
|
|
292
|
+
TAccountSystemProgram extends InstructionAccountInput =
|
|
293
|
+
InstructionAccountInput,
|
|
237
294
|
> = {
|
|
238
|
-
authority:
|
|
239
|
-
adminConfig:
|
|
240
|
-
receiver:
|
|
241
|
-
binArray:
|
|
242
|
-
systemProgram?:
|
|
295
|
+
authority: TAccountAuthority;
|
|
296
|
+
adminConfig: TAccountAdminConfig;
|
|
297
|
+
receiver: TAccountReceiver;
|
|
298
|
+
binArray: TAccountBinArray;
|
|
299
|
+
systemProgram?: TAccountSystemProgram;
|
|
243
300
|
pool: DeleteBinArrayInstructionDataArgs["pool"];
|
|
244
301
|
index: DeleteBinArrayInstructionDataArgs["index"];
|
|
245
302
|
};
|
|
246
303
|
|
|
247
304
|
export function getDeleteBinArrayInstruction<
|
|
248
|
-
TAccountAuthority extends
|
|
249
|
-
TAccountAdminConfig extends
|
|
250
|
-
TAccountReceiver extends
|
|
251
|
-
TAccountBinArray extends
|
|
252
|
-
TAccountSystemProgram extends
|
|
305
|
+
TAccountAuthority extends InstructionSignerInput,
|
|
306
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
307
|
+
TAccountReceiver extends InstructionAccountInput,
|
|
308
|
+
TAccountBinArray extends InstructionAccountInput,
|
|
309
|
+
TAccountSystemProgram extends InstructionAccountInput,
|
|
253
310
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
254
311
|
>(
|
|
255
312
|
input: DeleteBinArrayInput<
|
|
@@ -262,22 +319,60 @@ export function getDeleteBinArrayInstruction<
|
|
|
262
319
|
config?: { programAddress?: TProgramAddress },
|
|
263
320
|
): DeleteBinArrayInstruction<
|
|
264
321
|
TProgramAddress,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
322
|
+
ResolvedInstructionAccountMeta<
|
|
323
|
+
TAccountAuthority,
|
|
324
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
325
|
+
>,
|
|
326
|
+
ResolvedInstructionAccountMeta<
|
|
327
|
+
TAccountAdminConfig,
|
|
328
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
329
|
+
>,
|
|
330
|
+
ResolvedInstructionAccountMeta<
|
|
331
|
+
TAccountReceiver,
|
|
332
|
+
InstructionAccountInputAddress<TAccountReceiver>
|
|
333
|
+
>,
|
|
334
|
+
ResolvedInstructionAccountMeta<
|
|
335
|
+
TAccountBinArray,
|
|
336
|
+
InstructionAccountInputAddress<TAccountBinArray>
|
|
337
|
+
>,
|
|
338
|
+
ResolvedInstructionAccountMeta<
|
|
339
|
+
TAccountSystemProgram,
|
|
340
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
341
|
+
>
|
|
270
342
|
> {
|
|
271
343
|
// Program address.
|
|
272
344
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
273
345
|
|
|
346
|
+
// Account meta helper.
|
|
347
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
348
|
+
|
|
274
349
|
// Original accounts.
|
|
275
350
|
const originalAccounts = {
|
|
276
|
-
authority: {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
351
|
+
authority: {
|
|
352
|
+
value: input.authority ?? null,
|
|
353
|
+
isSigner: true,
|
|
354
|
+
isWritable: false,
|
|
355
|
+
},
|
|
356
|
+
adminConfig: {
|
|
357
|
+
value: input.adminConfig ?? null,
|
|
358
|
+
isSigner: false,
|
|
359
|
+
isWritable: false,
|
|
360
|
+
},
|
|
361
|
+
receiver: {
|
|
362
|
+
value: input.receiver ?? null,
|
|
363
|
+
isSigner: false,
|
|
364
|
+
isWritable: true,
|
|
365
|
+
},
|
|
366
|
+
binArray: {
|
|
367
|
+
value: input.binArray ?? null,
|
|
368
|
+
isSigner: false,
|
|
369
|
+
isWritable: true,
|
|
370
|
+
},
|
|
371
|
+
systemProgram: {
|
|
372
|
+
value: input.systemProgram ?? null,
|
|
373
|
+
isSigner: false,
|
|
374
|
+
isWritable: false,
|
|
375
|
+
},
|
|
281
376
|
};
|
|
282
377
|
const accounts = originalAccounts as Record<
|
|
283
378
|
keyof typeof originalAccounts,
|
|
@@ -293,7 +388,6 @@ export function getDeleteBinArrayInstruction<
|
|
|
293
388
|
"11111111111111111111111111111111" as Address<"11111111111111111111111111111111">;
|
|
294
389
|
}
|
|
295
390
|
|
|
296
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
297
391
|
return Object.freeze({
|
|
298
392
|
accounts: [
|
|
299
393
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -308,11 +402,26 @@ export function getDeleteBinArrayInstruction<
|
|
|
308
402
|
programAddress,
|
|
309
403
|
} as DeleteBinArrayInstruction<
|
|
310
404
|
TProgramAddress,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
405
|
+
ResolvedInstructionAccountMeta<
|
|
406
|
+
TAccountAuthority,
|
|
407
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
408
|
+
>,
|
|
409
|
+
ResolvedInstructionAccountMeta<
|
|
410
|
+
TAccountAdminConfig,
|
|
411
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
412
|
+
>,
|
|
413
|
+
ResolvedInstructionAccountMeta<
|
|
414
|
+
TAccountReceiver,
|
|
415
|
+
InstructionAccountInputAddress<TAccountReceiver>
|
|
416
|
+
>,
|
|
417
|
+
ResolvedInstructionAccountMeta<
|
|
418
|
+
TAccountBinArray,
|
|
419
|
+
InstructionAccountInputAddress<TAccountBinArray>
|
|
420
|
+
>,
|
|
421
|
+
ResolvedInstructionAccountMeta<
|
|
422
|
+
TAccountSystemProgram,
|
|
423
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
424
|
+
>
|
|
316
425
|
>);
|
|
317
426
|
}
|
|
318
427
|
|