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

@uniswap/sdk-core

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uniswap/sdk-core - npm Package Compare versions

Comparing version 3.2.2 to 3.2.3

1

dist/constants.d.ts

@@ -5,2 +5,3 @@ import JSBI from 'jsbi';

GOERLI = 5,
SEPOLIA = 11155111,
ARBITRUM_ONE = 42161,

@@ -7,0 +8,0 @@ ARBITRUM_GOERLI = 421613,

@@ -17,2 +17,3 @@ 'use strict';

SupportedChainId[SupportedChainId["GOERLI"] = 5] = "GOERLI";
SupportedChainId[SupportedChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
SupportedChainId[SupportedChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE";

@@ -19,0 +20,0 @@ SupportedChainId[SupportedChainId["ARBITRUM_GOERLI"] = 421613] = "ARBITRUM_GOERLI";

2

dist/sdk-core.cjs.production.min.js

@@ -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 r,n,e,i=t(require("jsbi")),o=t(require("tiny-invariant")),a=t(require("decimal.js-light")),u=t(require("big.js")),s=t(require("toformat")),c=require("@ethersproject/address");(r=exports.SupportedChainId||(exports.SupportedChainId={}))[r.MAINNET=1]="MAINNET",r[r.GOERLI=5]="GOERLI",r[r.ARBITRUM_ONE=42161]="ARBITRUM_ONE",r[r.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",r[r.OPTIMISM=10]="OPTIMISM",r[r.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",r[r.POLYGON=137]="POLYGON",r[r.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",r[r.CELO=42220]="CELO",r[r.CELO_ALFAJORES=44787]="CELO_ALFAJORES",r[r.BNB=56]="BNB",(n=exports.TradeType||(exports.TradeType={}))[n.EXACT_INPUT=0]="EXACT_INPUT",n[n.EXACT_OUTPUT=1]="EXACT_OUTPUT",(e=exports.Rounding||(exports.Rounding={}))[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP";var d,f,l=i.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function p(t,r){for(var n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function m(t,r,n){return r&&p(t.prototype,r),n&&p(t,n),t}function h(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r}var y=s(a),v=s(u),g=((d={})[exports.Rounding.ROUND_DOWN]=y.ROUND_DOWN,d[exports.Rounding.ROUND_HALF_UP]=y.ROUND_HALF_UP,d[exports.Rounding.ROUND_UP]=y.ROUND_UP,d),O=((f={})[exports.Rounding.ROUND_DOWN]=0,f[exports.Rounding.ROUND_HALF_UP]=1,f[exports.Rounding.ROUND_UP]=3,f),E=function(){function t(t,r){void 0===r&&(r=i.BigInt(1)),this.numerator=i.BigInt(t),this.denominator=i.BigInt(r)}t.tryParseFraction=function(r){if(r instanceof i||"number"==typeof r||"string"==typeof r)return new t(r);if("numerator"in r&&"denominator"in r)return r;throw new Error("Could not parse fraction")};var r=t.prototype;return r.invert=function(){return new t(this.denominator,this.numerator)},r.add=function(r){var n=t.tryParseFraction(r);return i.equal(this.denominator,n.denominator)?new t(i.add(this.numerator,n.numerator),this.denominator):new t(i.add(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator)),i.multiply(this.denominator,n.denominator))},r.subtract=function(r){var n=t.tryParseFraction(r);return i.equal(this.denominator,n.denominator)?new t(i.subtract(this.numerator,n.numerator),this.denominator):new t(i.subtract(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator)),i.multiply(this.denominator,n.denominator))},r.lessThan=function(r){var n=t.tryParseFraction(r);return i.lessThan(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator))},r.equalTo=function(r){var n=t.tryParseFraction(r);return i.equal(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator))},r.greaterThan=function(r){var n=t.tryParseFraction(r);return i.greaterThan(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator))},r.multiply=function(r){var n=t.tryParseFraction(r);return new t(i.multiply(this.numerator,n.numerator),i.multiply(this.denominator,n.denominator))},r.divide=function(r){var n=t.tryParseFraction(r);return new t(i.multiply(this.numerator,n.denominator),i.multiply(this.denominator,n.numerator))},r.toSignificant=function(t,r,n){void 0===r&&(r={groupSeparator:""}),void 0===n&&(n=exports.Rounding.ROUND_HALF_UP),Number.isInteger(t)||o(!1),t>0||o(!1),y.set({precision:t+1,rounding:g[n]});var e=new y(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return e.toFormat(e.decimalPlaces(),r)},r.toFixed=function(t,r,n){return void 0===r&&(r={groupSeparator:""}),void 0===n&&(n=exports.Rounding.ROUND_HALF_UP),Number.isInteger(t)||o(!1),t>=0||o(!1),v.DP=t,v.RM=O[n],new v(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,r)},m(t,[{key:"quotient",get:function(){return i.divide(this.numerator,this.denominator)}},{key:"remainder",get:function(){return new t(i.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function(){return new t(this.numerator,this.denominator)}}]),t}(),I=s(u),A=function(t){function r(r,n,e){var a;return a=t.call(this,n,e)||this,i.lessThanOrEqual(a.quotient,l)||o(!1),a.currency=r,a.decimalScale=i.exponentiate(i.BigInt(10),i.BigInt(r.decimals)),a}h(r,t),r.fromRawAmount=function(t,n){return new r(t,n)},r.fromFractionalAmount=function(t,n,e){return new r(t,n,e)};var n=r.prototype;return n.add=function(n){this.currency.equals(n.currency)||o(!1);var e=t.prototype.add.call(this,n);return r.fromFractionalAmount(this.currency,e.numerator,e.denominator)},n.subtract=function(n){this.currency.equals(n.currency)||o(!1);var e=t.prototype.subtract.call(this,n);return r.fromFractionalAmount(this.currency,e.numerator,e.denominator)},n.multiply=function(n){var e=t.prototype.multiply.call(this,n);return r.fromFractionalAmount(this.currency,e.numerator,e.denominator)},n.divide=function(n){var e=t.prototype.divide.call(this,n);return r.fromFractionalAmount(this.currency,e.numerator,e.denominator)},n.toSignificant=function(r,n,e){return void 0===r&&(r=6),void 0===e&&(e=exports.Rounding.ROUND_DOWN),t.prototype.divide.call(this,this.decimalScale).toSignificant(r,n,e)},n.toFixed=function(r,n,e){return void 0===r&&(r=this.currency.decimals),void 0===e&&(e=exports.Rounding.ROUND_DOWN),r<=this.currency.decimals||o(!1),t.prototype.divide.call(this,this.decimalScale).toFixed(r,n,e)},n.toExact=function(t){return void 0===t&&(t={groupSeparator:""}),I.DP=this.currency.decimals,new I(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(t)},m(r,[{key:"wrapped",get:function(){return this.currency.isToken?this:r.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),r}(E),x=new E(i.BigInt(100));function F(t){return new N(t.numerator,t.denominator)}var N=function(t){function r(){var r;return(r=t.apply(this,arguments)||this).isPercent=!0,r}h(r,t);var n=r.prototype;return n.add=function(r){return F(t.prototype.add.call(this,r))},n.subtract=function(r){return F(t.prototype.subtract.call(this,r))},n.multiply=function(r){return F(t.prototype.multiply.call(this,r))},n.divide=function(r){return F(t.prototype.divide.call(this,r))},n.toSignificant=function(r,n,e){return void 0===r&&(r=5),t.prototype.multiply.call(this,x).toSignificant(r,n,e)},n.toFixed=function(r,n,e){return void 0===r&&(r=2),t.prototype.multiply.call(this,x).toFixed(r,n,e)},r}(E),_=function(t){function r(){for(var r,n,e,o,a,u=arguments.length,s=new Array(u),c=0;c<u;c++)s[c]=arguments[c];if(4===s.length)n=s[0],e=s[1],o=s[2],a=s[3];else{var d=s[0].quoteAmount.divide(s[0].baseAmount),f=[s[0].baseAmount.currency,s[0].quoteAmount.currency,d.denominator,d.numerator];n=f[0],e=f[1],o=f[2],a=f[3]}return(r=t.call(this,a,o)||this).baseCurrency=n,r.quoteCurrency=e,r.scalar=new E(i.exponentiate(i.BigInt(10),i.BigInt(n.decimals)),i.exponentiate(i.BigInt(10),i.BigInt(e.decimals))),r}h(r,t);var n=r.prototype;return n.invert=function(){return new r(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},n.multiply=function(n){this.quoteCurrency.equals(n.baseCurrency)||o(!1);var e=t.prototype.multiply.call(this,n);return new r(this.baseCurrency,n.quoteCurrency,e.denominator,e.numerator)},n.quote=function(r){r.currency.equals(this.baseCurrency)||o(!1);var n=t.prototype.multiply.call(this,r);return A.fromFractionalAmount(this.quoteCurrency,n.numerator,n.denominator)},n.toSignificant=function(t,r,n){return void 0===t&&(t=6),this.adjustedForDecimals.toSignificant(t,r,n)},n.toFixed=function(t,r,n){return void 0===t&&(t=4),this.adjustedForDecimals.toFixed(t,r,n)},m(r,[{key:"adjustedForDecimals",get:function(){return t.prototype.multiply.call(this,this.scalar)}}]),r}(E),w=function(t,r,n,e){Number.isSafeInteger(t)||o(!1),r>=0&&r<255&&Number.isInteger(r)||o(!1),this.chainId=t,this.decimals=r,this.symbol=n,this.name=e},R=function(t){function r(){var r;return(r=t.apply(this,arguments)||this).isNative=!0,r.isToken=!1,r}return h(r,t),r}(w);function T(t){try{return c.getAddress(t)}catch(r){throw new Error(t+" is not a valid address.")}}var U,P=/^0x[0-9a-fA-F]{40}$/,b=function(t){function r(r,n,e,i,o,a){var u;return(u=t.call(this,r,e,i,o)||this).isNative=!1,u.isToken=!0,u.address=a?function(t){if(P.test(t))return t;throw new Error(t+" is not a valid address.")}(n):T(n),u}h(r,t);var n=r.prototype;return n.equals=function(t){return t.isToken&&this.chainId===t.chainId&&this.address.toLowerCase()===t.address.toLowerCase()},n.sortsBefore=function(t){return this.chainId!==t.chainId&&o(!1),this.address.toLowerCase()===t.address.toLowerCase()&&o(!1),this.address.toLowerCase()<t.address.toLowerCase()},m(r,[{key:"wrapped",get:function(){return this}}]),r}(w),C=((U={})[1]=new b(1,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped Ether"),U[3]=new b(3,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),U[4]=new b(4,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),U[5]=new b(5,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH","Wrapped Ether"),U[42]=new b(42,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH","Wrapped Ether"),U[10]=new b(10,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),U[69]=new b(69,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),U[42161]=new b(42161,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped Ether"),U[421611]=new b(421611,"0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681",18,"WETH","Wrapped Ether"),U),D=function(t){function r(r){return t.call(this,r,18,"ETH","Ether")||this}return h(r,t),r.onChain=function(t){var n;return null!=(n=this._etherCache[t])?n:this._etherCache[t]=new r(t)},r.prototype.equals=function(t){return t.isNative&&t.chainId===this.chainId},m(r,[{key:"wrapped",get:function(){var t=C[this.chainId];return t||o(!1),t}}]),r}(R);D._etherCache={};var B=i.BigInt(Number.MAX_SAFE_INTEGER),q=i.BigInt(0),S=i.BigInt(1),L=i.BigInt(2);exports.CurrencyAmount=A,exports.Ether=D,exports.Fraction=E,exports.MaxUint256=l,exports.NativeCurrency=R,exports.Percent=N,exports.Price=_,exports.Token=b,exports.WETH9=C,exports.computePriceImpact=function(t,r,n){var e=t.quote(r),i=e.subtract(n).divide(e);return new N(i.numerator,i.denominator)},exports.sortedInsert=function(t,r,n,e){if(n>0||o(!1),t.length<=n||o(!1),0===t.length)return t.push(r),null;var i=t.length===n;if(i&&e(t[t.length-1],r)<=0)return r;for(var a=0,u=t.length;a<u;){var s=a+u>>>1;e(t[s],r)<=0?a=s+1:u=s}return t.splice(a,0,r),i?t.pop():null},exports.sqrt=function(t){if(i.greaterThanOrEqual(t,q)||o(!1),i.lessThan(t,B))return i.BigInt(Math.floor(Math.sqrt(i.toNumber(t))));var r,n;for(r=t,n=i.add(i.divide(t,L),S);i.lessThan(n,r);)r=n,n=i.divide(i.add(i.divide(t,n),n),L);return r},exports.validateAndParseAddress=T;
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var r,n,e,i=t(require("jsbi")),o=t(require("tiny-invariant")),a=t(require("decimal.js-light")),u=t(require("big.js")),s=t(require("toformat")),c=require("@ethersproject/address");(r=exports.SupportedChainId||(exports.SupportedChainId={}))[r.MAINNET=1]="MAINNET",r[r.GOERLI=5]="GOERLI",r[r.SEPOLIA=11155111]="SEPOLIA",r[r.ARBITRUM_ONE=42161]="ARBITRUM_ONE",r[r.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",r[r.OPTIMISM=10]="OPTIMISM",r[r.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",r[r.POLYGON=137]="POLYGON",r[r.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",r[r.CELO=42220]="CELO",r[r.CELO_ALFAJORES=44787]="CELO_ALFAJORES",r[r.BNB=56]="BNB",(n=exports.TradeType||(exports.TradeType={}))[n.EXACT_INPUT=0]="EXACT_INPUT",n[n.EXACT_OUTPUT=1]="EXACT_OUTPUT",(e=exports.Rounding||(exports.Rounding={}))[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP";var d,f,l=i.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function p(t,r){for(var n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function m(t,r,n){return r&&p(t.prototype,r),n&&p(t,n),t}function h(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r}var y=s(a),v=s(u),g=((d={})[exports.Rounding.ROUND_DOWN]=y.ROUND_DOWN,d[exports.Rounding.ROUND_HALF_UP]=y.ROUND_HALF_UP,d[exports.Rounding.ROUND_UP]=y.ROUND_UP,d),O=((f={})[exports.Rounding.ROUND_DOWN]=0,f[exports.Rounding.ROUND_HALF_UP]=1,f[exports.Rounding.ROUND_UP]=3,f),E=function(){function t(t,r){void 0===r&&(r=i.BigInt(1)),this.numerator=i.BigInt(t),this.denominator=i.BigInt(r)}t.tryParseFraction=function(r){if(r instanceof i||"number"==typeof r||"string"==typeof r)return new t(r);if("numerator"in r&&"denominator"in r)return r;throw new Error("Could not parse fraction")};var r=t.prototype;return r.invert=function(){return new t(this.denominator,this.numerator)},r.add=function(r){var n=t.tryParseFraction(r);return i.equal(this.denominator,n.denominator)?new t(i.add(this.numerator,n.numerator),this.denominator):new t(i.add(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator)),i.multiply(this.denominator,n.denominator))},r.subtract=function(r){var n=t.tryParseFraction(r);return i.equal(this.denominator,n.denominator)?new t(i.subtract(this.numerator,n.numerator),this.denominator):new t(i.subtract(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator)),i.multiply(this.denominator,n.denominator))},r.lessThan=function(r){var n=t.tryParseFraction(r);return i.lessThan(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator))},r.equalTo=function(r){var n=t.tryParseFraction(r);return i.equal(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator))},r.greaterThan=function(r){var n=t.tryParseFraction(r);return i.greaterThan(i.multiply(this.numerator,n.denominator),i.multiply(n.numerator,this.denominator))},r.multiply=function(r){var n=t.tryParseFraction(r);return new t(i.multiply(this.numerator,n.numerator),i.multiply(this.denominator,n.denominator))},r.divide=function(r){var n=t.tryParseFraction(r);return new t(i.multiply(this.numerator,n.denominator),i.multiply(this.denominator,n.numerator))},r.toSignificant=function(t,r,n){void 0===r&&(r={groupSeparator:""}),void 0===n&&(n=exports.Rounding.ROUND_HALF_UP),Number.isInteger(t)||o(!1),t>0||o(!1),y.set({precision:t+1,rounding:g[n]});var e=new y(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return e.toFormat(e.decimalPlaces(),r)},r.toFixed=function(t,r,n){return void 0===r&&(r={groupSeparator:""}),void 0===n&&(n=exports.Rounding.ROUND_HALF_UP),Number.isInteger(t)||o(!1),t>=0||o(!1),v.DP=t,v.RM=O[n],new v(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,r)},m(t,[{key:"quotient",get:function(){return i.divide(this.numerator,this.denominator)}},{key:"remainder",get:function(){return new t(i.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function(){return new t(this.numerator,this.denominator)}}]),t}(),I=s(u),A=function(t){function r(r,n,e){var a;return a=t.call(this,n,e)||this,i.lessThanOrEqual(a.quotient,l)||o(!1),a.currency=r,a.decimalScale=i.exponentiate(i.BigInt(10),i.BigInt(r.decimals)),a}h(r,t),r.fromRawAmount=function(t,n){return new r(t,n)},r.fromFractionalAmount=function(t,n,e){return new r(t,n,e)};var n=r.prototype;return n.add=function(n){this.currency.equals(n.currency)||o(!1);var e=t.prototype.add.call(this,n);return r.fromFractionalAmount(this.currency,e.numerator,e.denominator)},n.subtract=function(n){this.currency.equals(n.currency)||o(!1);var e=t.prototype.subtract.call(this,n);return r.fromFractionalAmount(this.currency,e.numerator,e.denominator)},n.multiply=function(n){var e=t.prototype.multiply.call(this,n);return r.fromFractionalAmount(this.currency,e.numerator,e.denominator)},n.divide=function(n){var e=t.prototype.divide.call(this,n);return r.fromFractionalAmount(this.currency,e.numerator,e.denominator)},n.toSignificant=function(r,n,e){return void 0===r&&(r=6),void 0===e&&(e=exports.Rounding.ROUND_DOWN),t.prototype.divide.call(this,this.decimalScale).toSignificant(r,n,e)},n.toFixed=function(r,n,e){return void 0===r&&(r=this.currency.decimals),void 0===e&&(e=exports.Rounding.ROUND_DOWN),r<=this.currency.decimals||o(!1),t.prototype.divide.call(this,this.decimalScale).toFixed(r,n,e)},n.toExact=function(t){return void 0===t&&(t={groupSeparator:""}),I.DP=this.currency.decimals,new I(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(t)},m(r,[{key:"wrapped",get:function(){return this.currency.isToken?this:r.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),r}(E),x=new E(i.BigInt(100));function F(t){return new N(t.numerator,t.denominator)}var N=function(t){function r(){var r;return(r=t.apply(this,arguments)||this).isPercent=!0,r}h(r,t);var n=r.prototype;return n.add=function(r){return F(t.prototype.add.call(this,r))},n.subtract=function(r){return F(t.prototype.subtract.call(this,r))},n.multiply=function(r){return F(t.prototype.multiply.call(this,r))},n.divide=function(r){return F(t.prototype.divide.call(this,r))},n.toSignificant=function(r,n,e){return void 0===r&&(r=5),t.prototype.multiply.call(this,x).toSignificant(r,n,e)},n.toFixed=function(r,n,e){return void 0===r&&(r=2),t.prototype.multiply.call(this,x).toFixed(r,n,e)},r}(E),_=function(t){function r(){for(var r,n,e,o,a,u=arguments.length,s=new Array(u),c=0;c<u;c++)s[c]=arguments[c];if(4===s.length)n=s[0],e=s[1],o=s[2],a=s[3];else{var d=s[0].quoteAmount.divide(s[0].baseAmount),f=[s[0].baseAmount.currency,s[0].quoteAmount.currency,d.denominator,d.numerator];n=f[0],e=f[1],o=f[2],a=f[3]}return(r=t.call(this,a,o)||this).baseCurrency=n,r.quoteCurrency=e,r.scalar=new E(i.exponentiate(i.BigInt(10),i.BigInt(n.decimals)),i.exponentiate(i.BigInt(10),i.BigInt(e.decimals))),r}h(r,t);var n=r.prototype;return n.invert=function(){return new r(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},n.multiply=function(n){this.quoteCurrency.equals(n.baseCurrency)||o(!1);var e=t.prototype.multiply.call(this,n);return new r(this.baseCurrency,n.quoteCurrency,e.denominator,e.numerator)},n.quote=function(r){r.currency.equals(this.baseCurrency)||o(!1);var n=t.prototype.multiply.call(this,r);return A.fromFractionalAmount(this.quoteCurrency,n.numerator,n.denominator)},n.toSignificant=function(t,r,n){return void 0===t&&(t=6),this.adjustedForDecimals.toSignificant(t,r,n)},n.toFixed=function(t,r,n){return void 0===t&&(t=4),this.adjustedForDecimals.toFixed(t,r,n)},m(r,[{key:"adjustedForDecimals",get:function(){return t.prototype.multiply.call(this,this.scalar)}}]),r}(E),w=function(t,r,n,e){Number.isSafeInteger(t)||o(!1),r>=0&&r<255&&Number.isInteger(r)||o(!1),this.chainId=t,this.decimals=r,this.symbol=n,this.name=e},R=function(t){function r(){var r;return(r=t.apply(this,arguments)||this).isNative=!0,r.isToken=!1,r}return h(r,t),r}(w);function T(t){try{return c.getAddress(t)}catch(r){throw new Error(t+" is not a valid address.")}}var P,U=/^0x[0-9a-fA-F]{40}$/,b=function(t){function r(r,n,e,i,o,a){var u;return(u=t.call(this,r,e,i,o)||this).isNative=!1,u.isToken=!0,u.address=a?function(t){if(U.test(t))return t;throw new Error(t+" is not a valid address.")}(n):T(n),u}h(r,t);var n=r.prototype;return n.equals=function(t){return t.isToken&&this.chainId===t.chainId&&this.address.toLowerCase()===t.address.toLowerCase()},n.sortsBefore=function(t){return this.chainId!==t.chainId&&o(!1),this.address.toLowerCase()===t.address.toLowerCase()&&o(!1),this.address.toLowerCase()<t.address.toLowerCase()},m(r,[{key:"wrapped",get:function(){return this}}]),r}(w),C=((P={})[1]=new b(1,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped Ether"),P[3]=new b(3,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),P[4]=new b(4,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),P[5]=new b(5,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH","Wrapped Ether"),P[42]=new b(42,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH","Wrapped Ether"),P[10]=new b(10,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),P[69]=new b(69,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),P[42161]=new b(42161,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped Ether"),P[421611]=new b(421611,"0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681",18,"WETH","Wrapped Ether"),P),D=function(t){function r(r){return t.call(this,r,18,"ETH","Ether")||this}return h(r,t),r.onChain=function(t){var n;return null!=(n=this._etherCache[t])?n:this._etherCache[t]=new r(t)},r.prototype.equals=function(t){return t.isNative&&t.chainId===this.chainId},m(r,[{key:"wrapped",get:function(){var t=C[this.chainId];return t||o(!1),t}}]),r}(R);D._etherCache={};var B=i.BigInt(Number.MAX_SAFE_INTEGER),S=i.BigInt(0),q=i.BigInt(1),L=i.BigInt(2);exports.CurrencyAmount=A,exports.Ether=D,exports.Fraction=E,exports.MaxUint256=l,exports.NativeCurrency=R,exports.Percent=N,exports.Price=_,exports.Token=b,exports.WETH9=C,exports.computePriceImpact=function(t,r,n){var e=t.quote(r),i=e.subtract(n).divide(e);return new N(i.numerator,i.denominator)},exports.sortedInsert=function(t,r,n,e){if(n>0||o(!1),t.length<=n||o(!1),0===t.length)return t.push(r),null;var i=t.length===n;if(i&&e(t[t.length-1],r)<=0)return r;for(var a=0,u=t.length;a<u;){var s=a+u>>>1;e(t[s],r)<=0?a=s+1:u=s}return t.splice(a,0,r),i?t.pop():null},exports.sqrt=function(t){if(i.greaterThanOrEqual(t,S)||o(!1),i.lessThan(t,B))return i.BigInt(Math.floor(Math.sqrt(i.toNumber(t))));var r,n;for(r=t,n=i.add(i.divide(t,L),q);i.lessThan(n,r);)r=n,n=i.divide(i.add(i.divide(t,n),n),L);return r},exports.validateAndParseAddress=T;
//# sourceMappingURL=sdk-core.cjs.production.min.js.map

@@ -13,2 +13,3 @@ import JSBI from 'jsbi';

SupportedChainId[SupportedChainId["GOERLI"] = 5] = "GOERLI";
SupportedChainId[SupportedChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
SupportedChainId[SupportedChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE";

@@ -15,0 +16,0 @@ SupportedChainId[SupportedChainId["ARBITRUM_GOERLI"] = 421613] = "ARBITRUM_GOERLI";

{
"name": "@uniswap/sdk-core",
"license": "MIT",
"version": "3.2.2",
"version": "3.2.3",
"description": "⚒️ An SDK for building applications on top of Uniswap V3",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

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 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