@uniswap/sdk-core
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -10,3 +10,2 @@ 'use strict'; | ||
var address = require('@ethersproject/address'); | ||
var warning = _interopDefault(require('tiny-warning')); | ||
var _Decimal = _interopDefault(require('decimal.js-light')); | ||
@@ -59,9 +58,12 @@ var _Big = _interopDefault(require('big.js')); | ||
/** | ||
* Validates an address and returns the parsed (checksummed) version of that address | ||
* @param address the unchecksummed hex address | ||
*/ | ||
function validateAndParseAddress(address$1) { | ||
try { | ||
var checksummedAddress = address.getAddress(address$1); | ||
"development" !== "production" ? warning(address$1 === checksummedAddress, address$1 + " is not checksummed.") : void 0; | ||
return checksummedAddress; | ||
return address.getAddress(address$1); | ||
} catch (error) { | ||
invariant(false, address$1 + " is not a valid address.") ; | ||
throw new Error(address$1 + " is not a valid address."); | ||
} | ||
@@ -68,0 +70,0 @@ } |
@@ -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 n,r,e,i=t(require("jsbi")),o=t(require("tiny-invariant")),a=require("@ethersproject/address"),u=(t(require("tiny-warning")),t(require("decimal.js-light"))),s=t(require("big.js")),d=t(require("toformat"));(n=exports.ChainId||(exports.ChainId={}))[n.MAINNET=1]="MAINNET",n[n.ROPSTEN=3]="ROPSTEN",n[n.RINKEBY=4]="RINKEBY",n[n["GÖRLI"]=5]="GÖRLI",n[n.KOVAN=42]="KOVAN",(r=exports.TradeType||(exports.TradeType={}))[r.EXACT_INPUT=0]="EXACT_INPUT",r[r.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 c=i.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function f(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function h(t,n,r){return n&&f(t.prototype,n),r&&f(t,r),t}function p(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}function l(t){try{return a.getAddress(t)}catch(t){o(!1)}}var m,y=function(t,n,r){t<255||o(!1),this.decimals=t,this.symbol=n,this.name=r},g=y.ETHER=new y(18,"ETH","Ether"),x=function(t){function n(n,r,e,i,o){var a;return(a=t.call(this,e,i,o)||this).chainId=n,a.address=l(r),a}p(n,t);var r=n.prototype;return r.equals=function(t){return this===t||this.chainId===t.chainId&&this.address===t.address},r.sortsBefore=function(t){return this.chainId!==t.chainId&&o(!1),this.address===t.address&&o(!1),this.address.toLowerCase()<t.address.toLowerCase()},n}(y);function I(t,n){return t instanceof x&&n instanceof x?t.equals(n):!(t instanceof x||n instanceof x||t!==n)}var v,N,w=((m={})[exports.ChainId.MAINNET]=new x(exports.ChainId.MAINNET,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH9","Wrapped Ether"),m[exports.ChainId.ROPSTEN]=new x(exports.ChainId.ROPSTEN,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH9","Wrapped Ether"),m[exports.ChainId.RINKEBY]=new x(exports.ChainId.RINKEBY,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH9","Wrapped Ether"),m[exports.ChainId.GÖRLI]=new x(exports.ChainId.GÖRLI,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH9","Wrapped Ether"),m[exports.ChainId.KOVAN]=new x(exports.ChainId.KOVAN,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH9","Wrapped Ether"),m),R=d(u),E=d(s),T=((v={})[exports.Rounding.ROUND_DOWN]=R.ROUND_DOWN,v[exports.Rounding.ROUND_HALF_UP]=R.ROUND_HALF_UP,v[exports.Rounding.ROUND_UP]=R.ROUND_UP,v),O=((N={})[exports.Rounding.ROUND_DOWN]=0,N[exports.Rounding.ROUND_HALF_UP]=1,N[exports.Rounding.ROUND_UP]=3,N),C=function(){function t(t,n){void 0===n&&(n=i.BigInt(1)),this.numerator=i.BigInt(t),this.denominator=i.BigInt(n)}var n=t.prototype;return n.invert=function(){return new t(this.denominator,this.numerator)},n.add=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.equal(this.denominator,r.denominator)?new t(i.add(this.numerator,r.numerator),this.denominator):new t(i.add(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator)),i.multiply(this.denominator,r.denominator))},n.subtract=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.equal(this.denominator,r.denominator)?new t(i.subtract(this.numerator,r.numerator),this.denominator):new t(i.subtract(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator)),i.multiply(this.denominator,r.denominator))},n.lessThan=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.lessThan(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator))},n.equalTo=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.equal(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator))},n.greaterThan=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.greaterThan(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator))},n.multiply=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return new t(i.multiply(this.numerator,r.numerator),i.multiply(this.denominator,r.denominator))},n.divide=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return new t(i.multiply(this.numerator,r.denominator),i.multiply(this.denominator,r.numerator))},n.toSignificant=function(t,n,r){void 0===n&&(n={groupSeparator:""}),void 0===r&&(r=exports.Rounding.ROUND_HALF_UP),Number.isInteger(t)||o(!1),t>0||o(!1),R.set({precision:t+1,rounding:T[r]});var e=new R(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return e.toFormat(e.decimalPlaces(),n)},n.toFixed=function(t,n,r){return void 0===n&&(n={groupSeparator:""}),void 0===r&&(r=exports.Rounding.ROUND_HALF_UP),Number.isInteger(t)||o(!1),t>=0||o(!1),E.DP=t,E.RM=O[r],new E(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,n)},h(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)}}]),t}(),U=new C(i.BigInt(100)),_=function(t){function n(){return t.apply(this,arguments)||this}p(n,t);var r=n.prototype;return r.toSignificant=function(t,n,r){return void 0===t&&(t=5),this.multiply(U).toSignificant(t,n,r)},r.toFixed=function(t,n,r){return void 0===t&&(t=2),this.multiply(U).toFixed(t,n,r)},n}(C),A=d(s),B=function(t){function n(n,r){var e,a=i.BigInt(r);return i.lessThanOrEqual(a,c)||o(!1),(e=t.call(this,a,i.exponentiate(i.BigInt(10),i.BigInt(n.decimals)))||this).currency=n,e}p(n,t),n.ether=function(t){return new n(g,t)};var r=n.prototype;return r.add=function(t){return I(this.currency,t.currency)||o(!1),new n(this.currency,i.add(this.raw,t.raw))},r.subtract=function(t){return I(this.currency,t.currency)||o(!1),new n(this.currency,i.subtract(this.raw,t.raw))},r.toSignificant=function(n,r,e){return void 0===n&&(n=6),void 0===e&&(e=exports.Rounding.ROUND_DOWN),t.prototype.toSignificant.call(this,n,r,e)},r.toFixed=function(n,r,e){return void 0===n&&(n=this.currency.decimals),void 0===e&&(e=exports.Rounding.ROUND_DOWN),n<=this.currency.decimals||o(!1),t.prototype.toFixed.call(this,n,r,e)},r.toExact=function(t){return void 0===t&&(t={groupSeparator:""}),A.DP=this.currency.decimals,new A(this.numerator.toString()).div(this.denominator.toString()).toFormat(t)},h(n,[{key:"raw",get:function(){return this.numerator}}]),n}(C),D=function(t){function n(n,r){var e;return(e=t.call(this,n,r)||this).token=n,e}p(n,t);var r=n.prototype;return r.add=function(t){return this.token.equals(t.token)||o(!1),new n(this.token,i.add(this.raw,t.raw))},r.subtract=function(t){return this.token.equals(t.token)||o(!1),new n(this.token,i.subtract(this.raw,t.raw))},n}(B),b=function(t){function n(n,r,e,o){var a;return(a=t.call(this,o,e)||this).baseCurrency=n,a.quoteCurrency=r,a.scalar=new C(i.exponentiate(i.BigInt(10),i.BigInt(n.decimals)),i.exponentiate(i.BigInt(10),i.BigInt(r.decimals))),a}p(n,t);var r=n.prototype;return r.invert=function(){return new n(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},r.multiply=function(r){I(this.quoteCurrency,r.baseCurrency)||o(!1);var e=t.prototype.multiply.call(this,r);return new n(this.baseCurrency,r.quoteCurrency,e.denominator,e.numerator)},r.quote=function(n){return I(n.currency,this.baseCurrency)||o(!1),this.quoteCurrency instanceof x?new D(this.quoteCurrency,t.prototype.multiply.call(this,n.raw).quotient):B.ether(t.prototype.multiply.call(this,n.raw).quotient)},r.toSignificant=function(t,n,r){return void 0===t&&(t=6),this.adjusted.toSignificant(t,n,r)},r.toFixed=function(t,n,r){return void 0===t&&(t=4),this.adjusted.toFixed(t,n,r)},h(n,[{key:"raw",get:function(){return new C(this.numerator,this.denominator)}},{key:"adjusted",get:function(){return t.prototype.multiply.call(this,this.scalar)}}]),n}(C),q=i.BigInt(Number.MAX_SAFE_INTEGER),F=i.BigInt(0),P=i.BigInt(1),S=i.BigInt(2);exports.Currency=y,exports.CurrencyAmount=B,exports.ETHER=g,exports.Fraction=C,exports.MaxUint256=c,exports.Percent=_,exports.Price=b,exports.Token=x,exports.TokenAmount=D,exports.WETH9=w,exports.currencyEquals=I,exports.sortedInsert=function(t,n,r,e){if(r>0||o(!1),t.length<=r||o(!1),0===t.length)return t.push(n),null;var i=t.length===r;if(i&&e(t[t.length-1],n)<=0)return n;for(var a=0,u=t.length;a<u;){var s=a+u>>>1;e(t[s],n)<=0?a=s+1:u=s}return t.splice(a,0,n),i?t.pop():null},exports.sqrt=function(t){if(i.greaterThanOrEqual(t,F)||o(!1),i.lessThan(t,q))return i.BigInt(Math.floor(Math.sqrt(i.toNumber(t))));var n,r;for(n=t,r=i.add(i.divide(t,S),P);i.lessThan(r,n);)n=r,r=i.divide(i.add(i.divide(t,r),r),S);return n},exports.validateAndParseAddress=l; | ||
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var n,r,e,i=t(require("jsbi")),o=t(require("tiny-invariant")),a=require("@ethersproject/address"),u=t(require("decimal.js-light")),s=t(require("big.js")),d=t(require("toformat"));(n=exports.ChainId||(exports.ChainId={}))[n.MAINNET=1]="MAINNET",n[n.ROPSTEN=3]="ROPSTEN",n[n.RINKEBY=4]="RINKEBY",n[n["GÖRLI"]=5]="GÖRLI",n[n.KOVAN=42]="KOVAN",(r=exports.TradeType||(exports.TradeType={}))[r.EXACT_INPUT=0]="EXACT_INPUT",r[r.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 c=i.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function f(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function h(t,n,r){return n&&f(t.prototype,n),r&&f(t,r),t}function p(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}function l(t){try{return a.getAddress(t)}catch(n){throw new Error(t+" is not a valid address.")}}var m,y=function(t,n,r){t<255||o(!1),this.decimals=t,this.symbol=n,this.name=r},g=y.ETHER=new y(18,"ETH","Ether"),x=function(t){function n(n,r,e,i,o){var a;return(a=t.call(this,e,i,o)||this).chainId=n,a.address=l(r),a}p(n,t);var r=n.prototype;return r.equals=function(t){return this===t||this.chainId===t.chainId&&this.address===t.address},r.sortsBefore=function(t){return this.chainId!==t.chainId&&o(!1),this.address===t.address&&o(!1),this.address.toLowerCase()<t.address.toLowerCase()},n}(y);function I(t,n){return t instanceof x&&n instanceof x?t.equals(n):!(t instanceof x||n instanceof x||t!==n)}var v,N,w=((m={})[exports.ChainId.MAINNET]=new x(exports.ChainId.MAINNET,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH9","Wrapped Ether"),m[exports.ChainId.ROPSTEN]=new x(exports.ChainId.ROPSTEN,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH9","Wrapped Ether"),m[exports.ChainId.RINKEBY]=new x(exports.ChainId.RINKEBY,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH9","Wrapped Ether"),m[exports.ChainId.GÖRLI]=new x(exports.ChainId.GÖRLI,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH9","Wrapped Ether"),m[exports.ChainId.KOVAN]=new x(exports.ChainId.KOVAN,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH9","Wrapped Ether"),m),R=d(u),E=d(s),T=((v={})[exports.Rounding.ROUND_DOWN]=R.ROUND_DOWN,v[exports.Rounding.ROUND_HALF_UP]=R.ROUND_HALF_UP,v[exports.Rounding.ROUND_UP]=R.ROUND_UP,v),O=((N={})[exports.Rounding.ROUND_DOWN]=0,N[exports.Rounding.ROUND_HALF_UP]=1,N[exports.Rounding.ROUND_UP]=3,N),C=function(){function t(t,n){void 0===n&&(n=i.BigInt(1)),this.numerator=i.BigInt(t),this.denominator=i.BigInt(n)}var n=t.prototype;return n.invert=function(){return new t(this.denominator,this.numerator)},n.add=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.equal(this.denominator,r.denominator)?new t(i.add(this.numerator,r.numerator),this.denominator):new t(i.add(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator)),i.multiply(this.denominator,r.denominator))},n.subtract=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.equal(this.denominator,r.denominator)?new t(i.subtract(this.numerator,r.numerator),this.denominator):new t(i.subtract(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator)),i.multiply(this.denominator,r.denominator))},n.lessThan=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.lessThan(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator))},n.equalTo=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.equal(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator))},n.greaterThan=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return i.greaterThan(i.multiply(this.numerator,r.denominator),i.multiply(r.numerator,this.denominator))},n.multiply=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return new t(i.multiply(this.numerator,r.numerator),i.multiply(this.denominator,r.denominator))},n.divide=function(n){var r=n instanceof t?n:new t(i.BigInt(n));return new t(i.multiply(this.numerator,r.denominator),i.multiply(this.denominator,r.numerator))},n.toSignificant=function(t,n,r){void 0===n&&(n={groupSeparator:""}),void 0===r&&(r=exports.Rounding.ROUND_HALF_UP),Number.isInteger(t)||o(!1),t>0||o(!1),R.set({precision:t+1,rounding:T[r]});var e=new R(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return e.toFormat(e.decimalPlaces(),n)},n.toFixed=function(t,n,r){return void 0===n&&(n={groupSeparator:""}),void 0===r&&(r=exports.Rounding.ROUND_HALF_UP),Number.isInteger(t)||o(!1),t>=0||o(!1),E.DP=t,E.RM=O[r],new E(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,n)},h(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)}}]),t}(),U=new C(i.BigInt(100)),_=function(t){function n(){return t.apply(this,arguments)||this}p(n,t);var r=n.prototype;return r.toSignificant=function(t,n,r){return void 0===t&&(t=5),this.multiply(U).toSignificant(t,n,r)},r.toFixed=function(t,n,r){return void 0===t&&(t=2),this.multiply(U).toFixed(t,n,r)},n}(C),A=d(s),B=function(t){function n(n,r){var e,a=i.BigInt(r);return i.lessThanOrEqual(a,c)||o(!1),(e=t.call(this,a,i.exponentiate(i.BigInt(10),i.BigInt(n.decimals)))||this).currency=n,e}p(n,t),n.ether=function(t){return new n(g,t)};var r=n.prototype;return r.add=function(t){return I(this.currency,t.currency)||o(!1),new n(this.currency,i.add(this.raw,t.raw))},r.subtract=function(t){return I(this.currency,t.currency)||o(!1),new n(this.currency,i.subtract(this.raw,t.raw))},r.toSignificant=function(n,r,e){return void 0===n&&(n=6),void 0===e&&(e=exports.Rounding.ROUND_DOWN),t.prototype.toSignificant.call(this,n,r,e)},r.toFixed=function(n,r,e){return void 0===n&&(n=this.currency.decimals),void 0===e&&(e=exports.Rounding.ROUND_DOWN),n<=this.currency.decimals||o(!1),t.prototype.toFixed.call(this,n,r,e)},r.toExact=function(t){return void 0===t&&(t={groupSeparator:""}),A.DP=this.currency.decimals,new A(this.numerator.toString()).div(this.denominator.toString()).toFormat(t)},h(n,[{key:"raw",get:function(){return this.numerator}}]),n}(C),D=function(t){function n(n,r){var e;return(e=t.call(this,n,r)||this).token=n,e}p(n,t);var r=n.prototype;return r.add=function(t){return this.token.equals(t.token)||o(!1),new n(this.token,i.add(this.raw,t.raw))},r.subtract=function(t){return this.token.equals(t.token)||o(!1),new n(this.token,i.subtract(this.raw,t.raw))},n}(B),b=function(t){function n(n,r,e,o){var a;return(a=t.call(this,o,e)||this).baseCurrency=n,a.quoteCurrency=r,a.scalar=new C(i.exponentiate(i.BigInt(10),i.BigInt(n.decimals)),i.exponentiate(i.BigInt(10),i.BigInt(r.decimals))),a}p(n,t);var r=n.prototype;return r.invert=function(){return new n(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},r.multiply=function(r){I(this.quoteCurrency,r.baseCurrency)||o(!1);var e=t.prototype.multiply.call(this,r);return new n(this.baseCurrency,r.quoteCurrency,e.denominator,e.numerator)},r.quote=function(n){return I(n.currency,this.baseCurrency)||o(!1),this.quoteCurrency instanceof x?new D(this.quoteCurrency,t.prototype.multiply.call(this,n.raw).quotient):B.ether(t.prototype.multiply.call(this,n.raw).quotient)},r.toSignificant=function(t,n,r){return void 0===t&&(t=6),this.adjusted.toSignificant(t,n,r)},r.toFixed=function(t,n,r){return void 0===t&&(t=4),this.adjusted.toFixed(t,n,r)},h(n,[{key:"raw",get:function(){return new C(this.numerator,this.denominator)}},{key:"adjusted",get:function(){return t.prototype.multiply.call(this,this.scalar)}}]),n}(C),q=i.BigInt(Number.MAX_SAFE_INTEGER),F=i.BigInt(0),P=i.BigInt(1),S=i.BigInt(2);exports.Currency=y,exports.CurrencyAmount=B,exports.ETHER=g,exports.Fraction=C,exports.MaxUint256=c,exports.Percent=_,exports.Price=b,exports.Token=x,exports.TokenAmount=D,exports.WETH9=w,exports.currencyEquals=I,exports.sortedInsert=function(t,n,r,e){if(r>0||o(!1),t.length<=r||o(!1),0===t.length)return t.push(n),null;var i=t.length===r;if(i&&e(t[t.length-1],n)<=0)return n;for(var a=0,u=t.length;a<u;){var s=a+u>>>1;e(t[s],n)<=0?a=s+1:u=s}return t.splice(a,0,n),i?t.pop():null},exports.sqrt=function(t){if(i.greaterThanOrEqual(t,F)||o(!1),i.lessThan(t,q))return i.BigInt(Math.floor(Math.sqrt(i.toNumber(t))));var n,r;for(n=t,r=i.add(i.divide(t,S),P);i.lessThan(r,n);)n=r,r=i.divide(i.add(i.divide(t,r),r),S);return n},exports.validateAndParseAddress=l; | ||
//# sourceMappingURL=sdk-core.cjs.production.min.js.map |
import JSBI from 'jsbi'; | ||
import invariant from 'tiny-invariant'; | ||
import { getAddress } from '@ethersproject/address'; | ||
import warning from 'tiny-warning'; | ||
import _Decimal from 'decimal.js-light'; | ||
@@ -58,9 +57,12 @@ import _Big from 'big.js'; | ||
/** | ||
* Validates an address and returns the parsed (checksummed) version of that address | ||
* @param address the unchecksummed hex address | ||
*/ | ||
function validateAndParseAddress(address) { | ||
try { | ||
var checksummedAddress = getAddress(address); | ||
process.env.NODE_ENV !== "production" ? warning(address === checksummedAddress, address + " is not checksummed.") : void 0; | ||
return checksummedAddress; | ||
return getAddress(address); | ||
} catch (error) { | ||
process.env.NODE_ENV !== "production" ? invariant(false, address + " is not a valid address.") : invariant(false) ; | ||
throw new Error(address + " is not a valid address."); | ||
} | ||
@@ -67,0 +69,0 @@ } |
@@ -0,1 +1,5 @@ | ||
/** | ||
* Validates an address and returns the parsed (checksummed) version of that address | ||
* @param address the unchecksummed hex address | ||
*/ | ||
export default function validateAndParseAddress(address: string): string; |
{ | ||
"name": "@uniswap/sdk-core", | ||
"license": "MIT", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "⚒️ An SDK for building applications on top of Uniswap V3", | ||
@@ -29,3 +29,2 @@ "main": "dist/index.js", | ||
"tiny-invariant": "^1.1.0", | ||
"tiny-warning": "^1.0.3", | ||
"toformat": "^2.0.0" | ||
@@ -32,0 +31,0 @@ }, |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153906
6
25
1108
20
- Removedtiny-warning@^1.0.3
- Removedtiny-warning@1.0.3(transitive)