@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
@@ -31,12 +31,15 @@ import {
31
31
  type ReadonlyAccount,
32
32
  type ReadonlySignerAccount,
33
33
  type ReadonlyUint8Array,
34
- type TransactionSigner,
35
34
  type WritableAccount,
36
35
  } from "@solana/kit";
37
36
  import {
38
37
  getAccountMetaFactory,
38
+ type InstructionAccountInput,
39
+ type InstructionAccountInputAddress,
40
+ type InstructionSignerInput,
39
41
  type ResolvedInstructionAccount,
42
+ type ResolvedInstructionAccountMeta,
40
43
  } from "@solana/program-client-core";
41
44
  import { findAdminConfigPda } from "../pdas/index.js";
42
45
  import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
@@ -112,20 +115,20 @@ export function getSetPoolProtocolShareInstructionDataCodec(): FixedSizeCodec<
112
115
  }
113
116
 
114
117
  export type SetPoolProtocolShareAsyncInput<
115
- TAccountAuthority extends string = string,
116
- TAccountAdminConfig extends string = string,
117
- TAccountPool extends string = string,
118
+ TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
119
+ TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
120
+ TAccountPool extends InstructionAccountInput = InstructionAccountInput,
118
121
  > = {
119
- authority: TransactionSigner<TAccountAuthority>;
120
- adminConfig?: Address<TAccountAdminConfig>;
121
- pool: Address<TAccountPool>;
122
+ authority: TAccountAuthority;
123
+ adminConfig?: TAccountAdminConfig;
124
+ pool: TAccountPool;
122
125
  protocolShare: SetPoolProtocolShareInstructionDataArgs["protocolShare"];
123
126
  };
124
127
 
125
128
  export async function getSetPoolProtocolShareInstructionAsync<
126
- TAccountAuthority extends string,
127
- TAccountAdminConfig extends string,
128
- TAccountPool extends string,
129
+ TAccountAuthority extends InstructionSignerInput,
130
+ TAccountAdminConfig extends InstructionAccountInput,
131
+ TAccountPool extends InstructionAccountInput,
129
132
  TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
130
133
  >(
131
134
  input: SetPoolProtocolShareAsyncInput<
@@ -137,19 +140,39 @@ export async function getSetPoolProtocolShareInstructionAsync<
137
140
  ): Promise<
138
141
  SetPoolProtocolShareInstruction<
139
142
  TProgramAddress,
140
- TAccountAuthority,
141
- TAccountAdminConfig,
142
- TAccountPool
143
+ ResolvedInstructionAccountMeta<
144
+ TAccountAuthority,
145
+ InstructionAccountInputAddress<TAccountAuthority>
146
+ >,
147
+ ResolvedInstructionAccountMeta<
148
+ TAccountAdminConfig,
149
+ InstructionAccountInputAddress<TAccountAdminConfig>
150
+ >,
151
+ ResolvedInstructionAccountMeta<
152
+ TAccountPool,
153
+ InstructionAccountInputAddress<TAccountPool>
154
+ >
143
155
  >
144
156
  > {
145
157
  // Program address.
146
158
  const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
147
159
 
160
+ // Account meta helper.
161
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
162
+
148
163
  // Original accounts.
149
164
  const originalAccounts = {
150
- authority: { value: input.authority ?? null, isWritable: false },
151
- adminConfig: { value: input.adminConfig ?? null, isWritable: false },
152
- pool: { value: input.pool ?? null, isWritable: true },
165
+ authority: {
166
+ value: input.authority ?? null,
167
+ isSigner: true,
168
+ isWritable: false,
169
+ },
170
+ adminConfig: {
171
+ value: input.adminConfig ?? null,
172
+ isSigner: false,
173
+ isWritable: false,
174
+ },
175
+ pool: { value: input.pool ?? null, isSigner: false, isWritable: true },
153
176
  };
154
177
  const accounts = originalAccounts as Record<
155
178
  keyof typeof originalAccounts,
@@ -164,7 +187,6 @@ export async function getSetPoolProtocolShareInstructionAsync<
164
187
  accounts.adminConfig.value = await findAdminConfigPda({ programAddress });
165
188
  }
166
189
 
167
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
168
190
  return Object.freeze({
169
191
  accounts: [
170
192
  getAccountMeta("authority", accounts.authority),
@@ -177,27 +199,36 @@ export async function getSetPoolProtocolShareInstructionAsync<
177
199
  programAddress,
178
200
  } as SetPoolProtocolShareInstruction<
179
201
  TProgramAddress,
180
- TAccountAuthority,
181
- TAccountAdminConfig,
182
- TAccountPool
202
+ ResolvedInstructionAccountMeta<
203
+ TAccountAuthority,
204
+ InstructionAccountInputAddress<TAccountAuthority>
205
+ >,
206
+ ResolvedInstructionAccountMeta<
207
+ TAccountAdminConfig,
208
+ InstructionAccountInputAddress<TAccountAdminConfig>
209
+ >,
210
+ ResolvedInstructionAccountMeta<
211
+ TAccountPool,
212
+ InstructionAccountInputAddress<TAccountPool>
213
+ >
183
214
  >);
184
215
  }
185
216
 
186
217
  export type SetPoolProtocolShareInput<
187
- TAccountAuthority extends string = string,
188
- TAccountAdminConfig extends string = string,
189
- TAccountPool extends string = string,
218
+ TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
219
+ TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
220
+ TAccountPool extends InstructionAccountInput = InstructionAccountInput,
190
221
  > = {
191
- authority: TransactionSigner<TAccountAuthority>;
192
- adminConfig: Address<TAccountAdminConfig>;
193
- pool: Address<TAccountPool>;
222
+ authority: TAccountAuthority;
223
+ adminConfig: TAccountAdminConfig;
224
+ pool: TAccountPool;
194
225
  protocolShare: SetPoolProtocolShareInstructionDataArgs["protocolShare"];
195
226
  };
196
227
 
197
228
  export function getSetPoolProtocolShareInstruction<
198
- TAccountAuthority extends string,
199
- TAccountAdminConfig extends string,
200
- TAccountPool extends string,
229
+ TAccountAuthority extends InstructionSignerInput,
230
+ TAccountAdminConfig extends InstructionAccountInput,
231
+ TAccountPool extends InstructionAccountInput,
201
232
  TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
202
233
  >(
203
234
  input: SetPoolProtocolShareInput<
@@ -208,18 +239,38 @@ export function getSetPoolProtocolShareInstruction<
208
239
  config?: { programAddress?: TProgramAddress },
209
240
  ): SetPoolProtocolShareInstruction<
210
241
  TProgramAddress,
211
- TAccountAuthority,
212
- TAccountAdminConfig,
213
- TAccountPool
242
+ ResolvedInstructionAccountMeta<
243
+ TAccountAuthority,
244
+ InstructionAccountInputAddress<TAccountAuthority>
245
+ >,
246
+ ResolvedInstructionAccountMeta<
247
+ TAccountAdminConfig,
248
+ InstructionAccountInputAddress<TAccountAdminConfig>
249
+ >,
250
+ ResolvedInstructionAccountMeta<
251
+ TAccountPool,
252
+ InstructionAccountInputAddress<TAccountPool>
253
+ >
214
254
  > {
215
255
  // Program address.
216
256
  const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
217
257
 
258
+ // Account meta helper.
259
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
260
+
218
261
  // Original accounts.
219
262
  const originalAccounts = {
220
- authority: { value: input.authority ?? null, isWritable: false },
221
- adminConfig: { value: input.adminConfig ?? null, isWritable: false },
222
- pool: { value: input.pool ?? null, isWritable: true },
263
+ authority: {
264
+ value: input.authority ?? null,
265
+ isSigner: true,
266
+ isWritable: false,
267
+ },
268
+ adminConfig: {
269
+ value: input.adminConfig ?? null,
270
+ isSigner: false,
271
+ isWritable: false,
272
+ },
273
+ pool: { value: input.pool ?? null, isSigner: false, isWritable: true },
223
274
  };
224
275
  const accounts = originalAccounts as Record<
225
276
  keyof typeof originalAccounts,
@@ -229,7 +280,6 @@ export function getSetPoolProtocolShareInstruction<
229
280
  // Original args.
230
281
  const args = { ...input };
231
282
 
232
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
233
283
  return Object.freeze({
234
284
  accounts: [
235
285
  getAccountMeta("authority", accounts.authority),
@@ -242,9 +292,18 @@ export function getSetPoolProtocolShareInstruction<
242
292
  programAddress,
243
293
  } as SetPoolProtocolShareInstruction<
244
294
  TProgramAddress,
245
- TAccountAuthority,
246
- TAccountAdminConfig,
247
- TAccountPool
295
+ ResolvedInstructionAccountMeta<
296
+ TAccountAuthority,
297
+ InstructionAccountInputAddress<TAccountAuthority>
298
+ >,
299
+ ResolvedInstructionAccountMeta<
300
+ TAccountAdminConfig,
301
+ InstructionAccountInputAddress<TAccountAdminConfig>
302
+ >,
303
+ ResolvedInstructionAccountMeta<
304
+ TAccountPool,
305
+ InstructionAccountInputAddress<TAccountPool>
306
+ >
248
307
  >);
249
308
  }
250
309
 
@@ -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 getSwapExactInInstructionDataCodec(): Codec<
158
161
  }
159
162
 
160
163
  export type SwapExactInInput<
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
  amountIn: SwapExactInInstructionDataArgs["amountIn"];
183
190
  minAmountOut: SwapExactInInstructionDataArgs["minAmountOut"];
184
191
  xToY: SwapExactInInstructionDataArgs["xToY"];
@@ -186,16 +193,16 @@ export type SwapExactInInput<
186
193
  };
187
194
 
188
195
  export function getSwapExactInInstruction<
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: SwapExactInInput<
@@ -213,38 +220,97 @@ export function getSwapExactInInstruction<
213
220
  config?: { programAddress?: TProgramAddress },
214
221
  ): SwapExactInInstruction<
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 getSwapExactInInstruction<
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 getSwapExactInInstruction<
274
339
  programAddress,
275
340
  } as SwapExactInInstruction<
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