@crypticdot/defituna-core 3.4.1 → 3.4.2
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/defituna_core_js_bindings.d.ts +65 -29
- package/dist/browser/defituna_core_js_bindings_bg.js +76 -45
- package/dist/browser/defituna_core_js_bindings_bg.wasm +0 -0
- package/dist/browser/defituna_core_js_bindings_bg.wasm.d.ts +9 -5
- package/dist/nodejs/defituna_core_js_bindings.d.ts +65 -29
- package/dist/nodejs/defituna_core_js_bindings.js +76 -45
- package/dist/nodejs/defituna_core_js_bindings_bg.wasm +0 -0
- package/dist/nodejs/defituna_core_js_bindings_bg.wasm.d.ts +9 -5
- package/package.json +2 -2
|
@@ -599,23 +599,6 @@ export function tickIndexToPrice(tick_index: number, decimals_a: number, decimal
|
|
|
599
599
|
* * `i32` - The tick index
|
|
600
600
|
*/
|
|
601
601
|
export function priceToTickIndex(price: number, decimals_a: number, decimals_b: number): number;
|
|
602
|
-
/**
|
|
603
|
-
* Computes the liquidation prices for an existing position.
|
|
604
|
-
*
|
|
605
|
-
* # Parameters
|
|
606
|
-
* - `lower_tick_index`: The lower tick index of the position.
|
|
607
|
-
* - `upper_tick_index`: The upper tick index of the position.
|
|
608
|
-
* - `leftovers_a`: The amount of leftovers A in the position.
|
|
609
|
-
* - `leftovers_a`: The amount of leftovers B in the position.
|
|
610
|
-
* - `liquidity`: Liquidity of the position.
|
|
611
|
-
* - `debt_a`: The amount of tokens A borrowed.
|
|
612
|
-
* - `debt_b`: The amount of tokens B borrowed.
|
|
613
|
-
* - `liquidation_threshold`: The liquidation threshold of the market.
|
|
614
|
-
*
|
|
615
|
-
* # Returns
|
|
616
|
-
* - `LiquidationPrices`: An object containing lower/upper liquidation prices.
|
|
617
|
-
*/
|
|
618
|
-
export function getLpPositionLiquidationPrices(lower_tick_index: number, upper_tick_index: number, liquidity: bigint, leftovers_a: bigint, leftovers_b: bigint, debt_a: bigint, debt_b: bigint, liquidation_threshold: number): LiquidationPrices;
|
|
619
602
|
/**
|
|
620
603
|
* Computes the exact input or output amount for a swap transaction.
|
|
621
604
|
*
|
|
@@ -648,6 +631,26 @@ export function swapQuoteByInputToken(token_in: bigint, specified_token_a: boole
|
|
|
648
631
|
* The exact input or output amount for the swap transaction.
|
|
649
632
|
*/
|
|
650
633
|
export function swapQuoteByOutputToken(token_out: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, fusion_pool: FusionPoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): ExactOutSwapQuote;
|
|
634
|
+
/**
|
|
635
|
+
* Computes the liquidation prices for an existing position.
|
|
636
|
+
*
|
|
637
|
+
* # Parameters
|
|
638
|
+
* - `tick_lower_index`: The lower tick index of the position.
|
|
639
|
+
* - `tick_upper_index`: The upper tick index of the position.
|
|
640
|
+
* - `leftovers_a`: The amount of leftovers A in the position.
|
|
641
|
+
* - `leftovers_a`: The amount of leftovers B in the position.
|
|
642
|
+
* - `liquidity`: Liquidity of the position.
|
|
643
|
+
* - `debt_a`: The amount of tokens A borrowed.
|
|
644
|
+
* - `debt_b`: The amount of tokens B borrowed.
|
|
645
|
+
* - `liquidation_threshold`: The liquidation threshold of the market.
|
|
646
|
+
*
|
|
647
|
+
* # Returns
|
|
648
|
+
* - `LiquidationPrices`: An object containing lower/upper liquidation prices.
|
|
649
|
+
*/
|
|
650
|
+
export function getLpPositionLiquidationPrices(tick_lower_index: number, tick_upper_index: number, liquidity: bigint, leftovers_a: bigint, leftovers_b: bigint, debt_a: bigint, debt_b: bigint, liquidation_threshold: number): LiquidationPrices;
|
|
651
|
+
export function getIncreaseLpPositionQuote(args: IncreaseLpPositionQuoteArgs): IncreaseLpPositionQuoteResult;
|
|
652
|
+
export function _HUNDRED_PERCENT(): number;
|
|
653
|
+
export function _COMPUTED_AMOUNT(): bigint;
|
|
651
654
|
/**
|
|
652
655
|
* Spot position increase quote
|
|
653
656
|
*
|
|
@@ -718,6 +721,7 @@ export function getSpotPositionLiquidationPrice(position_token: number, amount:
|
|
|
718
721
|
*/
|
|
719
722
|
export function getTradableAmount(collateral_token: number, available_balance: bigint, leverage: number, position_token: number, position_amount: bigint, protocol_fee_rate: number, protocol_fee_rate_on_collateral: number, fusion_pool: FusionPoolFacade, increase: boolean): bigint;
|
|
720
723
|
export function calculateTunaSpotPositionProtocolFee(collateral_token: number, borrowed_token: number, collateral: bigint, borrow: bigint, protocol_fee_rate_on_collateral: number, protocol_fee_rate: number): TokenPair;
|
|
724
|
+
export function calculateTunaProtocolFee(collateral: bigint, borrow: bigint, protocol_fee_rate_on_collateral: number, protocol_fee_rate: number): bigint;
|
|
721
725
|
export function _INVALID_ARGUMENTS(): string;
|
|
722
726
|
export function _JUPITER_QUOTE_REQUEST_ERROR(): string;
|
|
723
727
|
export function _JUPITER_SWAP_INSTRUCTIONS_REQUEST_ERROR(): string;
|
|
@@ -844,18 +848,36 @@ export interface TransferFee {
|
|
|
844
848
|
maxFee: bigint;
|
|
845
849
|
}
|
|
846
850
|
|
|
847
|
-
export interface
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
851
|
+
export interface IncreaseLpPositionQuoteResult {
|
|
852
|
+
collateralA: bigint;
|
|
853
|
+
collateralB: bigint;
|
|
854
|
+
maxCollateralA: bigint;
|
|
855
|
+
maxCollateralB: bigint;
|
|
856
|
+
borrowA: bigint;
|
|
857
|
+
borrowB: bigint;
|
|
858
|
+
totalA: bigint;
|
|
859
|
+
totalB: bigint;
|
|
860
|
+
minTotalA: bigint;
|
|
861
|
+
minTotalB: bigint;
|
|
862
|
+
swapInput: bigint;
|
|
863
|
+
swapOutput: bigint;
|
|
864
|
+
swapAToB: boolean;
|
|
865
|
+
protocolFeeA: bigint;
|
|
866
|
+
protocolFeeB: bigint;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export interface IncreaseLpPositionQuoteArgs {
|
|
870
|
+
collateralA: bigint;
|
|
871
|
+
collateralB: bigint;
|
|
872
|
+
borrowA: bigint;
|
|
873
|
+
borrowB: bigint;
|
|
874
|
+
protocolFeeRate: number;
|
|
875
|
+
protocolFeeRateOnCollateral: number;
|
|
876
|
+
swapFeeRate: number;
|
|
877
|
+
sqrtPrice: bigint;
|
|
878
|
+
tickLowerIndex: number;
|
|
879
|
+
tickUpperIndex: number;
|
|
880
|
+
maxAmountSlippage: number;
|
|
859
881
|
}
|
|
860
882
|
|
|
861
883
|
export interface LiquidationPrices {
|
|
@@ -891,6 +913,20 @@ export interface DecreaseSpotPositionQuoteResult {
|
|
|
891
913
|
jupiterSwapIx: SwapInstruction | undefined;
|
|
892
914
|
}
|
|
893
915
|
|
|
916
|
+
export interface TunaSpotPositionFacade {
|
|
917
|
+
version: number;
|
|
918
|
+
marketMaker: number;
|
|
919
|
+
positionToken: number;
|
|
920
|
+
collateralToken: number;
|
|
921
|
+
flags: number;
|
|
922
|
+
amount: bigint;
|
|
923
|
+
loanShares: bigint;
|
|
924
|
+
loanFunds: bigint;
|
|
925
|
+
entrySqrtPrice: bigint;
|
|
926
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
927
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
928
|
+
}
|
|
929
|
+
|
|
894
930
|
/**
|
|
895
931
|
* A hash; the 32-byte output of a hashing algorithm.
|
|
896
932
|
*
|
|
@@ -1594,25 +1594,24 @@ export function priceToTickIndex(price, decimals_a, decimals_b) {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
|
|
1596
1596
|
/**
|
|
1597
|
-
* Computes the
|
|
1597
|
+
* Computes the exact input or output amount for a swap transaction.
|
|
1598
1598
|
*
|
|
1599
|
-
* #
|
|
1600
|
-
* - `
|
|
1601
|
-
* - `
|
|
1602
|
-
* - `
|
|
1603
|
-
* - `
|
|
1604
|
-
* - `
|
|
1605
|
-
* - `
|
|
1606
|
-
* - `
|
|
1607
|
-
* - `liquidation_threshold`: The liquidation threshold of the market.
|
|
1599
|
+
* # Arguments
|
|
1600
|
+
* - `token_in`: The input token amount.
|
|
1601
|
+
* - `specified_token_a`: If `true`, the input token is token A. Otherwise, it is token B.
|
|
1602
|
+
* - `slippage_tolerance`: The slippage tolerance in basis points.
|
|
1603
|
+
* - `fusion_pool`: The fusion_pool state.
|
|
1604
|
+
* - `tick_arrays`: The tick arrays needed for the swap.
|
|
1605
|
+
* - `transfer_fee_a`: The transfer fee for token A.
|
|
1606
|
+
* - `transfer_fee_b`: The transfer fee for token B.
|
|
1608
1607
|
*
|
|
1609
1608
|
* # Returns
|
|
1610
|
-
*
|
|
1609
|
+
* The exact input or output amount for the swap transaction.
|
|
1611
1610
|
*/
|
|
1612
|
-
export function
|
|
1611
|
+
export function swapQuoteByInputToken(token_in, specified_token_a, slippage_tolerance_bps, fusion_pool, tick_arrays, transfer_fee_a, transfer_fee_b) {
|
|
1613
1612
|
try {
|
|
1614
1613
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1615
|
-
wasm.
|
|
1614
|
+
wasm.swapQuoteByInputToken(retptr, token_in, specified_token_a, slippage_tolerance_bps, addHeapObject(fusion_pool), addHeapObject(tick_arrays), isLikeNone(transfer_fee_a) ? 0 : addHeapObject(transfer_fee_a), isLikeNone(transfer_fee_b) ? 0 : addHeapObject(transfer_fee_b));
|
|
1616
1615
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1617
1616
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1618
1617
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1629,8 +1628,8 @@ export function getLpPositionLiquidationPrices(lower_tick_index, upper_tick_inde
|
|
|
1629
1628
|
* Computes the exact input or output amount for a swap transaction.
|
|
1630
1629
|
*
|
|
1631
1630
|
* # Arguments
|
|
1632
|
-
* - `
|
|
1633
|
-
* - `specified_token_a`: If `true`, the
|
|
1631
|
+
* - `token_out`: The output token amount.
|
|
1632
|
+
* - `specified_token_a`: If `true`, the output token is token A. Otherwise, it is token B.
|
|
1634
1633
|
* - `slippage_tolerance`: The slippage tolerance in basis points.
|
|
1635
1634
|
* - `fusion_pool`: The fusion_pool state.
|
|
1636
1635
|
* - `tick_arrays`: The tick arrays needed for the swap.
|
|
@@ -1640,10 +1639,10 @@ export function getLpPositionLiquidationPrices(lower_tick_index, upper_tick_inde
|
|
|
1640
1639
|
* # Returns
|
|
1641
1640
|
* The exact input or output amount for the swap transaction.
|
|
1642
1641
|
*/
|
|
1643
|
-
export function
|
|
1642
|
+
export function swapQuoteByOutputToken(token_out, specified_token_a, slippage_tolerance_bps, fusion_pool, tick_arrays, transfer_fee_a, transfer_fee_b) {
|
|
1644
1643
|
try {
|
|
1645
1644
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1646
|
-
wasm.
|
|
1645
|
+
wasm.swapQuoteByOutputToken(retptr, token_out, specified_token_a, slippage_tolerance_bps, addHeapObject(fusion_pool), addHeapObject(tick_arrays), isLikeNone(transfer_fee_a) ? 0 : addHeapObject(transfer_fee_a), isLikeNone(transfer_fee_b) ? 0 : addHeapObject(transfer_fee_b));
|
|
1647
1646
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1648
1647
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1649
1648
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1657,24 +1656,25 @@ export function swapQuoteByInputToken(token_in, specified_token_a, slippage_tole
|
|
|
1657
1656
|
}
|
|
1658
1657
|
|
|
1659
1658
|
/**
|
|
1660
|
-
* Computes the
|
|
1659
|
+
* Computes the liquidation prices for an existing position.
|
|
1661
1660
|
*
|
|
1662
|
-
* #
|
|
1663
|
-
* - `
|
|
1664
|
-
* - `
|
|
1665
|
-
* - `
|
|
1666
|
-
* - `
|
|
1667
|
-
* - `
|
|
1668
|
-
* - `
|
|
1669
|
-
* - `
|
|
1661
|
+
* # Parameters
|
|
1662
|
+
* - `tick_lower_index`: The lower tick index of the position.
|
|
1663
|
+
* - `tick_upper_index`: The upper tick index of the position.
|
|
1664
|
+
* - `leftovers_a`: The amount of leftovers A in the position.
|
|
1665
|
+
* - `leftovers_a`: The amount of leftovers B in the position.
|
|
1666
|
+
* - `liquidity`: Liquidity of the position.
|
|
1667
|
+
* - `debt_a`: The amount of tokens A borrowed.
|
|
1668
|
+
* - `debt_b`: The amount of tokens B borrowed.
|
|
1669
|
+
* - `liquidation_threshold`: The liquidation threshold of the market.
|
|
1670
1670
|
*
|
|
1671
1671
|
* # Returns
|
|
1672
|
-
*
|
|
1672
|
+
* - `LiquidationPrices`: An object containing lower/upper liquidation prices.
|
|
1673
1673
|
*/
|
|
1674
|
-
export function
|
|
1674
|
+
export function getLpPositionLiquidationPrices(tick_lower_index, tick_upper_index, liquidity, leftovers_a, leftovers_b, debt_a, debt_b, liquidation_threshold) {
|
|
1675
1675
|
try {
|
|
1676
1676
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1677
|
-
wasm.
|
|
1677
|
+
wasm.getLpPositionLiquidationPrices(retptr, tick_lower_index, tick_upper_index, addHeapObject(liquidity), leftovers_a, leftovers_b, debt_a, debt_b, liquidation_threshold);
|
|
1678
1678
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1679
1679
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1680
1680
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1687,6 +1687,32 @@ export function swapQuoteByOutputToken(token_out, specified_token_a, slippage_to
|
|
|
1687
1687
|
}
|
|
1688
1688
|
}
|
|
1689
1689
|
|
|
1690
|
+
export function getIncreaseLpPositionQuote(args) {
|
|
1691
|
+
try {
|
|
1692
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1693
|
+
wasm.getIncreaseLpPositionQuote(retptr, addHeapObject(args));
|
|
1694
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1695
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1696
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1697
|
+
if (r2) {
|
|
1698
|
+
throw takeObject(r1);
|
|
1699
|
+
}
|
|
1700
|
+
return takeObject(r0);
|
|
1701
|
+
} finally {
|
|
1702
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
export function _HUNDRED_PERCENT() {
|
|
1707
|
+
const ret = wasm._HUNDRED_PERCENT();
|
|
1708
|
+
return ret >>> 0;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
export function _COMPUTED_AMOUNT() {
|
|
1712
|
+
const ret = wasm._COMPUTED_AMOUNT();
|
|
1713
|
+
return BigInt.asUintN(64, ret);
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1690
1716
|
/**
|
|
1691
1717
|
* Spot position increase quote
|
|
1692
1718
|
*
|
|
@@ -1807,6 +1833,11 @@ export function calculateTunaSpotPositionProtocolFee(collateral_token, borrowed_
|
|
|
1807
1833
|
return takeObject(ret);
|
|
1808
1834
|
}
|
|
1809
1835
|
|
|
1836
|
+
export function calculateTunaProtocolFee(collateral, borrow, protocol_fee_rate_on_collateral, protocol_fee_rate) {
|
|
1837
|
+
const ret = wasm.calculateTunaProtocolFee(collateral, borrow, protocol_fee_rate_on_collateral, protocol_fee_rate);
|
|
1838
|
+
return BigInt.asUintN(64, ret);
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1810
1841
|
export function _INVALID_ARGUMENTS() {
|
|
1811
1842
|
try {
|
|
1812
1843
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -1850,12 +1881,12 @@ export function solana_program_init() {
|
|
|
1850
1881
|
wasm.solana_program_init();
|
|
1851
1882
|
}
|
|
1852
1883
|
|
|
1853
|
-
function
|
|
1854
|
-
wasm.
|
|
1884
|
+
function __wasm_bindgen_func_elem_2635(arg0, arg1, arg2) {
|
|
1885
|
+
wasm.__wasm_bindgen_func_elem_2635(arg0, arg1, addHeapObject(arg2));
|
|
1855
1886
|
}
|
|
1856
1887
|
|
|
1857
|
-
function
|
|
1858
|
-
wasm.
|
|
1888
|
+
function __wasm_bindgen_func_elem_3208(arg0, arg1) {
|
|
1889
|
+
wasm.__wasm_bindgen_func_elem_3208(arg0, arg1);
|
|
1859
1890
|
}
|
|
1860
1891
|
|
|
1861
1892
|
function __wasm_bindgen_func_elem_495(arg0, arg1, arg2, arg3) {
|
|
@@ -3266,27 +3297,27 @@ export function __wbg_warn_1d74dddbe2fd1dbb(arg0) {
|
|
|
3266
3297
|
console.warn(getObject(arg0));
|
|
3267
3298
|
};
|
|
3268
3299
|
|
|
3269
|
-
export function
|
|
3270
|
-
// Cast intrinsic for `
|
|
3271
|
-
const ret =
|
|
3300
|
+
export function __wbindgen_cast_0660a350899916ec(arg0, arg1) {
|
|
3301
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 360, function: Function { arguments: [], shim_idx: 361, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3302
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3204, __wasm_bindgen_func_elem_3208);
|
|
3272
3303
|
return addHeapObject(ret);
|
|
3273
3304
|
};
|
|
3274
3305
|
|
|
3275
|
-
export function
|
|
3276
|
-
// Cast intrinsic for `
|
|
3277
|
-
const ret =
|
|
3306
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
3307
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
3308
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
3278
3309
|
return addHeapObject(ret);
|
|
3279
3310
|
};
|
|
3280
3311
|
|
|
3281
|
-
export function
|
|
3282
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3283
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
3312
|
+
export function __wbindgen_cast_2e5f7f1574aa20c6(arg0, arg1) {
|
|
3313
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 232, function: Function { arguments: [Externref], shim_idx: 227, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3314
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_2654, __wasm_bindgen_func_elem_2635);
|
|
3284
3315
|
return addHeapObject(ret);
|
|
3285
3316
|
};
|
|
3286
3317
|
|
|
3287
|
-
export function
|
|
3288
|
-
// Cast intrinsic for `
|
|
3289
|
-
const ret =
|
|
3318
|
+
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
3319
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
3320
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
3290
3321
|
return addHeapObject(ret);
|
|
3291
3322
|
};
|
|
3292
3323
|
|
|
Binary file
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const getLpPositionLiquidationPrices: (a: number, b: number, c: number, d: number, e: bigint, f: bigint, g: bigint, h: bigint, i: number) => void;
|
|
5
|
+
export const getIncreaseLpPositionQuote: (a: number, b: number) => void;
|
|
4
6
|
export const _INVALID_ARGUMENTS: (a: number) => void;
|
|
5
7
|
export const _JUPITER_QUOTE_REQUEST_ERROR: (a: number) => void;
|
|
6
8
|
export const _JUPITER_SWAP_INSTRUCTIONS_REQUEST_ERROR: (a: number) => void;
|
|
9
|
+
export const _HUNDRED_PERCENT: () => number;
|
|
10
|
+
export const _COMPUTED_AMOUNT: () => bigint;
|
|
7
11
|
export const getIncreaseSpotPositionQuote: (a: bigint, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
|
|
8
12
|
export const getDecreaseSpotPositionQuote: (a: bigint, b: number, c: number, d: number, e: number, f: bigint, g: bigint, h: number, i: number, j: number, k: number) => number;
|
|
9
13
|
export const getSpotPositionLiquidationPrice: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
10
14
|
export const getTradableAmount: (a: number, b: number, c: bigint, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number) => void;
|
|
11
15
|
export const calculateTunaSpotPositionProtocolFee: (a: number, b: number, c: bigint, d: bigint, e: number, f: number) => number;
|
|
12
|
-
export const
|
|
16
|
+
export const calculateTunaProtocolFee: (a: bigint, b: bigint, c: number, d: number) => bigint;
|
|
13
17
|
export const __wbg_transaction_free: (a: number, b: number) => void;
|
|
14
18
|
export const transaction_constructor: (a: number, b: number) => number;
|
|
15
19
|
export const transaction_message: (a: number) => number;
|
|
@@ -137,10 +141,10 @@ export const getFullRangeTickIndexes: (a: number) => number;
|
|
|
137
141
|
export const orderTickIndexes: (a: number, b: number) => number;
|
|
138
142
|
export const isFullRangeOnly: (a: number) => number;
|
|
139
143
|
export const getTickIndexInArray: (a: number, b: number, c: number, d: number) => void;
|
|
140
|
-
export const
|
|
141
|
-
export const
|
|
142
|
-
export const
|
|
143
|
-
export const
|
|
144
|
+
export const __wasm_bindgen_func_elem_2635: (a: number, b: number, c: number) => void;
|
|
145
|
+
export const __wasm_bindgen_func_elem_2654: (a: number, b: number) => void;
|
|
146
|
+
export const __wasm_bindgen_func_elem_3208: (a: number, b: number) => void;
|
|
147
|
+
export const __wasm_bindgen_func_elem_3204: (a: number, b: number) => void;
|
|
144
148
|
export const __wasm_bindgen_func_elem_495: (a: number, b: number, c: number, d: number) => void;
|
|
145
149
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
146
150
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -599,23 +599,6 @@ export function tickIndexToPrice(tick_index: number, decimals_a: number, decimal
|
|
|
599
599
|
* * `i32` - The tick index
|
|
600
600
|
*/
|
|
601
601
|
export function priceToTickIndex(price: number, decimals_a: number, decimals_b: number): number;
|
|
602
|
-
/**
|
|
603
|
-
* Computes the liquidation prices for an existing position.
|
|
604
|
-
*
|
|
605
|
-
* # Parameters
|
|
606
|
-
* - `lower_tick_index`: The lower tick index of the position.
|
|
607
|
-
* - `upper_tick_index`: The upper tick index of the position.
|
|
608
|
-
* - `leftovers_a`: The amount of leftovers A in the position.
|
|
609
|
-
* - `leftovers_a`: The amount of leftovers B in the position.
|
|
610
|
-
* - `liquidity`: Liquidity of the position.
|
|
611
|
-
* - `debt_a`: The amount of tokens A borrowed.
|
|
612
|
-
* - `debt_b`: The amount of tokens B borrowed.
|
|
613
|
-
* - `liquidation_threshold`: The liquidation threshold of the market.
|
|
614
|
-
*
|
|
615
|
-
* # Returns
|
|
616
|
-
* - `LiquidationPrices`: An object containing lower/upper liquidation prices.
|
|
617
|
-
*/
|
|
618
|
-
export function getLpPositionLiquidationPrices(lower_tick_index: number, upper_tick_index: number, liquidity: bigint, leftovers_a: bigint, leftovers_b: bigint, debt_a: bigint, debt_b: bigint, liquidation_threshold: number): LiquidationPrices;
|
|
619
602
|
/**
|
|
620
603
|
* Computes the exact input or output amount for a swap transaction.
|
|
621
604
|
*
|
|
@@ -648,6 +631,26 @@ export function swapQuoteByInputToken(token_in: bigint, specified_token_a: boole
|
|
|
648
631
|
* The exact input or output amount for the swap transaction.
|
|
649
632
|
*/
|
|
650
633
|
export function swapQuoteByOutputToken(token_out: bigint, specified_token_a: boolean, slippage_tolerance_bps: number, fusion_pool: FusionPoolFacade, tick_arrays: TickArrayFacade[], transfer_fee_a?: TransferFee | null, transfer_fee_b?: TransferFee | null): ExactOutSwapQuote;
|
|
634
|
+
/**
|
|
635
|
+
* Computes the liquidation prices for an existing position.
|
|
636
|
+
*
|
|
637
|
+
* # Parameters
|
|
638
|
+
* - `tick_lower_index`: The lower tick index of the position.
|
|
639
|
+
* - `tick_upper_index`: The upper tick index of the position.
|
|
640
|
+
* - `leftovers_a`: The amount of leftovers A in the position.
|
|
641
|
+
* - `leftovers_a`: The amount of leftovers B in the position.
|
|
642
|
+
* - `liquidity`: Liquidity of the position.
|
|
643
|
+
* - `debt_a`: The amount of tokens A borrowed.
|
|
644
|
+
* - `debt_b`: The amount of tokens B borrowed.
|
|
645
|
+
* - `liquidation_threshold`: The liquidation threshold of the market.
|
|
646
|
+
*
|
|
647
|
+
* # Returns
|
|
648
|
+
* - `LiquidationPrices`: An object containing lower/upper liquidation prices.
|
|
649
|
+
*/
|
|
650
|
+
export function getLpPositionLiquidationPrices(tick_lower_index: number, tick_upper_index: number, liquidity: bigint, leftovers_a: bigint, leftovers_b: bigint, debt_a: bigint, debt_b: bigint, liquidation_threshold: number): LiquidationPrices;
|
|
651
|
+
export function getIncreaseLpPositionQuote(args: IncreaseLpPositionQuoteArgs): IncreaseLpPositionQuoteResult;
|
|
652
|
+
export function _HUNDRED_PERCENT(): number;
|
|
653
|
+
export function _COMPUTED_AMOUNT(): bigint;
|
|
651
654
|
/**
|
|
652
655
|
* Spot position increase quote
|
|
653
656
|
*
|
|
@@ -718,6 +721,7 @@ export function getSpotPositionLiquidationPrice(position_token: number, amount:
|
|
|
718
721
|
*/
|
|
719
722
|
export function getTradableAmount(collateral_token: number, available_balance: bigint, leverage: number, position_token: number, position_amount: bigint, protocol_fee_rate: number, protocol_fee_rate_on_collateral: number, fusion_pool: FusionPoolFacade, increase: boolean): bigint;
|
|
720
723
|
export function calculateTunaSpotPositionProtocolFee(collateral_token: number, borrowed_token: number, collateral: bigint, borrow: bigint, protocol_fee_rate_on_collateral: number, protocol_fee_rate: number): TokenPair;
|
|
724
|
+
export function calculateTunaProtocolFee(collateral: bigint, borrow: bigint, protocol_fee_rate_on_collateral: number, protocol_fee_rate: number): bigint;
|
|
721
725
|
export function _INVALID_ARGUMENTS(): string;
|
|
722
726
|
export function _JUPITER_QUOTE_REQUEST_ERROR(): string;
|
|
723
727
|
export function _JUPITER_SWAP_INSTRUCTIONS_REQUEST_ERROR(): string;
|
|
@@ -844,18 +848,36 @@ export interface TransferFee {
|
|
|
844
848
|
maxFee: bigint;
|
|
845
849
|
}
|
|
846
850
|
|
|
847
|
-
export interface
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
851
|
+
export interface IncreaseLpPositionQuoteResult {
|
|
852
|
+
collateralA: bigint;
|
|
853
|
+
collateralB: bigint;
|
|
854
|
+
maxCollateralA: bigint;
|
|
855
|
+
maxCollateralB: bigint;
|
|
856
|
+
borrowA: bigint;
|
|
857
|
+
borrowB: bigint;
|
|
858
|
+
totalA: bigint;
|
|
859
|
+
totalB: bigint;
|
|
860
|
+
minTotalA: bigint;
|
|
861
|
+
minTotalB: bigint;
|
|
862
|
+
swapInput: bigint;
|
|
863
|
+
swapOutput: bigint;
|
|
864
|
+
swapAToB: boolean;
|
|
865
|
+
protocolFeeA: bigint;
|
|
866
|
+
protocolFeeB: bigint;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export interface IncreaseLpPositionQuoteArgs {
|
|
870
|
+
collateralA: bigint;
|
|
871
|
+
collateralB: bigint;
|
|
872
|
+
borrowA: bigint;
|
|
873
|
+
borrowB: bigint;
|
|
874
|
+
protocolFeeRate: number;
|
|
875
|
+
protocolFeeRateOnCollateral: number;
|
|
876
|
+
swapFeeRate: number;
|
|
877
|
+
sqrtPrice: bigint;
|
|
878
|
+
tickLowerIndex: number;
|
|
879
|
+
tickUpperIndex: number;
|
|
880
|
+
maxAmountSlippage: number;
|
|
859
881
|
}
|
|
860
882
|
|
|
861
883
|
export interface LiquidationPrices {
|
|
@@ -891,6 +913,20 @@ export interface DecreaseSpotPositionQuoteResult {
|
|
|
891
913
|
jupiterSwapIx: SwapInstruction | undefined;
|
|
892
914
|
}
|
|
893
915
|
|
|
916
|
+
export interface TunaSpotPositionFacade {
|
|
917
|
+
version: number;
|
|
918
|
+
marketMaker: number;
|
|
919
|
+
positionToken: number;
|
|
920
|
+
collateralToken: number;
|
|
921
|
+
flags: number;
|
|
922
|
+
amount: bigint;
|
|
923
|
+
loanShares: bigint;
|
|
924
|
+
loanFunds: bigint;
|
|
925
|
+
entrySqrtPrice: bigint;
|
|
926
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
927
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
928
|
+
}
|
|
929
|
+
|
|
894
930
|
/**
|
|
895
931
|
* A hash; the 32-byte output of a hashing algorithm.
|
|
896
932
|
*
|
|
@@ -1584,25 +1584,24 @@ exports.priceToTickIndex = function(price, decimals_a, decimals_b) {
|
|
|
1584
1584
|
};
|
|
1585
1585
|
|
|
1586
1586
|
/**
|
|
1587
|
-
* Computes the
|
|
1587
|
+
* Computes the exact input or output amount for a swap transaction.
|
|
1588
1588
|
*
|
|
1589
|
-
* #
|
|
1590
|
-
* - `
|
|
1591
|
-
* - `
|
|
1592
|
-
* - `
|
|
1593
|
-
* - `
|
|
1594
|
-
* - `
|
|
1595
|
-
* - `
|
|
1596
|
-
* - `
|
|
1597
|
-
* - `liquidation_threshold`: The liquidation threshold of the market.
|
|
1589
|
+
* # Arguments
|
|
1590
|
+
* - `token_in`: The input token amount.
|
|
1591
|
+
* - `specified_token_a`: If `true`, the input token is token A. Otherwise, it is token B.
|
|
1592
|
+
* - `slippage_tolerance`: The slippage tolerance in basis points.
|
|
1593
|
+
* - `fusion_pool`: The fusion_pool state.
|
|
1594
|
+
* - `tick_arrays`: The tick arrays needed for the swap.
|
|
1595
|
+
* - `transfer_fee_a`: The transfer fee for token A.
|
|
1596
|
+
* - `transfer_fee_b`: The transfer fee for token B.
|
|
1598
1597
|
*
|
|
1599
1598
|
* # Returns
|
|
1600
|
-
*
|
|
1599
|
+
* The exact input or output amount for the swap transaction.
|
|
1601
1600
|
*/
|
|
1602
|
-
exports.
|
|
1601
|
+
exports.swapQuoteByInputToken = function(token_in, specified_token_a, slippage_tolerance_bps, fusion_pool, tick_arrays, transfer_fee_a, transfer_fee_b) {
|
|
1603
1602
|
try {
|
|
1604
1603
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1605
|
-
wasm.
|
|
1604
|
+
wasm.swapQuoteByInputToken(retptr, token_in, specified_token_a, slippage_tolerance_bps, addHeapObject(fusion_pool), addHeapObject(tick_arrays), isLikeNone(transfer_fee_a) ? 0 : addHeapObject(transfer_fee_a), isLikeNone(transfer_fee_b) ? 0 : addHeapObject(transfer_fee_b));
|
|
1606
1605
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1607
1606
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1608
1607
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1619,8 +1618,8 @@ exports.getLpPositionLiquidationPrices = function(lower_tick_index, upper_tick_i
|
|
|
1619
1618
|
* Computes the exact input or output amount for a swap transaction.
|
|
1620
1619
|
*
|
|
1621
1620
|
* # Arguments
|
|
1622
|
-
* - `
|
|
1623
|
-
* - `specified_token_a`: If `true`, the
|
|
1621
|
+
* - `token_out`: The output token amount.
|
|
1622
|
+
* - `specified_token_a`: If `true`, the output token is token A. Otherwise, it is token B.
|
|
1624
1623
|
* - `slippage_tolerance`: The slippage tolerance in basis points.
|
|
1625
1624
|
* - `fusion_pool`: The fusion_pool state.
|
|
1626
1625
|
* - `tick_arrays`: The tick arrays needed for the swap.
|
|
@@ -1630,10 +1629,10 @@ exports.getLpPositionLiquidationPrices = function(lower_tick_index, upper_tick_i
|
|
|
1630
1629
|
* # Returns
|
|
1631
1630
|
* The exact input or output amount for the swap transaction.
|
|
1632
1631
|
*/
|
|
1633
|
-
exports.
|
|
1632
|
+
exports.swapQuoteByOutputToken = function(token_out, specified_token_a, slippage_tolerance_bps, fusion_pool, tick_arrays, transfer_fee_a, transfer_fee_b) {
|
|
1634
1633
|
try {
|
|
1635
1634
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1636
|
-
wasm.
|
|
1635
|
+
wasm.swapQuoteByOutputToken(retptr, token_out, specified_token_a, slippage_tolerance_bps, addHeapObject(fusion_pool), addHeapObject(tick_arrays), isLikeNone(transfer_fee_a) ? 0 : addHeapObject(transfer_fee_a), isLikeNone(transfer_fee_b) ? 0 : addHeapObject(transfer_fee_b));
|
|
1637
1636
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1638
1637
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1639
1638
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1647,24 +1646,25 @@ exports.swapQuoteByInputToken = function(token_in, specified_token_a, slippage_t
|
|
|
1647
1646
|
};
|
|
1648
1647
|
|
|
1649
1648
|
/**
|
|
1650
|
-
* Computes the
|
|
1649
|
+
* Computes the liquidation prices for an existing position.
|
|
1651
1650
|
*
|
|
1652
|
-
* #
|
|
1653
|
-
* - `
|
|
1654
|
-
* - `
|
|
1655
|
-
* - `
|
|
1656
|
-
* - `
|
|
1657
|
-
* - `
|
|
1658
|
-
* - `
|
|
1659
|
-
* - `
|
|
1651
|
+
* # Parameters
|
|
1652
|
+
* - `tick_lower_index`: The lower tick index of the position.
|
|
1653
|
+
* - `tick_upper_index`: The upper tick index of the position.
|
|
1654
|
+
* - `leftovers_a`: The amount of leftovers A in the position.
|
|
1655
|
+
* - `leftovers_a`: The amount of leftovers B in the position.
|
|
1656
|
+
* - `liquidity`: Liquidity of the position.
|
|
1657
|
+
* - `debt_a`: The amount of tokens A borrowed.
|
|
1658
|
+
* - `debt_b`: The amount of tokens B borrowed.
|
|
1659
|
+
* - `liquidation_threshold`: The liquidation threshold of the market.
|
|
1660
1660
|
*
|
|
1661
1661
|
* # Returns
|
|
1662
|
-
*
|
|
1662
|
+
* - `LiquidationPrices`: An object containing lower/upper liquidation prices.
|
|
1663
1663
|
*/
|
|
1664
|
-
exports.
|
|
1664
|
+
exports.getLpPositionLiquidationPrices = function(tick_lower_index, tick_upper_index, liquidity, leftovers_a, leftovers_b, debt_a, debt_b, liquidation_threshold) {
|
|
1665
1665
|
try {
|
|
1666
1666
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1667
|
-
wasm.
|
|
1667
|
+
wasm.getLpPositionLiquidationPrices(retptr, tick_lower_index, tick_upper_index, addHeapObject(liquidity), leftovers_a, leftovers_b, debt_a, debt_b, liquidation_threshold);
|
|
1668
1668
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1669
1669
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1670
1670
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1677,6 +1677,32 @@ exports.swapQuoteByOutputToken = function(token_out, specified_token_a, slippage
|
|
|
1677
1677
|
}
|
|
1678
1678
|
};
|
|
1679
1679
|
|
|
1680
|
+
exports.getIncreaseLpPositionQuote = function(args) {
|
|
1681
|
+
try {
|
|
1682
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1683
|
+
wasm.getIncreaseLpPositionQuote(retptr, addHeapObject(args));
|
|
1684
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1685
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1686
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1687
|
+
if (r2) {
|
|
1688
|
+
throw takeObject(r1);
|
|
1689
|
+
}
|
|
1690
|
+
return takeObject(r0);
|
|
1691
|
+
} finally {
|
|
1692
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1693
|
+
}
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1696
|
+
exports._HUNDRED_PERCENT = function() {
|
|
1697
|
+
const ret = wasm._HUNDRED_PERCENT();
|
|
1698
|
+
return ret >>> 0;
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
exports._COMPUTED_AMOUNT = function() {
|
|
1702
|
+
const ret = wasm._COMPUTED_AMOUNT();
|
|
1703
|
+
return BigInt.asUintN(64, ret);
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1680
1706
|
/**
|
|
1681
1707
|
* Spot position increase quote
|
|
1682
1708
|
*
|
|
@@ -1797,6 +1823,11 @@ exports.calculateTunaSpotPositionProtocolFee = function(collateral_token, borrow
|
|
|
1797
1823
|
return takeObject(ret);
|
|
1798
1824
|
};
|
|
1799
1825
|
|
|
1826
|
+
exports.calculateTunaProtocolFee = function(collateral, borrow, protocol_fee_rate_on_collateral, protocol_fee_rate) {
|
|
1827
|
+
const ret = wasm.calculateTunaProtocolFee(collateral, borrow, protocol_fee_rate_on_collateral, protocol_fee_rate);
|
|
1828
|
+
return BigInt.asUintN(64, ret);
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1800
1831
|
exports._INVALID_ARGUMENTS = function() {
|
|
1801
1832
|
try {
|
|
1802
1833
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -1840,12 +1871,12 @@ exports.solana_program_init = function() {
|
|
|
1840
1871
|
wasm.solana_program_init();
|
|
1841
1872
|
};
|
|
1842
1873
|
|
|
1843
|
-
function
|
|
1844
|
-
wasm.
|
|
1874
|
+
function __wasm_bindgen_func_elem_2635(arg0, arg1, arg2) {
|
|
1875
|
+
wasm.__wasm_bindgen_func_elem_2635(arg0, arg1, addHeapObject(arg2));
|
|
1845
1876
|
}
|
|
1846
1877
|
|
|
1847
|
-
function
|
|
1848
|
-
wasm.
|
|
1878
|
+
function __wasm_bindgen_func_elem_3208(arg0, arg1) {
|
|
1879
|
+
wasm.__wasm_bindgen_func_elem_3208(arg0, arg1);
|
|
1849
1880
|
}
|
|
1850
1881
|
|
|
1851
1882
|
function __wasm_bindgen_func_elem_495(arg0, arg1, arg2, arg3) {
|
|
@@ -3272,27 +3303,27 @@ exports.__wbg_warn_1d74dddbe2fd1dbb = function(arg0) {
|
|
|
3272
3303
|
console.warn(getObject(arg0));
|
|
3273
3304
|
};
|
|
3274
3305
|
|
|
3275
|
-
exports.
|
|
3276
|
-
// Cast intrinsic for `
|
|
3277
|
-
const ret =
|
|
3306
|
+
exports.__wbindgen_cast_0660a350899916ec = function(arg0, arg1) {
|
|
3307
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 360, function: Function { arguments: [], shim_idx: 361, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3308
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3204, __wasm_bindgen_func_elem_3208);
|
|
3278
3309
|
return addHeapObject(ret);
|
|
3279
3310
|
};
|
|
3280
3311
|
|
|
3281
|
-
exports.
|
|
3282
|
-
// Cast intrinsic for `
|
|
3283
|
-
const ret =
|
|
3312
|
+
exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
3313
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
3314
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
3284
3315
|
return addHeapObject(ret);
|
|
3285
3316
|
};
|
|
3286
3317
|
|
|
3287
|
-
exports.
|
|
3288
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3289
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
3318
|
+
exports.__wbindgen_cast_2e5f7f1574aa20c6 = function(arg0, arg1) {
|
|
3319
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 232, function: Function { arguments: [Externref], shim_idx: 227, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3320
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_2654, __wasm_bindgen_func_elem_2635);
|
|
3290
3321
|
return addHeapObject(ret);
|
|
3291
3322
|
};
|
|
3292
3323
|
|
|
3293
|
-
exports.
|
|
3294
|
-
// Cast intrinsic for `
|
|
3295
|
-
const ret =
|
|
3324
|
+
exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
3325
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
3326
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
3296
3327
|
return addHeapObject(ret);
|
|
3297
3328
|
};
|
|
3298
3329
|
|
|
Binary file
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const getLpPositionLiquidationPrices: (a: number, b: number, c: number, d: number, e: bigint, f: bigint, g: bigint, h: bigint, i: number) => void;
|
|
5
|
+
export const getIncreaseLpPositionQuote: (a: number, b: number) => void;
|
|
4
6
|
export const _INVALID_ARGUMENTS: (a: number) => void;
|
|
5
7
|
export const _JUPITER_QUOTE_REQUEST_ERROR: (a: number) => void;
|
|
6
8
|
export const _JUPITER_SWAP_INSTRUCTIONS_REQUEST_ERROR: (a: number) => void;
|
|
9
|
+
export const _HUNDRED_PERCENT: () => number;
|
|
10
|
+
export const _COMPUTED_AMOUNT: () => bigint;
|
|
7
11
|
export const getIncreaseSpotPositionQuote: (a: bigint, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
|
|
8
12
|
export const getDecreaseSpotPositionQuote: (a: bigint, b: number, c: number, d: number, e: number, f: bigint, g: bigint, h: number, i: number, j: number, k: number) => number;
|
|
9
13
|
export const getSpotPositionLiquidationPrice: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
10
14
|
export const getTradableAmount: (a: number, b: number, c: bigint, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number) => void;
|
|
11
15
|
export const calculateTunaSpotPositionProtocolFee: (a: number, b: number, c: bigint, d: bigint, e: number, f: number) => number;
|
|
12
|
-
export const
|
|
16
|
+
export const calculateTunaProtocolFee: (a: bigint, b: bigint, c: number, d: number) => bigint;
|
|
13
17
|
export const __wbg_transaction_free: (a: number, b: number) => void;
|
|
14
18
|
export const transaction_constructor: (a: number, b: number) => number;
|
|
15
19
|
export const transaction_message: (a: number) => number;
|
|
@@ -137,10 +141,10 @@ export const getFullRangeTickIndexes: (a: number) => number;
|
|
|
137
141
|
export const orderTickIndexes: (a: number, b: number) => number;
|
|
138
142
|
export const isFullRangeOnly: (a: number) => number;
|
|
139
143
|
export const getTickIndexInArray: (a: number, b: number, c: number, d: number) => void;
|
|
140
|
-
export const
|
|
141
|
-
export const
|
|
142
|
-
export const
|
|
143
|
-
export const
|
|
144
|
+
export const __wasm_bindgen_func_elem_2635: (a: number, b: number, c: number) => void;
|
|
145
|
+
export const __wasm_bindgen_func_elem_2654: (a: number, b: number) => void;
|
|
146
|
+
export const __wasm_bindgen_func_elem_3208: (a: number, b: number) => void;
|
|
147
|
+
export const __wasm_bindgen_func_elem_3204: (a: number, b: number) => void;
|
|
144
148
|
export const __wasm_bindgen_func_elem_495: (a: number, b: number, c: number, d: number) => void;
|
|
145
149
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
146
150
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crypticdot/defituna-core",
|
|
3
3
|
"description": "DefiTuna core typescript package.",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.2",
|
|
5
5
|
"main": "./dist/nodejs/defituna_core_js_bindings.js",
|
|
6
6
|
"types": "./dist/nodejs/defituna_core_js_bindings.d.ts",
|
|
7
7
|
"browser": "./dist/browser/defituna_core_js_bindings.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@crypticdot/typescript-config": "^1.0.0",
|
|
24
24
|
"typescript": "^5.8.3",
|
|
25
25
|
"wasm-pack": "^0.13.1",
|
|
26
|
-
"@crypticdot/defituna-rust-core": "3.4.
|
|
26
|
+
"@crypticdot/defituna-rust-core": "3.4.2"
|
|
27
27
|
},
|
|
28
28
|
"license": "SEE LICENSE IN LICENSE",
|
|
29
29
|
"keywords": [
|