@uniswap/sdk-core
Advanced tools
Comparing version 3.2.3 to 3.2.4
import JSBI from 'jsbi'; | ||
export declare enum SupportedChainId { | ||
MAINNET = 1, | ||
GOERLI = 5, | ||
SEPOLIA = 11155111, | ||
ARBITRUM_ONE = 42161, | ||
ARBITRUM_GOERLI = 421613, | ||
OPTIMISM = 10, | ||
OPTIMISM_GOERLI = 420, | ||
POLYGON = 137, | ||
POLYGON_MUMBAI = 80001, | ||
CELO = 42220, | ||
CELO_ALFAJORES = 44787, | ||
BNB = 56 | ||
} | ||
export declare type BigintIsh = JSBI | string | number; | ||
@@ -17,0 +3,0 @@ export declare enum TradeType { |
@@ -0,3 +1,5 @@ | ||
export * from './addresses'; | ||
export * from './chains'; | ||
export * from './constants'; | ||
export * from './entities'; | ||
export * from './utils'; |
@@ -14,30 +14,2 @@ 'use strict'; | ||
(function (SupportedChainId) { | ||
SupportedChainId[SupportedChainId["MAINNET"] = 1] = "MAINNET"; | ||
SupportedChainId[SupportedChainId["GOERLI"] = 5] = "GOERLI"; | ||
SupportedChainId[SupportedChainId["SEPOLIA"] = 11155111] = "SEPOLIA"; | ||
SupportedChainId[SupportedChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE"; | ||
SupportedChainId[SupportedChainId["ARBITRUM_GOERLI"] = 421613] = "ARBITRUM_GOERLI"; | ||
SupportedChainId[SupportedChainId["OPTIMISM"] = 10] = "OPTIMISM"; | ||
SupportedChainId[SupportedChainId["OPTIMISM_GOERLI"] = 420] = "OPTIMISM_GOERLI"; | ||
SupportedChainId[SupportedChainId["POLYGON"] = 137] = "POLYGON"; | ||
SupportedChainId[SupportedChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI"; | ||
SupportedChainId[SupportedChainId["CELO"] = 42220] = "CELO"; | ||
SupportedChainId[SupportedChainId["CELO_ALFAJORES"] = 44787] = "CELO_ALFAJORES"; | ||
SupportedChainId[SupportedChainId["BNB"] = 56] = "BNB"; | ||
})(exports.SupportedChainId || (exports.SupportedChainId = {})); | ||
(function (TradeType) { | ||
TradeType[TradeType["EXACT_INPUT"] = 0] = "EXACT_INPUT"; | ||
TradeType[TradeType["EXACT_OUTPUT"] = 1] = "EXACT_OUTPUT"; | ||
})(exports.TradeType || (exports.TradeType = {})); | ||
(function (Rounding) { | ||
Rounding[Rounding["ROUND_DOWN"] = 0] = "ROUND_DOWN"; | ||
Rounding[Rounding["ROUND_HALF_UP"] = 1] = "ROUND_HALF_UP"; | ||
Rounding[Rounding["ROUND_UP"] = 2] = "ROUND_UP"; | ||
})(exports.Rounding || (exports.Rounding = {})); | ||
var MaxUint256 = /*#__PURE__*/JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); | ||
function _defineProperties(target, props) { | ||
@@ -59,2 +31,20 @@ for (var i = 0; i < props.length; i++) { | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _inheritsLoose(subClass, superClass) { | ||
@@ -66,2 +56,211 @@ subClass.prototype = Object.create(superClass.prototype); | ||
(function (ChainId) { | ||
ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; | ||
ChainId[ChainId["GOERLI"] = 5] = "GOERLI"; | ||
ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA"; | ||
ChainId[ChainId["OPTIMISM"] = 10] = "OPTIMISM"; | ||
ChainId[ChainId["OPTIMISM_GOERLI"] = 420] = "OPTIMISM_GOERLI"; | ||
ChainId[ChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE"; | ||
ChainId[ChainId["ARBITRUM_GOERLI"] = 421613] = "ARBITRUM_GOERLI"; | ||
ChainId[ChainId["POLYGON"] = 137] = "POLYGON"; | ||
ChainId[ChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI"; | ||
ChainId[ChainId["CELO"] = 42220] = "CELO"; | ||
ChainId[ChainId["CELO_ALFAJORES"] = 44787] = "CELO_ALFAJORES"; | ||
ChainId[ChainId["GNOSIS"] = 100] = "GNOSIS"; | ||
ChainId[ChainId["MOONBEAM"] = 1284] = "MOONBEAM"; | ||
ChainId[ChainId["BNB"] = 56] = "BNB"; | ||
})(exports.ChainId || (exports.ChainId = {})); | ||
var SUPPORTED_CHAINS = [exports.ChainId.MAINNET, exports.ChainId.OPTIMISM, exports.ChainId.OPTIMISM_GOERLI, exports.ChainId.ARBITRUM_ONE, exports.ChainId.ARBITRUM_GOERLI, exports.ChainId.POLYGON, exports.ChainId.POLYGON_MUMBAI, exports.ChainId.GOERLI, exports.ChainId.SEPOLIA, exports.ChainId.CELO_ALFAJORES, exports.ChainId.CELO, exports.ChainId.BNB]; | ||
(function (NativeCurrencyName) { | ||
// Strings match input for CLI | ||
NativeCurrencyName["ETHER"] = "ETH"; | ||
NativeCurrencyName["MATIC"] = "MATIC"; | ||
NativeCurrencyName["CELO"] = "CELO"; | ||
NativeCurrencyName["GNOSIS"] = "XDAI"; | ||
NativeCurrencyName["MOONBEAM"] = "GLMR"; | ||
NativeCurrencyName["BNB"] = "BNB"; | ||
})(exports.NativeCurrencyName || (exports.NativeCurrencyName = {})); | ||
var _CHAIN_TO_ADDRESSES_M, _GOVERNANCE_ALPHA_V1_, _GOVERNANCE_BRAVO_ADD, _MERKLE_DISTRIBUTOR_A, _ARGENT_WALLET_DETECT, _SOCKS_CONTROLLER_ADD; | ||
var DEFAULT_NETWORKS = [exports.ChainId.MAINNET, exports.ChainId.GOERLI]; | ||
function constructSameAddressMap(address, additionalNetworks) { | ||
if (additionalNetworks === void 0) { | ||
additionalNetworks = []; | ||
} | ||
return DEFAULT_NETWORKS.concat(additionalNetworks).reduce(function (memo, chainId) { | ||
memo[chainId] = address; | ||
return memo; | ||
}, {}); | ||
} | ||
var UNI_ADDRESSES = /*#__PURE__*/constructSameAddressMap('0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', [exports.ChainId.OPTIMISM, exports.ChainId.ARBITRUM_ONE, exports.ChainId.POLYGON, exports.ChainId.POLYGON_MUMBAI, exports.ChainId.SEPOLIA]); | ||
var UNISWAP_NFT_AIRDROP_CLAIM_ADDRESS = '0x8B799381ac40b838BBA4131ffB26197C432AFe78'; | ||
var V2_FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'; | ||
var V2_FACTORY_ADDRESSES = /*#__PURE__*/constructSameAddressMap(V2_FACTORY_ADDRESS); | ||
var V2_ROUTER_ADDRESS = '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'; | ||
var V2_ROUTER_ADDRESSES = /*#__PURE__*/constructSameAddressMap(V2_ROUTER_ADDRESS); // Networks that share most of the same addresses i.e. Mainnet, Goerli, Optimism, Arbitrum, Polygon | ||
var DEFAULT_ADDRESSES = { | ||
v3CoreFactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984', | ||
multicallAddress: '0x1F98415757620B543A52E61c46B32eB19261F984', | ||
quoterAddress: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', | ||
v3MigratorAddress: '0xA5644E29708357803b5A882D272c41cC0dF92B34', | ||
nonfungiblePositionManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' | ||
}; | ||
var MAINNET_ADDRESSES = /*#__PURE__*/_extends({}, DEFAULT_ADDRESSES, { | ||
v1MixedRouteQuoterAddress: '0x84E44095eeBfEC7793Cd7d5b57B7e401D7f1cA2E' | ||
}); | ||
var GOERLI_ADDRESSES = /*#__PURE__*/_extends({}, DEFAULT_ADDRESSES, { | ||
v1MixedRouteQuoterAddress: '0xBa60b6e6fF25488308789E6e0A65D838be34194e' | ||
}); | ||
var OPTIMISM_ADDRESSES = DEFAULT_ADDRESSES; | ||
var ARBITRUM_ONE_ADDRESSES = /*#__PURE__*/_extends({}, DEFAULT_ADDRESSES, { | ||
multicallAddress: '0xadF885960B47eA2CD9B55E6DAc6B42b7Cb2806dB', | ||
tickLensAddress: '0xbfd8137f7d1516D3ea5cA83523914859ec47F573' | ||
}); | ||
var POLYGON_ADDRESSES = DEFAULT_ADDRESSES; // celo v3 addresses | ||
var CELO_ADDRESSES = { | ||
v3CoreFactoryAddress: '0xAfE208a311B21f13EF87E33A90049fC17A7acDEc', | ||
multicallAddress: '0x633987602DE5C4F337e3DbF265303A1080324204', | ||
quoterAddress: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8', | ||
v3MigratorAddress: '0x3cFd4d48EDfDCC53D3f173F596f621064614C582', | ||
nonfungiblePositionManagerAddress: '0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A', | ||
tickLensAddress: '0x5f115D9113F88e0a0Db1b5033D90D4a9690AcD3D' | ||
}; // BNB v3 addresses | ||
var BNB_ADDRESSES = { | ||
v3CoreFactoryAddress: '0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7', | ||
multicallAddress: '0x963Df249eD09c358A4819E39d9Cd5736c3087184', | ||
quoterAddress: '0x78D78E420Da98ad378D7799bE8f4AF69033EB077', | ||
v3MigratorAddress: '0x32681814957e0C13117ddc0c2aba232b5c9e760f', | ||
nonfungiblePositionManagerAddress: '0x7b8A01B39D58278b5DE7e48c8449c9f4F5170613', | ||
tickLensAddress: '0xD9270014D396281579760619CCf4c3af0501A47C', | ||
swapRouter02Address: '0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2' | ||
}; // optimism goerli addresses | ||
var OPTIMISM_GOERLI_ADDRESSES = { | ||
v3CoreFactoryAddress: '0xB656dA17129e7EB733A557f4EBc57B76CFbB5d10', | ||
multicallAddress: '0x07F2D8a2a02251B62af965f22fC4744A5f96BCCd', | ||
quoterAddress: '0x9569CbA925c8ca2248772A9A4976A516743A246F', | ||
v3MigratorAddress: '0xf6c55fBe84B1C8c3283533c53F51bC32F5C7Aba8', | ||
nonfungiblePositionManagerAddress: '0x39Ca85Af2F383190cBf7d7c41ED9202D27426EF6', | ||
tickLensAddress: '0xe6140Bd164b63E8BfCfc40D5dF952f83e171758e' | ||
}; // arbitrum goerli v3 addresses | ||
var ARBITRUM_GOERLI_ADDRESSES = { | ||
v3CoreFactoryAddress: '0x4893376342d5D7b3e31d4184c08b265e5aB2A3f6', | ||
multicallAddress: '0x8260CB40247290317a4c062F3542622367F206Ee', | ||
quoterAddress: '0x1dd92b83591781D0C6d98d07391eea4b9a6008FA', | ||
v3MigratorAddress: '0xA815919D2584Ac3F76ea9CB62E6Fd40a43BCe0C3', | ||
nonfungiblePositionManagerAddress: '0x622e4726a167799826d1E1D150b076A7725f5D81', | ||
tickLensAddress: '0xb52429333da969a0C79a60930a4Bf0020E5D1DE8' | ||
}; // sepolia v3 addresses | ||
var SEPOLIA_ADDRESSES = { | ||
v3CoreFactoryAddress: '0x0227628f3F023bb0B980b67D528571c95c6DaC1c', | ||
multicallAddress: '0xD7F33bCdb21b359c8ee6F0251d30E94832baAd07', | ||
quoterAddress: '0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3', | ||
v3MigratorAddress: '0x729004182cF005CEC8Bd85df140094b6aCbe8b15', | ||
nonfungiblePositionManagerAddress: '0x1238536071E1c677A632429e3655c799b22cDA52', | ||
tickLensAddress: '0xd7f33bcdb21b359c8ee6f0251d30e94832baad07' | ||
}; | ||
var CHAIN_TO_ADDRESSES_MAP = (_CHAIN_TO_ADDRESSES_M = {}, _CHAIN_TO_ADDRESSES_M[exports.ChainId.MAINNET] = MAINNET_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.OPTIMISM] = OPTIMISM_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.ARBITRUM_ONE] = ARBITRUM_ONE_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.POLYGON] = POLYGON_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.POLYGON_MUMBAI] = POLYGON_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.GOERLI] = GOERLI_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.CELO] = CELO_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.CELO_ALFAJORES] = CELO_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.BNB] = BNB_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.OPTIMISM_GOERLI] = OPTIMISM_GOERLI_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.ARBITRUM_GOERLI] = ARBITRUM_GOERLI_ADDRESSES, _CHAIN_TO_ADDRESSES_M[exports.ChainId.SEPOLIA] = SEPOLIA_ADDRESSES, _CHAIN_TO_ADDRESSES_M); | ||
/* V3 Contract Addresses */ | ||
var V3_CORE_FACTORY_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
return memo[chainId] = CHAIN_TO_ADDRESSES_MAP[chainId].v3CoreFactoryAddress; | ||
}, {})); | ||
var V3_MIGRATOR_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
var v3MigratorAddress = CHAIN_TO_ADDRESSES_MAP[chainId].v3MigratorAddress; | ||
if (v3MigratorAddress) { | ||
memo[chainId] = v3MigratorAddress; | ||
} | ||
return memo; | ||
}, {})); | ||
var MULTICALL_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
return memo[chainId] = CHAIN_TO_ADDRESSES_MAP[chainId].multicallAddress; | ||
}, {})); | ||
/** | ||
* The oldest V0 governance address | ||
*/ | ||
var GOVERNANCE_ALPHA_V0_ADDRESSES = /*#__PURE__*/constructSameAddressMap('0x5e4be8Bc9637f0EAA1A755019e06A68ce081D58F'); | ||
/** | ||
* The older V1 governance address | ||
*/ | ||
var GOVERNANCE_ALPHA_V1_ADDRESSES = (_GOVERNANCE_ALPHA_V1_ = {}, _GOVERNANCE_ALPHA_V1_[exports.ChainId.MAINNET] = '0xC4e172459f1E7939D522503B81AFAaC1014CE6F6', _GOVERNANCE_ALPHA_V1_); | ||
/** | ||
* The latest governor bravo that is currently admin of timelock | ||
*/ | ||
var GOVERNANCE_BRAVO_ADDRESSES = (_GOVERNANCE_BRAVO_ADD = {}, _GOVERNANCE_BRAVO_ADD[exports.ChainId.MAINNET] = '0x408ED6354d4973f66138C91495F2f2FCbd8724C3', _GOVERNANCE_BRAVO_ADD); | ||
var TIMELOCK_ADDRESSES = /*#__PURE__*/constructSameAddressMap('0x1a9C8182C09F50C8318d769245beA52c32BE35BC'); | ||
var MERKLE_DISTRIBUTOR_ADDRESS = (_MERKLE_DISTRIBUTOR_A = {}, _MERKLE_DISTRIBUTOR_A[exports.ChainId.MAINNET] = '0x090D4613473dEE047c3f2706764f49E0821D256e', _MERKLE_DISTRIBUTOR_A); | ||
var ARGENT_WALLET_DETECTOR_ADDRESS = (_ARGENT_WALLET_DETECT = {}, _ARGENT_WALLET_DETECT[exports.ChainId.MAINNET] = '0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8', _ARGENT_WALLET_DETECT); | ||
var QUOTER_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
return memo[chainId] = CHAIN_TO_ADDRESSES_MAP[chainId].quoterAddress; | ||
}, {})); | ||
var NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
var nonfungiblePositionManagerAddress = CHAIN_TO_ADDRESSES_MAP[chainId].nonfungiblePositionManagerAddress; | ||
if (nonfungiblePositionManagerAddress) { | ||
memo[chainId] = nonfungiblePositionManagerAddress; | ||
} | ||
return memo; | ||
}, {})); | ||
var ENS_REGISTRAR_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/constructSameAddressMap('0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e')); | ||
var SOCKS_CONTROLLER_ADDRESSES = (_SOCKS_CONTROLLER_ADD = {}, _SOCKS_CONTROLLER_ADD[exports.ChainId.MAINNET] = '0x65770b5283117639760beA3F867b69b3697a91dd', _SOCKS_CONTROLLER_ADD); | ||
var TICK_LENS_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
var tickLensAddress = CHAIN_TO_ADDRESSES_MAP[chainId].tickLensAddress; | ||
if (tickLensAddress) { | ||
memo[chainId] = tickLensAddress; | ||
} | ||
return memo; | ||
}, {})); | ||
var MIXED_ROUTE_QUOTER_V1_ADDRESSES = /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
var v1MixedRouteQuoterAddress = CHAIN_TO_ADDRESSES_MAP[chainId].v1MixedRouteQuoterAddress; | ||
if (v1MixedRouteQuoterAddress) { | ||
memo[chainId] = v1MixedRouteQuoterAddress; | ||
} | ||
return memo; | ||
}, {}); | ||
var SWAP_ROUTER_02_ADDRESSES = function SWAP_ROUTER_02_ADDRESSES(chainId) { | ||
if (chainId == exports.ChainId.BNB) { | ||
return CHAIN_TO_ADDRESSES_MAP[chainId].swapRouter02Address; | ||
} | ||
return '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45'; | ||
}; | ||
(function (TradeType) { | ||
TradeType[TradeType["EXACT_INPUT"] = 0] = "EXACT_INPUT"; | ||
TradeType[TradeType["EXACT_OUTPUT"] = 1] = "EXACT_OUTPUT"; | ||
})(exports.TradeType || (exports.TradeType = {})); | ||
(function (Rounding) { | ||
Rounding[Rounding["ROUND_DOWN"] = 0] = "ROUND_DOWN"; | ||
Rounding[Rounding["ROUND_HALF_UP"] = 1] = "ROUND_HALF_UP"; | ||
Rounding[Rounding["ROUND_UP"] = 2] = "ROUND_UP"; | ||
})(exports.Rounding || (exports.Rounding = {})); | ||
var MaxUint256 = /*#__PURE__*/JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); | ||
var _toSignificantRoundin, _toFixedRounding; | ||
@@ -740,10 +939,34 @@ var Decimal = /*#__PURE__*/toFormat(_Decimal); | ||
exports.ARGENT_WALLET_DETECTOR_ADDRESS = ARGENT_WALLET_DETECTOR_ADDRESS; | ||
exports.CHAIN_TO_ADDRESSES_MAP = CHAIN_TO_ADDRESSES_MAP; | ||
exports.CurrencyAmount = CurrencyAmount; | ||
exports.ENS_REGISTRAR_ADDRESSES = ENS_REGISTRAR_ADDRESSES; | ||
exports.Ether = Ether; | ||
exports.Fraction = Fraction; | ||
exports.GOVERNANCE_ALPHA_V0_ADDRESSES = GOVERNANCE_ALPHA_V0_ADDRESSES; | ||
exports.GOVERNANCE_ALPHA_V1_ADDRESSES = GOVERNANCE_ALPHA_V1_ADDRESSES; | ||
exports.GOVERNANCE_BRAVO_ADDRESSES = GOVERNANCE_BRAVO_ADDRESSES; | ||
exports.MERKLE_DISTRIBUTOR_ADDRESS = MERKLE_DISTRIBUTOR_ADDRESS; | ||
exports.MIXED_ROUTE_QUOTER_V1_ADDRESSES = MIXED_ROUTE_QUOTER_V1_ADDRESSES; | ||
exports.MULTICALL_ADDRESSES = MULTICALL_ADDRESSES; | ||
exports.MaxUint256 = MaxUint256; | ||
exports.NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = NONFUNGIBLE_POSITION_MANAGER_ADDRESSES; | ||
exports.NativeCurrency = NativeCurrency; | ||
exports.Percent = Percent; | ||
exports.Price = Price; | ||
exports.QUOTER_ADDRESSES = QUOTER_ADDRESSES; | ||
exports.SOCKS_CONTROLLER_ADDRESSES = SOCKS_CONTROLLER_ADDRESSES; | ||
exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS; | ||
exports.SWAP_ROUTER_02_ADDRESSES = SWAP_ROUTER_02_ADDRESSES; | ||
exports.TICK_LENS_ADDRESSES = TICK_LENS_ADDRESSES; | ||
exports.TIMELOCK_ADDRESSES = TIMELOCK_ADDRESSES; | ||
exports.Token = Token; | ||
exports.UNISWAP_NFT_AIRDROP_CLAIM_ADDRESS = UNISWAP_NFT_AIRDROP_CLAIM_ADDRESS; | ||
exports.UNI_ADDRESSES = UNI_ADDRESSES; | ||
exports.V2_FACTORY_ADDRESS = V2_FACTORY_ADDRESS; | ||
exports.V2_FACTORY_ADDRESSES = V2_FACTORY_ADDRESSES; | ||
exports.V2_ROUTER_ADDRESS = V2_ROUTER_ADDRESS; | ||
exports.V2_ROUTER_ADDRESSES = V2_ROUTER_ADDRESSES; | ||
exports.V3_CORE_FACTORY_ADDRESSES = V3_CORE_FACTORY_ADDRESSES; | ||
exports.V3_MIGRATOR_ADDRESSES = V3_MIGRATOR_ADDRESSES; | ||
exports.WETH9 = WETH9; | ||
@@ -750,0 +973,0 @@ exports.computePriceImpact = computePriceImpact; |
@@ -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.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; | ||
"use strict";function r(r){return r&&"object"==typeof r&&"default"in r?r.default:r}Object.defineProperty(exports,"__esModule",{value:!0});var e,t=r(require("jsbi")),n=r(require("tiny-invariant")),o=r(require("decimal.js-light")),i=r(require("big.js")),a=r(require("toformat")),s=require("@ethersproject/address");function d(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function u(r,e,t){return e&&d(r.prototype,e),t&&d(r,t),r}function c(){return(c=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}).apply(this,arguments)}function f(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}(e=exports.ChainId||(exports.ChainId={}))[e.MAINNET=1]="MAINNET",e[e.GOERLI=5]="GOERLI",e[e.SEPOLIA=11155111]="SEPOLIA",e[e.OPTIMISM=10]="OPTIMISM",e[e.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",e[e.POLYGON=137]="POLYGON",e[e.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",e[e.CELO=42220]="CELO",e[e.CELO_ALFAJORES=44787]="CELO_ALFAJORES",e[e.GNOSIS=100]="GNOSIS",e[e.MOONBEAM=1284]="MOONBEAM",e[e.BNB=56]="BNB";var A,p,E,l,h,C,m,x=[exports.ChainId.MAINNET,exports.ChainId.OPTIMISM,exports.ChainId.OPTIMISM_GOERLI,exports.ChainId.ARBITRUM_ONE,exports.ChainId.ARBITRUM_GOERLI,exports.ChainId.POLYGON,exports.ChainId.POLYGON_MUMBAI,exports.ChainId.GOERLI,exports.ChainId.SEPOLIA,exports.ChainId.CELO_ALFAJORES,exports.ChainId.CELO,exports.ChainId.BNB];(A=exports.NativeCurrencyName||(exports.NativeCurrencyName={})).ETHER="ETH",A.MATIC="MATIC",A.CELO="CELO",A.GNOSIS="XDAI",A.MOONBEAM="GLMR",A.BNB="BNB";var D=[exports.ChainId.MAINNET,exports.ChainId.GOERLI];function I(r,e){return void 0===e&&(e=[]),D.concat(e).reduce((function(e,t){return e[t]=r,e}),{})}var O,F,R=I("0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",[exports.ChainId.OPTIMISM,exports.ChainId.ARBITRUM_ONE,exports.ChainId.POLYGON,exports.ChainId.POLYGON_MUMBAI,exports.ChainId.SEPOLIA]),b=I("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"),y=I("0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"),B={v3CoreFactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",multicallAddress:"0x1F98415757620B543A52E61c46B32eB19261F984",quoterAddress:"0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6",v3MigratorAddress:"0xA5644E29708357803b5A882D272c41cC0dF92B34",nonfungiblePositionManagerAddress:"0xC36442b4a4522E871399CD717aBDD847Ab11FE88"},S=c({},B,{v1MixedRouteQuoterAddress:"0x84E44095eeBfEC7793Cd7d5b57B7e401D7f1cA2E"}),_=c({},B,{v1MixedRouteQuoterAddress:"0xBa60b6e6fF25488308789E6e0A65D838be34194e"}),v=B,N=c({},B,{multicallAddress:"0xadF885960B47eA2CD9B55E6DAc6B42b7Cb2806dB",tickLensAddress:"0xbfd8137f7d1516D3ea5cA83523914859ec47F573"}),g=B,T={v3CoreFactoryAddress:"0xAfE208a311B21f13EF87E33A90049fC17A7acDEc",multicallAddress:"0x633987602DE5C4F337e3DbF265303A1080324204",quoterAddress:"0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8",v3MigratorAddress:"0x3cFd4d48EDfDCC53D3f173F596f621064614C582",nonfungiblePositionManagerAddress:"0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A",tickLensAddress:"0x5f115D9113F88e0a0Db1b5033D90D4a9690AcD3D"},M=((p={})[exports.ChainId.MAINNET]=S,p[exports.ChainId.OPTIMISM]=v,p[exports.ChainId.ARBITRUM_ONE]=N,p[exports.ChainId.POLYGON]=g,p[exports.ChainId.POLYGON_MUMBAI]=g,p[exports.ChainId.GOERLI]=_,p[exports.ChainId.CELO]=T,p[exports.ChainId.CELO_ALFAJORES]=T,p[exports.ChainId.BNB]={v3CoreFactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",multicallAddress:"0x963Df249eD09c358A4819E39d9Cd5736c3087184",quoterAddress:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",v3MigratorAddress:"0x32681814957e0C13117ddc0c2aba232b5c9e760f",nonfungiblePositionManagerAddress:"0x7b8A01B39D58278b5DE7e48c8449c9f4F5170613",tickLensAddress:"0xD9270014D396281579760619CCf4c3af0501A47C",swapRouter02Address:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2"},p[exports.ChainId.OPTIMISM_GOERLI]={v3CoreFactoryAddress:"0xB656dA17129e7EB733A557f4EBc57B76CFbB5d10",multicallAddress:"0x07F2D8a2a02251B62af965f22fC4744A5f96BCCd",quoterAddress:"0x9569CbA925c8ca2248772A9A4976A516743A246F",v3MigratorAddress:"0xf6c55fBe84B1C8c3283533c53F51bC32F5C7Aba8",nonfungiblePositionManagerAddress:"0x39Ca85Af2F383190cBf7d7c41ED9202D27426EF6",tickLensAddress:"0xe6140Bd164b63E8BfCfc40D5dF952f83e171758e"},p[exports.ChainId.ARBITRUM_GOERLI]={v3CoreFactoryAddress:"0x4893376342d5D7b3e31d4184c08b265e5aB2A3f6",multicallAddress:"0x8260CB40247290317a4c062F3542622367F206Ee",quoterAddress:"0x1dd92b83591781D0C6d98d07391eea4b9a6008FA",v3MigratorAddress:"0xA815919D2584Ac3F76ea9CB62E6Fd40a43BCe0C3",nonfungiblePositionManagerAddress:"0x622e4726a167799826d1E1D150b076A7725f5D81",tickLensAddress:"0xb52429333da969a0C79a60930a4Bf0020E5D1DE8"},p[exports.ChainId.SEPOLIA]={v3CoreFactoryAddress:"0x0227628f3F023bb0B980b67D528571c95c6DaC1c",multicallAddress:"0xD7F33bCdb21b359c8ee6F0251d30E94832baAd07",quoterAddress:"0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3",v3MigratorAddress:"0x729004182cF005CEC8Bd85df140094b6aCbe8b15",nonfungiblePositionManagerAddress:"0x1238536071E1c677A632429e3655c799b22cDA52",tickLensAddress:"0xd7f33bcdb21b359c8ee6f0251d30e94832baad07"},p),L=c({},x.reduce((function(r,e){return r[e]=M[e].v3CoreFactoryAddress}),{})),P=c({},x.reduce((function(r,e){var t=M[e].v3MigratorAddress;return t&&(r[e]=t),r}),{})),U=c({},x.reduce((function(r,e){return r[e]=M[e].multicallAddress}),{})),w=I("0x5e4be8Bc9637f0EAA1A755019e06A68ce081D58F"),q=((E={})[exports.ChainId.MAINNET]="0xC4e172459f1E7939D522503B81AFAaC1014CE6F6",E),G=((l={})[exports.ChainId.MAINNET]="0x408ED6354d4973f66138C91495F2f2FCbd8724C3",l),W=I("0x1a9C8182C09F50C8318d769245beA52c32BE35BC"),H=((h={})[exports.ChainId.MAINNET]="0x090D4613473dEE047c3f2706764f49E0821D256e",h),k=((C={})[exports.ChainId.MAINNET]="0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8",C),j=c({},x.reduce((function(r,e){return r[e]=M[e].quoterAddress}),{})),V=c({},x.reduce((function(r,e){var t=M[e].nonfungiblePositionManagerAddress;return t&&(r[e]=t),r}),{})),Y=c({},I("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e")),X=((m={})[exports.ChainId.MAINNET]="0x65770b5283117639760beA3F867b69b3697a91dd",m),Q=c({},x.reduce((function(r,e){var t=M[e].tickLensAddress;return t&&(r[e]=t),r}),{})),J=x.reduce((function(r,e){var t=M[e].v1MixedRouteQuoterAddress;return t&&(r[e]=t),r}),{});(O=exports.TradeType||(exports.TradeType={}))[O.EXACT_INPUT=0]="EXACT_INPUT",O[O.EXACT_OUTPUT=1]="EXACT_OUTPUT",(F=exports.Rounding||(exports.Rounding={}))[F.ROUND_DOWN=0]="ROUND_DOWN",F[F.ROUND_HALF_UP=1]="ROUND_HALF_UP",F[F.ROUND_UP=2]="ROUND_UP";var K,$,z=t.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Z=a(o),rr=a(i),er=((K={})[exports.Rounding.ROUND_DOWN]=Z.ROUND_DOWN,K[exports.Rounding.ROUND_HALF_UP]=Z.ROUND_HALF_UP,K[exports.Rounding.ROUND_UP]=Z.ROUND_UP,K),tr=(($={})[exports.Rounding.ROUND_DOWN]=0,$[exports.Rounding.ROUND_HALF_UP]=1,$[exports.Rounding.ROUND_UP]=3,$),nr=function(){function r(r,e){void 0===e&&(e=t.BigInt(1)),this.numerator=t.BigInt(r),this.denominator=t.BigInt(e)}r.tryParseFraction=function(e){if(e instanceof t||"number"==typeof e||"string"==typeof e)return new r(e);if("numerator"in e&&"denominator"in e)return e;throw new Error("Could not parse fraction")};var e=r.prototype;return e.invert=function(){return new r(this.denominator,this.numerator)},e.add=function(e){var n=r.tryParseFraction(e);return t.equal(this.denominator,n.denominator)?new r(t.add(this.numerator,n.numerator),this.denominator):new r(t.add(t.multiply(this.numerator,n.denominator),t.multiply(n.numerator,this.denominator)),t.multiply(this.denominator,n.denominator))},e.subtract=function(e){var n=r.tryParseFraction(e);return t.equal(this.denominator,n.denominator)?new r(t.subtract(this.numerator,n.numerator),this.denominator):new r(t.subtract(t.multiply(this.numerator,n.denominator),t.multiply(n.numerator,this.denominator)),t.multiply(this.denominator,n.denominator))},e.lessThan=function(e){var n=r.tryParseFraction(e);return t.lessThan(t.multiply(this.numerator,n.denominator),t.multiply(n.numerator,this.denominator))},e.equalTo=function(e){var n=r.tryParseFraction(e);return t.equal(t.multiply(this.numerator,n.denominator),t.multiply(n.numerator,this.denominator))},e.greaterThan=function(e){var n=r.tryParseFraction(e);return t.greaterThan(t.multiply(this.numerator,n.denominator),t.multiply(n.numerator,this.denominator))},e.multiply=function(e){var n=r.tryParseFraction(e);return new r(t.multiply(this.numerator,n.numerator),t.multiply(this.denominator,n.denominator))},e.divide=function(e){var n=r.tryParseFraction(e);return new r(t.multiply(this.numerator,n.denominator),t.multiply(this.denominator,n.numerator))},e.toSignificant=function(r,e,t){void 0===e&&(e={groupSeparator:""}),void 0===t&&(t=exports.Rounding.ROUND_HALF_UP),Number.isInteger(r)||n(!1),r>0||n(!1),Z.set({precision:r+1,rounding:er[t]});var o=new Z(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(r);return o.toFormat(o.decimalPlaces(),e)},e.toFixed=function(r,e,t){return void 0===e&&(e={groupSeparator:""}),void 0===t&&(t=exports.Rounding.ROUND_HALF_UP),Number.isInteger(r)||n(!1),r>=0||n(!1),rr.DP=r,rr.RM=tr[t],new rr(this.numerator.toString()).div(this.denominator.toString()).toFormat(r,e)},u(r,[{key:"quotient",get:function(){return t.divide(this.numerator,this.denominator)}},{key:"remainder",get:function(){return new r(t.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function(){return new r(this.numerator,this.denominator)}}]),r}(),or=a(i),ir=function(r){function e(e,o,i){var a;return a=r.call(this,o,i)||this,t.lessThanOrEqual(a.quotient,z)||n(!1),a.currency=e,a.decimalScale=t.exponentiate(t.BigInt(10),t.BigInt(e.decimals)),a}f(e,r),e.fromRawAmount=function(r,t){return new e(r,t)},e.fromFractionalAmount=function(r,t,n){return new e(r,t,n)};var o=e.prototype;return o.add=function(t){this.currency.equals(t.currency)||n(!1);var o=r.prototype.add.call(this,t);return e.fromFractionalAmount(this.currency,o.numerator,o.denominator)},o.subtract=function(t){this.currency.equals(t.currency)||n(!1);var o=r.prototype.subtract.call(this,t);return e.fromFractionalAmount(this.currency,o.numerator,o.denominator)},o.multiply=function(t){var n=r.prototype.multiply.call(this,t);return e.fromFractionalAmount(this.currency,n.numerator,n.denominator)},o.divide=function(t){var n=r.prototype.divide.call(this,t);return e.fromFractionalAmount(this.currency,n.numerator,n.denominator)},o.toSignificant=function(e,t,n){return void 0===e&&(e=6),void 0===n&&(n=exports.Rounding.ROUND_DOWN),r.prototype.divide.call(this,this.decimalScale).toSignificant(e,t,n)},o.toFixed=function(e,t,o){return void 0===e&&(e=this.currency.decimals),void 0===o&&(o=exports.Rounding.ROUND_DOWN),e<=this.currency.decimals||n(!1),r.prototype.divide.call(this,this.decimalScale).toFixed(e,t,o)},o.toExact=function(r){return void 0===r&&(r={groupSeparator:""}),or.DP=this.currency.decimals,new or(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(r)},u(e,[{key:"wrapped",get:function(){return this.currency.isToken?this:e.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}]),e}(nr),ar=new nr(t.BigInt(100));function sr(r){return new dr(r.numerator,r.denominator)}var dr=function(r){function e(){var e;return(e=r.apply(this,arguments)||this).isPercent=!0,e}f(e,r);var t=e.prototype;return t.add=function(e){return sr(r.prototype.add.call(this,e))},t.subtract=function(e){return sr(r.prototype.subtract.call(this,e))},t.multiply=function(e){return sr(r.prototype.multiply.call(this,e))},t.divide=function(e){return sr(r.prototype.divide.call(this,e))},t.toSignificant=function(e,t,n){return void 0===e&&(e=5),r.prototype.multiply.call(this,ar).toSignificant(e,t,n)},t.toFixed=function(e,t,n){return void 0===e&&(e=2),r.prototype.multiply.call(this,ar).toFixed(e,t,n)},e}(nr),ur=function(r){function e(){for(var e,n,o,i,a,s=arguments.length,d=new Array(s),u=0;u<s;u++)d[u]=arguments[u];if(4===d.length)n=d[0],o=d[1],i=d[2],a=d[3];else{var c=d[0].quoteAmount.divide(d[0].baseAmount),f=[d[0].baseAmount.currency,d[0].quoteAmount.currency,c.denominator,c.numerator];n=f[0],o=f[1],i=f[2],a=f[3]}return(e=r.call(this,a,i)||this).baseCurrency=n,e.quoteCurrency=o,e.scalar=new nr(t.exponentiate(t.BigInt(10),t.BigInt(n.decimals)),t.exponentiate(t.BigInt(10),t.BigInt(o.decimals))),e}f(e,r);var o=e.prototype;return o.invert=function(){return new e(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)},o.multiply=function(t){this.quoteCurrency.equals(t.baseCurrency)||n(!1);var o=r.prototype.multiply.call(this,t);return new e(this.baseCurrency,t.quoteCurrency,o.denominator,o.numerator)},o.quote=function(e){e.currency.equals(this.baseCurrency)||n(!1);var t=r.prototype.multiply.call(this,e);return ir.fromFractionalAmount(this.quoteCurrency,t.numerator,t.denominator)},o.toSignificant=function(r,e,t){return void 0===r&&(r=6),this.adjustedForDecimals.toSignificant(r,e,t)},o.toFixed=function(r,e,t){return void 0===r&&(r=4),this.adjustedForDecimals.toFixed(r,e,t)},u(e,[{key:"adjustedForDecimals",get:function(){return r.prototype.multiply.call(this,this.scalar)}}]),e}(nr),cr=function(r,e,t,o){Number.isSafeInteger(r)||n(!1),e>=0&&e<255&&Number.isInteger(e)||n(!1),this.chainId=r,this.decimals=e,this.symbol=t,this.name=o},fr=function(r){function e(){var e;return(e=r.apply(this,arguments)||this).isNative=!0,e.isToken=!1,e}return f(e,r),e}(cr);function Ar(r){try{return s.getAddress(r)}catch(e){throw new Error(r+" is not a valid address.")}}var pr,Er=/^0x[0-9a-fA-F]{40}$/,lr=function(r){function e(e,t,n,o,i,a){var s;return(s=r.call(this,e,n,o,i)||this).isNative=!1,s.isToken=!0,s.address=a?function(r){if(Er.test(r))return r;throw new Error(r+" is not a valid address.")}(t):Ar(t),s}f(e,r);var t=e.prototype;return t.equals=function(r){return r.isToken&&this.chainId===r.chainId&&this.address.toLowerCase()===r.address.toLowerCase()},t.sortsBefore=function(r){return this.chainId!==r.chainId&&n(!1),this.address.toLowerCase()===r.address.toLowerCase()&&n(!1),this.address.toLowerCase()<r.address.toLowerCase()},u(e,[{key:"wrapped",get:function(){return this}}]),e}(cr),hr=((pr={})[1]=new lr(1,"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",18,"WETH","Wrapped Ether"),pr[3]=new lr(3,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),pr[4]=new lr(4,"0xc778417E063141139Fce010982780140Aa0cD5Ab",18,"WETH","Wrapped Ether"),pr[5]=new lr(5,"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",18,"WETH","Wrapped Ether"),pr[42]=new lr(42,"0xd0A1E359811322d97991E03f863a0C30C2cF029C",18,"WETH","Wrapped Ether"),pr[10]=new lr(10,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),pr[69]=new lr(69,"0x4200000000000000000000000000000000000006",18,"WETH","Wrapped Ether"),pr[42161]=new lr(42161,"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",18,"WETH","Wrapped Ether"),pr[421611]=new lr(421611,"0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681",18,"WETH","Wrapped Ether"),pr),Cr=function(r){function e(e){return r.call(this,e,18,"ETH","Ether")||this}return f(e,r),e.onChain=function(r){var t;return null!=(t=this._etherCache[r])?t:this._etherCache[r]=new e(r)},e.prototype.equals=function(r){return r.isNative&&r.chainId===this.chainId},u(e,[{key:"wrapped",get:function(){var r=hr[this.chainId];return r||n(!1),r}}]),e}(fr);Cr._etherCache={};var mr=t.BigInt(Number.MAX_SAFE_INTEGER),xr=t.BigInt(0),Dr=t.BigInt(1),Ir=t.BigInt(2);exports.ARGENT_WALLET_DETECTOR_ADDRESS=k,exports.CHAIN_TO_ADDRESSES_MAP=M,exports.CurrencyAmount=ir,exports.ENS_REGISTRAR_ADDRESSES=Y,exports.Ether=Cr,exports.Fraction=nr,exports.GOVERNANCE_ALPHA_V0_ADDRESSES=w,exports.GOVERNANCE_ALPHA_V1_ADDRESSES=q,exports.GOVERNANCE_BRAVO_ADDRESSES=G,exports.MERKLE_DISTRIBUTOR_ADDRESS=H,exports.MIXED_ROUTE_QUOTER_V1_ADDRESSES=J,exports.MULTICALL_ADDRESSES=U,exports.MaxUint256=z,exports.NONFUNGIBLE_POSITION_MANAGER_ADDRESSES=V,exports.NativeCurrency=fr,exports.Percent=dr,exports.Price=ur,exports.QUOTER_ADDRESSES=j,exports.SOCKS_CONTROLLER_ADDRESSES=X,exports.SUPPORTED_CHAINS=x,exports.SWAP_ROUTER_02_ADDRESSES=function(r){return r==exports.ChainId.BNB?M[r].swapRouter02Address:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"},exports.TICK_LENS_ADDRESSES=Q,exports.TIMELOCK_ADDRESSES=W,exports.Token=lr,exports.UNISWAP_NFT_AIRDROP_CLAIM_ADDRESS="0x8B799381ac40b838BBA4131ffB26197C432AFe78",exports.UNI_ADDRESSES=R,exports.V2_FACTORY_ADDRESS="0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",exports.V2_FACTORY_ADDRESSES=b,exports.V2_ROUTER_ADDRESS="0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",exports.V2_ROUTER_ADDRESSES=y,exports.V3_CORE_FACTORY_ADDRESSES=L,exports.V3_MIGRATOR_ADDRESSES=P,exports.WETH9=hr,exports.computePriceImpact=function(r,e,t){var n=r.quote(e),o=n.subtract(t).divide(n);return new dr(o.numerator,o.denominator)},exports.sortedInsert=function(r,e,t,o){if(t>0||n(!1),r.length<=t||n(!1),0===r.length)return r.push(e),null;var i=r.length===t;if(i&&o(r[r.length-1],e)<=0)return e;for(var a=0,s=r.length;a<s;){var d=a+s>>>1;o(r[d],e)<=0?a=d+1:s=d}return r.splice(a,0,e),i?r.pop():null},exports.sqrt=function(r){if(t.greaterThanOrEqual(r,xr)||n(!1),t.lessThan(r,mr))return t.BigInt(Math.floor(Math.sqrt(t.toNumber(r))));var e,o;for(e=r,o=t.add(t.divide(r,Ir),Dr);t.lessThan(o,e);)e=o,o=t.divide(t.add(t.divide(r,o),o),Ir);return e},exports.validateAndParseAddress=Ar; | ||
//# sourceMappingURL=sdk-core.cjs.production.min.js.map |
@@ -8,36 +8,2 @@ import JSBI from 'jsbi'; | ||
var SupportedChainId; | ||
(function (SupportedChainId) { | ||
SupportedChainId[SupportedChainId["MAINNET"] = 1] = "MAINNET"; | ||
SupportedChainId[SupportedChainId["GOERLI"] = 5] = "GOERLI"; | ||
SupportedChainId[SupportedChainId["SEPOLIA"] = 11155111] = "SEPOLIA"; | ||
SupportedChainId[SupportedChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE"; | ||
SupportedChainId[SupportedChainId["ARBITRUM_GOERLI"] = 421613] = "ARBITRUM_GOERLI"; | ||
SupportedChainId[SupportedChainId["OPTIMISM"] = 10] = "OPTIMISM"; | ||
SupportedChainId[SupportedChainId["OPTIMISM_GOERLI"] = 420] = "OPTIMISM_GOERLI"; | ||
SupportedChainId[SupportedChainId["POLYGON"] = 137] = "POLYGON"; | ||
SupportedChainId[SupportedChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI"; | ||
SupportedChainId[SupportedChainId["CELO"] = 42220] = "CELO"; | ||
SupportedChainId[SupportedChainId["CELO_ALFAJORES"] = 44787] = "CELO_ALFAJORES"; | ||
SupportedChainId[SupportedChainId["BNB"] = 56] = "BNB"; | ||
})(SupportedChainId || (SupportedChainId = {})); | ||
var TradeType; | ||
(function (TradeType) { | ||
TradeType[TradeType["EXACT_INPUT"] = 0] = "EXACT_INPUT"; | ||
TradeType[TradeType["EXACT_OUTPUT"] = 1] = "EXACT_OUTPUT"; | ||
})(TradeType || (TradeType = {})); | ||
var Rounding; | ||
(function (Rounding) { | ||
Rounding[Rounding["ROUND_DOWN"] = 0] = "ROUND_DOWN"; | ||
Rounding[Rounding["ROUND_HALF_UP"] = 1] = "ROUND_HALF_UP"; | ||
Rounding[Rounding["ROUND_UP"] = 2] = "ROUND_UP"; | ||
})(Rounding || (Rounding = {})); | ||
var MaxUint256 = /*#__PURE__*/JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); | ||
function _defineProperties(target, props) { | ||
@@ -59,2 +25,20 @@ for (var i = 0; i < props.length; i++) { | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _inheritsLoose(subClass, superClass) { | ||
@@ -66,2 +50,218 @@ subClass.prototype = Object.create(superClass.prototype); | ||
var ChainId; | ||
(function (ChainId) { | ||
ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; | ||
ChainId[ChainId["GOERLI"] = 5] = "GOERLI"; | ||
ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA"; | ||
ChainId[ChainId["OPTIMISM"] = 10] = "OPTIMISM"; | ||
ChainId[ChainId["OPTIMISM_GOERLI"] = 420] = "OPTIMISM_GOERLI"; | ||
ChainId[ChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE"; | ||
ChainId[ChainId["ARBITRUM_GOERLI"] = 421613] = "ARBITRUM_GOERLI"; | ||
ChainId[ChainId["POLYGON"] = 137] = "POLYGON"; | ||
ChainId[ChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI"; | ||
ChainId[ChainId["CELO"] = 42220] = "CELO"; | ||
ChainId[ChainId["CELO_ALFAJORES"] = 44787] = "CELO_ALFAJORES"; | ||
ChainId[ChainId["GNOSIS"] = 100] = "GNOSIS"; | ||
ChainId[ChainId["MOONBEAM"] = 1284] = "MOONBEAM"; | ||
ChainId[ChainId["BNB"] = 56] = "BNB"; | ||
})(ChainId || (ChainId = {})); | ||
var SUPPORTED_CHAINS = [ChainId.MAINNET, ChainId.OPTIMISM, ChainId.OPTIMISM_GOERLI, ChainId.ARBITRUM_ONE, ChainId.ARBITRUM_GOERLI, ChainId.POLYGON, ChainId.POLYGON_MUMBAI, ChainId.GOERLI, ChainId.SEPOLIA, ChainId.CELO_ALFAJORES, ChainId.CELO, ChainId.BNB]; | ||
var NativeCurrencyName; | ||
(function (NativeCurrencyName) { | ||
// Strings match input for CLI | ||
NativeCurrencyName["ETHER"] = "ETH"; | ||
NativeCurrencyName["MATIC"] = "MATIC"; | ||
NativeCurrencyName["CELO"] = "CELO"; | ||
NativeCurrencyName["GNOSIS"] = "XDAI"; | ||
NativeCurrencyName["MOONBEAM"] = "GLMR"; | ||
NativeCurrencyName["BNB"] = "BNB"; | ||
})(NativeCurrencyName || (NativeCurrencyName = {})); | ||
var _CHAIN_TO_ADDRESSES_M, _GOVERNANCE_ALPHA_V1_, _GOVERNANCE_BRAVO_ADD, _MERKLE_DISTRIBUTOR_A, _ARGENT_WALLET_DETECT, _SOCKS_CONTROLLER_ADD; | ||
var DEFAULT_NETWORKS = [ChainId.MAINNET, ChainId.GOERLI]; | ||
function constructSameAddressMap(address, additionalNetworks) { | ||
if (additionalNetworks === void 0) { | ||
additionalNetworks = []; | ||
} | ||
return DEFAULT_NETWORKS.concat(additionalNetworks).reduce(function (memo, chainId) { | ||
memo[chainId] = address; | ||
return memo; | ||
}, {}); | ||
} | ||
var UNI_ADDRESSES = /*#__PURE__*/constructSameAddressMap('0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', [ChainId.OPTIMISM, ChainId.ARBITRUM_ONE, ChainId.POLYGON, ChainId.POLYGON_MUMBAI, ChainId.SEPOLIA]); | ||
var UNISWAP_NFT_AIRDROP_CLAIM_ADDRESS = '0x8B799381ac40b838BBA4131ffB26197C432AFe78'; | ||
var V2_FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'; | ||
var V2_FACTORY_ADDRESSES = /*#__PURE__*/constructSameAddressMap(V2_FACTORY_ADDRESS); | ||
var V2_ROUTER_ADDRESS = '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'; | ||
var V2_ROUTER_ADDRESSES = /*#__PURE__*/constructSameAddressMap(V2_ROUTER_ADDRESS); // Networks that share most of the same addresses i.e. Mainnet, Goerli, Optimism, Arbitrum, Polygon | ||
var DEFAULT_ADDRESSES = { | ||
v3CoreFactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984', | ||
multicallAddress: '0x1F98415757620B543A52E61c46B32eB19261F984', | ||
quoterAddress: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', | ||
v3MigratorAddress: '0xA5644E29708357803b5A882D272c41cC0dF92B34', | ||
nonfungiblePositionManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' | ||
}; | ||
var MAINNET_ADDRESSES = /*#__PURE__*/_extends({}, DEFAULT_ADDRESSES, { | ||
v1MixedRouteQuoterAddress: '0x84E44095eeBfEC7793Cd7d5b57B7e401D7f1cA2E' | ||
}); | ||
var GOERLI_ADDRESSES = /*#__PURE__*/_extends({}, DEFAULT_ADDRESSES, { | ||
v1MixedRouteQuoterAddress: '0xBa60b6e6fF25488308789E6e0A65D838be34194e' | ||
}); | ||
var OPTIMISM_ADDRESSES = DEFAULT_ADDRESSES; | ||
var ARBITRUM_ONE_ADDRESSES = /*#__PURE__*/_extends({}, DEFAULT_ADDRESSES, { | ||
multicallAddress: '0xadF885960B47eA2CD9B55E6DAc6B42b7Cb2806dB', | ||
tickLensAddress: '0xbfd8137f7d1516D3ea5cA83523914859ec47F573' | ||
}); | ||
var POLYGON_ADDRESSES = DEFAULT_ADDRESSES; // celo v3 addresses | ||
var CELO_ADDRESSES = { | ||
v3CoreFactoryAddress: '0xAfE208a311B21f13EF87E33A90049fC17A7acDEc', | ||
multicallAddress: '0x633987602DE5C4F337e3DbF265303A1080324204', | ||
quoterAddress: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8', | ||
v3MigratorAddress: '0x3cFd4d48EDfDCC53D3f173F596f621064614C582', | ||
nonfungiblePositionManagerAddress: '0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A', | ||
tickLensAddress: '0x5f115D9113F88e0a0Db1b5033D90D4a9690AcD3D' | ||
}; // BNB v3 addresses | ||
var BNB_ADDRESSES = { | ||
v3CoreFactoryAddress: '0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7', | ||
multicallAddress: '0x963Df249eD09c358A4819E39d9Cd5736c3087184', | ||
quoterAddress: '0x78D78E420Da98ad378D7799bE8f4AF69033EB077', | ||
v3MigratorAddress: '0x32681814957e0C13117ddc0c2aba232b5c9e760f', | ||
nonfungiblePositionManagerAddress: '0x7b8A01B39D58278b5DE7e48c8449c9f4F5170613', | ||
tickLensAddress: '0xD9270014D396281579760619CCf4c3af0501A47C', | ||
swapRouter02Address: '0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2' | ||
}; // optimism goerli addresses | ||
var OPTIMISM_GOERLI_ADDRESSES = { | ||
v3CoreFactoryAddress: '0xB656dA17129e7EB733A557f4EBc57B76CFbB5d10', | ||
multicallAddress: '0x07F2D8a2a02251B62af965f22fC4744A5f96BCCd', | ||
quoterAddress: '0x9569CbA925c8ca2248772A9A4976A516743A246F', | ||
v3MigratorAddress: '0xf6c55fBe84B1C8c3283533c53F51bC32F5C7Aba8', | ||
nonfungiblePositionManagerAddress: '0x39Ca85Af2F383190cBf7d7c41ED9202D27426EF6', | ||
tickLensAddress: '0xe6140Bd164b63E8BfCfc40D5dF952f83e171758e' | ||
}; // arbitrum goerli v3 addresses | ||
var ARBITRUM_GOERLI_ADDRESSES = { | ||
v3CoreFactoryAddress: '0x4893376342d5D7b3e31d4184c08b265e5aB2A3f6', | ||
multicallAddress: '0x8260CB40247290317a4c062F3542622367F206Ee', | ||
quoterAddress: '0x1dd92b83591781D0C6d98d07391eea4b9a6008FA', | ||
v3MigratorAddress: '0xA815919D2584Ac3F76ea9CB62E6Fd40a43BCe0C3', | ||
nonfungiblePositionManagerAddress: '0x622e4726a167799826d1E1D150b076A7725f5D81', | ||
tickLensAddress: '0xb52429333da969a0C79a60930a4Bf0020E5D1DE8' | ||
}; // sepolia v3 addresses | ||
var SEPOLIA_ADDRESSES = { | ||
v3CoreFactoryAddress: '0x0227628f3F023bb0B980b67D528571c95c6DaC1c', | ||
multicallAddress: '0xD7F33bCdb21b359c8ee6F0251d30E94832baAd07', | ||
quoterAddress: '0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3', | ||
v3MigratorAddress: '0x729004182cF005CEC8Bd85df140094b6aCbe8b15', | ||
nonfungiblePositionManagerAddress: '0x1238536071E1c677A632429e3655c799b22cDA52', | ||
tickLensAddress: '0xd7f33bcdb21b359c8ee6f0251d30e94832baad07' | ||
}; | ||
var CHAIN_TO_ADDRESSES_MAP = (_CHAIN_TO_ADDRESSES_M = {}, _CHAIN_TO_ADDRESSES_M[ChainId.MAINNET] = MAINNET_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.OPTIMISM] = OPTIMISM_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.ARBITRUM_ONE] = ARBITRUM_ONE_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.POLYGON] = POLYGON_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.POLYGON_MUMBAI] = POLYGON_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.GOERLI] = GOERLI_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.CELO] = CELO_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.CELO_ALFAJORES] = CELO_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.BNB] = BNB_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.OPTIMISM_GOERLI] = OPTIMISM_GOERLI_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.ARBITRUM_GOERLI] = ARBITRUM_GOERLI_ADDRESSES, _CHAIN_TO_ADDRESSES_M[ChainId.SEPOLIA] = SEPOLIA_ADDRESSES, _CHAIN_TO_ADDRESSES_M); | ||
/* V3 Contract Addresses */ | ||
var V3_CORE_FACTORY_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
return memo[chainId] = CHAIN_TO_ADDRESSES_MAP[chainId].v3CoreFactoryAddress; | ||
}, {})); | ||
var V3_MIGRATOR_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
var v3MigratorAddress = CHAIN_TO_ADDRESSES_MAP[chainId].v3MigratorAddress; | ||
if (v3MigratorAddress) { | ||
memo[chainId] = v3MigratorAddress; | ||
} | ||
return memo; | ||
}, {})); | ||
var MULTICALL_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
return memo[chainId] = CHAIN_TO_ADDRESSES_MAP[chainId].multicallAddress; | ||
}, {})); | ||
/** | ||
* The oldest V0 governance address | ||
*/ | ||
var GOVERNANCE_ALPHA_V0_ADDRESSES = /*#__PURE__*/constructSameAddressMap('0x5e4be8Bc9637f0EAA1A755019e06A68ce081D58F'); | ||
/** | ||
* The older V1 governance address | ||
*/ | ||
var GOVERNANCE_ALPHA_V1_ADDRESSES = (_GOVERNANCE_ALPHA_V1_ = {}, _GOVERNANCE_ALPHA_V1_[ChainId.MAINNET] = '0xC4e172459f1E7939D522503B81AFAaC1014CE6F6', _GOVERNANCE_ALPHA_V1_); | ||
/** | ||
* The latest governor bravo that is currently admin of timelock | ||
*/ | ||
var GOVERNANCE_BRAVO_ADDRESSES = (_GOVERNANCE_BRAVO_ADD = {}, _GOVERNANCE_BRAVO_ADD[ChainId.MAINNET] = '0x408ED6354d4973f66138C91495F2f2FCbd8724C3', _GOVERNANCE_BRAVO_ADD); | ||
var TIMELOCK_ADDRESSES = /*#__PURE__*/constructSameAddressMap('0x1a9C8182C09F50C8318d769245beA52c32BE35BC'); | ||
var MERKLE_DISTRIBUTOR_ADDRESS = (_MERKLE_DISTRIBUTOR_A = {}, _MERKLE_DISTRIBUTOR_A[ChainId.MAINNET] = '0x090D4613473dEE047c3f2706764f49E0821D256e', _MERKLE_DISTRIBUTOR_A); | ||
var ARGENT_WALLET_DETECTOR_ADDRESS = (_ARGENT_WALLET_DETECT = {}, _ARGENT_WALLET_DETECT[ChainId.MAINNET] = '0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8', _ARGENT_WALLET_DETECT); | ||
var QUOTER_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
return memo[chainId] = CHAIN_TO_ADDRESSES_MAP[chainId].quoterAddress; | ||
}, {})); | ||
var NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
var nonfungiblePositionManagerAddress = CHAIN_TO_ADDRESSES_MAP[chainId].nonfungiblePositionManagerAddress; | ||
if (nonfungiblePositionManagerAddress) { | ||
memo[chainId] = nonfungiblePositionManagerAddress; | ||
} | ||
return memo; | ||
}, {})); | ||
var ENS_REGISTRAR_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/constructSameAddressMap('0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e')); | ||
var SOCKS_CONTROLLER_ADDRESSES = (_SOCKS_CONTROLLER_ADD = {}, _SOCKS_CONTROLLER_ADD[ChainId.MAINNET] = '0x65770b5283117639760beA3F867b69b3697a91dd', _SOCKS_CONTROLLER_ADD); | ||
var TICK_LENS_ADDRESSES = /*#__PURE__*/_extends({}, /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
var tickLensAddress = CHAIN_TO_ADDRESSES_MAP[chainId].tickLensAddress; | ||
if (tickLensAddress) { | ||
memo[chainId] = tickLensAddress; | ||
} | ||
return memo; | ||
}, {})); | ||
var MIXED_ROUTE_QUOTER_V1_ADDRESSES = /*#__PURE__*/SUPPORTED_CHAINS.reduce(function (memo, chainId) { | ||
var v1MixedRouteQuoterAddress = CHAIN_TO_ADDRESSES_MAP[chainId].v1MixedRouteQuoterAddress; | ||
if (v1MixedRouteQuoterAddress) { | ||
memo[chainId] = v1MixedRouteQuoterAddress; | ||
} | ||
return memo; | ||
}, {}); | ||
var SWAP_ROUTER_02_ADDRESSES = function SWAP_ROUTER_02_ADDRESSES(chainId) { | ||
if (chainId == ChainId.BNB) { | ||
return CHAIN_TO_ADDRESSES_MAP[chainId].swapRouter02Address; | ||
} | ||
return '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45'; | ||
}; | ||
var TradeType; | ||
(function (TradeType) { | ||
TradeType[TradeType["EXACT_INPUT"] = 0] = "EXACT_INPUT"; | ||
TradeType[TradeType["EXACT_OUTPUT"] = 1] = "EXACT_OUTPUT"; | ||
})(TradeType || (TradeType = {})); | ||
var Rounding; | ||
(function (Rounding) { | ||
Rounding[Rounding["ROUND_DOWN"] = 0] = "ROUND_DOWN"; | ||
Rounding[Rounding["ROUND_HALF_UP"] = 1] = "ROUND_HALF_UP"; | ||
Rounding[Rounding["ROUND_UP"] = 2] = "ROUND_UP"; | ||
})(Rounding || (Rounding = {})); | ||
var MaxUint256 = /*#__PURE__*/JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); | ||
var _toSignificantRoundin, _toFixedRounding; | ||
@@ -740,3 +940,3 @@ var Decimal = /*#__PURE__*/toFormat(_Decimal); | ||
export { CurrencyAmount, Ether, Fraction, MaxUint256, NativeCurrency, Percent, Price, Rounding, SupportedChainId, Token, TradeType, WETH9, computePriceImpact, sortedInsert, sqrt, validateAndParseAddress }; | ||
export { ARGENT_WALLET_DETECTOR_ADDRESS, CHAIN_TO_ADDRESSES_MAP, ChainId, CurrencyAmount, ENS_REGISTRAR_ADDRESSES, Ether, Fraction, GOVERNANCE_ALPHA_V0_ADDRESSES, GOVERNANCE_ALPHA_V1_ADDRESSES, GOVERNANCE_BRAVO_ADDRESSES, MERKLE_DISTRIBUTOR_ADDRESS, MIXED_ROUTE_QUOTER_V1_ADDRESSES, MULTICALL_ADDRESSES, MaxUint256, NONFUNGIBLE_POSITION_MANAGER_ADDRESSES, NativeCurrency, NativeCurrencyName, Percent, Price, QUOTER_ADDRESSES, Rounding, SOCKS_CONTROLLER_ADDRESSES, SUPPORTED_CHAINS, SWAP_ROUTER_02_ADDRESSES, TICK_LENS_ADDRESSES, TIMELOCK_ADDRESSES, Token, TradeType, UNISWAP_NFT_AIRDROP_CLAIM_ADDRESS, UNI_ADDRESSES, V2_FACTORY_ADDRESS, V2_FACTORY_ADDRESSES, V2_ROUTER_ADDRESS, V2_ROUTER_ADDRESSES, V3_CORE_FACTORY_ADDRESSES, V3_MIGRATOR_ADDRESSES, WETH9, computePriceImpact, sortedInsert, sqrt, validateAndParseAddress }; | ||
//# sourceMappingURL=sdk-core.esm.js.map |
{ | ||
"name": "@uniswap/sdk-core", | ||
"license": "MIT", | ||
"version": "3.2.3", | ||
"version": "3.2.4", | ||
"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
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
282521
31
1987
1
1