@picon-finance/dlmm-sdk 1.11.0 → 1.12.0
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 +5 -13
- package/dist/entities/dlmm_program.d.ts.map +1 -1
- package/dist/entities/dlmm_program.js +0 -4
- package/dist/entities/pool.d.ts +7 -15
- package/dist/entities/pool.d.ts.map +1 -1
- package/dist/entities/pool.js +36 -35
- package/dist/entities/position.d.ts.map +1 -1
- package/dist/entities/position.js +3 -0
- package/dist/generated/instructions/claimFee.d.ts +8 -4
- package/dist/generated/instructions/claimFee.d.ts.map +1 -1
- package/dist/generated/instructions/claimFee.js +10 -1
- package/dist/generated/instructions/claimProtocolFee.d.ts +11 -5
- package/dist/generated/instructions/claimProtocolFee.d.ts.map +1 -1
- package/dist/generated/instructions/claimProtocolFee.js +19 -4
- package/dist/generated/instructions/depositByWeight.d.ts +5 -2
- package/dist/generated/instructions/depositByWeight.d.ts.map +1 -1
- package/dist/generated/instructions/depositByWeight.js +10 -2
- package/dist/generated/instructions/withdraw.d.ts +8 -4
- package/dist/generated/instructions/withdraw.d.ts.map +1 -1
- package/dist/generated/instructions/withdraw.js +10 -1
- package/dist/generated/types/accountKind.d.ts +3 -1
- package/dist/generated/types/accountKind.d.ts.map +1 -1
- package/dist/generated/types/accountKind.js +2 -0
- package/dist/picon_dlmm.json +49 -2
- package/dist/quote/wasm-node/picon_dlmm_quote.d.ts +2 -0
- package/dist/quote/wasm-node/picon_dlmm_quote_bg.wasm +0 -0
- package/dist/quote/wasm-web/picon_dlmm_quote.d.ts +2 -0
- package/dist/quote/wasm-web/picon_dlmm_quote_bg.wasm +0 -0
- package/dist/utils/assert.d.ts +0 -1
- package/dist/utils/assert.d.ts.map +1 -1
- package/dist/utils/assert.js +0 -5
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +0 -5
- package/package.json +1 -1
- package/src/entities/dlmm_program.ts +3 -13
- package/src/entities/pool.ts +54 -61
- package/src/entities/position.ts +3 -0
- package/src/generated/instructions/claimFee.ts +27 -6
- package/src/generated/instructions/claimProtocolFee.ts +45 -10
- package/src/generated/instructions/depositByWeight.ts +19 -0
- package/src/generated/instructions/withdraw.ts +27 -6
- package/src/generated/types/accountKind.ts +2 -0
- package/src/picon_dlmm.json +49 -2
- package/src/quote/wasm-node/picon_dlmm_quote.d.ts +2 -0
- package/src/quote/wasm-node/picon_dlmm_quote_bg.wasm +0 -0
- package/src/quote/wasm-web/picon_dlmm_quote.d.ts +2 -0
- package/src/quote/wasm-web/picon_dlmm_quote_bg.wasm +0 -0
- package/src/utils/assert.ts +0 -6
- package/src/utils/constants.ts +0 -6
|
@@ -19,26 +19,18 @@ export declare class DlmmProgram {
|
|
|
19
19
|
tokenProgramY: Address;
|
|
20
20
|
}): Promise<Instruction>;
|
|
21
21
|
swap(user: TransactionSigner, poolAddress: Address, params: {
|
|
22
|
-
xToY: boolean;
|
|
23
|
-
amountIn: bigint;
|
|
24
|
-
minAmountOut: bigint;
|
|
25
|
-
binArrayCount?: number;
|
|
26
|
-
}, config?: FetchAccountConfig): Promise<Instruction[]>;
|
|
27
|
-
quote(poolAddress: Address, params: {
|
|
28
|
-
xToY: boolean;
|
|
29
|
-
amountIn: bigint;
|
|
30
|
-
slippageToleranceBps: number;
|
|
31
|
-
binArrayCount?: number;
|
|
32
|
-
}, config?: FetchAccountConfig): Promise<QuoteOutput>;
|
|
33
|
-
quoteAndSwap(user: TransactionSigner, poolAddress: Address, params: {
|
|
34
22
|
xToY: boolean;
|
|
35
23
|
amountIn: bigint;
|
|
36
24
|
slippageToleranceBps: number;
|
|
37
|
-
binArrayCount?: number;
|
|
38
25
|
}, config?: FetchAccountConfig): Promise<{
|
|
39
26
|
quoteOutput: QuoteOutput;
|
|
40
27
|
instructions: Instruction[];
|
|
41
28
|
}>;
|
|
29
|
+
quote(poolAddress: Address, params: {
|
|
30
|
+
xToY: boolean;
|
|
31
|
+
amountIn: bigint;
|
|
32
|
+
slippageToleranceBps: number;
|
|
33
|
+
}, config?: FetchAccountConfig): Promise<QuoteOutput>;
|
|
42
34
|
getAllPositionMintsByOwner(owner: Address, config?: FetchAccountsConfig): Promise<Map<Address, Address[]>>;
|
|
43
35
|
createAdminConfig(deployer: TransactionSigner): Promise<Instruction>;
|
|
44
36
|
resetAdminAuthority(deployer: TransactionSigner): Promise<Instruction>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dlmm_program.d.ts","sourceRoot":"","sources":["../../src/entities/dlmm_program.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,WAAW,EAEhB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAGzB,MAAM,aAAa,CAAC;AAOrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EACL,IAAI,EAEL,MAAM,QAAQ,CAAC;AAYhB,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,qBAAa,WAAW;;IAItB,YACE,GAAG,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,EACvC,cAAc,GAAE,OAAiC,EAIlD;IAED,IAAW,GAAG,+5nBAAwB;IACtC,IAAW,cAAc,YAAmC;IAE/C,OAAO,CAClB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAEf;IAEY,UAAU,CACrB,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;QACpB,aAAa,EAA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AAS,CAAC,WAAW,CAAC,CAAC,CAKzC;IAEY,mBAAmB,CAC9B,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,OAAO,CAAC,CAKlB;CACF"}
|
|
@@ -28,10 +28,6 @@ export class DlmmProgram {
|
|
|
28
28
|
const pool = await this.getPool(poolAddress, config);
|
|
29
29
|
return await pool.quote(params);
|
|
30
30
|
}
|
|
31
|
-
async quoteAndSwap(user, poolAddress, params, config) {
|
|
32
|
-
const pool = await this.getPool(poolAddress, config);
|
|
33
|
-
return await pool.quoteAndSwap(user, params);
|
|
34
|
-
}
|
|
35
31
|
async getAllPositionMintsByOwner(owner, config) {
|
|
36
32
|
const { commitment, minContextSlot, abortSignal } = config ?? {};
|
|
37
33
|
const { value: tokenAccounts } = await this.#rpc
|
package/dist/entities/pool.d.ts
CHANGED
|
@@ -34,28 +34,20 @@ export declare class Pool {
|
|
|
34
34
|
upperBinId: number;
|
|
35
35
|
}): Promise<Instruction[]>;
|
|
36
36
|
closePosition(owner: TransactionSigner, positionMint: Address): Promise<Instruction>;
|
|
37
|
-
swap(user: TransactionSigner, { xToY, amountIn,
|
|
38
|
-
xToY: boolean;
|
|
39
|
-
amountIn: bigint;
|
|
40
|
-
minAmountOut: bigint;
|
|
41
|
-
binArrayCount?: number;
|
|
42
|
-
}): Promise<Instruction[]>;
|
|
43
|
-
quote({ xToY, amountIn, slippageToleranceBps, binArrayCount, }: {
|
|
37
|
+
swap(user: TransactionSigner, { xToY, amountIn, slippageToleranceBps, }: {
|
|
44
38
|
xToY: boolean;
|
|
45
39
|
amountIn: bigint;
|
|
46
40
|
slippageToleranceBps: number;
|
|
47
|
-
binArrayCount?: number;
|
|
48
|
-
}): Promise<QuoteOutput>;
|
|
49
|
-
quoteAndSwap(user: TransactionSigner, { xToY, amountIn, slippageToleranceBps, binArrayCount, }: {
|
|
50
|
-
xToY: boolean;
|
|
51
|
-
amountIn: bigint;
|
|
52
|
-
slippageToleranceBps: number;
|
|
53
|
-
binArrayCount?: number;
|
|
54
41
|
}): Promise<{
|
|
55
42
|
quoteOutput: QuoteOutput;
|
|
56
43
|
instructions: Instruction[];
|
|
57
44
|
}>;
|
|
58
|
-
|
|
45
|
+
quote(params: {
|
|
46
|
+
xToY: boolean;
|
|
47
|
+
amountIn: bigint;
|
|
48
|
+
slippageToleranceBps: number;
|
|
49
|
+
}): Promise<QuoteOutput>;
|
|
50
|
+
sync(user: TransactionSigner, desiredBinId: number): Promise<Instruction[]>;
|
|
59
51
|
setDynamicFeeConfig(authority: TransactionSigner, dynamicFeeConfig: generated.DynamicFeeConfig): Promise<Instruction>;
|
|
60
52
|
setProtocolShare(authority: TransactionSigner, protocolShare: number): Promise<Instruction>;
|
|
61
53
|
claimProtocolFee(authority: TransactionSigner): Promise<Instruction[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../src/entities/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../src/entities/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK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AoB,IAAI,CACtB,GAAG,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,EACvC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,OAAO,EACvB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAWf;CACF;AAED,wBAAsB,eAAe,CACnC,KAAK,EAAE;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EACrF,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,wBAAsB,UAAU,CAC9B,EACE,SAAS,EACT,OAAO,EACP,OAAO,EACP,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,GACd,EAAE;IACD,SAAS,EAAE,iBAAiB,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CACxB,EACD,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,WAAW,CAAC,CAkBtB"}
|
package/dist/entities/pool.js
CHANGED
|
@@ -3,12 +3,11 @@ import { fetchAllMint, } from "@solana-program/token-2022";
|
|
|
3
3
|
import { generated } from "..";
|
|
4
4
|
import { quote, getPoolFeeRates, } from "../quote";
|
|
5
5
|
import { isAccount } from "../utils/type_guards";
|
|
6
|
-
import { assertInRange } from "../utils/assert";
|
|
7
6
|
import { resolveAdminConfigAddress } from "./admin_config";
|
|
8
7
|
import { processAssociatedTokenAccountPair } from "../utils/ata";
|
|
9
|
-
import { generateBinArrayIndicesForSwap, generateBinArrayIndicesForSync, } from "../utils/bin_location";
|
|
8
|
+
import { getBinArrayIndex, generateBinArrayIndicesForSwap, generateBinArrayIndicesForSync, } from "../utils/bin_location";
|
|
10
9
|
import { resolveTransferFee } from "../utils/transfer_fee";
|
|
11
|
-
import { MAX_BIN_ARRAYS_PER_TRAVERSAL
|
|
10
|
+
import { MAX_BIN_ARRAYS_PER_TRAVERSAL } from "../utils/constants";
|
|
12
11
|
import { Position, openPosition, closePosition, findPositionAddress, findAllPositionAddresses, } from "./position";
|
|
13
12
|
import { findAllBinArrayAddresses } from "./bin_array";
|
|
14
13
|
export class Pool {
|
|
@@ -70,21 +69,17 @@ export class Pool {
|
|
|
70
69
|
async closePosition(owner, positionMint) {
|
|
71
70
|
return await closePosition({ owner, positionMint }, { programAddress: this.#programAddress });
|
|
72
71
|
}
|
|
73
|
-
async swap(user, { xToY, amountIn,
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
amountX: xToY ? amountIn : undefined,
|
|
85
|
-
amountY: xToY ? undefined : amountIn,
|
|
86
|
-
}),
|
|
87
|
-
]);
|
|
72
|
+
async swap(user, { xToY, amountIn, slippageToleranceBps, }) {
|
|
73
|
+
const { quoteOutput, binArrayAddresses } = await this.#quote({ xToY, amountIn, slippageToleranceBps });
|
|
74
|
+
const { ataX: tokenUserAccountX, ataY: tokenUserAccountY, preInstructions, postInstructions, } = await processAssociatedTokenAccountPair({
|
|
75
|
+
owner: user,
|
|
76
|
+
tokenMintX: this.tokenMintX,
|
|
77
|
+
tokenMintY: this.tokenMintY,
|
|
78
|
+
tokenProgramX: this.tokenProgramX,
|
|
79
|
+
tokenProgramY: this.tokenProgramY,
|
|
80
|
+
amountX: xToY ? amountIn : undefined,
|
|
81
|
+
amountY: xToY ? undefined : amountIn,
|
|
82
|
+
});
|
|
88
83
|
const remainingAccountsScheme = {
|
|
89
84
|
groups: [{ kind: generated.AccountKind.BinArray, count: binArrayAddresses.length }],
|
|
90
85
|
};
|
|
@@ -100,24 +95,28 @@ export class Pool {
|
|
|
100
95
|
tokenProgramX: this.tokenProgramX,
|
|
101
96
|
tokenProgramY: this.tokenProgramY,
|
|
102
97
|
amountIn,
|
|
103
|
-
minAmountOut,
|
|
98
|
+
minAmountOut: quoteOutput.minAmountOut,
|
|
104
99
|
xToY,
|
|
105
100
|
remainingAccountsScheme,
|
|
106
101
|
}, { programAddress: this.#programAddress });
|
|
107
102
|
const remainingAccounts = binArrayAddresses.map(address => ({ address, role: AccountRole.WRITABLE }));
|
|
108
103
|
const swapIxWithBinArrays = { ...swapIx, accounts: [...swapIx.accounts, ...remainingAccounts] };
|
|
109
|
-
|
|
104
|
+
const instructions = [...preInstructions, swapIxWithBinArrays, ...postInstructions];
|
|
105
|
+
return { quoteOutput, instructions };
|
|
110
106
|
}
|
|
111
|
-
async quote(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
async quote(params) {
|
|
108
|
+
const { quoteOutput } = await this.#quote(params);
|
|
109
|
+
return quoteOutput;
|
|
110
|
+
}
|
|
111
|
+
async #quote({ xToY, amountIn, slippageToleranceBps, }) {
|
|
112
|
+
const indices = generateBinArrayIndicesForSwap(this.activeBinId, xToY, MAX_BIN_ARRAYS_PER_TRAVERSAL);
|
|
113
|
+
const maxBinArrayAddresses = await findAllBinArrayAddresses({ pool: this.address, indices }, { programAddress: this.#programAddress });
|
|
115
114
|
const [maybeBinArrays, { transferFeeX, transferFeeY }] = await Promise.all([
|
|
116
|
-
generated.fetchAllMaybeBinArray(this.#rpc,
|
|
115
|
+
generated.fetchAllMaybeBinArray(this.#rpc, maxBinArrayAddresses),
|
|
117
116
|
this.getTransferFees(),
|
|
118
117
|
]);
|
|
119
118
|
const binArrays = maybeBinArrays.map(maybeBinArray => maybeBinArray.exists ? maybeBinArray.data : undefined);
|
|
120
|
-
|
|
119
|
+
const quoteOutput = await quote({
|
|
121
120
|
amountIn,
|
|
122
121
|
xToY,
|
|
123
122
|
slippageToleranceBps,
|
|
@@ -127,15 +126,16 @@ export class Pool {
|
|
|
127
126
|
outputTransferFee: xToY ? transferFeeY : transferFeeX,
|
|
128
127
|
binArrays,
|
|
129
128
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
const safeOffset = xToY ? -1 : 1;
|
|
130
|
+
const targetBinArrayIndex = getBinArrayIndex(quoteOutput.postActiveBinId) + safeOffset;
|
|
131
|
+
const localTargetBinArrayIndex = targetBinArrayIndex - indices[0];
|
|
132
|
+
const binArrayAddresses = xToY
|
|
133
|
+
? maxBinArrayAddresses.slice(Math.max(0, localTargetBinArrayIndex))
|
|
134
|
+
: maxBinArrayAddresses.slice(0, localTargetBinArrayIndex + 1);
|
|
135
|
+
return { quoteOutput, binArrayAddresses };
|
|
136
|
+
}
|
|
137
|
+
async sync(user, desiredBinId) {
|
|
138
|
+
const indices = generateBinArrayIndicesForSync(this.activeBinId, desiredBinId, MAX_BIN_ARRAYS_PER_TRAVERSAL);
|
|
139
139
|
const binArrayAddresses = await findAllBinArrayAddresses({ pool: this.address, indices }, { programAddress: this.#programAddress });
|
|
140
140
|
const remainingAccountsScheme = {
|
|
141
141
|
groups: [{ kind: generated.AccountKind.BinArray, count: binArrayAddresses.length }],
|
|
@@ -173,6 +173,7 @@ export class Pool {
|
|
|
173
173
|
tokenVaultY: this.tokenVaultY,
|
|
174
174
|
tokenAdminAccountX,
|
|
175
175
|
tokenAdminAccountY,
|
|
176
|
+
remainingAccountsScheme: null,
|
|
176
177
|
tokenProgramX: this.tokenProgramX,
|
|
177
178
|
tokenProgramY: this.tokenProgramY,
|
|
178
179
|
}, { programAddress: this.#programAddress });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":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BinId,
|
|
138
138
|
binWeights,
|
|
139
|
+
remainingAccountsScheme: null,
|
|
139
140
|
}, {
|
|
140
141
|
programAddress: this.#pool.programAddress
|
|
141
142
|
});
|
|
@@ -162,6 +163,7 @@ export class Position {
|
|
|
162
163
|
upperBinArray,
|
|
163
164
|
lowerBinId,
|
|
164
165
|
upperBinId,
|
|
166
|
+
remainingAccountsScheme: null,
|
|
165
167
|
}, {
|
|
166
168
|
programAddress: this.#pool.programAddress
|
|
167
169
|
});
|
|
@@ -212,6 +214,7 @@ export class Position {
|
|
|
212
214
|
lowerBinId,
|
|
213
215
|
upperBinId,
|
|
214
216
|
bpsToRemove,
|
|
217
|
+
remainingAccountsScheme: null,
|
|
215
218
|
}, {
|
|
216
219
|
programAddress: this.#pool.programAddress
|
|
217
220
|
});
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
import { type AccountMeta, type AccountSignerMeta, type Address, type
|
|
8
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type Option, type OptionOrNullable, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from "@solana/kit";
|
|
9
9
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs";
|
|
10
|
+
import { type RemainingAccountsScheme, type RemainingAccountsSchemeArgs } from "../types";
|
|
10
11
|
export declare const CLAIM_FEE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
11
12
|
export declare function getClaimFeeDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
13
|
export type ClaimFeeInstruction<TProgram extends string = typeof PICON_DLMM_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountPosition extends string | AccountMeta<string> = string, TAccountPositionTokenAccount extends string | AccountMeta<string> = string, TAccountTokenMintX extends string | AccountMeta<string> = string, TAccountTokenMintY extends string | AccountMeta<string> = string, TAccountTokenOwnerAccountX extends string | AccountMeta<string> = string, TAccountTokenOwnerAccountY extends string | AccountMeta<string> = string, TAccountTokenVaultX extends string | AccountMeta<string> = string, TAccountTokenVaultY extends string | AccountMeta<string> = string, TAccountTokenProgramX extends string | AccountMeta<string> = string, TAccountTokenProgramY extends string | AccountMeta<string> = string, TAccountLowerBinArray extends string | AccountMeta<string> = string, TAccountUpperBinArray extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
@@ -30,14 +31,16 @@ export type ClaimFeeInstructionData = {
|
|
|
30
31
|
discriminator: ReadonlyUint8Array;
|
|
31
32
|
lowerBinId: number;
|
|
32
33
|
upperBinId: number;
|
|
34
|
+
remainingAccountsScheme: Option<RemainingAccountsScheme>;
|
|
33
35
|
};
|
|
34
36
|
export type ClaimFeeInstructionDataArgs = {
|
|
35
37
|
lowerBinId: number;
|
|
36
38
|
upperBinId: number;
|
|
39
|
+
remainingAccountsScheme: OptionOrNullable<RemainingAccountsSchemeArgs>;
|
|
37
40
|
};
|
|
38
|
-
export declare function getClaimFeeInstructionDataEncoder():
|
|
39
|
-
export declare function getClaimFeeInstructionDataDecoder():
|
|
40
|
-
export declare function getClaimFeeInstructionDataCodec():
|
|
41
|
+
export declare function getClaimFeeInstructionDataEncoder(): Encoder<ClaimFeeInstructionDataArgs>;
|
|
42
|
+
export declare function getClaimFeeInstructionDataDecoder(): Decoder<ClaimFeeInstructionData>;
|
|
43
|
+
export declare function getClaimFeeInstructionDataCodec(): Codec<ClaimFeeInstructionDataArgs, ClaimFeeInstructionData>;
|
|
41
44
|
export type ClaimFeeInput<TAccountOwner extends string = string, TAccountPool extends string = string, TAccountPosition extends string = string, TAccountPositionTokenAccount extends string = string, TAccountTokenMintX extends string = string, TAccountTokenMintY extends string = string, TAccountTokenOwnerAccountX extends string = string, TAccountTokenOwnerAccountY extends string = string, TAccountTokenVaultX extends string = string, TAccountTokenVaultY extends string = string, TAccountTokenProgramX extends string = string, TAccountTokenProgramY extends string = string, TAccountLowerBinArray extends string = string, TAccountUpperBinArray extends string = string> = {
|
|
42
45
|
owner: TransactionSigner<TAccountOwner>;
|
|
43
46
|
pool: Address<TAccountPool>;
|
|
@@ -55,6 +58,7 @@ export type ClaimFeeInput<TAccountOwner extends string = string, TAccountPool ex
|
|
|
55
58
|
upperBinArray?: Address<TAccountUpperBinArray>;
|
|
56
59
|
lowerBinId: ClaimFeeInstructionDataArgs["lowerBinId"];
|
|
57
60
|
upperBinId: ClaimFeeInstructionDataArgs["upperBinId"];
|
|
61
|
+
remainingAccountsScheme: ClaimFeeInstructionDataArgs["remainingAccountsScheme"];
|
|
58
62
|
};
|
|
59
63
|
export declare function getClaimFeeInstruction<TAccountOwner extends string, TAccountPool extends string, TAccountPosition extends string, TAccountPositionTokenAccount extends string, TAccountTokenMintX extends string, TAccountTokenMintY extends string, TAccountTokenOwnerAccountX extends string, TAccountTokenOwnerAccountY extends string, TAccountTokenVaultX extends string, TAccountTokenVaultY extends string, TAccountTokenProgramX extends string, TAccountTokenProgramY extends string, TAccountLowerBinArray extends string, TAccountUpperBinArray extends string, TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS>(input: ClaimFeeInput<TAccountOwner, TAccountPool, TAccountPosition, TAccountPositionTokenAccount, TAccountTokenMintX, TAccountTokenMintY, TAccountTokenOwnerAccountX, TAccountTokenOwnerAccountY, TAccountTokenVaultX, TAccountTokenVaultY, TAccountTokenProgramX, TAccountTokenProgramY, TAccountLowerBinArray, TAccountUpperBinArray>, config?: {
|
|
60
64
|
programAddress?: TProgramAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claimFee.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/claimFee.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH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EAAE;QACR,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACvB,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC3B,oBAAoB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACvC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC7B,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC7B,kBAAkB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACrC,kBAAkB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACrC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;QACjC,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;QACjC,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;QACjC,aAAa,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;KAC/C,CAAC;IACF,IAAI,EAAE,uBAAuB,CAAC;CAC/B,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,WAAW,EAAE,EAE5C,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,GAChC,uBAAuB,CAAC,aAAa,CAAC,GACtC,mBAAmB,CAAC,kBAAkB,CAAC,GACxC,yBAAyB,CAAC,QAAQ,EAAE,aAAa,CAAC,CA0CpD"}
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getI32Decoder, getI32Encoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
|
|
8
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getI32Decoder, getI32Encoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
|
|
9
9
|
import { getAccountMetaFactory, } from "@solana/program-client-core";
|
|
10
10
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs";
|
|
11
|
+
import { getRemainingAccountsSchemeDecoder, getRemainingAccountsSchemeEncoder, } from "../types";
|
|
11
12
|
export const CLAIM_FEE_DISCRIMINATOR = new Uint8Array([
|
|
12
13
|
169, 32, 79, 137, 136, 232, 70, 137,
|
|
13
14
|
]);
|
|
@@ -19,6 +20,10 @@ export function getClaimFeeInstructionDataEncoder() {
|
|
|
19
20
|
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
20
21
|
["lowerBinId", getI32Encoder()],
|
|
21
22
|
["upperBinId", getI32Encoder()],
|
|
23
|
+
[
|
|
24
|
+
"remainingAccountsScheme",
|
|
25
|
+
getOptionEncoder(getRemainingAccountsSchemeEncoder()),
|
|
26
|
+
],
|
|
22
27
|
]), (value) => ({ ...value, discriminator: CLAIM_FEE_DISCRIMINATOR }));
|
|
23
28
|
}
|
|
24
29
|
export function getClaimFeeInstructionDataDecoder() {
|
|
@@ -26,6 +31,10 @@ export function getClaimFeeInstructionDataDecoder() {
|
|
|
26
31
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
27
32
|
["lowerBinId", getI32Decoder()],
|
|
28
33
|
["upperBinId", getI32Decoder()],
|
|
34
|
+
[
|
|
35
|
+
"remainingAccountsScheme",
|
|
36
|
+
getOptionDecoder(getRemainingAccountsSchemeDecoder()),
|
|
37
|
+
],
|
|
29
38
|
]);
|
|
30
39
|
}
|
|
31
40
|
export function getClaimFeeInstructionDataCodec() {
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
import { type AccountMeta, type AccountSignerMeta, type Address, type
|
|
8
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type Option, type OptionOrNullable, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from "@solana/kit";
|
|
9
9
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs";
|
|
10
|
+
import { type RemainingAccountsScheme, type RemainingAccountsSchemeArgs } from "../types";
|
|
10
11
|
export declare const CLAIM_PROTOCOL_FEE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
11
12
|
export declare function getClaimProtocolFeeDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
13
|
export type ClaimProtocolFeeInstruction<TProgram extends string = typeof PICON_DLMM_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountAdminConfig extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountTokenMintX extends string | AccountMeta<string> = string, TAccountTokenMintY extends string | AccountMeta<string> = string, TAccountTokenVaultX extends string | AccountMeta<string> = string, TAccountTokenVaultY extends string | AccountMeta<string> = string, TAccountTokenAdminAccountX extends string | AccountMeta<string> = string, TAccountTokenAdminAccountY extends string | AccountMeta<string> = string, TAccountTokenProgramX extends string | AccountMeta<string> = string, TAccountTokenProgramY extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
@@ -25,11 +26,14 @@ export type ClaimProtocolFeeInstruction<TProgram extends string = typeof PICON_D
|
|
|
25
26
|
]>;
|
|
26
27
|
export type ClaimProtocolFeeInstructionData = {
|
|
27
28
|
discriminator: ReadonlyUint8Array;
|
|
29
|
+
remainingAccountsScheme: Option<RemainingAccountsScheme>;
|
|
28
30
|
};
|
|
29
|
-
export type ClaimProtocolFeeInstructionDataArgs = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export declare function
|
|
31
|
+
export type ClaimProtocolFeeInstructionDataArgs = {
|
|
32
|
+
remainingAccountsScheme: OptionOrNullable<RemainingAccountsSchemeArgs>;
|
|
33
|
+
};
|
|
34
|
+
export declare function getClaimProtocolFeeInstructionDataEncoder(): Encoder<ClaimProtocolFeeInstructionDataArgs>;
|
|
35
|
+
export declare function getClaimProtocolFeeInstructionDataDecoder(): Decoder<ClaimProtocolFeeInstructionData>;
|
|
36
|
+
export declare function getClaimProtocolFeeInstructionDataCodec(): Codec<ClaimProtocolFeeInstructionDataArgs, ClaimProtocolFeeInstructionData>;
|
|
33
37
|
export type ClaimProtocolFeeAsyncInput<TAccountAuthority extends string = string, TAccountAdminConfig extends string = string, TAccountPool extends string = string, TAccountTokenMintX extends string = string, TAccountTokenMintY extends string = string, TAccountTokenVaultX extends string = string, TAccountTokenVaultY extends string = string, TAccountTokenAdminAccountX extends string = string, TAccountTokenAdminAccountY extends string = string, TAccountTokenProgramX extends string = string, TAccountTokenProgramY extends string = string> = {
|
|
34
38
|
authority: TransactionSigner<TAccountAuthority>;
|
|
35
39
|
adminConfig?: Address<TAccountAdminConfig>;
|
|
@@ -42,6 +46,7 @@ export type ClaimProtocolFeeAsyncInput<TAccountAuthority extends string = string
|
|
|
42
46
|
tokenAdminAccountY: Address<TAccountTokenAdminAccountY>;
|
|
43
47
|
tokenProgramX: Address<TAccountTokenProgramX>;
|
|
44
48
|
tokenProgramY: Address<TAccountTokenProgramY>;
|
|
49
|
+
remainingAccountsScheme: ClaimProtocolFeeInstructionDataArgs["remainingAccountsScheme"];
|
|
45
50
|
};
|
|
46
51
|
export declare function getClaimProtocolFeeInstructionAsync<TAccountAuthority extends string, TAccountAdminConfig extends string, TAccountPool extends string, TAccountTokenMintX extends string, TAccountTokenMintY extends string, TAccountTokenVaultX extends string, TAccountTokenVaultY extends string, TAccountTokenAdminAccountX extends string, TAccountTokenAdminAccountY extends string, TAccountTokenProgramX extends string, TAccountTokenProgramY extends string, TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS>(input: ClaimProtocolFeeAsyncInput<TAccountAuthority, TAccountAdminConfig, TAccountPool, TAccountTokenMintX, TAccountTokenMintY, TAccountTokenVaultX, TAccountTokenVaultY, TAccountTokenAdminAccountX, TAccountTokenAdminAccountY, TAccountTokenProgramX, TAccountTokenProgramY>, config?: {
|
|
47
52
|
programAddress?: TProgramAddress;
|
|
@@ -58,6 +63,7 @@ export type ClaimProtocolFeeInput<TAccountAuthority extends string = string, TAc
|
|
|
58
63
|
tokenAdminAccountY: Address<TAccountTokenAdminAccountY>;
|
|
59
64
|
tokenProgramX: Address<TAccountTokenProgramX>;
|
|
60
65
|
tokenProgramY: Address<TAccountTokenProgramY>;
|
|
66
|
+
remainingAccountsScheme: ClaimProtocolFeeInstructionDataArgs["remainingAccountsScheme"];
|
|
61
67
|
};
|
|
62
68
|
export declare function getClaimProtocolFeeInstruction<TAccountAuthority extends string, TAccountAdminConfig extends string, TAccountPool extends string, TAccountTokenMintX extends string, TAccountTokenMintY extends string, TAccountTokenVaultX extends string, TAccountTokenVaultY extends string, TAccountTokenAdminAccountX extends string, TAccountTokenAdminAccountY extends string, TAccountTokenProgramX extends string, TAccountTokenProgramY extends string, TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS>(input: ClaimProtocolFeeInput<TAccountAuthority, TAccountAdminConfig, TAccountPool, TAccountTokenMintX, TAccountTokenMintY, TAccountTokenVaultX, TAccountTokenVaultY, TAccountTokenAdminAccountX, TAccountTokenAdminAccountY, TAccountTokenProgramX, TAccountTokenProgramY>, config?: {
|
|
63
69
|
programAddress?: TProgramAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claimProtocolFee.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/claimProtocolFee.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"claimProtocolFee.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/claimProtocolFee.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAaL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EACjC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,gCAAgC,EAAE,kBACQ,CAAC;AAExD,wBAAgB,qCAAqC,IAAI,kBAAkB,CAI1E;AAED,MAAM,MAAM,2BAA2B,CACrC,QAAQ,SAAS,MAAM,GAAG,OAAO,0BAA0B,EAC3D,iBAAiB,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAC/D,mBAAmB,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EACjE,YAAY,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAC1D,kBAAkB,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAChE,kBAAkB,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAChE,mBAAmB,SAAS,MAAM,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B,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,kBAAkB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACrC,kBAAkB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACrC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;KAClC,CAAC;IACF,IAAI,EAAE,+BAA+B,CAAC;CACvC,CAAC;AAEF,wBAAgB,gCAAgC,CAC9C,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,WAAW,EAAE,EAE5C,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,GAChC,uBAAuB,CAAC,aAAa,CAAC,GACtC,mBAAmB,CAAC,kBAAkB,CAAC,GACxC,iCAAiC,CAAC,QAAQ,EAAE,aAAa,CAAC,CAiC5D"}
|
|
@@ -5,20 +5,31 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
|
|
8
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
|
|
9
9
|
import { getAccountMetaFactory, } from "@solana/program-client-core";
|
|
10
10
|
import { findAdminConfigPda } from "../pdas";
|
|
11
11
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs";
|
|
12
|
+
import { getRemainingAccountsSchemeDecoder, getRemainingAccountsSchemeEncoder, } from "../types";
|
|
12
13
|
export const CLAIM_PROTOCOL_FEE_DISCRIMINATOR = new Uint8Array([165, 228, 133, 48, 99, 249, 255, 33]);
|
|
13
14
|
export function getClaimProtocolFeeDiscriminatorBytes() {
|
|
14
15
|
return fixEncoderSize(getBytesEncoder(), 8).encode(CLAIM_PROTOCOL_FEE_DISCRIMINATOR);
|
|
15
16
|
}
|
|
16
17
|
export function getClaimProtocolFeeInstructionDataEncoder() {
|
|
17
|
-
return transformEncoder(getStructEncoder([
|
|
18
|
+
return transformEncoder(getStructEncoder([
|
|
19
|
+
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
20
|
+
[
|
|
21
|
+
"remainingAccountsScheme",
|
|
22
|
+
getOptionEncoder(getRemainingAccountsSchemeEncoder()),
|
|
23
|
+
],
|
|
24
|
+
]), (value) => ({ ...value, discriminator: CLAIM_PROTOCOL_FEE_DISCRIMINATOR }));
|
|
18
25
|
}
|
|
19
26
|
export function getClaimProtocolFeeInstructionDataDecoder() {
|
|
20
27
|
return getStructDecoder([
|
|
21
28
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
29
|
+
[
|
|
30
|
+
"remainingAccountsScheme",
|
|
31
|
+
getOptionDecoder(getRemainingAccountsSchemeDecoder()),
|
|
32
|
+
],
|
|
22
33
|
]);
|
|
23
34
|
}
|
|
24
35
|
export function getClaimProtocolFeeInstructionDataCodec() {
|
|
@@ -48,6 +59,8 @@ export async function getClaimProtocolFeeInstructionAsync(input, config) {
|
|
|
48
59
|
tokenProgramY: { value: input.tokenProgramY ?? null, isWritable: false },
|
|
49
60
|
};
|
|
50
61
|
const accounts = originalAccounts;
|
|
62
|
+
// Original args.
|
|
63
|
+
const args = { ...input };
|
|
51
64
|
// Resolve default values.
|
|
52
65
|
if (!accounts.adminConfig.value) {
|
|
53
66
|
accounts.adminConfig.value = await findAdminConfigPda();
|
|
@@ -67,7 +80,7 @@ export async function getClaimProtocolFeeInstructionAsync(input, config) {
|
|
|
67
80
|
getAccountMeta("tokenProgramX", accounts.tokenProgramX),
|
|
68
81
|
getAccountMeta("tokenProgramY", accounts.tokenProgramY),
|
|
69
82
|
],
|
|
70
|
-
data: getClaimProtocolFeeInstructionDataEncoder().encode(
|
|
83
|
+
data: getClaimProtocolFeeInstructionDataEncoder().encode(args),
|
|
71
84
|
programAddress,
|
|
72
85
|
});
|
|
73
86
|
}
|
|
@@ -95,6 +108,8 @@ export function getClaimProtocolFeeInstruction(input, config) {
|
|
|
95
108
|
tokenProgramY: { value: input.tokenProgramY ?? null, isWritable: false },
|
|
96
109
|
};
|
|
97
110
|
const accounts = originalAccounts;
|
|
111
|
+
// Original args.
|
|
112
|
+
const args = { ...input };
|
|
98
113
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
99
114
|
return Object.freeze({
|
|
100
115
|
accounts: [
|
|
@@ -110,7 +125,7 @@ export function getClaimProtocolFeeInstruction(input, config) {
|
|
|
110
125
|
getAccountMeta("tokenProgramX", accounts.tokenProgramX),
|
|
111
126
|
getAccountMeta("tokenProgramY", accounts.tokenProgramY),
|
|
112
127
|
],
|
|
113
|
-
data: getClaimProtocolFeeInstructionDataEncoder().encode(
|
|
128
|
+
data: getClaimProtocolFeeInstructionDataEncoder().encode(args),
|
|
114
129
|
programAddress,
|
|
115
130
|
});
|
|
116
131
|
}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
import { type AccountMeta, type AccountSignerMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from "@solana/kit";
|
|
8
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type Option, type OptionOrNullable, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from "@solana/kit";
|
|
9
9
|
import { PICON_DLMM_PROGRAM_ADDRESS } from "../programs";
|
|
10
|
-
import { type DistributionMode, type DistributionModeArgs } from "../types";
|
|
10
|
+
import { type DistributionMode, type DistributionModeArgs, type RemainingAccountsScheme, type RemainingAccountsSchemeArgs } from "../types";
|
|
11
11
|
export declare const DEPOSIT_BY_WEIGHT_DISCRIMINATOR: ReadonlyUint8Array;
|
|
12
12
|
export declare function getDepositByWeightDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
13
|
export type DepositByWeightInstruction<TProgram extends string = typeof PICON_DLMM_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountPosition extends string | AccountMeta<string> = string, TAccountPositionTokenAccount extends string | AccountMeta<string> = string, TAccountTokenMintX extends string | AccountMeta<string> = string, TAccountTokenMintY extends string | AccountMeta<string> = string, TAccountTokenOwnerAccountX extends string | AccountMeta<string> = string, TAccountTokenOwnerAccountY extends string | AccountMeta<string> = string, TAccountTokenVaultX extends string | AccountMeta<string> = string, TAccountTokenVaultY extends string | AccountMeta<string> = string, TAccountTokenProgramX extends string | AccountMeta<string> = string, TAccountTokenProgramY extends string | AccountMeta<string> = string, TAccountLowerBinArray extends string | AccountMeta<string> = string, TAccountUpperBinArray extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
@@ -36,6 +36,7 @@ export type DepositByWeightInstructionData = {
|
|
|
36
36
|
distributionMode: DistributionMode;
|
|
37
37
|
lowerBinId: number;
|
|
38
38
|
binWeights: Array<number>;
|
|
39
|
+
remainingAccountsScheme: Option<RemainingAccountsScheme>;
|
|
39
40
|
};
|
|
40
41
|
export type DepositByWeightInstructionDataArgs = {
|
|
41
42
|
amountX: number | bigint;
|
|
@@ -45,6 +46,7 @@ export type DepositByWeightInstructionDataArgs = {
|
|
|
45
46
|
distributionMode: DistributionModeArgs;
|
|
46
47
|
lowerBinId: number;
|
|
47
48
|
binWeights: Array<number>;
|
|
49
|
+
remainingAccountsScheme: OptionOrNullable<RemainingAccountsSchemeArgs>;
|
|
48
50
|
};
|
|
49
51
|
export declare function getDepositByWeightInstructionDataEncoder(): Encoder<DepositByWeightInstructionDataArgs>;
|
|
50
52
|
export declare function getDepositByWeightInstructionDataDecoder(): Decoder<DepositByWeightInstructionData>;
|
|
@@ -71,6 +73,7 @@ export type DepositByWeightInput<TAccountOwner extends string = string, TAccount
|
|
|
71
73
|
distributionMode: DepositByWeightInstructionDataArgs["distributionMode"];
|
|
72
74
|
lowerBinId: DepositByWeightInstructionDataArgs["lowerBinId"];
|
|
73
75
|
binWeights: DepositByWeightInstructionDataArgs["binWeights"];
|
|
76
|
+
remainingAccountsScheme: DepositByWeightInstructionDataArgs["remainingAccountsScheme"];
|
|
74
77
|
};
|
|
75
78
|
export declare function getDepositByWeightInstruction<TAccountOwner extends string, TAccountPool extends string, TAccountPosition extends string, TAccountPositionTokenAccount extends string, TAccountTokenMintX extends string, TAccountTokenMintY extends string, TAccountTokenOwnerAccountX extends string, TAccountTokenOwnerAccountY extends string, TAccountTokenVaultX extends string, TAccountTokenVaultY extends string, TAccountTokenProgramX extends string, TAccountTokenProgramY extends string, TAccountLowerBinArray extends string, TAccountUpperBinArray extends string, TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS>(input: DepositByWeightInput<TAccountOwner, TAccountPool, TAccountPosition, TAccountPositionTokenAccount, TAccountTokenMintX, TAccountTokenMintY, TAccountTokenOwnerAccountX, TAccountTokenOwnerAccountY, TAccountTokenVaultX, TAccountTokenVaultY, TAccountTokenProgramX, TAccountTokenProgramY, TAccountLowerBinArray, TAccountUpperBinArray>, config?: {
|
|
76
79
|
programAddress?: TProgramAddress;
|