@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
|
@@ -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";
|
|
@@ -110,22 +113,22 @@ export function getResetAdminAuthorityInstructionDataCodec(): FixedSizeCodec<
|
|
|
110
113
|
}
|
|
111
114
|
|
|
112
115
|
export type ResetAdminAuthorityAsyncInput<
|
|
113
|
-
TAccountDeployer extends
|
|
114
|
-
TAccountAdminConfig extends
|
|
115
|
-
TAccountProgram extends
|
|
116
|
-
TAccountProgramData extends
|
|
116
|
+
TAccountDeployer extends InstructionSignerInput = InstructionSignerInput,
|
|
117
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
118
|
+
TAccountProgram extends InstructionAccountInput = InstructionAccountInput,
|
|
119
|
+
TAccountProgramData extends InstructionAccountInput = InstructionAccountInput,
|
|
117
120
|
> = {
|
|
118
|
-
deployer:
|
|
119
|
-
adminConfig?:
|
|
120
|
-
program?:
|
|
121
|
-
programData:
|
|
121
|
+
deployer: TAccountDeployer;
|
|
122
|
+
adminConfig?: TAccountAdminConfig;
|
|
123
|
+
program?: TAccountProgram;
|
|
124
|
+
programData: TAccountProgramData;
|
|
122
125
|
};
|
|
123
126
|
|
|
124
127
|
export async function getResetAdminAuthorityInstructionAsync<
|
|
125
|
-
TAccountDeployer extends
|
|
126
|
-
TAccountAdminConfig extends
|
|
127
|
-
TAccountProgram extends
|
|
128
|
-
TAccountProgramData extends
|
|
128
|
+
TAccountDeployer extends InstructionSignerInput,
|
|
129
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
130
|
+
TAccountProgram extends InstructionAccountInput,
|
|
131
|
+
TAccountProgramData extends InstructionAccountInput,
|
|
129
132
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
130
133
|
>(
|
|
131
134
|
input: ResetAdminAuthorityAsyncInput<
|
|
@@ -138,21 +141,52 @@ export async function getResetAdminAuthorityInstructionAsync<
|
|
|
138
141
|
): Promise<
|
|
139
142
|
ResetAdminAuthorityInstruction<
|
|
140
143
|
TProgramAddress,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
ResolvedInstructionAccountMeta<
|
|
145
|
+
TAccountDeployer,
|
|
146
|
+
InstructionAccountInputAddress<TAccountDeployer>
|
|
147
|
+
>,
|
|
148
|
+
ResolvedInstructionAccountMeta<
|
|
149
|
+
TAccountAdminConfig,
|
|
150
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
151
|
+
>,
|
|
152
|
+
ResolvedInstructionAccountMeta<
|
|
153
|
+
TAccountProgram,
|
|
154
|
+
InstructionAccountInputAddress<TAccountProgram>
|
|
155
|
+
>,
|
|
156
|
+
ResolvedInstructionAccountMeta<
|
|
157
|
+
TAccountProgramData,
|
|
158
|
+
InstructionAccountInputAddress<TAccountProgramData>
|
|
159
|
+
>
|
|
145
160
|
>
|
|
146
161
|
> {
|
|
147
162
|
// Program address.
|
|
148
163
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
149
164
|
|
|
165
|
+
// Account meta helper.
|
|
166
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
167
|
+
|
|
150
168
|
// Original accounts.
|
|
151
169
|
const originalAccounts = {
|
|
152
|
-
deployer: {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
170
|
+
deployer: {
|
|
171
|
+
value: input.deployer ?? null,
|
|
172
|
+
isSigner: true,
|
|
173
|
+
isWritable: true,
|
|
174
|
+
},
|
|
175
|
+
adminConfig: {
|
|
176
|
+
value: input.adminConfig ?? null,
|
|
177
|
+
isSigner: false,
|
|
178
|
+
isWritable: true,
|
|
179
|
+
},
|
|
180
|
+
program: {
|
|
181
|
+
value: input.program ?? null,
|
|
182
|
+
isSigner: false,
|
|
183
|
+
isWritable: false,
|
|
184
|
+
},
|
|
185
|
+
programData: {
|
|
186
|
+
value: input.programData ?? null,
|
|
187
|
+
isSigner: false,
|
|
188
|
+
isWritable: false,
|
|
189
|
+
},
|
|
156
190
|
};
|
|
157
191
|
const accounts = originalAccounts as Record<
|
|
158
192
|
keyof typeof originalAccounts,
|
|
@@ -168,7 +202,6 @@ export async function getResetAdminAuthorityInstructionAsync<
|
|
|
168
202
|
"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">;
|
|
169
203
|
}
|
|
170
204
|
|
|
171
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
172
205
|
return Object.freeze({
|
|
173
206
|
accounts: [
|
|
174
207
|
getAccountMeta("deployer", accounts.deployer),
|
|
@@ -180,30 +213,42 @@ export async function getResetAdminAuthorityInstructionAsync<
|
|
|
180
213
|
programAddress,
|
|
181
214
|
} as ResetAdminAuthorityInstruction<
|
|
182
215
|
TProgramAddress,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
216
|
+
ResolvedInstructionAccountMeta<
|
|
217
|
+
TAccountDeployer,
|
|
218
|
+
InstructionAccountInputAddress<TAccountDeployer>
|
|
219
|
+
>,
|
|
220
|
+
ResolvedInstructionAccountMeta<
|
|
221
|
+
TAccountAdminConfig,
|
|
222
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
223
|
+
>,
|
|
224
|
+
ResolvedInstructionAccountMeta<
|
|
225
|
+
TAccountProgram,
|
|
226
|
+
InstructionAccountInputAddress<TAccountProgram>
|
|
227
|
+
>,
|
|
228
|
+
ResolvedInstructionAccountMeta<
|
|
229
|
+
TAccountProgramData,
|
|
230
|
+
InstructionAccountInputAddress<TAccountProgramData>
|
|
231
|
+
>
|
|
187
232
|
>);
|
|
188
233
|
}
|
|
189
234
|
|
|
190
235
|
export type ResetAdminAuthorityInput<
|
|
191
|
-
TAccountDeployer extends
|
|
192
|
-
TAccountAdminConfig extends
|
|
193
|
-
TAccountProgram extends
|
|
194
|
-
TAccountProgramData extends
|
|
236
|
+
TAccountDeployer extends InstructionSignerInput = InstructionSignerInput,
|
|
237
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
238
|
+
TAccountProgram extends InstructionAccountInput = InstructionAccountInput,
|
|
239
|
+
TAccountProgramData extends InstructionAccountInput = InstructionAccountInput,
|
|
195
240
|
> = {
|
|
196
|
-
deployer:
|
|
197
|
-
adminConfig:
|
|
198
|
-
program?:
|
|
199
|
-
programData:
|
|
241
|
+
deployer: TAccountDeployer;
|
|
242
|
+
adminConfig: TAccountAdminConfig;
|
|
243
|
+
program?: TAccountProgram;
|
|
244
|
+
programData: TAccountProgramData;
|
|
200
245
|
};
|
|
201
246
|
|
|
202
247
|
export function getResetAdminAuthorityInstruction<
|
|
203
|
-
TAccountDeployer extends
|
|
204
|
-
TAccountAdminConfig extends
|
|
205
|
-
TAccountProgram extends
|
|
206
|
-
TAccountProgramData extends
|
|
248
|
+
TAccountDeployer extends InstructionSignerInput,
|
|
249
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
250
|
+
TAccountProgram extends InstructionAccountInput,
|
|
251
|
+
TAccountProgramData extends InstructionAccountInput,
|
|
207
252
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
208
253
|
>(
|
|
209
254
|
input: ResetAdminAuthorityInput<
|
|
@@ -215,20 +260,51 @@ export function getResetAdminAuthorityInstruction<
|
|
|
215
260
|
config?: { programAddress?: TProgramAddress },
|
|
216
261
|
): ResetAdminAuthorityInstruction<
|
|
217
262
|
TProgramAddress,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
263
|
+
ResolvedInstructionAccountMeta<
|
|
264
|
+
TAccountDeployer,
|
|
265
|
+
InstructionAccountInputAddress<TAccountDeployer>
|
|
266
|
+
>,
|
|
267
|
+
ResolvedInstructionAccountMeta<
|
|
268
|
+
TAccountAdminConfig,
|
|
269
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
270
|
+
>,
|
|
271
|
+
ResolvedInstructionAccountMeta<
|
|
272
|
+
TAccountProgram,
|
|
273
|
+
InstructionAccountInputAddress<TAccountProgram>
|
|
274
|
+
>,
|
|
275
|
+
ResolvedInstructionAccountMeta<
|
|
276
|
+
TAccountProgramData,
|
|
277
|
+
InstructionAccountInputAddress<TAccountProgramData>
|
|
278
|
+
>
|
|
222
279
|
> {
|
|
223
280
|
// Program address.
|
|
224
281
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
225
282
|
|
|
283
|
+
// Account meta helper.
|
|
284
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
285
|
+
|
|
226
286
|
// Original accounts.
|
|
227
287
|
const originalAccounts = {
|
|
228
|
-
deployer: {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
288
|
+
deployer: {
|
|
289
|
+
value: input.deployer ?? null,
|
|
290
|
+
isSigner: true,
|
|
291
|
+
isWritable: true,
|
|
292
|
+
},
|
|
293
|
+
adminConfig: {
|
|
294
|
+
value: input.adminConfig ?? null,
|
|
295
|
+
isSigner: false,
|
|
296
|
+
isWritable: true,
|
|
297
|
+
},
|
|
298
|
+
program: {
|
|
299
|
+
value: input.program ?? null,
|
|
300
|
+
isSigner: false,
|
|
301
|
+
isWritable: false,
|
|
302
|
+
},
|
|
303
|
+
programData: {
|
|
304
|
+
value: input.programData ?? null,
|
|
305
|
+
isSigner: false,
|
|
306
|
+
isWritable: false,
|
|
307
|
+
},
|
|
232
308
|
};
|
|
233
309
|
const accounts = originalAccounts as Record<
|
|
234
310
|
keyof typeof originalAccounts,
|
|
@@ -241,7 +317,6 @@ export function getResetAdminAuthorityInstruction<
|
|
|
241
317
|
"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">;
|
|
242
318
|
}
|
|
243
319
|
|
|
244
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
245
320
|
return Object.freeze({
|
|
246
321
|
accounts: [
|
|
247
322
|
getAccountMeta("deployer", accounts.deployer),
|
|
@@ -253,10 +328,22 @@ export function getResetAdminAuthorityInstruction<
|
|
|
253
328
|
programAddress,
|
|
254
329
|
} as ResetAdminAuthorityInstruction<
|
|
255
330
|
TProgramAddress,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
331
|
+
ResolvedInstructionAccountMeta<
|
|
332
|
+
TAccountDeployer,
|
|
333
|
+
InstructionAccountInputAddress<TAccountDeployer>
|
|
334
|
+
>,
|
|
335
|
+
ResolvedInstructionAccountMeta<
|
|
336
|
+
TAccountAdminConfig,
|
|
337
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
338
|
+
>,
|
|
339
|
+
ResolvedInstructionAccountMeta<
|
|
340
|
+
TAccountProgram,
|
|
341
|
+
InstructionAccountInputAddress<TAccountProgram>
|
|
342
|
+
>,
|
|
343
|
+
ResolvedInstructionAccountMeta<
|
|
344
|
+
TAccountProgramData,
|
|
345
|
+
InstructionAccountInputAddress<TAccountProgramData>
|
|
346
|
+
>
|
|
260
347
|
>);
|
|
261
348
|
}
|
|
262
349
|
|
|
@@ -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 getSetMetadataUpdateAuthorityInstructionDataCodec(): FixedSizeCo
|
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
export type SetMetadataUpdateAuthorityAsyncInput<
|
|
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
|
metadataUpdateAuthority: SetMetadataUpdateAuthorityInstructionDataArgs["metadataUpdateAuthority"];
|
|
118
121
|
};
|
|
119
122
|
|
|
120
123
|
export async function getSetMetadataUpdateAuthorityInstructionAsync<
|
|
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: SetMetadataUpdateAuthorityAsyncInput<
|
|
@@ -130,17 +133,34 @@ export async function getSetMetadataUpdateAuthorityInstructionAsync<
|
|
|
130
133
|
): Promise<
|
|
131
134
|
SetMetadataUpdateAuthorityInstruction<
|
|
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 getSetMetadataUpdateAuthorityInstructionAsync<
|
|
|
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,23 +186,29 @@ export async function getSetMetadataUpdateAuthorityInstructionAsync<
|
|
|
167
186
|
programAddress,
|
|
168
187
|
} as SetMetadataUpdateAuthorityInstruction<
|
|
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 SetMetadataUpdateAuthorityInput<
|
|
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
|
metadataUpdateAuthority: SetMetadataUpdateAuthorityInstructionDataArgs["metadataUpdateAuthority"];
|
|
182
207
|
};
|
|
183
208
|
|
|
184
209
|
export function getSetMetadataUpdateAuthorityInstruction<
|
|
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: SetMetadataUpdateAuthorityInput<
|
|
@@ -193,16 +218,33 @@ export function getSetMetadataUpdateAuthorityInstruction<
|
|
|
193
218
|
config?: { programAddress?: TProgramAddress },
|
|
194
219
|
): SetMetadataUpdateAuthorityInstruction<
|
|
195
220
|
TProgramAddress,
|
|
196
|
-
|
|
197
|
-
|
|
221
|
+
ResolvedInstructionAccountMeta<
|
|
222
|
+
TAccountAuthority,
|
|
223
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
224
|
+
>,
|
|
225
|
+
ResolvedInstructionAccountMeta<
|
|
226
|
+
TAccountAdminConfig,
|
|
227
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
228
|
+
>
|
|
198
229
|
> {
|
|
199
230
|
// Program address.
|
|
200
231
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
201
232
|
|
|
233
|
+
// Account meta helper.
|
|
234
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
235
|
+
|
|
202
236
|
// Original accounts.
|
|
203
237
|
const originalAccounts = {
|
|
204
|
-
authority: {
|
|
205
|
-
|
|
238
|
+
authority: {
|
|
239
|
+
value: input.authority ?? null,
|
|
240
|
+
isSigner: true,
|
|
241
|
+
isWritable: false,
|
|
242
|
+
},
|
|
243
|
+
adminConfig: {
|
|
244
|
+
value: input.adminConfig ?? null,
|
|
245
|
+
isSigner: false,
|
|
246
|
+
isWritable: true,
|
|
247
|
+
},
|
|
206
248
|
};
|
|
207
249
|
const accounts = originalAccounts as Record<
|
|
208
250
|
keyof typeof originalAccounts,
|
|
@@ -212,7 +254,6 @@ export function getSetMetadataUpdateAuthorityInstruction<
|
|
|
212
254
|
// Original args.
|
|
213
255
|
const args = { ...input };
|
|
214
256
|
|
|
215
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
216
257
|
return Object.freeze({
|
|
217
258
|
accounts: [
|
|
218
259
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -224,8 +265,14 @@ export function getSetMetadataUpdateAuthorityInstruction<
|
|
|
224
265
|
programAddress,
|
|
225
266
|
} as SetMetadataUpdateAuthorityInstruction<
|
|
226
267
|
TProgramAddress,
|
|
227
|
-
|
|
228
|
-
|
|
268
|
+
ResolvedInstructionAccountMeta<
|
|
269
|
+
TAccountAuthority,
|
|
270
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
271
|
+
>,
|
|
272
|
+
ResolvedInstructionAccountMeta<
|
|
273
|
+
TAccountAdminConfig,
|
|
274
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
275
|
+
>
|
|
229
276
|
>);
|
|
230
277
|
}
|
|
231
278
|
|
|
@@ -29,12 +29,15 @@ import {
|
|
|
29
29
|
type ReadonlyAccount,
|
|
30
30
|
type ReadonlySignerAccount,
|
|
31
31
|
type ReadonlyUint8Array,
|
|
32
|
-
type TransactionSigner,
|
|
33
32
|
type WritableAccount,
|
|
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";
|
|
@@ -118,20 +121,20 @@ export function getSetPoolDynamicFeeConfigInstructionDataCodec(): FixedSizeCodec
|
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
export type SetPoolDynamicFeeConfigAsyncInput<
|
|
121
|
-
TAccountAuthority extends
|
|
122
|
-
TAccountAdminConfig extends
|
|
123
|
-
TAccountPool extends
|
|
124
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
125
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
126
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
124
127
|
> = {
|
|
125
|
-
authority:
|
|
126
|
-
adminConfig?:
|
|
127
|
-
pool:
|
|
128
|
+
authority: TAccountAuthority;
|
|
129
|
+
adminConfig?: TAccountAdminConfig;
|
|
130
|
+
pool: TAccountPool;
|
|
128
131
|
config: SetPoolDynamicFeeConfigInstructionDataArgs["config"];
|
|
129
132
|
};
|
|
130
133
|
|
|
131
134
|
export async function getSetPoolDynamicFeeConfigInstructionAsync<
|
|
132
|
-
TAccountAuthority extends
|
|
133
|
-
TAccountAdminConfig extends
|
|
134
|
-
TAccountPool extends
|
|
135
|
+
TAccountAuthority extends InstructionSignerInput,
|
|
136
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
137
|
+
TAccountPool extends InstructionAccountInput,
|
|
135
138
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
136
139
|
>(
|
|
137
140
|
input: SetPoolDynamicFeeConfigAsyncInput<
|
|
@@ -143,19 +146,39 @@ export async function getSetPoolDynamicFeeConfigInstructionAsync<
|
|
|
143
146
|
): Promise<
|
|
144
147
|
SetPoolDynamicFeeConfigInstruction<
|
|
145
148
|
TProgramAddress,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
ResolvedInstructionAccountMeta<
|
|
150
|
+
TAccountAuthority,
|
|
151
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
152
|
+
>,
|
|
153
|
+
ResolvedInstructionAccountMeta<
|
|
154
|
+
TAccountAdminConfig,
|
|
155
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
156
|
+
>,
|
|
157
|
+
ResolvedInstructionAccountMeta<
|
|
158
|
+
TAccountPool,
|
|
159
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
160
|
+
>
|
|
149
161
|
>
|
|
150
162
|
> {
|
|
151
163
|
// Program address.
|
|
152
164
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
153
165
|
|
|
166
|
+
// Account meta helper.
|
|
167
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
168
|
+
|
|
154
169
|
// Original accounts.
|
|
155
170
|
const originalAccounts = {
|
|
156
|
-
authority: {
|
|
157
|
-
|
|
158
|
-
|
|
171
|
+
authority: {
|
|
172
|
+
value: input.authority ?? null,
|
|
173
|
+
isSigner: true,
|
|
174
|
+
isWritable: false,
|
|
175
|
+
},
|
|
176
|
+
adminConfig: {
|
|
177
|
+
value: input.adminConfig ?? null,
|
|
178
|
+
isSigner: false,
|
|
179
|
+
isWritable: false,
|
|
180
|
+
},
|
|
181
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: true },
|
|
159
182
|
};
|
|
160
183
|
const accounts = originalAccounts as Record<
|
|
161
184
|
keyof typeof originalAccounts,
|
|
@@ -170,7 +193,6 @@ export async function getSetPoolDynamicFeeConfigInstructionAsync<
|
|
|
170
193
|
accounts.adminConfig.value = await findAdminConfigPda({ programAddress });
|
|
171
194
|
}
|
|
172
195
|
|
|
173
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
174
196
|
return Object.freeze({
|
|
175
197
|
accounts: [
|
|
176
198
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -183,27 +205,36 @@ export async function getSetPoolDynamicFeeConfigInstructionAsync<
|
|
|
183
205
|
programAddress,
|
|
184
206
|
} as SetPoolDynamicFeeConfigInstruction<
|
|
185
207
|
TProgramAddress,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
208
|
+
ResolvedInstructionAccountMeta<
|
|
209
|
+
TAccountAuthority,
|
|
210
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
211
|
+
>,
|
|
212
|
+
ResolvedInstructionAccountMeta<
|
|
213
|
+
TAccountAdminConfig,
|
|
214
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
215
|
+
>,
|
|
216
|
+
ResolvedInstructionAccountMeta<
|
|
217
|
+
TAccountPool,
|
|
218
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
219
|
+
>
|
|
189
220
|
>);
|
|
190
221
|
}
|
|
191
222
|
|
|
192
223
|
export type SetPoolDynamicFeeConfigInput<
|
|
193
|
-
TAccountAuthority extends
|
|
194
|
-
TAccountAdminConfig extends
|
|
195
|
-
TAccountPool extends
|
|
224
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
225
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
226
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
196
227
|
> = {
|
|
197
|
-
authority:
|
|
198
|
-
adminConfig:
|
|
199
|
-
pool:
|
|
228
|
+
authority: TAccountAuthority;
|
|
229
|
+
adminConfig: TAccountAdminConfig;
|
|
230
|
+
pool: TAccountPool;
|
|
200
231
|
config: SetPoolDynamicFeeConfigInstructionDataArgs["config"];
|
|
201
232
|
};
|
|
202
233
|
|
|
203
234
|
export function getSetPoolDynamicFeeConfigInstruction<
|
|
204
|
-
TAccountAuthority extends
|
|
205
|
-
TAccountAdminConfig extends
|
|
206
|
-
TAccountPool extends
|
|
235
|
+
TAccountAuthority extends InstructionSignerInput,
|
|
236
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
237
|
+
TAccountPool extends InstructionAccountInput,
|
|
207
238
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
208
239
|
>(
|
|
209
240
|
input: SetPoolDynamicFeeConfigInput<
|
|
@@ -214,18 +245,38 @@ export function getSetPoolDynamicFeeConfigInstruction<
|
|
|
214
245
|
config?: { programAddress?: TProgramAddress },
|
|
215
246
|
): SetPoolDynamicFeeConfigInstruction<
|
|
216
247
|
TProgramAddress,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
248
|
+
ResolvedInstructionAccountMeta<
|
|
249
|
+
TAccountAuthority,
|
|
250
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
251
|
+
>,
|
|
252
|
+
ResolvedInstructionAccountMeta<
|
|
253
|
+
TAccountAdminConfig,
|
|
254
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
255
|
+
>,
|
|
256
|
+
ResolvedInstructionAccountMeta<
|
|
257
|
+
TAccountPool,
|
|
258
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
259
|
+
>
|
|
220
260
|
> {
|
|
221
261
|
// Program address.
|
|
222
262
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
223
263
|
|
|
264
|
+
// Account meta helper.
|
|
265
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
266
|
+
|
|
224
267
|
// Original accounts.
|
|
225
268
|
const originalAccounts = {
|
|
226
|
-
authority: {
|
|
227
|
-
|
|
228
|
-
|
|
269
|
+
authority: {
|
|
270
|
+
value: input.authority ?? null,
|
|
271
|
+
isSigner: true,
|
|
272
|
+
isWritable: false,
|
|
273
|
+
},
|
|
274
|
+
adminConfig: {
|
|
275
|
+
value: input.adminConfig ?? null,
|
|
276
|
+
isSigner: false,
|
|
277
|
+
isWritable: false,
|
|
278
|
+
},
|
|
279
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: true },
|
|
229
280
|
};
|
|
230
281
|
const accounts = originalAccounts as Record<
|
|
231
282
|
keyof typeof originalAccounts,
|
|
@@ -235,7 +286,6 @@ export function getSetPoolDynamicFeeConfigInstruction<
|
|
|
235
286
|
// Original args.
|
|
236
287
|
const args = { ...input };
|
|
237
288
|
|
|
238
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
239
289
|
return Object.freeze({
|
|
240
290
|
accounts: [
|
|
241
291
|
getAccountMeta("authority", accounts.authority),
|
|
@@ -248,9 +298,18 @@ export function getSetPoolDynamicFeeConfigInstruction<
|
|
|
248
298
|
programAddress,
|
|
249
299
|
} as SetPoolDynamicFeeConfigInstruction<
|
|
250
300
|
TProgramAddress,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
301
|
+
ResolvedInstructionAccountMeta<
|
|
302
|
+
TAccountAuthority,
|
|
303
|
+
InstructionAccountInputAddress<TAccountAuthority>
|
|
304
|
+
>,
|
|
305
|
+
ResolvedInstructionAccountMeta<
|
|
306
|
+
TAccountAdminConfig,
|
|
307
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
308
|
+
>,
|
|
309
|
+
ResolvedInstructionAccountMeta<
|
|
310
|
+
TAccountPool,
|
|
311
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
312
|
+
>
|
|
254
313
|
>);
|
|
255
314
|
}
|
|
256
315
|
|