@orca-so/whirlpools-core 1.0.2 → 1.0.3
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/browser/orca_whirlpools_core_js_bindings.d.ts +40 -40
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.js +41 -41
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.wasm +0 -0
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.wasm.d.ts +2 -2
- package/dist/browser/package.json +1 -1
- package/dist/nodejs/orca_whirlpools_core_js_bindings.d.ts +40 -40
- package/dist/nodejs/orca_whirlpools_core_js_bindings.js +41 -41
- package/dist/nodejs/orca_whirlpools_core_js_bindings_bg.wasm +0 -0
- package/dist/nodejs/orca_whirlpools_core_js_bindings_bg.wasm.d.ts +2 -2
- package/dist/nodejs/package.json +1 -1
- package/package.json +5 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function
|
|
3
|
+
export function _NUM_REWARDS(): number;
|
|
4
|
+
export function _POSITION_BUNDLE_SIZE(): number;
|
|
4
5
|
export function _TICK_ARRAY_SIZE(): number;
|
|
5
6
|
export function _FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD(): number;
|
|
6
7
|
export function _MIN_TICK_INDEX(): number;
|
|
@@ -106,7 +107,7 @@ export function tickIndexToPrice(tick_index: number, decimals_a: number, decimal
|
|
|
106
107
|
* * `i32` - The tick index
|
|
107
108
|
*/
|
|
108
109
|
export function priceToTickIndex(price: number, decimals_a: number, decimals_b: number): number;
|
|
109
|
-
export function
|
|
110
|
+
export function _FEE_RATE_DENOMINATOR(): number;
|
|
110
111
|
/**
|
|
111
112
|
* Get the first tick index in the tick array that contains the specified tick index.
|
|
112
113
|
*
|
|
@@ -152,7 +153,7 @@ export function sqrtPriceToTickIndex(sqrt_price: bigint): number;
|
|
|
152
153
|
* # Returns
|
|
153
154
|
* - A i32 integer representing the previous initializable tick index
|
|
154
155
|
*/
|
|
155
|
-
export function getInitializableTickIndex(tick_index: number, tick_spacing: number, round_up?: boolean): number;
|
|
156
|
+
export function getInitializableTickIndex(tick_index: number, tick_spacing: number, round_up?: boolean | null): number;
|
|
156
157
|
/**
|
|
157
158
|
* Get the previous initializable tick index.
|
|
158
159
|
*
|
|
@@ -266,7 +267,6 @@ export function isFullRangeOnly(tick_spacing: number): boolean;
|
|
|
266
267
|
* - A u32 integer representing the tick index in the tick array
|
|
267
268
|
*/
|
|
268
269
|
export function getTickIndexInArray(tick_index: number, tick_array_start_index: number, tick_spacing: number): number;
|
|
269
|
-
export function _POSITION_BUNDLE_SIZE(): number;
|
|
270
270
|
export function _TICK_ARRAY_NOT_EVENLY_SPACED(): string;
|
|
271
271
|
export function _TICK_INDEX_OUT_OF_BOUNDS(): string;
|
|
272
272
|
export function _INVALID_TICK_INDEX(): string;
|
|
@@ -465,7 +465,7 @@ export function tryReverseApplySwapFee(amount: bigint, fee_rate: number): bigint
|
|
|
465
465
|
* # Returns
|
|
466
466
|
* The exact input or output amount for the swap transaction.
|
|
467
467
|
*/
|
|
468
|
-
export function swapQuoteByInputToken(token_in: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, whirlpool: WhirlpoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): ExactInSwapQuote;
|
|
468
|
+
export function swapQuoteByInputToken(token_in: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, whirlpool: WhirlpoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): ExactInSwapQuote;
|
|
469
469
|
/**
|
|
470
470
|
* Computes the exact input or output amount for a swap transaction.
|
|
471
471
|
*
|
|
@@ -481,7 +481,7 @@ export function swapQuoteByInputToken(token_in: bigint, specified_token_a: boole
|
|
|
481
481
|
* # Returns
|
|
482
482
|
* The exact input or output amount for the swap transaction.
|
|
483
483
|
*/
|
|
484
|
-
export function swapQuoteByOutputToken(token_out: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, whirlpool: WhirlpoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): ExactOutSwapQuote;
|
|
484
|
+
export function swapQuoteByOutputToken(token_out: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, whirlpool: WhirlpoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): ExactOutSwapQuote;
|
|
485
485
|
/**
|
|
486
486
|
* Calculate fees owed for a position
|
|
487
487
|
*
|
|
@@ -496,7 +496,7 @@ export function swapQuoteByOutputToken(token_out: bigint, specified_token_a: boo
|
|
|
496
496
|
* # Returns
|
|
497
497
|
* - `CollectFeesQuote`: The fees owed for token A and token B
|
|
498
498
|
*/
|
|
499
|
-
export function collectFeesQuote(whirlpool: WhirlpoolFacade, position: PositionFacade, tick_lower: TickFacade, tick_upper: TickFacade, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): CollectFeesQuote;
|
|
499
|
+
export function collectFeesQuote(whirlpool: WhirlpoolFacade, position: PositionFacade, tick_lower: TickFacade, tick_upper: TickFacade, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): CollectFeesQuote;
|
|
500
500
|
/**
|
|
501
501
|
* Calculate the quote for decreasing liquidity
|
|
502
502
|
*
|
|
@@ -512,7 +512,7 @@ export function collectFeesQuote(whirlpool: WhirlpoolFacade, position: PositionF
|
|
|
512
512
|
* # Returns
|
|
513
513
|
* - A DecreaseLiquidityQuote struct containing the estimated token amounts
|
|
514
514
|
*/
|
|
515
|
-
export function decreaseLiquidityQuote(liquidity_delta: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): DecreaseLiquidityQuote;
|
|
515
|
+
export function decreaseLiquidityQuote(liquidity_delta: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): DecreaseLiquidityQuote;
|
|
516
516
|
/**
|
|
517
517
|
* Calculate the quote for decreasing liquidity given a token a amount
|
|
518
518
|
*
|
|
@@ -528,7 +528,7 @@ export function decreaseLiquidityQuote(liquidity_delta: bigint, slippage_toleran
|
|
|
528
528
|
* # Returns
|
|
529
529
|
* - A DecreaseLiquidityQuote struct containing the estimated token amounts
|
|
530
530
|
*/
|
|
531
|
-
export function decreaseLiquidityQuoteA(token_amount_a: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): DecreaseLiquidityQuote;
|
|
531
|
+
export function decreaseLiquidityQuoteA(token_amount_a: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): DecreaseLiquidityQuote;
|
|
532
532
|
/**
|
|
533
533
|
* Calculate the quote for decreasing liquidity given a token b amount
|
|
534
534
|
*
|
|
@@ -544,7 +544,7 @@ export function decreaseLiquidityQuoteA(token_amount_a: bigint, slippage_toleran
|
|
|
544
544
|
* # Returns
|
|
545
545
|
* - A DecreaseLiquidityQuote struct containing the estimated token amounts
|
|
546
546
|
*/
|
|
547
|
-
export function decreaseLiquidityQuoteB(token_amount_b: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): DecreaseLiquidityQuote;
|
|
547
|
+
export function decreaseLiquidityQuoteB(token_amount_b: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): DecreaseLiquidityQuote;
|
|
548
548
|
/**
|
|
549
549
|
* Calculate the quote for increasing liquidity
|
|
550
550
|
*
|
|
@@ -560,7 +560,7 @@ export function decreaseLiquidityQuoteB(token_amount_b: bigint, slippage_toleran
|
|
|
560
560
|
* # Returns
|
|
561
561
|
* - An IncreaseLiquidityQuote struct containing the estimated token amounts
|
|
562
562
|
*/
|
|
563
|
-
export function increaseLiquidityQuote(liquidity_delta: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): IncreaseLiquidityQuote;
|
|
563
|
+
export function increaseLiquidityQuote(liquidity_delta: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): IncreaseLiquidityQuote;
|
|
564
564
|
/**
|
|
565
565
|
* Calculate the quote for increasing liquidity given a token a amount
|
|
566
566
|
*
|
|
@@ -576,7 +576,7 @@ export function increaseLiquidityQuote(liquidity_delta: bigint, slippage_toleran
|
|
|
576
576
|
* # Returns
|
|
577
577
|
* - An IncreaseLiquidityQuote struct containing the estimated token amounts
|
|
578
578
|
*/
|
|
579
|
-
export function increaseLiquidityQuoteA(token_amount_a: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): IncreaseLiquidityQuote;
|
|
579
|
+
export function increaseLiquidityQuoteA(token_amount_a: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): IncreaseLiquidityQuote;
|
|
580
580
|
/**
|
|
581
581
|
* Calculate the quote for increasing liquidity given a token b amount
|
|
582
582
|
*
|
|
@@ -592,7 +592,7 @@ export function increaseLiquidityQuoteA(token_amount_a: bigint, slippage_toleran
|
|
|
592
592
|
* # Returns
|
|
593
593
|
* - An IncreaseLiquidityQuote struct containing the estimated token amounts
|
|
594
594
|
*/
|
|
595
|
-
export function increaseLiquidityQuoteB(token_amount_b: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): IncreaseLiquidityQuote;
|
|
595
|
+
export function increaseLiquidityQuoteB(token_amount_b: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): IncreaseLiquidityQuote;
|
|
596
596
|
/**
|
|
597
597
|
* Calculate rewards owed for a position
|
|
598
598
|
*
|
|
@@ -609,33 +609,7 @@ export function increaseLiquidityQuoteB(token_amount_b: bigint, slippage_toleran
|
|
|
609
609
|
* # Returns
|
|
610
610
|
* - `CollectRewardsQuote`: The rewards owed for the 3 reward tokens.
|
|
611
611
|
*/
|
|
612
|
-
export function collectRewardsQuote(whirlpool: WhirlpoolFacade, position: PositionFacade, tick_lower: TickFacade, tick_upper: TickFacade, current_timestamp: bigint, transfer_fee_1?: TransferFee, transfer_fee_2?: TransferFee, transfer_fee_3?: TransferFee): CollectRewardsQuote;
|
|
613
|
-
export interface TransferFee {
|
|
614
|
-
feeBps: number;
|
|
615
|
-
maxFee: bigint;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
export interface IncreaseLiquidityQuote {
|
|
619
|
-
liquidityDelta: bigint;
|
|
620
|
-
tokenEstA: bigint;
|
|
621
|
-
tokenEstB: bigint;
|
|
622
|
-
tokenMaxA: bigint;
|
|
623
|
-
tokenMaxB: bigint;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
export interface DecreaseLiquidityQuote {
|
|
627
|
-
liquidityDelta: bigint;
|
|
628
|
-
tokenEstA: bigint;
|
|
629
|
-
tokenEstB: bigint;
|
|
630
|
-
tokenMinA: bigint;
|
|
631
|
-
tokenMinB: bigint;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
export interface CollectFeesQuote {
|
|
635
|
-
feeOwedA: bigint;
|
|
636
|
-
feeOwedB: bigint;
|
|
637
|
-
}
|
|
638
|
-
|
|
612
|
+
export function collectRewardsQuote(whirlpool: WhirlpoolFacade, position: PositionFacade, tick_lower: TickFacade, tick_upper: TickFacade, current_timestamp: bigint, transfer_fee_1?: TransferFee | null, transfer_fee_2?: TransferFee | null, transfer_fee_3?: TransferFee | null): CollectRewardsQuote;
|
|
639
613
|
export interface TickArrayFacade {
|
|
640
614
|
startTickIndex: number;
|
|
641
615
|
ticks: TickFacade[];
|
|
@@ -687,6 +661,32 @@ export interface WhirlpoolFacade {
|
|
|
687
661
|
rewardInfos: WhirlpoolRewardInfoFacade[];
|
|
688
662
|
}
|
|
689
663
|
|
|
664
|
+
export interface TransferFee {
|
|
665
|
+
feeBps: number;
|
|
666
|
+
maxFee: bigint;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export interface IncreaseLiquidityQuote {
|
|
670
|
+
liquidityDelta: bigint;
|
|
671
|
+
tokenEstA: bigint;
|
|
672
|
+
tokenEstB: bigint;
|
|
673
|
+
tokenMaxA: bigint;
|
|
674
|
+
tokenMaxB: bigint;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export interface DecreaseLiquidityQuote {
|
|
678
|
+
liquidityDelta: bigint;
|
|
679
|
+
tokenEstA: bigint;
|
|
680
|
+
tokenEstB: bigint;
|
|
681
|
+
tokenMinA: bigint;
|
|
682
|
+
tokenMinB: bigint;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
export interface CollectFeesQuote {
|
|
686
|
+
feeOwedA: bigint;
|
|
687
|
+
feeOwedB: bigint;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
690
|
export interface CollectRewardQuote {
|
|
691
691
|
rewardsOwed: bigint;
|
|
692
692
|
}
|
|
@@ -197,8 +197,13 @@ function getStringFromWasm0(ptr, len) {
|
|
|
197
197
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
export function
|
|
201
|
-
const ret = wasm.
|
|
200
|
+
export function _NUM_REWARDS() {
|
|
201
|
+
const ret = wasm._NUM_REWARDS();
|
|
202
|
+
return ret >>> 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function _POSITION_BUNDLE_SIZE() {
|
|
206
|
+
const ret = wasm._POSITION_BUNDLE_SIZE();
|
|
202
207
|
return ret >>> 0;
|
|
203
208
|
}
|
|
204
209
|
|
|
@@ -367,8 +372,8 @@ export function priceToTickIndex(price, decimals_a, decimals_b) {
|
|
|
367
372
|
return ret;
|
|
368
373
|
}
|
|
369
374
|
|
|
370
|
-
export function
|
|
371
|
-
const ret = wasm.
|
|
375
|
+
export function _FEE_RATE_DENOMINATOR() {
|
|
376
|
+
const ret = wasm._FEE_RATE_DENOMINATOR();
|
|
372
377
|
return ret >>> 0;
|
|
373
378
|
}
|
|
374
379
|
|
|
@@ -598,11 +603,6 @@ export function getTickIndexInArray(tick_index, tick_array_start_index, tick_spa
|
|
|
598
603
|
}
|
|
599
604
|
}
|
|
600
605
|
|
|
601
|
-
export function _POSITION_BUNDLE_SIZE() {
|
|
602
|
-
const ret = wasm._POSITION_BUNDLE_SIZE();
|
|
603
|
-
return ret >>> 0;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
606
|
export function _TICK_ARRAY_NOT_EVENLY_SPACED() {
|
|
607
607
|
try {
|
|
608
608
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -1420,31 +1420,31 @@ export function __wbg_String_eecc4a11987127d6(arg0, arg1) {
|
|
|
1420
1420
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1421
1421
|
};
|
|
1422
1422
|
|
|
1423
|
-
export function
|
|
1423
|
+
export function __wbg_buffer_609cc3eee51ed158(arg0) {
|
|
1424
1424
|
const ret = getObject(arg0).buffer;
|
|
1425
1425
|
return addHeapObject(ret);
|
|
1426
1426
|
};
|
|
1427
1427
|
|
|
1428
|
-
export function
|
|
1428
|
+
export function __wbg_call_672a4d21634d4a24() { return handleError(function (arg0, arg1) {
|
|
1429
1429
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
1430
1430
|
return addHeapObject(ret);
|
|
1431
1431
|
}, arguments) };
|
|
1432
1432
|
|
|
1433
|
-
export function
|
|
1433
|
+
export function __wbg_done_769e5ede4b31c67b(arg0) {
|
|
1434
1434
|
const ret = getObject(arg0).done;
|
|
1435
1435
|
return ret;
|
|
1436
1436
|
};
|
|
1437
1437
|
|
|
1438
|
-
export function
|
|
1439
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1440
|
-
return addHeapObject(ret);
|
|
1441
|
-
};
|
|
1442
|
-
|
|
1443
|
-
export function __wbg_get_bbccf8970793c087() { return handleError(function (arg0, arg1) {
|
|
1438
|
+
export function __wbg_get_67b2ba62fc30de12() { return handleError(function (arg0, arg1) {
|
|
1444
1439
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1445
1440
|
return addHeapObject(ret);
|
|
1446
1441
|
}, arguments) };
|
|
1447
1442
|
|
|
1443
|
+
export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
|
|
1444
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1445
|
+
return addHeapObject(ret);
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
1448
|
export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
|
|
1449
1449
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
1450
1450
|
return addHeapObject(ret);
|
|
@@ -1455,7 +1455,7 @@ export function __wbg_getwithrefkey_6550b2c093d2eb18(arg0, arg1) {
|
|
|
1455
1455
|
return addHeapObject(ret);
|
|
1456
1456
|
};
|
|
1457
1457
|
|
|
1458
|
-
export function
|
|
1458
|
+
export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
|
|
1459
1459
|
let result;
|
|
1460
1460
|
try {
|
|
1461
1461
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -1466,7 +1466,7 @@ export function __wbg_instanceof_ArrayBuffer_670ddde44cdb2602(arg0) {
|
|
|
1466
1466
|
return ret;
|
|
1467
1467
|
};
|
|
1468
1468
|
|
|
1469
|
-
export function
|
|
1469
|
+
export function __wbg_instanceof_Uint8Array_17156bcf118086a9(arg0) {
|
|
1470
1470
|
let result;
|
|
1471
1471
|
try {
|
|
1472
1472
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -1477,69 +1477,69 @@ export function __wbg_instanceof_Uint8Array_28af5bc19d6acad8(arg0) {
|
|
|
1477
1477
|
return ret;
|
|
1478
1478
|
};
|
|
1479
1479
|
|
|
1480
|
-
export function
|
|
1480
|
+
export function __wbg_isArray_a1eab7e0d067391b(arg0) {
|
|
1481
1481
|
const ret = Array.isArray(getObject(arg0));
|
|
1482
1482
|
return ret;
|
|
1483
1483
|
};
|
|
1484
1484
|
|
|
1485
|
-
export function
|
|
1485
|
+
export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) {
|
|
1486
1486
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
1487
1487
|
return ret;
|
|
1488
1488
|
};
|
|
1489
1489
|
|
|
1490
|
-
export function
|
|
1490
|
+
export function __wbg_iterator_9a24c88df860dc65() {
|
|
1491
1491
|
const ret = Symbol.iterator;
|
|
1492
1492
|
return addHeapObject(ret);
|
|
1493
1493
|
};
|
|
1494
1494
|
|
|
1495
|
-
export function
|
|
1495
|
+
export function __wbg_length_a446193dc22c12f8(arg0) {
|
|
1496
1496
|
const ret = getObject(arg0).length;
|
|
1497
1497
|
return ret;
|
|
1498
1498
|
};
|
|
1499
1499
|
|
|
1500
|
-
export function
|
|
1500
|
+
export function __wbg_length_e2d2a49132c1b256(arg0) {
|
|
1501
1501
|
const ret = getObject(arg0).length;
|
|
1502
1502
|
return ret;
|
|
1503
1503
|
};
|
|
1504
1504
|
|
|
1505
|
-
export function
|
|
1505
|
+
export function __wbg_new_405e22f390576ce2() {
|
|
1506
|
+
const ret = new Object();
|
|
1507
|
+
return addHeapObject(ret);
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
export function __wbg_new_78feb108b6472713() {
|
|
1506
1511
|
const ret = new Array();
|
|
1507
1512
|
return addHeapObject(ret);
|
|
1508
1513
|
};
|
|
1509
1514
|
|
|
1510
|
-
export function
|
|
1515
|
+
export function __wbg_new_a12002a7f91c75be(arg0) {
|
|
1511
1516
|
const ret = new Uint8Array(getObject(arg0));
|
|
1512
1517
|
return addHeapObject(ret);
|
|
1513
1518
|
};
|
|
1514
1519
|
|
|
1515
|
-
export function
|
|
1516
|
-
const ret =
|
|
1520
|
+
export function __wbg_next_25feadfc0913fea9(arg0) {
|
|
1521
|
+
const ret = getObject(arg0).next;
|
|
1517
1522
|
return addHeapObject(ret);
|
|
1518
1523
|
};
|
|
1519
1524
|
|
|
1520
|
-
export function
|
|
1525
|
+
export function __wbg_next_6574e1a8a62d1055() { return handleError(function (arg0) {
|
|
1521
1526
|
const ret = getObject(arg0).next();
|
|
1522
1527
|
return addHeapObject(ret);
|
|
1523
1528
|
}, arguments) };
|
|
1524
1529
|
|
|
1525
|
-
export function
|
|
1526
|
-
const ret = getObject(arg0).next;
|
|
1527
|
-
return addHeapObject(ret);
|
|
1528
|
-
};
|
|
1529
|
-
|
|
1530
|
-
export function __wbg_set_1d80752d0d5f0b21(arg0, arg1, arg2) {
|
|
1530
|
+
export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
|
|
1531
1531
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
1532
1532
|
};
|
|
1533
1533
|
|
|
1534
|
-
export function __wbg_set_23d69db4e5c66a6e(arg0, arg1, arg2) {
|
|
1535
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1536
|
-
};
|
|
1537
|
-
|
|
1538
1534
|
export function __wbg_set_3807d5f0bfc24aa7(arg0, arg1, arg2) {
|
|
1539
1535
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1540
1536
|
};
|
|
1541
1537
|
|
|
1542
|
-
export function
|
|
1538
|
+
export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
|
1539
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
export function __wbg_value_cd1ffa7b1ab794f1(arg0) {
|
|
1543
1543
|
const ret = getObject(arg0).value;
|
|
1544
1544
|
return addHeapObject(ret);
|
|
1545
1545
|
};
|
|
Binary file
|
|
@@ -31,7 +31,7 @@ export const tryGetMaxAmountWithSlippageTolerance: (a: number, b: bigint, c: num
|
|
|
31
31
|
export const tryGetMinAmountWithSlippageTolerance: (a: number, b: bigint, c: number) => void;
|
|
32
32
|
export const tryApplySwapFee: (a: number, b: bigint, c: number) => void;
|
|
33
33
|
export const tryReverseApplySwapFee: (a: number, b: bigint, c: number) => void;
|
|
34
|
-
export const
|
|
34
|
+
export const _FEE_RATE_DENOMINATOR: () => number;
|
|
35
35
|
export const _TICK_ARRAY_NOT_EVENLY_SPACED: (a: number) => void;
|
|
36
36
|
export const _TICK_INDEX_OUT_OF_BOUNDS: (a: number) => void;
|
|
37
37
|
export const _INVALID_TICK_INDEX: (a: number) => void;
|
|
@@ -49,7 +49,7 @@ export const _TICK_INDEX_NOT_IN_ARRAY: (a: number) => void;
|
|
|
49
49
|
export const isPositionInRange: (a: number, b: number, c: number) => number;
|
|
50
50
|
export const positionStatus: (a: number, b: number, c: number) => number;
|
|
51
51
|
export const positionRatio: (a: number, b: number, c: number) => number;
|
|
52
|
-
export const
|
|
52
|
+
export const _POSITION_BUNDLE_SIZE: () => number;
|
|
53
53
|
export const _TICK_ARRAY_SIZE: () => number;
|
|
54
54
|
export const _FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD: () => number;
|
|
55
55
|
export const _MIN_TICK_INDEX: () => number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function
|
|
3
|
+
export function _NUM_REWARDS(): number;
|
|
4
|
+
export function _POSITION_BUNDLE_SIZE(): number;
|
|
4
5
|
export function _TICK_ARRAY_SIZE(): number;
|
|
5
6
|
export function _FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD(): number;
|
|
6
7
|
export function _MIN_TICK_INDEX(): number;
|
|
@@ -106,7 +107,7 @@ export function tickIndexToPrice(tick_index: number, decimals_a: number, decimal
|
|
|
106
107
|
* * `i32` - The tick index
|
|
107
108
|
*/
|
|
108
109
|
export function priceToTickIndex(price: number, decimals_a: number, decimals_b: number): number;
|
|
109
|
-
export function
|
|
110
|
+
export function _FEE_RATE_DENOMINATOR(): number;
|
|
110
111
|
/**
|
|
111
112
|
* Get the first tick index in the tick array that contains the specified tick index.
|
|
112
113
|
*
|
|
@@ -152,7 +153,7 @@ export function sqrtPriceToTickIndex(sqrt_price: bigint): number;
|
|
|
152
153
|
* # Returns
|
|
153
154
|
* - A i32 integer representing the previous initializable tick index
|
|
154
155
|
*/
|
|
155
|
-
export function getInitializableTickIndex(tick_index: number, tick_spacing: number, round_up?: boolean): number;
|
|
156
|
+
export function getInitializableTickIndex(tick_index: number, tick_spacing: number, round_up?: boolean | null): number;
|
|
156
157
|
/**
|
|
157
158
|
* Get the previous initializable tick index.
|
|
158
159
|
*
|
|
@@ -266,7 +267,6 @@ export function isFullRangeOnly(tick_spacing: number): boolean;
|
|
|
266
267
|
* - A u32 integer representing the tick index in the tick array
|
|
267
268
|
*/
|
|
268
269
|
export function getTickIndexInArray(tick_index: number, tick_array_start_index: number, tick_spacing: number): number;
|
|
269
|
-
export function _POSITION_BUNDLE_SIZE(): number;
|
|
270
270
|
export function _TICK_ARRAY_NOT_EVENLY_SPACED(): string;
|
|
271
271
|
export function _TICK_INDEX_OUT_OF_BOUNDS(): string;
|
|
272
272
|
export function _INVALID_TICK_INDEX(): string;
|
|
@@ -465,7 +465,7 @@ export function tryReverseApplySwapFee(amount: bigint, fee_rate: number): bigint
|
|
|
465
465
|
* # Returns
|
|
466
466
|
* The exact input or output amount for the swap transaction.
|
|
467
467
|
*/
|
|
468
|
-
export function swapQuoteByInputToken(token_in: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, whirlpool: WhirlpoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): ExactInSwapQuote;
|
|
468
|
+
export function swapQuoteByInputToken(token_in: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, whirlpool: WhirlpoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): ExactInSwapQuote;
|
|
469
469
|
/**
|
|
470
470
|
* Computes the exact input or output amount for a swap transaction.
|
|
471
471
|
*
|
|
@@ -481,7 +481,7 @@ export function swapQuoteByInputToken(token_in: bigint, specified_token_a: boole
|
|
|
481
481
|
* # Returns
|
|
482
482
|
* The exact input or output amount for the swap transaction.
|
|
483
483
|
*/
|
|
484
|
-
export function swapQuoteByOutputToken(token_out: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, whirlpool: WhirlpoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): ExactOutSwapQuote;
|
|
484
|
+
export function swapQuoteByOutputToken(token_out: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, whirlpool: WhirlpoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): ExactOutSwapQuote;
|
|
485
485
|
/**
|
|
486
486
|
* Calculate fees owed for a position
|
|
487
487
|
*
|
|
@@ -496,7 +496,7 @@ export function swapQuoteByOutputToken(token_out: bigint, specified_token_a: boo
|
|
|
496
496
|
* # Returns
|
|
497
497
|
* - `CollectFeesQuote`: The fees owed for token A and token B
|
|
498
498
|
*/
|
|
499
|
-
export function collectFeesQuote(whirlpool: WhirlpoolFacade, position: PositionFacade, tick_lower: TickFacade, tick_upper: TickFacade, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): CollectFeesQuote;
|
|
499
|
+
export function collectFeesQuote(whirlpool: WhirlpoolFacade, position: PositionFacade, tick_lower: TickFacade, tick_upper: TickFacade, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): CollectFeesQuote;
|
|
500
500
|
/**
|
|
501
501
|
* Calculate the quote for decreasing liquidity
|
|
502
502
|
*
|
|
@@ -512,7 +512,7 @@ export function collectFeesQuote(whirlpool: WhirlpoolFacade, position: PositionF
|
|
|
512
512
|
* # Returns
|
|
513
513
|
* - A DecreaseLiquidityQuote struct containing the estimated token amounts
|
|
514
514
|
*/
|
|
515
|
-
export function decreaseLiquidityQuote(liquidity_delta: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): DecreaseLiquidityQuote;
|
|
515
|
+
export function decreaseLiquidityQuote(liquidity_delta: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): DecreaseLiquidityQuote;
|
|
516
516
|
/**
|
|
517
517
|
* Calculate the quote for decreasing liquidity given a token a amount
|
|
518
518
|
*
|
|
@@ -528,7 +528,7 @@ export function decreaseLiquidityQuote(liquidity_delta: bigint, slippage_toleran
|
|
|
528
528
|
* # Returns
|
|
529
529
|
* - A DecreaseLiquidityQuote struct containing the estimated token amounts
|
|
530
530
|
*/
|
|
531
|
-
export function decreaseLiquidityQuoteA(token_amount_a: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): DecreaseLiquidityQuote;
|
|
531
|
+
export function decreaseLiquidityQuoteA(token_amount_a: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): DecreaseLiquidityQuote;
|
|
532
532
|
/**
|
|
533
533
|
* Calculate the quote for decreasing liquidity given a token b amount
|
|
534
534
|
*
|
|
@@ -544,7 +544,7 @@ export function decreaseLiquidityQuoteA(token_amount_a: bigint, slippage_toleran
|
|
|
544
544
|
* # Returns
|
|
545
545
|
* - A DecreaseLiquidityQuote struct containing the estimated token amounts
|
|
546
546
|
*/
|
|
547
|
-
export function decreaseLiquidityQuoteB(token_amount_b: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): DecreaseLiquidityQuote;
|
|
547
|
+
export function decreaseLiquidityQuoteB(token_amount_b: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): DecreaseLiquidityQuote;
|
|
548
548
|
/**
|
|
549
549
|
* Calculate the quote for increasing liquidity
|
|
550
550
|
*
|
|
@@ -560,7 +560,7 @@ export function decreaseLiquidityQuoteB(token_amount_b: bigint, slippage_toleran
|
|
|
560
560
|
* # Returns
|
|
561
561
|
* - An IncreaseLiquidityQuote struct containing the estimated token amounts
|
|
562
562
|
*/
|
|
563
|
-
export function increaseLiquidityQuote(liquidity_delta: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): IncreaseLiquidityQuote;
|
|
563
|
+
export function increaseLiquidityQuote(liquidity_delta: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): IncreaseLiquidityQuote;
|
|
564
564
|
/**
|
|
565
565
|
* Calculate the quote for increasing liquidity given a token a amount
|
|
566
566
|
*
|
|
@@ -576,7 +576,7 @@ export function increaseLiquidityQuote(liquidity_delta: bigint, slippage_toleran
|
|
|
576
576
|
* # Returns
|
|
577
577
|
* - An IncreaseLiquidityQuote struct containing the estimated token amounts
|
|
578
578
|
*/
|
|
579
|
-
export function increaseLiquidityQuoteA(token_amount_a: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): IncreaseLiquidityQuote;
|
|
579
|
+
export function increaseLiquidityQuoteA(token_amount_a: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): IncreaseLiquidityQuote;
|
|
580
580
|
/**
|
|
581
581
|
* Calculate the quote for increasing liquidity given a token b amount
|
|
582
582
|
*
|
|
@@ -592,7 +592,7 @@ export function increaseLiquidityQuoteA(token_amount_a: bigint, slippage_toleran
|
|
|
592
592
|
* # Returns
|
|
593
593
|
* - An IncreaseLiquidityQuote struct containing the estimated token amounts
|
|
594
594
|
*/
|
|
595
|
-
export function increaseLiquidityQuoteB(token_amount_b: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee, transfer_fee_b?: TransferFee): IncreaseLiquidityQuote;
|
|
595
|
+
export function increaseLiquidityQuoteB(token_amount_b: bigint, slippage_tolerance_bps: number, current_sqrt_price: bigint, tick_index_1: number, tick_index_2: number, transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): IncreaseLiquidityQuote;
|
|
596
596
|
/**
|
|
597
597
|
* Calculate rewards owed for a position
|
|
598
598
|
*
|
|
@@ -609,33 +609,7 @@ export function increaseLiquidityQuoteB(token_amount_b: bigint, slippage_toleran
|
|
|
609
609
|
* # Returns
|
|
610
610
|
* - `CollectRewardsQuote`: The rewards owed for the 3 reward tokens.
|
|
611
611
|
*/
|
|
612
|
-
export function collectRewardsQuote(whirlpool: WhirlpoolFacade, position: PositionFacade, tick_lower: TickFacade, tick_upper: TickFacade, current_timestamp: bigint, transfer_fee_1?: TransferFee, transfer_fee_2?: TransferFee, transfer_fee_3?: TransferFee): CollectRewardsQuote;
|
|
613
|
-
export interface TransferFee {
|
|
614
|
-
feeBps: number;
|
|
615
|
-
maxFee: bigint;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
export interface IncreaseLiquidityQuote {
|
|
619
|
-
liquidityDelta: bigint;
|
|
620
|
-
tokenEstA: bigint;
|
|
621
|
-
tokenEstB: bigint;
|
|
622
|
-
tokenMaxA: bigint;
|
|
623
|
-
tokenMaxB: bigint;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
export interface DecreaseLiquidityQuote {
|
|
627
|
-
liquidityDelta: bigint;
|
|
628
|
-
tokenEstA: bigint;
|
|
629
|
-
tokenEstB: bigint;
|
|
630
|
-
tokenMinA: bigint;
|
|
631
|
-
tokenMinB: bigint;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
export interface CollectFeesQuote {
|
|
635
|
-
feeOwedA: bigint;
|
|
636
|
-
feeOwedB: bigint;
|
|
637
|
-
}
|
|
638
|
-
|
|
612
|
+
export function collectRewardsQuote(whirlpool: WhirlpoolFacade, position: PositionFacade, tick_lower: TickFacade, tick_upper: TickFacade, current_timestamp: bigint, transfer_fee_1?: TransferFee | null, transfer_fee_2?: TransferFee | null, transfer_fee_3?: TransferFee | null): CollectRewardsQuote;
|
|
639
613
|
export interface TickArrayFacade {
|
|
640
614
|
startTickIndex: number;
|
|
641
615
|
ticks: TickFacade[];
|
|
@@ -687,6 +661,32 @@ export interface WhirlpoolFacade {
|
|
|
687
661
|
rewardInfos: WhirlpoolRewardInfoFacade[];
|
|
688
662
|
}
|
|
689
663
|
|
|
664
|
+
export interface TransferFee {
|
|
665
|
+
feeBps: number;
|
|
666
|
+
maxFee: bigint;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export interface IncreaseLiquidityQuote {
|
|
670
|
+
liquidityDelta: bigint;
|
|
671
|
+
tokenEstA: bigint;
|
|
672
|
+
tokenEstB: bigint;
|
|
673
|
+
tokenMaxA: bigint;
|
|
674
|
+
tokenMaxB: bigint;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export interface DecreaseLiquidityQuote {
|
|
678
|
+
liquidityDelta: bigint;
|
|
679
|
+
tokenEstA: bigint;
|
|
680
|
+
tokenEstB: bigint;
|
|
681
|
+
tokenMinA: bigint;
|
|
682
|
+
tokenMinB: bigint;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
export interface CollectFeesQuote {
|
|
686
|
+
feeOwedA: bigint;
|
|
687
|
+
feeOwedB: bigint;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
690
|
export interface CollectRewardQuote {
|
|
691
691
|
rewardsOwed: bigint;
|
|
692
692
|
}
|
|
@@ -193,8 +193,13 @@ function getStringFromWasm0(ptr, len) {
|
|
|
193
193
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
module.exports.
|
|
197
|
-
const ret = wasm.
|
|
196
|
+
module.exports._NUM_REWARDS = function() {
|
|
197
|
+
const ret = wasm._NUM_REWARDS();
|
|
198
|
+
return ret >>> 0;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
module.exports._POSITION_BUNDLE_SIZE = function() {
|
|
202
|
+
const ret = wasm._POSITION_BUNDLE_SIZE();
|
|
198
203
|
return ret >>> 0;
|
|
199
204
|
};
|
|
200
205
|
|
|
@@ -363,8 +368,8 @@ module.exports.priceToTickIndex = function(price, decimals_a, decimals_b) {
|
|
|
363
368
|
return ret;
|
|
364
369
|
};
|
|
365
370
|
|
|
366
|
-
module.exports.
|
|
367
|
-
const ret = wasm.
|
|
371
|
+
module.exports._FEE_RATE_DENOMINATOR = function() {
|
|
372
|
+
const ret = wasm._FEE_RATE_DENOMINATOR();
|
|
368
373
|
return ret >>> 0;
|
|
369
374
|
};
|
|
370
375
|
|
|
@@ -594,11 +599,6 @@ module.exports.getTickIndexInArray = function(tick_index, tick_array_start_index
|
|
|
594
599
|
}
|
|
595
600
|
};
|
|
596
601
|
|
|
597
|
-
module.exports._POSITION_BUNDLE_SIZE = function() {
|
|
598
|
-
const ret = wasm._POSITION_BUNDLE_SIZE();
|
|
599
|
-
return ret >>> 0;
|
|
600
|
-
};
|
|
601
|
-
|
|
602
602
|
module.exports._TICK_ARRAY_NOT_EVENLY_SPACED = function() {
|
|
603
603
|
try {
|
|
604
604
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -1416,31 +1416,31 @@ module.exports.__wbg_String_eecc4a11987127d6 = function(arg0, arg1) {
|
|
|
1416
1416
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1417
1417
|
};
|
|
1418
1418
|
|
|
1419
|
-
module.exports.
|
|
1419
|
+
module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
1420
1420
|
const ret = getObject(arg0).buffer;
|
|
1421
1421
|
return addHeapObject(ret);
|
|
1422
1422
|
};
|
|
1423
1423
|
|
|
1424
|
-
module.exports.
|
|
1424
|
+
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
1425
1425
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
1426
1426
|
return addHeapObject(ret);
|
|
1427
1427
|
}, arguments) };
|
|
1428
1428
|
|
|
1429
|
-
module.exports.
|
|
1429
|
+
module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
1430
1430
|
const ret = getObject(arg0).done;
|
|
1431
1431
|
return ret;
|
|
1432
1432
|
};
|
|
1433
1433
|
|
|
1434
|
-
module.exports.
|
|
1435
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1436
|
-
return addHeapObject(ret);
|
|
1437
|
-
};
|
|
1438
|
-
|
|
1439
|
-
module.exports.__wbg_get_bbccf8970793c087 = function() { return handleError(function (arg0, arg1) {
|
|
1434
|
+
module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
1440
1435
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1441
1436
|
return addHeapObject(ret);
|
|
1442
1437
|
}, arguments) };
|
|
1443
1438
|
|
|
1439
|
+
module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
|
1440
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1441
|
+
return addHeapObject(ret);
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
1444
|
module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
|
1445
1445
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
1446
1446
|
return addHeapObject(ret);
|
|
@@ -1451,7 +1451,7 @@ module.exports.__wbg_getwithrefkey_6550b2c093d2eb18 = function(arg0, arg1) {
|
|
|
1451
1451
|
return addHeapObject(ret);
|
|
1452
1452
|
};
|
|
1453
1453
|
|
|
1454
|
-
module.exports.
|
|
1454
|
+
module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
1455
1455
|
let result;
|
|
1456
1456
|
try {
|
|
1457
1457
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -1462,7 +1462,7 @@ module.exports.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function(arg0) {
|
|
|
1462
1462
|
return ret;
|
|
1463
1463
|
};
|
|
1464
1464
|
|
|
1465
|
-
module.exports.
|
|
1465
|
+
module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
1466
1466
|
let result;
|
|
1467
1467
|
try {
|
|
1468
1468
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -1473,69 +1473,69 @@ module.exports.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) {
|
|
|
1473
1473
|
return ret;
|
|
1474
1474
|
};
|
|
1475
1475
|
|
|
1476
|
-
module.exports.
|
|
1476
|
+
module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
1477
1477
|
const ret = Array.isArray(getObject(arg0));
|
|
1478
1478
|
return ret;
|
|
1479
1479
|
};
|
|
1480
1480
|
|
|
1481
|
-
module.exports.
|
|
1481
|
+
module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
|
1482
1482
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
1483
1483
|
return ret;
|
|
1484
1484
|
};
|
|
1485
1485
|
|
|
1486
|
-
module.exports.
|
|
1486
|
+
module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
1487
1487
|
const ret = Symbol.iterator;
|
|
1488
1488
|
return addHeapObject(ret);
|
|
1489
1489
|
};
|
|
1490
1490
|
|
|
1491
|
-
module.exports.
|
|
1491
|
+
module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
1492
1492
|
const ret = getObject(arg0).length;
|
|
1493
1493
|
return ret;
|
|
1494
1494
|
};
|
|
1495
1495
|
|
|
1496
|
-
module.exports.
|
|
1496
|
+
module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
1497
1497
|
const ret = getObject(arg0).length;
|
|
1498
1498
|
return ret;
|
|
1499
1499
|
};
|
|
1500
1500
|
|
|
1501
|
-
module.exports.
|
|
1501
|
+
module.exports.__wbg_new_405e22f390576ce2 = function() {
|
|
1502
|
+
const ret = new Object();
|
|
1503
|
+
return addHeapObject(ret);
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
module.exports.__wbg_new_78feb108b6472713 = function() {
|
|
1502
1507
|
const ret = new Array();
|
|
1503
1508
|
return addHeapObject(ret);
|
|
1504
1509
|
};
|
|
1505
1510
|
|
|
1506
|
-
module.exports.
|
|
1511
|
+
module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
1507
1512
|
const ret = new Uint8Array(getObject(arg0));
|
|
1508
1513
|
return addHeapObject(ret);
|
|
1509
1514
|
};
|
|
1510
1515
|
|
|
1511
|
-
module.exports.
|
|
1512
|
-
const ret =
|
|
1516
|
+
module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
1517
|
+
const ret = getObject(arg0).next;
|
|
1513
1518
|
return addHeapObject(ret);
|
|
1514
1519
|
};
|
|
1515
1520
|
|
|
1516
|
-
module.exports.
|
|
1521
|
+
module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
1517
1522
|
const ret = getObject(arg0).next();
|
|
1518
1523
|
return addHeapObject(ret);
|
|
1519
1524
|
}, arguments) };
|
|
1520
1525
|
|
|
1521
|
-
module.exports.
|
|
1522
|
-
const ret = getObject(arg0).next;
|
|
1523
|
-
return addHeapObject(ret);
|
|
1524
|
-
};
|
|
1525
|
-
|
|
1526
|
-
module.exports.__wbg_set_1d80752d0d5f0b21 = function(arg0, arg1, arg2) {
|
|
1526
|
+
module.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
1527
1527
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
1528
1528
|
};
|
|
1529
1529
|
|
|
1530
|
-
module.exports.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) {
|
|
1531
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1532
|
-
};
|
|
1533
|
-
|
|
1534
1530
|
module.exports.__wbg_set_3807d5f0bfc24aa7 = function(arg0, arg1, arg2) {
|
|
1535
1531
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1536
1532
|
};
|
|
1537
1533
|
|
|
1538
|
-
module.exports.
|
|
1534
|
+
module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
1535
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1538
|
+
module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
1539
1539
|
const ret = getObject(arg0).value;
|
|
1540
1540
|
return addHeapObject(ret);
|
|
1541
1541
|
};
|
|
Binary file
|
|
@@ -31,7 +31,7 @@ export const tryGetMaxAmountWithSlippageTolerance: (a: number, b: bigint, c: num
|
|
|
31
31
|
export const tryGetMinAmountWithSlippageTolerance: (a: number, b: bigint, c: number) => void;
|
|
32
32
|
export const tryApplySwapFee: (a: number, b: bigint, c: number) => void;
|
|
33
33
|
export const tryReverseApplySwapFee: (a: number, b: bigint, c: number) => void;
|
|
34
|
-
export const
|
|
34
|
+
export const _FEE_RATE_DENOMINATOR: () => number;
|
|
35
35
|
export const _TICK_ARRAY_NOT_EVENLY_SPACED: (a: number) => void;
|
|
36
36
|
export const _TICK_INDEX_OUT_OF_BOUNDS: (a: number) => void;
|
|
37
37
|
export const _INVALID_TICK_INDEX: (a: number) => void;
|
|
@@ -49,7 +49,7 @@ export const _TICK_INDEX_NOT_IN_ARRAY: (a: number) => void;
|
|
|
49
49
|
export const isPositionInRange: (a: number, b: number, c: number) => number;
|
|
50
50
|
export const positionStatus: (a: number, b: number, c: number) => number;
|
|
51
51
|
export const positionRatio: (a: number, b: number, c: number) => number;
|
|
52
|
-
export const
|
|
52
|
+
export const _POSITION_BUNDLE_SIZE: () => number;
|
|
53
53
|
export const _TICK_ARRAY_SIZE: () => number;
|
|
54
54
|
export const _FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD: () => number;
|
|
55
55
|
export const _MIN_TICK_INDEX: () => number;
|
package/dist/nodejs/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orca-so/whirlpools-core",
|
|
3
3
|
"description": "Orca's core typescript package.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"main": "./dist/nodejs/orca_whirlpools_core_js_bindings.js",
|
|
6
6
|
"types": "./dist/nodejs/orca_whirlpools_core_js_bindings.d.ts",
|
|
7
7
|
"browser": "./dist/browser/orca_whirlpools_core_js_bindings.js",
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "wasm-pack build --release --out-dir ./dist/nodejs --target nodejs && wasm-pack build --release --out-dir ./dist/browser --target browser",
|
|
19
19
|
"test": "tsc --noEmit && vitest run tests",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"prepublishOnly": "rimraf dist/nodejs/.gitignore dist/browser/.gitignore",
|
|
21
|
+
"deploy": "sh ../../scripts/deploy-npm",
|
|
22
|
+
"clean": "cargo clean && rimraf dist"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@orca-so/whirlpools-client": "*",
|
|
25
26
|
"@orca-so/whirlpools-rust-core": "*",
|
|
26
|
-
"typescript": "^5.7.
|
|
27
|
+
"typescript": "^5.7.3",
|
|
27
28
|
"wasm-pack": "^0.13.1"
|
|
28
29
|
},
|
|
29
30
|
"repository": {
|