UNPKG

@elkdex/sdk

Version:

🛠 An SDK for building applications on top of Elk Finance.

3 lines (2 loc) • 32 kB
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n,r,t,a=e(require("jsbi")),E=e(require("tiny-invariant")),i=e(require("decimal.js-light")),o=e(require("big.js")),T=e(require("toformat")),C=require("@ethersproject/address");(n=exports.ChainId||(exports.ChainId={}))[n.MUMBAI=80001]="MUMBAI",n[n.MATIC=137]="MATIC",n[n.FUJI=43113]="FUJI",n[n.AVALANCHE=43114]="AVALANCHE",n[n.FANTOM_TESTNET=4002]="FANTOM_TESTNET",n[n.FANTOM=250]="FANTOM",n[n.HUOBIECO_TESTNET=256]="HUOBIECO_TESTNET",n[n.HUOBIECO=128]="HUOBIECO",n[n.REEF=13939]="REEF",n[n.XDAI=100]="XDAI",n[n.FUSE=122]="FUSE",n[n.OPTIMISM=10]="OPTIMISM",n[n.OPTIMISM_TESTNET=69]="OPTIMISM_TESTNET",n[n.KUCOIN=321]="KUCOIN",n[n.KUCOIN_TESTNET=322]="KUCOIN_TESTNET",n[n.ETHERLITE=111]="ETHERLITE",n[n.ETHEREUM_CLASSIC=61]="ETHEREUM_CLASSIC",n[n.ETHEREUM_CLASSIC_TESTNET=62]="ETHEREUM_CLASSIC_TESTNET",n[n.MOONBEAM_TESTNET=1287]="MOONBEAM_TESTNET",n[n.CLOVER_TESTNET=123]="CLOVER_TESTNET",n[n.CELO=42220]="CELO",n[n.ALFAJORES=44787]="ALFAJORES",n[n.ARBITRUM_TESTNET=421611]="ARBITRUM_TESTNET",n[n.ARBITRUM=42161]="ARBITRUM",n[n.FLARE=14]="FLARE",n[n.FLARE_TESTNET=16]="FLARE_TESTNET",n[n.FUSION=32659]="FUSION",n[n.HARMONY=16666e5]="HARMONY",n[n.OKEX=66]="OKEX",n[n.IOTEX=4689]="IOTEX",n[n.HOO=70]="HOO",n[n.ELAETH=20]="ELAETH",n[n.MOONRIVER=1285]="MOONRIVER",n[n.TELOS=40]="TELOS",n[n.CRONOS=25]="CRONOS",n[n.KAVA=2222]="KAVA",n[n.BTTC=199]="BTTC",n[n.BTTC_TESTNET=1029]="BTTC_TESTNET",n[n.BINANCE_TESTNET=97]="BINANCE_TESTNET",n[n.BINANCE=56]="BINANCE",n[n.ROPSTEN=3]="ROPSTEN",n[n.ETHEREUM=1]="ETHEREUM",n[n.NEON_TESTNET=245022926]="NEON_TESTNET",n[n.NEON_MAINNET=245022934]="NEON_MAINNET",n[n.Q=35441]="Q",n[n.BITGERT=32520]="BITGERT",n[n.WANCHAIN=888]="WANCHAIN",n[n.METIS=1088]="METIS",n[n.ASTAR=592]="ASTAR",n[n.ARTHERA_TESTNET=10243]="ARTHERA_TESTNET",n[n.ARTHERA=10242]="ARTHERA",n[n.PULSECHAIN=369]="PULSECHAIN",n[n.BASE=8453]="BASE",n[n.VELAS=106]="VELAS",n[n.LINEA=59144]="LINEA",n[n.ROOTSTOCK=30]="ROOTSTOCK",n[n.BOBA=288]="BOBA",n[n.BOBA_BNB=56288]="BOBA_BNB",n[n.CLOVER=1024]="CLOVER",n[n.AURORA=1313161554]="AURORA",n[n.ZKSYNC=324]="ZKSYNC",n[n.SCROLL=534352]="SCROLL",n[n.BLAST=238]="BLAST",n[n.OPBNB=204]="OPBNB",n[n.MOONBEAM=1284]="MOONBEAM",n[n.MANTLE=5e3]="MANTLE",n[n.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",n[n.SONIC=146]="SONIC",n[n.BERA=80094]="BERA",n[n.EXPCHAIN_TESTNET=18880]="EXPCHAIN_TESTNET",n[n.CYTONIC_TESTNET=52226]="CYTONIC_TESTNET",(r=exports.TradeType||(exports.TradeType={}))[r.EXACT_INPUT=0]="EXACT_INPUT",r[r.EXACT_OUTPUT=1]="EXACT_OUTPUT",(t=exports.Rounding||(exports.Rounding={}))[t.ROUND_DOWN=0]="ROUND_DOWN",t[t.ROUND_HALF_UP=1]="ROUND_HALF_UP",t[t.ROUND_UP=2]="ROUND_UP";var d,p,I=a.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),s="0x0000000000000000000000000000000000000000";function h(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function A(e,n,r){return n&&h(e.prototype,n),r&&h(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function x(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,(Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var N=T(i),O=T(o),S=((d={})[exports.Rounding.ROUND_DOWN]=N.ROUND_DOWN,d[exports.Rounding.ROUND_HALF_UP]=N.ROUND_HALF_UP,d[exports.Rounding.ROUND_UP]=N.ROUND_UP,d),u=((p={})[exports.Rounding.ROUND_DOWN]=0,p[exports.Rounding.ROUND_HALF_UP]=1,p[exports.Rounding.ROUND_UP]=3,p),B=function(){function e(e,n){void 0===n&&(n=a.BigInt(1)),this.numerator=a.BigInt(e),this.denominator=a.BigInt(n)}e.tryParseFraction=function(n){if(n instanceof a||"number"==typeof n||"string"==typeof n)return new e(n);if("numerator"in n&&"denominator"in n)return n;throw new Error("Could not parse fraction")};var n=e.prototype;return n.invert=function(){return new e(this.denominator,this.numerator)},n.add=function(n){var r=e.tryParseFraction(n);return a.equal(this.denominator,r.denominator)?new e(a.add(this.numerator,r.numerator),this.denominator):new e(a.add(a.multiply(this.numerator,r.denominator),a.multiply(r.numerator,this.denominator)),a.multiply(this.denominator,r.denominator))},n.subtract=function(n){var r=e.tryParseFraction(n);return a.equal(this.denominator,r.denominator)?new e(a.subtract(this.numerator,r.numerator),this.denominator):new e(a.subtract(a.multiply(this.numerator,r.denominator),a.multiply(r.numerator,this.denominator)),a.multiply(this.denominator,r.denominator))},n.lessThan=function(n){var r=e.tryParseFraction(n);return a.lessThan(a.multiply(this.numerator,r.denominator),a.multiply(r.numerator,this.denominator))},n.equalTo=function(n){var r=e.tryParseFraction(n);return a.equal(a.multiply(this.numerator,r.denominator),a.multiply(r.numerator,this.denominator))},n.greaterThan=function(n){var r=e.tryParseFraction(n);return a.greaterThan(a.multiply(this.numerator,r.denominator),a.multiply(r.numerator,this.denominator))},n.multiply=function(n){var r=e.tryParseFraction(n);return new e(a.multiply(this.numerator,r.numerator),a.multiply(this.denominator,r.denominator))},n.divide=function(n){var r=e.tryParseFraction(n);return new e(a.multiply(this.numerator,r.denominator),a.multiply(this.denominator,r.numerator))},n.toSignificant=function(e,n,r){void 0===n&&(n={groupSeparator:""}),void 0===r&&(r=exports.Rounding.ROUND_HALF_UP),Number.isInteger(e)||E(!1),e>0||E(!1),N.set({precision:e+1,rounding:S[r]});var t=new N(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return t.toFormat(t.decimalPlaces(),n)},n.toFixed=function(e,n,r){return void 0===n&&(n={groupSeparator:""}),void 0===r&&(r=exports.Rounding.ROUND_HALF_UP),Number.isInteger(e)||E(!1),e>=0||E(!1),O.DP=e,O.RM=u[r],new O(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,n)},A(e,[{key:"quotient",get:function(){return a.divide(this.numerator,this.denominator)}},{key:"remainder",get:function(){return new e(a.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function(){return new e(this.numerator,this.denominator)}}]),e}(),R=T(o),c=function(e){function n(n,r,t){var i;return i=e.call(this,r,t)||this,a.lessThanOrEqual(i.quotient,I)||E(!1),i.currency=n,i.decimalScale=a.exponentiate(a.BigInt(10),a.BigInt(n.decimals)),i}x(n,e),n.fromRawAmount=function(e,r){return new n(e,r)},n.fromFractionalAmount=function(e,r,t){return new n(e,r,t)};var r=n.prototype;return r.add=function(r){this.currency.equals(r.currency)||E(!1);var t=e.prototype.add.call(this,r);return n.fromFractionalAmount(this.currency,t.numerator,t.denominator)},r.subtract=function(r){this.currency.equals(r.currency)||E(!1);var t=e.prototype.subtract.call(this,r);return n.fromFractionalAmount(this.currency,t.numerator,t.denominator)},r.multiply=function(r){var t=e.prototype.multiply.call(this,r);return n.fromFractionalAmount(this.currency,t.numerator,t.denominator)},r.divide=function(r){var t=e.prototype.divide.call(this,r);return n.fromFractionalAmount(this.currency,t.numerator,t.denominator)},r.toSignificant=function(n,r,t){return void 0===n&&(n=6),void 0===t&&(t=exports.Rounding.ROUND_DOWN),e.prototype.divide.call(this,this.decimalScale).toSignificant(n,r,t)},r.toFixed=function(n,r,t){return void 0===n&&(n=this.currency.decimals),void 0===t&&(t=exports.Rounding.ROUND_DOWN),n<=this.currency.decimals||E(!1),e.prototype.divide.call(this,this.decimalScale).toFixed(n,r,t)},r.toExact=function(e){return void 0===e&&(e={groupSeparator:""}),R.DP=this.currency.decimals,new R(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(e)},A(n,[{key:"wrapped",get:function(){return this.currency.isToken?this:n.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),n}(B),H=new B(a.BigInt(100));function f(e){return new M(e.numerator,e.denominator)}var M=function(e){function n(){var n;return(n=e.apply(this,arguments)||this).isPercent=!0,n}x(n,e);var r=n.prototype;return r.add=function(n){return f(e.prototype.add.call(this,n))},r.subtract=function(n){return f(e.prototype.subtract.call(this,n))},r.multiply=function(n){return f(e.prototype.multiply.call(this,n))},r.divide=function(n){return f(e.prototype.divide.call(this,n))},r.toSignificant=function(n,r,t){return void 0===n&&(n=5),e.prototype.multiply.call(this,H).toSignificant(n,r,t)},r.toFixed=function(n,r,t){return void 0===n&&(n=2),e.prototype.multiply.call(this,H).toFixed(n,r,t)},n}(B),L=function(e){function n(){for(var n,r,t,E,i,o=arguments.length,T=new Array(o),C=0;C<o;C++)T[C]=arguments[C];if(4===T.length)r=T[0],t=T[1],E=T[2],i=T[3];else{var d=T[0].quoteAmount.divide(T[0].baseAmount),p=[T[0].baseAmount.currency,T[0].quoteAmount.currency,d.denominator,d.numerator];r=p[0],t=p[1],E=p[2],i=p[3]}return(n=e.call(this,i,E)||this).baseCurrency=r,n.quoteCurrency=t,n.scalar=new B(a.exponentiate(a.BigInt(10),a.BigInt(r.decimals)),a.exponentiate(a.BigInt(10),a.BigInt(t.decimals))),n}x(n,e);var r=n.prototype;return r.invert=function(){return new n(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},r.multiply=function(r){this.quoteCurrency.equals(r.baseCurrency)||E(!1);var t=e.prototype.multiply.call(this,r);return new n(this.baseCurrency,r.quoteCurrency,t.denominator,t.numerator)},r.quote=function(n){n.currency.equals(this.baseCurrency)||E(!1);var r=e.prototype.multiply.call(this,n);return c.fromFractionalAmount(this.quoteCurrency,r.numerator,r.denominator)},r.toSignificant=function(e,n,r){return void 0===e&&(e=6),this.adjustedForDecimals.toSignificant(e,n,r)},r.toFixed=function(e,n,r){return void 0===e&&(e=4),this.adjustedForDecimals.toFixed(e,n,r)},A(n,[{key:"adjustedForDecimals",get:function(){return e.prototype.multiply.call(this,this.scalar)}}]),n}(B),F=function(e,n,r,t){Number.isSafeInteger(e)||E(!1),n>=0&&n<255&&Number.isInteger(n)||E(!1),this.chainId=e,this.decimals=n,this.symbol=r,this.name=t},_=function(e){function n(){var n;return(n=e.apply(this,arguments)||this).isNative=!0,n.isToken=!1,n}return x(n,e),n}(F);function l(e){try{return C.getAddress(e)}catch(n){throw new Error(e+" is not a valid address.")}}var w,m,W,U,D,y=/^0x[0-9a-fA-F]{40}$/,b=function(e){function n(n,r,t,a,E,i){var o;return(o=e.call(this,n,t,a,E)||this).isNative=!1,o.isToken=!0,o.address=i?function(e){if(y.test(e))return e;throw new Error(e+" is not a valid address.")}(r):l(r),o}x(n,e);var r=n.prototype;return r.equals=function(e){return e.isToken&&this.chainId===e.chainId&&this.address===e.address},r.sortsBefore=function(e){return this.chainId!==e.chainId&&E(!1),this.address===e.address&&E(!1),this.address.toLowerCase()<e.address.toLowerCase()},A(n,[{key:"wrapped",get:function(){return this}}]),n}(F),P=((w={})[1]=new b(1,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped Ether"),w[3]=new b(3,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),w[4]=new b(4,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),w[5]=new b(5,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH","Wrapped Ether"),w[42]=new b(42,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH","Wrapped Ether"),w[10]=new b(10,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),w[69]=new b(69,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),w[42161]=new b(42161,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped Ether"),w[421611]=new b(421611,"0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681",18,"WETH","Wrapped Ether"),w),V=((m={})[exports.ChainId.MUMBAI]=new b(exports.ChainId.MUMBAI,"0x5B67676a984807a212b1c59eBFc9B3568a474F0a",18,"WPOL","Wrapped POL"),m[exports.ChainId.MATIC]=new b(exports.ChainId.MATIC,"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",18,"WPOL","Wrapped POL"),m[exports.ChainId.FUJI]=new b(exports.ChainId.FUJI,"0xd00ae08403B9bbb9124bB305C09058E32C39A48c",18,"WAVAX","Wrapped AVAX"),m[exports.ChainId.AVALANCHE]=new b(exports.ChainId.AVALANCHE,"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",18,"WAVAX","Wrapped AVAX"),m[exports.ChainId.FANTOM_TESTNET]=new b(exports.ChainId.FANTOM_TESTNET,"0xf1277d1Ed8AD466beddF92ef448A132661956621",18,"WFTM","Wrapped FTM"),m[exports.ChainId.FANTOM]=new b(exports.ChainId.FANTOM,"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",18,"WFTM","Wrapped FTM"),m[exports.ChainId.HUOBIECO_TESTNET]=new b(exports.ChainId.HUOBIECO_TESTNET,"0x7aF326B6351C8A9b8fb8CD205CBe11d4Ac5FA836",18,"WHT","Wrapped HT"),m[exports.ChainId.HUOBIECO]=new b(exports.ChainId.HUOBIECO,"0x5545153CCFcA01fbd7Dd11C0b23ba694D9509A6F",18,"WHT","Wrapped HT"),m[exports.ChainId.REEF]=new b(exports.ChainId.REEF,s,18,"WREEF","Wrapped REEF"),m[exports.ChainId.XDAI]=new b(exports.ChainId.XDAI,"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",18,"WXDAI","Wrapped XDAI"),m[exports.ChainId.FUSE]=new b(exports.ChainId.FUSE,"0x0BE9e53fd7EDaC9F859882AfdDa116645287C629",18,"WFUSE","Wrapped FUSE"),m[exports.ChainId.OPTIMISM]=new b(exports.ChainId.OPTIMISM,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped ETH"),m[exports.ChainId.OPTIMISM_TESTNET]=new b(exports.ChainId.OPTIMISM_TESTNET,s,18,"WKOR","Wrapped KOR"),m[exports.ChainId.KUCOIN]=new b(exports.ChainId.KUCOIN,"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",18,"WKCS","Wrapped KCS"),m[exports.ChainId.KUCOIN_TESTNET]=new b(exports.ChainId.KUCOIN_TESTNET,s,18,"WtKCS","Wrapped tKCS"),m[exports.ChainId.ETHERLITE]=new b(exports.ChainId.ETHERLITE,s,18,"WETL","Wrapped ETL"),m[exports.ChainId.ETHEREUM_CLASSIC]=new b(exports.ChainId.ETHEREUM_CLASSIC,s,18,"WETC","Wrapped ETC"),m[exports.ChainId.ETHEREUM_CLASSIC_TESTNET]=new b(exports.ChainId.ETHEREUM_CLASSIC_TESTNET,s,18,"WCETC","Wrapped CETC"),m[exports.ChainId.MOONBEAM]=new b(exports.ChainId.MOONBEAM,"0xAcc15dC74880C9944775448304B263D191c6077F",18,"WGLMR","Wrapped GLMR"),m[exports.ChainId.MOONBEAM_TESTNET]=new b(exports.ChainId.MOONBEAM_TESTNET,s,18,"WDEV","Wrapped DEV"),m[exports.ChainId.CLOVER]=new b(exports.ChainId.CLOVER,"0x1376C97C5c512d2d6F9173A9A3A016B6140b4536",18,"WCLV","Wrapped CLV"),m[exports.ChainId.CLOVER_TESTNET]=new b(exports.ChainId.CLOVER_TESTNET,s,18,"WCLV","Wrapped CLV"),m[exports.ChainId.CELO]=new b(exports.ChainId.CELO,s,18,"WCELO","Wrapped CELO"),m[exports.ChainId.ALFAJORES]=new b(exports.ChainId.ALFAJORES,s,18,"WCELO","Wrapped CELO"),m[exports.ChainId.ARBITRUM_TESTNET]=new b(exports.ChainId.ARBITRUM_TESTNET,s,18,"WETH","Wrapped ETH"),m[exports.ChainId.ARBITRUM]=new b(exports.ChainId.ARBITRUM,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped ETH"),m[exports.ChainId.FLARE]=new b(exports.ChainId.FLARE,s,18,"WFLR","Wrapped FLR"),m[exports.ChainId.FLARE_TESTNET]=new b(exports.ChainId.FLARE_TESTNET,s,18,"WCFLR","Wrapped CFLR"),m[exports.ChainId.FUSION]=new b(exports.ChainId.FUSION,s,18,"WFSN","Wrapped FSN"),m[exports.ChainId.HARMONY]=new b(exports.ChainId.HARMONY,"0xcF664087a5bB0237a0BAd6742852ec6c8d69A27a",18,"WONE","Wrapped ONE"),m[exports.ChainId.OKEX]=new b(exports.ChainId.OKEX,"0x8F8526dbfd6E38E3D8307702cA8469Bae6C56C15",18,"WOKT","Wrapped OKT"),m[exports.ChainId.IOTEX]=new b(exports.ChainId.IOTEX,"0xA00744882684C3e4747faEFD68D283eA44099D03",18,"WIOTX","Wrapped IOTX"),m[exports.ChainId.HOO]=new b(exports.ChainId.HOO,"0x3EFF9D389D13D6352bfB498BCF616EF9b1BEaC87",18,"WHOO","Wrapped HOO"),m[exports.ChainId.ELAETH]=new b(exports.ChainId.ELAETH,"0x517E9e5d46C1EA8aB6f78677d6114Ef47F71f6c4",18,"WELA","Wrapped ELA"),m[exports.ChainId.MOONRIVER]=new b(exports.ChainId.MOONRIVER,"0x98878B06940aE243284CA214f92Bb71a2b032B8A",18,"WMOVR","Wrapped MOVR"),m[exports.ChainId.TELOS]=new b(exports.ChainId.TELOS,"0xD102cE6A4dB07D247fcc28F366A623Df0938CA9E",18,"WTLOS","Wrapped TLOS"),m[exports.ChainId.CRONOS]=new b(exports.ChainId.CRONOS,"0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23",18,"WCRO","Wrapped CRO"),m[exports.ChainId.BTTC]=new b(exports.ChainId.BTTC,"0x8D193c6efa90BCFf940A98785d1Ce9D093d3DC8A",18,"WBTT","Wrapped BTT"),m[exports.ChainId.BTTC_TESTNET]=new b(exports.ChainId.BTTC_TESTNET,"0x107742EB846b86CEaAF7528D5C85cddcad3e409A",18,"WBTT","Wrapped BTT"),m[exports.ChainId.KAVA]=new b(exports.ChainId.KAVA,"0xc86c7C0eFbd6A49B35E8714C5f59D99De09A225b",18,"WKAVA","Wrapped KAVA"),m[exports.ChainId.BINANCE_TESTNET]=new b(exports.ChainId.BINANCE_TESTNET,"0x094616F0BdFB0b526bD735Bf66Eca0Ad254ca81F",18,"WBNB","Wrapped BNB"),m[exports.ChainId.BINANCE]=new b(exports.ChainId.BINANCE,"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",18,"WBNB","Wrapped BNB"),m[exports.ChainId.ROPSTEN]=new b(exports.ChainId.ROPSTEN,"0x0a180A76e4466bF68A7F86fB029BEd3cCcFaAac5",18,"WETH","Wrapped ETH"),m[exports.ChainId.ETHEREUM]=new b(exports.ChainId.ETHEREUM,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped ETH"),m[exports.ChainId.NEON_TESTNET]=new b(exports.ChainId.NEON_TESTNET,"0x11adC2d986E334137b9ad0a0F290771F31e9517F",18,"WNEON","Wrapped NEON"),m[exports.ChainId.NEON_MAINNET]=new b(exports.ChainId.NEON_MAINNET,"0x202C35e517Fa803B537565c40F0a6965D7204609",18,"WNEON","Wrapped NEON"),m[exports.ChainId.Q]=new b(exports.ChainId.Q,"0xd07178e3eCbC78De110Df84fe1A979D5f349784a",18,"WQOV","Wrapped QOV"),m[exports.ChainId.BITGERT]=new b(exports.ChainId.BITGERT,"0x0eb9036cbE0f052386f36170c6b07eF0a0E3f710",18,"WBRISE","Wrapped BRISE"),m[exports.ChainId.WANCHAIN]=new b(exports.ChainId.WANCHAIN,"0xdabD997aE5E4799BE47d6E69D9431615CBa28f48",18,"WWAN","Wrapped WAN"),m[exports.ChainId.METIS]=new b(exports.ChainId.METIS,"0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481",18,"WMETIS","Wrapped METIS"),m[exports.ChainId.ASTAR]=new b(exports.ChainId.ASTAR,"0xAeaaf0e2c81Af264101B9129C00F4440cCF0F720",18,"WASTR","Wrapped ASTR"),m[exports.ChainId.ARTHERA_TESTNET]=new b(exports.ChainId.ARTHERA_TESTNET,"0x5A1750f9cb8A7E98e1FD618922Af276493318710",18,"WAA","Wrapped AA"),m[exports.ChainId.ARTHERA]=new b(exports.ChainId.ARTHERA,"0x69D349E2009Af35206EFc3937BaD6817424729F7",18,"WAA","Wrapped AA"),m[exports.ChainId.PULSECHAIN]=new b(exports.ChainId.PULSECHAIN,"0xA1077a294dDE1B09bB078844df40758a5D0f9a27",18,"WPLS","Wrapped PLS"),m[exports.ChainId.BASE]=new b(exports.ChainId.BASE,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped ETH"),m[exports.ChainId.VELAS]=new b(exports.ChainId.VELAS,"0xc579D1f3CF86749E05CD06f7ADe17856c2CE3126",18,"VLX","Wrapped VLX"),m[exports.ChainId.LINEA]=new b(exports.ChainId.LINEA,"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",18,"WETH","Wrapped ETH"),m[exports.ChainId.ROOTSTOCK]=new b(exports.ChainId.ROOTSTOCK,"0x542fda317318ebf1d3deaf76e0b632741a7e677d",18,"WRBTC","Wrapped BTC"),m[exports.ChainId.BOBA]=new b(exports.ChainId.BOBA,"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000",18,"WETH","Wrapped ETH"),m[exports.ChainId.BOBA_BNB]=new b(exports.ChainId.BOBA_BNB,"0xC58aaD327D6D58D979882601ba8DDa0685B505eA",18,"WBOBA","Wrapped BOBA"),m[exports.ChainId.AURORA]=new b(exports.ChainId.AURORA,"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",18,"WETH","Wrapped ETH"),m[exports.ChainId.ZKSYNC]=new b(exports.ChainId.ZKSYNC,"0x5aea5775959fbc2557cc8789bc1bf90a239d9a91",18,"WETH","Wrapped ETH"),m[exports.ChainId.SCROLL]=new b(exports.ChainId.SCROLL,"0x5300000000000000000000000000000000000004",18,"WETH","Wrapped ETH"),m[exports.ChainId.BLAST]=new b(exports.ChainId.BLAST,"0x4300000000000000000000000000000000000004",18,"WETH","Wrapped ETH"),m[exports.ChainId.OPBNB]=new b(exports.ChainId.OPBNB,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped ETH"),m[exports.ChainId.MANTLE]=new b(exports.ChainId.MANTLE,"0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8",18,"WMNT","Wrapped MNT"),m[exports.ChainId.POLYGON_ZKEVM]=new b(exports.ChainId.POLYGON_ZKEVM,"0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",18,"WETH","Wrapped ETH"),m[exports.ChainId.BERA]=new b(exports.ChainId.BERA,"0x6969696969696969696969696969696969696969",18,"WBERA","Wrapped BERA"),m[exports.ChainId.SONIC]=new b(exports.ChainId.SONIC,"0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38",18,"WS","Wrapped S"),m[exports.ChainId.EXPCHAIN_TESTNET]=new b(exports.ChainId.EXPCHAIN_TESTNET,"0x46F2038afa5CDD1a8CD444DB923279ADe1208a48",18,"WTZKJ","Wrapped TZKJ"),m[exports.ChainId.CYTONIC_TESTNET]=new b(exports.ChainId.CYTONIC_TESTNET,"0x30fDf316f8DFA2F0d10c7e2F900F43979ca4C60a",18,"WCCC","Wrapped CCC"),m),v=function(e){function n(n){return e.call(this,n,18,"ETH","Ether")||this}return x(n,e),n.onChain=function(e){var r;return null!==(r=this._etherCache[e])&&void 0!==r?r:this._etherCache[e]=new n(e)},n.prototype.equals=function(e){return e.isNative&&e.chainId===this.chainId},A(n,[{key:"wrapped",get:function(){var e=P[this.chainId];return e||E(!1),e}}]),n}(_);v._etherCache={};var K=((W={})[exports.ChainId.MUMBAI]=new b(exports.ChainId.MUMBAI,s,18,"MATIC","Matic"),W[exports.ChainId.MATIC]=new b(exports.ChainId.MATIC,s,18,"MATIC","Matic"),W[exports.ChainId.FUJI]=new b(exports.ChainId.AVALANCHE,s,18,"AVAX","Avalanche"),W[exports.ChainId.AVALANCHE]=new b(exports.ChainId.AVALANCHE,s,18,"AVAX","Avalanche"),W[exports.ChainId.FANTOM_TESTNET]=new b(exports.ChainId.FANTOM_TESTNET,s,18,"FTM","Fantom"),W[exports.ChainId.FANTOM]=new b(exports.ChainId.FANTOM,s,18,"FTM","Fantom"),W[exports.ChainId.HUOBIECO_TESTNET]=new b(exports.ChainId.HUOBIECO_TESTNET,s,18,"HT","Huobi ECO"),W[exports.ChainId.HUOBIECO]=new b(exports.ChainId.HUOBIECO,s,18,"HT","Huobi ECO"),W[exports.ChainId.REEF]=new b(exports.ChainId.REEF,s,18,"REEF","Reef"),W[exports.ChainId.XDAI]=new b(exports.ChainId.XDAI,s,18,"XDAI","xDai"),W[exports.ChainId.FUSE]=new b(exports.ChainId.FUSE,s,18,"FUSE","Fuse"),W[exports.ChainId.OPTIMISM]=new b(exports.ChainId.OPTIMISM,s,18,"ETH","Optimism"),W[exports.ChainId.OPTIMISM_TESTNET]=new b(exports.ChainId.OPTIMISM_TESTNET,s,18,"ETH","Optimism"),W[exports.ChainId.KUCOIN]=new b(exports.ChainId.KUCOIN,s,18,"KCS","Kucoin"),W[exports.ChainId.KUCOIN_TESTNET]=new b(exports.ChainId.KUCOIN_TESTNET,s,18,"tKCS","Kucoin"),W[exports.ChainId.ETHERLITE]=new b(exports.ChainId.ETHERLITE,s,18,"ETL","Etherlite"),W[exports.ChainId.ETHEREUM_CLASSIC]=new b(exports.ChainId.ETHEREUM_CLASSIC,s,18,"ETC","Ethereum Classic"),W[exports.ChainId.ETHEREUM_CLASSIC_TESTNET]=new b(exports.ChainId.ETHEREUM_CLASSIC_TESTNET,s,18,"CETC","Ethereum Classic"),W[exports.ChainId.MOONBEAM]=new b(exports.ChainId.MOONBEAM,s,18,"GLMR","Moonbeam"),W[exports.ChainId.MOONBEAM_TESTNET]=new b(exports.ChainId.MOONBEAM_TESTNET,s,18,"DEV","Moonbeam"),W[exports.ChainId.CLOVER]=new b(exports.ChainId.CLOVER,s,18,"CLV","Clover"),W[exports.ChainId.CLOVER_TESTNET]=new b(exports.ChainId.CLOVER_TESTNET,s,18,"CLV","Clover"),W[exports.ChainId.CELO]=new b(exports.ChainId.CELO,s,18,"CELO","Celo"),W[exports.ChainId.ALFAJORES]=new b(exports.ChainId.ALFAJORES,s,18,"CELO","Celo"),W[exports.ChainId.ARBITRUM_TESTNET]=new b(exports.ChainId.ARBITRUM_TESTNET,s,18,"ETH","Arbitrum"),W[exports.ChainId.ARBITRUM]=new b(exports.ChainId.ARBITRUM,s,18,"ETH","Arbitrum"),W[exports.ChainId.FLARE]=new b(exports.ChainId.FLARE,s,18,"FLR","Flare"),W[exports.ChainId.FLARE_TESTNET]=new b(exports.ChainId.FLARE_TESTNET,s,18,"CFLR","Flare"),W[exports.ChainId.FUSION]=new b(exports.ChainId.FUSION,s,18,"FSN","Fusion"),W[exports.ChainId.HARMONY]=new b(exports.ChainId.HARMONY,s,18,"ONE","Harmony"),W[exports.ChainId.OKEX]=new b(exports.ChainId.OKEX,s,18,"OKT","OKEx"),W[exports.ChainId.IOTEX]=new b(exports.ChainId.IOTEX,s,18,"IOTX","IoTeX"),W[exports.ChainId.HOO]=new b(exports.ChainId.HOO,s,18,"HOO","HOO"),W[exports.ChainId.ELAETH]=new b(exports.ChainId.ELAETH,s,18,"ELA","ELA"),W[exports.ChainId.MOONRIVER]=new b(exports.ChainId.MOONRIVER,s,18,"MOVR","MOVR"),W[exports.ChainId.TELOS]=new b(exports.ChainId.TELOS,s,18,"TLOS","TLOS"),W[exports.ChainId.CRONOS]=new b(exports.ChainId.CRONOS,s,18,"CRO","CRO"),W[exports.ChainId.KAVA]=new b(exports.ChainId.KAVA,s,18,"KAVA","Kava"),W[exports.ChainId.BTTC]=new b(exports.ChainId.BTTC,s,18,"BTT","BTT"),W[exports.ChainId.BTTC_TESTNET]=new b(exports.ChainId.BTTC_TESTNET,s,18,"BTT","BTT"),W[exports.ChainId.BINANCE_TESTNET]=new b(exports.ChainId.BINANCE_TESTNET,s,18,"BSC","Binance"),W[exports.ChainId.BINANCE]=new b(exports.ChainId.BINANCE,s,18,"BNB","Binance"),W[exports.ChainId.ROPSTEN]=new b(exports.ChainId.ROPSTEN,s,18,"ETH","Ethereum"),W[exports.ChainId.ETHEREUM]=new b(exports.ChainId.ETHEREUM,s,18,"ETH","Ethereum"),W[exports.ChainId.NEON_TESTNET]=new b(exports.ChainId.NEON_TESTNET,s,18,"NEON","Neon"),W[exports.ChainId.NEON_MAINNET]=new b(exports.ChainId.NEON_MAINNET,s,18,"NEON","Neon"),W[exports.ChainId.Q]=new b(exports.ChainId.Q,s,18,"QGOV","QGOV"),W[exports.ChainId.BITGERT]=new b(exports.ChainId.BITGERT,s,18,"BRISE","Brise"),W[exports.ChainId.WANCHAIN]=new b(exports.ChainId.WANCHAIN,s,18,"WAN","WAN"),W[exports.ChainId.METIS]=new b(exports.ChainId.METIS,s,18,"METIS","METIS"),W[exports.ChainId.ASTAR]=new b(exports.ChainId.ASTAR,s,18,"ASTR","Astar"),W[exports.ChainId.ARTHERA_TESTNET]=new b(exports.ChainId.ARTHERA_TESTNET,s,18,"AA","Arthera"),W[exports.ChainId.ARTHERA]=new b(exports.ChainId.ARTHERA,s,18,"AA","Arthera"),W[exports.ChainId.PULSECHAIN]=new b(exports.ChainId.PULSECHAIN,s,18,"PLS","Pulse"),W[exports.ChainId.BASE]=new b(exports.ChainId.BASE,s,18,"ETH","Ethereum"),W[exports.ChainId.VELAS]=new b(exports.ChainId.VELAS,s,18,"VLX","Velas"),W[exports.ChainId.LINEA]=new b(exports.ChainId.LINEA,s,18,"ETH","Ethereum"),W[exports.ChainId.ROOTSTOCK]=new b(exports.ChainId.ROOTSTOCK,s,18,"RBTC","Rootstock"),W[exports.ChainId.BOBA]=new b(exports.ChainId.BOBA,s,18,"ETH","Boba ETH"),W[exports.ChainId.BOBA_BNB]=new b(exports.ChainId.BOBA_BNB,s,18,"BOBA","Boba BNB"),W[exports.ChainId.AURORA]=new b(exports.ChainId.AURORA,s,18,"ETH","Aurora"),W[exports.ChainId.ZKSYNC]=new b(exports.ChainId.ZKSYNC,s,18,"ETH","ZkSync"),W[exports.ChainId.SCROLL]=new b(exports.ChainId.SCROLL,s,18,"ETH","Scroll"),W[exports.ChainId.BLAST]=new b(exports.ChainId.BLAST,s,18,"ETH","Blast"),W[exports.ChainId.OPBNB]=new b(exports.ChainId.OPBNB,s,18,"BNB","opBNB"),W[exports.ChainId.MANTLE]=new b(exports.ChainId.MANTLE,s,18,"MNT","Mantle"),W[exports.ChainId.POLYGON_ZKEVM]=new b(exports.ChainId.POLYGON_ZKEVM,s,18,"ETH","Polygon zkEVM"),W),g=((U={})[exports.ChainId.MUMBAI]="MATIC",U[exports.ChainId.MATIC]="POL",U[exports.ChainId.FUJI]="AVAX",U[exports.ChainId.AVALANCHE]="AVAX",U[exports.ChainId.FANTOM_TESTNET]="FTM",U[exports.ChainId.FANTOM]="FTM",U[exports.ChainId.HUOBIECO_TESTNET]="HT",U[exports.ChainId.HUOBIECO]="HT",U[exports.ChainId.REEF]="REEF",U[exports.ChainId.XDAI]="xDAI",U[exports.ChainId.FUSE]="FUSE",U[exports.ChainId.OPTIMISM]="ETH",U[exports.ChainId.OPTIMISM_TESTNET]="KOR",U[exports.ChainId.KUCOIN]="KCS",U[exports.ChainId.KUCOIN_TESTNET]="tKCS",U[exports.ChainId.ETHERLITE]="ETL",U[exports.ChainId.ETHEREUM_CLASSIC]="ETC",U[exports.ChainId.ETHEREUM_CLASSIC_TESTNET]="CETC",U[exports.ChainId.MOONBEAM_TESTNET]="DEV",U[exports.ChainId.CLOVER_TESTNET]="CLV",U[exports.ChainId.CELO]="CELO",U[exports.ChainId.ALFAJORES]="CELO",U[exports.ChainId.ARBITRUM_TESTNET]="ETH",U[exports.ChainId.ARBITRUM]="ETH",U[exports.ChainId.FLARE]="FLR",U[exports.ChainId.FLARE_TESTNET]="CFLR",U[exports.ChainId.FUSION]="FSN",U[exports.ChainId.HARMONY]="ONE",U[exports.ChainId.OKEX]="OKT",U[exports.ChainId.IOTEX]="IOTX",U[exports.ChainId.HOO]="HOO",U[exports.ChainId.ELAETH]="ELA",U[exports.ChainId.MOONRIVER]="MOVR",U[exports.ChainId.TELOS]="TLOS",U[exports.ChainId.CRONOS]="CRO",U[exports.ChainId.KAVA]="KAVA",U[exports.ChainId.BTTC]="BTT",U[exports.ChainId.BTTC_TESTNET]="BTT",U[exports.ChainId.BINANCE_TESTNET]="BNB",U[exports.ChainId.BINANCE]="BNB",U[exports.ChainId.ROPSTEN]="ETH",U[exports.ChainId.ETHEREUM]="ETH",U[exports.ChainId.NEON_TESTNET]="tNEON",U[exports.ChainId.NEON_MAINNET]="NEON",U[exports.ChainId.Q]="QGOV",U[exports.ChainId.BITGERT]="BRISE",U[exports.ChainId.WANCHAIN]="WAN",U[exports.ChainId.METIS]="METIS",U[exports.ChainId.ASTAR]="ASTR",U[exports.ChainId.ARTHERA_TESTNET]="AA",U[exports.ChainId.ARTHERA]="AA",U[exports.ChainId.PULSECHAIN]="PLS",U[exports.ChainId.BASE]="ETH",U[exports.ChainId.VELAS]="VLX",U[exports.ChainId.LINEA]="ETH",U[exports.ChainId.ROOTSTOCK]="RBTC",U[exports.ChainId.BOBA]="ETH",U[exports.ChainId.BOBA_BNB]="BOBA",U[exports.ChainId.AURORA]="ETH",U[exports.ChainId.CLOVER]="CLV",U[exports.ChainId.ZKSYNC]="ETH",U[exports.ChainId.SCROLL]="ETH",U[exports.ChainId.BLAST]="ETH",U[exports.ChainId.OPBNB]="ETH",U[exports.ChainId.MOONBEAM]="GLMR",U[exports.ChainId.MANTLE]="MNT",U[exports.ChainId.POLYGON_ZKEVM]="ETH",U[exports.ChainId.BERA]="BERA",U[exports.ChainId.SONIC]="S",U[exports.ChainId.EXPCHAIN_TESTNET]="TZKJ",U[exports.ChainId.CYTONIC_TESTNET]="CCC",U),X=((D={})[exports.ChainId.MUMBAI]="MATIC",D[exports.ChainId.MATIC]="MATIC",D[exports.ChainId.FUJI]="AVAX",D[exports.ChainId.AVALANCHE]="AVAX",D[exports.ChainId.FANTOM_TESTNET]="FTM",D[exports.ChainId.FANTOM]="FTM",D[exports.ChainId.HUOBIECO_TESTNET]="HT",D[exports.ChainId.HUOBIECO]="HT",D[exports.ChainId.REEF]="ETH",D[exports.ChainId.XDAI]="xDAI",D[exports.ChainId.FUSE]="ETH",D[exports.ChainId.OPTIMISM]="ETH",D[exports.ChainId.OPTIMISM_TESTNET]="ETH",D[exports.ChainId.KUCOIN]="ETH",D[exports.ChainId.KUCOIN_TESTNET]="ETH",D[exports.ChainId.ETHERLITE]="ETH",D[exports.ChainId.ETHEREUM_CLASSIC]="ETH",D[exports.ChainId.ETHEREUM_CLASSIC_TESTNET]="ETH",D[exports.ChainId.MOONBEAM_TESTNET]="ETH",D[exports.ChainId.CLOVER_TESTNET]="ETH",D[exports.ChainId.CELO]="ETH",D[exports.ChainId.ALFAJORES]="ETH",D[exports.ChainId.ARBITRUM_TESTNET]="ETH",D[exports.ChainId.ARBITRUM]="ETH",D[exports.ChainId.FLARE]="ETH",D[exports.ChainId.FLARE_TESTNET]="ETH",D[exports.ChainId.FUSION]="ETH",D[exports.ChainId.HARMONY]="ETH",D[exports.ChainId.OKEX]="ETH",D[exports.ChainId.IOTEX]="ETH",D[exports.ChainId.HOO]="ETH",D[exports.ChainId.ELAETH]="ETH",D[exports.ChainId.MOONRIVER]="ETH",D[exports.ChainId.TELOS]="ETH",D[exports.ChainId.CRONOS]="ETH",D[exports.ChainId.KAVA]="ETH",D[exports.ChainId.BTTC]="ETH",D[exports.ChainId.BTTC_TESTNET]="ETH",D[exports.ChainId.BINANCE_TESTNET]="BNB",D[exports.ChainId.BINANCE]="BNB",D[exports.ChainId.ROPSTEN]="ETH",D[exports.ChainId.ETHEREUM]="ETH",D[exports.ChainId.NEON_TESTNET]="ETH",D[exports.ChainId.NEON_MAINNET]="ETH",D[exports.ChainId.Q]="ETH",D[exports.ChainId.BITGERT]="ETH",D[exports.ChainId.WANCHAIN]="ETH",D[exports.ChainId.METIS]="ETH",D[exports.ChainId.ASTAR]="ETH",D[exports.ChainId.ARTHERA_TESTNET]="ETH",D[exports.ChainId.ARTHERA]="ETH",D[exports.ChainId.PULSECHAIN]="ETH",D[exports.ChainId.BASE]="ETH",D[exports.ChainId.VELAS]="ETH",D[exports.ChainId.LINEA]="ETH",D[exports.ChainId.ROOTSTOCK]="ETH",D[exports.ChainId.BOBA]="ETH",D[exports.ChainId.BOBA_BNB]="ETH",D[exports.ChainId.AURORA]="ETH",D[exports.ChainId.CLOVER]="ETH",D[exports.ChainId.ZKSYNC]="ETH",D[exports.ChainId.SCROLL]="ETH",D[exports.ChainId.BLAST]="ETH",D[exports.ChainId.OPBNB]="ETH",D[exports.ChainId.MOONBEAM]="ETH",D[exports.ChainId.MANTLE]="ETH",D[exports.ChainId.POLYGON_ZKEVM]="ETH",D[exports.ChainId.BERA]="ETH",D[exports.ChainId.SONIC]="ETH",D[exports.ChainId.EXPCHAIN_TESTNET]="ETH",D[exports.ChainId.CYTONIC_TESTNET]="ETH",D),q=a.BigInt(Number.MAX_SAFE_INTEGER),Y=a.BigInt(0),G=a.BigInt(1),Z=a.BigInt(2);exports.JSBI=a,exports.CETH=K,exports.CETH_NAME=g,exports.CETH_NAME_ROUTER=X,exports.CurrencyAmount=c,exports.Ether=v,exports.Fraction=B,exports.MaxUint256=I,exports.NativeCurrency=_,exports.Percent=M,exports.Price=L,exports.Token=b,exports.WETH=V,exports.WETH9=P,exports.ZERO_ADDRESS=s,exports.computePriceImpact=function(e,n,r){var t=e.quote(n),a=t.subtract(r).divide(t);return new M(a.numerator,a.denominator)},exports.sortedInsert=function(e,n,r,t){if(r>0||E(!1),e.length<=r||E(!1),0===e.length)return e.push(n),null;var a=e.length===r;if(a&&t(e[e.length-1],n)<=0)return n;for(var i=0,o=e.length;i<o;){var T=i+o>>>1;t(e[T],n)<=0?i=T+1:o=T}return e.splice(i,0,n),a?e.pop():null},exports.sqrt=function(e){if(a.greaterThanOrEqual(e,Y)||E(!1),a.lessThan(e,q))return a.BigInt(Math.floor(Math.sqrt(a.toNumber(e))));var n,r;for(n=e,r=a.add(a.divide(e,Z),G);a.lessThan(r,n);)n=r,r=a.divide(a.add(a.divide(e,r),r),Z);return n},exports.validateAndParseAddress=l; //# sourceMappingURL=sdk.cjs.production.min.js.map