@sanctumso/inf1 0.0.2-dev-2 → 0.0.2-dev-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/index.d.ts +82 -65
- package/index.js +146 -124
- package/index_bg.wasm +0 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @throws if no valid PDA found
|
|
5
|
+
*/
|
|
6
|
+
export function findPoolReservesAta(arg0: Bs58Array): FoundPda;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Protocol fee accumulator token accounts are no longer used in v2
|
|
9
|
+
*
|
|
10
|
+
* @throws if no valid PDA found
|
|
11
|
+
*/
|
|
12
|
+
export function findProtocolFeeAccumulatorAta(arg0: Bs58Array): FoundPda;
|
|
13
|
+
/**
|
|
14
|
+
* @throws
|
|
15
|
+
*/
|
|
16
|
+
export function quoteTradeExactIn(inf: Inf, arg1: QuoteArgs): Quote;
|
|
17
|
+
/**
|
|
18
|
+
* @throws
|
|
19
|
+
*/
|
|
20
|
+
export function quoteTradeExactOut(inf: Inf, arg1: QuoteArgs): Quote;
|
|
21
|
+
/**
|
|
22
|
+
* @throws
|
|
23
|
+
*/
|
|
24
|
+
export function tradeExactInIx(inf: Inf, arg1: TradeArgs): Instruction;
|
|
25
|
+
/**
|
|
26
|
+
* @throws
|
|
27
|
+
*/
|
|
28
|
+
export function tradeExactOutIx(inf: Inf, arg1: TradeArgs): Instruction;
|
|
3
29
|
/**
|
|
4
30
|
* Returns the pubkeys of the accounts that need to be fetched to initialize
|
|
5
31
|
* a new {@link Inf} object
|
|
@@ -33,28 +59,19 @@ export function accountsToUpdateForTrade(inf: Inf, arg1: PkPair): Bs58Array[];
|
|
|
33
59
|
*/
|
|
34
60
|
export function updateForTrade(inf: Inf, arg1: PkPair, account_map: AccountMap): void;
|
|
35
61
|
/**
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
export function rebalanceIxs(inf: Inf, arg1: RebalanceArgs): RebalanceIxs;
|
|
39
|
-
/**
|
|
40
|
-
* @throws if no valid PDA found
|
|
41
|
-
*/
|
|
42
|
-
export function findPoolReservesAta(arg0: Bs58Array): FoundPda;
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated Protocol fee accumulator token accounts are no longer used in v2
|
|
62
|
+
* Returned accounts are deduped
|
|
45
63
|
*
|
|
46
|
-
* @throws
|
|
64
|
+
* @throws
|
|
47
65
|
*/
|
|
48
|
-
export function
|
|
66
|
+
export function accountsToUpdateForRebalance(inf: Inf, arg1: PkPair): Bs58Array[];
|
|
49
67
|
/**
|
|
50
68
|
* @throws
|
|
51
69
|
*/
|
|
52
|
-
export function
|
|
70
|
+
export function updateForRebalance(inf: Inf, arg1: PkPair, account_map: AccountMap): void;
|
|
53
71
|
/**
|
|
54
|
-
* @throws
|
|
72
|
+
* @throws if lookahead was set and failed
|
|
55
73
|
*/
|
|
56
|
-
export function
|
|
57
|
-
export function getPoolState(inf: Inf): PoolStateV2;
|
|
74
|
+
export function getPoolState(inf: Inf, lookahead?: SlotLookahead | null): PoolStateV2;
|
|
58
75
|
/**
|
|
59
76
|
* Sets the `PoolState` account data
|
|
60
77
|
*/
|
|
@@ -83,16 +100,10 @@ export function serLstStateList(inf: Inf): Uint8Array;
|
|
|
83
100
|
* @throws if `lst_state_list_data` is invalid
|
|
84
101
|
*/
|
|
85
102
|
export function deserLstStateList(inf: Inf, lst_state_list_data: Uint8Array): void;
|
|
86
|
-
/**
|
|
87
|
-
* Returned accounts are deduped
|
|
88
|
-
*
|
|
89
|
-
* @throws
|
|
90
|
-
*/
|
|
91
|
-
export function accountsToUpdateForRebalance(inf: Inf, arg1: PkPair): Bs58Array[];
|
|
92
103
|
/**
|
|
93
104
|
* @throws
|
|
94
105
|
*/
|
|
95
|
-
export function
|
|
106
|
+
export function withdrawProtocolFeesV2IxRaw(arg0: WithdrawProtocolFeesV2Args): Instruction;
|
|
96
107
|
/**
|
|
97
108
|
* Add SPL LSTs auxiliary data to support new SPL LSTs that may have previously not been covered
|
|
98
109
|
*/
|
|
@@ -109,34 +120,15 @@ export function appendSplLsts(inf: Inf, arg1: SplPoolAccounts): void;
|
|
|
109
120
|
* conversion doesnt work with bool arrays.
|
|
110
121
|
*/
|
|
111
122
|
export function hasSplData(inf: Inf, mints: Bs58Array[]): Uint8Array;
|
|
112
|
-
/**
|
|
113
|
-
* Returns the array of all possible {@link InfErr}s
|
|
114
|
-
*/
|
|
115
|
-
export function allInfErrs(): AllInfErrs;
|
|
116
|
-
export function quoteRebalance(inf: Inf, arg1: RebalanceQuoteArgs): RebalanceQuote;
|
|
117
123
|
/**
|
|
118
124
|
* @throws
|
|
119
125
|
*/
|
|
120
|
-
export function
|
|
126
|
+
export function rebalanceIxs(inf: Inf, arg1: RebalanceArgs): RebalanceIxs;
|
|
121
127
|
/**
|
|
122
|
-
* @
|
|
128
|
+
* Returns the array of all possible {@link InfErr}s
|
|
123
129
|
*/
|
|
124
|
-
export function
|
|
125
|
-
export
|
|
126
|
-
|
|
127
|
-
export interface RebalanceArgs {
|
|
128
|
-
out: bigint;
|
|
129
|
-
minStartingOutLst: bigint;
|
|
130
|
-
maxStartingInpLst: bigint;
|
|
131
|
-
mints: PkPair;
|
|
132
|
-
withdrawTo: B58PK;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface RebalanceIxs {
|
|
136
|
-
start: Instruction;
|
|
137
|
-
end: Instruction;
|
|
138
|
-
}
|
|
139
|
-
|
|
130
|
+
export function allInfErrs(): AllInfErrs;
|
|
131
|
+
export function quoteRebalance(inf: Inf, arg1: RebalanceQuoteArgs): RebalanceQuote;
|
|
140
132
|
export type FeeMint = "inp" | "out";
|
|
141
133
|
|
|
142
134
|
export interface QuoteArgs {
|
|
@@ -177,6 +169,16 @@ export interface Quote {
|
|
|
177
169
|
mints: PkPair;
|
|
178
170
|
}
|
|
179
171
|
|
|
172
|
+
export interface TradeArgs {
|
|
173
|
+
amt: bigint;
|
|
174
|
+
limit: bigint;
|
|
175
|
+
mints: PkPair;
|
|
176
|
+
signer: B58PK;
|
|
177
|
+
tokenAccs: PkPair;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export type SlotLookahead = { abs: bigint } | { rel: bigint };
|
|
181
|
+
|
|
180
182
|
export interface LstState {
|
|
181
183
|
isInputDisabled: number;
|
|
182
184
|
poolReservesBump: number;
|
|
@@ -227,6 +229,28 @@ export interface PkPair {
|
|
|
227
229
|
|
|
228
230
|
export type B58PK = Bs58Array;
|
|
229
231
|
|
|
232
|
+
export interface WithdrawProtocolFeesV2Args {
|
|
233
|
+
protocolFeeBeneficiary: B58PK;
|
|
234
|
+
withdrawTo: B58PK;
|
|
235
|
+
infMint: B58PK;
|
|
236
|
+
tokenProgram: B58PK;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export type FoundPda = [B58PK, number];
|
|
240
|
+
|
|
241
|
+
export interface RebalanceArgs {
|
|
242
|
+
out: bigint;
|
|
243
|
+
minStartingOutLst: bigint;
|
|
244
|
+
maxStartingInpLst: bigint;
|
|
245
|
+
mints: PkPair;
|
|
246
|
+
withdrawTo: B58PK;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface RebalanceIxs {
|
|
250
|
+
start: Instruction;
|
|
251
|
+
end: Instruction;
|
|
252
|
+
}
|
|
253
|
+
|
|
230
254
|
|
|
231
255
|
export type ERR_CODE_MSG_SEP = ":";
|
|
232
256
|
|
|
@@ -290,14 +314,6 @@ export interface Instruction {
|
|
|
290
314
|
programAddress: B58PK;
|
|
291
315
|
}
|
|
292
316
|
|
|
293
|
-
export interface TradeArgs {
|
|
294
|
-
amt: bigint;
|
|
295
|
-
limit: bigint;
|
|
296
|
-
mints: PkPair;
|
|
297
|
-
signer: B58PK;
|
|
298
|
-
tokenAccs: PkPair;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
317
|
export type Bs58Array = string
|
|
302
318
|
|
|
303
319
|
export class Inf {
|
|
@@ -309,19 +325,22 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
309
325
|
|
|
310
326
|
export interface InitOutput {
|
|
311
327
|
readonly memory: WebAssembly.Memory;
|
|
312
|
-
readonly
|
|
328
|
+
readonly findPoolReservesAta: (a: any) => [number, number, number];
|
|
329
|
+
readonly findProtocolFeeAccumulatorAta: (a: any) => [number, number, number];
|
|
330
|
+
readonly quoteTradeExactIn: (a: number, b: any) => [number, number, number];
|
|
331
|
+
readonly quoteTradeExactOut: (a: number, b: any) => [number, number, number];
|
|
332
|
+
readonly tradeExactInIx: (a: number, b: any) => [number, number, number];
|
|
333
|
+
readonly tradeExactOutIx: (a: number, b: any) => [number, number, number];
|
|
313
334
|
readonly initPks: () => [number, number];
|
|
314
335
|
readonly init: (a: any, b: any) => [number, number, number];
|
|
315
336
|
readonly initObj: (a: any, b: number, c: number, d: any) => [number, number, number];
|
|
316
337
|
readonly cloneInf: (a: number) => number;
|
|
317
338
|
readonly accountsToUpdateForTrade: (a: number, b: any) => [number, number, number, number];
|
|
318
339
|
readonly updateForTrade: (a: number, b: any, c: any) => [number, number];
|
|
319
|
-
readonly
|
|
320
|
-
readonly
|
|
321
|
-
readonly
|
|
322
|
-
readonly
|
|
323
|
-
readonly quoteTradeExactOut: (a: number, b: any) => [number, number, number];
|
|
324
|
-
readonly getPoolState: (a: number) => any;
|
|
340
|
+
readonly accountsToUpdateForRebalance: (a: number, b: any) => [number, number, number, number];
|
|
341
|
+
readonly updateForRebalance: (a: number, b: any, c: any) => [number, number];
|
|
342
|
+
readonly __wbg_inf_free: (a: number, b: number) => void;
|
|
343
|
+
readonly getPoolState: (a: number, b: number) => [number, number, number];
|
|
325
344
|
readonly setPoolState: (a: number, b: any) => void;
|
|
326
345
|
readonly serPoolState: (a: number) => [number, number];
|
|
327
346
|
readonly deserPoolState: (a: number, b: number, c: number) => [number, number];
|
|
@@ -329,22 +348,20 @@ export interface InitOutput {
|
|
|
329
348
|
readonly setLstStateList: (a: number, b: number, c: number) => void;
|
|
330
349
|
readonly serLstStateList: (a: number) => [number, number];
|
|
331
350
|
readonly deserLstStateList: (a: number, b: number, c: number) => [number, number];
|
|
332
|
-
readonly
|
|
333
|
-
readonly updateForRebalance: (a: number, b: any, c: any) => [number, number];
|
|
351
|
+
readonly withdrawProtocolFeesV2IxRaw: (a: any) => [number, number, number];
|
|
334
352
|
readonly appendSplLsts: (a: number, b: any) => void;
|
|
335
353
|
readonly hasSplData: (a: number, b: number, c: number) => [number, number];
|
|
354
|
+
readonly rebalanceIxs: (a: number, b: any) => [number, number, number];
|
|
336
355
|
readonly allInfErrs: () => any;
|
|
337
356
|
readonly quoteRebalance: (a: number, b: any) => [number, number, number];
|
|
338
|
-
readonly tradeExactInIx: (a: number, b: any) => [number, number, number];
|
|
339
|
-
readonly tradeExactOutIx: (a: number, b: any) => [number, number, number];
|
|
340
357
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
341
358
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
342
359
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
343
360
|
readonly __externref_table_alloc: () => number;
|
|
344
361
|
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
362
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
345
363
|
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
346
364
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
347
|
-
readonly __externref_table_dealloc: (a: number) => void;
|
|
348
365
|
readonly __wbindgen_start: () => void;
|
|
349
366
|
}
|
|
350
367
|
|