@picon-finance/dlmm-sdk 2.0.3 → 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/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 +5 -5
- 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,12 +28,15 @@ import {
|
|
|
28
28
|
type InstructionWithData,
|
|
29
29
|
type ReadonlySignerAccount,
|
|
30
30
|
type ReadonlyUint8Array,
|
|
31
|
-
type TransactionSigner,
|
|
32
31
|
type WritableAccount,
|
|
33
32
|
} from "@solana/kit";
|
|
34
33
|
import {
|
|
35
34
|
getAccountMetaFactory,
|
|
35
|
+
type InstructionAccountInput,
|
|
36
|
+
type InstructionAccountInputAddress,
|
|
37
|
+
type InstructionSignerInput,
|
|
36
38
|
type ResolvedInstructionAccount,
|
|
39
|
+
type ResolvedInstructionAccountMeta,
|
|
37
40
|
} from "@solana/program-client-core";
|
|
38
41
|
import { findAdminConfigPda } from "../pdas/index.js";
|
|
39
42
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
@@ -100,16 +103,17 @@ export function getAcceptAdminAuthorityInstructionDataCodec(): FixedSizeCodec<
|
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
export type AcceptAdminAuthorityAsyncInput<
|
|
103
|
-
TAccountPendingAuthority extends
|
|
104
|
-
|
|
106
|
+
TAccountPendingAuthority extends InstructionSignerInput =
|
|
107
|
+
InstructionSignerInput,
|
|
108
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
105
109
|
> = {
|
|
106
|
-
pendingAuthority:
|
|
107
|
-
adminConfig?:
|
|
110
|
+
pendingAuthority: TAccountPendingAuthority;
|
|
111
|
+
adminConfig?: TAccountAdminConfig;
|
|
108
112
|
};
|
|
109
113
|
|
|
110
114
|
export async function getAcceptAdminAuthorityInstructionAsync<
|
|
111
|
-
TAccountPendingAuthority extends
|
|
112
|
-
TAccountAdminConfig extends
|
|
115
|
+
TAccountPendingAuthority extends InstructionSignerInput,
|
|
116
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
113
117
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
114
118
|
>(
|
|
115
119
|
input: AcceptAdminAuthorityAsyncInput<
|
|
@@ -120,20 +124,34 @@ export async function getAcceptAdminAuthorityInstructionAsync<
|
|
|
120
124
|
): Promise<
|
|
121
125
|
AcceptAdminAuthorityInstruction<
|
|
122
126
|
TProgramAddress,
|
|
123
|
-
|
|
124
|
-
|
|
127
|
+
ResolvedInstructionAccountMeta<
|
|
128
|
+
TAccountPendingAuthority,
|
|
129
|
+
InstructionAccountInputAddress<TAccountPendingAuthority>
|
|
130
|
+
>,
|
|
131
|
+
ResolvedInstructionAccountMeta<
|
|
132
|
+
TAccountAdminConfig,
|
|
133
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
134
|
+
>
|
|
125
135
|
>
|
|
126
136
|
> {
|
|
127
137
|
// Program address.
|
|
128
138
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
129
139
|
|
|
140
|
+
// Account meta helper.
|
|
141
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
142
|
+
|
|
130
143
|
// Original accounts.
|
|
131
144
|
const originalAccounts = {
|
|
132
145
|
pendingAuthority: {
|
|
133
146
|
value: input.pendingAuthority ?? null,
|
|
147
|
+
isSigner: true,
|
|
134
148
|
isWritable: false,
|
|
135
149
|
},
|
|
136
|
-
adminConfig: {
|
|
150
|
+
adminConfig: {
|
|
151
|
+
value: input.adminConfig ?? null,
|
|
152
|
+
isSigner: false,
|
|
153
|
+
isWritable: true,
|
|
154
|
+
},
|
|
137
155
|
};
|
|
138
156
|
const accounts = originalAccounts as Record<
|
|
139
157
|
keyof typeof originalAccounts,
|
|
@@ -145,7 +163,6 @@ export async function getAcceptAdminAuthorityInstructionAsync<
|
|
|
145
163
|
accounts.adminConfig.value = await findAdminConfigPda({ programAddress });
|
|
146
164
|
}
|
|
147
165
|
|
|
148
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
149
166
|
return Object.freeze({
|
|
150
167
|
accounts: [
|
|
151
168
|
getAccountMeta("pendingAuthority", accounts.pendingAuthority),
|
|
@@ -155,22 +172,29 @@ export async function getAcceptAdminAuthorityInstructionAsync<
|
|
|
155
172
|
programAddress,
|
|
156
173
|
} as AcceptAdminAuthorityInstruction<
|
|
157
174
|
TProgramAddress,
|
|
158
|
-
|
|
159
|
-
|
|
175
|
+
ResolvedInstructionAccountMeta<
|
|
176
|
+
TAccountPendingAuthority,
|
|
177
|
+
InstructionAccountInputAddress<TAccountPendingAuthority>
|
|
178
|
+
>,
|
|
179
|
+
ResolvedInstructionAccountMeta<
|
|
180
|
+
TAccountAdminConfig,
|
|
181
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
182
|
+
>
|
|
160
183
|
>);
|
|
161
184
|
}
|
|
162
185
|
|
|
163
186
|
export type AcceptAdminAuthorityInput<
|
|
164
|
-
TAccountPendingAuthority extends
|
|
165
|
-
|
|
187
|
+
TAccountPendingAuthority extends InstructionSignerInput =
|
|
188
|
+
InstructionSignerInput,
|
|
189
|
+
TAccountAdminConfig extends InstructionAccountInput = InstructionAccountInput,
|
|
166
190
|
> = {
|
|
167
|
-
pendingAuthority:
|
|
168
|
-
adminConfig:
|
|
191
|
+
pendingAuthority: TAccountPendingAuthority;
|
|
192
|
+
adminConfig: TAccountAdminConfig;
|
|
169
193
|
};
|
|
170
194
|
|
|
171
195
|
export function getAcceptAdminAuthorityInstruction<
|
|
172
|
-
TAccountPendingAuthority extends
|
|
173
|
-
TAccountAdminConfig extends
|
|
196
|
+
TAccountPendingAuthority extends InstructionSignerInput,
|
|
197
|
+
TAccountAdminConfig extends InstructionAccountInput,
|
|
174
198
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
175
199
|
>(
|
|
176
200
|
input: AcceptAdminAuthorityInput<
|
|
@@ -180,26 +204,39 @@ export function getAcceptAdminAuthorityInstruction<
|
|
|
180
204
|
config?: { programAddress?: TProgramAddress },
|
|
181
205
|
): AcceptAdminAuthorityInstruction<
|
|
182
206
|
TProgramAddress,
|
|
183
|
-
|
|
184
|
-
|
|
207
|
+
ResolvedInstructionAccountMeta<
|
|
208
|
+
TAccountPendingAuthority,
|
|
209
|
+
InstructionAccountInputAddress<TAccountPendingAuthority>
|
|
210
|
+
>,
|
|
211
|
+
ResolvedInstructionAccountMeta<
|
|
212
|
+
TAccountAdminConfig,
|
|
213
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
214
|
+
>
|
|
185
215
|
> {
|
|
186
216
|
// Program address.
|
|
187
217
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
188
218
|
|
|
219
|
+
// Account meta helper.
|
|
220
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
221
|
+
|
|
189
222
|
// Original accounts.
|
|
190
223
|
const originalAccounts = {
|
|
191
224
|
pendingAuthority: {
|
|
192
225
|
value: input.pendingAuthority ?? null,
|
|
226
|
+
isSigner: true,
|
|
193
227
|
isWritable: false,
|
|
194
228
|
},
|
|
195
|
-
adminConfig: {
|
|
229
|
+
adminConfig: {
|
|
230
|
+
value: input.adminConfig ?? null,
|
|
231
|
+
isSigner: false,
|
|
232
|
+
isWritable: true,
|
|
233
|
+
},
|
|
196
234
|
};
|
|
197
235
|
const accounts = originalAccounts as Record<
|
|
198
236
|
keyof typeof originalAccounts,
|
|
199
237
|
ResolvedInstructionAccount
|
|
200
238
|
>;
|
|
201
239
|
|
|
202
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
203
240
|
return Object.freeze({
|
|
204
241
|
accounts: [
|
|
205
242
|
getAccountMeta("pendingAuthority", accounts.pendingAuthority),
|
|
@@ -209,8 +246,14 @@ export function getAcceptAdminAuthorityInstruction<
|
|
|
209
246
|
programAddress,
|
|
210
247
|
} as AcceptAdminAuthorityInstruction<
|
|
211
248
|
TProgramAddress,
|
|
212
|
-
|
|
213
|
-
|
|
249
|
+
ResolvedInstructionAccountMeta<
|
|
250
|
+
TAccountPendingAuthority,
|
|
251
|
+
InstructionAccountInputAddress<TAccountPendingAuthority>
|
|
252
|
+
>,
|
|
253
|
+
ResolvedInstructionAccountMeta<
|
|
254
|
+
TAccountAdminConfig,
|
|
255
|
+
InstructionAccountInputAddress<TAccountAdminConfig>
|
|
256
|
+
>
|
|
214
257
|
>);
|
|
215
258
|
}
|
|
216
259
|
|
|
@@ -35,12 +35,15 @@ import {
|
|
|
35
35
|
type ReadonlyAccount,
|
|
36
36
|
type ReadonlySignerAccount,
|
|
37
37
|
type ReadonlyUint8Array,
|
|
38
|
-
type TransactionSigner,
|
|
39
38
|
type WritableAccount,
|
|
40
39
|
} from "@solana/kit";
|
|
41
40
|
import {
|
|
42
41
|
getAccountMetaFactory,
|
|
42
|
+
type InstructionAccountInput,
|
|
43
|
+
type InstructionAccountInputAddress,
|
|
44
|
+
type InstructionSignerInput,
|
|
43
45
|
type ResolvedInstructionAccount,
|
|
46
|
+
type ResolvedInstructionAccountMeta,
|
|
44
47
|
} from "@solana/program-client-core";
|
|
45
48
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
46
49
|
import {
|
|
@@ -177,55 +180,62 @@ export function getClaimFeeInstructionDataCodec(): Codec<
|
|
|
177
180
|
}
|
|
178
181
|
|
|
179
182
|
export type ClaimFeeInput<
|
|
180
|
-
TAccountOwner extends
|
|
181
|
-
TAccountPool extends
|
|
182
|
-
TAccountPosition extends
|
|
183
|
-
TAccountPositionTokenAccount extends
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
183
|
+
TAccountOwner extends InstructionSignerInput = InstructionSignerInput,
|
|
184
|
+
TAccountPool extends InstructionAccountInput = InstructionAccountInput,
|
|
185
|
+
TAccountPosition extends InstructionAccountInput = InstructionAccountInput,
|
|
186
|
+
TAccountPositionTokenAccount extends InstructionAccountInput =
|
|
187
|
+
InstructionAccountInput,
|
|
188
|
+
TAccountTokenMintX extends InstructionAccountInput = InstructionAccountInput,
|
|
189
|
+
TAccountTokenMintY extends InstructionAccountInput = InstructionAccountInput,
|
|
190
|
+
TAccountTokenOwnerAccountX extends InstructionAccountInput =
|
|
191
|
+
InstructionAccountInput,
|
|
192
|
+
TAccountTokenOwnerAccountY extends InstructionAccountInput =
|
|
193
|
+
InstructionAccountInput,
|
|
194
|
+
TAccountTokenVaultX extends InstructionAccountInput = InstructionAccountInput,
|
|
195
|
+
TAccountTokenVaultY extends InstructionAccountInput = InstructionAccountInput,
|
|
196
|
+
TAccountTokenProgramX extends InstructionAccountInput =
|
|
197
|
+
InstructionAccountInput,
|
|
198
|
+
TAccountTokenProgramY extends InstructionAccountInput =
|
|
199
|
+
InstructionAccountInput,
|
|
200
|
+
TAccountLowerBinArray extends InstructionAccountInput =
|
|
201
|
+
InstructionAccountInput,
|
|
202
|
+
TAccountUpperBinArray extends InstructionAccountInput =
|
|
203
|
+
InstructionAccountInput,
|
|
194
204
|
> = {
|
|
195
|
-
owner:
|
|
196
|
-
pool:
|
|
197
|
-
position:
|
|
198
|
-
positionTokenAccount:
|
|
199
|
-
tokenMintX:
|
|
200
|
-
tokenMintY:
|
|
201
|
-
tokenOwnerAccountX:
|
|
202
|
-
tokenOwnerAccountY:
|
|
203
|
-
tokenVaultX:
|
|
204
|
-
tokenVaultY:
|
|
205
|
-
tokenProgramX:
|
|
206
|
-
tokenProgramY:
|
|
207
|
-
lowerBinArray:
|
|
208
|
-
upperBinArray?:
|
|
205
|
+
owner: TAccountOwner;
|
|
206
|
+
pool: TAccountPool;
|
|
207
|
+
position: TAccountPosition;
|
|
208
|
+
positionTokenAccount: TAccountPositionTokenAccount;
|
|
209
|
+
tokenMintX: TAccountTokenMintX;
|
|
210
|
+
tokenMintY: TAccountTokenMintY;
|
|
211
|
+
tokenOwnerAccountX: TAccountTokenOwnerAccountX;
|
|
212
|
+
tokenOwnerAccountY: TAccountTokenOwnerAccountY;
|
|
213
|
+
tokenVaultX: TAccountTokenVaultX;
|
|
214
|
+
tokenVaultY: TAccountTokenVaultY;
|
|
215
|
+
tokenProgramX: TAccountTokenProgramX;
|
|
216
|
+
tokenProgramY: TAccountTokenProgramY;
|
|
217
|
+
lowerBinArray: TAccountLowerBinArray;
|
|
218
|
+
upperBinArray?: TAccountUpperBinArray;
|
|
209
219
|
lowerBinId: ClaimFeeInstructionDataArgs["lowerBinId"];
|
|
210
220
|
upperBinId: ClaimFeeInstructionDataArgs["upperBinId"];
|
|
211
221
|
remainingAccountsScheme: ClaimFeeInstructionDataArgs["remainingAccountsScheme"];
|
|
212
222
|
};
|
|
213
223
|
|
|
214
224
|
export function getClaimFeeInstruction<
|
|
215
|
-
TAccountOwner extends
|
|
216
|
-
TAccountPool extends
|
|
217
|
-
TAccountPosition extends
|
|
218
|
-
TAccountPositionTokenAccount extends
|
|
219
|
-
TAccountTokenMintX extends
|
|
220
|
-
TAccountTokenMintY extends
|
|
221
|
-
TAccountTokenOwnerAccountX extends
|
|
222
|
-
TAccountTokenOwnerAccountY extends
|
|
223
|
-
TAccountTokenVaultX extends
|
|
224
|
-
TAccountTokenVaultY extends
|
|
225
|
-
TAccountTokenProgramX extends
|
|
226
|
-
TAccountTokenProgramY extends
|
|
227
|
-
TAccountLowerBinArray extends
|
|
228
|
-
TAccountUpperBinArray extends
|
|
225
|
+
TAccountOwner extends InstructionSignerInput,
|
|
226
|
+
TAccountPool extends InstructionAccountInput,
|
|
227
|
+
TAccountPosition extends InstructionAccountInput,
|
|
228
|
+
TAccountPositionTokenAccount extends InstructionAccountInput,
|
|
229
|
+
TAccountTokenMintX extends InstructionAccountInput,
|
|
230
|
+
TAccountTokenMintY extends InstructionAccountInput,
|
|
231
|
+
TAccountTokenOwnerAccountX extends InstructionAccountInput,
|
|
232
|
+
TAccountTokenOwnerAccountY extends InstructionAccountInput,
|
|
233
|
+
TAccountTokenVaultX extends InstructionAccountInput,
|
|
234
|
+
TAccountTokenVaultY extends InstructionAccountInput,
|
|
235
|
+
TAccountTokenProgramX extends InstructionAccountInput,
|
|
236
|
+
TAccountTokenProgramY extends InstructionAccountInput,
|
|
237
|
+
TAccountLowerBinArray extends InstructionAccountInput,
|
|
238
|
+
TAccountUpperBinArray extends InstructionAccountInput,
|
|
229
239
|
TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
|
|
230
240
|
>(
|
|
231
241
|
input: ClaimFeeInput<
|
|
@@ -247,49 +257,133 @@ export function getClaimFeeInstruction<
|
|
|
247
257
|
config?: { programAddress?: TProgramAddress },
|
|
248
258
|
): ClaimFeeInstruction<
|
|
249
259
|
TProgramAddress,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
ResolvedInstructionAccountMeta<
|
|
261
|
+
TAccountOwner,
|
|
262
|
+
InstructionAccountInputAddress<TAccountOwner>
|
|
263
|
+
>,
|
|
264
|
+
ResolvedInstructionAccountMeta<
|
|
265
|
+
TAccountPool,
|
|
266
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
267
|
+
>,
|
|
268
|
+
ResolvedInstructionAccountMeta<
|
|
269
|
+
TAccountPosition,
|
|
270
|
+
InstructionAccountInputAddress<TAccountPosition>
|
|
271
|
+
>,
|
|
272
|
+
ResolvedInstructionAccountMeta<
|
|
273
|
+
TAccountPositionTokenAccount,
|
|
274
|
+
InstructionAccountInputAddress<TAccountPositionTokenAccount>
|
|
275
|
+
>,
|
|
276
|
+
ResolvedInstructionAccountMeta<
|
|
277
|
+
TAccountTokenMintX,
|
|
278
|
+
InstructionAccountInputAddress<TAccountTokenMintX>
|
|
279
|
+
>,
|
|
280
|
+
ResolvedInstructionAccountMeta<
|
|
281
|
+
TAccountTokenMintY,
|
|
282
|
+
InstructionAccountInputAddress<TAccountTokenMintY>
|
|
283
|
+
>,
|
|
284
|
+
ResolvedInstructionAccountMeta<
|
|
285
|
+
TAccountTokenOwnerAccountX,
|
|
286
|
+
InstructionAccountInputAddress<TAccountTokenOwnerAccountX>
|
|
287
|
+
>,
|
|
288
|
+
ResolvedInstructionAccountMeta<
|
|
289
|
+
TAccountTokenOwnerAccountY,
|
|
290
|
+
InstructionAccountInputAddress<TAccountTokenOwnerAccountY>
|
|
291
|
+
>,
|
|
292
|
+
ResolvedInstructionAccountMeta<
|
|
293
|
+
TAccountTokenVaultX,
|
|
294
|
+
InstructionAccountInputAddress<TAccountTokenVaultX>
|
|
295
|
+
>,
|
|
296
|
+
ResolvedInstructionAccountMeta<
|
|
297
|
+
TAccountTokenVaultY,
|
|
298
|
+
InstructionAccountInputAddress<TAccountTokenVaultY>
|
|
299
|
+
>,
|
|
300
|
+
ResolvedInstructionAccountMeta<
|
|
301
|
+
TAccountTokenProgramX,
|
|
302
|
+
InstructionAccountInputAddress<TAccountTokenProgramX>
|
|
303
|
+
>,
|
|
304
|
+
ResolvedInstructionAccountMeta<
|
|
305
|
+
TAccountTokenProgramY,
|
|
306
|
+
InstructionAccountInputAddress<TAccountTokenProgramY>
|
|
307
|
+
>,
|
|
308
|
+
ResolvedInstructionAccountMeta<
|
|
309
|
+
TAccountLowerBinArray,
|
|
310
|
+
InstructionAccountInputAddress<TAccountLowerBinArray>
|
|
311
|
+
>,
|
|
312
|
+
ResolvedInstructionAccountMeta<
|
|
313
|
+
TAccountUpperBinArray,
|
|
314
|
+
InstructionAccountInputAddress<TAccountUpperBinArray>
|
|
315
|
+
>
|
|
264
316
|
> {
|
|
265
317
|
// Program address.
|
|
266
318
|
const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
|
|
267
319
|
|
|
320
|
+
// Account meta helper.
|
|
321
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
322
|
+
|
|
268
323
|
// Original accounts.
|
|
269
324
|
const originalAccounts = {
|
|
270
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
271
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
272
|
-
position: {
|
|
325
|
+
owner: { value: input.owner ?? null, isSigner: true, isWritable: false },
|
|
326
|
+
pool: { value: input.pool ?? null, isSigner: false, isWritable: false },
|
|
327
|
+
position: {
|
|
328
|
+
value: input.position ?? null,
|
|
329
|
+
isSigner: false,
|
|
330
|
+
isWritable: true,
|
|
331
|
+
},
|
|
273
332
|
positionTokenAccount: {
|
|
274
333
|
value: input.positionTokenAccount ?? null,
|
|
334
|
+
isSigner: false,
|
|
335
|
+
isWritable: false,
|
|
336
|
+
},
|
|
337
|
+
tokenMintX: {
|
|
338
|
+
value: input.tokenMintX ?? null,
|
|
339
|
+
isSigner: false,
|
|
340
|
+
isWritable: false,
|
|
341
|
+
},
|
|
342
|
+
tokenMintY: {
|
|
343
|
+
value: input.tokenMintY ?? null,
|
|
344
|
+
isSigner: false,
|
|
275
345
|
isWritable: false,
|
|
276
346
|
},
|
|
277
|
-
tokenMintX: { value: input.tokenMintX ?? null, isWritable: false },
|
|
278
|
-
tokenMintY: { value: input.tokenMintY ?? null, isWritable: false },
|
|
279
347
|
tokenOwnerAccountX: {
|
|
280
348
|
value: input.tokenOwnerAccountX ?? null,
|
|
349
|
+
isSigner: false,
|
|
281
350
|
isWritable: true,
|
|
282
351
|
},
|
|
283
352
|
tokenOwnerAccountY: {
|
|
284
353
|
value: input.tokenOwnerAccountY ?? null,
|
|
354
|
+
isSigner: false,
|
|
355
|
+
isWritable: true,
|
|
356
|
+
},
|
|
357
|
+
tokenVaultX: {
|
|
358
|
+
value: input.tokenVaultX ?? null,
|
|
359
|
+
isSigner: false,
|
|
360
|
+
isWritable: true,
|
|
361
|
+
},
|
|
362
|
+
tokenVaultY: {
|
|
363
|
+
value: input.tokenVaultY ?? null,
|
|
364
|
+
isSigner: false,
|
|
285
365
|
isWritable: true,
|
|
286
366
|
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
367
|
+
tokenProgramX: {
|
|
368
|
+
value: input.tokenProgramX ?? null,
|
|
369
|
+
isSigner: false,
|
|
370
|
+
isWritable: false,
|
|
371
|
+
},
|
|
372
|
+
tokenProgramY: {
|
|
373
|
+
value: input.tokenProgramY ?? null,
|
|
374
|
+
isSigner: false,
|
|
375
|
+
isWritable: false,
|
|
376
|
+
},
|
|
377
|
+
lowerBinArray: {
|
|
378
|
+
value: input.lowerBinArray ?? null,
|
|
379
|
+
isSigner: false,
|
|
380
|
+
isWritable: false,
|
|
381
|
+
},
|
|
382
|
+
upperBinArray: {
|
|
383
|
+
value: input.upperBinArray ?? null,
|
|
384
|
+
isSigner: false,
|
|
385
|
+
isWritable: false,
|
|
386
|
+
},
|
|
293
387
|
};
|
|
294
388
|
const accounts = originalAccounts as Record<
|
|
295
389
|
keyof typeof originalAccounts,
|
|
@@ -299,7 +393,6 @@ export function getClaimFeeInstruction<
|
|
|
299
393
|
// Original args.
|
|
300
394
|
const args = { ...input };
|
|
301
395
|
|
|
302
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
303
396
|
return Object.freeze({
|
|
304
397
|
accounts: [
|
|
305
398
|
getAccountMeta("owner", accounts.owner),
|
|
@@ -323,20 +416,62 @@ export function getClaimFeeInstruction<
|
|
|
323
416
|
programAddress,
|
|
324
417
|
} as ClaimFeeInstruction<
|
|
325
418
|
TProgramAddress,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
419
|
+
ResolvedInstructionAccountMeta<
|
|
420
|
+
TAccountOwner,
|
|
421
|
+
InstructionAccountInputAddress<TAccountOwner>
|
|
422
|
+
>,
|
|
423
|
+
ResolvedInstructionAccountMeta<
|
|
424
|
+
TAccountPool,
|
|
425
|
+
InstructionAccountInputAddress<TAccountPool>
|
|
426
|
+
>,
|
|
427
|
+
ResolvedInstructionAccountMeta<
|
|
428
|
+
TAccountPosition,
|
|
429
|
+
InstructionAccountInputAddress<TAccountPosition>
|
|
430
|
+
>,
|
|
431
|
+
ResolvedInstructionAccountMeta<
|
|
432
|
+
TAccountPositionTokenAccount,
|
|
433
|
+
InstructionAccountInputAddress<TAccountPositionTokenAccount>
|
|
434
|
+
>,
|
|
435
|
+
ResolvedInstructionAccountMeta<
|
|
436
|
+
TAccountTokenMintX,
|
|
437
|
+
InstructionAccountInputAddress<TAccountTokenMintX>
|
|
438
|
+
>,
|
|
439
|
+
ResolvedInstructionAccountMeta<
|
|
440
|
+
TAccountTokenMintY,
|
|
441
|
+
InstructionAccountInputAddress<TAccountTokenMintY>
|
|
442
|
+
>,
|
|
443
|
+
ResolvedInstructionAccountMeta<
|
|
444
|
+
TAccountTokenOwnerAccountX,
|
|
445
|
+
InstructionAccountInputAddress<TAccountTokenOwnerAccountX>
|
|
446
|
+
>,
|
|
447
|
+
ResolvedInstructionAccountMeta<
|
|
448
|
+
TAccountTokenOwnerAccountY,
|
|
449
|
+
InstructionAccountInputAddress<TAccountTokenOwnerAccountY>
|
|
450
|
+
>,
|
|
451
|
+
ResolvedInstructionAccountMeta<
|
|
452
|
+
TAccountTokenVaultX,
|
|
453
|
+
InstructionAccountInputAddress<TAccountTokenVaultX>
|
|
454
|
+
>,
|
|
455
|
+
ResolvedInstructionAccountMeta<
|
|
456
|
+
TAccountTokenVaultY,
|
|
457
|
+
InstructionAccountInputAddress<TAccountTokenVaultY>
|
|
458
|
+
>,
|
|
459
|
+
ResolvedInstructionAccountMeta<
|
|
460
|
+
TAccountTokenProgramX,
|
|
461
|
+
InstructionAccountInputAddress<TAccountTokenProgramX>
|
|
462
|
+
>,
|
|
463
|
+
ResolvedInstructionAccountMeta<
|
|
464
|
+
TAccountTokenProgramY,
|
|
465
|
+
InstructionAccountInputAddress<TAccountTokenProgramY>
|
|
466
|
+
>,
|
|
467
|
+
ResolvedInstructionAccountMeta<
|
|
468
|
+
TAccountLowerBinArray,
|
|
469
|
+
InstructionAccountInputAddress<TAccountLowerBinArray>
|
|
470
|
+
>,
|
|
471
|
+
ResolvedInstructionAccountMeta<
|
|
472
|
+
TAccountUpperBinArray,
|
|
473
|
+
InstructionAccountInputAddress<TAccountUpperBinArray>
|
|
474
|
+
>
|
|
340
475
|
>);
|
|
341
476
|
}
|
|
342
477
|
|