@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.
Files changed (83) hide show
  1. package/dist/entities/dlmm_program.d.ts +1 -1
  2. package/dist/entities/dlmm_program.d.ts.map +1 -1
  3. package/dist/entities/dlmm_program.js +2 -2
  4. package/dist/entities/pool.d.ts +1 -1
  5. package/dist/entities/pool.d.ts.map +1 -1
  6. package/dist/generated/instructions/acceptAdminAuthority.d.ts +12 -11
  7. package/dist/generated/instructions/acceptAdminAuthority.d.ts.map +1 -1
  8. package/dist/generated/instructions/acceptAdminAuthority.js +16 -4
  9. package/dist/generated/instructions/claimFee.d.ts +19 -18
  10. package/dist/generated/instructions/claimFee.d.ts.map +1 -1
  11. package/dist/generated/instructions/claimFee.js +52 -12
  12. package/dist/generated/instructions/claimProtocolFee.d.ts +30 -29
  13. package/dist/generated/instructions/claimProtocolFee.d.ts.map +1 -1
  14. package/dist/generated/instructions/claimProtocolFee.js +90 -20
  15. package/dist/generated/instructions/closePosition.d.ts +18 -17
  16. package/dist/generated/instructions/closePosition.d.ts.map +1 -1
  17. package/dist/generated/instructions/closePosition.js +38 -10
  18. package/dist/generated/instructions/createAdminConfig.d.ts +18 -17
  19. package/dist/generated/instructions/createAdminConfig.d.ts.map +1 -1
  20. package/dist/generated/instructions/createAdminConfig.js +54 -12
  21. package/dist/generated/instructions/createBinArray.d.ts +16 -15
  22. package/dist/generated/instructions/createBinArray.d.ts.map +1 -1
  23. package/dist/generated/instructions/createBinArray.js +28 -10
  24. package/dist/generated/instructions/createPool.d.ts +30 -29
  25. package/dist/generated/instructions/createPool.d.ts.map +1 -1
  26. package/dist/generated/instructions/createPool.js +98 -22
  27. package/dist/generated/instructions/deleteBinArray.d.ts +18 -17
  28. package/dist/generated/instructions/deleteBinArray.d.ts.map +1 -1
  29. package/dist/generated/instructions/deleteBinArray.js +54 -12
  30. package/dist/generated/instructions/depositByWeight.d.ts +19 -18
  31. package/dist/generated/instructions/depositByWeight.d.ts.map +1 -1
  32. package/dist/generated/instructions/depositByWeight.js +52 -12
  33. package/dist/generated/instructions/openPosition.d.ts +28 -27
  34. package/dist/generated/instructions/openPosition.d.ts.map +1 -1
  35. package/dist/generated/instructions/openPosition.js +64 -16
  36. package/dist/generated/instructions/resetAdminAuthority.d.ts +16 -15
  37. package/dist/generated/instructions/resetAdminAuthority.d.ts.map +1 -1
  38. package/dist/generated/instructions/resetAdminAuthority.js +44 -10
  39. package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts +12 -11
  40. package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts.map +1 -1
  41. package/dist/generated/instructions/setMetadataUpdateAuthority.js +24 -6
  42. package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts +14 -13
  43. package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts.map +1 -1
  44. package/dist/generated/instructions/setPoolDynamicFeeConfig.js +26 -8
  45. package/dist/generated/instructions/setPoolProtocolShare.d.ts +14 -13
  46. package/dist/generated/instructions/setPoolProtocolShare.d.ts.map +1 -1
  47. package/dist/generated/instructions/setPoolProtocolShare.js +26 -8
  48. package/dist/generated/instructions/swapExactIn.d.ts +15 -14
  49. package/dist/generated/instructions/swapExactIn.d.ts.map +1 -1
  50. package/dist/generated/instructions/swapExactIn.js +36 -9
  51. package/dist/generated/instructions/swapExactOut.d.ts +15 -14
  52. package/dist/generated/instructions/swapExactOut.d.ts.map +1 -1
  53. package/dist/generated/instructions/swapExactOut.js +36 -9
  54. package/dist/generated/instructions/syncPool.d.ts +7 -6
  55. package/dist/generated/instructions/syncPool.d.ts.map +1 -1
  56. package/dist/generated/instructions/syncPool.js +4 -3
  57. package/dist/generated/instructions/transferAdminAuthority.d.ts +12 -11
  58. package/dist/generated/instructions/transferAdminAuthority.d.ts.map +1 -1
  59. package/dist/generated/instructions/transferAdminAuthority.js +24 -6
  60. package/dist/generated/instructions/withdraw.d.ts +19 -18
  61. package/dist/generated/instructions/withdraw.d.ts.map +1 -1
  62. package/dist/generated/instructions/withdraw.js +52 -12
  63. package/package.json +8 -8
  64. package/src/entities/dlmm_program.ts +3 -3
  65. package/src/generated/instructions/acceptAdminAuthority.ts +68 -25
  66. package/src/generated/instructions/claimFee.ts +218 -83
  67. package/src/generated/instructions/claimProtocolFee.ts +346 -131
  68. package/src/generated/instructions/closePosition.ts +160 -61
  69. package/src/generated/instructions/createAdminConfig.ts +172 -63
  70. package/src/generated/instructions/createBinArray.ts +124 -51
  71. package/src/generated/instructions/createPool.ts +354 -133
  72. package/src/generated/instructions/deleteBinArray.ts +172 -63
  73. package/src/generated/instructions/depositByWeight.ts +218 -83
  74. package/src/generated/instructions/openPosition.ts +300 -117
  75. package/src/generated/instructions/resetAdminAuthority.ts +138 -51
  76. package/src/generated/instructions/setMetadataUpdateAuthority.ts +74 -27
  77. package/src/generated/instructions/setPoolDynamicFeeConfig.ts +98 -39
  78. package/src/generated/instructions/setPoolProtocolShare.ts +98 -39
  79. package/src/generated/instructions/swapExactIn.ts +155 -60
  80. package/src/generated/instructions/swapExactOut.ts +155 -60
  81. package/src/generated/instructions/syncPool.ts +37 -12
  82. package/src/generated/instructions/transferAdminAuthority.ts +74 -27
  83. 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 string = string,
162
- TAccountPool extends string = string,
163
- TAccountTokenMintX extends string = string,
164
- TAccountTokenMintY extends string = string,
165
- TAccountTokenUserAccountX extends string = string,
166
- TAccountTokenUserAccountY extends string = string,
167
- TAccountTokenVaultX extends string = string,
168
- TAccountTokenVaultY extends string = string,
169
- TAccountTokenProgramX extends string = string,
170
- TAccountTokenProgramY extends string = string,
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: TransactionSigner<TAccountUser>;
173
- pool: Address<TAccountPool>;
174
- tokenMintX: Address<TAccountTokenMintX>;
175
- tokenMintY: Address<TAccountTokenMintY>;
176
- tokenUserAccountX: Address<TAccountTokenUserAccountX>;
177
- tokenUserAccountY: Address<TAccountTokenUserAccountY>;
178
- tokenVaultX: Address<TAccountTokenVaultX>;
179
- tokenVaultY: Address<TAccountTokenVaultY>;
180
- tokenProgramX: Address<TAccountTokenProgramX>;
181
- tokenProgramY: Address<TAccountTokenProgramY>;
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 string,
190
- TAccountPool extends string,
191
- TAccountTokenMintX extends string,
192
- TAccountTokenMintY extends string,
193
- TAccountTokenUserAccountX extends string,
194
- TAccountTokenUserAccountY extends string,
195
- TAccountTokenVaultX extends string,
196
- TAccountTokenVaultY extends string,
197
- TAccountTokenProgramX extends string,
198
- TAccountTokenProgramY extends string,
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
- TAccountUser,
217
- TAccountPool,
218
- TAccountTokenMintX,
219
- TAccountTokenMintY,
220
- TAccountTokenUserAccountX,
221
- TAccountTokenUserAccountY,
222
- TAccountTokenVaultX,
223
- TAccountTokenVaultY,
224
- TAccountTokenProgramX,
225
- TAccountTokenProgramY
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: { value: input.tokenMintX ?? null, isWritable: false },
235
- tokenMintY: { value: input.tokenMintY ?? null, isWritable: false },
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
- tokenVaultX: { value: input.tokenVaultX ?? null, isWritable: true },
245
- tokenVaultY: { value: input.tokenVaultY ?? null, isWritable: true },
246
- tokenProgramX: { value: input.tokenProgramX ?? null, isWritable: false },
247
- tokenProgramY: { value: input.tokenProgramY ?? null, isWritable: false },
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
- TAccountUser,
278
- TAccountPool,
279
- TAccountTokenMintX,
280
- TAccountTokenMintY,
281
- TAccountTokenUserAccountX,
282
- TAccountTokenUserAccountY,
283
- TAccountTokenVaultX,
284
- TAccountTokenVaultY,
285
- TAccountTokenProgramX,
286
- TAccountTokenProgramY
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 string = string,
117
- TAccountPool extends string = string,
119
+ TAccountUser extends InstructionSignerInput = InstructionSignerInput,
120
+ TAccountPool extends InstructionAccountInput = InstructionAccountInput,
118
121
  > = {
119
- user: TransactionSigner<TAccountUser>;
120
- pool: Address<TAccountPool>;
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 string,
127
- TAccountPool extends string,
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<TProgramAddress, TAccountUser, TAccountPool> {
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<TProgramAddress, TAccountUser, TAccountPool>);
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 string = string,
113
- TAccountAdminConfig extends string = string,
115
+ TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
116
+ TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
114
117
  > = {
115
- authority: TransactionSigner<TAccountAuthority>;
116
- adminConfig?: Address<TAccountAdminConfig>;
118
+ authority: TAccountAuthority;
119
+ adminConfig?: TAccountAdminConfig;
117
120
  newAuthority: TransferAdminAuthorityInstructionDataArgs["newAuthority"];
118
121
  };
119
122
 
120
123
  export async function getTransferAdminAuthorityInstructionAsync<
121
- TAccountAuthority extends string,
122
- TAccountAdminConfig extends string,
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
- TAccountAuthority,
134
- TAccountAdminConfig
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: { value: input.authority ?? null, isWritable: false },
143
- adminConfig: { value: input.adminConfig ?? null, isWritable: true },
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
- TAccountAuthority,
171
- TAccountAdminConfig
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 string = string,
177
- TAccountAdminConfig extends string = string,
201
+ TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
202
+ TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
178
203
  > = {
179
- authority: TransactionSigner<TAccountAuthority>;
180
- adminConfig: Address<TAccountAdminConfig>;
204
+ authority: TAccountAuthority;
205
+ adminConfig: TAccountAdminConfig;
181
206
  newAuthority: TransferAdminAuthorityInstructionDataArgs["newAuthority"];
182
207
  };
183
208
 
184
209
  export function getTransferAdminAuthorityInstruction<
185
- TAccountAuthority extends string,
186
- TAccountAdminConfig extends string,
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
- TAccountAuthority,
194
- TAccountAdminConfig
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: { value: input.authority ?? null, isWritable: false },
202
- adminConfig: { value: input.adminConfig ?? null, isWritable: true },
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
- TAccountAuthority,
225
- TAccountAdminConfig
265
+ ResolvedInstructionAccountMeta<
266
+ TAccountAuthority,
267
+ InstructionAccountInputAddress<TAccountAuthority>
268
+ >,
269
+ ResolvedInstructionAccountMeta<
270
+ TAccountAdminConfig,
271
+ InstructionAccountInputAddress<TAccountAdminConfig>
272
+ >
226
273
  >);
227
274
  }
228
275