Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uniswap/v3-sdk

Package Overview
Dependencies
Maintainers
9
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uniswap/v3-sdk - npm Package Compare versions

Comparing version 1.0.0-alpha.12 to 1.0.0-alpha.13

2

dist/constants.d.ts
export declare const FACTORY_ADDRESS = "0x1F98431c8aD98523631AE4a59f267346ea31F984";
export declare const SWAP_ROUTER_ADDRESS = "0x1F98431c8aD98523631AE4a59f267346ea31F984";
export declare const NONFUNGIBLE_POSITION_MANAGER_ADDRESS = "0x1F98431c8aD98523631AE4a59f267346ea31F984";
export declare const POOL_INIT_CODE_HASH = "0xa8180af292c6986c74fa300a542e049db8a89221e2452e431c3d8103b610c568";
export declare const POOL_INIT_CODE_HASH = "0xc02f72e8ae5e68802e6d893d58ddfb0df89a2f4c9c2f04927db1186a29373660";
/**

@@ -6,0 +6,0 @@ * The default factory enabled fee amounts, denominated in hundredths of bips.

@@ -1,2 +0,2 @@

"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e,n=require("@uniswap/sdk-core"),i=t(require("jsbi")),r=t(require("tiny-invariant")),o=require("@ethersproject/abi"),a=require("@ethersproject/address"),u=require("@ethersproject/solidity"),c=require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function f(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return d(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}var m,h="0xa8180af292c6986c74fa300a542e049db8a89221e2452e431c3d8103b610c568";(m=exports.FeeAmount||(exports.FeeAmount={}))[m.LOW=500]="LOW",m[m.MEDIUM=3e3]="MEDIUM",m[m.HIGH=1e4]="HIGH";var p=((e={})[exports.FeeAmount.LOW]=10,e[exports.FeeAmount.MEDIUM]=60,e[exports.FeeAmount.HIGH]=200,e),g=i.BigInt(-1),k=i.BigInt(0),T=i.BigInt(1),A=i.exponentiate(i.BigInt(2),i.BigInt(96)),v=i.exponentiate(A,i.BigInt(2));function I(t){var e=t.factoryAddress,n=t.tokenA,i=t.tokenB,r=t.fee,c=n.sortsBefore(i)?[n,i]:[i,n];return a.getCreate2Address(e,u.keccak256(["bytes"],[o.defaultAbiCoder.encode(["address","address","uint24"],[c[0].address,c[1].address,r])]),h)}var q=function(){function t(){}return t.addDelta=function(t,e){return i.lessThan(e,k)?i.subtract(t,i.multiply(e,g)):i.add(t,e)},t}(),x=function(){function t(){}return t.mulDivRoundingUp=function(t,e,n){var r=i.multiply(t,e),o=i.divide(r,n);return i.notEqual(i.remainder(r,n),k)&&(o=i.add(o,T)),o},t}(),y=i.subtract(i.exponentiate(i.BigInt(2),i.BigInt(160)),T);function R(t,e){var r=i.multiply(t,e);return i.bitwiseAnd(r,n.MaxUint256)}var S=function(){function t(){}return t.getAmount0Delta=function(t,e,n,r){if(i.greaterThan(t,e)){var o=[e,t];t=o[0],e=o[1]}var a=i.leftShift(n,i.BigInt(96)),u=i.subtract(e,t);return r?x.mulDivRoundingUp(x.mulDivRoundingUp(a,u,e),T,t):i.divide(i.divide(i.multiply(a,u),e),t)},t.getAmount1Delta=function(t,e,n,r){if(i.greaterThan(t,e)){var o=[e,t];t=o[0],e=o[1]}return r?x.mulDivRoundingUp(n,i.subtract(e,t),A):i.divide(i.multiply(n,i.subtract(e,t)),A)},t.getNextSqrtPriceFromInput=function(t,e,n,o){return i.greaterThan(t,k)||r(!1),i.greaterThan(e,k)||r(!1),o?this.getNextSqrtPriceFromAmount0RoundingUp(t,e,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(t,e,n,!0)},t.getNextSqrtPriceFromOutput=function(t,e,n,o){return i.greaterThan(t,k)||r(!1),i.greaterThan(e,k)||r(!1),o?this.getNextSqrtPriceFromAmount1RoundingDown(t,e,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(t,e,n,!1)},t.getNextSqrtPriceFromAmount0RoundingUp=function(t,e,o,a){if(i.equal(o,k))return t;var u=i.leftShift(e,i.BigInt(96));if(a){var c=R(o,t);if(i.equal(i.divide(c,o),t)){var s=(d=i.add(u,c),i.bitwiseAnd(d,n.MaxUint256));if(i.greaterThanOrEqual(s,u))return x.mulDivRoundingUp(u,t,s)}return x.mulDivRoundingUp(u,T,i.add(i.divide(u,t),o))}var l=R(o,t);i.equal(i.divide(l,o),t)||r(!1),i.greaterThan(u,l)||r(!1);var d,f=i.subtract(u,l);return x.mulDivRoundingUp(u,t,f)},t.getNextSqrtPriceFromAmount1RoundingDown=function(t,e,n,o){if(o){var a=i.lessThanOrEqual(n,y)?i.divide(i.leftShift(n,i.BigInt(96)),e):i.divide(i.multiply(n,A),e);return i.add(t,a)}var u=x.mulDivRoundingUp(n,A,e);return i.greaterThan(t,u)||r(!1),i.subtract(t,u)},t}(),b=i.exponentiate(i.BigInt(10),i.BigInt(6)),w=function(){function t(){}return t.computeSwapStep=function(t,e,n,r,o){var a={},u=i.greaterThanOrEqual(t,e),c=i.greaterThanOrEqual(r,k);if(c){var s=i.divide(i.multiply(r,i.subtract(b,i.BigInt(o))),b);a.amountIn=u?S.getAmount0Delta(e,t,n,!0):S.getAmount1Delta(t,e,n,!0),a.sqrtRatioNextX96=i.greaterThanOrEqual(s,a.amountIn)?e:S.getNextSqrtPriceFromInput(t,n,s,u)}else a.amountOut=u?S.getAmount1Delta(e,t,n,!1):S.getAmount0Delta(t,e,n,!1),a.sqrtRatioNextX96=i.greaterThanOrEqual(i.multiply(r,g),a.amountOut)?e:S.getNextSqrtPriceFromOutput(t,n,i.multiply(r,g),u);var l=i.equal(e,a.sqrtRatioNextX96);return u?(a.amountIn=l&&c?a.amountIn:S.getAmount0Delta(a.sqrtRatioNextX96,t,n,!0),a.amountOut=l&&!c?a.amountOut:S.getAmount1Delta(a.sqrtRatioNextX96,t,n,!1)):(a.amountIn=l&&c?a.amountIn:S.getAmount1Delta(t,a.sqrtRatioNextX96,n,!0),a.amountOut=l&&!c?a.amountOut:S.getAmount0Delta(t,a.sqrtRatioNextX96,n,!1)),!c&&i.greaterThan(a.amountOut,i.multiply(r,g))&&(a.amountOut=i.multiply(r,g)),a.feeAmount=c&&i.notEqual(a.sqrtRatioNextX96,e)?i.subtract(r,a.amountIn):x.mulDivRoundingUp(a.amountIn,i.BigInt(o),i.subtract(b,i.BigInt(o))),[a.sqrtRatioNextX96,a.amountIn,a.amountOut,a.feeAmount]},t}(),E=i.BigInt(2),P=[128,64,32,16,8,4,2,1].map((function(t){return[t,i.exponentiate(E,i.BigInt(t))]}));function N(t){i.greaterThan(t,k)||r(!1),i.lessThanOrEqual(t,n.MaxUint256)||r(!1);for(var e,o=0,a=f(P);!(e=a()).done;){var u=e.value,c=u[0];i.greaterThanOrEqual(t,u[1])&&(t=i.signedRightShift(t,i.BigInt(c)),o+=c)}return o}function C(t,e){return i.signedRightShift(i.multiply(t,i.BigInt(e)),i.BigInt(128))}var O=i.exponentiate(i.BigInt(2),i.BigInt(32)),B=function(){function t(){}return t.getSqrtRatioAtTick=function(e){e>=t.MIN_TICK&&e<=t.MAX_TICK&&Number.isInteger(e)||r(!1);var o=e<0?-1*e:e,a=i.BigInt(0!=(1&o)?"0xfffcb933bd6fad37aa2d162d1a594001":"0x100000000000000000000000000000000");return 0!=(2&o)&&(a=C(a,"0xfff97272373d413259a46990580e213a")),0!=(4&o)&&(a=C(a,"0xfff2e50f5f656932ef12357cf3c7fdcc")),0!=(8&o)&&(a=C(a,"0xffe5caca7e10e4e61c3624eaa0941cd0")),0!=(16&o)&&(a=C(a,"0xffcb9843d60f6159c9db58835c926644")),0!=(32&o)&&(a=C(a,"0xff973b41fa98c081472e6896dfb254c0")),0!=(64&o)&&(a=C(a,"0xff2ea16466c96a3843ec78b326b52861")),0!=(128&o)&&(a=C(a,"0xfe5dee046a99a2a811c461f1969c3053")),0!=(256&o)&&(a=C(a,"0xfcbe86c7900a88aedcffc83b479aa3a4")),0!=(512&o)&&(a=C(a,"0xf987a7253ac413176f2b074cf7815e54")),0!=(1024&o)&&(a=C(a,"0xf3392b0822b70005940c7a398e4b70f3")),0!=(2048&o)&&(a=C(a,"0xe7159475a2c29b7443b29c7fa6e889d9")),0!=(4096&o)&&(a=C(a,"0xd097f3bdfd2022b8845ad8f792aa5825")),0!=(8192&o)&&(a=C(a,"0xa9f746462d870fdf8a65dc1f90e061e5")),0!=(16384&o)&&(a=C(a,"0x70d869a156d2a1b890bb3df62baf32f7")),0!=(32768&o)&&(a=C(a,"0x31be135f97d08fd981231505542fcfa6")),0!=(65536&o)&&(a=C(a,"0x9aa508b5b7a84e1c677de54f3e99bc9")),0!=(131072&o)&&(a=C(a,"0x5d6af8dedb81196699c329225ee604")),0!=(262144&o)&&(a=C(a,"0x2216e584f5fa1ea926041bedfe98")),0!=(524288&o)&&(a=C(a,"0x48a170391f7dc42444e8fa2")),e>0&&(a=i.divide(n.MaxUint256,a)),i.greaterThan(i.remainder(a,O),k)?i.add(i.divide(a,O),T):i.divide(a,O)},t.getTickAtSqrtRatio=function(e){i.greaterThanOrEqual(e,t.MIN_SQRT_RATIO)&&i.lessThan(e,t.MAX_SQRT_RATIO)||r(!1);var n,o=i.leftShift(e,i.BigInt(32)),a=N(o);n=i.greaterThanOrEqual(i.BigInt(a),i.BigInt(128))?i.signedRightShift(o,i.BigInt(a-127)):i.leftShift(o,i.BigInt(127-a));for(var u=i.leftShift(i.subtract(i.BigInt(a),i.BigInt(128)),i.BigInt(64)),c=0;c<14;c++){n=i.signedRightShift(i.multiply(n,n),i.BigInt(127));var s=i.signedRightShift(n,i.BigInt(128));u=i.bitwiseOr(u,i.leftShift(s,i.BigInt(63-c))),n=i.signedRightShift(n,s)}var l=i.multiply(u,i.BigInt("255738958999603826347141")),d=i.toNumber(i.signedRightShift(i.subtract(l,i.BigInt("3402992956809132418596140100660247210")),i.BigInt(128))),f=i.toNumber(i.signedRightShift(i.add(l,i.BigInt("291339464771989622907027621153398088495")),i.BigInt(128)));return d===f?d:i.lessThanOrEqual(t.getSqrtRatioAtTick(f),e)?f:d},t}();function _(t,e){var r=i.leftShift(i.BigInt(t),i.BigInt(192)),o=i.BigInt(e),a=i.divide(r,o);return n.sqrt(a)}function X(t,e){for(var n=0;n<t.length-1;n++)if(e(t[n],t[n+1])>0)return!1;return!0}function D(t,e,n){if(i.greaterThan(t,e)){var r=[e,t];t=r[0],e=r[1]}var o=i.divide(i.multiply(t,e),A);return i.divide(i.multiply(i.BigInt(n),o),i.subtract(e,t))}function M(t,e,n){if(i.greaterThan(t,e)){var r=[e,t];t=r[0],e=r[1]}return i.divide(i.multiply(i.BigInt(n),A),i.subtract(e,t))}function U(t,e,n,r,o){if(i.greaterThan(e,n)){var a=[n,e];e=a[0],n=a[1]}if(i.lessThanOrEqual(t,e))return D(e,n,r);if(i.lessThan(t,n)){var u=D(t,n,r),c=M(e,t,o);return i.lessThan(u,c)?u:c}return M(e,n,o)}function F(t,e,r){var o=B.getSqrtRatioAtTick(r),a=i.multiply(o,o);return t.sortsBefore(e)?new n.Price(t,e,v,a):new n.Price(t,e,a,v)}function L(t,e){return t.index-e.index}B.MIN_TICK=-887272,B.MAX_TICK=-B.MIN_TICK,B.MIN_SQRT_RATIO=i.BigInt("4295128739"),B.MAX_SQRT_RATIO=i.BigInt("1461446703485210103287273052203988822378723970342");var H=function(){function t(){}return t.validate=function(t,e){t.every((function(t){return t.index%e==0}))||r(!1),i.equal(t.reduce((function(t,e){return i.add(t,e.liquidityNet)}),k),k)||r(!1),X(t,L)||r(!1)},t.isBelowSmallest=function(t,e){return t.length>0||r(!1),e<t[0].index},t.isAtOrAboveLargest=function(t,e){return t.length>0||r(!1),e>=t[t.length-1].index},t.getTick=function(t,e){var n=t[this.binarySearch(t,e)];return n.index!==e&&r(!1),n},t.binarySearch=function(t,e){this.isBelowSmallest(t,e)&&r(!1),this.isAtOrAboveLargest(t,e)&&r(!1);for(var n,i=0,o=t.length-1;;){if(t[n=Math.floor((i+o)/2)].index<=e&&t[n+1].index>e)return n;t[n].index<e?i=n+1:o=n-1}},t.nextInitializedTick=function(e,n,i){return i?(t.isBelowSmallest(e,n)&&r(!1),t.isAtOrAboveLargest(e,n)?e[e.length-1]:e[this.binarySearch(e,n)]):(this.isAtOrAboveLargest(e,n)&&r(!1),this.isBelowSmallest(e,n)?e[0]:e[this.binarySearch(e,n)+1])},t.nextInitializedTickWithinOneWord=function(e,n,i,r){var o=Math.floor(n/r);if(i){var a=(o>>8<<8)*r;if(t.isBelowSmallest(e,n))return[a,!1];var u=t.nextInitializedTick(e,n,i).index,c=Math.max(a,u);return[c,c===u]}var s=(1+(o+1>>8)<<8)*r-1;if(this.isAtOrAboveLargest(e,n))return[s,!1];var l=this.nextInitializedTick(e,n,i).index,d=Math.min(s,l);return[d,d===l]},t}(),K=function(t){var e=t.index,n=t.liquidityGross,o=t.liquidityNet;e>=B.MIN_TICK&&e<=B.MAX_TICK||r(!1),this.index=e,this.liquidityGross=i.BigInt(n),this.liquidityNet=i.BigInt(o)},W=function(){function t(t,e,n,o,a,u,c){Number.isInteger(n)&&n<1e6||r(!1);var s=B.getSqrtRatioAtTick(u),l=B.getSqrtRatioAtTick(u+1);i.greaterThanOrEqual(i.BigInt(o),s)&&i.lessThanOrEqual(i.BigInt(o),l)||r(!1);var d=c.map((function(t){return t instanceof K?t:new K(t)}));H.validate(d,p[n]);var f=t.sortsBefore(e)?[t,e]:[e,t];this.token0=f[0],this.token1=f[1],this.fee=n,this.sqrtRatioX96=i.BigInt(o),this.liquidity=i.BigInt(a),this.tickCurrent=u,this.ticks=d}t.getAddress=function(t,e,n){return I({factoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",fee:n,tokenA:t,tokenB:e})};var e=t.prototype;return e.involvesToken=function(t){return t.equals(this.token0)||t.equals(this.token1)},e.priceOf=function(t){return this.involvesToken(t)||r(!1),t.equals(this.token0)?this.token0Price:this.token1Price},e.getOutputAmount=function(e){this.involvesToken(e.token)||r(!1);var o=e.token.equals(this.token0),a=this.swap(o,e.raw),u=a.sqrtRatioX96,c=a.liquidity,s=a.tickCurrent;return[new n.TokenAmount(o?this.token1:this.token0,i.multiply(a.amountCalculated,g)),new t(this.token0,this.token1,this.fee,u,c,s,this.ticks)]},e.getInputAmount=function(e){this.involvesToken(e.token)||r(!1);var o=e.token.equals(this.token1),a=this.swap(o,i.multiply(e.raw,g)),u=a.sqrtRatioX96,c=a.liquidity,s=a.tickCurrent;return[new n.TokenAmount(o?this.token0:this.token1,a.amountCalculated),new t(this.token0,this.token1,this.fee,u,c,s,this.ticks)]},e.swap=function(t,e,n){n||(n=t?i.add(B.MIN_SQRT_RATIO,T):i.subtract(B.MAX_SQRT_RATIO,T)),t?(i.greaterThan(n,B.MIN_SQRT_RATIO)||r(!1),i.lessThan(n,this.sqrtRatioX96)||r(!1)):(i.lessThan(n,B.MAX_SQRT_RATIO)||r(!1),i.greaterThan(n,this.sqrtRatioX96)||r(!1));for(var o=i.greaterThanOrEqual(e,k),a={amountSpecifiedRemaining:e,amountCalculated:k,sqrtPriceX96:this.sqrtRatioX96,tick:this.tickCurrent,liquidity:this.liquidity};i.notEqual(a.amountSpecifiedRemaining,k)&&a.sqrtPriceX96!=n;){var u={};u.sqrtPriceStartX96=a.sqrtPriceX96;var c=H.nextInitializedTickWithinOneWord(this.ticks,a.tick,t,this.tickSpacing);u.tickNext=c[0],u.initialized=c[1],u.tickNext<B.MIN_TICK?u.tickNext=B.MIN_TICK:u.tickNext>B.MAX_TICK&&(u.tickNext=B.MAX_TICK),u.sqrtPriceNextX96=B.getSqrtRatioAtTick(u.tickNext);var s=w.computeSwapStep(a.sqrtPriceX96,(t?i.lessThan(u.sqrtPriceNextX96,n):i.greaterThan(u.sqrtPriceNextX96,n))?n:u.sqrtPriceNextX96,a.liquidity,a.amountSpecifiedRemaining,this.fee);if(a.sqrtPriceX96=s[0],u.amountIn=s[1],u.amountOut=s[2],u.feeAmount=s[3],o?(a.amountSpecifiedRemaining=i.subtract(a.amountSpecifiedRemaining,i.add(u.amountIn,u.feeAmount)),a.amountCalculated=i.subtract(a.amountCalculated,u.amountOut)):(a.amountSpecifiedRemaining=i.add(a.amountSpecifiedRemaining,u.amountOut),a.amountCalculated=i.add(a.amountCalculated,i.add(u.amountIn,u.feeAmount))),i.equal(a.sqrtPriceX96,u.sqrtPriceNextX96)){if(u.initialized){var l=H.getTick(this.ticks,u.tickNext).liquidityNet;t&&(l=i.multiply(l,g)),a.liquidity=q.addDelta(a.liquidity,l)}a.tick=t?u.tickNext-1:u.tickNext}else a.sqrtPriceX96!=u.sqrtPriceStartX96&&(a.tick=B.getTickAtSqrtRatio(a.sqrtPriceX96))}return{amountCalculated:a.amountCalculated,sqrtRatioX96:a.sqrtPriceX96,liquidity:a.liquidity,tickCurrent:a.tick}},l(t,[{key:"token0Price",get:function(){var t;return null!=(t=this._token0Price)?t:this._token0Price=new n.Price(this.token0,this.token1,v,i.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}},{key:"token1Price",get:function(){var t;return null!=(t=this._token1Price)?t:this._token1Price=new n.Price(this.token1,this.token0,i.multiply(this.sqrtRatioX96,this.sqrtRatioX96),v)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"tickSpacing",get:function(){return p[this.fee]}}]),t}(),j=function(){function t(t){var e=t.pool,n=t.liquidity,o=t.tickLower,a=t.tickUpper;this._token0Amount=null,this._token1Amount=null,o<a||r(!1),o>=B.MIN_TICK&&o%e.tickSpacing==0||r(!1),a<=B.MAX_TICK&&a%e.tickSpacing==0||r(!1),this.pool=e,this.tickLower=o,this.tickUpper=a,this.liquidity=i.BigInt(n)}return t.fromAmounts=function(e){var n=e.pool,i=e.tickLower,r=e.tickUpper,o=e.amount0,a=e.amount1,u=B.getSqrtRatioAtTick(i),c=B.getSqrtRatioAtTick(r);return new t({pool:n,tickLower:i,tickUpper:r,liquidity:U(n.sqrtRatioX96,u,c,o,a)})},t.fromAmount0=function(e){return t.fromAmounts({pool:e.pool,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0:e.amount0,amount1:n.MaxUint256})},t.fromAmount1=function(e){return t.fromAmounts({pool:e.pool,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0:n.MaxUint256,amount1:e.amount1})},l(t,[{key:"token0PriceLower",get:function(){return F(this.pool.token0,this.pool.token1,this.tickLower)}},{key:"token0PriceUpper",get:function(){return F(this.pool.token0,this.pool.token1,this.tickUpper)}},{key:"amount0",get:function(){return null!==this._token0Amount||(this._token0Amount=new n.TokenAmount(this.pool.token0,this.pool.tickCurrent<this.tickLower?S.getAmount0Delta(B.getSqrtRatioAtTick(this.tickLower),B.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1):this.pool.tickCurrent<this.tickUpper?S.getAmount0Delta(this.pool.sqrtRatioX96,B.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1):k)),this._token0Amount}},{key:"amount1",get:function(){return null!==this._token1Amount||(this._token1Amount=this.pool.tickCurrent<this.tickLower?new n.TokenAmount(this.pool.token0,k):new n.TokenAmount(this.pool.token1,S.getAmount1Delta(B.getSqrtRatioAtTick(this.tickLower),this.pool.tickCurrent<this.tickUpper?this.pool.sqrtRatioX96:B.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1))),this._token1Amount}}]),t}(),z=function(){function t(t,e,i){t.length>0||r(!1);var o=t[0].chainId;t.every((function(t){return t.chainId===o}))||r(!1);var a=n.WETH9[o],u=e instanceof n.Token&&t[0].involvesToken(e),c=e===n.ETHER&&a&&t[0].involvesToken(a);u||c||r(!1);var s=void 0===i,l=i instanceof n.Token&&t[t.length-1].involvesToken(i),d=i===n.ETHER&&a&&t[t.length-1].involvesToken(a);s||l||d||r(!1);for(var m,h=[e instanceof n.Token?e:a],p=f(t.entries());!(m=p()).done;){var g=m.value,k=g[1],T=h[g[0]];T.equals(k.token0)||T.equals(k.token1)||r(!1);var A=T.equals(k.token0)?k.token1:k.token0;h.push(A)}this.pools=t,this.tokenPath=h,this.input=e,this.output=null!=i?i:h[h.length-1]}return l(t,[{key:"chainId",get:function(){return this.pools[0].chainId}},{key:"midPrice",get:function(){throw new Error("todo")}}]),t}();function G(t,e){return n.currencyEquals(t.inputAmount.currency,e.inputAmount.currency)||r(!1),n.currencyEquals(t.outputAmount.currency,e.outputAmount.currency)||r(!1),t.outputAmount.equalTo(e.outputAmount)?t.inputAmount.equalTo(e.inputAmount)?0:t.inputAmount.lessThan(e.inputAmount)?-1:1:t.outputAmount.lessThan(e.outputAmount)?1:-1}function Q(t,e){var n=G(t,e);return 0!==n?n:t.priceImpact.lessThan(e.priceImpact)?-1:t.priceImpact.greaterThan(e.priceImpact)?1:t.route.tokenPath.length-e.route.tokenPath.length}function Y(t,e){return t instanceof n.TokenAmount?t:t.currency===n.ETHER?new n.TokenAmount(n.WETH9[e],t.raw):void r(!1)}function $(t,e){return t instanceof n.Token?t:t===n.ETHER?n.WETH9[e]:void r(!1)}var J=function(){function t(t,e,i){var o,a,u,c=new Array(t.tokenPath.length),s=new Array(t.pools.length);if(i===n.TradeType.EXACT_INPUT){n.currencyEquals(e.currency,t.input)||r(!1),c[0]=Y(e,t.chainId);for(var l=0;l<t.tokenPath.length-1;l++){var d=t.pools[l].getOutputAmount(c[l]),f=d[1];c[l+1]=d[0],s[l]=f}}else{n.currencyEquals(e.currency,t.output)||r(!1),c[c.length-1]=Y(e,t.chainId);for(var m=t.tokenPath.length-1;m>0;m--){var h=t.pools[m-1].getInputAmount(c[m]),p=h[1];c[m-1]=h[0],s[m-1]=p}}this.route=t,this.tradeType=i,this.inputAmount=i===n.TradeType.EXACT_INPUT?e:t.input===n.ETHER?n.CurrencyAmount.ether(c[0].raw):c[0],this.outputAmount=i===n.TradeType.EXACT_OUTPUT?e:t.output===n.ETHER?n.CurrencyAmount.ether(c[c.length-1].raw):c[c.length-1],this.executionPrice=new n.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.raw,this.outputAmount.raw),this.priceImpact=(o=this.outputAmount,u=(a=this.executionPrice.raw.multiply(this.inputAmount.raw)).subtract(o.raw).divide(a),new n.Percent(u.numerator,u.denominator))}t.exactIn=function(e,i){return new t(e,i,n.TradeType.EXACT_INPUT)},t.exactOut=function(e,i){return new t(e,i,n.TradeType.EXACT_OUTPUT)};var e=t.prototype;return e.minimumAmountOut=function(t){if(t.lessThan(k)&&r(!1),this.tradeType===n.TradeType.EXACT_OUTPUT)return this.outputAmount;var e=new n.Fraction(T).add(t).invert().multiply(this.outputAmount.raw).quotient;return this.outputAmount instanceof n.TokenAmount?new n.TokenAmount(this.outputAmount.token,e):n.CurrencyAmount.ether(e)},e.maximumAmountIn=function(t){if(t.lessThan(k)&&r(!1),this.tradeType===n.TradeType.EXACT_INPUT)return this.inputAmount;var e=new n.Fraction(T).add(t).multiply(this.inputAmount.raw).quotient;return this.inputAmount instanceof n.TokenAmount?new n.TokenAmount(this.inputAmount.token,e):n.CurrencyAmount.ether(e)},t.bestTradeExactIn=function(e,i,o,a,u,c,s){var l=void 0===a?{}:a,d=l.maxNumResults,f=void 0===d?3:d,m=l.maxHops,h=void 0===m?3:m;void 0===u&&(u=[]),void 0===c&&(c=i),void 0===s&&(s=[]),e.length>0||r(!1),h>0||r(!1),c===i||u.length>0||r(!1);var p=i instanceof n.TokenAmount?i.token.chainId:o instanceof n.Token?o.chainId:void 0;void 0===p&&r(!1);for(var g=Y(i,p),k=$(o,p),T=0;T<e.length;T++){var A=e[T];if(A.token0.equals(g.token)||A.token1.equals(g.token)){var v=void 0;try{v=A.getOutputAmount(g)[0]}catch(t){if(t.isInsufficientInputAmountError)continue;throw t}if(v.token.equals(k))n.sortedInsert(s,new t(new z([].concat(u,[A]),c.currency,o),c,n.TradeType.EXACT_INPUT),f,Q);else if(h>1&&e.length>1){var I=e.slice(0,T).concat(e.slice(T+1,e.length));t.bestTradeExactIn(I,v,o,{maxNumResults:f,maxHops:h-1},[].concat(u,[A]),c,s)}}}return s},t.bestTradeExactOut=function(e,i,o,a,u,c,s){var l=void 0===a?{}:a,d=l.maxNumResults,f=void 0===d?3:d,m=l.maxHops,h=void 0===m?3:m;void 0===u&&(u=[]),void 0===c&&(c=o),void 0===s&&(s=[]),e.length>0||r(!1),h>0||r(!1),c===o||u.length>0||r(!1);var p=o instanceof n.TokenAmount?o.token.chainId:i instanceof n.Token?i.chainId:void 0;void 0===p&&r(!1);for(var g=Y(o,p),k=$(i,p),T=0;T<e.length;T++){var A=e[T];if(A.token0.equals(g.token)||A.token1.equals(g.token)){var v=void 0;try{v=A.getInputAmount(g)[0]}catch(t){if(t.isInsufficientReservesError)continue;throw t}if(v.token.equals(k))n.sortedInsert(s,new t(new z([A].concat(u),i,c.currency),c,n.TradeType.EXACT_OUTPUT),f,Q);else if(h>1&&e.length>1){var I=e.slice(0,T).concat(e.slice(T+1,e.length));t.bestTradeExactOut(I,i,v,{maxNumResults:f,maxHops:h-1},[A].concat(u),c,s)}}}return s},t}(),V=function(){function t(){}return t.encodePermit=function(e,n){return"nonce"in n?t.INTERFACE.encodeFunctionData("selfPermitAllowed",[e.address,n.nonce,n.expiry,n.v,n.r,n.s]):t.INTERFACE.encodeFunctionData("selfPermit",[e.address,n.amount.toString(),n.deadline,n.v,n.r,n.s])},t.mintCallParameters=function(e,o){i.greaterThan(e.liquidity,k)||r(!1);var a=[],u="0x"+i.add(e.amount0.raw,T).toString(16),c="0x"+i.add(e.amount1.raw,T).toString(16),s=new n.Fraction(T).subtract(o.slippageTolerance),l="0x"+s.multiply(e.amount0.raw).quotient.toString(16),d="0x"+s.multiply(e.amount1.raw).quotient.toString(16);o.createPool&&a.push(t.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[e.pool.token0.address,e.pool.token1.address,e.pool.fee,e.pool.sqrtRatioX96.toString()])),o.token0Permit&&a.push(t.encodePermit(e.pool.token0,o.token0Permit)),o.token1Permit&&a.push(t.encodePermit(e.pool.token1,o.token1Permit)),a.push(t.INTERFACE.encodeFunctionData("mint",[{token0:e.pool.token0.address,token1:e.pool.token1.address,fee:e.pool.fee,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0Desired:u,amount1Desired:c,amount0Min:l,amount1Min:d,recipient:o.recipient,deadline:o.deadline}]));var f="0x0";if(o.useEther){var m=n.WETH9[e.pool.chainId];m&&e.pool.token0.equals(m)||e.pool.token1.equals(m)||r(!1),f=e.pool.token0.equals(m)?"0x"+e.amount0.raw.toString(16):"0x"+e.amount1.raw.toString(16)}return 1===a.length?{calldata:a[0],value:f}:{calldata:t.INTERFACE.encodeFunctionData("multicall",[a]),value:f}},t.exitCallParameters=function(e,o){var a,u,c,s,l,d;if(i.greaterThan(e.liquidity,k)||r(!1),i.greaterThan(i.BigInt(o.tokenId),k)||r(!1),!1===o.burnToken&&null!=(a=o.liquidityPercentage)&&a.equalTo(T)&&r(!1),o.receiveEther){var f=n.WETH9[e.pool.chainId];throw f&&e.pool.token0.equals(f)||e.pool.token1.equals(f)||r(!1),new Error("todo")}var m=[],h=null!=(u=null==(c=o.liquidityPercentage)||null==(s=c.multiply(e.liquidity))?void 0:s.quotient)?u:i.BigInt(e.liquidity),p=new n.Fraction(T).subtract(o.slippageTolerance),g="0x"+p.multiply(e.amount0.raw).quotient.toString(16),A="0x"+p.multiply(e.amount1.raw).quotient.toString(16);m.push(t.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:o.tokenId,liquidity:"0x"+h.toString(16),amount0Min:g,amount1Min:A,deadline:o.deadline}]));var v="0x"+i.subtract(i.exponentiate(i.BigInt(2),i.BigInt(128)),i.BigInt(1)).toString(16);return m.push(t.INTERFACE.encodeFunctionData("collect",[{tokenId:o.tokenId,recipient:o.recipient,amount0Max:v,amount1Max:v}])),!1===o.burnToken||null!=(l=null==(d=o.liquidityPercentage)?void 0:d.equalTo(T))&&!l||m.push(t.INTERFACE.encodeFunctionData("burn",[o.tokenId])),{calldata:t.INTERFACE.encodeFunctionData("multicall",[m]),value:"0x0"}},t}();V.ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",V.INTERFACE=new o.Interface(c.abi);var Z=function(){function t(){}return t.swapCallParameters=function(t,e){throw t.inputAmount.currency===n.ETHER&&t.outputAmount.currency===n.ETHER&&r(!1),new Error("todo")},t}();Z.ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.FACTORY_ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.FullMath=x,exports.LiquidityMath=q,exports.NONFUNGIBLE_POSITION_MANAGER_ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.NonfungiblePositionManager=V,exports.POOL_INIT_CODE_HASH=h,exports.Pool=W,exports.Position=j,exports.Route=z,exports.SWAP_ROUTER_ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.SqrtPriceMath=S,exports.SwapRouter=Z,exports.TICK_SPACINGS=p,exports.Tick=K,exports.TickList=H,exports.TickMath=B,exports.Trade=J,exports.computePoolAddress=I,exports.encodeSqrtRatioX96=_,exports.inputOutputComparator=G,exports.isSorted=X,exports.maxLiquidityForAmounts=U,exports.mostSignificantBit=N,exports.nearestUsableTick=function(t,e){Number.isInteger(t)&&Number.isInteger(e)||r(!1),e>0||r(!1),t>=B.MIN_TICK&&t<=B.MAX_TICK||r(!1);var n=Math.round(t/e)*e;return n<B.MIN_TICK?n+e:n>B.MAX_TICK?n-e:n},exports.priceToClosestTick=function(t){t.baseCurrency instanceof n.Token&&t.quoteCurrency instanceof n.Token||r(!1);var e=t.baseCurrency.sortsBefore(t.quoteCurrency),i=e?_(t.raw.numerator,t.raw.denominator):_(t.raw.denominator,t.raw.numerator),o=B.getTickAtSqrtRatio(i),a=F(t.baseCurrency,t.quoteCurrency,o+1);return e?t.lessThan(a)||o++:t.greaterThan(a)||o++,o},exports.tickToPrice=F,exports.tradeComparator=Q;
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e,n=require("@uniswap/sdk-core"),i=t(require("jsbi")),r=t(require("tiny-invariant")),o=require("@ethersproject/abi"),a=require("@ethersproject/address"),u=require("@ethersproject/solidity"),c=require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function f(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return d(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}var m,h="0xc02f72e8ae5e68802e6d893d58ddfb0df89a2f4c9c2f04927db1186a29373660";(m=exports.FeeAmount||(exports.FeeAmount={}))[m.LOW=500]="LOW",m[m.MEDIUM=3e3]="MEDIUM",m[m.HIGH=1e4]="HIGH";var p=((e={})[exports.FeeAmount.LOW]=10,e[exports.FeeAmount.MEDIUM]=60,e[exports.FeeAmount.HIGH]=200,e),g=i.BigInt(-1),k=i.BigInt(0),T=i.BigInt(1),A=i.exponentiate(i.BigInt(2),i.BigInt(96)),v=i.exponentiate(A,i.BigInt(2));function I(t){var e=t.factoryAddress,n=t.tokenA,i=t.tokenB,r=t.fee,c=n.sortsBefore(i)?[n,i]:[i,n];return a.getCreate2Address(e,u.keccak256(["bytes"],[o.defaultAbiCoder.encode(["address","address","uint24"],[c[0].address,c[1].address,r])]),h)}var q=function(){function t(){}return t.addDelta=function(t,e){return i.lessThan(e,k)?i.subtract(t,i.multiply(e,g)):i.add(t,e)},t}(),x=function(){function t(){}return t.mulDivRoundingUp=function(t,e,n){var r=i.multiply(t,e),o=i.divide(r,n);return i.notEqual(i.remainder(r,n),k)&&(o=i.add(o,T)),o},t}(),y=i.subtract(i.exponentiate(i.BigInt(2),i.BigInt(160)),T);function R(t,e){var r=i.multiply(t,e);return i.bitwiseAnd(r,n.MaxUint256)}var S=function(){function t(){}return t.getAmount0Delta=function(t,e,n,r){if(i.greaterThan(t,e)){var o=[e,t];t=o[0],e=o[1]}var a=i.leftShift(n,i.BigInt(96)),u=i.subtract(e,t);return r?x.mulDivRoundingUp(x.mulDivRoundingUp(a,u,e),T,t):i.divide(i.divide(i.multiply(a,u),e),t)},t.getAmount1Delta=function(t,e,n,r){if(i.greaterThan(t,e)){var o=[e,t];t=o[0],e=o[1]}return r?x.mulDivRoundingUp(n,i.subtract(e,t),A):i.divide(i.multiply(n,i.subtract(e,t)),A)},t.getNextSqrtPriceFromInput=function(t,e,n,o){return i.greaterThan(t,k)||r(!1),i.greaterThan(e,k)||r(!1),o?this.getNextSqrtPriceFromAmount0RoundingUp(t,e,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(t,e,n,!0)},t.getNextSqrtPriceFromOutput=function(t,e,n,o){return i.greaterThan(t,k)||r(!1),i.greaterThan(e,k)||r(!1),o?this.getNextSqrtPriceFromAmount1RoundingDown(t,e,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(t,e,n,!1)},t.getNextSqrtPriceFromAmount0RoundingUp=function(t,e,o,a){if(i.equal(o,k))return t;var u=i.leftShift(e,i.BigInt(96));if(a){var c=R(o,t);if(i.equal(i.divide(c,o),t)){var s=(d=i.add(u,c),i.bitwiseAnd(d,n.MaxUint256));if(i.greaterThanOrEqual(s,u))return x.mulDivRoundingUp(u,t,s)}return x.mulDivRoundingUp(u,T,i.add(i.divide(u,t),o))}var l=R(o,t);i.equal(i.divide(l,o),t)||r(!1),i.greaterThan(u,l)||r(!1);var d,f=i.subtract(u,l);return x.mulDivRoundingUp(u,t,f)},t.getNextSqrtPriceFromAmount1RoundingDown=function(t,e,n,o){if(o){var a=i.lessThanOrEqual(n,y)?i.divide(i.leftShift(n,i.BigInt(96)),e):i.divide(i.multiply(n,A),e);return i.add(t,a)}var u=x.mulDivRoundingUp(n,A,e);return i.greaterThan(t,u)||r(!1),i.subtract(t,u)},t}(),b=i.exponentiate(i.BigInt(10),i.BigInt(6)),w=function(){function t(){}return t.computeSwapStep=function(t,e,n,r,o){var a={},u=i.greaterThanOrEqual(t,e),c=i.greaterThanOrEqual(r,k);if(c){var s=i.divide(i.multiply(r,i.subtract(b,i.BigInt(o))),b);a.amountIn=u?S.getAmount0Delta(e,t,n,!0):S.getAmount1Delta(t,e,n,!0),a.sqrtRatioNextX96=i.greaterThanOrEqual(s,a.amountIn)?e:S.getNextSqrtPriceFromInput(t,n,s,u)}else a.amountOut=u?S.getAmount1Delta(e,t,n,!1):S.getAmount0Delta(t,e,n,!1),a.sqrtRatioNextX96=i.greaterThanOrEqual(i.multiply(r,g),a.amountOut)?e:S.getNextSqrtPriceFromOutput(t,n,i.multiply(r,g),u);var l=i.equal(e,a.sqrtRatioNextX96);return u?(a.amountIn=l&&c?a.amountIn:S.getAmount0Delta(a.sqrtRatioNextX96,t,n,!0),a.amountOut=l&&!c?a.amountOut:S.getAmount1Delta(a.sqrtRatioNextX96,t,n,!1)):(a.amountIn=l&&c?a.amountIn:S.getAmount1Delta(t,a.sqrtRatioNextX96,n,!0),a.amountOut=l&&!c?a.amountOut:S.getAmount0Delta(t,a.sqrtRatioNextX96,n,!1)),!c&&i.greaterThan(a.amountOut,i.multiply(r,g))&&(a.amountOut=i.multiply(r,g)),a.feeAmount=c&&i.notEqual(a.sqrtRatioNextX96,e)?i.subtract(r,a.amountIn):x.mulDivRoundingUp(a.amountIn,i.BigInt(o),i.subtract(b,i.BigInt(o))),[a.sqrtRatioNextX96,a.amountIn,a.amountOut,a.feeAmount]},t}(),E=i.BigInt(2),P=[128,64,32,16,8,4,2,1].map((function(t){return[t,i.exponentiate(E,i.BigInt(t))]}));function N(t){i.greaterThan(t,k)||r(!1),i.lessThanOrEqual(t,n.MaxUint256)||r(!1);for(var e,o=0,a=f(P);!(e=a()).done;){var u=e.value,c=u[0];i.greaterThanOrEqual(t,u[1])&&(t=i.signedRightShift(t,i.BigInt(c)),o+=c)}return o}function C(t,e){return i.signedRightShift(i.multiply(t,i.BigInt(e)),i.BigInt(128))}var O=i.exponentiate(i.BigInt(2),i.BigInt(32)),B=function(){function t(){}return t.getSqrtRatioAtTick=function(e){e>=t.MIN_TICK&&e<=t.MAX_TICK&&Number.isInteger(e)||r(!1);var o=e<0?-1*e:e,a=i.BigInt(0!=(1&o)?"0xfffcb933bd6fad37aa2d162d1a594001":"0x100000000000000000000000000000000");return 0!=(2&o)&&(a=C(a,"0xfff97272373d413259a46990580e213a")),0!=(4&o)&&(a=C(a,"0xfff2e50f5f656932ef12357cf3c7fdcc")),0!=(8&o)&&(a=C(a,"0xffe5caca7e10e4e61c3624eaa0941cd0")),0!=(16&o)&&(a=C(a,"0xffcb9843d60f6159c9db58835c926644")),0!=(32&o)&&(a=C(a,"0xff973b41fa98c081472e6896dfb254c0")),0!=(64&o)&&(a=C(a,"0xff2ea16466c96a3843ec78b326b52861")),0!=(128&o)&&(a=C(a,"0xfe5dee046a99a2a811c461f1969c3053")),0!=(256&o)&&(a=C(a,"0xfcbe86c7900a88aedcffc83b479aa3a4")),0!=(512&o)&&(a=C(a,"0xf987a7253ac413176f2b074cf7815e54")),0!=(1024&o)&&(a=C(a,"0xf3392b0822b70005940c7a398e4b70f3")),0!=(2048&o)&&(a=C(a,"0xe7159475a2c29b7443b29c7fa6e889d9")),0!=(4096&o)&&(a=C(a,"0xd097f3bdfd2022b8845ad8f792aa5825")),0!=(8192&o)&&(a=C(a,"0xa9f746462d870fdf8a65dc1f90e061e5")),0!=(16384&o)&&(a=C(a,"0x70d869a156d2a1b890bb3df62baf32f7")),0!=(32768&o)&&(a=C(a,"0x31be135f97d08fd981231505542fcfa6")),0!=(65536&o)&&(a=C(a,"0x9aa508b5b7a84e1c677de54f3e99bc9")),0!=(131072&o)&&(a=C(a,"0x5d6af8dedb81196699c329225ee604")),0!=(262144&o)&&(a=C(a,"0x2216e584f5fa1ea926041bedfe98")),0!=(524288&o)&&(a=C(a,"0x48a170391f7dc42444e8fa2")),e>0&&(a=i.divide(n.MaxUint256,a)),i.greaterThan(i.remainder(a,O),k)?i.add(i.divide(a,O),T):i.divide(a,O)},t.getTickAtSqrtRatio=function(e){i.greaterThanOrEqual(e,t.MIN_SQRT_RATIO)&&i.lessThan(e,t.MAX_SQRT_RATIO)||r(!1);var n,o=i.leftShift(e,i.BigInt(32)),a=N(o);n=i.greaterThanOrEqual(i.BigInt(a),i.BigInt(128))?i.signedRightShift(o,i.BigInt(a-127)):i.leftShift(o,i.BigInt(127-a));for(var u=i.leftShift(i.subtract(i.BigInt(a),i.BigInt(128)),i.BigInt(64)),c=0;c<14;c++){n=i.signedRightShift(i.multiply(n,n),i.BigInt(127));var s=i.signedRightShift(n,i.BigInt(128));u=i.bitwiseOr(u,i.leftShift(s,i.BigInt(63-c))),n=i.signedRightShift(n,s)}var l=i.multiply(u,i.BigInt("255738958999603826347141")),d=i.toNumber(i.signedRightShift(i.subtract(l,i.BigInt("3402992956809132418596140100660247210")),i.BigInt(128))),f=i.toNumber(i.signedRightShift(i.add(l,i.BigInt("291339464771989622907027621153398088495")),i.BigInt(128)));return d===f?d:i.lessThanOrEqual(t.getSqrtRatioAtTick(f),e)?f:d},t}();function _(t,e){var r=i.leftShift(i.BigInt(t),i.BigInt(192)),o=i.BigInt(e),a=i.divide(r,o);return n.sqrt(a)}function X(t,e){for(var n=0;n<t.length-1;n++)if(e(t[n],t[n+1])>0)return!1;return!0}function D(t,e,n){if(i.greaterThan(t,e)){var r=[e,t];t=r[0],e=r[1]}var o=i.divide(i.multiply(t,e),A);return i.divide(i.multiply(i.BigInt(n),o),i.subtract(e,t))}function M(t,e,n){if(i.greaterThan(t,e)){var r=[e,t];t=r[0],e=r[1]}return i.divide(i.multiply(i.BigInt(n),A),i.subtract(e,t))}function U(t,e,n,r,o){if(i.greaterThan(e,n)){var a=[n,e];e=a[0],n=a[1]}if(i.lessThanOrEqual(t,e))return D(e,n,r);if(i.lessThan(t,n)){var u=D(t,n,r),c=M(e,t,o);return i.lessThan(u,c)?u:c}return M(e,n,o)}function F(t,e,r){var o=B.getSqrtRatioAtTick(r),a=i.multiply(o,o);return t.sortsBefore(e)?new n.Price(t,e,v,a):new n.Price(t,e,a,v)}function L(t,e){return t.index-e.index}B.MIN_TICK=-887272,B.MAX_TICK=-B.MIN_TICK,B.MIN_SQRT_RATIO=i.BigInt("4295128739"),B.MAX_SQRT_RATIO=i.BigInt("1461446703485210103287273052203988822378723970342");var H=function(){function t(){}return t.validate=function(t,e){t.every((function(t){return t.index%e==0}))||r(!1),i.equal(t.reduce((function(t,e){return i.add(t,e.liquidityNet)}),k),k)||r(!1),X(t,L)||r(!1)},t.isBelowSmallest=function(t,e){return t.length>0||r(!1),e<t[0].index},t.isAtOrAboveLargest=function(t,e){return t.length>0||r(!1),e>=t[t.length-1].index},t.getTick=function(t,e){var n=t[this.binarySearch(t,e)];return n.index!==e&&r(!1),n},t.binarySearch=function(t,e){this.isBelowSmallest(t,e)&&r(!1),this.isAtOrAboveLargest(t,e)&&r(!1);for(var n,i=0,o=t.length-1;;){if(t[n=Math.floor((i+o)/2)].index<=e&&t[n+1].index>e)return n;t[n].index<e?i=n+1:o=n-1}},t.nextInitializedTick=function(e,n,i){return i?(t.isBelowSmallest(e,n)&&r(!1),t.isAtOrAboveLargest(e,n)?e[e.length-1]:e[this.binarySearch(e,n)]):(this.isAtOrAboveLargest(e,n)&&r(!1),this.isBelowSmallest(e,n)?e[0]:e[this.binarySearch(e,n)+1])},t.nextInitializedTickWithinOneWord=function(e,n,i,r){var o=Math.floor(n/r);if(i){var a=(o>>8<<8)*r;if(t.isBelowSmallest(e,n))return[a,!1];var u=t.nextInitializedTick(e,n,i).index,c=Math.max(a,u);return[c,c===u]}var s=(1+(o+1>>8)<<8)*r-1;if(this.isAtOrAboveLargest(e,n))return[s,!1];var l=this.nextInitializedTick(e,n,i).index,d=Math.min(s,l);return[d,d===l]},t}(),K=function(t){var e=t.index,n=t.liquidityGross,o=t.liquidityNet;e>=B.MIN_TICK&&e<=B.MAX_TICK||r(!1),this.index=e,this.liquidityGross=i.BigInt(n),this.liquidityNet=i.BigInt(o)},W=function(){function t(t,e,n,o,a,u,c){Number.isInteger(n)&&n<1e6||r(!1);var s=B.getSqrtRatioAtTick(u),l=B.getSqrtRatioAtTick(u+1);i.greaterThanOrEqual(i.BigInt(o),s)&&i.lessThanOrEqual(i.BigInt(o),l)||r(!1);var d=c.map((function(t){return t instanceof K?t:new K(t)}));H.validate(d,p[n]);var f=t.sortsBefore(e)?[t,e]:[e,t];this.token0=f[0],this.token1=f[1],this.fee=n,this.sqrtRatioX96=i.BigInt(o),this.liquidity=i.BigInt(a),this.tickCurrent=u,this.ticks=d}t.getAddress=function(t,e,n){return I({factoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",fee:n,tokenA:t,tokenB:e})};var e=t.prototype;return e.involvesToken=function(t){return t.equals(this.token0)||t.equals(this.token1)},e.priceOf=function(t){return this.involvesToken(t)||r(!1),t.equals(this.token0)?this.token0Price:this.token1Price},e.getOutputAmount=function(e){this.involvesToken(e.token)||r(!1);var o=e.token.equals(this.token0),a=this.swap(o,e.raw),u=a.sqrtRatioX96,c=a.liquidity,s=a.tickCurrent;return[new n.TokenAmount(o?this.token1:this.token0,i.multiply(a.amountCalculated,g)),new t(this.token0,this.token1,this.fee,u,c,s,this.ticks)]},e.getInputAmount=function(e){this.involvesToken(e.token)||r(!1);var o=e.token.equals(this.token1),a=this.swap(o,i.multiply(e.raw,g)),u=a.sqrtRatioX96,c=a.liquidity,s=a.tickCurrent;return[new n.TokenAmount(o?this.token0:this.token1,a.amountCalculated),new t(this.token0,this.token1,this.fee,u,c,s,this.ticks)]},e.swap=function(t,e,n){n||(n=t?i.add(B.MIN_SQRT_RATIO,T):i.subtract(B.MAX_SQRT_RATIO,T)),t?(i.greaterThan(n,B.MIN_SQRT_RATIO)||r(!1),i.lessThan(n,this.sqrtRatioX96)||r(!1)):(i.lessThan(n,B.MAX_SQRT_RATIO)||r(!1),i.greaterThan(n,this.sqrtRatioX96)||r(!1));for(var o=i.greaterThanOrEqual(e,k),a={amountSpecifiedRemaining:e,amountCalculated:k,sqrtPriceX96:this.sqrtRatioX96,tick:this.tickCurrent,liquidity:this.liquidity};i.notEqual(a.amountSpecifiedRemaining,k)&&a.sqrtPriceX96!=n;){var u={};u.sqrtPriceStartX96=a.sqrtPriceX96;var c=H.nextInitializedTickWithinOneWord(this.ticks,a.tick,t,this.tickSpacing);u.tickNext=c[0],u.initialized=c[1],u.tickNext<B.MIN_TICK?u.tickNext=B.MIN_TICK:u.tickNext>B.MAX_TICK&&(u.tickNext=B.MAX_TICK),u.sqrtPriceNextX96=B.getSqrtRatioAtTick(u.tickNext);var s=w.computeSwapStep(a.sqrtPriceX96,(t?i.lessThan(u.sqrtPriceNextX96,n):i.greaterThan(u.sqrtPriceNextX96,n))?n:u.sqrtPriceNextX96,a.liquidity,a.amountSpecifiedRemaining,this.fee);if(a.sqrtPriceX96=s[0],u.amountIn=s[1],u.amountOut=s[2],u.feeAmount=s[3],o?(a.amountSpecifiedRemaining=i.subtract(a.amountSpecifiedRemaining,i.add(u.amountIn,u.feeAmount)),a.amountCalculated=i.subtract(a.amountCalculated,u.amountOut)):(a.amountSpecifiedRemaining=i.add(a.amountSpecifiedRemaining,u.amountOut),a.amountCalculated=i.add(a.amountCalculated,i.add(u.amountIn,u.feeAmount))),i.equal(a.sqrtPriceX96,u.sqrtPriceNextX96)){if(u.initialized){var l=H.getTick(this.ticks,u.tickNext).liquidityNet;t&&(l=i.multiply(l,g)),a.liquidity=q.addDelta(a.liquidity,l)}a.tick=t?u.tickNext-1:u.tickNext}else a.sqrtPriceX96!=u.sqrtPriceStartX96&&(a.tick=B.getTickAtSqrtRatio(a.sqrtPriceX96))}return{amountCalculated:a.amountCalculated,sqrtRatioX96:a.sqrtPriceX96,liquidity:a.liquidity,tickCurrent:a.tick}},l(t,[{key:"token0Price",get:function(){var t;return null!=(t=this._token0Price)?t:this._token0Price=new n.Price(this.token0,this.token1,v,i.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}},{key:"token1Price",get:function(){var t;return null!=(t=this._token1Price)?t:this._token1Price=new n.Price(this.token1,this.token0,i.multiply(this.sqrtRatioX96,this.sqrtRatioX96),v)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"tickSpacing",get:function(){return p[this.fee]}}]),t}(),j=function(){function t(t){var e=t.pool,n=t.liquidity,o=t.tickLower,a=t.tickUpper;this._token0Amount=null,this._token1Amount=null,o<a||r(!1),o>=B.MIN_TICK&&o%e.tickSpacing==0||r(!1),a<=B.MAX_TICK&&a%e.tickSpacing==0||r(!1),this.pool=e,this.tickLower=o,this.tickUpper=a,this.liquidity=i.BigInt(n)}return t.fromAmounts=function(e){var n=e.pool,i=e.tickLower,r=e.tickUpper,o=e.amount0,a=e.amount1,u=B.getSqrtRatioAtTick(i),c=B.getSqrtRatioAtTick(r);return new t({pool:n,tickLower:i,tickUpper:r,liquidity:U(n.sqrtRatioX96,u,c,o,a)})},t.fromAmount0=function(e){return t.fromAmounts({pool:e.pool,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0:e.amount0,amount1:n.MaxUint256})},t.fromAmount1=function(e){return t.fromAmounts({pool:e.pool,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0:n.MaxUint256,amount1:e.amount1})},l(t,[{key:"token0PriceLower",get:function(){return F(this.pool.token0,this.pool.token1,this.tickLower)}},{key:"token0PriceUpper",get:function(){return F(this.pool.token0,this.pool.token1,this.tickUpper)}},{key:"amount0",get:function(){return null!==this._token0Amount||(this._token0Amount=new n.TokenAmount(this.pool.token0,this.pool.tickCurrent<this.tickLower?S.getAmount0Delta(B.getSqrtRatioAtTick(this.tickLower),B.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1):this.pool.tickCurrent<this.tickUpper?S.getAmount0Delta(this.pool.sqrtRatioX96,B.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1):k)),this._token0Amount}},{key:"amount1",get:function(){return null!==this._token1Amount||(this._token1Amount=this.pool.tickCurrent<this.tickLower?new n.TokenAmount(this.pool.token0,k):new n.TokenAmount(this.pool.token1,S.getAmount1Delta(B.getSqrtRatioAtTick(this.tickLower),this.pool.tickCurrent<this.tickUpper?this.pool.sqrtRatioX96:B.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1))),this._token1Amount}}]),t}(),z=function(){function t(t,e,i){t.length>0||r(!1);var o=t[0].chainId;t.every((function(t){return t.chainId===o}))||r(!1);var a=n.WETH9[o],u=e instanceof n.Token&&t[0].involvesToken(e),c=e===n.ETHER&&a&&t[0].involvesToken(a);u||c||r(!1);var s=void 0===i,l=i instanceof n.Token&&t[t.length-1].involvesToken(i),d=i===n.ETHER&&a&&t[t.length-1].involvesToken(a);s||l||d||r(!1);for(var m,h=[e instanceof n.Token?e:a],p=f(t.entries());!(m=p()).done;){var g=m.value,k=g[1],T=h[g[0]];T.equals(k.token0)||T.equals(k.token1)||r(!1);var A=T.equals(k.token0)?k.token1:k.token0;h.push(A)}this.pools=t,this.tokenPath=h,this.input=e,this.output=null!=i?i:h[h.length-1]}return l(t,[{key:"chainId",get:function(){return this.pools[0].chainId}},{key:"midPrice",get:function(){throw new Error("todo")}}]),t}();function G(t,e){return n.currencyEquals(t.inputAmount.currency,e.inputAmount.currency)||r(!1),n.currencyEquals(t.outputAmount.currency,e.outputAmount.currency)||r(!1),t.outputAmount.equalTo(e.outputAmount)?t.inputAmount.equalTo(e.inputAmount)?0:t.inputAmount.lessThan(e.inputAmount)?-1:1:t.outputAmount.lessThan(e.outputAmount)?1:-1}function Q(t,e){var n=G(t,e);return 0!==n?n:t.priceImpact.lessThan(e.priceImpact)?-1:t.priceImpact.greaterThan(e.priceImpact)?1:t.route.tokenPath.length-e.route.tokenPath.length}function Y(t,e){return t instanceof n.TokenAmount?t:t.currency===n.ETHER?new n.TokenAmount(n.WETH9[e],t.raw):void r(!1)}function $(t,e){return t instanceof n.Token?t:t===n.ETHER?n.WETH9[e]:void r(!1)}var J=function(){function t(t,e,i){var o,a,u,c=new Array(t.tokenPath.length),s=new Array(t.pools.length);if(i===n.TradeType.EXACT_INPUT){n.currencyEquals(e.currency,t.input)||r(!1),c[0]=Y(e,t.chainId);for(var l=0;l<t.tokenPath.length-1;l++){var d=t.pools[l].getOutputAmount(c[l]),f=d[1];c[l+1]=d[0],s[l]=f}}else{n.currencyEquals(e.currency,t.output)||r(!1),c[c.length-1]=Y(e,t.chainId);for(var m=t.tokenPath.length-1;m>0;m--){var h=t.pools[m-1].getInputAmount(c[m]),p=h[1];c[m-1]=h[0],s[m-1]=p}}this.route=t,this.tradeType=i,this.inputAmount=i===n.TradeType.EXACT_INPUT?e:t.input===n.ETHER?n.CurrencyAmount.ether(c[0].raw):c[0],this.outputAmount=i===n.TradeType.EXACT_OUTPUT?e:t.output===n.ETHER?n.CurrencyAmount.ether(c[c.length-1].raw):c[c.length-1],this.executionPrice=new n.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.raw,this.outputAmount.raw),this.priceImpact=(o=this.outputAmount,u=(a=this.executionPrice.raw.multiply(this.inputAmount.raw)).subtract(o.raw).divide(a),new n.Percent(u.numerator,u.denominator))}t.exactIn=function(e,i){return new t(e,i,n.TradeType.EXACT_INPUT)},t.exactOut=function(e,i){return new t(e,i,n.TradeType.EXACT_OUTPUT)};var e=t.prototype;return e.minimumAmountOut=function(t){if(t.lessThan(k)&&r(!1),this.tradeType===n.TradeType.EXACT_OUTPUT)return this.outputAmount;var e=new n.Fraction(T).add(t).invert().multiply(this.outputAmount.raw).quotient;return this.outputAmount instanceof n.TokenAmount?new n.TokenAmount(this.outputAmount.token,e):n.CurrencyAmount.ether(e)},e.maximumAmountIn=function(t){if(t.lessThan(k)&&r(!1),this.tradeType===n.TradeType.EXACT_INPUT)return this.inputAmount;var e=new n.Fraction(T).add(t).multiply(this.inputAmount.raw).quotient;return this.inputAmount instanceof n.TokenAmount?new n.TokenAmount(this.inputAmount.token,e):n.CurrencyAmount.ether(e)},t.bestTradeExactIn=function(e,i,o,a,u,c,s){var l=void 0===a?{}:a,d=l.maxNumResults,f=void 0===d?3:d,m=l.maxHops,h=void 0===m?3:m;void 0===u&&(u=[]),void 0===c&&(c=i),void 0===s&&(s=[]),e.length>0||r(!1),h>0||r(!1),c===i||u.length>0||r(!1);var p=i instanceof n.TokenAmount?i.token.chainId:o instanceof n.Token?o.chainId:void 0;void 0===p&&r(!1);for(var g=Y(i,p),k=$(o,p),T=0;T<e.length;T++){var A=e[T];if(A.token0.equals(g.token)||A.token1.equals(g.token)){var v=void 0;try{v=A.getOutputAmount(g)[0]}catch(t){if(t.isInsufficientInputAmountError)continue;throw t}if(v.token.equals(k))n.sortedInsert(s,new t(new z([].concat(u,[A]),c.currency,o),c,n.TradeType.EXACT_INPUT),f,Q);else if(h>1&&e.length>1){var I=e.slice(0,T).concat(e.slice(T+1,e.length));t.bestTradeExactIn(I,v,o,{maxNumResults:f,maxHops:h-1},[].concat(u,[A]),c,s)}}}return s},t.bestTradeExactOut=function(e,i,o,a,u,c,s){var l=void 0===a?{}:a,d=l.maxNumResults,f=void 0===d?3:d,m=l.maxHops,h=void 0===m?3:m;void 0===u&&(u=[]),void 0===c&&(c=o),void 0===s&&(s=[]),e.length>0||r(!1),h>0||r(!1),c===o||u.length>0||r(!1);var p=o instanceof n.TokenAmount?o.token.chainId:i instanceof n.Token?i.chainId:void 0;void 0===p&&r(!1);for(var g=Y(o,p),k=$(i,p),T=0;T<e.length;T++){var A=e[T];if(A.token0.equals(g.token)||A.token1.equals(g.token)){var v=void 0;try{v=A.getInputAmount(g)[0]}catch(t){if(t.isInsufficientReservesError)continue;throw t}if(v.token.equals(k))n.sortedInsert(s,new t(new z([A].concat(u),i,c.currency),c,n.TradeType.EXACT_OUTPUT),f,Q);else if(h>1&&e.length>1){var I=e.slice(0,T).concat(e.slice(T+1,e.length));t.bestTradeExactOut(I,i,v,{maxNumResults:f,maxHops:h-1},[A].concat(u),c,s)}}}return s},t}(),V=function(){function t(){}return t.encodePermit=function(e,n){return"nonce"in n?t.INTERFACE.encodeFunctionData("selfPermitAllowed",[e.address,n.nonce,n.expiry,n.v,n.r,n.s]):t.INTERFACE.encodeFunctionData("selfPermit",[e.address,n.amount.toString(),n.deadline,n.v,n.r,n.s])},t.mintCallParameters=function(e,o){i.greaterThan(e.liquidity,k)||r(!1);var a=[],u="0x"+i.add(e.amount0.raw,T).toString(16),c="0x"+i.add(e.amount1.raw,T).toString(16),s=new n.Fraction(T).subtract(o.slippageTolerance),l="0x"+s.multiply(e.amount0.raw).quotient.toString(16),d="0x"+s.multiply(e.amount1.raw).quotient.toString(16);o.createPool&&a.push(t.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[e.pool.token0.address,e.pool.token1.address,e.pool.fee,e.pool.sqrtRatioX96.toString()])),o.token0Permit&&a.push(t.encodePermit(e.pool.token0,o.token0Permit)),o.token1Permit&&a.push(t.encodePermit(e.pool.token1,o.token1Permit)),a.push(t.INTERFACE.encodeFunctionData("mint",[{token0:e.pool.token0.address,token1:e.pool.token1.address,fee:e.pool.fee,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0Desired:u,amount1Desired:c,amount0Min:l,amount1Min:d,recipient:o.recipient,deadline:o.deadline}]));var f="0x0";if(o.useEther){var m=n.WETH9[e.pool.chainId];m&&e.pool.token0.equals(m)||e.pool.token1.equals(m)||r(!1),f=e.pool.token0.equals(m)?"0x"+e.amount0.raw.toString(16):"0x"+e.amount1.raw.toString(16)}return 1===a.length?{calldata:a[0],value:f}:{calldata:t.INTERFACE.encodeFunctionData("multicall",[a]),value:f}},t.exitCallParameters=function(e,o){var a,u,c,s,l,d;if(i.greaterThan(e.liquidity,k)||r(!1),i.greaterThan(i.BigInt(o.tokenId),k)||r(!1),!1===o.burnToken&&null!=(a=o.liquidityPercentage)&&a.equalTo(T)&&r(!1),o.receiveEther){var f=n.WETH9[e.pool.chainId];throw f&&e.pool.token0.equals(f)||e.pool.token1.equals(f)||r(!1),new Error("todo")}var m=[],h=null!=(u=null==(c=o.liquidityPercentage)||null==(s=c.multiply(e.liquidity))?void 0:s.quotient)?u:i.BigInt(e.liquidity),p=new n.Fraction(T).subtract(o.slippageTolerance),g="0x"+p.multiply(e.amount0.raw).quotient.toString(16),A="0x"+p.multiply(e.amount1.raw).quotient.toString(16);m.push(t.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:o.tokenId,liquidity:"0x"+h.toString(16),amount0Min:g,amount1Min:A,deadline:o.deadline}]));var v="0x"+i.subtract(i.exponentiate(i.BigInt(2),i.BigInt(128)),i.BigInt(1)).toString(16);return m.push(t.INTERFACE.encodeFunctionData("collect",[{tokenId:o.tokenId,recipient:o.recipient,amount0Max:v,amount1Max:v}])),!1===o.burnToken||null!=(l=null==(d=o.liquidityPercentage)?void 0:d.equalTo(T))&&!l||m.push(t.INTERFACE.encodeFunctionData("burn",[o.tokenId])),{calldata:t.INTERFACE.encodeFunctionData("multicall",[m]),value:"0x0"}},t}();V.ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",V.INTERFACE=new o.Interface(c.abi);var Z=function(){function t(){}return t.swapCallParameters=function(t,e){throw t.inputAmount.currency===n.ETHER&&t.outputAmount.currency===n.ETHER&&r(!1),new Error("todo")},t}();Z.ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.FACTORY_ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.FullMath=x,exports.LiquidityMath=q,exports.NONFUNGIBLE_POSITION_MANAGER_ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.NonfungiblePositionManager=V,exports.POOL_INIT_CODE_HASH=h,exports.Pool=W,exports.Position=j,exports.Route=z,exports.SWAP_ROUTER_ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.SqrtPriceMath=S,exports.SwapRouter=Z,exports.TICK_SPACINGS=p,exports.Tick=K,exports.TickList=H,exports.TickMath=B,exports.Trade=J,exports.computePoolAddress=I,exports.encodeSqrtRatioX96=_,exports.inputOutputComparator=G,exports.isSorted=X,exports.maxLiquidityForAmounts=U,exports.mostSignificantBit=N,exports.nearestUsableTick=function(t,e){Number.isInteger(t)&&Number.isInteger(e)||r(!1),e>0||r(!1),t>=B.MIN_TICK&&t<=B.MAX_TICK||r(!1);var n=Math.round(t/e)*e;return n<B.MIN_TICK?n+e:n>B.MAX_TICK?n-e:n},exports.priceToClosestTick=function(t){t.baseCurrency instanceof n.Token&&t.quoteCurrency instanceof n.Token||r(!1);var e=t.baseCurrency.sortsBefore(t.quoteCurrency),i=e?_(t.raw.numerator,t.raw.denominator):_(t.raw.denominator,t.raw.numerator),o=B.getTickAtSqrtRatio(i),a=F(t.baseCurrency,t.quoteCurrency,o+1);return e?t.lessThan(a)||o++:t.greaterThan(a)||o++,o},exports.tickToPrice=F,exports.tradeComparator=Q;
//# sourceMappingURL=v3-sdk.cjs.production.min.js.map

@@ -7,3 +7,3 @@ {

},
"version": "1.0.0-alpha.12",
"version": "1.0.0-alpha.13",
"description": "⚒️ An SDK for building applications on top of Uniswap V3",

@@ -31,3 +31,3 @@ "main": "dist/index.js",

"@uniswap/sdk-core": "^1.0.9",
"@uniswap/v3-periphery": "^1.0.0-beta.19",
"@uniswap/v3-periphery": "^1.0.0-beta.21",
"tiny-invariant": "^1.1.0",

@@ -38,3 +38,3 @@ "tiny-warning": "^1.0.3"

"@types/jest": "^24.0.25",
"@uniswap/v3-core": "^1.0.0-rc.1",
"@uniswap/v3-core": "^1.0.0-rc.2",
"tsdx": "^0.14.1"

@@ -41,0 +41,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc