@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 { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
44
47
|
import {
|
|
@@ -158,27 +161,31 @@ export function getSwapExactOutInstructionDataCodec(): Codec<
|
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
export type SwapExactOutInput<
|
|
161
|
-
TAccountUser extends
|
|
162
|
-
TAccountPool extends
|
|
163
|
-
TAccountTokenMintX extends
|
|
164
|
-
TAccountTokenMintY extends
|
|
165
|
-
TAccountTokenUserAccountX extends
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
TAccountUser extends InstructionSignerInput = InstructionSignerInput,
|
|
165
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
166
|
+
TAccountTokenMintX extends InstructionAccountInput = InstructionAccountInput,
|
|
167
|
+
TAccountTokenMintY extends InstructionAccountInput = InstructionAccountInput,
|
|
168
|
+
TAccountTokenUserAccountX extends InstructionAccountInput =
|
|
169
|
+
InstructionAccountInput,
|
|
170
|
+
TAccountTokenUserAccountY extends InstructionAccountInput =
|
|
171
|
+
InstructionAccountInput,
|
|
172
|
+
TAccountTokenVaultX extends InstructionAccountInput = InstructionAccountInput,
|
|
173
|
+
TAccountTokenVaultY extends InstructionAccountInput = InstructionAccountInput,
|
|
174
|
+
TAccountTokenProgramX extends InstructionAccountInput =
|
|
175
|
+
InstructionAccountInput,
|
|
176
|
+
TAccountTokenProgramY extends InstructionAccountInput =
|
|
177
|
+
InstructionAccountInput,
|
|
171
178
|
> = {
|
|
172
|
-
user:
|
|
173
|
-
pool:
|
|
174
|
-
tokenMintX:
|
|
175
|
-
tokenMintY:
|
|
176
|
-
tokenUserAccountX:
|
|
177
|
-
tokenUserAccountY:
|
|
178
|
-
tokenVaultX:
|
|
179
|
-
tokenVaultY:
|
|
180
|
-
tokenProgramX:
|
|
181
|
-
tokenProgramY:
|
|
179
|
+
user: TAccountUser;
|
|
180
|
+
pool: TAccountPool;
|
|
181
|
+
tokenMintX: TAccountTokenMintX;
|
|
182
|
+
tokenMintY: TAccountTokenMintY;
|
|
183
|
+
tokenUserAccountX: TAccountTokenUserAccountX;
|
|
184
|
+
tokenUserAccountY: TAccountTokenUserAccountY;
|
|
185
|
+
tokenVaultX: TAccountTokenVaultX;
|
|
186
|
+
tokenVaultY: TAccountTokenVaultY;
|
|
187
|
+
tokenProgramX: TAccountTokenProgramX;
|
|
188
|
+
tokenProgramY: TAccountTokenProgramY;
|
|
182
189
|
amountOut: SwapExactOutInstructionDataArgs["amountOut"];
|
|
183
190
|
maxAmountIn: SwapExactOutInstructionDataArgs["maxAmountIn"];
|
|
184
191
|
xToY: SwapExactOutInstructionDataArgs["xToY"];
|
|
@@ -186,16 +193,16 @@ export type SwapExactOutInput<
|
|
|
186
193
|
};
|
|
187
194
|
|
|
188
195
|
export function getSwapExactOutInstruction<
|
|
189
|
-
TAccountUser extends
|
|
190
|
-
TAccountPool extends
|
|
191
|
-
TAccountTokenMintX extends
|
|
192
|
-
TAccountTokenMintY extends
|
|
193
|
-
TAccountTokenUserAccountX extends
|
|
194
|
-
TAccountTokenUserAccountY extends
|
|
195
|
-
TAccountTokenVaultX extends
|
|
196
|
-
TAccountTokenVaultY extends
|
|
197
|
-
TAccountTokenProgramX extends
|
|
198
|
-
TAccountTokenProgramY extends
|
|
196
|
+
TAccountUser extends InstructionSignerInput,
|
|
197
|
+
TAccountPool extends InstructionAccountInput,
|
|
198
|
+
TAccountTokenMintX extends InstructionAccountInput,
|
|
199
|
+
TAccountTokenMintY extends InstructionAccountInput,
|
|
200
|
+
TAccountTokenUserAccountX extends InstructionAccountInput,
|
|
201
|
+
TAccountTokenUserAccountY extends InstructionAccountInput,
|
|
202
|
+
TAccountTokenVaultX extends InstructionAccountInput,
|
|
203
|
+
TAccountTokenVaultY extends InstructionAccountInput,
|
|
204
|
+
TAccountTokenProgramX extends InstructionAccountInput,
|
|
205
|
+
TAccountTokenProgramY extends InstructionAccountInput,
|
|
199
206
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
200
207
|
>(
|
|
201
208
|
input: SwapExactOutInput<
|
|
@@ -213,38 +220,97 @@ export function getSwapExactOutInstruction<
|
|
|
213
220
|
config?: { programAddress?: TProgramAddress },
|
|
214
221
|
): SwapExactOutInstruction<
|
|
215
222
|
TProgramAddress,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
ResolvedInstructionAccountMeta<
|
|
224
|
+
TAccountUser,
|
|
225
|
+
InstructionAccountInputAddress<TAccountUser>
|
|
226
|
+
>,
|
|
227
|
+
ResolvedInstructionAccountMeta<
|
|
228
|
+
TAccountPool,
|
|
229
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
230
|
+
>,
|
|
231
|
+
ResolvedInstructionAccountMeta<
|
|
232
|
+
TAccountTokenMintX,
|
|
233
|
+
InstructionAccountInputAddress<TAccountTokenMintX>
|
|
234
|
+
>,
|
|
235
|
+
ResolvedInstructionAccountMeta<
|
|
236
|
+
TAccountTokenMintY,
|
|
237
|
+
InstructionAccountInputAddress<TAccountTokenMintY>
|
|
238
|
+
>,
|
|
239
|
+
ResolvedInstructionAccountMeta<
|
|
240
|
+
TAccountTokenUserAccountX,
|
|
241
|
+
InstructionAccountInputAddress<TAccountTokenUserAccountX>
|
|
242
|
+
>,
|
|
243
|
+
ResolvedInstructionAccountMeta<
|
|
244
|
+
TAccountTokenUserAccountY,
|
|
245
|
+
InstructionAccountInputAddress<TAccountTokenUserAccountY>
|
|
246
|
+
>,
|
|
247
|
+
ResolvedInstructionAccountMeta<
|
|
248
|
+
TAccountTokenVaultX,
|
|
249
|
+
InstructionAccountInputAddress<TAccountTokenVaultX>
|
|
250
|
+
>,
|
|
251
|
+
ResolvedInstructionAccountMeta<
|
|
252
|
+
TAccountTokenVaultY,
|
|
253
|
+
InstructionAccountInputAddress<TAccountTokenVaultY>
|
|
254
|
+
>,
|
|
255
|
+
ResolvedInstructionAccountMeta<
|
|
256
|
+
TAccountTokenProgramX,
|
|
257
|
+
InstructionAccountInputAddress<TAccountTokenProgramX>
|
|
258
|
+
>,
|
|
259
|
+
ResolvedInstructionAccountMeta<
|
|
260
|
+
TAccountTokenProgramY,
|
|
261
|
+
InstructionAccountInputAddress<TAccountTokenProgramY>
|
|
262
|
+
>
|
|
226
263
|
> {
|
|
227
264
|
// Program address.
|
|
228
265
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
229
266
|
|
|
267
|
+
// Account meta helper.
|
|
268
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
269
|
+
|
|
230
270
|
// Original accounts.
|
|
231
271
|
const originalAccounts = {
|
|
232
|
-
user: { value: input.user ?? null, isWritable: false },
|
|
233
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
234
|
-
tokenMintX: {
|
|
235
|
-
|
|
272
|
+
user: { value: input.user ?? null, isSigner: true, isWritable: false },
|
|
273
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: true },
|
|
274
|
+
tokenMintX: {
|
|
275
|
+
value: input.tokenMintX ?? null,
|
|
276
|
+
isSigner: false,
|
|
277
|
+
isWritable: false,
|
|
278
|
+
},
|
|
279
|
+
tokenMintY: {
|
|
280
|
+
value: input.tokenMintY ?? null,
|
|
281
|
+
isSigner: false,
|
|
282
|
+
isWritable: false,
|
|
283
|
+
},
|
|
236
284
|
tokenUserAccountX: {
|
|
237
285
|
value: input.tokenUserAccountX ?? null,
|
|
286
|
+
isSigner: false,
|
|
238
287
|
isWritable: true,
|
|
239
288
|
},
|
|
240
289
|
tokenUserAccountY: {
|
|
241
290
|
value: input.tokenUserAccountY ?? null,
|
|
291
|
+
isSigner: false,
|
|
292
|
+
isWritable: true,
|
|
293
|
+
},
|
|
294
|
+
tokenVaultX: {
|
|
295
|
+
value: input.tokenVaultX ?? null,
|
|
296
|
+
isSigner: false,
|
|
297
|
+
isWritable: true,
|
|
298
|
+
},
|
|
299
|
+
tokenVaultY: {
|
|
300
|
+
value: input.tokenVaultY ?? null,
|
|
301
|
+
isSigner: false,
|
|
242
302
|
isWritable: true,
|
|
243
303
|
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
304
|
+
tokenProgramX: {
|
|
305
|
+
value: input.tokenProgramX ?? null,
|
|
306
|
+
isSigner: false,
|
|
307
|
+
isWritable: false,
|
|
308
|
+
},
|
|
309
|
+
tokenProgramY: {
|
|
310
|
+
value: input.tokenProgramY ?? null,
|
|
311
|
+
isSigner: false,
|
|
312
|
+
isWritable: false,
|
|
313
|
+
},
|
|
248
314
|
};
|
|
249
315
|
const accounts = originalAccounts as Record<
|
|
250
316
|
keyof typeof originalAccounts,
|
|
@@ -254,7 +320,6 @@ export function getSwapExactOutInstruction<
|
|
|
254
320
|
// Original args.
|
|
255
321
|
const args = { ...input };
|
|
256
322
|
|
|
257
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
258
323
|
return Object.freeze({
|
|
259
324
|
accounts: [
|
|
260
325
|
getAccountMeta("user", accounts.user),
|
|
@@ -274,16 +339,46 @@ export function getSwapExactOutInstruction<
|
|
|
274
339
|
programAddress,
|
|
275
340
|
} as SwapExactOutInstruction<
|
|
276
341
|
TProgramAddress,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
342
|
+
ResolvedInstructionAccountMeta<
|
|
343
|
+
TAccountUser,
|
|
344
|
+
InstructionAccountInputAddress<TAccountUser>
|
|
345
|
+
>,
|
|
346
|
+
ResolvedInstructionAccountMeta<
|
|
347
|
+
TAccountPool,
|
|
348
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
349
|
+
>,
|
|
350
|
+
ResolvedInstructionAccountMeta<
|
|
351
|
+
TAccountTokenMintX,
|
|
352
|
+
InstructionAccountInputAddress<TAccountTokenMintX>
|
|
353
|
+
>,
|
|
354
|
+
ResolvedInstructionAccountMeta<
|
|
355
|
+
TAccountTokenMintY,
|
|
356
|
+
InstructionAccountInputAddress<TAccountTokenMintY>
|
|
357
|
+
>,
|
|
358
|
+
ResolvedInstructionAccountMeta<
|
|
359
|
+
TAccountTokenUserAccountX,
|
|
360
|
+
InstructionAccountInputAddress<TAccountTokenUserAccountX>
|
|
361
|
+
>,
|
|
362
|
+
ResolvedInstructionAccountMeta<
|
|
363
|
+
TAccountTokenUserAccountY,
|
|
364
|
+
InstructionAccountInputAddress<TAccountTokenUserAccountY>
|
|
365
|
+
>,
|
|
366
|
+
ResolvedInstructionAccountMeta<
|
|
367
|
+
TAccountTokenVaultX,
|
|
368
|
+
InstructionAccountInputAddress<TAccountTokenVaultX>
|
|
369
|
+
>,
|
|
370
|
+
ResolvedInstructionAccountMeta<
|
|
371
|
+
TAccountTokenVaultY,
|
|
372
|
+
InstructionAccountInputAddress<TAccountTokenVaultY>
|
|
373
|
+
>,
|
|
374
|
+
ResolvedInstructionAccountMeta<
|
|
375
|
+
TAccountTokenProgramX,
|
|
376
|
+
InstructionAccountInputAddress<TAccountTokenProgramX>
|
|
377
|
+
>,
|
|
378
|
+
ResolvedInstructionAccountMeta<
|
|
379
|
+
TAccountTokenProgramY,
|
|
380
|
+
InstructionAccountInputAddress<TAccountTokenProgramY>
|
|
381
|
+
>
|
|
287
382
|
>);
|
|
288
383
|
}
|
|
289
384
|
|
|
@@ -30,12 +30,15 @@ import {
|
|
|
30
30
|
type InstructionWithData,
|
|
31
31
|
type ReadonlySignerAccount,
|
|
32
32
|
type ReadonlyUint8Array,
|
|
33
|
-
type TransactionSigner,
|
|
34
33
|
type WritableAccount,
|
|
35
34
|
} from "@solana/kit";
|
|
36
35
|
import {
|
|
37
36
|
getAccountMetaFactory,
|
|
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 { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
41
44
|
import {
|
|
@@ -113,30 +116,43 @@ export function getSyncPoolInstructionDataCodec(): Codec<
|
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
export type SyncPoolInput<
|
|
116
|
-
TAccountUser extends
|
|
117
|
-
TAccountPool extends
|
|
119
|
+
TAccountUser extends InstructionSignerInput = InstructionSignerInput,
|
|
120
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
118
121
|
> = {
|
|
119
|
-
user:
|
|
120
|
-
pool:
|
|
122
|
+
user: TAccountUser;
|
|
123
|
+
pool: TAccountPool;
|
|
121
124
|
desiredBinId: SyncPoolInstructionDataArgs["desiredBinId"];
|
|
122
125
|
remainingAccountsScheme: SyncPoolInstructionDataArgs["remainingAccountsScheme"];
|
|
123
126
|
};
|
|
124
127
|
|
|
125
128
|
export function getSyncPoolInstruction<
|
|
126
|
-
TAccountUser extends
|
|
127
|
-
TAccountPool extends
|
|
129
|
+
TAccountUser extends InstructionSignerInput,
|
|
130
|
+
TAccountPool extends InstructionAccountInput,
|
|
128
131
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
129
132
|
>(
|
|
130
133
|
input: SyncPoolInput<TAccountUser, TAccountPool>,
|
|
131
134
|
config?: { programAddress?: TProgramAddress },
|
|
132
|
-
): SyncPoolInstruction<
|
|
135
|
+
): SyncPoolInstruction<
|
|
136
|
+
TProgramAddress,
|
|
137
|
+
ResolvedInstructionAccountMeta<
|
|
138
|
+
TAccountUser,
|
|
139
|
+
InstructionAccountInputAddress<TAccountUser>
|
|
140
|
+
>,
|
|
141
|
+
ResolvedInstructionAccountMeta<
|
|
142
|
+
TAccountPool,
|
|
143
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
144
|
+
>
|
|
145
|
+
> {
|
|
133
146
|
// Program address.
|
|
134
147
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
135
148
|
|
|
149
|
+
// Account meta helper.
|
|
150
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
151
|
+
|
|
136
152
|
// Original accounts.
|
|
137
153
|
const originalAccounts = {
|
|
138
|
-
user: { value: input.user ?? null, isWritable: false },
|
|
139
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
154
|
+
user: { value: input.user ?? null, isSigner: true, isWritable: false },
|
|
155
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: true },
|
|
140
156
|
};
|
|
141
157
|
const accounts = originalAccounts as Record<
|
|
142
158
|
keyof typeof originalAccounts,
|
|
@@ -146,7 +162,6 @@ export function getSyncPoolInstruction<
|
|
|
146
162
|
// Original args.
|
|
147
163
|
const args = { ...input };
|
|
148
164
|
|
|
149
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
150
165
|
return Object.freeze({
|
|
151
166
|
accounts: [
|
|
152
167
|
getAccountMeta("user", accounts.user),
|
|
@@ -156,7 +171,17 @@ export function getSyncPoolInstruction<
|
|
|
156
171
|
args as SyncPoolInstructionDataArgs,
|
|
157
172
|
),
|
|
158
173
|
programAddress,
|
|
159
|
-
} as SyncPoolInstruction<
|
|
174
|
+
} as SyncPoolInstruction<
|
|
175
|
+
TProgramAddress,
|
|
176
|
+
ResolvedInstructionAccountMeta<
|
|
177
|
+
TAccountUser,
|
|
178
|
+
InstructionAccountInputAddress<TAccountUser>
|
|
179
|
+
>,
|
|
180
|
+
ResolvedInstructionAccountMeta<
|
|
181
|
+
TAccountPool,
|
|
182
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
183
|
+
>
|
|
184
|
+
>);
|
|
160
185
|
}
|
|
161
186
|
|
|
162
187
|
export type ParsedSyncPoolInstruction<
|
|
@@ -30,12 +30,15 @@ import {
|
|
|
30
30
|
type InstructionWithData,
|
|
31
31
|
type ReadonlySignerAccount,
|
|
32
32
|
type ReadonlyUint8Array,
|
|
33
|
-
type TransactionSigner,
|
|
34
33
|
type WritableAccount,
|
|
35
34
|
} from "@solana/kit";
|
|
36
35
|
import {
|
|
37
36
|
getAccountMetaFactory,
|
|
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 { findAdminConfigPda } from "../pdas/index.js";
|
|
41
44
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
@@ -109,17 +112,17 @@ export function getTransferAdminAuthorityInstructionDataCodec(): FixedSizeCodec<
|
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
export type TransferAdminAuthorityAsyncInput<
|
|
112
|
-
TAccountAuthority extends
|
|
113
|
-
TAccountAdminConfig extends
|
|
115
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
116
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
114
117
|
> = {
|
|
115
|
-
authority:
|
|
116
|
-
adminConfig?:
|
|
118
|
+
authority: TAccountAuthority;
|
|
119
|
+
adminConfig?: TAccountAdminConfig;
|
|
117
120
|
newAuthority: TransferAdminAuthorityInstructionDataArgs["newAuthority"];
|
|
118
121
|
};
|
|
119
122
|
|
|
120
123
|
export async function getTransferAdminAuthorityInstructionAsync<
|
|
121
|
-
TAccountAuthority extends
|
|
122
|
-
TAccountAdminConfig extends
|
|
124
|
+
TAccountAuthority extends InstructionSignerInput,
|
|
125
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
123
126
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
124
127
|
>(
|
|
125
128
|
input: TransferAdminAuthorityAsyncInput<
|
|
@@ -130,17 +133,34 @@ export async function getTransferAdminAuthorityInstructionAsync<
|
|
|
130
133
|
): Promise<
|
|
131
134
|
TransferAdminAuthorityInstruction<
|
|
132
135
|
TProgramAddress,
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
ResolvedInstructionAccountMeta<
|
|
137
|
+
TAccountAuthority,
|
|
138
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
139
|
+
>,
|
|
140
|
+
ResolvedInstructionAccountMeta<
|
|
141
|
+
TAccountAdminConfig,
|
|
142
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
143
|
+
>
|
|
135
144
|
>
|
|
136
145
|
> {
|
|
137
146
|
// Program address.
|
|
138
147
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
139
148
|
|
|
149
|
+
// Account meta helper.
|
|
150
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
151
|
+
|
|
140
152
|
// Original accounts.
|
|
141
153
|
const originalAccounts = {
|
|
142
|
-
authority: {
|
|
143
|
-
|
|
154
|
+
authority: {
|
|
155
|
+
value: input.authority ?? null,
|
|
156
|
+
isSigner: true,
|
|
157
|
+
isWritable: false,
|
|
158
|
+
},
|
|
159
|
+
adminConfig: {
|
|
160
|
+
value: input.adminConfig ?? null,
|
|
161
|
+
isSigner: false,
|
|
162
|
+
isWritable: true,
|
|
163
|
+
},
|
|
144
164
|
};
|
|
145
165
|
const accounts = originalAccounts as Record<
|
|
146
166
|
keyof typeof originalAccounts,
|
|
@@ -155,7 +175,6 @@ export async function getTransferAdminAuthorityInstructionAsync<
|
|
|
155
175
|
accounts.adminConfig.value = await findAdminConfigPda({ programAddress });
|
|
156
176
|
}
|
|
157
177
|
|
|
158
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
159
178
|
return Object.freeze({
|
|
160
179
|
accounts: [
|
|
161
180
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -167,39 +186,62 @@ export async function getTransferAdminAuthorityInstructionAsync<
|
|
|
167
186
|
programAddress,
|
|
168
187
|
} as TransferAdminAuthorityInstruction<
|
|
169
188
|
TProgramAddress,
|
|
170
|
-
|
|
171
|
-
|
|
189
|
+
ResolvedInstructionAccountMeta<
|
|
190
|
+
TAccountAuthority,
|
|
191
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
192
|
+
>,
|
|
193
|
+
ResolvedInstructionAccountMeta<
|
|
194
|
+
TAccountAdminConfig,
|
|
195
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
196
|
+
>
|
|
172
197
|
>);
|
|
173
198
|
}
|
|
174
199
|
|
|
175
200
|
export type TransferAdminAuthorityInput<
|
|
176
|
-
TAccountAuthority extends
|
|
177
|
-
TAccountAdminConfig extends
|
|
201
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
202
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
178
203
|
> = {
|
|
179
|
-
authority:
|
|
180
|
-
adminConfig:
|
|
204
|
+
authority: TAccountAuthority;
|
|
205
|
+
adminConfig: TAccountAdminConfig;
|
|
181
206
|
newAuthority: TransferAdminAuthorityInstructionDataArgs["newAuthority"];
|
|
182
207
|
};
|
|
183
208
|
|
|
184
209
|
export function getTransferAdminAuthorityInstruction<
|
|
185
|
-
TAccountAuthority extends
|
|
186
|
-
TAccountAdminConfig extends
|
|
210
|
+
TAccountAuthority extends InstructionSignerInput,
|
|
211
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
187
212
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
188
213
|
>(
|
|
189
214
|
input: TransferAdminAuthorityInput<TAccountAuthority, TAccountAdminConfig>,
|
|
190
215
|
config?: { programAddress?: TProgramAddress },
|
|
191
216
|
): TransferAdminAuthorityInstruction<
|
|
192
217
|
TProgramAddress,
|
|
193
|
-
|
|
194
|
-
|
|
218
|
+
ResolvedInstructionAccountMeta<
|
|
219
|
+
TAccountAuthority,
|
|
220
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
221
|
+
>,
|
|
222
|
+
ResolvedInstructionAccountMeta<
|
|
223
|
+
TAccountAdminConfig,
|
|
224
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
225
|
+
>
|
|
195
226
|
> {
|
|
196
227
|
// Program address.
|
|
197
228
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
198
229
|
|
|
230
|
+
// Account meta helper.
|
|
231
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
232
|
+
|
|
199
233
|
// Original accounts.
|
|
200
234
|
const originalAccounts = {
|
|
201
|
-
authority: {
|
|
202
|
-
|
|
235
|
+
authority: {
|
|
236
|
+
value: input.authority ?? null,
|
|
237
|
+
isSigner: true,
|
|
238
|
+
isWritable: false,
|
|
239
|
+
},
|
|
240
|
+
adminConfig: {
|
|
241
|
+
value: input.adminConfig ?? null,
|
|
242
|
+
isSigner: false,
|
|
243
|
+
isWritable: true,
|
|
244
|
+
},
|
|
203
245
|
};
|
|
204
246
|
const accounts = originalAccounts as Record<
|
|
205
247
|
keyof typeof originalAccounts,
|
|
@@ -209,7 +251,6 @@ export function getTransferAdminAuthorityInstruction<
|
|
|
209
251
|
// Original args.
|
|
210
252
|
const args = { ...input };
|
|
211
253
|
|
|
212
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
213
254
|
return Object.freeze({
|
|
214
255
|
accounts: [
|
|
215
256
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -221,8 +262,14 @@ export function getTransferAdminAuthorityInstruction<
|
|
|
221
262
|
programAddress,
|
|
222
263
|
} as TransferAdminAuthorityInstruction<
|
|
223
264
|
TProgramAddress,
|
|
224
|
-
|
|
225
|
-
|
|
265
|
+
ResolvedInstructionAccountMeta<
|
|
266
|
+
TAccountAuthority,
|
|
267
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
268
|
+
>,
|
|
269
|
+
ResolvedInstructionAccountMeta<
|
|
270
|
+
TAccountAdminConfig,
|
|
271
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
272
|
+
>
|
|
226
273
|
>);
|
|
227
274
|
}
|
|
228
275
|
|