@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
|
@@ -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
|
|
116
|
-
TAccountAdminConfig extends
|
|
117
|
-
TAccountPool extends
|
|
118
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
119
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
120
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
118
121
|
> = {
|
|
119
|
-
authority:
|
|
120
|
-
adminConfig?:
|
|
121
|
-
pool:
|
|
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
|
|
127
|
-
TAccountAdminConfig extends
|
|
128
|
-
TAccountPool extends
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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: {
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
|
188
|
-
TAccountAdminConfig extends
|
|
189
|
-
TAccountPool extends
|
|
218
|
+
TAccountAuthority extends InstructionSignerInput = InstructionSignerInput,
|
|
219
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
220
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
190
221
|
> = {
|
|
191
|
-
authority:
|
|
192
|
-
adminConfig:
|
|
193
|
-
pool:
|
|
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
|
|
199
|
-
TAccountAdminConfig extends
|
|
200
|
-
TAccountPool extends
|
|
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
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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: {
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
|
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
|
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
|
|
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: SwapExactInInput<
|
|
@@ -213,38 +220,97 @@ export function getSwapExactInInstruction<
|
|
|
213
220
|
config?: { programAddress?: TProgramAddress },
|
|
214
221
|
): SwapExactInInstruction<
|
|
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 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
|
-
|
|
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
|
|