@sanctumso/inf1 0.0.1-dev-6 → 0.0.1-dev-8

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 CHANGED
@@ -1,23 +1,18 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function getPoolState(inf: Inf): PoolState;
3
4
  /**
4
- * Returns the array of all possible {@link InfErr}s
5
+ * Returns serialized `PoolState` account data
5
6
  */
6
- export function allInfErrs(): AllInfErrs;
7
- export function quoteRebalance(inf: Inf, arg1: RebalanceQuoteArgs): RebalanceQuote;
7
+ export function serPoolState(inf: Inf): Uint8Array;
8
8
  /**
9
- * @throws
9
+ * @throws if stored lst state list account data is invalid
10
10
  */
11
- export function quoteTradeExactIn(inf: Inf, arg1: QuoteArgs): Quote;
12
- /**
13
- * @throws
14
- */
15
- export function quoteTradeExactOut(inf: Inf, arg1: QuoteArgs): Quote;
16
- export function getPoolState(inf: Inf): PoolState;
11
+ export function getLstStateList(inf: Inf): LstState[];
17
12
  /**
18
- * @throws
13
+ * Returns serialized `LstStateList` account data
19
14
  */
20
- export function getLstStateList(inf: Inf): LstState[];
15
+ export function serLstStateList(inf: Inf): Uint8Array;
21
16
  /**
22
17
  * Returned accounts are deduped
23
18
  *
@@ -54,10 +49,19 @@ export function appendSplLsts(inf: Inf, arg1: SplPoolAccounts): void;
54
49
  * conversion doesnt work with bool arrays.
55
50
  */
56
51
  export function hasSplData(inf: Inf, mints: Bs58Array[]): Uint8Array;
52
+ /**
53
+ * Returns the array of all possible {@link InfErr}s
54
+ */
55
+ export function allInfErrs(): AllInfErrs;
56
+ export function quoteRebalance(inf: Inf, arg1: RebalanceQuoteArgs): RebalanceQuote;
57
57
  /**
58
58
  * @throws
59
59
  */
60
- export function rebalanceIxs(inf: Inf, arg1: RebalanceArgs): RebalanceIxs;
60
+ export function quoteTradeExactIn(inf: Inf, arg1: QuoteArgs): Quote;
61
+ /**
62
+ * @throws
63
+ */
64
+ export function quoteTradeExactOut(inf: Inf, arg1: QuoteArgs): Quote;
61
65
  /**
62
66
  * @throws if no valid PDA found
63
67
  */
@@ -75,7 +79,11 @@ export function tradeExactInIx(inf: Inf, arg1: TradeArgs): Instruction;
75
79
  */
76
80
  export function tradeExactOutIx(inf: Inf, arg1: TradeArgs): Instruction;
77
81
  /**
78
- * Returns the pubkeys of the accounts that need ot be fetched to initialize
82
+ * @throws
83
+ */
84
+ export function rebalanceIxs(inf: Inf, arg1: RebalanceArgs): RebalanceIxs;
85
+ /**
86
+ * Returns the pubkeys of the accounts that need to be fetched to initialize
79
87
  * a new {@link Inf} object
80
88
  */
81
89
  export function initPks(): Bs58Array[];
@@ -196,6 +204,27 @@ export interface Quote {
196
204
  mints: PkPair;
197
205
  }
198
206
 
207
+ export interface TradeArgs {
208
+ amt: bigint;
209
+ limit: bigint;
210
+ mints: PkPair;
211
+ signer: B58PK;
212
+ tokenAccs: PkPair;
213
+ }
214
+
215
+ export interface RebalanceArgs {
216
+ out: bigint;
217
+ minStartingOutLst: bigint;
218
+ maxStartingInpLst: bigint;
219
+ mints: PkPair;
220
+ withdrawTo: B58PK;
221
+ }
222
+
223
+ export interface RebalanceIxs {
224
+ start: Instruction;
225
+ end: Instruction;
226
+ }
227
+
199
228
  export interface LstState {
200
229
  isInputDisabled: number;
201
230
  poolReservesBump: number;
@@ -242,27 +271,6 @@ export interface PkPair {
242
271
 
243
272
  export type B58PK = Bs58Array;
244
273
 
245
- export interface RebalanceArgs {
246
- out: bigint;
247
- minStartingOutLst: bigint;
248
- maxStartingInpLst: bigint;
249
- mints: PkPair;
250
- withdrawTo: B58PK;
251
- }
252
-
253
- export interface RebalanceIxs {
254
- start: Instruction;
255
- end: Instruction;
256
- }
257
-
258
- export interface TradeArgs {
259
- amt: bigint;
260
- limit: bigint;
261
- mints: PkPair;
262
- signer: B58PK;
263
- tokenAccs: PkPair;
264
- }
265
-
266
274
  export type FoundPda = [B58PK, number];
267
275
 
268
276
  export type Bs58Array = string
@@ -276,12 +284,10 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
276
284
 
277
285
  export interface InitOutput {
278
286
  readonly memory: WebAssembly.Memory;
279
- readonly allInfErrs: () => any;
280
- readonly quoteRebalance: (a: number, b: any) => [number, number, number];
281
- readonly quoteTradeExactIn: (a: number, b: any) => [number, number, number];
282
- readonly quoteTradeExactOut: (a: number, b: any) => [number, number, number];
283
287
  readonly getPoolState: (a: number) => any;
288
+ readonly serPoolState: (a: number) => [number, number];
284
289
  readonly getLstStateList: (a: number) => [number, number, number, number];
290
+ readonly serLstStateList: (a: number) => [number, number];
285
291
  readonly accountsToUpdateForTrade: (a: number, b: any) => [number, number, number, number];
286
292
  readonly updateForTrade: (a: number, b: any, c: any) => [number, number];
287
293
  readonly accountsToUpdateForRebalance: (a: number, b: any) => [number, number, number, number];
@@ -289,11 +295,15 @@ export interface InitOutput {
289
295
  readonly appendSplLsts: (a: number, b: any) => void;
290
296
  readonly hasSplData: (a: number, b: number, c: number) => [number, number];
291
297
  readonly __wbg_inf_free: (a: number, b: number) => void;
292
- readonly rebalanceIxs: (a: number, b: any) => [number, number, number];
298
+ readonly allInfErrs: () => any;
299
+ readonly quoteRebalance: (a: number, b: any) => [number, number, number];
300
+ readonly quoteTradeExactIn: (a: number, b: any) => [number, number, number];
301
+ readonly quoteTradeExactOut: (a: number, b: any) => [number, number, number];
293
302
  readonly findPoolReservesAta: (a: any) => [number, number, number];
294
303
  readonly findProtocolFeeAccumulatorAta: (a: any) => [number, number, number];
295
304
  readonly tradeExactInIx: (a: number, b: any) => [number, number, number];
296
305
  readonly tradeExactOutIx: (a: number, b: any) => [number, number, number];
306
+ readonly rebalanceIxs: (a: number, b: any) => [number, number, number];
297
307
  readonly initPks: () => [number, number];
298
308
  readonly init: (a: any, b: any) => [number, number, number];
299
309
  readonly __wbindgen_malloc: (a: number, b: number) => number;
@@ -301,9 +311,9 @@ export interface InitOutput {
301
311
  readonly __wbindgen_exn_store: (a: number) => void;
302
312
  readonly __externref_table_alloc: () => number;
303
313
  readonly __wbindgen_export_4: WebAssembly.Table;
314
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
304
315
  readonly __externref_table_dealloc: (a: number) => void;
305
316
  readonly __externref_drop_slice: (a: number, b: number) => void;
306
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
307
317
  readonly __wbindgen_start: () => void;
308
318
  }
309
319