@orca-so/whirlpools-core 0.3.1 → 0.3.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 +91 -91
- package/dist/browser/orca_whirlpools_core_js_bindings.js +1 -2
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.js +429 -238
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.wasm +0 -0
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.wasm.d.ts +26 -29
- package/dist/nodejs/orca_whirlpools_core_js_bindings.d.ts +91 -91
- package/dist/nodejs/orca_whirlpools_core_js_bindings.js +429 -240
- package/dist/nodejs/orca_whirlpools_core_js_bindings_bg.wasm +0 -0
- package/dist/nodejs/orca_whirlpools_core_js_bindings_bg.wasm.d.ts +26 -29
- package/package.json +2 -2
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Get the first unoccupied position in a bundle
|
|
5
|
+
*
|
|
6
|
+
* # Arguments
|
|
7
|
+
* * `bundle` - The bundle to check
|
|
8
|
+
*
|
|
9
|
+
* # Returns
|
|
10
|
+
* * `u32` - The first unoccupied position (None if full)
|
|
11
|
+
*/
|
|
12
|
+
export function firstUnoccupiedPositionInBundle(bitmap: Uint8Array): number | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Check whether a position bundle is full
|
|
15
|
+
* A position bundle can contain 256 positions
|
|
16
|
+
*
|
|
17
|
+
* # Arguments
|
|
18
|
+
* * `bundle` - The bundle to check
|
|
19
|
+
*
|
|
20
|
+
* # Returns
|
|
21
|
+
* * `bool` - Whether the bundle is full
|
|
22
|
+
*/
|
|
23
|
+
export function isPositionBundleFull(bitmap: Uint8Array): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Check whether a position bundle is empty
|
|
26
|
+
*
|
|
27
|
+
* # Arguments
|
|
28
|
+
* * `bundle` - The bundle to check
|
|
29
|
+
*
|
|
30
|
+
* # Returns
|
|
31
|
+
* * `bool` - Whether the bundle is empty
|
|
32
|
+
*/
|
|
33
|
+
export function isPositionBundleEmpty(bitmap: Uint8Array): boolean;
|
|
3
34
|
/**
|
|
4
35
|
* Get the first tick index in the tick array that contains the specified tick index.
|
|
5
36
|
*
|
|
@@ -159,37 +190,6 @@ export function isFullRangeOnly(tick_spacing: number): boolean;
|
|
|
159
190
|
* - A u32 integer representing the tick index in the tick array
|
|
160
191
|
*/
|
|
161
192
|
export function getTickIndexInArray(tick_index: number, tick_array_start_index: number, tick_spacing: number): number;
|
|
162
|
-
/**
|
|
163
|
-
* Get the first unoccupied position in a bundle
|
|
164
|
-
*
|
|
165
|
-
* # Arguments
|
|
166
|
-
* * `bundle` - The bundle to check
|
|
167
|
-
*
|
|
168
|
-
* # Returns
|
|
169
|
-
* * `u32` - The first unoccupied position (None if full)
|
|
170
|
-
*/
|
|
171
|
-
export function firstUnoccupiedPositionInBundle(bitmap: Uint8Array): number | undefined;
|
|
172
|
-
/**
|
|
173
|
-
* Check whether a position bundle is full
|
|
174
|
-
* A position bundle can contain 256 positions
|
|
175
|
-
*
|
|
176
|
-
* # Arguments
|
|
177
|
-
* * `bundle` - The bundle to check
|
|
178
|
-
*
|
|
179
|
-
* # Returns
|
|
180
|
-
* * `bool` - Whether the bundle is full
|
|
181
|
-
*/
|
|
182
|
-
export function isPositionBundleFull(bitmap: Uint8Array): boolean;
|
|
183
|
-
/**
|
|
184
|
-
* Check whether a position bundle is empty
|
|
185
|
-
*
|
|
186
|
-
* # Arguments
|
|
187
|
-
* * `bundle` - The bundle to check
|
|
188
|
-
*
|
|
189
|
-
* # Returns
|
|
190
|
-
* * `bool` - Whether the bundle is empty
|
|
191
|
-
*/
|
|
192
|
-
export function isPositionBundleEmpty(bitmap: Uint8Array): boolean;
|
|
193
193
|
export function _POSITION_BUNDLE_SIZE(): number;
|
|
194
194
|
export function _TICK_ARRAY_NOT_EVENLY_SPACED(): number;
|
|
195
195
|
export function _TICK_INDEX_OUT_OF_BOUNDS(): number;
|
|
@@ -610,48 +610,36 @@ export function increaseLiquidityQuoteB(token_amount_b: bigint, slippage_toleran
|
|
|
610
610
|
* - `CollectRewardsQuote`: The rewards owed for the 3 reward tokens.
|
|
611
611
|
*/
|
|
612
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
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
export interface PositionFacade {
|
|
619
|
-
liquidity: bigint;
|
|
620
|
-
tickLowerIndex: number;
|
|
621
|
-
tickUpperIndex: number;
|
|
622
|
-
feeGrowthCheckpointA: bigint;
|
|
623
|
-
feeOwedA: bigint;
|
|
624
|
-
feeGrowthCheckpointB: bigint;
|
|
625
|
-
feeOwedB: bigint;
|
|
626
|
-
rewardInfos: PositionRewardInfoFacade[];
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
export type PositionStatus = "priceInRange" | "priceBelowRange" | "priceAboveRange" | "invalid";
|
|
630
|
-
|
|
631
|
-
export interface PositionRatio {
|
|
632
|
-
ratioA: number;
|
|
633
|
-
ratioB: number;
|
|
613
|
+
export interface ExactOutSwapQuote {
|
|
614
|
+
tokenOut: bigint;
|
|
615
|
+
tokenEstIn: bigint;
|
|
616
|
+
tokenMaxIn: bigint;
|
|
617
|
+
tradeFee: bigint;
|
|
634
618
|
}
|
|
635
619
|
|
|
636
|
-
export interface
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
tokenMaxB: bigint;
|
|
620
|
+
export interface ExactInSwapQuote {
|
|
621
|
+
tokenIn: bigint;
|
|
622
|
+
tokenEstOut: bigint;
|
|
623
|
+
tokenMinOut: bigint;
|
|
624
|
+
tradeFee: bigint;
|
|
642
625
|
}
|
|
643
626
|
|
|
644
|
-
export interface
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
tokenEstB: bigint;
|
|
648
|
-
tokenMinA: bigint;
|
|
649
|
-
tokenMinB: bigint;
|
|
627
|
+
export interface WhirlpoolRewardInfoFacade {
|
|
628
|
+
emissionsPerSecondX64: bigint;
|
|
629
|
+
growthGlobalX64: bigint;
|
|
650
630
|
}
|
|
651
631
|
|
|
652
|
-
export interface
|
|
653
|
-
|
|
654
|
-
|
|
632
|
+
export interface WhirlpoolFacade {
|
|
633
|
+
tickSpacing: number;
|
|
634
|
+
feeRate: number;
|
|
635
|
+
protocolFeeRate: number;
|
|
636
|
+
liquidity: bigint;
|
|
637
|
+
sqrtPrice: bigint;
|
|
638
|
+
tickCurrentIndex: number;
|
|
639
|
+
feeGrowthGlobalA: bigint;
|
|
640
|
+
feeGrowthGlobalB: bigint;
|
|
641
|
+
rewardLastUpdatedTimestamp: bigint;
|
|
642
|
+
rewardInfos: WhirlpoolRewardInfoFacade[];
|
|
655
643
|
}
|
|
656
644
|
|
|
657
645
|
export interface TransferFee {
|
|
@@ -686,35 +674,47 @@ export interface CollectRewardsQuote {
|
|
|
686
674
|
rewards: CollectRewardQuote[];
|
|
687
675
|
}
|
|
688
676
|
|
|
689
|
-
export interface
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
tokenMaxIn: bigint;
|
|
693
|
-
tradeFee: bigint;
|
|
677
|
+
export interface PositionRewardInfoFacade {
|
|
678
|
+
growthInsideCheckpoint: bigint;
|
|
679
|
+
amountOwed: bigint;
|
|
694
680
|
}
|
|
695
681
|
|
|
696
|
-
export interface
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
682
|
+
export interface PositionFacade {
|
|
683
|
+
liquidity: bigint;
|
|
684
|
+
tickLowerIndex: number;
|
|
685
|
+
tickUpperIndex: number;
|
|
686
|
+
feeGrowthCheckpointA: bigint;
|
|
687
|
+
feeOwedA: bigint;
|
|
688
|
+
feeGrowthCheckpointB: bigint;
|
|
689
|
+
feeOwedB: bigint;
|
|
690
|
+
rewardInfos: PositionRewardInfoFacade[];
|
|
701
691
|
}
|
|
702
692
|
|
|
703
|
-
export
|
|
704
|
-
|
|
705
|
-
|
|
693
|
+
export type PositionStatus = "priceInRange" | "priceBelowRange" | "priceAboveRange" | "invalid";
|
|
694
|
+
|
|
695
|
+
export interface PositionRatio {
|
|
696
|
+
ratioA: number;
|
|
697
|
+
ratioB: number;
|
|
706
698
|
}
|
|
707
699
|
|
|
708
|
-
export interface
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
700
|
+
export interface IncreaseLiquidityQuote {
|
|
701
|
+
liquidityDelta: bigint;
|
|
702
|
+
tokenEstA: bigint;
|
|
703
|
+
tokenEstB: bigint;
|
|
704
|
+
tokenMaxA: bigint;
|
|
705
|
+
tokenMaxB: bigint;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
export interface DecreaseLiquidityQuote {
|
|
709
|
+
liquidityDelta: bigint;
|
|
710
|
+
tokenEstA: bigint;
|
|
711
|
+
tokenEstB: bigint;
|
|
712
|
+
tokenMinA: bigint;
|
|
713
|
+
tokenMinB: bigint;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export interface CollectFeesQuote {
|
|
717
|
+
feeOwedA: bigint;
|
|
718
|
+
feeOwedB: bigint;
|
|
719
719
|
}
|
|
720
720
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as wasm from "./orca_whirlpools_core_js_bindings_bg.wasm";
|
|
2
2
|
export * from "./orca_whirlpools_core_js_bindings_bg.js";
|
|
3
3
|
import { __wbg_set_wasm } from "./orca_whirlpools_core_js_bindings_bg.js";
|
|
4
|
-
__wbg_set_wasm(wasm);
|
|
5
|
-
wasm.__wbindgen_start();
|
|
4
|
+
__wbg_set_wasm(wasm);
|