@pancakeswap/v3-sdk 3.9.0 → 3.9.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/constants.d.ts +3 -3
- package/dist/index.js +16 -5
- package/dist/index.mjs +14 -7
- package/dist/utils/maxLiquidityForAmounts.d.ts +29 -0
- package/dist/utils/maxLiquidityForAmounts.d.ts.map +1 -1
- package/dist/utils/nearestUsableTick.d.ts.map +1 -1
- package/dist/utils/priceTickConversions.d.ts +11 -3
- package/dist/utils/priceTickConversions.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/constants.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare const FACTORY_ADDRESSES: {
|
|
|
22
22
|
readonly 11155111: "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865";
|
|
23
23
|
readonly 84532: "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865";
|
|
24
24
|
readonly 421614: "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865";
|
|
25
|
-
readonly 10143: "
|
|
25
|
+
readonly 10143: "0x3b7838D96Fc18AD1972aFa17574686be79C50040";
|
|
26
26
|
};
|
|
27
27
|
export declare const DEPLOYER_ADDRESSES: {
|
|
28
28
|
readonly 1: "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
@@ -45,7 +45,7 @@ export declare const DEPLOYER_ADDRESSES: {
|
|
|
45
45
|
readonly 11155111: "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
46
46
|
readonly 84532: "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
47
47
|
readonly 421614: "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
48
|
-
readonly 10143: "
|
|
48
|
+
readonly 10143: "0x2c63B2dC63D7e1f47294a0902da68B5E80f0d604";
|
|
49
49
|
};
|
|
50
50
|
export declare const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";
|
|
51
51
|
export declare const POOL_INIT_CODE_HASHES: {
|
|
@@ -92,7 +92,7 @@ export declare const NFT_POSITION_MANAGER_ADDRESSES: {
|
|
|
92
92
|
readonly 11155111: "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364";
|
|
93
93
|
readonly 421614: "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364";
|
|
94
94
|
readonly 84532: "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364";
|
|
95
|
-
readonly 10143: "
|
|
95
|
+
readonly 10143: "0x075A0Ba7bc4cdFBBdc9d8De5f228C834246e5AFc";
|
|
96
96
|
};
|
|
97
97
|
/**
|
|
98
98
|
* The default factory enabled fee amounts, denominated in hundredths of bips.
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var FACTORY_ADDRESSES = {
|
|
|
33
33
|
[chains.ChainId.SEPOLIA]: FACTORY_ADDRESS,
|
|
34
34
|
[chains.ChainId.BASE_SEPOLIA]: FACTORY_ADDRESS,
|
|
35
35
|
[chains.ChainId.ARBITRUM_SEPOLIA]: FACTORY_ADDRESS,
|
|
36
|
-
[chains.ChainId.MONAD_TESTNET]: "
|
|
36
|
+
[chains.ChainId.MONAD_TESTNET]: "0x3b7838D96Fc18AD1972aFa17574686be79C50040"
|
|
37
37
|
};
|
|
38
38
|
var DEPLOYER_ADDRESS = "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
39
39
|
var DEPLOYER_ADDRESSES = {
|
|
@@ -57,7 +57,7 @@ var DEPLOYER_ADDRESSES = {
|
|
|
57
57
|
[chains.ChainId.SEPOLIA]: DEPLOYER_ADDRESS,
|
|
58
58
|
[chains.ChainId.BASE_SEPOLIA]: DEPLOYER_ADDRESS,
|
|
59
59
|
[chains.ChainId.ARBITRUM_SEPOLIA]: DEPLOYER_ADDRESS,
|
|
60
|
-
[chains.ChainId.MONAD_TESTNET]: "
|
|
60
|
+
[chains.ChainId.MONAD_TESTNET]: "0x2c63B2dC63D7e1f47294a0902da68B5E80f0d604"
|
|
61
61
|
};
|
|
62
62
|
var ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";
|
|
63
63
|
var POOL_INIT_CODE_HASH = "0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2";
|
|
@@ -106,7 +106,7 @@ var NFT_POSITION_MANAGER_ADDRESSES = {
|
|
|
106
106
|
[chains.ChainId.SEPOLIA]: NFT_POSITION_MANAGER_ADDRESS,
|
|
107
107
|
[chains.ChainId.ARBITRUM_SEPOLIA]: NFT_POSITION_MANAGER_ADDRESS,
|
|
108
108
|
[chains.ChainId.BASE_SEPOLIA]: NFT_POSITION_MANAGER_ADDRESS,
|
|
109
|
-
[chains.ChainId.MONAD_TESTNET]: "
|
|
109
|
+
[chains.ChainId.MONAD_TESTNET]: "0x075A0Ba7bc4cdFBBdc9d8De5f228C834246e5AFc"
|
|
110
110
|
};
|
|
111
111
|
var FeeAmount = /* @__PURE__ */ ((FeeAmount4) => {
|
|
112
112
|
FeeAmount4[FeeAmount4["LOWEST"] = 100] = "LOWEST";
|
|
@@ -858,10 +858,15 @@ function encodeSqrtRatioX96(amount1, amount0) {
|
|
|
858
858
|
function tickToPrice(baseToken, quoteToken, tick) {
|
|
859
859
|
const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick);
|
|
860
860
|
const ratioX192 = sqrtRatioX96 * sqrtRatioX96;
|
|
861
|
-
return
|
|
861
|
+
return swapSdkCore.isCurrencySorted(baseToken, quoteToken) ? new swapSdkCore.Price(baseToken, quoteToken, Q192, ratioX192) : new swapSdkCore.Price(baseToken, quoteToken, ratioX192, Q192);
|
|
862
|
+
}
|
|
863
|
+
function tickToPriceV2(baseToken, quoteToken, tick) {
|
|
864
|
+
const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick);
|
|
865
|
+
const ratioX192 = sqrtRatioX96 * sqrtRatioX96;
|
|
866
|
+
return swapSdkCore.sortCurrencies([baseToken, quoteToken])[0] === baseToken ? new swapSdkCore.Price(baseToken, quoteToken, Q192, ratioX192) : new swapSdkCore.Price(baseToken, quoteToken, ratioX192, Q192);
|
|
862
867
|
}
|
|
863
868
|
function priceToClosestTick(price) {
|
|
864
|
-
const sorted = price.baseCurrency
|
|
869
|
+
const sorted = swapSdkCore.isCurrencySorted(price.baseCurrency, price.quoteCurrency);
|
|
865
870
|
const sqrtRatioX96 = sorted ? encodeSqrtRatioX96(price.numerator, price.denominator) : encodeSqrtRatioX96(price.denominator, price.numerator);
|
|
866
871
|
let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96);
|
|
867
872
|
const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1);
|
|
@@ -1777,6 +1782,8 @@ function nearestUsableTick(tick, tickSpacing) {
|
|
|
1777
1782
|
invariant9__default.default(Number.isInteger(tick) && Number.isInteger(tickSpacing), "INTEGERS");
|
|
1778
1783
|
invariant9__default.default(tickSpacing > 0, "TICK_SPACING");
|
|
1779
1784
|
invariant9__default.default(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, "TICK_BOUND");
|
|
1785
|
+
if (tickSpacing === 1)
|
|
1786
|
+
return tick;
|
|
1780
1787
|
const rounded = Math.round(tick / tickSpacing) * tickSpacing;
|
|
1781
1788
|
if (rounded < TickMath.MIN_TICK)
|
|
1782
1789
|
return rounded + tickSpacing;
|
|
@@ -6858,6 +6865,9 @@ exports.isMint = isMint;
|
|
|
6858
6865
|
exports.isPoolTickInRange = isPoolTickInRange;
|
|
6859
6866
|
exports.isSorted = isSorted;
|
|
6860
6867
|
exports.masterChefV3ABI = masterChefV3ABI;
|
|
6868
|
+
exports.maxLiquidityForAmount0Imprecise = maxLiquidityForAmount0Imprecise;
|
|
6869
|
+
exports.maxLiquidityForAmount0Precise = maxLiquidityForAmount0Precise;
|
|
6870
|
+
exports.maxLiquidityForAmount1 = maxLiquidityForAmount1;
|
|
6861
6871
|
exports.maxLiquidityForAmounts = maxLiquidityForAmounts;
|
|
6862
6872
|
exports.mostSignificantBit = mostSignificantBit;
|
|
6863
6873
|
exports.nearestUsableTick = nearestUsableTick;
|
|
@@ -6874,6 +6884,7 @@ exports.subIn256 = subIn256;
|
|
|
6874
6884
|
exports.swap = swap;
|
|
6875
6885
|
exports.swapRouterABI = swapRouterABI;
|
|
6876
6886
|
exports.tickToPrice = tickToPrice;
|
|
6887
|
+
exports.tickToPriceV2 = tickToPriceV2;
|
|
6877
6888
|
exports.toHex = toHex;
|
|
6878
6889
|
exports.tradeComparator = tradeComparator;
|
|
6879
6890
|
exports.v3PoolAbi = v3PoolAbi;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Price, CurrencyAmount, Percent as Percent$1, MaxUint256 as MaxUint256$1, TradeType, Fraction, sortedInsert, validateAndParseAddress, ZERO as ZERO$2, ONE as ONE$1 } from '@pancakeswap/sdk';
|
|
2
2
|
import invariant9 from 'tiny-invariant';
|
|
3
3
|
import { ChainId } from '@pancakeswap/chains';
|
|
4
|
-
import { Percent, MaxUint256, sqrt, Price as Price$1, sortCurrencies, CurrencyAmount as CurrencyAmount$1, Fraction as Fraction$1, ZERO as ZERO$1, TradeType as TradeType$1 } from '@pancakeswap/swap-sdk-core';
|
|
4
|
+
import { Percent, MaxUint256, sqrt, isCurrencySorted, Price as Price$1, sortCurrencies, CurrencyAmount as CurrencyAmount$1, Fraction as Fraction$1, ZERO as ZERO$1, TradeType as TradeType$1 } from '@pancakeswap/swap-sdk-core';
|
|
5
5
|
import { keccak256, encodeAbiParameters, parseAbiParameters, encodePacked, encodeFunctionData, toBytes, getAddress, pad, isBytes, slice, concat } from 'viem';
|
|
6
6
|
|
|
7
7
|
// src/entities/pool.ts
|
|
@@ -27,7 +27,7 @@ var FACTORY_ADDRESSES = {
|
|
|
27
27
|
[ChainId.SEPOLIA]: FACTORY_ADDRESS,
|
|
28
28
|
[ChainId.BASE_SEPOLIA]: FACTORY_ADDRESS,
|
|
29
29
|
[ChainId.ARBITRUM_SEPOLIA]: FACTORY_ADDRESS,
|
|
30
|
-
[ChainId.MONAD_TESTNET]: "
|
|
30
|
+
[ChainId.MONAD_TESTNET]: "0x3b7838D96Fc18AD1972aFa17574686be79C50040"
|
|
31
31
|
};
|
|
32
32
|
var DEPLOYER_ADDRESS = "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
33
33
|
var DEPLOYER_ADDRESSES = {
|
|
@@ -51,7 +51,7 @@ var DEPLOYER_ADDRESSES = {
|
|
|
51
51
|
[ChainId.SEPOLIA]: DEPLOYER_ADDRESS,
|
|
52
52
|
[ChainId.BASE_SEPOLIA]: DEPLOYER_ADDRESS,
|
|
53
53
|
[ChainId.ARBITRUM_SEPOLIA]: DEPLOYER_ADDRESS,
|
|
54
|
-
[ChainId.MONAD_TESTNET]: "
|
|
54
|
+
[ChainId.MONAD_TESTNET]: "0x2c63B2dC63D7e1f47294a0902da68B5E80f0d604"
|
|
55
55
|
};
|
|
56
56
|
var ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";
|
|
57
57
|
var POOL_INIT_CODE_HASH = "0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2";
|
|
@@ -100,7 +100,7 @@ var NFT_POSITION_MANAGER_ADDRESSES = {
|
|
|
100
100
|
[ChainId.SEPOLIA]: NFT_POSITION_MANAGER_ADDRESS,
|
|
101
101
|
[ChainId.ARBITRUM_SEPOLIA]: NFT_POSITION_MANAGER_ADDRESS,
|
|
102
102
|
[ChainId.BASE_SEPOLIA]: NFT_POSITION_MANAGER_ADDRESS,
|
|
103
|
-
[ChainId.MONAD_TESTNET]: "
|
|
103
|
+
[ChainId.MONAD_TESTNET]: "0x075A0Ba7bc4cdFBBdc9d8De5f228C834246e5AFc"
|
|
104
104
|
};
|
|
105
105
|
var FeeAmount = /* @__PURE__ */ ((FeeAmount4) => {
|
|
106
106
|
FeeAmount4[FeeAmount4["LOWEST"] = 100] = "LOWEST";
|
|
@@ -852,10 +852,15 @@ function encodeSqrtRatioX96(amount1, amount0) {
|
|
|
852
852
|
function tickToPrice(baseToken, quoteToken, tick) {
|
|
853
853
|
const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick);
|
|
854
854
|
const ratioX192 = sqrtRatioX96 * sqrtRatioX96;
|
|
855
|
-
return baseToken
|
|
855
|
+
return isCurrencySorted(baseToken, quoteToken) ? new Price$1(baseToken, quoteToken, Q192, ratioX192) : new Price$1(baseToken, quoteToken, ratioX192, Q192);
|
|
856
|
+
}
|
|
857
|
+
function tickToPriceV2(baseToken, quoteToken, tick) {
|
|
858
|
+
const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick);
|
|
859
|
+
const ratioX192 = sqrtRatioX96 * sqrtRatioX96;
|
|
860
|
+
return sortCurrencies([baseToken, quoteToken])[0] === baseToken ? new Price$1(baseToken, quoteToken, Q192, ratioX192) : new Price$1(baseToken, quoteToken, ratioX192, Q192);
|
|
856
861
|
}
|
|
857
862
|
function priceToClosestTick(price) {
|
|
858
|
-
const sorted = price.baseCurrency
|
|
863
|
+
const sorted = isCurrencySorted(price.baseCurrency, price.quoteCurrency);
|
|
859
864
|
const sqrtRatioX96 = sorted ? encodeSqrtRatioX96(price.numerator, price.denominator) : encodeSqrtRatioX96(price.denominator, price.numerator);
|
|
860
865
|
let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96);
|
|
861
866
|
const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1);
|
|
@@ -1771,6 +1776,8 @@ function nearestUsableTick(tick, tickSpacing) {
|
|
|
1771
1776
|
invariant9(Number.isInteger(tick) && Number.isInteger(tickSpacing), "INTEGERS");
|
|
1772
1777
|
invariant9(tickSpacing > 0, "TICK_SPACING");
|
|
1773
1778
|
invariant9(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, "TICK_BOUND");
|
|
1779
|
+
if (tickSpacing === 1)
|
|
1780
|
+
return tick;
|
|
1774
1781
|
const rounded = Math.round(tick / tickSpacing) * tickSpacing;
|
|
1775
1782
|
if (rounded < TickMath.MIN_TICK)
|
|
1776
1783
|
return rounded + tickSpacing;
|
|
@@ -6791,4 +6798,4 @@ var v3PoolAbi = [
|
|
|
6791
6798
|
}
|
|
6792
6799
|
];
|
|
6793
6800
|
|
|
6794
|
-
export { ADDRESS_ZERO, DEPLOYER_ADDRESSES, FACTORY_ADDRESSES, FeeAmount, FeeCalculator, FullMath, LiquidityMath, MasterChefV3, MaxUint128, Multicall, NFT_POSITION_MANAGER_ADDRESSES, NoTickDataProvider, NonfungiblePositionManager, POOL_INIT_CODE_HASHES, Payments, Pool, Position, PositionLibrary, PositionMath, Route, SelfPermit, SqrtPriceMath, Staker, SwapMath, SwapQuoter, SwapRouter, TICK_SPACINGS, Tick, TickLibrary, TickList, TickListDataProvider, TickMath, Trade, computePoolAddress, encodeRouteToPath, encodeSqrtRatioX96, getAmountsAtNewPrice, getAmountsByLiquidityAndPrice, getAverageLiquidity, getCurrency0Price, getCurrency1Price, getDependentAmount, getEstimatedLPFee, getEstimatedLPFeeByAmounts, getEstimatedLPFeeByAmountsWithProtocolFee, getEstimatedLPFeeWithProtocolFee, getInputAmount, getLiquidityByAmountsAndPrice, getLiquidityBySingleAmount, getLiquidityFromSqrtRatioX96, getLiquidityFromTick, getOutputAmount, getPool, getPriceOfCurrency, getPriceOfCurrency0, getPriceOfCurrency1, hasInvolvedCurrency, isMint, isPoolTickInRange, isSorted, masterChefV3ABI, maxLiquidityForAmounts, mostSignificantBit, nearestUsableTick, nonfungiblePositionManagerABI, pancakeV3PoolABI, parseProtocolFees, peripheryPaymentsWithFeeABI, priceToClosestTick, quoterABI, quoterV2ABI, selfPermitABI, sqrtRatioX96ToPrice, subIn256, swap, swapRouterABI, tickToPrice, toHex, tradeComparator, v3PoolAbi, v3StakerABI };
|
|
6801
|
+
export { ADDRESS_ZERO, DEPLOYER_ADDRESSES, FACTORY_ADDRESSES, FeeAmount, FeeCalculator, FullMath, LiquidityMath, MasterChefV3, MaxUint128, Multicall, NFT_POSITION_MANAGER_ADDRESSES, NoTickDataProvider, NonfungiblePositionManager, POOL_INIT_CODE_HASHES, Payments, Pool, Position, PositionLibrary, PositionMath, Route, SelfPermit, SqrtPriceMath, Staker, SwapMath, SwapQuoter, SwapRouter, TICK_SPACINGS, Tick, TickLibrary, TickList, TickListDataProvider, TickMath, Trade, computePoolAddress, encodeRouteToPath, encodeSqrtRatioX96, getAmountsAtNewPrice, getAmountsByLiquidityAndPrice, getAverageLiquidity, getCurrency0Price, getCurrency1Price, getDependentAmount, getEstimatedLPFee, getEstimatedLPFeeByAmounts, getEstimatedLPFeeByAmountsWithProtocolFee, getEstimatedLPFeeWithProtocolFee, getInputAmount, getLiquidityByAmountsAndPrice, getLiquidityBySingleAmount, getLiquidityFromSqrtRatioX96, getLiquidityFromTick, getOutputAmount, getPool, getPriceOfCurrency, getPriceOfCurrency0, getPriceOfCurrency1, hasInvolvedCurrency, isMint, isPoolTickInRange, isSorted, masterChefV3ABI, maxLiquidityForAmount0Imprecise, maxLiquidityForAmount0Precise, maxLiquidityForAmount1, maxLiquidityForAmounts, mostSignificantBit, nearestUsableTick, nonfungiblePositionManagerABI, pancakeV3PoolABI, parseProtocolFees, peripheryPaymentsWithFeeABI, priceToClosestTick, quoterABI, quoterV2ABI, selfPermitABI, sqrtRatioX96ToPrice, subIn256, swap, swapRouterABI, tickToPrice, tickToPriceV2, toHex, tradeComparator, v3PoolAbi, v3StakerABI };
|
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
import { BigintIsh } from '@pancakeswap/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an imprecise maximum amount of liquidity received for a given amount of token 0.
|
|
4
|
+
* This function is available to accommodate LiquidityAmounts#getLiquidityForAmount0 in the v3 periphery,
|
|
5
|
+
* which could be more precise by at least 32 bits by dividing by Q64 instead of Q96 in the intermediate step,
|
|
6
|
+
* and shifting the subtracted ratio left by 32 bits. This imprecise calculation will likely be replaced in a future
|
|
7
|
+
* v3 router contract.
|
|
8
|
+
* @param sqrtRatioAX96 The price at the lower boundary
|
|
9
|
+
* @param sqrtRatioBX96 The price at the upper boundary
|
|
10
|
+
* @param amount0 The token0 amount
|
|
11
|
+
* @returns liquidity for amount0, imprecise
|
|
12
|
+
*/
|
|
13
|
+
export declare function maxLiquidityForAmount0Imprecise(sqrtRatioAX96: bigint, sqrtRatioBX96: bigint, amount0: BigintIsh): bigint;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a precise maximum amount of liquidity received for a given amount of token 0 by dividing by Q64 instead of Q96 in the intermediate step,
|
|
16
|
+
* and shifting the subtracted ratio left by 32 bits.
|
|
17
|
+
* @param sqrtRatioAX96 The price at the lower boundary
|
|
18
|
+
* @param sqrtRatioBX96 The price at the upper boundary
|
|
19
|
+
* @param amount0 The token0 amount
|
|
20
|
+
* @returns liquidity for amount0, precise
|
|
21
|
+
*/
|
|
22
|
+
export declare function maxLiquidityForAmount0Precise(sqrtRatioAX96: bigint, sqrtRatioBX96: bigint, amount0: BigintIsh): bigint;
|
|
23
|
+
/**
|
|
24
|
+
* Computes the maximum amount of liquidity received for a given amount of token1
|
|
25
|
+
* @param sqrtRatioAX96 The price at the lower tick boundary
|
|
26
|
+
* @param sqrtRatioBX96 The price at the upper tick boundary
|
|
27
|
+
* @param amount1 The token1 amount
|
|
28
|
+
* @returns liquidity for amount1
|
|
29
|
+
*/
|
|
30
|
+
export declare function maxLiquidityForAmount1(sqrtRatioAX96: bigint, sqrtRatioBX96: bigint, amount1: BigintIsh): bigint;
|
|
2
31
|
/**
|
|
3
32
|
* Computes the maximum amount of liquidity received for a given amount of token0, token1,
|
|
4
33
|
* and the prices at the tick boundaries.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maxLiquidityForAmounts.d.ts","sourceRoot":"","sources":["../../src/utils/maxLiquidityForAmounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"maxLiquidityForAmounts.d.ts","sourceRoot":"","sources":["../../src/utils/maxLiquidityForAmounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAG5C;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,GACjB,MAAM,CAMR;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,GACjB,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,MAAM,CAK/G;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,MAAM,EAC3B,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,SAAS,EAClB,gBAAgB,EAAE,OAAO,GACxB,MAAM,CAgBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nearestUsableTick.d.ts","sourceRoot":"","sources":["../../src/utils/nearestUsableTick.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"nearestUsableTick.d.ts","sourceRoot":"","sources":["../../src/utils/nearestUsableTick.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UASlE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Price, Token } from '@pancakeswap/swap-sdk-core';
|
|
1
|
+
import { Currency, Price, Token } from '@pancakeswap/swap-sdk-core';
|
|
2
2
|
/**
|
|
3
3
|
* Returns a price object corresponding to the input tick and the base/quote token
|
|
4
4
|
* Inputs must be tokens because the address order is used to interpret the price represented by the tick
|
|
@@ -6,11 +6,19 @@ import { Price, Token } from '@pancakeswap/swap-sdk-core';
|
|
|
6
6
|
* @param quoteToken the quote token of the price
|
|
7
7
|
* @param tick the tick for which to return the price
|
|
8
8
|
*/
|
|
9
|
-
export declare function tickToPrice(baseToken:
|
|
9
|
+
export declare function tickToPrice<TBase extends Currency | Token, TQuote extends Currency | Token>(baseToken: TBase, quoteToken: TQuote, tick: number): Price<TBase, TQuote>;
|
|
10
|
+
/**
|
|
11
|
+
* Returns a price object corresponding to the input tick and the base/quote token
|
|
12
|
+
* Inputs must be tokens because the address order is used to interpret the price represented by the tick
|
|
13
|
+
* @param baseToken the base token of the price
|
|
14
|
+
* @param quoteToken the quote token of the price
|
|
15
|
+
* @param tick the tick for which to return the price
|
|
16
|
+
*/
|
|
17
|
+
export declare function tickToPriceV2(baseToken: Currency, quoteToken: Currency, tick: number): Price<Currency, Currency>;
|
|
10
18
|
/**
|
|
11
19
|
* Returns the first tick for which the given price is greater than or equal to the tick price
|
|
12
20
|
* @param price for which to return the closest tick that represents a price less than or equal to the input price,
|
|
13
21
|
* i.e. the price of the returned tick is less than or equal to the input price
|
|
14
22
|
*/
|
|
15
|
-
export declare function priceToClosestTick(price: Price<
|
|
23
|
+
export declare function priceToClosestTick(price: Price<Currency, Currency>): number;
|
|
16
24
|
//# sourceMappingURL=priceTickConversions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priceTickConversions.d.ts","sourceRoot":"","sources":["../../src/utils/priceTickConversions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"priceTickConversions.d.ts","sourceRoot":"","sources":["../../src/utils/priceTickConversions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,KAAK,EAAkB,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAIrG;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAS,QAAQ,GAAG,KAAK,EAAE,MAAM,SAAS,QAAQ,GAAG,KAAK,EACzF,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAQtB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAQhH;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,MAAM,CAiB3E"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "3.9.
|
|
7
|
+
"version": "3.9.2",
|
|
8
8
|
"description": "⚒️ An SDK for building applications on top of Pancakeswap V3",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"tiny-warning": "^1.0.3",
|
|
25
25
|
"toformat": "^2.0.0",
|
|
26
26
|
"viem": "^2.22.23",
|
|
27
|
-
"@pancakeswap/chains": "0.5.
|
|
28
|
-
"@pancakeswap/sdk": "5.8.
|
|
29
|
-
"@pancakeswap/swap-sdk-core": "1.
|
|
27
|
+
"@pancakeswap/chains": "0.5.1",
|
|
28
|
+
"@pancakeswap/sdk": "5.8.13",
|
|
29
|
+
"@pancakeswap/swap-sdk-core": "1.4.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"tsup": "^6.7.0",
|
|
33
|
-
"@pancakeswap/utils": "6.0
|
|
33
|
+
"@pancakeswap/utils": "6.1.0"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=10"
|