@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
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
type InstructionWithData,
|
|
33
33
|
type ReadonlyAccount,
|
|
34
34
|
type ReadonlyUint8Array,
|
|
35
|
-
type TransactionSigner,
|
|
36
35
|
type WritableAccount,
|
|
37
36
|
type WritableSignerAccount,
|
|
38
37
|
} from "@solana/kit";
|
|
@@ -40,7 +39,11 @@ import {
|
|
|
40
39
|
getAccountMetaFactory,
|
|
41
40
|
getAddressFromResolvedInstructionAccount,
|
|
42
41
|
getNonNullResolvedInstructionInput,
|
|
42
|
+
type InstructionAccountInput,
|
|
43
|
+
type InstructionAccountInputAddress,
|
|
44
|
+
type InstructionSignerInput,
|
|
43
45
|
type ResolvedInstructionAccount,
|
|
46
|
+
type ResolvedInstructionAccountMeta,
|
|
44
47
|
} from "@solana/program-client-core";
|
|
45
48
|
import { findBinArrayPda } from "../pdas/index.js";
|
|
46
49
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
@@ -124,24 +127,25 @@ export function getCreateBinArrayInstructionDataCodec(): FixedSizeCodec<
|
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
export type CreateBinArrayAsyncInput<
|
|
127
|
-
TAccountPayer extends
|
|
128
|
-
TAccountPool extends
|
|
129
|
-
TAccountBinArray extends
|
|
130
|
-
TAccountSystemProgram extends
|
|
130
|
+
TAccountPayer extends InstructionSignerInput = InstructionSignerInput,
|
|
131
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
132
|
+
TAccountBinArray extends InstructionAccountInput = InstructionAccountInput,
|
|
133
|
+
TAccountSystemProgram extends InstructionAccountInput =
|
|
134
|
+
InstructionAccountInput,
|
|
131
135
|
> = {
|
|
132
|
-
payer:
|
|
133
|
-
pool:
|
|
134
|
-
binArray?:
|
|
135
|
-
systemProgram?:
|
|
136
|
+
payer: TAccountPayer;
|
|
137
|
+
pool: TAccountPool;
|
|
138
|
+
binArray?: TAccountBinArray;
|
|
139
|
+
systemProgram?: TAccountSystemProgram;
|
|
136
140
|
index: CreateBinArrayInstructionDataArgs["index"];
|
|
137
141
|
idempotent: CreateBinArrayInstructionDataArgs["idempotent"];
|
|
138
142
|
};
|
|
139
143
|
|
|
140
144
|
export async function getCreateBinArrayInstructionAsync<
|
|
141
|
-
TAccountPayer extends
|
|
142
|
-
TAccountPool extends
|
|
143
|
-
TAccountBinArray extends
|
|
144
|
-
TAccountSystemProgram extends
|
|
145
|
+
TAccountPayer extends InstructionSignerInput,
|
|
146
|
+
TAccountPool extends InstructionAccountInput,
|
|
147
|
+
TAccountBinArray extends InstructionAccountInput,
|
|
148
|
+
TAccountSystemProgram extends InstructionAccountInput,
|
|
145
149
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
146
150
|
>(
|
|
147
151
|
input: CreateBinArrayAsyncInput<
|
|
@@ -154,21 +158,44 @@ export async function getCreateBinArrayInstructionAsync<
|
|
|
154
158
|
): Promise<
|
|
155
159
|
CreateBinArrayInstruction<
|
|
156
160
|
TProgramAddress,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
ResolvedInstructionAccountMeta<
|
|
162
|
+
TAccountPayer,
|
|
163
|
+
InstructionAccountInputAddress<TAccountPayer>
|
|
164
|
+
>,
|
|
165
|
+
ResolvedInstructionAccountMeta<
|
|
166
|
+
TAccountPool,
|
|
167
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
168
|
+
>,
|
|
169
|
+
ResolvedInstructionAccountMeta<
|
|
170
|
+
TAccountBinArray,
|
|
171
|
+
InstructionAccountInputAddress<TAccountBinArray>
|
|
172
|
+
>,
|
|
173
|
+
ResolvedInstructionAccountMeta<
|
|
174
|
+
TAccountSystemProgram,
|
|
175
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
176
|
+
>
|
|
161
177
|
>
|
|
162
178
|
> {
|
|
163
179
|
// Program address.
|
|
164
180
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
165
181
|
|
|
182
|
+
// Account meta helper.
|
|
183
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
184
|
+
|
|
166
185
|
// Original accounts.
|
|
167
186
|
const originalAccounts = {
|
|
168
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
169
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
170
|
-
binArray: {
|
|
171
|
-
|
|
187
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
188
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: false },
|
|
189
|
+
binArray: {
|
|
190
|
+
value: input.binArray ?? null,
|
|
191
|
+
isSigner: false,
|
|
192
|
+
isWritable: true,
|
|
193
|
+
},
|
|
194
|
+
systemProgram: {
|
|
195
|
+
value: input.systemProgram ?? null,
|
|
196
|
+
isSigner: false,
|
|
197
|
+
isWritable: false,
|
|
198
|
+
},
|
|
172
199
|
};
|
|
173
200
|
const accounts = originalAccounts as Record<
|
|
174
201
|
keyof typeof originalAccounts,
|
|
@@ -196,7 +223,6 @@ export async function getCreateBinArrayInstructionAsync<
|
|
|
196
223
|
"11111111111111111111111111111111" as Address<"11111111111111111111111111111111">;
|
|
197
224
|
}
|
|
198
225
|
|
|
199
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
200
226
|
return Object.freeze({
|
|
201
227
|
accounts: [
|
|
202
228
|
getAccountMeta("payer", accounts.payer),
|
|
@@ -210,32 +236,45 @@ export async function getCreateBinArrayInstructionAsync<
|
|
|
210
236
|
programAddress,
|
|
211
237
|
} as CreateBinArrayInstruction<
|
|
212
238
|
TProgramAddress,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
239
|
+
ResolvedInstructionAccountMeta<
|
|
240
|
+
TAccountPayer,
|
|
241
|
+
InstructionAccountInputAddress<TAccountPayer>
|
|
242
|
+
>,
|
|
243
|
+
ResolvedInstructionAccountMeta<
|
|
244
|
+
TAccountPool,
|
|
245
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
246
|
+
>,
|
|
247
|
+
ResolvedInstructionAccountMeta<
|
|
248
|
+
TAccountBinArray,
|
|
249
|
+
InstructionAccountInputAddress<TAccountBinArray>
|
|
250
|
+
>,
|
|
251
|
+
ResolvedInstructionAccountMeta<
|
|
252
|
+
TAccountSystemProgram,
|
|
253
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
254
|
+
>
|
|
217
255
|
>);
|
|
218
256
|
}
|
|
219
257
|
|
|
220
258
|
export type CreateBinArrayInput<
|
|
221
|
-
TAccountPayer extends
|
|
222
|
-
TAccountPool extends
|
|
223
|
-
TAccountBinArray extends
|
|
224
|
-
TAccountSystemProgram extends
|
|
259
|
+
TAccountPayer extends InstructionSignerInput = InstructionSignerInput,
|
|
260
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
261
|
+
TAccountBinArray extends InstructionAccountInput = InstructionAccountInput,
|
|
262
|
+
TAccountSystemProgram extends InstructionAccountInput =
|
|
263
|
+
InstructionAccountInput,
|
|
225
264
|
> = {
|
|
226
|
-
payer:
|
|
227
|
-
pool:
|
|
228
|
-
binArray:
|
|
229
|
-
systemProgram?:
|
|
265
|
+
payer: TAccountPayer;
|
|
266
|
+
pool: TAccountPool;
|
|
267
|
+
binArray: TAccountBinArray;
|
|
268
|
+
systemProgram?: TAccountSystemProgram;
|
|
230
269
|
index: CreateBinArrayInstructionDataArgs["index"];
|
|
231
270
|
idempotent: CreateBinArrayInstructionDataArgs["idempotent"];
|
|
232
271
|
};
|
|
233
272
|
|
|
234
273
|
export function getCreateBinArrayInstruction<
|
|
235
|
-
TAccountPayer extends
|
|
236
|
-
TAccountPool extends
|
|
237
|
-
TAccountBinArray extends
|
|
238
|
-
TAccountSystemProgram extends
|
|
274
|
+
TAccountPayer extends InstructionSignerInput,
|
|
275
|
+
TAccountPool extends InstructionAccountInput,
|
|
276
|
+
TAccountBinArray extends InstructionAccountInput,
|
|
277
|
+
TAccountSystemProgram extends InstructionAccountInput,
|
|
239
278
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
240
279
|
>(
|
|
241
280
|
input: CreateBinArrayInput<
|
|
@@ -247,20 +286,43 @@ export function getCreateBinArrayInstruction<
|
|
|
247
286
|
config?: { programAddress?: TProgramAddress },
|
|
248
287
|
): CreateBinArrayInstruction<
|
|
249
288
|
TProgramAddress,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
289
|
+
ResolvedInstructionAccountMeta<
|
|
290
|
+
TAccountPayer,
|
|
291
|
+
InstructionAccountInputAddress<TAccountPayer>
|
|
292
|
+
>,
|
|
293
|
+
ResolvedInstructionAccountMeta<
|
|
294
|
+
TAccountPool,
|
|
295
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
296
|
+
>,
|
|
297
|
+
ResolvedInstructionAccountMeta<
|
|
298
|
+
TAccountBinArray,
|
|
299
|
+
InstructionAccountInputAddress<TAccountBinArray>
|
|
300
|
+
>,
|
|
301
|
+
ResolvedInstructionAccountMeta<
|
|
302
|
+
TAccountSystemProgram,
|
|
303
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
304
|
+
>
|
|
254
305
|
> {
|
|
255
306
|
// Program address.
|
|
256
307
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
257
308
|
|
|
309
|
+
// Account meta helper.
|
|
310
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
311
|
+
|
|
258
312
|
// Original accounts.
|
|
259
313
|
const originalAccounts = {
|
|
260
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
261
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
262
|
-
binArray: {
|
|
263
|
-
|
|
314
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
315
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: false },
|
|
316
|
+
binArray: {
|
|
317
|
+
value: input.binArray ?? null,
|
|
318
|
+
isSigner: false,
|
|
319
|
+
isWritable: true,
|
|
320
|
+
},
|
|
321
|
+
systemProgram: {
|
|
322
|
+
value: input.systemProgram ?? null,
|
|
323
|
+
isSigner: false,
|
|
324
|
+
isWritable: false,
|
|
325
|
+
},
|
|
264
326
|
};
|
|
265
327
|
const accounts = originalAccounts as Record<
|
|
266
328
|
keyof typeof originalAccounts,
|
|
@@ -276,7 +338,6 @@ export function getCreateBinArrayInstruction<
|
|
|
276
338
|
"11111111111111111111111111111111" as Address<"11111111111111111111111111111111">;
|
|
277
339
|
}
|
|
278
340
|
|
|
279
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
280
341
|
return Object.freeze({
|
|
281
342
|
accounts: [
|
|
282
343
|
getAccountMeta("payer", accounts.payer),
|
|
@@ -290,10 +351,22 @@ export function getCreateBinArrayInstruction<
|
|
|
290
351
|
programAddress,
|
|
291
352
|
} as CreateBinArrayInstruction<
|
|
292
353
|
TProgramAddress,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
354
|
+
ResolvedInstructionAccountMeta<
|
|
355
|
+
TAccountPayer,
|
|
356
|
+
InstructionAccountInputAddress<TAccountPayer>
|
|
357
|
+
>,
|
|
358
|
+
ResolvedInstructionAccountMeta<
|
|
359
|
+
TAccountPool,
|
|
360
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
361
|
+
>,
|
|
362
|
+
ResolvedInstructionAccountMeta<
|
|
363
|
+
TAccountBinArray,
|
|
364
|
+
InstructionAccountInputAddress<TAccountBinArray>
|
|
365
|
+
>,
|
|
366
|
+
ResolvedInstructionAccountMeta<
|
|
367
|
+
TAccountSystemProgram,
|
|
368
|
+
InstructionAccountInputAddress<TAccountSystemProgram>
|
|
369
|
+
>
|
|
297
370
|
>);
|
|
298
371
|
}
|
|
299
372
|
|