@sanctumso/inf1 0.0.1-dev-6 → 0.0.1-dev-7
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/index.d.ts +92 -92
- package/index.js +110 -109
- package/index_bg.wasm +0 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Returns the array of all possible {@link InfErr}s
|
|
5
|
-
*/
|
|
6
|
-
export function allInfErrs(): AllInfErrs;
|
|
7
|
-
export function quoteRebalance(inf: Inf, arg1: RebalanceQuoteArgs): RebalanceQuote;
|
|
8
3
|
/**
|
|
9
4
|
* @throws
|
|
10
5
|
*/
|
|
@@ -13,6 +8,20 @@ export function quoteTradeExactIn(inf: Inf, arg1: QuoteArgs): Quote;
|
|
|
13
8
|
* @throws
|
|
14
9
|
*/
|
|
15
10
|
export function quoteTradeExactOut(inf: Inf, arg1: QuoteArgs): Quote;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the pubkeys of the accounts that need ot be fetched to initialize
|
|
13
|
+
* a new {@link Inf} object
|
|
14
|
+
*/
|
|
15
|
+
export function initPks(): Bs58Array[];
|
|
16
|
+
/**
|
|
17
|
+
* Initialize a new {@link Inf} object.
|
|
18
|
+
*
|
|
19
|
+
* The returned object must be updated for a mint pair before it is ready to
|
|
20
|
+
* quote and operate for trades involving that pair
|
|
21
|
+
*
|
|
22
|
+
* @throws
|
|
23
|
+
*/
|
|
24
|
+
export function init(arg0: AccountMap, arg1: SplPoolAccounts): Inf;
|
|
16
25
|
export function getPoolState(inf: Inf): PoolState;
|
|
17
26
|
/**
|
|
18
27
|
* @throws
|
|
@@ -28,6 +37,22 @@ export function accountsToUpdateForTrade(inf: Inf, arg1: PkPair): Bs58Array[];
|
|
|
28
37
|
* @throws
|
|
29
38
|
*/
|
|
30
39
|
export function updateForTrade(inf: Inf, arg1: PkPair, account_map: AccountMap): void;
|
|
40
|
+
/**
|
|
41
|
+
* @throws if no valid PDA found
|
|
42
|
+
*/
|
|
43
|
+
export function findPoolReservesAta(arg0: Bs58Array): FoundPda;
|
|
44
|
+
/**
|
|
45
|
+
* @throws if no valid PDA found
|
|
46
|
+
*/
|
|
47
|
+
export function findProtocolFeeAccumulatorAta(arg0: Bs58Array): FoundPda;
|
|
48
|
+
/**
|
|
49
|
+
* @throws
|
|
50
|
+
*/
|
|
51
|
+
export function tradeExactInIx(inf: Inf, arg1: TradeArgs): Instruction;
|
|
52
|
+
/**
|
|
53
|
+
* @throws
|
|
54
|
+
*/
|
|
55
|
+
export function tradeExactOutIx(inf: Inf, arg1: TradeArgs): Instruction;
|
|
31
56
|
/**
|
|
32
57
|
* Returned accounts are deduped
|
|
33
58
|
*
|
|
@@ -55,39 +80,64 @@ export function appendSplLsts(inf: Inf, arg1: SplPoolAccounts): void;
|
|
|
55
80
|
*/
|
|
56
81
|
export function hasSplData(inf: Inf, mints: Bs58Array[]): Uint8Array;
|
|
57
82
|
/**
|
|
58
|
-
* @
|
|
59
|
-
*/
|
|
60
|
-
export function rebalanceIxs(inf: Inf, arg1: RebalanceArgs): RebalanceIxs;
|
|
61
|
-
/**
|
|
62
|
-
* @throws if no valid PDA found
|
|
63
|
-
*/
|
|
64
|
-
export function findPoolReservesAta(arg0: Bs58Array): FoundPda;
|
|
65
|
-
/**
|
|
66
|
-
* @throws if no valid PDA found
|
|
67
|
-
*/
|
|
68
|
-
export function findProtocolFeeAccumulatorAta(arg0: Bs58Array): FoundPda;
|
|
69
|
-
/**
|
|
70
|
-
* @throws
|
|
71
|
-
*/
|
|
72
|
-
export function tradeExactInIx(inf: Inf, arg1: TradeArgs): Instruction;
|
|
73
|
-
/**
|
|
74
|
-
* @throws
|
|
75
|
-
*/
|
|
76
|
-
export function tradeExactOutIx(inf: Inf, arg1: TradeArgs): Instruction;
|
|
77
|
-
/**
|
|
78
|
-
* Returns the pubkeys of the accounts that need ot be fetched to initialize
|
|
79
|
-
* a new {@link Inf} object
|
|
83
|
+
* Returns the array of all possible {@link InfErr}s
|
|
80
84
|
*/
|
|
81
|
-
export function
|
|
85
|
+
export function allInfErrs(): AllInfErrs;
|
|
86
|
+
export function quoteRebalance(inf: Inf, arg1: RebalanceQuoteArgs): RebalanceQuote;
|
|
82
87
|
/**
|
|
83
|
-
* Initialize a new {@link Inf} object.
|
|
84
|
-
*
|
|
85
|
-
* The returned object must be updated for a mint pair before it is ready to
|
|
86
|
-
* quote and operate for trades involving that pair
|
|
87
|
-
*
|
|
88
88
|
* @throws
|
|
89
89
|
*/
|
|
90
|
-
export function
|
|
90
|
+
export function rebalanceIxs(inf: Inf, arg1: RebalanceArgs): RebalanceIxs;
|
|
91
|
+
export type FeeMint = "inp" | "out";
|
|
92
|
+
|
|
93
|
+
export interface QuoteArgs {
|
|
94
|
+
amt: bigint;
|
|
95
|
+
mints: PkPair;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface Quote {
|
|
99
|
+
/**
|
|
100
|
+
* Amount of input tokens given by the user to the pool,
|
|
101
|
+
* after fees. This is exactly the amount of tokens that
|
|
102
|
+
* will leave the user\'s wallet.
|
|
103
|
+
*/
|
|
104
|
+
inp: bigint;
|
|
105
|
+
/**
|
|
106
|
+
* Amount of output tokens returned by the pool to the user,
|
|
107
|
+
* after fees. This is exactly the amount of tokens that
|
|
108
|
+
* will enter the user\'s wallet.
|
|
109
|
+
*/
|
|
110
|
+
out: bigint;
|
|
111
|
+
/**
|
|
112
|
+
* The amount of fee accrued to pool LPs,
|
|
113
|
+
* accumulated in the pool reserves.
|
|
114
|
+
*
|
|
115
|
+
* Which mint it is denoted in (whether inp_mint or out_mint)
|
|
116
|
+
* depends on value of `self.fee_mint`
|
|
117
|
+
*/
|
|
118
|
+
lpFee: bigint;
|
|
119
|
+
/**
|
|
120
|
+
* The amount of fee accrued to the protocol,
|
|
121
|
+
* to be transferred to the protocol fee accumulator account.
|
|
122
|
+
*
|
|
123
|
+
* Which mint it is denoted in (whether inp_mint or out_mint)
|
|
124
|
+
* depends on value of `self.fee_mint`
|
|
125
|
+
*/
|
|
126
|
+
protocolFee: bigint;
|
|
127
|
+
feeMint: FeeMint;
|
|
128
|
+
mints: PkPair;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type FoundPda = [B58PK, number];
|
|
132
|
+
|
|
133
|
+
export interface TradeArgs {
|
|
134
|
+
amt: bigint;
|
|
135
|
+
limit: bigint;
|
|
136
|
+
mints: PkPair;
|
|
137
|
+
signer: B58PK;
|
|
138
|
+
tokenAccs: PkPair;
|
|
139
|
+
}
|
|
140
|
+
|
|
91
141
|
|
|
92
142
|
export type ERR_CODE_MSG_SEP = ":";
|
|
93
143
|
|
|
@@ -156,46 +206,6 @@ export interface Instruction {
|
|
|
156
206
|
programAddress: B58PK;
|
|
157
207
|
}
|
|
158
208
|
|
|
159
|
-
export type FeeMint = "inp" | "out";
|
|
160
|
-
|
|
161
|
-
export interface QuoteArgs {
|
|
162
|
-
amt: bigint;
|
|
163
|
-
mints: PkPair;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export interface Quote {
|
|
167
|
-
/**
|
|
168
|
-
* Amount of input tokens given by the user to the pool,
|
|
169
|
-
* after fees. This is exactly the amount of tokens that
|
|
170
|
-
* will leave the user\'s wallet.
|
|
171
|
-
*/
|
|
172
|
-
inp: bigint;
|
|
173
|
-
/**
|
|
174
|
-
* Amount of output tokens returned by the pool to the user,
|
|
175
|
-
* after fees. This is exactly the amount of tokens that
|
|
176
|
-
* will enter the user\'s wallet.
|
|
177
|
-
*/
|
|
178
|
-
out: bigint;
|
|
179
|
-
/**
|
|
180
|
-
* The amount of fee accrued to pool LPs,
|
|
181
|
-
* accumulated in the pool reserves.
|
|
182
|
-
*
|
|
183
|
-
* Which mint it is denoted in (whether inp_mint or out_mint)
|
|
184
|
-
* depends on value of `self.fee_mint`
|
|
185
|
-
*/
|
|
186
|
-
lpFee: bigint;
|
|
187
|
-
/**
|
|
188
|
-
* The amount of fee accrued to the protocol,
|
|
189
|
-
* to be transferred to the protocol fee accumulator account.
|
|
190
|
-
*
|
|
191
|
-
* Which mint it is denoted in (whether inp_mint or out_mint)
|
|
192
|
-
* depends on value of `self.fee_mint`
|
|
193
|
-
*/
|
|
194
|
-
protocolFee: bigint;
|
|
195
|
-
feeMint: FeeMint;
|
|
196
|
-
mints: PkPair;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
209
|
export interface LstState {
|
|
200
210
|
isInputDisabled: number;
|
|
201
211
|
poolReservesBump: number;
|
|
@@ -255,16 +265,6 @@ export interface RebalanceIxs {
|
|
|
255
265
|
end: Instruction;
|
|
256
266
|
}
|
|
257
267
|
|
|
258
|
-
export interface TradeArgs {
|
|
259
|
-
amt: bigint;
|
|
260
|
-
limit: bigint;
|
|
261
|
-
mints: PkPair;
|
|
262
|
-
signer: B58PK;
|
|
263
|
-
tokenAccs: PkPair;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export type FoundPda = [B58PK, number];
|
|
267
|
-
|
|
268
268
|
export type Bs58Array = string
|
|
269
269
|
|
|
270
270
|
export class Inf {
|
|
@@ -276,26 +276,26 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
276
276
|
|
|
277
277
|
export interface InitOutput {
|
|
278
278
|
readonly memory: WebAssembly.Memory;
|
|
279
|
-
readonly allInfErrs: () => any;
|
|
280
|
-
readonly quoteRebalance: (a: number, b: any) => [number, number, number];
|
|
281
279
|
readonly quoteTradeExactIn: (a: number, b: any) => [number, number, number];
|
|
282
280
|
readonly quoteTradeExactOut: (a: number, b: any) => [number, number, number];
|
|
281
|
+
readonly initPks: () => [number, number];
|
|
282
|
+
readonly init: (a: any, b: any) => [number, number, number];
|
|
283
283
|
readonly getPoolState: (a: number) => any;
|
|
284
284
|
readonly getLstStateList: (a: number) => [number, number, number, number];
|
|
285
285
|
readonly accountsToUpdateForTrade: (a: number, b: any) => [number, number, number, number];
|
|
286
286
|
readonly updateForTrade: (a: number, b: any, c: any) => [number, number];
|
|
287
|
+
readonly findPoolReservesAta: (a: any) => [number, number, number];
|
|
288
|
+
readonly findProtocolFeeAccumulatorAta: (a: any) => [number, number, number];
|
|
289
|
+
readonly tradeExactInIx: (a: number, b: any) => [number, number, number];
|
|
290
|
+
readonly tradeExactOutIx: (a: number, b: any) => [number, number, number];
|
|
287
291
|
readonly accountsToUpdateForRebalance: (a: number, b: any) => [number, number, number, number];
|
|
288
292
|
readonly updateForRebalance: (a: number, b: any, c: any) => [number, number];
|
|
289
293
|
readonly appendSplLsts: (a: number, b: any) => void;
|
|
290
294
|
readonly hasSplData: (a: number, b: number, c: number) => [number, number];
|
|
291
295
|
readonly __wbg_inf_free: (a: number, b: number) => void;
|
|
296
|
+
readonly allInfErrs: () => any;
|
|
297
|
+
readonly quoteRebalance: (a: number, b: any) => [number, number, number];
|
|
292
298
|
readonly rebalanceIxs: (a: number, b: any) => [number, number, number];
|
|
293
|
-
readonly findPoolReservesAta: (a: any) => [number, number, number];
|
|
294
|
-
readonly findProtocolFeeAccumulatorAta: (a: any) => [number, number, number];
|
|
295
|
-
readonly tradeExactInIx: (a: number, b: any) => [number, number, number];
|
|
296
|
-
readonly tradeExactOutIx: (a: number, b: any) => [number, number, number];
|
|
297
|
-
readonly initPks: () => [number, number];
|
|
298
|
-
readonly init: (a: any, b: any) => [number, number, number];
|
|
299
299
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
300
300
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
301
301
|
readonly __wbindgen_exn_store: (a: number) => void;
|