From 7dac46655abdaa1b5f0fe465d0eb5629e6a199ed Mon Sep 17 00:00:00 2001 From: Misha Yakubchuk Date: Wed, 27 Nov 2024 10:56:43 +0400 Subject: [PATCH 01/30] build: prepared a working branch --- README.md | 43 ++++++++++++++++++++++++++++--------------- package.json | 7 ++++--- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 15815e32b99..8ed98d370ca 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,31 @@ -# Uniswap Interface +# Fork Uniswap Interface v3 + +The current branch is a fork of the v3.3.6 tag. + +## Development + +Node.js v16 required (Checked on v16.20.2). + +### Install Dependencies + +```bash +yarn install +``` + +### Run + +```bash +yarn start +``` + +After generating types go to `src/types/v3/index.ts` and add two lines: + +```ts +export type { UniswapV3Factory } from './UniswapV3Factory' +export type { UniswapV3Pool } from './UniswapV3Pool' +``` + +## Uniswap Interface [![Unit Tests](https://github.com/Uniswap/uniswap-interface/actions/workflows/unit-tests.yaml/badge.svg)](https://github.com/Uniswap/uniswap-interface/actions/workflows/unit-tests.yaml) [![Integration Tests](https://github.com/Uniswap/uniswap-interface/actions/workflows/integration-tests.yaml/badge.svg)](https://github.com/Uniswap/uniswap-interface/actions/workflows/integration-tests.yaml) @@ -22,20 +49,6 @@ To access the Uniswap Interface, use an IPFS gateway link from the [latest release](https://github.com/Uniswap/uniswap-interface/releases/latest), or visit [app.uniswap.org](https://app.uniswap.org). -## Development - -### Install Dependencies - -```bash -yarn install -``` - -### Run - -```bash -yarn start -``` - ## Contributions **Please open all pull requests against the `main` branch.** diff --git a/package.json b/package.json index 473be5838d9..11b6d7eef27 100644 --- a/package.json +++ b/package.json @@ -120,9 +120,10 @@ "@walletconnect/web3-provider": "1.4.2-rc.2" }, "scripts": { - "compile-contract-types": "yarn compile-external-abi-types && yarn compile-v3-contract-types", - "compile-external-abi-types": "typechain --target ethers-v5 --out-dir src/abis/types './src/abis/**/*.json'", - "compile-v3-contract-types": "typechain --target ethers-v5 --out-dir src/types/v3 './node_modules/@uniswap/?(v3-core|v3-periphery)/artifacts/contracts/**/*.json'", + "compile-contract-types": "yarn compile-external-abi-types && yarn compile-v3-core-contract-types && yarn compile-v3-periphery-contract-types", + "compile-external-abi-types": "npx typechain --target ethers-v5 --out-dir src/abis/types \"./src/abis/**/*.json\"", + "compile-v3-core-contract-types": "npx typechain --target ethers-v5 --out-dir src/types/v3 \"./node_modules/@uniswap/v3-core/artifacts/contracts/**/*.json\"", + "compile-v3-periphery-contract-types": "npx typechain --target ethers-v5 --out-dir src/types/v3 \"./node_modules/@uniswap/v3-periphery/artifacts/contracts/**/*.json\"", "build": "yarn compile-contract-types && react-scripts build", "integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run'", "postinstall": "yarn compile-contract-types", From f876d9b9d836ba117dca3f9afba0dfc589930f4d Mon Sep 17 00:00:00 2001 From: Anton Zhade Date: Tue, 3 Dec 2024 15:55:01 +0300 Subject: [PATCH 02/30] add polygon amou chain id --- src/components/Header/index.tsx | 1 + src/connectors/Fortmatic.ts | 6 +++++- src/connectors/index.ts | 23 +++++++++++++++-------- src/constants/addresses.ts | 19 +++++++++++++++++++ src/constants/governance.ts | 5 +++++ src/constants/lists.ts | 4 +++- src/constants/routing.ts | 1 + src/constants/tokens.ts | 1 + src/hooks/useERC20Permit.ts | 3 +++ src/state/lists/hooks.ts | 2 ++ src/utils/constructSameAddressMap.ts | 12 ++++++++++-- src/utils/getExplorerLink.ts | 1 + 12 files changed, 66 insertions(+), 12 deletions(-) diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index b95a86d2655..49ab72a664a 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -306,6 +306,7 @@ const NETWORK_LABELS: { [chainId in ChainId]?: string } = { [ChainId.ROPSTEN]: 'Ropsten', [ChainId.GÖRLI]: 'Görli', [ChainId.KOVAN]: 'Kovan', + [ChainId.POLYGON_AMOY]: 'Polygon Amoy', } export default function Header() { diff --git a/src/connectors/Fortmatic.ts b/src/connectors/Fortmatic.ts index 0d12d4b12ab..8cb80e52237 100644 --- a/src/connectors/Fortmatic.ts +++ b/src/connectors/Fortmatic.ts @@ -3,13 +3,17 @@ import { FortmaticConnector as FortmaticConnectorCore } from '@web3-react/fortma export const OVERLAY_READY = 'OVERLAY_READY' -type FormaticSupportedChains = Extract +type FormaticSupportedChains = Extract< + ChainId, + ChainId.MAINNET | ChainId.ROPSTEN | ChainId.RINKEBY | ChainId.KOVAN | ChainId.POLYGON_AMOY +> const CHAIN_ID_NETWORK_ARGUMENT: { readonly [chainId in FormaticSupportedChains]: string | undefined } = { [ChainId.MAINNET]: undefined, [ChainId.ROPSTEN]: 'ropsten', [ChainId.RINKEBY]: 'rinkeby', [ChainId.KOVAN]: 'kovan', + [ChainId.POLYGON_AMOY]: 'polygon', } export class FortmaticConnector extends FortmaticConnectorCore { diff --git a/src/connectors/index.ts b/src/connectors/index.ts index 686e7a55538..e706ac589fc 100644 --- a/src/connectors/index.ts +++ b/src/connectors/index.ts @@ -9,6 +9,7 @@ import getLibrary from '../utils/getLibrary' import { FortmaticConnector } from './Fortmatic' import { NetworkConnector } from './NetworkConnector' import UNISWAP_LOGO_URL from '../assets/svg/logo.svg' +import { SupportedChainId } from 'constants/addresses' const INFURA_KEY = process.env.REACT_APP_INFURA_KEY const FORMATIC_KEY = process.env.REACT_APP_FORTMATIC_KEY @@ -19,17 +20,23 @@ if (typeof INFURA_KEY === 'undefined') { throw new Error(`REACT_APP_INFURA_KEY must be a defined environment variable`) } -const NETWORK_URLS: { - [chainId in ChainId]: string -} = { +export const NETWORK_URLS: { [key in SupportedChainId]: string } = { [ChainId.MAINNET]: `https://mainnet.infura.io/v3/${INFURA_KEY}`, - [ChainId.RINKEBY]: `https://rinkeby.infura.io/v3/${INFURA_KEY}`, - [ChainId.ROPSTEN]: `https://ropsten.infura.io/v3/${INFURA_KEY}`, - [ChainId.GÖRLI]: `https://goerli.infura.io/v3/${INFURA_KEY}`, - [ChainId.KOVAN]: `https://kovan.infura.io/v3/${INFURA_KEY}`, + [SupportedChainId.RINKEBY]: `https://rinkeby.infura.io/v3/${INFURA_KEY}`, + [SupportedChainId.ROPSTEN]: `https://ropsten.infura.io/v3/${INFURA_KEY}`, + [SupportedChainId.GOERLI]: `https://goerli.infura.io/v3/${INFURA_KEY}`, + [SupportedChainId.KOVAN]: `https://kovan.infura.io/v3/${INFURA_KEY}`, + [SupportedChainId.POLYGON_AMOY]: `https://polygon-amoy.drpc.org`, } -const SUPPORTED_CHAIN_IDS = [ChainId.MAINNET, ChainId.RINKEBY, ChainId.ROPSTEN, ChainId.KOVAN, ChainId.GÖRLI] +const SUPPORTED_CHAIN_IDS = [ + ChainId.MAINNET, + ChainId.RINKEBY, + ChainId.ROPSTEN, + ChainId.KOVAN, + ChainId.GÖRLI, + ChainId.POLYGON_AMOY, +] export const network = new NetworkConnector({ urls: NETWORK_URLS, diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index da5b4fa9a1d..74013d2df0c 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -23,9 +23,28 @@ export const ENS_REGISTRAR_ADDRESSES = { [ChainId.GÖRLI]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', [ChainId.RINKEBY]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', [ChainId.ROPSTEN]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', + [ChainId.POLYGON_AMOY]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', } export const SOCKS_CONTROLLER_ADDRESSES = { [ChainId.MAINNET]: '0x65770b5283117639760beA3F867b69b3697a91dd', } export const SWAP_ROUTER_ADDRESSES = constructSameAddressMap('0xE592427A0AEce92De3Edee1F18E0157C05861564') export const V3_MIGRATOR_ADDRESSES = constructSameAddressMap('0xA5644E29708357803b5A882D272c41cC0dF92B34') + +export enum SupportedChainId { + MAINNET = 1, + ROPSTEN = 3, + RINKEBY = 4, + GOERLI = 5, + KOVAN = 42, + POLYGON_AMOY = 80002, +} + +export const SUPPORTED_CHAIN_IDS: SupportedChainId[] = [ + SupportedChainId.MAINNET, + SupportedChainId.ROPSTEN, + SupportedChainId.RINKEBY, + SupportedChainId.GOERLI, + SupportedChainId.KOVAN, + SupportedChainId.POLYGON_AMOY, +] diff --git a/src/constants/governance.ts b/src/constants/governance.ts index 1d15e9dfc54..c8b4f83c582 100644 --- a/src/constants/governance.ts +++ b/src/constants/governance.ts @@ -27,6 +27,11 @@ export const COMMON_CONTRACT_NAMES: { [chainId in ChainId]?: { [address: string] [GOVERNANCE_ADDRESS[ChainId.GÖRLI]]: 'Goerli Governance', [TIMELOCK_ADDRESS[ChainId.GÖRLI]]: 'Goerli Timelock', }, + [ChainId.POLYGON_AMOY]: { + [UNI_ADDRESS[ChainId.POLYGON_AMOY]]: 'Polygon Amoy UNI', + [GOVERNANCE_ADDRESS[ChainId.POLYGON_AMOY]]: 'Polygon Amoy Governance', + [TIMELOCK_ADDRESS[ChainId.POLYGON_AMOY]]: 'Polygon Amoy Timelock', + }, } export const DEFAULT_AVERAGE_BLOCK_TIME_IN_SECS = 13 diff --git a/src/constants/lists.ts b/src/constants/lists.ts index 823620a0cd7..5be508d72ac 100644 --- a/src/constants/lists.ts +++ b/src/constants/lists.ts @@ -14,6 +14,7 @@ const CMC_STABLECOIN = 'stablecoin.cmc.eth' const KLEROS_LIST = 't2crtokens.eth' const GEMINI_LIST = 'https://www.gemini.com/uniswap/manifest.json' const BA_LIST = 'https://raw.githubusercontent.com/The-Blockchain-Association/sec-notice-list/master/ba-sec-list.json' +const POLYGON_AMOY_LIST = 'https://api-polygon-tokens.polygon.technology/tokenlists/polygon.tokenlist.json' export const UNSUPPORTED_LIST_URLS: string[] = [BA_LIST] @@ -32,8 +33,9 @@ export const DEFAULT_LIST_OF_LISTS: string[] = [ CMC_STABLECOIN, KLEROS_LIST, GEMINI_LIST, + POLYGON_AMOY_LIST, ...UNSUPPORTED_LIST_URLS, // need to load unsupported tokens as well ] // default lists to be 'active' aka searched across -export const DEFAULT_ACTIVE_LIST_URLS: string[] = [GEMINI_LIST] +export const DEFAULT_ACTIVE_LIST_URLS: string[] = [POLYGON_AMOY_LIST, GEMINI_LIST] diff --git a/src/constants/routing.ts b/src/constants/routing.ts index 94a0c24a403..0e0000d6e7c 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -31,6 +31,7 @@ const WETH_ONLY: ChainTokenList = { [ChainId.RINKEBY]: [WETH9[ChainId.RINKEBY]], [ChainId.GÖRLI]: [WETH9[ChainId.GÖRLI]], [ChainId.KOVAN]: [WETH9[ChainId.KOVAN]], + [ChainId.POLYGON_AMOY]: [WETH9[ChainId.POLYGON_AMOY]], } // used to construct intermediary pairs for trading export const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = { diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index eafced238e8..f2b41ca439a 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -27,4 +27,5 @@ export const UNI: { [chainId in ChainId]: Token } = { [ChainId.ROPSTEN]: new Token(ChainId.ROPSTEN, UNI_ADDRESS[ChainId.ROPSTEN], 18, 'UNI', 'Uniswap'), [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, UNI_ADDRESS[ChainId.GÖRLI], 18, 'UNI', 'Uniswap'), [ChainId.KOVAN]: new Token(ChainId.KOVAN, UNI_ADDRESS[ChainId.KOVAN], 18, 'UNI', 'Uniswap'), + [ChainId.POLYGON_AMOY]: new Token(ChainId.POLYGON_AMOY, UNI_ADDRESS[ChainId.POLYGON_AMOY], 18, 'UNI', 'Uniswap'), } diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index 384add6738b..3140c293c3c 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -52,6 +52,9 @@ const PERMITTABLE_TOKENS: { [ChainId.KOVAN]: { [UNI[ChainId.KOVAN].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, }, + [ChainId.POLYGON_AMOY]: { + [UNI[ChainId.POLYGON_AMOY].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, + }, } export enum UseERC20PermitState { diff --git a/src/state/lists/hooks.ts b/src/state/lists/hooks.ts index 17173384c26..42d80553309 100644 --- a/src/state/lists/hooks.ts +++ b/src/state/lists/hooks.ts @@ -22,6 +22,7 @@ const EMPTY_LIST: TokenAddressMap = { [ChainId.ROPSTEN]: {}, [ChainId.GÖRLI]: {}, [ChainId.MAINNET]: {}, + [ChainId.POLYGON_AMOY]: {}, } const listCache: WeakMap | null = @@ -68,6 +69,7 @@ function combineMaps(map1: TokenAddressMap, map2: TokenAddressMap): TokenAddress [ChainId.ROPSTEN]: { ...map1[ChainId.ROPSTEN], ...map2[ChainId.ROPSTEN] }, [ChainId.KOVAN]: { ...map1[ChainId.KOVAN], ...map2[ChainId.KOVAN] }, [ChainId.GÖRLI]: { ...map1[ChainId.GÖRLI], ...map2[ChainId.GÖRLI] }, + [ChainId.POLYGON_AMOY]: { ...map1[ChainId.POLYGON_AMOY], ...map2[ChainId.POLYGON_AMOY] }, } } diff --git a/src/utils/constructSameAddressMap.ts b/src/utils/constructSameAddressMap.ts index b19081e62ad..7df238f5cbf 100644 --- a/src/utils/constructSameAddressMap.ts +++ b/src/utils/constructSameAddressMap.ts @@ -1,11 +1,19 @@ import { ChainId } from '@uniswap/sdk-core' -export function constructSameAddressMap(address: T): { [chainId in ChainId]: T } { +export function constructSameAddressMap( + address: T, + additionalNetworks: ChainId[] = [] +): { [chainId: number]: T } { return { [ChainId.MAINNET]: address, [ChainId.ROPSTEN]: address, - [ChainId.KOVAN]: address, [ChainId.RINKEBY]: address, [ChainId.GÖRLI]: address, + [ChainId.KOVAN]: address, + [ChainId.POLYGON_AMOY]: address, + ...additionalNetworks.reduce<{ [chainId: number]: T }>((memo, chainId) => { + memo[chainId] = address + return memo + }, {}), } } diff --git a/src/utils/getExplorerLink.ts b/src/utils/getExplorerLink.ts index afa56bb9931..08ae647feb3 100644 --- a/src/utils/getExplorerLink.ts +++ b/src/utils/getExplorerLink.ts @@ -6,6 +6,7 @@ const ETHERSCAN_PREFIXES: { [chainId in ChainId]: string } = { 4: 'rinkeby.', 5: 'goerli.', 42: 'kovan.', + 80002: 'polygon-amoy.', } export enum ExplorerDataType { From e99455098fe81c8ca5a8adcd6aefffff3605c989 Mon Sep 17 00:00:00 2001 From: Anton Zhade Date: Fri, 6 Dec 2024 09:39:15 +0300 Subject: [PATCH 03/30] move skd-core to src & replace imports --- package.json | 9 +- .../CurrencyInputPanel/FiatValue.tsx | 2 +- src/components/CurrencyInputPanel/index.tsx | 2 +- src/components/CurrencyLogo/index.tsx | 2 +- src/components/DoubleLogo/index.tsx | 2 +- .../FormattedCurrencyAmount/index.tsx | 2 +- src/components/Header/UniBalanceContent.tsx | 2 +- src/components/Header/index.tsx | 2 +- src/components/NavigationTabs/index.tsx | 2 +- src/components/Popups/ClaimPopup.tsx | 2 +- src/components/PositionCard/Sushi.tsx | 2 +- src/components/PositionCard/V2.tsx | 2 +- src/components/PositionCard/index.tsx | 2 +- src/components/PositionListItem/index.tsx | 2 +- src/components/PositionPreview/index.tsx | 2 +- src/components/RangeSelector/index.tsx | 2 +- src/components/RateToggle/index.tsx | 2 +- src/components/SearchModal/CommonBases.tsx | 2 +- src/components/SearchModal/CurrencyList.tsx | 2 +- src/components/SearchModal/CurrencySearch.tsx | 2 +- .../SearchModal/CurrencySearchModal.tsx | 2 +- src/components/SearchModal/ImportRow.tsx | 2 +- src/components/SearchModal/ImportToken.tsx | 2 +- src/components/SearchModal/Manage.tsx | 2 +- src/components/SearchModal/ManageTokens.tsx | 2 +- src/components/SearchModal/filtering.ts | 2 +- src/components/SearchModal/sorting.ts | 2 +- src/components/Settings/index.tsx | 2 +- src/components/TokenWarningModal/index.tsx | 2 +- .../TransactionConfirmationModal/index.tsx | 2 +- src/components/TransactionSettings/index.tsx | 2 +- src/components/claim/AddressClaimModal.tsx | 2 +- src/components/claim/ClaimModal.tsx | 4 +- src/components/earn/PoolCard.tsx | 2 +- src/components/earn/StakingModal.tsx | 2 +- src/components/swap/AdvancedSwapDetails.tsx | 2 +- src/components/swap/ConfirmSwapModal.tsx | 2 +- src/components/swap/FormattedPriceImpact.tsx | 2 +- src/components/swap/SwapHeader.tsx | 2 +- src/components/swap/SwapModalFooter.tsx | 2 +- src/components/swap/SwapModalHeader.tsx | 2 +- src/components/swap/SwapRoute.tsx | 2 +- src/components/swap/TradePrice.tsx | 2 +- .../swap/UnsupportedCurrencyFooter.tsx | 2 +- .../swap/confirmPriceImpactWithoutFee.ts | 2 +- src/components/vote/VoteModal.tsx | 2 +- src/connectors/Fortmatic.ts | 2 +- src/connectors/index.ts | 2 +- src/constants/addresses.ts | 2 +- src/constants/governance.ts | 2 +- src/constants/misc.ts | 2 +- src/constants/routing.ts | 2 +- src/constants/tokens.ts | 2 +- src/hooks/Tokens.ts | 2 +- src/hooks/useAddTokenToMetamask.ts | 2 +- src/hooks/useAllCurrencyCombinations.ts | 2 +- src/hooks/useAllV3Routes.ts | 2 +- src/hooks/useApproveCallback.ts | 2 +- src/hooks/useBestV3Trade.ts | 2 +- src/hooks/useColor.ts | 2 +- src/hooks/useContract.ts | 2 +- src/hooks/useERC20Permit.ts | 2 +- src/hooks/useFetchListCallback.ts | 2 +- src/hooks/useIsSwapUnsupported.ts | 2 +- src/hooks/usePools.ts | 2 +- src/hooks/useSwapCallback.ts | 2 +- src/hooks/useSwapSlippageTolerance.ts | 2 +- src/hooks/useTickToPrice.ts | 2 +- src/hooks/useTokenAllowance.ts | 2 +- src/hooks/useTotalSupply.ts | 2 +- src/hooks/useUSDCPrice.ts | 2 +- src/hooks/useV2Pairs.ts | 2 +- src/hooks/useV2Trade.ts | 2 +- src/hooks/useV3PositionFees.ts | 2 +- src/hooks/useV3SwapPools.ts | 2 +- src/hooks/useWrapCallback.ts | 2 +- src/hooks/web3.ts | 2 +- src/libs/sdk-core/.gitignore | 38 + src/libs/sdk-core/LICENSE | 21 + src/libs/sdk-core/README.md | 8 + src/libs/sdk-core/dist/constants.d.ts | 20 + .../sdk-core/dist/entities/baseCurrency.d.ts | 19 + src/libs/sdk-core/dist/entities/currency.d.ts | 3 + src/libs/sdk-core/dist/entities/ether.d.ts | 18 + .../entities/fractions/currencyAmount.d.ts | 35 + .../dist/entities/fractions/fraction.d.ts | 24 + .../dist/entities/fractions/index.d.ts | 4 + .../dist/entities/fractions/percent.d.ts | 14 + .../dist/entities/fractions/price.d.ts | 31 + src/libs/sdk-core/dist/entities/index.d.ts | 4 + src/libs/sdk-core/dist/entities/token.d.ts | 27 + src/libs/sdk-core/dist/index.d.ts | 3 + src/libs/sdk-core/dist/index.js | 8 + .../sdk-core/dist/sdk-core.cjs.development.js | 785 ++ .../dist/sdk-core.cjs.development.js.map | 1 + .../dist/sdk-core.cjs.production.min.js | 424 + .../dist/sdk-core.cjs.production.min.js.map | 1 + src/libs/sdk-core/dist/sdk-core.esm.js | 855 +++ src/libs/sdk-core/dist/sdk-core.esm.js.map | 1 + .../dist/utils/computePriceImpact.d.ts | 8 + .../sdk-core/dist/utils/currencyEquals.d.ts | 5 + src/libs/sdk-core/dist/utils/index.d.ts | 7 + .../sdk-core/dist/utils/sortedInsert.d.ts | 1 + src/libs/sdk-core/dist/utils/sqrt.d.ts | 7 + .../dist/utils/validateAndParseAddress.d.ts | 5 + .../sdk-core/dist/utils/wrappedCurrency.d.ts | 8 + .../dist/utils/wrappedCurrencyAmount.d.ts | 11 + src/libs/sdk-core/package.json | 44 + src/libs/sdk-core/yarn.lock | 6823 +++++++++++++++++ src/pages/AddLiquidity/PoolPriceBar.tsx | 2 +- src/pages/AddLiquidity/Review.tsx | 2 +- src/pages/AddLiquidity/index.tsx | 4 +- src/pages/AddLiquidity/redirects.tsx | 2 +- .../AddLiquidityV2/ConfirmAddModalBottom.tsx | 2 +- src/pages/AddLiquidityV2/PoolPriceBar.tsx | 2 +- src/pages/AddLiquidityV2/index.tsx | 2 +- src/pages/Earn/Manage.tsx | 2 +- src/pages/MigrateV2/MigrateV2Pair.tsx | 2 +- src/pages/MigrateV2/index.tsx | 2 +- src/pages/Pool/PositionPage.tsx | 2 +- src/pages/PoolFinder/index.tsx | 2 +- src/pages/RemoveLiquidity/V3.tsx | 2 +- src/pages/RemoveLiquidity/index.tsx | 2 +- src/pages/Swap/index.tsx | 2 +- src/pages/Vote/VotePage.tsx | 2 +- src/pages/Vote/index.tsx | 2 +- src/state/application/reducer.test.ts | 2 +- src/state/application/reducer.ts | 1 + src/state/burn/hooks.ts | 2 +- src/state/burn/v3/hooks.ts | 2 +- src/state/claim/hooks.ts | 2 +- src/state/governance/hooks.ts | 2 +- src/state/lists/actions.ts | 1 + src/state/lists/hooks.ts | 2 +- src/state/lists/reducer.test.ts | 1 + src/state/lists/reducer.ts | 1 + src/state/lists/updater.ts | 1 + src/state/lists/wrappedTokenInfo.ts | 2 +- src/state/mint/hooks.ts | 2 +- src/state/mint/v3/hooks.ts | 2 +- src/state/mint/v3/utils.ts | 2 +- src/state/stake/hooks.ts | 2 +- src/state/swap/hooks.ts | 2 +- src/state/transactions/actions.ts | 2 +- src/state/transactions/reducer.test.ts | 2 +- src/state/user/hooks.tsx | 2 +- src/state/wallet/hooks.ts | 2 +- src/utils/calculateSlippageAmount.test.ts | 2 +- src/utils/calculateSlippageAmount.ts | 2 +- src/utils/computeFiatValuePriceImpact.tsx | 2 +- src/utils/computeUniCirculation.test.ts | 2 +- src/utils/computeUniCirculation.ts | 2 +- src/utils/constructSameAddressMap.ts | 2 +- src/utils/currencyId.ts | 2 +- src/utils/formatTokenAmount.ts | 2 +- src/utils/getExplorerLink.test.ts | 2 +- src/utils/getExplorerLink.ts | 2 +- src/utils/getTickToPrice.ts | 2 +- src/utils/getTradeVersion.ts | 2 +- src/utils/index.ts | 2 +- src/utils/isTradeBetter.ts | 2 +- src/utils/maxAmountSpend.ts | 2 +- src/utils/prices.test.ts | 2 +- src/utils/prices.ts | 2 +- src/utils/supportedChainId.ts | 2 +- src/utils/wrappedCurrency.ts | 2 +- yarn.lock | 8 +- 167 files changed, 9409 insertions(+), 136 deletions(-) create mode 100644 src/libs/sdk-core/.gitignore create mode 100644 src/libs/sdk-core/LICENSE create mode 100644 src/libs/sdk-core/README.md create mode 100644 src/libs/sdk-core/dist/constants.d.ts create mode 100644 src/libs/sdk-core/dist/entities/baseCurrency.d.ts create mode 100644 src/libs/sdk-core/dist/entities/currency.d.ts create mode 100644 src/libs/sdk-core/dist/entities/ether.d.ts create mode 100644 src/libs/sdk-core/dist/entities/fractions/currencyAmount.d.ts create mode 100644 src/libs/sdk-core/dist/entities/fractions/fraction.d.ts create mode 100644 src/libs/sdk-core/dist/entities/fractions/index.d.ts create mode 100644 src/libs/sdk-core/dist/entities/fractions/percent.d.ts create mode 100644 src/libs/sdk-core/dist/entities/fractions/price.d.ts create mode 100644 src/libs/sdk-core/dist/entities/index.d.ts create mode 100644 src/libs/sdk-core/dist/entities/token.d.ts create mode 100644 src/libs/sdk-core/dist/index.d.ts create mode 100644 src/libs/sdk-core/dist/index.js create mode 100644 src/libs/sdk-core/dist/sdk-core.cjs.development.js create mode 100644 src/libs/sdk-core/dist/sdk-core.cjs.development.js.map create mode 100644 src/libs/sdk-core/dist/sdk-core.cjs.production.min.js create mode 100644 src/libs/sdk-core/dist/sdk-core.cjs.production.min.js.map create mode 100644 src/libs/sdk-core/dist/sdk-core.esm.js create mode 100644 src/libs/sdk-core/dist/sdk-core.esm.js.map create mode 100644 src/libs/sdk-core/dist/utils/computePriceImpact.d.ts create mode 100644 src/libs/sdk-core/dist/utils/currencyEquals.d.ts create mode 100644 src/libs/sdk-core/dist/utils/index.d.ts create mode 100644 src/libs/sdk-core/dist/utils/sortedInsert.d.ts create mode 100644 src/libs/sdk-core/dist/utils/sqrt.d.ts create mode 100644 src/libs/sdk-core/dist/utils/validateAndParseAddress.d.ts create mode 100644 src/libs/sdk-core/dist/utils/wrappedCurrency.d.ts create mode 100644 src/libs/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts create mode 100644 src/libs/sdk-core/package.json create mode 100644 src/libs/sdk-core/yarn.lock diff --git a/package.json b/package.json index 11b6d7eef27..7c80ed87fa9 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,8 @@ "workbox-strategies": "^6.1.0" }, "resolutions": { - "@walletconnect/web3-provider": "1.4.2-rc.2" + "@walletconnect/web3-provider": "1.4.2-rc.2", + "jsbi": "^3.2.5" }, "scripts": { "compile-contract-types": "yarn compile-external-abi-types && yarn compile-v3-core-contract-types && yarn compile-v3-periphery-contract-types", @@ -127,7 +128,7 @@ "build": "yarn compile-contract-types && react-scripts build", "integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run'", "postinstall": "yarn compile-contract-types", - "start": "yarn compile-contract-types && react-scripts start", + "start": "set NODE_OPTIONS=--openssl-legacy-provider && yarn compile-contract-types && react-scripts start", "storybook": "start-storybook -p 6006", "test": "react-scripts test --env=jsdom" }, @@ -150,5 +151,7 @@ ] }, "license": "GPL-3.0-or-later", - "dependencies": {} + "dependencies": { + "jsbi": "^3.1.4" + } } diff --git a/src/components/CurrencyInputPanel/FiatValue.tsx b/src/components/CurrencyInputPanel/FiatValue.tsx index e94d553400e..deb0857e9d1 100644 --- a/src/components/CurrencyInputPanel/FiatValue.tsx +++ b/src/components/CurrencyInputPanel/FiatValue.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Percent } from '../../libs/sdk-core' import React, { useMemo } from 'react' import useTheme from '../../hooks/useTheme' import { TYPE } from '../../theme' diff --git a/src/components/CurrencyInputPanel/index.tsx b/src/components/CurrencyInputPanel/index.tsx index db70a905f79..77c992f449a 100644 --- a/src/components/CurrencyInputPanel/index.tsx +++ b/src/components/CurrencyInputPanel/index.tsx @@ -1,5 +1,5 @@ import { Pair } from '@uniswap/v2-sdk' -import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Percent, Token } from '../../libs/sdk-core' import React, { useState, useCallback } from 'react' import styled from 'styled-components/macro' import { darken } from 'polished' diff --git a/src/components/CurrencyLogo/index.tsx b/src/components/CurrencyLogo/index.tsx index bc82a6bf01a..a4f138bdb85 100644 --- a/src/components/CurrencyLogo/index.tsx +++ b/src/components/CurrencyLogo/index.tsx @@ -1,4 +1,4 @@ -import { ChainId, Currency } from '@uniswap/sdk-core' +import { ChainId, Currency } from '../../libs/sdk-core' import React, { useMemo } from 'react' import styled from 'styled-components/macro' import EthereumLogo from '../../assets/images/ethereum-logo.png' diff --git a/src/components/DoubleLogo/index.tsx b/src/components/DoubleLogo/index.tsx index b8828073e49..c9688e7040c 100644 --- a/src/components/DoubleLogo/index.tsx +++ b/src/components/DoubleLogo/index.tsx @@ -1,4 +1,4 @@ -import { Currency } from '@uniswap/sdk-core' +import { Currency } from '../../libs/sdk-core' import React from 'react' import styled from 'styled-components/macro' import CurrencyLogo from '../CurrencyLogo' diff --git a/src/components/FormattedCurrencyAmount/index.tsx b/src/components/FormattedCurrencyAmount/index.tsx index 5421ad22ebc..3829ce74a7c 100644 --- a/src/components/FormattedCurrencyAmount/index.tsx +++ b/src/components/FormattedCurrencyAmount/index.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React from 'react' -import { Currency, CurrencyAmount, Fraction } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Fraction } from '../../libs/sdk-core' const CURRENCY_AMOUNT_MIN = new Fraction(JSBI.BigInt(1), JSBI.BigInt(1000000)) diff --git a/src/components/Header/UniBalanceContent.tsx b/src/components/Header/UniBalanceContent.tsx index deed875fa9f..7e8a483fc28 100644 --- a/src/components/Header/UniBalanceContent.tsx +++ b/src/components/Header/UniBalanceContent.tsx @@ -1,4 +1,4 @@ -import { ChainId, CurrencyAmount, Token } from '@uniswap/sdk-core' +import { ChainId, CurrencyAmount, Token } from '../../libs/sdk-core' import React, { useMemo } from 'react' import { X } from 'react-feather' import styled from 'styled-components/macro' diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 49ab72a664a..6755f205766 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../../libs/sdk-core' import useScrollPosition from '@react-hook/window-scroll' import React, { useState } from 'react' import { Text } from 'rebass' diff --git a/src/components/NavigationTabs/index.tsx b/src/components/NavigationTabs/index.tsx index d6acc5c3d42..adf5bf4ba00 100644 --- a/src/components/NavigationTabs/index.tsx +++ b/src/components/NavigationTabs/index.tsx @@ -3,7 +3,7 @@ import styled from 'styled-components/macro' import { darken } from 'polished' import { useTranslation } from 'react-i18next' import { NavLink, Link as HistoryLink } from 'react-router-dom' -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '../../libs/sdk-core' import { ArrowLeft } from 'react-feather' import { RowBetween } from '../Row' diff --git a/src/components/Popups/ClaimPopup.tsx b/src/components/Popups/ClaimPopup.tsx index f1ca2b0edc9..5925d7680ac 100644 --- a/src/components/Popups/ClaimPopup.tsx +++ b/src/components/Popups/ClaimPopup.tsx @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '../../libs/sdk-core' import React, { useEffect } from 'react' import { X } from 'react-feather' import styled, { keyframes } from 'styled-components' diff --git a/src/components/PositionCard/Sushi.tsx b/src/components/PositionCard/Sushi.tsx index f6619403a1a..ec5a2d010f0 100644 --- a/src/components/PositionCard/Sushi.tsx +++ b/src/components/PositionCard/Sushi.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Token } from '@uniswap/sdk-core' +import { Token } from '../../libs/sdk-core' import { Link } from 'react-router-dom' import { Text } from 'rebass' import styled from 'styled-components/macro' diff --git a/src/components/PositionCard/V2.tsx b/src/components/PositionCard/V2.tsx index 233022e17f2..3bae33a4055 100644 --- a/src/components/PositionCard/V2.tsx +++ b/src/components/PositionCard/V2.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React, { useState } from 'react' -import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core' +import { Percent, CurrencyAmount, Token } from '../../libs/sdk-core' import { Pair } from '@uniswap/v2-sdk' import { ChevronDown, ChevronUp } from 'react-feather' import { Link } from 'react-router-dom' diff --git a/src/components/PositionCard/index.tsx b/src/components/PositionCard/index.tsx index ee7de8d4348..04148a25fde 100644 --- a/src/components/PositionCard/index.tsx +++ b/src/components/PositionCard/index.tsx @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core' +import { Percent, CurrencyAmount, Token } from '../../libs/sdk-core' import { Pair } from '@uniswap/v2-sdk' import { darken } from 'polished' import React, { useState } from 'react' diff --git a/src/components/PositionListItem/index.tsx b/src/components/PositionListItem/index.tsx index cdcb6964668..638b9fd583b 100644 --- a/src/components/PositionListItem/index.tsx +++ b/src/components/PositionListItem/index.tsx @@ -8,7 +8,7 @@ import { Link } from 'react-router-dom' import styled from 'styled-components/macro' import { HideSmall, MEDIA_WIDTHS, SmallOnly } from 'theme' import { PositionDetails } from 'types/position' -import { WETH9, Price, Token, Percent } from '@uniswap/sdk-core' +import { WETH9, Price, Token, Percent } from '../../libs/sdk-core' import { formatPrice } from 'utils/formatTokenAmount' import Loader from 'components/Loader' import { unwrappedToken } from 'utils/wrappedCurrency' diff --git a/src/components/PositionPreview/index.tsx b/src/components/PositionPreview/index.tsx index 839fee08cf8..6648d8a4619 100644 --- a/src/components/PositionPreview/index.tsx +++ b/src/components/PositionPreview/index.tsx @@ -8,7 +8,7 @@ import CurrencyLogo from 'components/CurrencyLogo' import { unwrappedToken } from 'utils/wrappedCurrency' import { Break } from 'components/earn/styled' import { useTranslation } from 'react-i18next' -import { Currency } from '@uniswap/sdk-core' +import { Currency } from '../../libs/sdk-core' import RateToggle from 'components/RateToggle' import DoubleCurrencyLogo from 'components/DoubleLogo' import RangeBadge from 'components/Badge/RangeBadge' diff --git a/src/components/RangeSelector/index.tsx b/src/components/RangeSelector/index.tsx index ad153cb16a6..23e8e7f9bb4 100644 --- a/src/components/RangeSelector/index.tsx +++ b/src/components/RangeSelector/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Currency, Price, Token } from '@uniswap/sdk-core' +import { Currency, Price, Token } from '../../libs/sdk-core' import StepCounter from 'components/InputStepCounter/InputStepCounter' import { RowBetween } from 'components/Row' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/components/RateToggle/index.tsx b/src/components/RateToggle/index.tsx index 30d68b7266c..39b5005d828 100644 --- a/src/components/RateToggle/index.tsx +++ b/src/components/RateToggle/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Currency } from '@uniswap/sdk-core' +import { Currency } from '../../libs/sdk-core' import { ToggleElement, ToggleWrapper } from 'components/Toggle/MultiToggle' import { useActiveWeb3React } from 'hooks/web3' import { wrappedCurrency } from 'utils/wrappedCurrency' diff --git a/src/components/SearchModal/CommonBases.tsx b/src/components/SearchModal/CommonBases.tsx index b503103ace3..8f829bae231 100644 --- a/src/components/SearchModal/CommonBases.tsx +++ b/src/components/SearchModal/CommonBases.tsx @@ -1,6 +1,6 @@ import React from 'react' import { Text } from 'rebass' -import { ChainId, Currency, currencyEquals, Token, ETHER } from '@uniswap/sdk-core' +import { ChainId, Currency, currencyEquals, Token, ETHER } from '../../libs/sdk-core' import styled from 'styled-components/macro' import { SUGGESTED_BASES } from '../../constants/routing' diff --git a/src/components/SearchModal/CurrencyList.tsx b/src/components/SearchModal/CurrencyList.tsx index ffc10f0363f..a4719a43d51 100644 --- a/src/components/SearchModal/CurrencyList.tsx +++ b/src/components/SearchModal/CurrencyList.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, currencyEquals, Token } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, currencyEquals, Token } from '../../libs/sdk-core' import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react' import { FixedSizeList } from 'react-window' import { Text } from 'rebass' diff --git a/src/components/SearchModal/CurrencySearch.tsx b/src/components/SearchModal/CurrencySearch.tsx index b5726279415..804339631e5 100644 --- a/src/components/SearchModal/CurrencySearch.tsx +++ b/src/components/SearchModal/CurrencySearch.tsx @@ -1,4 +1,4 @@ -import { Currency, ETHER, Token } from '@uniswap/sdk-core' +import { Currency, ETHER, Token } from '../../libs/sdk-core' import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react' import ReactGA from 'react-ga' import { useTranslation } from 'react-i18next' diff --git a/src/components/SearchModal/CurrencySearchModal.tsx b/src/components/SearchModal/CurrencySearchModal.tsx index b2ca00b7139..cb5dd4edfe0 100644 --- a/src/components/SearchModal/CurrencySearchModal.tsx +++ b/src/components/SearchModal/CurrencySearchModal.tsx @@ -1,4 +1,4 @@ -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '../../libs/sdk-core' import React, { useCallback, useEffect, useState } from 'react' import useLast from '../../hooks/useLast' import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo' diff --git a/src/components/SearchModal/ImportRow.tsx b/src/components/SearchModal/ImportRow.tsx index b9abcde89d1..4644a0a97b1 100644 --- a/src/components/SearchModal/ImportRow.tsx +++ b/src/components/SearchModal/ImportRow.tsx @@ -1,5 +1,5 @@ import React, { CSSProperties } from 'react' -import { Token } from '@uniswap/sdk-core' +import { Token } from '../../libs/sdk-core' import { AutoRow, RowFixed } from 'components/Row' import { AutoColumn } from 'components/Column' import CurrencyLogo from 'components/CurrencyLogo' diff --git a/src/components/SearchModal/ImportToken.tsx b/src/components/SearchModal/ImportToken.tsx index 410a92e4fc7..9f0a31ad887 100644 --- a/src/components/SearchModal/ImportToken.tsx +++ b/src/components/SearchModal/ImportToken.tsx @@ -1,6 +1,6 @@ import { TokenList } from '@uniswap/token-lists/dist/types' import React from 'react' -import { Token, Currency } from '@uniswap/sdk-core' +import { Token, Currency } from '../../libs/sdk-core' import styled from 'styled-components/macro' import { TYPE, CloseIcon } from 'theme' import Card from 'components/Card' diff --git a/src/components/SearchModal/Manage.tsx b/src/components/SearchModal/Manage.tsx index aeeb4211332..9a33745e39f 100644 --- a/src/components/SearchModal/Manage.tsx +++ b/src/components/SearchModal/Manage.tsx @@ -5,7 +5,7 @@ import { ArrowLeft } from 'react-feather' import { Text } from 'rebass' import { CloseIcon } from 'theme' import styled from 'styled-components/macro' -import { Token } from '@uniswap/sdk-core' +import { Token } from '../../libs/sdk-core' import { ManageLists } from './ManageLists' import ManageTokens from './ManageTokens' import { TokenList } from '@uniswap/token-lists' diff --git a/src/components/SearchModal/ManageTokens.tsx b/src/components/SearchModal/ManageTokens.tsx index b3aa934fd62..04cbb403dd7 100644 --- a/src/components/SearchModal/ManageTokens.tsx +++ b/src/components/SearchModal/ManageTokens.tsx @@ -7,7 +7,7 @@ import { TYPE, ExternalLinkIcon, TrashIcon, ButtonText, ExternalLink } from 'the import { useToken } from 'hooks/Tokens' import styled from 'styled-components/macro' import { useUserAddedTokens, useRemoveUserAddedToken } from 'state/user/hooks' -import { Token } from '@uniswap/sdk-core' +import { Token } from '../../libs/sdk-core' import CurrencyLogo from 'components/CurrencyLogo' import { isAddress } from 'utils' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/components/SearchModal/filtering.ts b/src/components/SearchModal/filtering.ts index 23dfa2cf554..260a921d5ee 100644 --- a/src/components/SearchModal/filtering.ts +++ b/src/components/SearchModal/filtering.ts @@ -1,7 +1,7 @@ import { TokenInfo } from '@uniswap/token-lists' import { useMemo } from 'react' import { isAddress } from '../../utils' -import { Token } from '@uniswap/sdk-core' +import { Token } from '../../libs/sdk-core' const alwaysTrue = () => true diff --git a/src/components/SearchModal/sorting.ts b/src/components/SearchModal/sorting.ts index 2b270748800..0dd9c936d2f 100644 --- a/src/components/SearchModal/sorting.ts +++ b/src/components/SearchModal/sorting.ts @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount, Currency } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, Currency } from '../../libs/sdk-core' import { useMemo } from 'react' import { useAllTokenBalances } from '../../state/wallet/hooks' diff --git a/src/components/Settings/index.tsx b/src/components/Settings/index.tsx index 8b8b9f77aa2..2a1066fbdf6 100644 --- a/src/components/Settings/index.tsx +++ b/src/components/Settings/index.tsx @@ -15,7 +15,7 @@ import QuestionHelper from '../QuestionHelper' import { RowBetween, RowFixed } from '../Row' import Toggle from '../Toggle' import TransactionSettings from '../TransactionSettings' -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '../../libs/sdk-core' const StyledMenuIcon = styled(Settings)` height: 20px; diff --git a/src/components/TokenWarningModal/index.tsx b/src/components/TokenWarningModal/index.tsx index 8f21614098b..a08f7b4a163 100644 --- a/src/components/TokenWarningModal/index.tsx +++ b/src/components/TokenWarningModal/index.tsx @@ -1,4 +1,4 @@ -import { Token } from '@uniswap/sdk-core' +import { Token } from '../../libs/sdk-core' import React from 'react' import Modal from '../Modal' import { ImportToken } from 'components/SearchModal/ImportToken' diff --git a/src/components/TransactionConfirmationModal/index.tsx b/src/components/TransactionConfirmationModal/index.tsx index 5519a77b175..7a77a399154 100644 --- a/src/components/TransactionConfirmationModal/index.tsx +++ b/src/components/TransactionConfirmationModal/index.tsx @@ -1,4 +1,4 @@ -import { ChainId, Currency } from '@uniswap/sdk-core' +import { ChainId, Currency } from '../../libs/sdk-core' import React, { useContext } from 'react' import styled, { ThemeContext } from 'styled-components' import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink' diff --git a/src/components/TransactionSettings/index.tsx b/src/components/TransactionSettings/index.tsx index d55c0023605..121fcddd458 100644 --- a/src/components/TransactionSettings/index.tsx +++ b/src/components/TransactionSettings/index.tsx @@ -1,5 +1,5 @@ import React, { useState, useContext } from 'react' -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '../../libs/sdk-core' import styled, { ThemeContext } from 'styled-components' import QuestionHelper from '../QuestionHelper' diff --git a/src/components/claim/AddressClaimModal.tsx b/src/components/claim/AddressClaimModal.tsx index 4ea9dc1c507..c9f8ef4439b 100644 --- a/src/components/claim/AddressClaimModal.tsx +++ b/src/components/claim/AddressClaimModal.tsx @@ -18,7 +18,7 @@ import { isAddress } from 'ethers/lib/utils' import Confetti from '../Confetti' import { CardNoise, CardBGImage, CardBGImageSmaller } from '../earn/styled' import { useIsTransactionPending } from '../../state/transactions/hooks' -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '../../libs/sdk-core' import { shortenAddress } from '../../utils' const ContentWrapper = styled(AutoColumn)` diff --git a/src/components/claim/ClaimModal.tsx b/src/components/claim/ClaimModal.tsx index 5fbc2edc71e..9b07a117b74 100644 --- a/src/components/claim/ClaimModal.tsx +++ b/src/components/claim/ClaimModal.tsx @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '../../libs/sdk-core' import { isAddress } from 'ethers/lib/utils' import React, { useEffect, useState } from 'react' import { Text } from 'rebass' @@ -116,11 +116,13 @@ export default function ClaimModal() { )} {userClaimData?.flags?.isLP && unclaimedAmount && + // @ts-ignore JSBI.greaterThanOrEqual(unclaimedAmount.quotient, nonLPAmount) && ( Liquidity {unclaimedAmount + // @ts-ignore .subtract(CurrencyAmount.fromRawAmount(unclaimedAmount.currency, nonLPAmount)) .toFixed(0, { groupSeparator: ',' })}{' '} UNI diff --git a/src/components/earn/PoolCard.tsx b/src/components/earn/PoolCard.tsx index 9ee6c1173e7..4abb1e9213b 100644 --- a/src/components/earn/PoolCard.tsx +++ b/src/components/earn/PoolCard.tsx @@ -4,7 +4,7 @@ import { RowBetween } from '../Row' import styled from 'styled-components/macro' import { TYPE, StyledInternalLink } from '../../theme' import DoubleCurrencyLogo from '../DoubleLogo' -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '../../libs/sdk-core' import JSBI from 'jsbi' import { ButtonPrimary } from '../Button' import { StakingInfo } from '../../state/stake/hooks' diff --git a/src/components/earn/StakingModal.tsx b/src/components/earn/StakingModal.tsx index cfe206669be..ac173c47971 100644 --- a/src/components/earn/StakingModal.tsx +++ b/src/components/earn/StakingModal.tsx @@ -11,7 +11,7 @@ import { ButtonConfirmed, ButtonError } from '../Button' import ProgressCircles from '../ProgressSteps' import CurrencyInputPanel from '../CurrencyInputPanel' import { Pair } from '@uniswap/v2-sdk' -import { Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, CurrencyAmount } from '../../libs/sdk-core' import { useActiveWeb3React } from '../../hooks/web3' import { maxAmountSpend } from '../../utils/maxAmountSpend' import { usePairContract, useStakingContract } from '../../hooks/useContract' diff --git a/src/components/swap/AdvancedSwapDetails.tsx b/src/components/swap/AdvancedSwapDetails.tsx index c9c1471c03c..c4bed309e06 100644 --- a/src/components/swap/AdvancedSwapDetails.tsx +++ b/src/components/swap/AdvancedSwapDetails.tsx @@ -1,4 +1,4 @@ -import { Percent, Currency, TradeType } from '@uniswap/sdk-core' +import { Percent, Currency, TradeType } from '../../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import React, { useContext, useMemo } from 'react' diff --git a/src/components/swap/ConfirmSwapModal.tsx b/src/components/swap/ConfirmSwapModal.tsx index 97161a6a6ab..9087227babb 100644 --- a/src/components/swap/ConfirmSwapModal.tsx +++ b/src/components/swap/ConfirmSwapModal.tsx @@ -1,4 +1,4 @@ -import { Currency, currencyEquals, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, currencyEquals, Percent, TradeType } from '../../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import React, { useCallback, useMemo } from 'react' diff --git a/src/components/swap/FormattedPriceImpact.tsx b/src/components/swap/FormattedPriceImpact.tsx index 5f1e1621431..d33f7742897 100644 --- a/src/components/swap/FormattedPriceImpact.tsx +++ b/src/components/swap/FormattedPriceImpact.tsx @@ -1,4 +1,4 @@ -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '../../libs/sdk-core' import React from 'react' import { warningSeverity } from '../../utils/prices' import { ErrorText, ErrorPill } from './styleds' diff --git a/src/components/swap/SwapHeader.tsx b/src/components/swap/SwapHeader.tsx index 6d3d9329a92..6033af8088b 100644 --- a/src/components/swap/SwapHeader.tsx +++ b/src/components/swap/SwapHeader.tsx @@ -1,7 +1,7 @@ import React from 'react' import styled from 'styled-components/macro' import SettingsTab from '../Settings' -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '../../libs/sdk-core' import { RowBetween, RowFixed } from '../Row' import { TYPE } from '../../theme' diff --git a/src/components/swap/SwapModalFooter.tsx b/src/components/swap/SwapModalFooter.tsx index 9617a2b0591..4a22ae04b6e 100644 --- a/src/components/swap/SwapModalFooter.tsx +++ b/src/components/swap/SwapModalFooter.tsx @@ -1,4 +1,4 @@ -import { Currency, TradeType } from '@uniswap/sdk-core' +import { Currency, TradeType } from '../../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' diff --git a/src/components/swap/SwapModalHeader.tsx b/src/components/swap/SwapModalHeader.tsx index 5a8eabcb54c..4ced7d6bd77 100644 --- a/src/components/swap/SwapModalHeader.tsx +++ b/src/components/swap/SwapModalHeader.tsx @@ -1,4 +1,4 @@ -import { Currency, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, Percent, TradeType } from '../../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import React, { useContext, useState } from 'react' diff --git a/src/components/swap/SwapRoute.tsx b/src/components/swap/SwapRoute.tsx index 569f64b3271..4fb771a1169 100644 --- a/src/components/swap/SwapRoute.tsx +++ b/src/components/swap/SwapRoute.tsx @@ -1,4 +1,4 @@ -import { Currency, TradeType } from '@uniswap/sdk-core' +import { Currency, TradeType } from '../../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade, FeeAmount } from '@uniswap/v3-sdk' import React, { Fragment, memo, useContext } from 'react' diff --git a/src/components/swap/TradePrice.tsx b/src/components/swap/TradePrice.tsx index d8843cf9e04..d900789b19a 100644 --- a/src/components/swap/TradePrice.tsx +++ b/src/components/swap/TradePrice.tsx @@ -1,5 +1,5 @@ import React, { useCallback } from 'react' -import { Price, Currency } from '@uniswap/sdk-core' +import { Price, Currency } from '../../libs/sdk-core' import { useContext } from 'react' import { Text } from 'rebass' import styled, { ThemeContext } from 'styled-components' diff --git a/src/components/swap/UnsupportedCurrencyFooter.tsx b/src/components/swap/UnsupportedCurrencyFooter.tsx index c8ca3ffe350..3681de12b03 100644 --- a/src/components/swap/UnsupportedCurrencyFooter.tsx +++ b/src/components/swap/UnsupportedCurrencyFooter.tsx @@ -8,7 +8,7 @@ import { RowBetween, AutoRow } from 'components/Row' import { AutoColumn } from 'components/Column' import CurrencyLogo from 'components/CurrencyLogo' import { useActiveWeb3React } from 'hooks/web3' -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '../../libs/sdk-core' import { wrappedCurrency } from 'utils/wrappedCurrency' import { useUnsupportedTokens } from '../../hooks/Tokens' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' diff --git a/src/components/swap/confirmPriceImpactWithoutFee.ts b/src/components/swap/confirmPriceImpactWithoutFee.ts index 392768bc8e4..fcc39412525 100644 --- a/src/components/swap/confirmPriceImpactWithoutFee.ts +++ b/src/components/swap/confirmPriceImpactWithoutFee.ts @@ -1,4 +1,4 @@ -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '../../libs/sdk-core' import { ALLOWED_PRICE_IMPACT_HIGH, PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN } from '../../constants/misc' /** diff --git a/src/components/vote/VoteModal.tsx b/src/components/vote/VoteModal.tsx index 93adefaa7ac..0c013ac5909 100644 --- a/src/components/vote/VoteModal.tsx +++ b/src/components/vote/VoteModal.tsx @@ -13,7 +13,7 @@ import Circle from '../../assets/images/blue-loader.svg' import { useVoteCallback, useUserVotes } from '../../state/governance/hooks' import { ExternalLink } from '../../theme/components' import { formatTokenAmount } from 'utils/formatTokenAmount' -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '../../libs/sdk-core' const ContentWrapper = styled(AutoColumn)` width: 100%; diff --git a/src/connectors/Fortmatic.ts b/src/connectors/Fortmatic.ts index 8cb80e52237..1e8627fd81c 100644 --- a/src/connectors/Fortmatic.ts +++ b/src/connectors/Fortmatic.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' import { FortmaticConnector as FortmaticConnectorCore } from '@web3-react/fortmatic-connector' export const OVERLAY_READY = 'OVERLAY_READY' diff --git a/src/connectors/index.ts b/src/connectors/index.ts index e706ac589fc..74fc3e9c259 100644 --- a/src/connectors/index.ts +++ b/src/connectors/index.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' import { Web3Provider } from '@ethersproject/providers' import { InjectedConnector } from '@web3-react/injected-connector' import { WalletConnectConnector } from '@web3-react/walletconnect-connector' diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 74013d2df0c..44eb0b9ce97 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' import { FACTORY_ADDRESS as V3_FACTORY_ADDRESS } from '@uniswap/v3-sdk' import { constructSameAddressMap } from '../utils/constructSameAddressMap' diff --git a/src/constants/governance.ts b/src/constants/governance.ts index c8b4f83c582..20a444916cf 100644 --- a/src/constants/governance.ts +++ b/src/constants/governance.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' import { GOVERNANCE_ADDRESS, TIMELOCK_ADDRESS, UNI_ADDRESS } from './addresses' export const COMMON_CONTRACT_NAMES: { [chainId in ChainId]?: { [address: string]: string } } = { diff --git a/src/constants/misc.ts b/src/constants/misc.ts index 2ede179ffd9..2b8df2202ec 100644 --- a/src/constants/misc.ts +++ b/src/constants/misc.ts @@ -1,4 +1,4 @@ -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '../libs/sdk-core' import JSBI from 'jsbi' export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' diff --git a/src/constants/routing.ts b/src/constants/routing.ts index 0e0000d6e7c..d0ec1f09f04 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -1,5 +1,5 @@ // a list of tokens by chain -import { ChainId, Token, WETH9 } from '@uniswap/sdk-core' +import { ChainId, Token, WETH9 } from '../libs/sdk-core' import { AMPL, DAI, FEI, FRAX, FXS, MIR, renBTC, TRIBE, UMA, UNI, USDC, USDT, UST, WBTC } from './tokens' type ChainTokenList = { diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index f2b41ca439a..f6f43b3f03f 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -1,4 +1,4 @@ -import { ChainId, Token } from '@uniswap/sdk-core' +import { ChainId, Token } from '../libs/sdk-core' import { UNI_ADDRESS } from './addresses' export const AMPL = new Token(ChainId.MAINNET, '0xD46bA6D942050d489DBd938a2C909A5d5039A161', 9, 'AMPL', 'Ampleforth') diff --git a/src/hooks/Tokens.ts b/src/hooks/Tokens.ts index 1f9343d7cff..49c0414367d 100644 --- a/src/hooks/Tokens.ts +++ b/src/hooks/Tokens.ts @@ -1,5 +1,5 @@ import { parseBytes32String } from '@ethersproject/strings' -import { Currency, currencyEquals, ETHER, Token } from '@uniswap/sdk-core' +import { Currency, currencyEquals, ETHER, Token } from '../libs/sdk-core' import { arrayify } from 'ethers/lib/utils' import { useMemo } from 'react' import { createTokenFilterFunction } from '../components/SearchModal/filtering' diff --git a/src/hooks/useAddTokenToMetamask.ts b/src/hooks/useAddTokenToMetamask.ts index 3b5b12ae92b..24d80229735 100644 --- a/src/hooks/useAddTokenToMetamask.ts +++ b/src/hooks/useAddTokenToMetamask.ts @@ -1,6 +1,6 @@ import { getTokenLogoURL } from './../components/CurrencyLogo/index' import { wrappedCurrency } from 'utils/wrappedCurrency' -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '../libs/sdk-core' import { useCallback, useState } from 'react' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/hooks/useAllCurrencyCombinations.ts b/src/hooks/useAllCurrencyCombinations.ts index 7a209a7370a..58476420628 100644 --- a/src/hooks/useAllCurrencyCombinations.ts +++ b/src/hooks/useAllCurrencyCombinations.ts @@ -1,4 +1,4 @@ -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '../libs/sdk-core' import flatMap from 'lodash.flatmap' import { useMemo } from 'react' import { ADDITIONAL_BASES, BASES_TO_CHECK_TRADES_AGAINST, CUSTOM_BASES } from '../constants/routing' diff --git a/src/hooks/useAllV3Routes.ts b/src/hooks/useAllV3Routes.ts index fec692e0ae4..d5fb2a21e97 100644 --- a/src/hooks/useAllV3Routes.ts +++ b/src/hooks/useAllV3Routes.ts @@ -1,4 +1,4 @@ -import { ChainId, Currency } from '@uniswap/sdk-core' +import { ChainId, Currency } from '../libs/sdk-core' import { Pool, Route } from '@uniswap/v3-sdk' import { useMemo } from 'react' import { useUserSingleHopOnly } from '../state/user/hooks' diff --git a/src/hooks/useApproveCallback.ts b/src/hooks/useApproveCallback.ts index c2c2656cd16..324d65e76bd 100644 --- a/src/hooks/useApproveCallback.ts +++ b/src/hooks/useApproveCallback.ts @@ -1,6 +1,6 @@ import { MaxUint256 } from '@ethersproject/constants' import { TransactionResponse } from '@ethersproject/providers' -import { CurrencyAmount, ChainId, Percent, Currency, TradeType } from '@uniswap/sdk-core' +import { CurrencyAmount, ChainId, Percent, Currency, TradeType } from '../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { useCallback, useMemo } from 'react' diff --git a/src/hooks/useBestV3Trade.ts b/src/hooks/useBestV3Trade.ts index e1f7283dada..a598910f0fe 100644 --- a/src/hooks/useBestV3Trade.ts +++ b/src/hooks/useBestV3Trade.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, TradeType } from '../libs/sdk-core' import { encodeRouteToPath, Route, Trade } from '@uniswap/v3-sdk' import { BigNumber } from 'ethers' import { useMemo } from 'react' diff --git a/src/hooks/useColor.ts b/src/hooks/useColor.ts index 5d1575435f0..a299ba17323 100644 --- a/src/hooks/useColor.ts +++ b/src/hooks/useColor.ts @@ -2,7 +2,7 @@ import { useState, useLayoutEffect } from 'react' import { shade } from 'polished' import Vibrant from 'node-vibrant' import { hex } from 'wcag-contrast' -import { Token, ChainId } from '@uniswap/sdk-core' +import { Token, ChainId } from '../libs/sdk-core' import uriToHttp from 'utils/uriToHttp' async function getColorFromToken(token: Token): Promise { diff --git a/src/hooks/useContract.ts b/src/hooks/useContract.ts index 1e0a836c4af..9ce3a1d8887 100644 --- a/src/hooks/useContract.ts +++ b/src/hooks/useContract.ts @@ -1,5 +1,5 @@ import { Contract } from '@ethersproject/contracts' -import { ChainId, WETH9 } from '@uniswap/sdk-core' +import { ChainId, WETH9 } from '../libs/sdk-core' import { abi as GOVERNANCE_ABI } from '@uniswap/governance/build/GovernorAlpha.json' import { abi as UNI_ABI } from '@uniswap/governance/build/Uni.json' import { abi as STAKING_REWARDS_ABI } from '@uniswap/liquidity-staker/build/StakingRewards.json' diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index 3140c293c3c..48bb47a2875 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { ChainId, Percent, CurrencyAmount, Currency, TradeType, Token } from '@uniswap/sdk-core' +import { ChainId, Percent, CurrencyAmount, Currency, TradeType, Token } from '../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { splitSignature } from 'ethers/lib/utils' diff --git a/src/hooks/useFetchListCallback.ts b/src/hooks/useFetchListCallback.ts index 1a4a8ec3d48..2ed26f535bb 100644 --- a/src/hooks/useFetchListCallback.ts +++ b/src/hooks/useFetchListCallback.ts @@ -1,5 +1,5 @@ import { nanoid } from '@reduxjs/toolkit' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' import { TokenList } from '@uniswap/token-lists' import { useCallback } from 'react' import { useDispatch } from 'react-redux' diff --git a/src/hooks/useIsSwapUnsupported.ts b/src/hooks/useIsSwapUnsupported.ts index 739e971a516..82b66866a49 100644 --- a/src/hooks/useIsSwapUnsupported.ts +++ b/src/hooks/useIsSwapUnsupported.ts @@ -1,4 +1,4 @@ -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '../libs/sdk-core' import { useMemo } from 'react' import { useUnsupportedTokens } from './Tokens' diff --git a/src/hooks/usePools.ts b/src/hooks/usePools.ts index 560f9e28b7e..db7c965c349 100644 --- a/src/hooks/usePools.ts +++ b/src/hooks/usePools.ts @@ -1,7 +1,7 @@ import { computePoolAddress } from '@uniswap/v3-sdk' import { V3_CORE_FACTORY_ADDRESSES } from '../constants/addresses' import { IUniswapV3PoolStateInterface } from '../types/v3/IUniswapV3PoolState' -import { Token, Currency } from '@uniswap/sdk-core' +import { Token, Currency } from '../libs/sdk-core' import { useMemo } from 'react' import { useActiveWeb3React } from './web3' import { useMultipleContractSingleData } from '../state/multicall/hooks' diff --git a/src/hooks/useSwapCallback.ts b/src/hooks/useSwapCallback.ts index ce04803ba18..ff21762d583 100644 --- a/src/hooks/useSwapCallback.ts +++ b/src/hooks/useSwapCallback.ts @@ -1,7 +1,7 @@ import { BigNumber } from '@ethersproject/bignumber' import { Router, Trade as V2Trade } from '@uniswap/v2-sdk' import { SwapRouter, Trade as V3Trade } from '@uniswap/v3-sdk' -import { ChainId, Currency, Percent, TradeType } from '@uniswap/sdk-core' +import { ChainId, Currency, Percent, TradeType } from '../libs/sdk-core' import { useMemo } from 'react' import { SWAP_ROUTER_ADDRESSES } from '../constants/addresses' import { calculateGasMargin } from '../utils/calculateGasMargin' diff --git a/src/hooks/useSwapSlippageTolerance.ts b/src/hooks/useSwapSlippageTolerance.ts index f5ad6d2aa2f..ee816a14dae 100644 --- a/src/hooks/useSwapSlippageTolerance.ts +++ b/src/hooks/useSwapSlippageTolerance.ts @@ -1,4 +1,4 @@ -import { Currency, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, Percent, TradeType } from '../libs/sdk-core' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { useMemo } from 'react' diff --git a/src/hooks/useTickToPrice.ts b/src/hooks/useTickToPrice.ts index e6e5ffdb0e7..772e121b632 100644 --- a/src/hooks/useTickToPrice.ts +++ b/src/hooks/useTickToPrice.ts @@ -1,4 +1,4 @@ -import { Token, Price } from '@uniswap/sdk-core' +import { Token, Price } from '../libs/sdk-core' import { tickToPrice } from '@uniswap/v3-sdk' export function getTickToPrice( diff --git a/src/hooks/useTokenAllowance.ts b/src/hooks/useTokenAllowance.ts index 4e62c36d02e..167c8415940 100644 --- a/src/hooks/useTokenAllowance.ts +++ b/src/hooks/useTokenAllowance.ts @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, CurrencyAmount } from '../libs/sdk-core' import { useMemo } from 'react' import { useSingleCallResult } from '../state/multicall/hooks' import { useTokenContract } from './useContract' diff --git a/src/hooks/useTotalSupply.ts b/src/hooks/useTotalSupply.ts index f247d5325a4..15f1b0d46c6 100644 --- a/src/hooks/useTotalSupply.ts +++ b/src/hooks/useTotalSupply.ts @@ -1,5 +1,5 @@ import { BigNumber } from '@ethersproject/bignumber' -import { Token, CurrencyAmount, Currency } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, Currency } from '../libs/sdk-core' import { useTokenContract } from './useContract' import { useSingleCallResult } from '../state/multicall/hooks' diff --git a/src/hooks/useUSDCPrice.ts b/src/hooks/useUSDCPrice.ts index 31f1aa8fdb5..4804472bbdb 100644 --- a/src/hooks/useUSDCPrice.ts +++ b/src/hooks/useUSDCPrice.ts @@ -1,4 +1,4 @@ -import { ChainId, Currency, CurrencyAmount, Price, Token } from '@uniswap/sdk-core' +import { ChainId, Currency, CurrencyAmount, Price, Token } from '../libs/sdk-core' import { useMemo } from 'react' import { USDC } from '../constants/tokens' import { useV2TradeExactOut } from './useV2Trade' diff --git a/src/hooks/useV2Pairs.ts b/src/hooks/useV2Pairs.ts index 2bf74e58ea4..a077da515ed 100644 --- a/src/hooks/useV2Pairs.ts +++ b/src/hooks/useV2Pairs.ts @@ -5,7 +5,7 @@ import { Interface } from '@ethersproject/abi' import { useActiveWeb3React } from './web3' import { useMultipleContractSingleData } from '../state/multicall/hooks' import { wrappedCurrency } from '../utils/wrappedCurrency' -import { Currency, CurrencyAmount } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount } from '../libs/sdk-core' const PAIR_INTERFACE = new Interface(IUniswapV2PairABI) diff --git a/src/hooks/useV2Trade.ts b/src/hooks/useV2Trade.ts index f8a203b2375..8ec733e4b52 100644 --- a/src/hooks/useV2Trade.ts +++ b/src/hooks/useV2Trade.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, TradeType } from '../libs/sdk-core' import { Pair, Trade } from '@uniswap/v2-sdk' import { useMemo } from 'react' import { isTradeBetter } from 'utils/isTradeBetter' diff --git a/src/hooks/useV3PositionFees.ts b/src/hooks/useV3PositionFees.ts index 93b4cdc5ff8..da97ec28f65 100644 --- a/src/hooks/useV3PositionFees.ts +++ b/src/hooks/useV3PositionFees.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react' import { useV3NFTPositionManagerContract } from './useContract' import { BigNumber } from '@ethersproject/bignumber' import { Pool } from '@uniswap/v3-sdk' -import { CurrencyAmount, Token, currencyEquals, ETHER, Ether } from '@uniswap/sdk-core' +import { CurrencyAmount, Token, currencyEquals, ETHER, Ether } from '../libs/sdk-core' import { useBlockNumber } from 'state/application/hooks' import { unwrappedToken } from 'utils/wrappedCurrency' diff --git a/src/hooks/useV3SwapPools.ts b/src/hooks/useV3SwapPools.ts index 70a4bd5f419..cf11a8a64f4 100644 --- a/src/hooks/useV3SwapPools.ts +++ b/src/hooks/useV3SwapPools.ts @@ -1,4 +1,4 @@ -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '../libs/sdk-core' import { FeeAmount, Pool } from '@uniswap/v3-sdk' import { useMemo } from 'react' import { useAllCurrencyCombinations } from './useAllCurrencyCombinations' diff --git a/src/hooks/useWrapCallback.ts b/src/hooks/useWrapCallback.ts index 5a719f04f81..124b2eb44c2 100644 --- a/src/hooks/useWrapCallback.ts +++ b/src/hooks/useWrapCallback.ts @@ -1,4 +1,4 @@ -import { Currency, currencyEquals, WETH9 } from '@uniswap/sdk-core' +import { Currency, currencyEquals, WETH9 } from '../libs/sdk-core' import { useMemo } from 'react' import { tryParseAmount } from '../state/swap/hooks' import { useTransactionAdder } from '../state/transactions/hooks' diff --git a/src/hooks/web3.ts b/src/hooks/web3.ts index b45860bb995..f768c531460 100644 --- a/src/hooks/web3.ts +++ b/src/hooks/web3.ts @@ -1,5 +1,5 @@ import { Web3Provider } from '@ethersproject/providers' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' import { useWeb3React as useWeb3ReactCore } from '@web3-react/core' import { Web3ReactContextInterface } from '@web3-react/core/dist/types' import { useEffect, useState } from 'react' diff --git a/src/libs/sdk-core/.gitignore b/src/libs/sdk-core/.gitignore new file mode 100644 index 00000000000..e37cd8efc1b --- /dev/null +++ b/src/libs/sdk-core/.gitignore @@ -0,0 +1,38 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# generated contract types +/src/types/v3 +/src/abis/types + +# dependencies +/node_modules + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +/.netlify + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +notes.txt +.idea/ + +.vscode/ + +package-lock.json + +cypress/videos +cypress/screenshots +cypress/fixtures/example.json \ No newline at end of file diff --git a/src/libs/sdk-core/LICENSE b/src/libs/sdk-core/LICENSE new file mode 100644 index 00000000000..0c6c24ca9dd --- /dev/null +++ b/src/libs/sdk-core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Uniswap Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/libs/sdk-core/README.md b/src/libs/sdk-core/README.md new file mode 100644 index 00000000000..86f69f1dbd3 --- /dev/null +++ b/src/libs/sdk-core/README.md @@ -0,0 +1,8 @@ +# Uniswap SDK Core + +[![Unit Tests](https://github.com/Uniswap/uniswap-sdk-core/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3A%22Unit+Tests%22) +[![Lint](https://github.com/Uniswap/uniswap-sdk-core/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3ALint) +[![npm version](https://img.shields.io/npm/v/@uniswap/sdk-core/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk-core/v/latest) +[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk-core/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk-core@latest) + +This code is shared across Uniswap TypeScript SDKs. diff --git a/src/libs/sdk-core/dist/constants.d.ts b/src/libs/sdk-core/dist/constants.d.ts new file mode 100644 index 00000000000..e363b20d37b --- /dev/null +++ b/src/libs/sdk-core/dist/constants.d.ts @@ -0,0 +1,20 @@ +import JSBI from 'jsbi' +export declare type BigintIsh = JSBI | string | number +export declare enum ChainId { + MAINNET = 1, + ROPSTEN = 3, + RINKEBY = 4, + GÖRLI = 5, + KOVAN = 42, + POLYGON_AMOY = 80002, +} +export declare enum TradeType { + EXACT_INPUT = 0, + EXACT_OUTPUT = 1, +} +export declare enum Rounding { + ROUND_DOWN = 0, + ROUND_HALF_UP = 1, + ROUND_UP = 2, +} +export declare const MaxUint256: JSBI diff --git a/src/libs/sdk-core/dist/entities/baseCurrency.d.ts b/src/libs/sdk-core/dist/entities/baseCurrency.d.ts new file mode 100644 index 00000000000..c56bf6b49a8 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/baseCurrency.d.ts @@ -0,0 +1,19 @@ +/** + * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. + * + * The only instance of the base class `Currency` is Ether. + */ +export declare abstract class BaseCurrency { + abstract readonly isEther: boolean; + abstract readonly isToken: boolean; + readonly decimals: number; + readonly symbol?: string; + readonly name?: string; + /** + * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. + * @param decimals decimals of the currency + * @param symbol symbol of the currency + * @param name of the currency + */ + protected constructor(decimals: number, symbol?: string, name?: string); +} diff --git a/src/libs/sdk-core/dist/entities/currency.d.ts b/src/libs/sdk-core/dist/entities/currency.d.ts new file mode 100644 index 00000000000..997946a07f5 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/currency.d.ts @@ -0,0 +1,3 @@ +import { Ether } from './ether'; +import { Token } from './token'; +export declare type Currency = Ether | Token; diff --git a/src/libs/sdk-core/dist/entities/ether.d.ts b/src/libs/sdk-core/dist/entities/ether.d.ts new file mode 100644 index 00000000000..78ded1b62b6 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/ether.d.ts @@ -0,0 +1,18 @@ +import { BaseCurrency } from './baseCurrency'; +/** + * Represents the currency Ether + */ +export declare class Ether extends BaseCurrency { + readonly isEther: true; + readonly isToken: false; + /** + * Only called once by this class + * @protected + */ + protected constructor(); + /** + * The only instance of the class `Ether`. + */ + static readonly ETHER: Ether; +} +export declare const ETHER: Ether; diff --git a/src/libs/sdk-core/dist/entities/fractions/currencyAmount.d.ts b/src/libs/sdk-core/dist/entities/fractions/currencyAmount.d.ts new file mode 100644 index 00000000000..294019b4aa8 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/fractions/currencyAmount.d.ts @@ -0,0 +1,35 @@ +import JSBI from 'jsbi'; +import { Currency } from '../currency'; +import { Ether } from '../ether'; +import { Fraction } from './fraction'; +import { BigintIsh, Rounding } from '../../constants'; +export declare class CurrencyAmount extends Fraction { + readonly currency: T; + readonly decimalScale: JSBI; + /** + * Returns a new currency amount instance from the + * @param currency the currency in the amount + * @param rawAmount the raw token or ether amount + */ + static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount; + /** + * Construct a currency amount with a denominator that is not equal to 1 + * @param currency the currency + * @param numerator the numerator of the fractional token amount + * @param denominator the denominator of the fractional token amount + */ + static fromFractionalAmount(currency: T, numerator: BigintIsh, denominator: BigintIsh): CurrencyAmount; + /** + * Helper that calls the constructor with the ETHER currency + * @param rawAmount ether amount in wei + */ + static ether(rawAmount: BigintIsh): CurrencyAmount; + protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh); + add(other: CurrencyAmount): CurrencyAmount; + subtract(other: CurrencyAmount): CurrencyAmount; + multiply(other: Fraction | BigintIsh): CurrencyAmount; + divide(other: Fraction | BigintIsh): CurrencyAmount; + toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; + toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; + toExact(format?: object): string; +} diff --git a/src/libs/sdk-core/dist/entities/fractions/fraction.d.ts b/src/libs/sdk-core/dist/entities/fractions/fraction.d.ts new file mode 100644 index 00000000000..414770af5e3 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/fractions/fraction.d.ts @@ -0,0 +1,24 @@ +import JSBI from 'jsbi'; +import { BigintIsh, Rounding } from '../../constants'; +export declare class Fraction { + readonly numerator: JSBI; + readonly denominator: JSBI; + constructor(numerator: BigintIsh, denominator?: BigintIsh); + private static tryParseFraction; + get quotient(): JSBI; + get remainder(): Fraction; + invert(): Fraction; + add(other: Fraction | BigintIsh): Fraction; + subtract(other: Fraction | BigintIsh): Fraction; + lessThan(other: Fraction | BigintIsh): boolean; + equalTo(other: Fraction | BigintIsh): boolean; + greaterThan(other: Fraction | BigintIsh): boolean; + multiply(other: Fraction | BigintIsh): Fraction; + divide(other: Fraction | BigintIsh): Fraction; + toSignificant(significantDigits: number, format?: object, rounding?: Rounding): string; + toFixed(decimalPlaces: number, format?: object, rounding?: Rounding): string; + /** + * Helper method for converting any super class back to a fraction + */ + get asFraction(): Fraction; +} diff --git a/src/libs/sdk-core/dist/entities/fractions/index.d.ts b/src/libs/sdk-core/dist/entities/fractions/index.d.ts new file mode 100644 index 00000000000..616c23384e2 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/fractions/index.d.ts @@ -0,0 +1,4 @@ +export { CurrencyAmount } from './currencyAmount'; +export { Fraction } from './fraction'; +export { Percent } from './percent'; +export { Price } from './price'; diff --git a/src/libs/sdk-core/dist/entities/fractions/percent.d.ts b/src/libs/sdk-core/dist/entities/fractions/percent.d.ts new file mode 100644 index 00000000000..6f373cf3282 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/fractions/percent.d.ts @@ -0,0 +1,14 @@ +import { BigintIsh, Rounding } from '../../constants'; +import { Fraction } from './fraction'; +export declare class Percent extends Fraction { + /** + * This boolean prevents a fraction from being interpreted as a Percent + */ + readonly isPercent: true; + add(other: Fraction | BigintIsh): Percent; + subtract(other: Fraction | BigintIsh): Percent; + multiply(other: Fraction | BigintIsh): Percent; + divide(other: Fraction | BigintIsh): Percent; + toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; + toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; +} diff --git a/src/libs/sdk-core/dist/entities/fractions/price.d.ts b/src/libs/sdk-core/dist/entities/fractions/price.d.ts new file mode 100644 index 00000000000..b04db496080 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/fractions/price.d.ts @@ -0,0 +1,31 @@ +import { BigintIsh, Rounding } from '../../constants'; +import { Currency } from '../currency'; +import { Fraction } from './fraction'; +import { CurrencyAmount } from './currencyAmount'; +export declare class Price extends Fraction { + readonly baseCurrency: TBase; + readonly quoteCurrency: TQuote; + readonly scalar: Fraction; + constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh); + /** + * Flip the price, switching the base and quote currency + */ + invert(): Price; + /** + * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency + * @param other the other price + */ + multiply(other: Price): Price; + /** + * Return the amount of quote currency corresponding to a given amount of the base currency + * @param currencyAmount the amount of base currency to quote against the price + */ + quote(currencyAmount: CurrencyAmount): CurrencyAmount; + /** + * Get the value scaled by decimals for formatting + * @private + */ + private get adjustedForDecimals(); + toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; + toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; +} diff --git a/src/libs/sdk-core/dist/entities/index.d.ts b/src/libs/sdk-core/dist/entities/index.d.ts new file mode 100644 index 00000000000..623a38d0b91 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/index.d.ts @@ -0,0 +1,4 @@ +export * from './fractions'; +export * from './currency'; +export * from './ether'; +export * from './token'; diff --git a/src/libs/sdk-core/dist/entities/token.d.ts b/src/libs/sdk-core/dist/entities/token.d.ts new file mode 100644 index 00000000000..53ec6fd2e27 --- /dev/null +++ b/src/libs/sdk-core/dist/entities/token.d.ts @@ -0,0 +1,27 @@ +import { ChainId } from '../constants' +import { BaseCurrency } from './baseCurrency' +/** + * Represents an ERC20 token with a unique address and some metadata. + */ +export declare class Token extends BaseCurrency { + readonly isEther: false + readonly isToken: true + readonly chainId: ChainId | number + readonly address: string + constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) + /** + * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. + * @param other other token to compare + */ + equals(other: Token): boolean + /** + * Returns true if the address of this token sorts before the address of the other token + * @param other other token to compare + * @throws if the tokens have the same address + * @throws if the tokens are on different chains + */ + sortsBefore(other: Token): boolean +} +export declare const WETH9: { + [chainId in ChainId]: Token +} diff --git a/src/libs/sdk-core/dist/index.d.ts b/src/libs/sdk-core/dist/index.d.ts new file mode 100644 index 00000000000..0e9ce96a650 --- /dev/null +++ b/src/libs/sdk-core/dist/index.d.ts @@ -0,0 +1,3 @@ +export * from './constants'; +export * from './entities'; +export * from './utils'; diff --git a/src/libs/sdk-core/dist/index.js b/src/libs/sdk-core/dist/index.js new file mode 100644 index 00000000000..c3473ea9bf6 --- /dev/null +++ b/src/libs/sdk-core/dist/index.js @@ -0,0 +1,8 @@ + +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./sdk-core.cjs.production.min.js') +} else { + module.exports = require('./sdk-core.cjs.development.js') +} diff --git a/src/libs/sdk-core/dist/sdk-core.cjs.development.js b/src/libs/sdk-core/dist/sdk-core.cjs.development.js new file mode 100644 index 00000000000..542ca9588eb --- /dev/null +++ b/src/libs/sdk-core/dist/sdk-core.cjs.development.js @@ -0,0 +1,785 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', { value: true }) + +function _interopDefault(ex) { + return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex +} + +var JSBI = _interopDefault(require('jsbi')) +var invariant = _interopDefault(require('tiny-invariant')) +var _Decimal = _interopDefault(require('decimal.js-light')) +var _Big = _interopDefault(require('big.js')) +var toFormat = _interopDefault(require('toformat')) +var address = require('@ethersproject/address') + +;(function (ChainId) { + ChainId[(ChainId['MAINNET'] = 1)] = 'MAINNET' + ChainId[(ChainId['ROPSTEN'] = 3)] = 'ROPSTEN' + ChainId[(ChainId['RINKEBY'] = 4)] = 'RINKEBY' + ChainId[(ChainId['G\xD6RLI'] = 5)] = 'G\xD6RLI' + ChainId[(ChainId['KOVAN'] = 42)] = 'KOVAN' + ChainId[(ChainId['POLYGON_AMOY'] = 80002)] = 'POLYGON_AMOY' +})(exports.ChainId || (exports.ChainId = {})) +;(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) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i] + descriptor.enumerable = descriptor.enumerable || false + descriptor.configurable = true + if ('value' in descriptor) descriptor.writable = true + Object.defineProperty(target, descriptor.key, descriptor) + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps) + if (staticProps) _defineProperties(Constructor, staticProps) + return Constructor +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype) + subClass.prototype.constructor = subClass + subClass.__proto__ = superClass +} + +/** + * Compares two currencies for equality + */ +function currencyEquals(currencyA, currencyB) { + if (currencyA.isToken && currencyB.isToken) { + return currencyA.equals(currencyB) + } else if (currencyA.isToken) { + return false + } else if (currencyB.isToken) { + return false + } else { + return currencyA.isEther === currencyB.isEther + } +} + +/** + * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. + * + * The only instance of the base class `Currency` is Ether. + */ + +var BaseCurrency = + /** + * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. + * @param decimals decimals of the currency + * @param symbol symbol of the currency + * @param name of the currency + */ + function BaseCurrency(decimals, symbol, name) { + !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? invariant(false, 'DECIMALS') : void 0 + this.decimals = decimals + this.symbol = symbol + this.name = name + } + +/** + * Represents the currency Ether + */ + +var Ether = /*#__PURE__*/ (function (_BaseCurrency) { + _inheritsLoose(Ether, _BaseCurrency) + + /** + * Only called once by this class + * @protected + */ + function Ether() { + var _this + + _this = _BaseCurrency.call(this, 18, 'ETH', 'Ether') || this + _this.isEther = true + _this.isToken = false + return _this + } + + return Ether +})(BaseCurrency) +/** + * The only instance of the class `Ether`. + */ + +Ether.ETHER = /*#__PURE__*/ new Ether() +var ETHER = Ether.ETHER + +var _toSignificantRoundin, _toFixedRounding +var Decimal = /*#__PURE__*/ toFormat(_Decimal) +var Big = /*#__PURE__*/ toFormat(_Big) +var toSignificantRounding = + ((_toSignificantRoundin = {}), + (_toSignificantRoundin[exports.Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN), + (_toSignificantRoundin[exports.Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP), + (_toSignificantRoundin[exports.Rounding.ROUND_UP] = Decimal.ROUND_UP), + _toSignificantRoundin) +var toFixedRounding = + ((_toFixedRounding = {}), + (_toFixedRounding[exports.Rounding.ROUND_DOWN] = 0), + (_toFixedRounding[exports.Rounding.ROUND_HALF_UP] = 1), + (_toFixedRounding[exports.Rounding.ROUND_UP] = 3), + _toFixedRounding) +var Fraction = /*#__PURE__*/ (function () { + function Fraction(numerator, denominator) { + if (denominator === void 0) { + denominator = JSBI.BigInt(1) + } + + this.numerator = JSBI.BigInt(numerator) + this.denominator = JSBI.BigInt(denominator) + } + + Fraction.tryParseFraction = function tryParseFraction(fractionish) { + if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') + return new Fraction(fractionish) + if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish + throw new Error('Could not parse fraction') + } // performs floor division + + var _proto = Fraction.prototype + + _proto.invert = function invert() { + return new Fraction(this.denominator, this.numerator) + } + + _proto.add = function add(other) { + var otherParsed = Fraction.tryParseFraction(other) + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator) + } + + return new Fraction( + JSBI.add( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ), + JSBI.multiply(this.denominator, otherParsed.denominator) + ) + } + + _proto.subtract = function subtract(other) { + var otherParsed = Fraction.tryParseFraction(other) + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator) + } + + return new Fraction( + JSBI.subtract( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ), + JSBI.multiply(this.denominator, otherParsed.denominator) + ) + } + + _proto.lessThan = function lessThan(other) { + var otherParsed = Fraction.tryParseFraction(other) + return JSBI.lessThan( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ) + } + + _proto.equalTo = function equalTo(other) { + var otherParsed = Fraction.tryParseFraction(other) + return JSBI.equal( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ) + } + + _proto.greaterThan = function greaterThan(other) { + var otherParsed = Fraction.tryParseFraction(other) + return JSBI.greaterThan( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ) + } + + _proto.multiply = function multiply(other) { + var otherParsed = Fraction.tryParseFraction(other) + return new Fraction( + JSBI.multiply(this.numerator, otherParsed.numerator), + JSBI.multiply(this.denominator, otherParsed.denominator) + ) + } + + _proto.divide = function divide(other) { + var otherParsed = Fraction.tryParseFraction(other) + return new Fraction( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(this.denominator, otherParsed.numerator) + ) + } + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '', + } + } + + if (rounding === void 0) { + rounding = exports.Rounding.ROUND_HALF_UP + } + + !Number.isInteger(significantDigits) ? invariant(false, significantDigits + ' is not an integer.') : void 0 + !(significantDigits > 0) ? invariant(false, significantDigits + ' is not positive.') : void 0 + Decimal.set({ + precision: significantDigits + 1, + rounding: toSignificantRounding[rounding], + }) + var quotient = new Decimal(this.numerator.toString()) + .div(this.denominator.toString()) + .toSignificantDigits(significantDigits) + return quotient.toFormat(quotient.decimalPlaces(), format) + } + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '', + } + } + + if (rounding === void 0) { + rounding = exports.Rounding.ROUND_HALF_UP + } + + !Number.isInteger(decimalPlaces) ? invariant(false, decimalPlaces + ' is not an integer.') : void 0 + !(decimalPlaces >= 0) ? invariant(false, decimalPlaces + ' is negative.') : void 0 + Big.DP = decimalPlaces + Big.RM = toFixedRounding[rounding] + return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format) + } + /** + * Helper method for converting any super class back to a fraction + */ + + _createClass(Fraction, [ + { + key: 'quotient', + get: function get() { + return JSBI.divide(this.numerator, this.denominator) + }, // remainder after floor division + }, + { + key: 'remainder', + get: function get() { + return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator) + }, + }, + { + key: 'asFraction', + get: function get() { + return new Fraction(this.numerator, this.denominator) + }, + }, + ]) + + return Fraction +})() + +var Big$1 = /*#__PURE__*/ toFormat(_Big) +var CurrencyAmount = /*#__PURE__*/ (function (_Fraction) { + _inheritsLoose(CurrencyAmount, _Fraction) + + function CurrencyAmount(currency, numerator, denominator) { + var _this + + _this = _Fraction.call(this, numerator, denominator) || this + !JSBI.lessThanOrEqual(_this.quotient, MaxUint256) ? invariant(false, 'AMOUNT') : void 0 + _this.currency = currency + _this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals)) + return _this + } + /** + * Returns a new currency amount instance from the + * @param currency the currency in the amount + * @param rawAmount the raw token or ether amount + */ + + CurrencyAmount.fromRawAmount = function fromRawAmount(currency, rawAmount) { + return new CurrencyAmount(currency, rawAmount) + } + /** + * Construct a currency amount with a denominator that is not equal to 1 + * @param currency the currency + * @param numerator the numerator of the fractional token amount + * @param denominator the denominator of the fractional token amount + */ + + CurrencyAmount.fromFractionalAmount = function fromFractionalAmount(currency, numerator, denominator) { + return new CurrencyAmount(currency, numerator, denominator) + } + /** + * Helper that calls the constructor with the ETHER currency + * @param rawAmount ether amount in wei + */ + + CurrencyAmount.ether = function ether(rawAmount) { + return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount) + } + + var _proto = CurrencyAmount.prototype + + _proto.add = function add(other) { + !currencyEquals(this.currency, other.currency) ? invariant(false, 'CURRENCY') : void 0 + + var added = _Fraction.prototype.add.call(this, other) + + return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator) + } + + _proto.subtract = function subtract(other) { + !currencyEquals(this.currency, other.currency) ? invariant(false, 'CURRENCY') : void 0 + + var subtracted = _Fraction.prototype.subtract.call(this, other) + + return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator) + } + + _proto.multiply = function multiply(other) { + var multiplied = _Fraction.prototype.multiply.call(this, other) + + return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator) + } + + _proto.divide = function divide(other) { + var divided = _Fraction.prototype.divide.call(this, other) + + return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator) + } + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 6 + } + + if (rounding === void 0) { + rounding = exports.Rounding.ROUND_DOWN + } + + return _Fraction.prototype.divide.call(this, this.decimalScale).toSignificant(significantDigits, format, rounding) + } + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = this.currency.decimals + } + + if (rounding === void 0) { + rounding = exports.Rounding.ROUND_DOWN + } + + !(decimalPlaces <= this.currency.decimals) ? invariant(false, 'DECIMALS') : void 0 + return _Fraction.prototype.divide.call(this, this.decimalScale).toFixed(decimalPlaces, format, rounding) + } + + _proto.toExact = function toExact(format) { + if (format === void 0) { + format = { + groupSeparator: '', + } + } + + Big$1.DP = this.currency.decimals + return new Big$1(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format) + } + + return CurrencyAmount +})(Fraction) + +var ONE_HUNDRED = /*#__PURE__*/ new Fraction(/*#__PURE__*/ JSBI.BigInt(100)) +/** + * Converts a fraction to a percent + * @param fraction the fraction to convert + */ + +function toPercent(fraction) { + return new Percent(fraction.numerator, fraction.denominator) +} + +var Percent = /*#__PURE__*/ (function (_Fraction) { + _inheritsLoose(Percent, _Fraction) + + function Percent() { + var _this + + _this = _Fraction.apply(this, arguments) || this + /** + * This boolean prevents a fraction from being interpreted as a Percent + */ + + _this.isPercent = true + return _this + } + + var _proto = Percent.prototype + + _proto.add = function add(other) { + return toPercent(_Fraction.prototype.add.call(this, other)) + } + + _proto.subtract = function subtract(other) { + return toPercent(_Fraction.prototype.subtract.call(this, other)) + } + + _proto.multiply = function multiply(other) { + return toPercent(_Fraction.prototype.multiply.call(this, other)) + } + + _proto.divide = function divide(other) { + return toPercent(_Fraction.prototype.divide.call(this, other)) + } + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 5 + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding) + } + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 2 + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding) + } + + return Percent +})(Fraction) + +var Price = /*#__PURE__*/ (function (_Fraction) { + _inheritsLoose(Price, _Fraction) + + // denominator and numerator _must_ be raw, i.e. in the native representation + function Price(baseCurrency, quoteCurrency, denominator, numerator) { + var _this + + _this = _Fraction.call(this, numerator, denominator) || this + _this.baseCurrency = baseCurrency + _this.quoteCurrency = quoteCurrency + _this.scalar = new Fraction( + JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)), + JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals)) + ) + return _this + } + /** + * Flip the price, switching the base and quote currency + */ + + var _proto = Price.prototype + + _proto.invert = function invert() { + return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator) + } + /** + * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency + * @param other the other price + */ + + _proto.multiply = function multiply(other) { + !currencyEquals(this.quoteCurrency, other.baseCurrency) ? invariant(false, 'TOKEN') : void 0 + + var fraction = _Fraction.prototype.multiply.call(this, other) + + return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator) + } + /** + * Return the amount of quote currency corresponding to a given amount of the base currency + * @param currencyAmount the amount of base currency to quote against the price + */ + + _proto.quote = function quote(currencyAmount) { + !currencyEquals(currencyAmount.currency, this.baseCurrency) ? invariant(false, 'TOKEN') : void 0 + + var result = _Fraction.prototype.multiply.call(this, currencyAmount) + + return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator) + } + /** + * Get the value scaled by decimals for formatting + * @private + */ + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 6 + } + + return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding) + } + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 4 + } + + return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding) + } + + _createClass(Price, [ + { + key: 'adjustedForDecimals', + get: function get() { + return _Fraction.prototype.multiply.call(this, this.scalar) + }, + }, + ]) + + return Price +})(Fraction) + +/** + * Validates an address and returns the parsed (checksummed) version of that address + * @param address the unchecksummed hex address + */ + +function validateAndParseAddress(address$1) { + try { + return address.getAddress(address$1) + } catch (error) { + throw new Error(address$1 + ' is not a valid address.') + } +} + +var _WETH +/** + * Represents an ERC20 token with a unique address and some metadata. + */ + +var Token = /*#__PURE__*/ (function (_BaseCurrency) { + _inheritsLoose(Token, _BaseCurrency) + + function Token(chainId, address, decimals, symbol, name) { + var _this + + _this = _BaseCurrency.call(this, decimals, symbol, name) || this + _this.isEther = false + _this.isToken = true + _this.chainId = chainId + _this.address = validateAndParseAddress(address) + return _this + } + /** + * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. + * @param other other token to compare + */ + + var _proto = Token.prototype + + _proto.equals = function equals(other) { + // short circuit on reference equality + if (this === other) { + return true + } + + return this.chainId === other.chainId && this.address === other.address + } + /** + * Returns true if the address of this token sorts before the address of the other token + * @param other other token to compare + * @throws if the tokens have the same address + * @throws if the tokens are on different chains + */ + + _proto.sortsBefore = function sortsBefore(other) { + !(this.chainId === other.chainId) ? invariant(false, 'CHAIN_IDS') : void 0 + !(this.address !== other.address) ? invariant(false, 'ADDRESSES') : void 0 + return this.address.toLowerCase() < other.address.toLowerCase() + } + + return Token +})(BaseCurrency) +var WETH9 = + ((_WETH = {}), + (_WETH[exports.ChainId.MAINNET] = /*#__PURE__*/ new Token( + exports.ChainId.MAINNET, + '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[exports.ChainId.ROPSTEN] = /*#__PURE__*/ new Token( + exports.ChainId.ROPSTEN, + '0xc778417E063141139Fce010982780140Aa0cD5Ab', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[exports.ChainId.RINKEBY] = /*#__PURE__*/ new Token( + exports.ChainId.RINKEBY, + '0xc778417E063141139Fce010982780140Aa0cD5Ab', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[exports.ChainId.GÖRLI] = /*#__PURE__*/ new Token( + exports.ChainId.GÖRLI, + '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[exports.ChainId.KOVAN] = /*#__PURE__*/ new Token( + exports.ChainId.KOVAN, + '0xd0A1E359811322d97991E03f863a0C30C2cF029C', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[exports.ChainId.POLYGON_AMOY] = /*#__PURE__*/ new Token( + exports.ChainId.POLYGON_AMOY, + '0xd7a19e388c52D3580B6428F29494883A5d40C330', + 18, + 'WETH9', + 'Wrapped Ether' + )), + _WETH) + +/** + * Returns the percent difference between the mid price and the execution price, i.e. price impact. + * @param midPrice mid price before the trade + * @param inputAmount the input amount of the trade + * @param outputAmount the output amount of the trade + */ + +function computePriceImpact(midPrice, inputAmount, outputAmount) { + var quotedOutputAmount = midPrice.quote(inputAmount) // calculate price impact := (exactQuote - outputAmount) / exactQuote + + var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount) + return new Percent(priceImpact.numerator, priceImpact.denominator) +} + +// `maxSize` by removing the last item + +function sortedInsert(items, add, maxSize, comparator) { + !(maxSize > 0) ? invariant(false, 'MAX_SIZE_ZERO') : void 0 // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize + + !(items.length <= maxSize) ? invariant(false, 'ITEMS_SIZE') : void 0 // short circuit first item add + + if (items.length === 0) { + items.push(add) + return null + } else { + var isFull = items.length === maxSize // short circuit if full and the additional item does not come before the last item + + if (isFull && comparator(items[items.length - 1], add) <= 0) { + return add + } + + var lo = 0, + hi = items.length + + while (lo < hi) { + var mid = (lo + hi) >>> 1 + + if (comparator(items[mid], add) <= 0) { + lo = mid + 1 + } else { + hi = mid + } + } + + items.splice(lo, 0, add) + return isFull ? items.pop() : null + } +} + +var MAX_SAFE_INTEGER = /*#__PURE__*/ JSBI.BigInt(Number.MAX_SAFE_INTEGER) +var ZERO = /*#__PURE__*/ JSBI.BigInt(0) +var ONE = /*#__PURE__*/ JSBI.BigInt(1) +var TWO = /*#__PURE__*/ JSBI.BigInt(2) +/** + * Computes floor(sqrt(value)) + * @param value the value for which to compute the square root, rounded down + */ + +function sqrt(value) { + !JSBI.greaterThanOrEqual(value, ZERO) ? invariant(false, 'NEGATIVE') : void 0 // rely on built in sqrt if possible + + if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) { + return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value)))) + } + + var z + var x + z = value + x = JSBI.add(JSBI.divide(value, TWO), ONE) + + while (JSBI.lessThan(x, z)) { + z = x + x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO) + } + + return z +} + +/** + * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token + * @param currency the currency to wrap, if necessary + * @param chainId the ID of the chain for wrapping + */ + +function wrappedCurrency(currency, chainId) { + if (currency.isToken) { + !(currency.chainId === chainId) ? invariant(false, 'CHAIN_ID') : void 0 + return currency + } + + if (currency.isEther) return WETH9[chainId] + throw new Error('CURRENCY') +} + +/** + * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. + * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns + * the input currency amount. + */ + +function wrappedCurrencyAmount(currencyAmount, chainId) { + return CurrencyAmount.fromFractionalAmount( + wrappedCurrency(currencyAmount.currency, chainId), + currencyAmount.numerator, + currencyAmount.denominator + ) +} + +exports.CurrencyAmount = CurrencyAmount +exports.ETHER = ETHER +exports.Ether = Ether +exports.Fraction = Fraction +exports.MaxUint256 = MaxUint256 +exports.Percent = Percent +exports.Price = Price +exports.Token = Token +exports.WETH9 = WETH9 +exports.computePriceImpact = computePriceImpact +exports.currencyEquals = currencyEquals +exports.sortedInsert = sortedInsert +exports.sqrt = sqrt +exports.validateAndParseAddress = validateAndParseAddress +exports.wrappedCurrency = wrappedCurrency +exports.wrappedCurrencyAmount = wrappedCurrencyAmount +//# sourceMappingURL=sdk-core.cjs.development.js.map diff --git a/src/libs/sdk-core/dist/sdk-core.cjs.development.js.map b/src/libs/sdk-core/dist/sdk-core.cjs.development.js.map new file mode 100644 index 00000000000..fe7e30bda05 --- /dev/null +++ b/src/libs/sdk-core/dist/sdk-core.cjs.development.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sdk-core.cjs.development.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import { Currency } from '../entities/currency'\n\n/**\n * Compares two currencies for equality\n */\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\n if (currencyA.isToken && currencyB.isToken) {\n return currencyA.equals(currencyB)\n } else if (currencyA.isToken) {\n return false\n } else if (currencyB.isToken) {\n return false\n } else {\n return currencyA.isEther === currencyB.isEther\n }\n}\n","import invariant from 'tiny-invariant'\n\n/**\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\n *\n * The only instance of the base class `Currency` is Ether.\n */\nexport abstract class BaseCurrency {\n public abstract readonly isEther: boolean\n public abstract readonly isToken: boolean\n\n public readonly decimals: number\n public readonly symbol?: string\n public readonly name?: string\n\n /**\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\n * @param decimals decimals of the currency\n * @param symbol symbol of the currency\n * @param name of the currency\n */\n protected constructor(decimals: number, symbol?: string, name?: string) {\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\n\n this.decimals = decimals\n this.symbol = symbol\n this.name = name\n }\n}\n","import { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents the currency Ether\n */\nexport class Ether extends BaseCurrency {\n public readonly isEther: true = true\n public readonly isToken: false = false\n\n /**\n * Only called once by this class\n * @protected\n */\n protected constructor() {\n super(18, 'ETH', 'Ether')\n }\n\n /**\n * The only instance of the class `Ether`.\n */\n public static readonly ETHER: Ether = new Ether()\n}\n\nexport const ETHER = Ether.ETHER\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport _Decimal from 'decimal.js-light'\nimport _Big, { RoundingMode } from 'big.js'\nimport toFormat from 'toformat'\n\nimport { BigintIsh, Rounding } from '../../constants'\n\nconst Decimal = toFormat(_Decimal)\nconst Big = toFormat(_Big)\n\nconst toSignificantRounding = {\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\n}\n\nconst toFixedRounding = {\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\n}\n\nexport class Fraction {\n public readonly numerator: JSBI\n public readonly denominator: JSBI\n\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\n this.numerator = JSBI.BigInt(numerator)\n this.denominator = JSBI.BigInt(denominator)\n }\n\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\n return new Fraction(fractionish)\n\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\n throw new Error('Could not parse fraction')\n }\n\n // performs floor division\n public get quotient(): JSBI {\n return JSBI.divide(this.numerator, this.denominator)\n }\n\n // remainder after floor division\n public get remainder(): Fraction {\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\n }\n\n public invert(): Fraction {\n return new Fraction(this.denominator, this.numerator)\n }\n\n public add(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.add(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public subtract(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.subtract(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public lessThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.lessThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public equalTo(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.equal(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public greaterThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.greaterThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public multiply(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.numerator),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public divide(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(this.denominator, otherParsed.numerator)\n )\n }\n\n public toSignificant(\n significantDigits: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\n\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\n const quotient = new Decimal(this.numerator.toString())\n .div(this.denominator.toString())\n .toSignificantDigits(significantDigits)\n return quotient.toFormat(quotient.decimalPlaces(), format)\n }\n\n public toFixed(\n decimalPlaces: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\n\n Big.DP = decimalPlaces\n Big.RM = toFixedRounding[rounding]\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\n }\n\n /**\n * Helper method for converting any super class back to a fraction\n */\n public get asFraction(): Fraction {\n return new Fraction(this.numerator, this.denominator)\n }\n}\n","import invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport { Currency } from '../currency'\nimport { Ether } from '../ether'\nimport { Fraction } from './fraction'\nimport _Big from 'big.js'\n\nimport toFormat from 'toformat'\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\n\nconst Big = toFormat(_Big)\n\nexport class CurrencyAmount extends Fraction {\n public readonly currency: T\n public readonly decimalScale: JSBI\n\n /**\n * Returns a new currency amount instance from the\n * @param currency the currency in the amount\n * @param rawAmount the raw token or ether amount\n */\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\n return new CurrencyAmount(currency, rawAmount)\n }\n\n /**\n * Construct a currency amount with a denominator that is not equal to 1\n * @param currency the currency\n * @param numerator the numerator of the fractional token amount\n * @param denominator the denominator of the fractional token amount\n */\n public static fromFractionalAmount(\n currency: T,\n numerator: BigintIsh,\n denominator: BigintIsh\n ): CurrencyAmount {\n return new CurrencyAmount(currency, numerator, denominator)\n }\n\n /**\n * Helper that calls the constructor with the ETHER currency\n * @param rawAmount ether amount in wei\n */\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\n }\n\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\n super(numerator, denominator)\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\n this.currency = currency\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\n }\n\n public add(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const added = super.add(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\n }\n\n public subtract(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const subtracted = super.subtract(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\n }\n\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\n const multiplied = super.multiply(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\n }\n\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\n const divided = super.divide(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\n }\n\n public toSignificant(\n significantDigits: number = 6,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(\n decimalPlaces: number = this.currency.decimals,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\n }\n\n public toExact(format: object = { groupSeparator: '' }): string {\n Big.DP = this.currency.decimals\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\n }\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Fraction } from './fraction'\n\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\n\n/**\n * Converts a fraction to a percent\n * @param fraction the fraction to convert\n */\nfunction toPercent(fraction: Fraction): Percent {\n return new Percent(fraction.numerator, fraction.denominator)\n}\n\nexport class Percent extends Fraction {\n /**\n * This boolean prevents a fraction from being interpreted as a Percent\n */\n public readonly isPercent: true = true\n\n add(other: Fraction | BigintIsh): Percent {\n return toPercent(super.add(other))\n }\n\n subtract(other: Fraction | BigintIsh): Percent {\n return toPercent(super.subtract(other))\n }\n\n multiply(other: Fraction | BigintIsh): Percent {\n return toPercent(super.multiply(other))\n }\n\n divide(other: Fraction | BigintIsh): Percent {\n return toPercent(super.divide(other))\n }\n\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\n }\n}\n","import JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport invariant from 'tiny-invariant'\n\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Currency } from '../currency'\nimport { Fraction } from './fraction'\nimport { CurrencyAmount } from './currencyAmount'\n\nexport class Price extends Fraction {\n public readonly baseCurrency: TBase // input i.e. denominator\n public readonly quoteCurrency: TQuote // output i.e. numerator\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\n\n // denominator and numerator _must_ be raw, i.e. in the native representation\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\n super(numerator, denominator)\n\n this.baseCurrency = baseCurrency\n this.quoteCurrency = quoteCurrency\n this.scalar = new Fraction(\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\n )\n }\n\n /**\n * Flip the price, switching the base and quote currency\n */\n public invert(): Price {\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\n }\n\n /**\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\n * @param other the other price\n */\n public multiply(other: Price): Price {\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\n const fraction = super.multiply(other)\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\n }\n\n /**\n * Return the amount of quote currency corresponding to a given amount of the base currency\n * @param currencyAmount the amount of base currency to quote against the price\n */\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\n const result = super.multiply(currencyAmount)\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\n }\n\n /**\n * Get the value scaled by decimals for formatting\n * @private\n */\n private get adjustedForDecimals(): Fraction {\n return super.multiply(this.scalar)\n }\n\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\n }\n}\n","import { getAddress } from '@ethersproject/address'\n\n/**\n * Validates an address and returns the parsed (checksummed) version of that address\n * @param address the unchecksummed hex address\n */\nexport function validateAndParseAddress(address: string): string {\n try {\n return getAddress(address)\n } catch (error) {\n throw new Error(`${address} is not a valid address.`)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\nimport { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents an ERC20 token with a unique address and some metadata.\n */\nexport class Token extends BaseCurrency {\n public readonly isEther: false = false\n public readonly isToken: true = true\n\n public readonly chainId: ChainId | number\n public readonly address: string\n\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\n super(decimals, symbol, name)\n this.chainId = chainId\n this.address = validateAndParseAddress(address)\n }\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Token): boolean {\n // short circuit on reference equality\n if (this === other) {\n return true\n }\n return this.chainId === other.chainId && this.address === other.address\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: Token): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n}\n\nexport const WETH9: { [chainId in ChainId]: Token } = {\n [ChainId.MAINNET]: new Token(\n ChainId.MAINNET,\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.ROPSTEN]: new Token(\n ChainId.ROPSTEN,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.RINKEBY]: new Token(\n ChainId.RINKEBY,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether')\n}\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\n\n/**\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\n * @param midPrice mid price before the trade\n * @param inputAmount the input amount of the trade\n * @param outputAmount the output amount of the trade\n */\nexport function computePriceImpact(\n midPrice: Price,\n inputAmount: CurrencyAmount,\n outputAmount: CurrencyAmount\n): Percent {\n const quotedOutputAmount = midPrice.quote(inputAmount)\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\n return new Percent(priceImpact.numerator, priceImpact.denominator)\n}\n","import invariant from 'tiny-invariant'\n\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\n// `maxSize` by removing the last item\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\n\n // short circuit first item add\n if (items.length === 0) {\n items.push(add)\n return null\n } else {\n const isFull = items.length === maxSize\n // short circuit if full and the additional item does not come before the last item\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\n return add\n }\n\n let lo = 0,\n hi = items.length\n\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (comparator(items[mid], add) <= 0) {\n lo = mid + 1\n } else {\n hi = mid\n }\n }\n items.splice(lo, 0, add)\n return isFull ? items.pop()! : null\n }\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\n\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\n\nconst ZERO = JSBI.BigInt(0)\nconst ONE = JSBI.BigInt(1)\nconst TWO = JSBI.BigInt(2)\n\n/**\n * Computes floor(sqrt(value))\n * @param value the value for which to compute the square root, rounded down\n */\nexport function sqrt(value: JSBI): JSBI {\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\n\n // rely on built in sqrt if possible\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\n }\n\n let z: JSBI\n let x: JSBI\n z = value\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\n while (JSBI.lessThan(x, z)) {\n z = x\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\n }\n return z\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { Currency, Token, WETH9 } from '../entities'\n\n/**\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\n * @param currency the currency to wrap, if necessary\n * @param chainId the ID of the chain for wrapping\n */\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\n if (currency.isToken) {\n invariant(currency.chainId === chainId, 'CHAIN_ID')\n return currency\n }\n if (currency.isEther) return WETH9[chainId]\n throw new Error('CURRENCY')\n}\n","import { ChainId } from '../constants'\nimport { Currency, CurrencyAmount, Token } from '../entities'\nimport { wrappedCurrency } from './wrappedCurrency'\n\n/**\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\n * the input currency amount.\n */\nexport function wrappedCurrencyAmount(\n currencyAmount: CurrencyAmount,\n chainId: ChainId\n): CurrencyAmount {\n return CurrencyAmount.fromFractionalAmount(\n wrappedCurrency(currencyAmount.currency, chainId),\n currencyAmount.numerator,\n currencyAmount.denominator\n )\n}\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","added","subtracted","multiplied","divided","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","computePriceImpact","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","sortedInsert","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","MAX_SAFE_INTEGER","ZERO","ONE","TWO","sqrt","value","greaterThanOrEqual","Math","floor","toNumber","z","x","wrappedCurrency","wrappedCurrencyAmount"],"mappings":";;;;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,CAAZ,EAAgDR,GAAhD,CAAJ;AACD;;AACD,SAAOO,CAAP;AACD;;AC1BD;;;;;;AAKA,SAAgBE,gBAAgBrE,UAAoB8B;AAClD,MAAI9B,QAAQ,CAACxD,OAAb,EAAsB;AACpB,MAAUwD,QAAQ,CAAC8B,OAAT,KAAqBA,OAA/B,KAAA7E,SAAS,QAA+B,UAA/B,CAAT,CAAA;AACA,WAAO+C,QAAP;AACD;;AACD,MAAIA,QAAQ,CAACtD,OAAb,EAAsB,OAAOuF,KAAK,CAACH,OAAD,CAAZ;AACtB,QAAM,IAAI3D,KAAJ,CAAU,UAAV,CAAN;AACD;;ACZD;;;;;;AAKA,SAAgBmG,sBACdhD,gBACAQ;AAEA,SAAO/B,cAAc,CAACO,oBAAf,CACL+D,eAAe,CAAC/C,cAAc,CAACtB,QAAhB,EAA0B8B,OAA1B,CADV,EAELR,cAAc,CAACvD,SAFV,EAGLuD,cAAc,CAACtD,WAHV,CAAP;AAKD;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js b/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js new file mode 100644 index 00000000000..03ff402a968 --- /dev/null +++ b/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js @@ -0,0 +1,424 @@ +'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.ChainId || (exports.ChainId = {}))[(r.MAINNET = 1)] = 'MAINNET'), + (r[(r.ROPSTEN = 3)] = 'ROPSTEN'), + (r[(r.RINKEBY = 4)] = 'RINKEBY'), + (r[(r['GÖRLI'] = 5)] = 'GÖRLI'), + (r[(r.KOVAN = 42)] = 'KOVAN'), + ((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 = i.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff') +function f(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 l(t, r, n) { + return r && f(t.prototype, r), n && f(t, n), t +} +function m(t, r) { + ;(t.prototype = Object.create(r.prototype)), (t.prototype.constructor = t), (t.__proto__ = r) +} +function p(t, r) { + return t.isToken && r.isToken ? t.equals(r) : !t.isToken && !r.isToken && t.isEther === r.isEther +} +var h = function (t, r, n) { + ;(t >= 0 && t < 255 && Number.isInteger(t)) || o(!1), (this.decimals = t), (this.symbol = r), (this.name = n) + }, + y = (function (t) { + function r() { + var r + return ((r = t.call(this, 18, 'ETH', 'Ether') || this).isEther = !0), (r.isToken = !1), r + } + return m(r, t), r + })(h) +y.ETHER = new y() +var v, + g, + x = y.ETHER, + E = s(a), + N = s(u), + I = + (((v = {})[exports.Rounding.ROUND_DOWN] = E.ROUND_DOWN), + (v[exports.Rounding.ROUND_HALF_UP] = E.ROUND_HALF_UP), + (v[exports.Rounding.ROUND_UP] = E.ROUND_UP), + v), + R = + (((g = {})[exports.Rounding.ROUND_DOWN] = 0), + (g[exports.Rounding.ROUND_HALF_UP] = 1), + (g[exports.Rounding.ROUND_UP] = 3), + g), + T = (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), + E.set({ precision: t + 1, rounding: I[n] }) + var e = new E(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), + (N.DP = t), + (N.RM = R[n]), + new N(this.numerator.toString()).div(this.denominator.toString()).toFormat(t, r) + ) + }), + l(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 + ) + })(), + F = s(u), + A = (function (t) { + function r(r, n, e) { + var a + return ( + (a = t.call(this, n, e) || this), + i.lessThanOrEqual(a.quotient, d) || o(!1), + (a.currency = r), + (a.decimalScale = i.exponentiate(i.BigInt(10), i.BigInt(r.decimals))), + a + ) + } + m(r, t), + (r.fromRawAmount = function (t, n) { + return new r(t, n) + }), + (r.fromFractionalAmount = function (t, n, e) { + return new r(t, n, e) + }), + (r.ether = function (t) { + return r.fromRawAmount(y.ETHER, t) + }) + var n = r.prototype + return ( + (n.add = function (n) { + p(this.currency, 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) { + p(this.currency, 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: '' }), + (F.DP = this.currency.decimals), + new F(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(t) + ) + }), + r + ) + })(T), + C = new T(i.BigInt(100)) +function O(t) { + return new U(t.numerator, t.denominator) +} +var w, + U = (function (t) { + function r() { + var r + return ((r = t.apply(this, arguments) || this).isPercent = !0), r + } + m(r, t) + var n = r.prototype + return ( + (n.add = function (r) { + return O(t.prototype.add.call(this, r)) + }), + (n.subtract = function (r) { + return O(t.prototype.subtract.call(this, r)) + }), + (n.multiply = function (r) { + return O(t.prototype.multiply.call(this, r)) + }), + (n.divide = function (r) { + return O(t.prototype.divide.call(this, r)) + }), + (n.toSignificant = function (r, n, e) { + return void 0 === r && (r = 5), t.prototype.multiply.call(this, C).toSignificant(r, n, e) + }), + (n.toFixed = function (r, n, e) { + return void 0 === r && (r = 2), t.prototype.multiply.call(this, C).toFixed(r, n, e) + }), + r + ) + })(T), + P = (function (t) { + function r(r, n, e, o) { + var a + return ( + ((a = t.call(this, o, e) || this).baseCurrency = r), + (a.quoteCurrency = n), + (a.scalar = new T( + i.exponentiate(i.BigInt(10), i.BigInt(r.decimals)), + i.exponentiate(i.BigInt(10), i.BigInt(n.decimals)) + )), + a + ) + } + m(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) { + p(this.quoteCurrency, 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) { + p(r.currency, 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) + }), + l(r, [ + { + key: 'adjustedForDecimals', + get: function () { + return t.prototype.multiply.call(this, this.scalar) + }, + }, + ]), + r + ) + })(T) +function _(t) { + try { + return c.getAddress(t) + } catch (r) { + throw new Error(t + ' is not a valid address.') + } +} +var D = (function (t) { + function r(r, n, e, i, o) { + var a + return ( + ((a = t.call(this, e, i, o) || this).isEther = !1), (a.isToken = !0), (a.chainId = r), (a.address = _(n)), a + ) + } + m(r, t) + var n = r.prototype + return ( + (n.equals = function (t) { + return this === t || (this.chainId === t.chainId && this.address === t.address) + }), + (n.sortsBefore = function (t) { + return ( + this.chainId !== t.chainId && o(!1), + this.address === t.address && o(!1), + this.address.toLowerCase() < t.address.toLowerCase() + ) + }), + r + ) + })(h), + b = + (((w = {})[exports.ChainId.MAINNET] = new D( + exports.ChainId.MAINNET, + '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (w[exports.ChainId.ROPSTEN] = new D( + exports.ChainId.ROPSTEN, + '0xc778417E063141139Fce010982780140Aa0cD5Ab', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (w[exports.ChainId.RINKEBY] = new D( + exports.ChainId.RINKEBY, + '0xc778417E063141139Fce010982780140Aa0cD5Ab', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (w[exports.ChainId.GÖRLI] = new D( + exports.ChainId.GÖRLI, + '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (w[exports.ChainId.KOVAN] = new D( + exports.ChainId.KOVAN, + '0xd0A1E359811322d97991E03f863a0C30C2cF029C', + 18, + 'WETH9', + 'Wrapped Ether' + )), + w), + q = i.BigInt(Number.MAX_SAFE_INTEGER), + S = i.BigInt(0), + B = i.BigInt(1), + H = i.BigInt(2) +function W(t, r) { + if (t.isToken) return t.chainId !== r && o(!1), t + if (t.isEther) return b[r] + throw new Error('CURRENCY') +} +;(exports.CurrencyAmount = A), + (exports.ETHER = x), + (exports.Ether = y), + (exports.Fraction = T), + (exports.MaxUint256 = d), + (exports.Percent = U), + (exports.Price = P), + (exports.Token = D), + (exports.WETH9 = b), + (exports.computePriceImpact = function (t, r, n) { + var e = t.quote(r), + i = e.subtract(n).divide(e) + return new U(i.numerator, i.denominator) + }), + (exports.currencyEquals = p), + (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, q))) return i.BigInt(Math.floor(Math.sqrt(i.toNumber(t)))) + var r, n + for (r = t, n = i.add(i.divide(t, H), B); i.lessThan(n, r); ) (r = n), (n = i.divide(i.add(i.divide(t, n), n), H)) + return r + }), + (exports.validateAndParseAddress = _), + (exports.wrappedCurrency = W), + (exports.wrappedCurrencyAmount = function (t, r) { + return A.fromFractionalAmount(W(t.currency, r), t.numerator, t.denominator) + }) +//# sourceMappingURL=sdk-core.cjs.production.min.js.map diff --git a/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js.map b/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js.map new file mode 100644 index 00000000000..88d3531ddbf --- /dev/null +++ b/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sdk-core.cjs.production.min.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import { Currency } from '../entities/currency'\n\n/**\n * Compares two currencies for equality\n */\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\n if (currencyA.isToken && currencyB.isToken) {\n return currencyA.equals(currencyB)\n } else if (currencyA.isToken) {\n return false\n } else if (currencyB.isToken) {\n return false\n } else {\n return currencyA.isEther === currencyB.isEther\n }\n}\n","import invariant from 'tiny-invariant'\n\n/**\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\n *\n * The only instance of the base class `Currency` is Ether.\n */\nexport abstract class BaseCurrency {\n public abstract readonly isEther: boolean\n public abstract readonly isToken: boolean\n\n public readonly decimals: number\n public readonly symbol?: string\n public readonly name?: string\n\n /**\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\n * @param decimals decimals of the currency\n * @param symbol symbol of the currency\n * @param name of the currency\n */\n protected constructor(decimals: number, symbol?: string, name?: string) {\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\n\n this.decimals = decimals\n this.symbol = symbol\n this.name = name\n }\n}\n","import { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents the currency Ether\n */\nexport class Ether extends BaseCurrency {\n public readonly isEther: true = true\n public readonly isToken: false = false\n\n /**\n * Only called once by this class\n * @protected\n */\n protected constructor() {\n super(18, 'ETH', 'Ether')\n }\n\n /**\n * The only instance of the class `Ether`.\n */\n public static readonly ETHER: Ether = new Ether()\n}\n\nexport const ETHER = Ether.ETHER\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport _Decimal from 'decimal.js-light'\nimport _Big, { RoundingMode } from 'big.js'\nimport toFormat from 'toformat'\n\nimport { BigintIsh, Rounding } from '../../constants'\n\nconst Decimal = toFormat(_Decimal)\nconst Big = toFormat(_Big)\n\nconst toSignificantRounding = {\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\n}\n\nconst toFixedRounding = {\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\n}\n\nexport class Fraction {\n public readonly numerator: JSBI\n public readonly denominator: JSBI\n\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\n this.numerator = JSBI.BigInt(numerator)\n this.denominator = JSBI.BigInt(denominator)\n }\n\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\n return new Fraction(fractionish)\n\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\n throw new Error('Could not parse fraction')\n }\n\n // performs floor division\n public get quotient(): JSBI {\n return JSBI.divide(this.numerator, this.denominator)\n }\n\n // remainder after floor division\n public get remainder(): Fraction {\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\n }\n\n public invert(): Fraction {\n return new Fraction(this.denominator, this.numerator)\n }\n\n public add(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.add(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public subtract(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.subtract(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public lessThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.lessThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public equalTo(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.equal(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public greaterThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.greaterThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public multiply(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.numerator),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public divide(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(this.denominator, otherParsed.numerator)\n )\n }\n\n public toSignificant(\n significantDigits: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\n\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\n const quotient = new Decimal(this.numerator.toString())\n .div(this.denominator.toString())\n .toSignificantDigits(significantDigits)\n return quotient.toFormat(quotient.decimalPlaces(), format)\n }\n\n public toFixed(\n decimalPlaces: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\n\n Big.DP = decimalPlaces\n Big.RM = toFixedRounding[rounding]\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\n }\n\n /**\n * Helper method for converting any super class back to a fraction\n */\n public get asFraction(): Fraction {\n return new Fraction(this.numerator, this.denominator)\n }\n}\n","import invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport { Currency } from '../currency'\nimport { Ether } from '../ether'\nimport { Fraction } from './fraction'\nimport _Big from 'big.js'\n\nimport toFormat from 'toformat'\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\n\nconst Big = toFormat(_Big)\n\nexport class CurrencyAmount extends Fraction {\n public readonly currency: T\n public readonly decimalScale: JSBI\n\n /**\n * Returns a new currency amount instance from the\n * @param currency the currency in the amount\n * @param rawAmount the raw token or ether amount\n */\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\n return new CurrencyAmount(currency, rawAmount)\n }\n\n /**\n * Construct a currency amount with a denominator that is not equal to 1\n * @param currency the currency\n * @param numerator the numerator of the fractional token amount\n * @param denominator the denominator of the fractional token amount\n */\n public static fromFractionalAmount(\n currency: T,\n numerator: BigintIsh,\n denominator: BigintIsh\n ): CurrencyAmount {\n return new CurrencyAmount(currency, numerator, denominator)\n }\n\n /**\n * Helper that calls the constructor with the ETHER currency\n * @param rawAmount ether amount in wei\n */\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\n }\n\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\n super(numerator, denominator)\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\n this.currency = currency\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\n }\n\n public add(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const added = super.add(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\n }\n\n public subtract(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const subtracted = super.subtract(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\n }\n\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\n const multiplied = super.multiply(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\n }\n\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\n const divided = super.divide(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\n }\n\n public toSignificant(\n significantDigits: number = 6,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(\n decimalPlaces: number = this.currency.decimals,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\n }\n\n public toExact(format: object = { groupSeparator: '' }): string {\n Big.DP = this.currency.decimals\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\n }\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Fraction } from './fraction'\n\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\n\n/**\n * Converts a fraction to a percent\n * @param fraction the fraction to convert\n */\nfunction toPercent(fraction: Fraction): Percent {\n return new Percent(fraction.numerator, fraction.denominator)\n}\n\nexport class Percent extends Fraction {\n /**\n * This boolean prevents a fraction from being interpreted as a Percent\n */\n public readonly isPercent: true = true\n\n add(other: Fraction | BigintIsh): Percent {\n return toPercent(super.add(other))\n }\n\n subtract(other: Fraction | BigintIsh): Percent {\n return toPercent(super.subtract(other))\n }\n\n multiply(other: Fraction | BigintIsh): Percent {\n return toPercent(super.multiply(other))\n }\n\n divide(other: Fraction | BigintIsh): Percent {\n return toPercent(super.divide(other))\n }\n\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\n }\n}\n","import JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport invariant from 'tiny-invariant'\n\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Currency } from '../currency'\nimport { Fraction } from './fraction'\nimport { CurrencyAmount } from './currencyAmount'\n\nexport class Price extends Fraction {\n public readonly baseCurrency: TBase // input i.e. denominator\n public readonly quoteCurrency: TQuote // output i.e. numerator\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\n\n // denominator and numerator _must_ be raw, i.e. in the native representation\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\n super(numerator, denominator)\n\n this.baseCurrency = baseCurrency\n this.quoteCurrency = quoteCurrency\n this.scalar = new Fraction(\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\n )\n }\n\n /**\n * Flip the price, switching the base and quote currency\n */\n public invert(): Price {\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\n }\n\n /**\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\n * @param other the other price\n */\n public multiply(other: Price): Price {\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\n const fraction = super.multiply(other)\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\n }\n\n /**\n * Return the amount of quote currency corresponding to a given amount of the base currency\n * @param currencyAmount the amount of base currency to quote against the price\n */\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\n const result = super.multiply(currencyAmount)\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\n }\n\n /**\n * Get the value scaled by decimals for formatting\n * @private\n */\n private get adjustedForDecimals(): Fraction {\n return super.multiply(this.scalar)\n }\n\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\n }\n}\n","import { getAddress } from '@ethersproject/address'\n\n/**\n * Validates an address and returns the parsed (checksummed) version of that address\n * @param address the unchecksummed hex address\n */\nexport function validateAndParseAddress(address: string): string {\n try {\n return getAddress(address)\n } catch (error) {\n throw new Error(`${address} is not a valid address.`)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\nimport { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents an ERC20 token with a unique address and some metadata.\n */\nexport class Token extends BaseCurrency {\n public readonly isEther: false = false\n public readonly isToken: true = true\n\n public readonly chainId: ChainId | number\n public readonly address: string\n\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\n super(decimals, symbol, name)\n this.chainId = chainId\n this.address = validateAndParseAddress(address)\n }\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Token): boolean {\n // short circuit on reference equality\n if (this === other) {\n return true\n }\n return this.chainId === other.chainId && this.address === other.address\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: Token): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n}\n\nexport const WETH9: { [chainId in ChainId]: Token } = {\n [ChainId.MAINNET]: new Token(\n ChainId.MAINNET,\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.ROPSTEN]: new Token(\n ChainId.ROPSTEN,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.RINKEBY]: new Token(\n ChainId.RINKEBY,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether')\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\n\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\n\nconst ZERO = JSBI.BigInt(0)\nconst ONE = JSBI.BigInt(1)\nconst TWO = JSBI.BigInt(2)\n\n/**\n * Computes floor(sqrt(value))\n * @param value the value for which to compute the square root, rounded down\n */\nexport function sqrt(value: JSBI): JSBI {\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\n\n // rely on built in sqrt if possible\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\n }\n\n let z: JSBI\n let x: JSBI\n z = value\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\n while (JSBI.lessThan(x, z)) {\n z = x\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\n }\n return z\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { Currency, Token, WETH9 } from '../entities'\n\n/**\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\n * @param currency the currency to wrap, if necessary\n * @param chainId the ID of the chain for wrapping\n */\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\n if (currency.isToken) {\n invariant(currency.chainId === chainId, 'CHAIN_ID')\n return currency\n }\n if (currency.isEther) return WETH9[chainId]\n throw new Error('CURRENCY')\n}\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\n\n/**\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\n * @param midPrice mid price before the trade\n * @param inputAmount the input amount of the trade\n * @param outputAmount the output amount of the trade\n */\nexport function computePriceImpact(\n midPrice: Price,\n inputAmount: CurrencyAmount,\n outputAmount: CurrencyAmount\n): Percent {\n const quotedOutputAmount = midPrice.quote(inputAmount)\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\n return new Percent(priceImpact.numerator, priceImpact.denominator)\n}\n","import invariant from 'tiny-invariant'\n\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\n// `maxSize` by removing the last item\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\n\n // short circuit first item add\n if (items.length === 0) {\n items.push(add)\n return null\n } else {\n const isFull = items.length === maxSize\n // short circuit if full and the additional item does not come before the last item\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\n return add\n }\n\n let lo = 0,\n hi = items.length\n\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (comparator(items[mid], add) <= 0) {\n lo = mid + 1\n } else {\n hi = mid\n }\n }\n items.splice(lo, 0, add)\n return isFull ? items.pop()! : null\n }\n}\n","import { ChainId } from '../constants'\nimport { Currency, CurrencyAmount, Token } from '../entities'\nimport { wrappedCurrency } from './wrappedCurrency'\n\n/**\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\n * the input currency amount.\n */\nexport function wrappedCurrencyAmount(\n currencyAmount: CurrencyAmount,\n chainId: ChainId\n): CurrencyAmount {\n return CurrencyAmount.fromFractionalAmount(\n wrappedCurrency(currencyAmount.currency, chainId),\n currencyAmount.numerator,\n currencyAmount.denominator\n )\n}\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","this","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","_this","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","added","subtracted","multiplied","divided","_Fraction","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","MAX_SAFE_INTEGER","ZERO","ONE","TWO","wrappedCurrency","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","value","greaterThanOrEqual","Math","floor","sqrt","toNumber","z","x"],"mappings":"8IAKYA,EAQAC,EAKAC,4KAbAF,EAAAA,kBAAAA,4CAEVA,yBACAA,yBACAA,wBACAA,uBAGUC,EAAAA,oBAAAA,sDAEVA,oCAGUC,EAAAA,mBAAAA,mDAEVA,qCACAA,+BAGWC,EAAaC,EAAKC,OAAO,6YCnBtBC,EAAeC,EAAqBC,UAC9CD,EAAUE,SAAWD,EAAUC,QAC1BF,EAAUG,OAAOF,IACfD,EAAUE,UAEVD,EAAUC,SAGZF,EAAUI,UAAYH,EAAUG,YCNrBC,EAcpB,SAAsBC,EAAkBC,EAAiBC,GAC7CF,GAAY,GAAKA,EAAW,KAAOG,OAAOC,UAAUJ,IAA9DK,WAEKL,SAAWA,OACXC,OAASA,OACTC,KAAOA,GCrBHI,sDASH,GAAI,MAAO,yBARa,aACC,qBAFRP,GAeFO,QAAe,IAAIA,UAG/BC,EAAQD,EAAMC,MCfrBC,EAAUC,EAASC,GACnBC,EAAMF,EAASG,GAEfC,UACHxB,iBAASyB,YAAaN,EAAQM,aAC9BzB,iBAAS0B,eAAgBP,EAAQO,gBACjC1B,iBAAS2B,UAAWR,EAAQQ,YAGzBC,UACH5B,iBAASyB,gBACTzB,iBAAS0B,mBACT1B,iBAAS2B,eAGCE,wBA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bmF,EAASL,EAAMU,MAAS,4BHnBdC,MACT5H,EAAK6H,mBAAmBD,EAAOpB,IAAzC1F,MAGId,EAAKyC,SAASmF,EAAOrB,UAChBvG,EAAKC,OAAO6H,KAAKC,MAAMD,KAAKE,KAAKhI,EAAKiI,SAASL,UAGpDM,EACAC,MACJD,EAAIN,EACJO,EAAInI,EAAKmC,IAAInC,EAAK4C,OAAOgF,EAAOlB,GAAMD,GAC/BzG,EAAKyC,SAAS0F,EAAGD,IACtBA,EAAIC,EACJA,EAAInI,EAAK4C,OAAO5C,EAAKmC,IAAInC,EAAK4C,OAAOgF,EAAOO,GAAIA,GAAIzB,UAE/CwB,sGInBP5C,EACAQ,UAEOjC,EAAeQ,qBACpBsC,EAAgBrB,EAAexB,SAAUgC,GACzCR,EAAe1D,UACf0D,EAAezD"} \ No newline at end of file diff --git a/src/libs/sdk-core/dist/sdk-core.esm.js b/src/libs/sdk-core/dist/sdk-core.esm.js new file mode 100644 index 00000000000..27ba2671107 --- /dev/null +++ b/src/libs/sdk-core/dist/sdk-core.esm.js @@ -0,0 +1,855 @@ +import JSBI from 'jsbi' +import invariant from 'tiny-invariant' +import _Decimal from 'decimal.js-light' +import _Big from 'big.js' +import toFormat from 'toformat' +import { getAddress } from '@ethersproject/address' + +var ChainId +;(function (ChainId) { + ChainId[(ChainId['MAINNET'] = 1)] = 'MAINNET' + ChainId[(ChainId['ROPSTEN'] = 3)] = 'ROPSTEN' + ChainId[(ChainId['RINKEBY'] = 4)] = 'RINKEBY' + ChainId[(ChainId['G\xD6RLI'] = 5)] = 'G\xD6RLI' + ChainId[(ChainId['KOVAN'] = 42)] = 'KOVAN' + ChainId[(ChainId['POLYGON_AMOY'] = 80002)] = 'POLYGON_AMOY' +})(ChainId || (ChainId = {})) + +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) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i] + descriptor.enumerable = descriptor.enumerable || false + descriptor.configurable = true + if ('value' in descriptor) descriptor.writable = true + Object.defineProperty(target, descriptor.key, descriptor) + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps) + if (staticProps) _defineProperties(Constructor, staticProps) + return Constructor +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype) + subClass.prototype.constructor = subClass + subClass.__proto__ = superClass +} + +/** + * Compares two currencies for equality + */ +function currencyEquals(currencyA, currencyB) { + if (currencyA.isToken && currencyB.isToken) { + return currencyA.equals(currencyB) + } else if (currencyA.isToken) { + return false + } else if (currencyB.isToken) { + return false + } else { + return currencyA.isEther === currencyB.isEther + } +} + +/** + * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. + * + * The only instance of the base class `Currency` is Ether. + */ + +var BaseCurrency = + /** + * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. + * @param decimals decimals of the currency + * @param symbol symbol of the currency + * @param name of the currency + */ + function BaseCurrency(decimals, symbol, name) { + !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'DECIMALS') + : invariant(false) + : void 0 + this.decimals = decimals + this.symbol = symbol + this.name = name + } + +/** + * Represents the currency Ether + */ + +var Ether = /*#__PURE__*/ (function (_BaseCurrency) { + _inheritsLoose(Ether, _BaseCurrency) + + /** + * Only called once by this class + * @protected + */ + function Ether() { + var _this + + _this = _BaseCurrency.call(this, 18, 'ETH', 'Ether') || this + _this.isEther = true + _this.isToken = false + return _this + } + + return Ether +})(BaseCurrency) +/** + * The only instance of the class `Ether`. + */ + +Ether.ETHER = /*#__PURE__*/ new Ether() +var ETHER = Ether.ETHER + +var _toSignificantRoundin, _toFixedRounding +var Decimal = /*#__PURE__*/ toFormat(_Decimal) +var Big = /*#__PURE__*/ toFormat(_Big) +var toSignificantRounding = + ((_toSignificantRoundin = {}), + (_toSignificantRoundin[Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN), + (_toSignificantRoundin[Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP), + (_toSignificantRoundin[Rounding.ROUND_UP] = Decimal.ROUND_UP), + _toSignificantRoundin) +var toFixedRounding = + ((_toFixedRounding = {}), + (_toFixedRounding[Rounding.ROUND_DOWN] = 0), + (_toFixedRounding[Rounding.ROUND_HALF_UP] = 1), + (_toFixedRounding[Rounding.ROUND_UP] = 3), + _toFixedRounding) +var Fraction = /*#__PURE__*/ (function () { + function Fraction(numerator, denominator) { + if (denominator === void 0) { + denominator = JSBI.BigInt(1) + } + + this.numerator = JSBI.BigInt(numerator) + this.denominator = JSBI.BigInt(denominator) + } + + Fraction.tryParseFraction = function tryParseFraction(fractionish) { + if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') + return new Fraction(fractionish) + if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish + throw new Error('Could not parse fraction') + } // performs floor division + + var _proto = Fraction.prototype + + _proto.invert = function invert() { + return new Fraction(this.denominator, this.numerator) + } + + _proto.add = function add(other) { + var otherParsed = Fraction.tryParseFraction(other) + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator) + } + + return new Fraction( + JSBI.add( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ), + JSBI.multiply(this.denominator, otherParsed.denominator) + ) + } + + _proto.subtract = function subtract(other) { + var otherParsed = Fraction.tryParseFraction(other) + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator) + } + + return new Fraction( + JSBI.subtract( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ), + JSBI.multiply(this.denominator, otherParsed.denominator) + ) + } + + _proto.lessThan = function lessThan(other) { + var otherParsed = Fraction.tryParseFraction(other) + return JSBI.lessThan( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ) + } + + _proto.equalTo = function equalTo(other) { + var otherParsed = Fraction.tryParseFraction(other) + return JSBI.equal( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ) + } + + _proto.greaterThan = function greaterThan(other) { + var otherParsed = Fraction.tryParseFraction(other) + return JSBI.greaterThan( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(otherParsed.numerator, this.denominator) + ) + } + + _proto.multiply = function multiply(other) { + var otherParsed = Fraction.tryParseFraction(other) + return new Fraction( + JSBI.multiply(this.numerator, otherParsed.numerator), + JSBI.multiply(this.denominator, otherParsed.denominator) + ) + } + + _proto.divide = function divide(other) { + var otherParsed = Fraction.tryParseFraction(other) + return new Fraction( + JSBI.multiply(this.numerator, otherParsed.denominator), + JSBI.multiply(this.denominator, otherParsed.numerator) + ) + } + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '', + } + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_HALF_UP + } + + !Number.isInteger(significantDigits) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, significantDigits + ' is not an integer.') + : invariant(false) + : void 0 + !(significantDigits > 0) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, significantDigits + ' is not positive.') + : invariant(false) + : void 0 + Decimal.set({ + precision: significantDigits + 1, + rounding: toSignificantRounding[rounding], + }) + var quotient = new Decimal(this.numerator.toString()) + .div(this.denominator.toString()) + .toSignificantDigits(significantDigits) + return quotient.toFormat(quotient.decimalPlaces(), format) + } + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '', + } + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_HALF_UP + } + + !Number.isInteger(decimalPlaces) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, decimalPlaces + ' is not an integer.') + : invariant(false) + : void 0 + !(decimalPlaces >= 0) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, decimalPlaces + ' is negative.') + : invariant(false) + : void 0 + Big.DP = decimalPlaces + Big.RM = toFixedRounding[rounding] + return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format) + } + /** + * Helper method for converting any super class back to a fraction + */ + + _createClass(Fraction, [ + { + key: 'quotient', + get: function get() { + return JSBI.divide(this.numerator, this.denominator) + }, // remainder after floor division + }, + { + key: 'remainder', + get: function get() { + return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator) + }, + }, + { + key: 'asFraction', + get: function get() { + return new Fraction(this.numerator, this.denominator) + }, + }, + ]) + + return Fraction +})() + +var Big$1 = /*#__PURE__*/ toFormat(_Big) +var CurrencyAmount = /*#__PURE__*/ (function (_Fraction) { + _inheritsLoose(CurrencyAmount, _Fraction) + + function CurrencyAmount(currency, numerator, denominator) { + var _this + + _this = _Fraction.call(this, numerator, denominator) || this + !JSBI.lessThanOrEqual(_this.quotient, MaxUint256) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'AMOUNT') + : invariant(false) + : void 0 + _this.currency = currency + _this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals)) + return _this + } + /** + * Returns a new currency amount instance from the + * @param currency the currency in the amount + * @param rawAmount the raw token or ether amount + */ + + CurrencyAmount.fromRawAmount = function fromRawAmount(currency, rawAmount) { + return new CurrencyAmount(currency, rawAmount) + } + /** + * Construct a currency amount with a denominator that is not equal to 1 + * @param currency the currency + * @param numerator the numerator of the fractional token amount + * @param denominator the denominator of the fractional token amount + */ + + CurrencyAmount.fromFractionalAmount = function fromFractionalAmount(currency, numerator, denominator) { + return new CurrencyAmount(currency, numerator, denominator) + } + /** + * Helper that calls the constructor with the ETHER currency + * @param rawAmount ether amount in wei + */ + + CurrencyAmount.ether = function ether(rawAmount) { + return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount) + } + + var _proto = CurrencyAmount.prototype + + _proto.add = function add(other) { + !currencyEquals(this.currency, other.currency) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'CURRENCY') + : invariant(false) + : void 0 + + var added = _Fraction.prototype.add.call(this, other) + + return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator) + } + + _proto.subtract = function subtract(other) { + !currencyEquals(this.currency, other.currency) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'CURRENCY') + : invariant(false) + : void 0 + + var subtracted = _Fraction.prototype.subtract.call(this, other) + + return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator) + } + + _proto.multiply = function multiply(other) { + var multiplied = _Fraction.prototype.multiply.call(this, other) + + return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator) + } + + _proto.divide = function divide(other) { + var divided = _Fraction.prototype.divide.call(this, other) + + return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator) + } + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 6 + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_DOWN + } + + return _Fraction.prototype.divide.call(this, this.decimalScale).toSignificant(significantDigits, format, rounding) + } + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = this.currency.decimals + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_DOWN + } + + !(decimalPlaces <= this.currency.decimals) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'DECIMALS') + : invariant(false) + : void 0 + return _Fraction.prototype.divide.call(this, this.decimalScale).toFixed(decimalPlaces, format, rounding) + } + + _proto.toExact = function toExact(format) { + if (format === void 0) { + format = { + groupSeparator: '', + } + } + + Big$1.DP = this.currency.decimals + return new Big$1(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format) + } + + return CurrencyAmount +})(Fraction) + +var ONE_HUNDRED = /*#__PURE__*/ new Fraction(/*#__PURE__*/ JSBI.BigInt(100)) +/** + * Converts a fraction to a percent + * @param fraction the fraction to convert + */ + +function toPercent(fraction) { + return new Percent(fraction.numerator, fraction.denominator) +} + +var Percent = /*#__PURE__*/ (function (_Fraction) { + _inheritsLoose(Percent, _Fraction) + + function Percent() { + var _this + + _this = _Fraction.apply(this, arguments) || this + /** + * This boolean prevents a fraction from being interpreted as a Percent + */ + + _this.isPercent = true + return _this + } + + var _proto = Percent.prototype + + _proto.add = function add(other) { + return toPercent(_Fraction.prototype.add.call(this, other)) + } + + _proto.subtract = function subtract(other) { + return toPercent(_Fraction.prototype.subtract.call(this, other)) + } + + _proto.multiply = function multiply(other) { + return toPercent(_Fraction.prototype.multiply.call(this, other)) + } + + _proto.divide = function divide(other) { + return toPercent(_Fraction.prototype.divide.call(this, other)) + } + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 5 + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding) + } + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 2 + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding) + } + + return Percent +})(Fraction) + +var Price = /*#__PURE__*/ (function (_Fraction) { + _inheritsLoose(Price, _Fraction) + + // denominator and numerator _must_ be raw, i.e. in the native representation + function Price(baseCurrency, quoteCurrency, denominator, numerator) { + var _this + + _this = _Fraction.call(this, numerator, denominator) || this + _this.baseCurrency = baseCurrency + _this.quoteCurrency = quoteCurrency + _this.scalar = new Fraction( + JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)), + JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals)) + ) + return _this + } + /** + * Flip the price, switching the base and quote currency + */ + + var _proto = Price.prototype + + _proto.invert = function invert() { + return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator) + } + /** + * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency + * @param other the other price + */ + + _proto.multiply = function multiply(other) { + !currencyEquals(this.quoteCurrency, other.baseCurrency) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'TOKEN') + : invariant(false) + : void 0 + + var fraction = _Fraction.prototype.multiply.call(this, other) + + return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator) + } + /** + * Return the amount of quote currency corresponding to a given amount of the base currency + * @param currencyAmount the amount of base currency to quote against the price + */ + + _proto.quote = function quote(currencyAmount) { + !currencyEquals(currencyAmount.currency, this.baseCurrency) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'TOKEN') + : invariant(false) + : void 0 + + var result = _Fraction.prototype.multiply.call(this, currencyAmount) + + return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator) + } + /** + * Get the value scaled by decimals for formatting + * @private + */ + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 6 + } + + return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding) + } + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 4 + } + + return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding) + } + + _createClass(Price, [ + { + key: 'adjustedForDecimals', + get: function get() { + return _Fraction.prototype.multiply.call(this, this.scalar) + }, + }, + ]) + + return Price +})(Fraction) + +/** + * Validates an address and returns the parsed (checksummed) version of that address + * @param address the unchecksummed hex address + */ + +function validateAndParseAddress(address) { + try { + return getAddress(address) + } catch (error) { + throw new Error(address + ' is not a valid address.') + } +} + +var _WETH +/** + * Represents an ERC20 token with a unique address and some metadata. + */ + +var Token = /*#__PURE__*/ (function (_BaseCurrency) { + _inheritsLoose(Token, _BaseCurrency) + + function Token(chainId, address, decimals, symbol, name) { + var _this + + _this = _BaseCurrency.call(this, decimals, symbol, name) || this + _this.isEther = false + _this.isToken = true + _this.chainId = chainId + _this.address = validateAndParseAddress(address) + return _this + } + /** + * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. + * @param other other token to compare + */ + + var _proto = Token.prototype + + _proto.equals = function equals(other) { + // short circuit on reference equality + if (this === other) { + return true + } + + return this.chainId === other.chainId && this.address === other.address + } + /** + * Returns true if the address of this token sorts before the address of the other token + * @param other other token to compare + * @throws if the tokens have the same address + * @throws if the tokens are on different chains + */ + + _proto.sortsBefore = function sortsBefore(other) { + !(this.chainId === other.chainId) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'CHAIN_IDS') + : invariant(false) + : void 0 + !(this.address !== other.address) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'ADDRESSES') + : invariant(false) + : void 0 + return this.address.toLowerCase() < other.address.toLowerCase() + } + + return Token +})(BaseCurrency) +var WETH9 = + ((_WETH = {}), + (_WETH[ChainId.MAINNET] = /*#__PURE__*/ new Token( + ChainId.MAINNET, + '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[ChainId.ROPSTEN] = /*#__PURE__*/ new Token( + ChainId.ROPSTEN, + '0xc778417E063141139Fce010982780140Aa0cD5Ab', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[ChainId.RINKEBY] = /*#__PURE__*/ new Token( + ChainId.RINKEBY, + '0xc778417E063141139Fce010982780140Aa0cD5Ab', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[ChainId.GÖRLI] = /*#__PURE__*/ new Token( + ChainId.GÖRLI, + '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[ChainId.KOVAN] = /*#__PURE__*/ new Token( + ChainId.KOVAN, + '0xd0A1E359811322d97991E03f863a0C30C2cF029C', + 18, + 'WETH9', + 'Wrapped Ether' + )), + (_WETH[ChainId.POLYGON_AMOY] = /*#__PURE__*/ new Token( + ChainId.POLYGON_AMOY, + '0xd7a19e388c52D3580B6428F29494883A5d40C330', + 18, + 'WETH9', + 'Wrapped Ether' + )), + _WETH) + +/** + * Returns the percent difference between the mid price and the execution price, i.e. price impact. + * @param midPrice mid price before the trade + * @param inputAmount the input amount of the trade + * @param outputAmount the output amount of the trade + */ + +function computePriceImpact(midPrice, inputAmount, outputAmount) { + var quotedOutputAmount = midPrice.quote(inputAmount) // calculate price impact := (exactQuote - outputAmount) / exactQuote + + var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount) + return new Percent(priceImpact.numerator, priceImpact.denominator) +} + +// `maxSize` by removing the last item + +function sortedInsert(items, add, maxSize, comparator) { + !(maxSize > 0) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'MAX_SIZE_ZERO') + : invariant(false) + : void 0 // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize + + !(items.length <= maxSize) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'ITEMS_SIZE') + : invariant(false) + : void 0 // short circuit first item add + + if (items.length === 0) { + items.push(add) + return null + } else { + var isFull = items.length === maxSize // short circuit if full and the additional item does not come before the last item + + if (isFull && comparator(items[items.length - 1], add) <= 0) { + return add + } + + var lo = 0, + hi = items.length + + while (lo < hi) { + var mid = (lo + hi) >>> 1 + + if (comparator(items[mid], add) <= 0) { + lo = mid + 1 + } else { + hi = mid + } + } + + items.splice(lo, 0, add) + return isFull ? items.pop() : null + } +} + +var MAX_SAFE_INTEGER = /*#__PURE__*/ JSBI.BigInt(Number.MAX_SAFE_INTEGER) +var ZERO = /*#__PURE__*/ JSBI.BigInt(0) +var ONE = /*#__PURE__*/ JSBI.BigInt(1) +var TWO = /*#__PURE__*/ JSBI.BigInt(2) +/** + * Computes floor(sqrt(value)) + * @param value the value for which to compute the square root, rounded down + */ + +function sqrt(value) { + !JSBI.greaterThanOrEqual(value, ZERO) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'NEGATIVE') + : invariant(false) + : void 0 // rely on built in sqrt if possible + + if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) { + return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value)))) + } + + var z + var x + z = value + x = JSBI.add(JSBI.divide(value, TWO), ONE) + + while (JSBI.lessThan(x, z)) { + z = x + x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO) + } + + return z +} + +/** + * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token + * @param currency the currency to wrap, if necessary + * @param chainId the ID of the chain for wrapping + */ + +function wrappedCurrency(currency, chainId) { + if (currency.isToken) { + !(currency.chainId === chainId) + ? process.env.NODE_ENV !== 'production' + ? invariant(false, 'CHAIN_ID') + : invariant(false) + : void 0 + return currency + } + + if (currency.isEther) return WETH9[chainId] + throw new Error('CURRENCY') +} + +/** + * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. + * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns + * the input currency amount. + */ + +function wrappedCurrencyAmount(currencyAmount, chainId) { + return CurrencyAmount.fromFractionalAmount( + wrappedCurrency(currencyAmount.currency, chainId), + currencyAmount.numerator, + currencyAmount.denominator + ) +} + +export { + ChainId, + CurrencyAmount, + ETHER, + Ether, + Fraction, + MaxUint256, + Percent, + Price, + Rounding, + Token, + TradeType, + WETH9, + computePriceImpact, + currencyEquals, + sortedInsert, + sqrt, + validateAndParseAddress, + wrappedCurrency, + wrappedCurrencyAmount, +} +//# sourceMappingURL=sdk-core.esm.js.map diff --git a/src/libs/sdk-core/dist/sdk-core.esm.js.map b/src/libs/sdk-core/dist/sdk-core.esm.js.map new file mode 100644 index 00000000000..643d3380023 --- /dev/null +++ b/src/libs/sdk-core/dist/sdk-core.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sdk-core.esm.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import { Currency } from '../entities/currency'\n\n/**\n * Compares two currencies for equality\n */\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\n if (currencyA.isToken && currencyB.isToken) {\n return currencyA.equals(currencyB)\n } else if (currencyA.isToken) {\n return false\n } else if (currencyB.isToken) {\n return false\n } else {\n return currencyA.isEther === currencyB.isEther\n }\n}\n","import invariant from 'tiny-invariant'\n\n/**\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\n *\n * The only instance of the base class `Currency` is Ether.\n */\nexport abstract class BaseCurrency {\n public abstract readonly isEther: boolean\n public abstract readonly isToken: boolean\n\n public readonly decimals: number\n public readonly symbol?: string\n public readonly name?: string\n\n /**\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\n * @param decimals decimals of the currency\n * @param symbol symbol of the currency\n * @param name of the currency\n */\n protected constructor(decimals: number, symbol?: string, name?: string) {\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\n\n this.decimals = decimals\n this.symbol = symbol\n this.name = name\n }\n}\n","import { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents the currency Ether\n */\nexport class Ether extends BaseCurrency {\n public readonly isEther: true = true\n public readonly isToken: false = false\n\n /**\n * Only called once by this class\n * @protected\n */\n protected constructor() {\n super(18, 'ETH', 'Ether')\n }\n\n /**\n * The only instance of the class `Ether`.\n */\n public static readonly ETHER: Ether = new Ether()\n}\n\nexport const ETHER = Ether.ETHER\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport _Decimal from 'decimal.js-light'\nimport _Big, { RoundingMode } from 'big.js'\nimport toFormat from 'toformat'\n\nimport { BigintIsh, Rounding } from '../../constants'\n\nconst Decimal = toFormat(_Decimal)\nconst Big = toFormat(_Big)\n\nconst toSignificantRounding = {\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\n}\n\nconst toFixedRounding = {\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\n}\n\nexport class Fraction {\n public readonly numerator: JSBI\n public readonly denominator: JSBI\n\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\n this.numerator = JSBI.BigInt(numerator)\n this.denominator = JSBI.BigInt(denominator)\n }\n\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\n return new Fraction(fractionish)\n\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\n throw new Error('Could not parse fraction')\n }\n\n // performs floor division\n public get quotient(): JSBI {\n return JSBI.divide(this.numerator, this.denominator)\n }\n\n // remainder after floor division\n public get remainder(): Fraction {\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\n }\n\n public invert(): Fraction {\n return new Fraction(this.denominator, this.numerator)\n }\n\n public add(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.add(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public subtract(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.subtract(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public lessThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.lessThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public equalTo(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.equal(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public greaterThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.greaterThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public multiply(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.numerator),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public divide(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(this.denominator, otherParsed.numerator)\n )\n }\n\n public toSignificant(\n significantDigits: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\n\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\n const quotient = new Decimal(this.numerator.toString())\n .div(this.denominator.toString())\n .toSignificantDigits(significantDigits)\n return quotient.toFormat(quotient.decimalPlaces(), format)\n }\n\n public toFixed(\n decimalPlaces: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\n\n Big.DP = decimalPlaces\n Big.RM = toFixedRounding[rounding]\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\n }\n\n /**\n * Helper method for converting any super class back to a fraction\n */\n public get asFraction(): Fraction {\n return new Fraction(this.numerator, this.denominator)\n }\n}\n","import invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport { Currency } from '../currency'\nimport { Ether } from '../ether'\nimport { Fraction } from './fraction'\nimport _Big from 'big.js'\n\nimport toFormat from 'toformat'\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\n\nconst Big = toFormat(_Big)\n\nexport class CurrencyAmount extends Fraction {\n public readonly currency: T\n public readonly decimalScale: JSBI\n\n /**\n * Returns a new currency amount instance from the\n * @param currency the currency in the amount\n * @param rawAmount the raw token or ether amount\n */\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\n return new CurrencyAmount(currency, rawAmount)\n }\n\n /**\n * Construct a currency amount with a denominator that is not equal to 1\n * @param currency the currency\n * @param numerator the numerator of the fractional token amount\n * @param denominator the denominator of the fractional token amount\n */\n public static fromFractionalAmount(\n currency: T,\n numerator: BigintIsh,\n denominator: BigintIsh\n ): CurrencyAmount {\n return new CurrencyAmount(currency, numerator, denominator)\n }\n\n /**\n * Helper that calls the constructor with the ETHER currency\n * @param rawAmount ether amount in wei\n */\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\n }\n\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\n super(numerator, denominator)\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\n this.currency = currency\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\n }\n\n public add(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const added = super.add(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\n }\n\n public subtract(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const subtracted = super.subtract(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\n }\n\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\n const multiplied = super.multiply(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\n }\n\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\n const divided = super.divide(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\n }\n\n public toSignificant(\n significantDigits: number = 6,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(\n decimalPlaces: number = this.currency.decimals,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\n }\n\n public toExact(format: object = { groupSeparator: '' }): string {\n Big.DP = this.currency.decimals\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\n }\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Fraction } from './fraction'\n\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\n\n/**\n * Converts a fraction to a percent\n * @param fraction the fraction to convert\n */\nfunction toPercent(fraction: Fraction): Percent {\n return new Percent(fraction.numerator, fraction.denominator)\n}\n\nexport class Percent extends Fraction {\n /**\n * This boolean prevents a fraction from being interpreted as a Percent\n */\n public readonly isPercent: true = true\n\n add(other: Fraction | BigintIsh): Percent {\n return toPercent(super.add(other))\n }\n\n subtract(other: Fraction | BigintIsh): Percent {\n return toPercent(super.subtract(other))\n }\n\n multiply(other: Fraction | BigintIsh): Percent {\n return toPercent(super.multiply(other))\n }\n\n divide(other: Fraction | BigintIsh): Percent {\n return toPercent(super.divide(other))\n }\n\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\n }\n}\n","import JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport invariant from 'tiny-invariant'\n\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Currency } from '../currency'\nimport { Fraction } from './fraction'\nimport { CurrencyAmount } from './currencyAmount'\n\nexport class Price extends Fraction {\n public readonly baseCurrency: TBase // input i.e. denominator\n public readonly quoteCurrency: TQuote // output i.e. numerator\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\n\n // denominator and numerator _must_ be raw, i.e. in the native representation\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\n super(numerator, denominator)\n\n this.baseCurrency = baseCurrency\n this.quoteCurrency = quoteCurrency\n this.scalar = new Fraction(\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\n )\n }\n\n /**\n * Flip the price, switching the base and quote currency\n */\n public invert(): Price {\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\n }\n\n /**\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\n * @param other the other price\n */\n public multiply(other: Price): Price {\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\n const fraction = super.multiply(other)\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\n }\n\n /**\n * Return the amount of quote currency corresponding to a given amount of the base currency\n * @param currencyAmount the amount of base currency to quote against the price\n */\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\n const result = super.multiply(currencyAmount)\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\n }\n\n /**\n * Get the value scaled by decimals for formatting\n * @private\n */\n private get adjustedForDecimals(): Fraction {\n return super.multiply(this.scalar)\n }\n\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\n }\n}\n","import { getAddress } from '@ethersproject/address'\n\n/**\n * Validates an address and returns the parsed (checksummed) version of that address\n * @param address the unchecksummed hex address\n */\nexport function validateAndParseAddress(address: string): string {\n try {\n return getAddress(address)\n } catch (error) {\n throw new Error(`${address} is not a valid address.`)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\nimport { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents an ERC20 token with a unique address and some metadata.\n */\nexport class Token extends BaseCurrency {\n public readonly isEther: false = false\n public readonly isToken: true = true\n\n public readonly chainId: ChainId | number\n public readonly address: string\n\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\n super(decimals, symbol, name)\n this.chainId = chainId\n this.address = validateAndParseAddress(address)\n }\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Token): boolean {\n // short circuit on reference equality\n if (this === other) {\n return true\n }\n return this.chainId === other.chainId && this.address === other.address\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: Token): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n}\n\nexport const WETH9: { [chainId in ChainId]: Token } = {\n [ChainId.MAINNET]: new Token(\n ChainId.MAINNET,\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.ROPSTEN]: new Token(\n ChainId.ROPSTEN,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.RINKEBY]: new Token(\n ChainId.RINKEBY,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether')\n}\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\n\n/**\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\n * @param midPrice mid price before the trade\n * @param inputAmount the input amount of the trade\n * @param outputAmount the output amount of the trade\n */\nexport function computePriceImpact(\n midPrice: Price,\n inputAmount: CurrencyAmount,\n outputAmount: CurrencyAmount\n): Percent {\n const quotedOutputAmount = midPrice.quote(inputAmount)\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\n return new Percent(priceImpact.numerator, priceImpact.denominator)\n}\n","import invariant from 'tiny-invariant'\n\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\n// `maxSize` by removing the last item\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\n\n // short circuit first item add\n if (items.length === 0) {\n items.push(add)\n return null\n } else {\n const isFull = items.length === maxSize\n // short circuit if full and the additional item does not come before the last item\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\n return add\n }\n\n let lo = 0,\n hi = items.length\n\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (comparator(items[mid], add) <= 0) {\n lo = mid + 1\n } else {\n hi = mid\n }\n }\n items.splice(lo, 0, add)\n return isFull ? items.pop()! : null\n }\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\n\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\n\nconst ZERO = JSBI.BigInt(0)\nconst ONE = JSBI.BigInt(1)\nconst TWO = JSBI.BigInt(2)\n\n/**\n * Computes floor(sqrt(value))\n * @param value the value for which to compute the square root, rounded down\n */\nexport function sqrt(value: JSBI): JSBI {\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\n\n // rely on built in sqrt if possible\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\n }\n\n let z: JSBI\n let x: JSBI\n z = value\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\n while (JSBI.lessThan(x, z)) {\n z = x\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\n }\n return z\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { Currency, Token, WETH9 } from '../entities'\n\n/**\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\n * @param currency the currency to wrap, if necessary\n * @param chainId the ID of the chain for wrapping\n */\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\n if (currency.isToken) {\n invariant(currency.chainId === chainId, 'CHAIN_ID')\n return currency\n }\n if (currency.isEther) return WETH9[chainId]\n throw new Error('CURRENCY')\n}\n","import { ChainId } from '../constants'\nimport { Currency, CurrencyAmount, Token } from '../entities'\nimport { wrappedCurrency } from './wrappedCurrency'\n\n/**\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\n * the input currency amount.\n */\nexport function wrappedCurrencyAmount(\n currencyAmount: CurrencyAmount,\n chainId: ChainId\n): CurrencyAmount {\n return CurrencyAmount.fromFractionalAmount(\n wrappedCurrency(currencyAmount.currency, chainId),\n currencyAmount.numerator,\n currencyAmount.denominator\n )\n}\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","added","subtracted","multiplied","divided","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","computePriceImpact","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","sortedInsert","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","MAX_SAFE_INTEGER","ZERO","ONE","TWO","sqrt","value","greaterThanOrEqual","Math","floor","toNumber","z","x","wrappedCurrency","wrappedCurrencyAmount"],"mappings":";;;;;;;IAKYA;;AAAZ,WAAYA;AACVA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,gCAAA,aAAA;AACAA,EAAAA,8BAAA,UAAA;AACD,CAND,EAAYA,OAAO,KAAPA,OAAO,KAAA,CAAnB;;IAQYC;;AAAZ,WAAYA;AACVA,EAAAA,uCAAA,gBAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAHD,EAAYA,SAA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;;;;AAKA,SAAgBE,gBAAgBrE,UAAoB8B;AAClD,MAAI9B,QAAQ,CAACxD,OAAb,EAAsB;AACpB,MAAUwD,QAAQ,CAAC8B,OAAT,KAAqBA,OAA/B,4CAAA7E,SAAS,QAA+B,UAA/B,CAAT,GAAAA,SAAS,OAAT;AACA,WAAO+C,QAAP;AACD;;AACD,MAAIA,QAAQ,CAACtD,OAAb,EAAsB,OAAOuF,KAAK,CAACH,OAAD,CAAZ;AACtB,QAAM,IAAI3D,KAAJ,CAAU,UAAV,CAAN;AACD;;ACZD;;;;;;AAKA,SAAgBmG,sBACdhD,gBACAQ;AAEA,SAAO/B,cAAc,CAACO,oBAAf,CACL+D,eAAe,CAAC/C,cAAc,CAACtB,QAAhB,EAA0B8B,OAA1B,CADV,EAELR,cAAc,CAACvD,SAFV,EAGLuD,cAAc,CAACtD,WAHV,CAAP;AAKD;;;;"} \ No newline at end of file diff --git a/src/libs/sdk-core/dist/utils/computePriceImpact.d.ts b/src/libs/sdk-core/dist/utils/computePriceImpact.d.ts new file mode 100644 index 00000000000..0161f44e74b --- /dev/null +++ b/src/libs/sdk-core/dist/utils/computePriceImpact.d.ts @@ -0,0 +1,8 @@ +import { Currency, CurrencyAmount, Percent, Price } from '../entities'; +/** + * Returns the percent difference between the mid price and the execution price, i.e. price impact. + * @param midPrice mid price before the trade + * @param inputAmount the input amount of the trade + * @param outputAmount the output amount of the trade + */ +export declare function computePriceImpact(midPrice: Price, inputAmount: CurrencyAmount, outputAmount: CurrencyAmount): Percent; diff --git a/src/libs/sdk-core/dist/utils/currencyEquals.d.ts b/src/libs/sdk-core/dist/utils/currencyEquals.d.ts new file mode 100644 index 00000000000..f434dc5bba9 --- /dev/null +++ b/src/libs/sdk-core/dist/utils/currencyEquals.d.ts @@ -0,0 +1,5 @@ +import { Currency } from '../entities/currency'; +/** + * Compares two currencies for equality + */ +export declare function currencyEquals(currencyA: Currency, currencyB: Currency): boolean; diff --git a/src/libs/sdk-core/dist/utils/index.d.ts b/src/libs/sdk-core/dist/utils/index.d.ts new file mode 100644 index 00000000000..6440331c9e6 --- /dev/null +++ b/src/libs/sdk-core/dist/utils/index.d.ts @@ -0,0 +1,7 @@ +export { computePriceImpact } from './computePriceImpact'; +export { currencyEquals } from './currencyEquals'; +export { validateAndParseAddress } from './validateAndParseAddress'; +export { sortedInsert } from './sortedInsert'; +export { sqrt } from './sqrt'; +export { wrappedCurrency } from './wrappedCurrency'; +export { wrappedCurrencyAmount } from './wrappedCurrencyAmount'; diff --git a/src/libs/sdk-core/dist/utils/sortedInsert.d.ts b/src/libs/sdk-core/dist/utils/sortedInsert.d.ts new file mode 100644 index 00000000000..562be26f112 --- /dev/null +++ b/src/libs/sdk-core/dist/utils/sortedInsert.d.ts @@ -0,0 +1 @@ +export declare function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null; diff --git a/src/libs/sdk-core/dist/utils/sqrt.d.ts b/src/libs/sdk-core/dist/utils/sqrt.d.ts new file mode 100644 index 00000000000..f1adc876d72 --- /dev/null +++ b/src/libs/sdk-core/dist/utils/sqrt.d.ts @@ -0,0 +1,7 @@ +import JSBI from 'jsbi'; +export declare const MAX_SAFE_INTEGER: JSBI; +/** + * Computes floor(sqrt(value)) + * @param value the value for which to compute the square root, rounded down + */ +export declare function sqrt(value: JSBI): JSBI; diff --git a/src/libs/sdk-core/dist/utils/validateAndParseAddress.d.ts b/src/libs/sdk-core/dist/utils/validateAndParseAddress.d.ts new file mode 100644 index 00000000000..98f35a8beb2 --- /dev/null +++ b/src/libs/sdk-core/dist/utils/validateAndParseAddress.d.ts @@ -0,0 +1,5 @@ +/** + * Validates an address and returns the parsed (checksummed) version of that address + * @param address the unchecksummed hex address + */ +export declare function validateAndParseAddress(address: string): string; diff --git a/src/libs/sdk-core/dist/utils/wrappedCurrency.d.ts b/src/libs/sdk-core/dist/utils/wrappedCurrency.d.ts new file mode 100644 index 00000000000..70a51073993 --- /dev/null +++ b/src/libs/sdk-core/dist/utils/wrappedCurrency.d.ts @@ -0,0 +1,8 @@ +import { ChainId } from '../constants' +import { Currency, Token } from '../entities' +/** + * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token + * @param currency the currency to wrap, if necessary + * @param chainId the ID of the chain for wrapping + */ +export declare function wrappedCurrency(currency: Currency, chainId: ChainId): Token diff --git a/src/libs/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts b/src/libs/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts new file mode 100644 index 00000000000..129599b41dc --- /dev/null +++ b/src/libs/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts @@ -0,0 +1,11 @@ +import { ChainId } from '../constants' +import { Currency, CurrencyAmount, Token } from '../entities' +/** + * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. + * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns + * the input currency amount. + */ +export declare function wrappedCurrencyAmount( + currencyAmount: CurrencyAmount, + chainId: ChainId +): CurrencyAmount diff --git a/src/libs/sdk-core/package.json b/src/libs/sdk-core/package.json new file mode 100644 index 00000000000..b6cee43afba --- /dev/null +++ b/src/libs/sdk-core/package.json @@ -0,0 +1,44 @@ +{ + "name": "@uniswap/sdk-core", + "license": "MIT", + "version": "3.0.0-alpha.1", + "description": "⚒️ An SDK for building applications on top of Uniswap V3", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "files": [ + "dist" + ], + "repository": "https://github.com/Uniswap/uniswap-sdk-core.git", + "keywords": [ + "uniswap", + "ethereum" + ], + "module": "dist/sdk-core.esm.js", + "scripts": { + "build": "tsdx build", + "start": "tsdx watch", + "test": "tsdx test", + "prepublishOnly": "tsdx build" + }, + "dependencies": { + "@ethersproject/address": "^5.0.2", + "big.js": "^5.2.2", + "decimal.js-light": "^2.5.0", + "jsbi": "^3.1.4", + "tiny-invariant": "^1.1.0", + "toformat": "^2.0.0" + }, + "devDependencies": { + "@types/big.js": "^4.0.5", + "@types/jest": "^24.0.25", + "tsdx": "^0.14.1" + }, + "engines": { + "node": ">=10" + }, + "prettier": { + "printWidth": 120, + "semi": false, + "singleQuote": true + } +} diff --git a/src/libs/sdk-core/yarn.lock b/src/libs/sdk-core/yarn.lock new file mode 100644 index 00000000000..9c008be4fa8 --- /dev/null +++ b/src/libs/sdk-core/yarn.lock @@ -0,0 +1,6823 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ampproject/remapping@^2.2.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" + integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2", "@babel/code-frame@^7.5.5": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" + integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" + picocolors "^1.0.0" + +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.3.tgz#99488264a56b2aded63983abd6a417f03b92ed02" + integrity sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g== + +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.4.4", "@babel/core@^7.7.5": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" + integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.0" + "@babel/generator" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.0" + "@babel/parser" "^7.26.0" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.26.0" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/generator@^7.26.0", "@babel/generator@^7.26.3": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" + integrity sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== + dependencies: + "@babel/parser" "^7.26.3" + "@babel/types" "^7.26.3" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + +"@babel/helper-annotate-as-pure@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" + integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== + dependencies: + "@babel/types" "^7.25.9" + +"@babel/helper-compilation-targets@^7.10.4", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" + integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== + dependencies: + "@babel/compat-data" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" + integrity sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-member-expression-to-functions" "^7.25.9" + "@babel/helper-optimise-call-expression" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/traverse" "^7.25.9" + semver "^6.3.1" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.25.9": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.26.3.tgz#5169756ecbe1d95f7866b90bb555b022595302a0" + integrity sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + regexpu-core "^6.2.0" + semver "^6.3.1" + +"@babel/helper-define-polyfill-provider@^0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.0.3.tgz#df9da66285b884ce66417abdd0b6ca91198149bd" + integrity sha512-dULDd/APiP4JowYDAMosecKOi/1v+UId99qhBGiO3myM29KtAVKS/R3x3OJJNBR0FeYB1BcYb2dCwkhqvxWXXQ== + dependencies: + "@babel/helper-compilation-targets" "^7.10.4" + "@babel/helper-module-imports" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/traverse" "^7.11.5" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + semver "^6.1.2" + +"@babel/helper-define-polyfill-provider@^0.6.2", "@babel/helper-define-polyfill-provider@^0.6.3": + version "0.6.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" + integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== + dependencies: + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-plugin-utils" "^7.22.5" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + +"@babel/helper-member-expression-to-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" + integrity sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" + integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" + integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== + dependencies: + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/helper-optimise-call-expression@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" + integrity sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== + dependencies: + "@babel/types" "^7.25.9" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" + integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== + +"@babel/helper-remap-async-to-generator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" + integrity sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-wrap-function" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/helper-replace-supers@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz#ba447224798c3da3f8713fc272b145e33da6a5c5" + integrity sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.25.9" + "@babel/helper-optimise-call-expression" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/helper-skip-transparent-expression-wrappers@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" + integrity sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + +"@babel/helper-validator-option@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" + integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== + +"@babel/helper-wrap-function@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz#d99dfd595312e6c894bd7d237470025c85eea9d0" + integrity sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g== + dependencies: + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helpers@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" + integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== + dependencies: + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.11.5", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.3", "@babel/parser@^7.7.0": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" + integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== + dependencies: + "@babel/types" "^7.26.3" + +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" + integrity sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/plugin-bugfix-safari-class-field-initializer-scope@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz#af9e4fb63ccb8abcb92375b2fcfe36b60c774d30" + integrity sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz#e8dc26fcd616e6c5bf2bd0d5a2c151d4f92a9137" + integrity sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz#807a667f9158acac6f6164b4beb85ad9ebc9e1d1" + integrity sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/plugin-transform-optional-chaining" "^7.25.9" + +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz#de7093f1e7deaf68eadd7cc6b07f2ab82543269e" + integrity sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/plugin-proposal-class-properties@^7.4.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" + integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": + version "7.21.0-placeholder-for-preset-env.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" + integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-import-assertions@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" + integrity sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-syntax-import-attributes@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" + integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-syntax-import-meta@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" + integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-arrow-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz#7821d4410bee5daaadbb4cdd9a6649704e176845" + integrity sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-async-generator-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" + integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-remap-async-to-generator" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/plugin-transform-async-to-generator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz#c80008dacae51482793e5a9c08b39a5be7e12d71" + integrity sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== + dependencies: + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-remap-async-to-generator" "^7.25.9" + +"@babel/plugin-transform-block-scoped-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz#5700691dbd7abb93de300ca7be94203764fce458" + integrity sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-block-scoping@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz#c33665e46b06759c93687ca0f84395b80c0473a1" + integrity sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-class-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz#a8ce84fedb9ad512549984101fa84080a9f5f51f" + integrity sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-class-static-block@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz#6c8da219f4eb15cae9834ec4348ff8e9e09664a0" + integrity sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-classes@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz#7152457f7880b593a63ade8a861e6e26a4469f52" + integrity sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + "@babel/traverse" "^7.25.9" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz#db36492c78460e534b8852b1d5befe3c923ef10b" + integrity sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/template" "^7.25.9" + +"@babel/plugin-transform-destructuring@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz#966ea2595c498224340883602d3cfd7a0c79cea1" + integrity sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-dotall-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz#bad7945dd07734ca52fe3ad4e872b40ed09bb09a" + integrity sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-duplicate-keys@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz#8850ddf57dce2aebb4394bb434a7598031059e6d" + integrity sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-duplicate-named-capturing-groups-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz#6f7259b4de127721a08f1e5165b852fcaa696d31" + integrity sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-dynamic-import@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz#23e917de63ed23c6600c5dd06d94669dce79f7b8" + integrity sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-exponentiation-operator@^7.25.9": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" + integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-export-namespace-from@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz#90745fe55053394f554e40584cda81f2c8a402a2" + integrity sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-for-of@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz#4bdc7d42a213397905d89f02350c5267866d5755" + integrity sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + +"@babel/plugin-transform-function-name@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz#939d956e68a606661005bfd550c4fc2ef95f7b97" + integrity sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== + dependencies: + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/plugin-transform-json-strings@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz#c86db407cb827cded902a90c707d2781aaa89660" + integrity sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz#1a1c6b4d4aa59bc4cad5b6b3a223a0abd685c9de" + integrity sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-logical-assignment-operators@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz#b19441a8c39a2fda0902900b306ea05ae1055db7" + integrity sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-member-expression-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz#63dff19763ea64a31f5e6c20957e6a25e41ed5de" + integrity sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-modules-amd@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz#49ba478f2295101544abd794486cd3088dddb6c5" + integrity sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== + dependencies: + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-modules-commonjs@^7.25.9": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" + integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== + dependencies: + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-modules-systemjs@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" + integrity sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== + dependencies: + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/plugin-transform-modules-umd@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz#6710079cdd7c694db36529a1e8411e49fcbf14c9" + integrity sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== + dependencies: + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz#454990ae6cc22fd2a0fa60b3a2c6f63a38064e6a" + integrity sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-new-target@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz#42e61711294b105c248336dcb04b77054ea8becd" + integrity sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz#bcb1b0d9e948168102d5f7104375ca21c3266949" + integrity sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-numeric-separator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz#bfed75866261a8b643468b0ccfd275f2033214a1" + integrity sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-object-rest-spread@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz#0203725025074164808bcf1a2cfa90c652c99f18" + integrity sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== + dependencies: + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-transform-parameters" "^7.25.9" + +"@babel/plugin-transform-object-super@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz#385d5de135162933beb4a3d227a2b7e52bb4cf03" + integrity sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + +"@babel/plugin-transform-optional-catch-binding@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz#10e70d96d52bb1f10c5caaac59ac545ea2ba7ff3" + integrity sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-optional-chaining@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz#e142eb899d26ef715435f201ab6e139541eee7dd" + integrity sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + +"@babel/plugin-transform-parameters@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz#b856842205b3e77e18b7a7a1b94958069c7ba257" + integrity sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-private-methods@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz#847f4139263577526455d7d3223cd8bda51e3b57" + integrity sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-private-property-in-object@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz#9c8b73e64e6cc3cbb2743633885a7dd2c385fe33" + integrity sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-property-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz#d72d588bd88b0dec8b62e36f6fda91cedfe28e3f" + integrity sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-regenerator@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz#03a8a4670d6cebae95305ac6defac81ece77740b" + integrity sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + regenerator-transform "^0.15.2" + +"@babel/plugin-transform-regexp-modifiers@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz#2f5837a5b5cd3842a919d8147e9903cc7455b850" + integrity sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-reserved-words@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz#0398aed2f1f10ba3f78a93db219b27ef417fb9ce" + integrity sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-shorthand-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz#bb785e6091f99f826a95f9894fc16fde61c163f2" + integrity sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-spread@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz#24a35153931b4ba3d13cec4a7748c21ab5514ef9" + integrity sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + +"@babel/plugin-transform-sticky-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz#c7f02b944e986a417817b20ba2c504dfc1453d32" + integrity sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-template-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" + integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-typeof-symbol@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" + integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-unicode-escapes@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz#a75ef3947ce15363fccaa38e2dd9bc70b2788b82" + integrity sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-unicode-property-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz#a901e96f2c1d071b0d1bb5dc0d3c880ce8f53dd3" + integrity sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-unicode-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz#5eae747fe39eacf13a8bd006a4fb0b5d1fa5e9b1" + integrity sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-transform-unicode-sets-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz#65114c17b4ffc20fa5b163c63c70c0d25621fabe" + integrity sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/preset-env@^7.11.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" + integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== + dependencies: + "@babel/compat-data" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" + "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.25.9" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.25.9" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.25.9" + "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" + "@babel/plugin-syntax-import-assertions" "^7.26.0" + "@babel/plugin-syntax-import-attributes" "^7.26.0" + "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" + "@babel/plugin-transform-arrow-functions" "^7.25.9" + "@babel/plugin-transform-async-generator-functions" "^7.25.9" + "@babel/plugin-transform-async-to-generator" "^7.25.9" + "@babel/plugin-transform-block-scoped-functions" "^7.25.9" + "@babel/plugin-transform-block-scoping" "^7.25.9" + "@babel/plugin-transform-class-properties" "^7.25.9" + "@babel/plugin-transform-class-static-block" "^7.26.0" + "@babel/plugin-transform-classes" "^7.25.9" + "@babel/plugin-transform-computed-properties" "^7.25.9" + "@babel/plugin-transform-destructuring" "^7.25.9" + "@babel/plugin-transform-dotall-regex" "^7.25.9" + "@babel/plugin-transform-duplicate-keys" "^7.25.9" + "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" + "@babel/plugin-transform-dynamic-import" "^7.25.9" + "@babel/plugin-transform-exponentiation-operator" "^7.25.9" + "@babel/plugin-transform-export-namespace-from" "^7.25.9" + "@babel/plugin-transform-for-of" "^7.25.9" + "@babel/plugin-transform-function-name" "^7.25.9" + "@babel/plugin-transform-json-strings" "^7.25.9" + "@babel/plugin-transform-literals" "^7.25.9" + "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" + "@babel/plugin-transform-member-expression-literals" "^7.25.9" + "@babel/plugin-transform-modules-amd" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-modules-systemjs" "^7.25.9" + "@babel/plugin-transform-modules-umd" "^7.25.9" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" + "@babel/plugin-transform-new-target" "^7.25.9" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" + "@babel/plugin-transform-numeric-separator" "^7.25.9" + "@babel/plugin-transform-object-rest-spread" "^7.25.9" + "@babel/plugin-transform-object-super" "^7.25.9" + "@babel/plugin-transform-optional-catch-binding" "^7.25.9" + "@babel/plugin-transform-optional-chaining" "^7.25.9" + "@babel/plugin-transform-parameters" "^7.25.9" + "@babel/plugin-transform-private-methods" "^7.25.9" + "@babel/plugin-transform-private-property-in-object" "^7.25.9" + "@babel/plugin-transform-property-literals" "^7.25.9" + "@babel/plugin-transform-regenerator" "^7.25.9" + "@babel/plugin-transform-regexp-modifiers" "^7.26.0" + "@babel/plugin-transform-reserved-words" "^7.25.9" + "@babel/plugin-transform-shorthand-properties" "^7.25.9" + "@babel/plugin-transform-spread" "^7.25.9" + "@babel/plugin-transform-sticky-regex" "^7.25.9" + "@babel/plugin-transform-template-literals" "^7.25.9" + "@babel/plugin-transform-typeof-symbol" "^7.25.9" + "@babel/plugin-transform-unicode-escapes" "^7.25.9" + "@babel/plugin-transform-unicode-property-regex" "^7.25.9" + "@babel/plugin-transform-unicode-regex" "^7.25.9" + "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" + "@babel/preset-modules" "0.1.6-no-external-plugins" + babel-plugin-polyfill-corejs2 "^0.4.10" + babel-plugin-polyfill-corejs3 "^0.10.6" + babel-plugin-polyfill-regenerator "^0.6.1" + core-js-compat "^3.38.1" + semver "^6.3.1" + +"@babel/preset-modules@0.1.6-no-external-plugins": + version "0.1.6-no-external-plugins" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" + integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/types" "^7.4.4" + esutils "^2.0.2" + +"@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" + integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== + dependencies: + regenerator-runtime "^0.14.0" + +"@babel/template@^7.25.9", "@babel/template@^7.3.3": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" + integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.11.5", "@babel/traverse@^7.25.9", "@babel/traverse@^7.7.0": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.26.3.tgz#1ebfc75bd748d8f96b3cc63af5e82ebd4c37ba35" + integrity sha512-yTmc8J+Sj8yLzwr4PD5Xb/WF3bOYu2C2OoSZPzbuqRm4n98XirsbzaX+GloeO376UnSYIYJ4NCanwV5/ugZkwA== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.3" + "@babel/parser" "^7.26.3" + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.3" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.26.3", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": + version "7.26.3" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" + integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + +"@cnakazawa/watch@^1.0.3": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" + integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@ethersproject/address@^5.0.2": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/console@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.5.0.tgz#770800799d510f37329c508a9edd0b7b447d9abb" + integrity sha512-T48kZa6MK1Y6k4b89sexwmSF4YLeZS/Udqg3Jj3jG/cHH+N/sLFCEoXEDMOKugJQ9FxPN1osxIknvKkxt6MKyw== + dependencies: + "@jest/types" "^25.5.0" + chalk "^3.0.0" + jest-message-util "^25.5.0" + jest-util "^25.5.0" + slash "^3.0.0" + +"@jest/core@^25.5.4": + version "25.5.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.5.4.tgz#3ef7412f7339210f003cdf36646bbca786efe7b4" + integrity sha512-3uSo7laYxF00Dg/DMgbn4xMJKmDdWvZnf89n8Xj/5/AeQ2dOQmn6b6Hkj/MleyzZWXpwv+WSdYWl4cLsy2JsoA== + dependencies: + "@jest/console" "^25.5.0" + "@jest/reporters" "^25.5.1" + "@jest/test-result" "^25.5.0" + "@jest/transform" "^25.5.1" + "@jest/types" "^25.5.0" + ansi-escapes "^4.2.1" + chalk "^3.0.0" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-changed-files "^25.5.0" + jest-config "^25.5.4" + jest-haste-map "^25.5.1" + jest-message-util "^25.5.0" + jest-regex-util "^25.2.6" + jest-resolve "^25.5.1" + jest-resolve-dependencies "^25.5.4" + jest-runner "^25.5.4" + jest-runtime "^25.5.4" + jest-snapshot "^25.5.1" + jest-util "^25.5.0" + jest-validate "^25.5.0" + jest-watcher "^25.5.0" + micromatch "^4.0.2" + p-each-series "^2.1.0" + realpath-native "^2.0.0" + rimraf "^3.0.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.5.0.tgz#aa33b0c21a716c65686638e7ef816c0e3a0c7b37" + integrity sha512-U2VXPEqL07E/V7pSZMSQCvV5Ea4lqOlT+0ZFijl/i316cRMHvZ4qC+jBdryd+lmRetjQo0YIQr6cVPNxxK87mA== + dependencies: + "@jest/fake-timers" "^25.5.0" + "@jest/types" "^25.5.0" + jest-mock "^25.5.0" + +"@jest/fake-timers@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.5.0.tgz#46352e00533c024c90c2bc2ad9f2959f7f114185" + integrity sha512-9y2+uGnESw/oyOI3eww9yaxdZyHq7XvprfP/eeoCsjqKYts2yRlsHS/SgjPDV8FyMfn2nbMy8YzUk6nyvdLOpQ== + dependencies: + "@jest/types" "^25.5.0" + jest-message-util "^25.5.0" + jest-mock "^25.5.0" + jest-util "^25.5.0" + lolex "^5.0.0" + +"@jest/globals@^25.5.2": + version "25.5.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-25.5.2.tgz#5e45e9de8d228716af3257eeb3991cc2e162ca88" + integrity sha512-AgAS/Ny7Q2RCIj5kZ+0MuKM1wbF0WMLxbCVl/GOMoCNbODRdJ541IxJ98xnZdVSZXivKpJlNPIWa3QmY0l4CXA== + dependencies: + "@jest/environment" "^25.5.0" + "@jest/types" "^25.5.0" + expect "^25.5.0" + +"@jest/reporters@^25.5.1": + version "25.5.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.5.1.tgz#cb686bcc680f664c2dbaf7ed873e93aa6811538b" + integrity sha512-3jbd8pPDTuhYJ7vqiHXbSwTJQNavczPs+f1kRprRDxETeE3u6srJ+f0NPuwvOmk+lmunZzPkYWIFZDLHQPkviw== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^25.5.0" + "@jest/test-result" "^25.5.0" + "@jest/transform" "^25.5.1" + "@jest/types" "^25.5.0" + chalk "^3.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.2.4" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^4.0.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + jest-haste-map "^25.5.1" + jest-resolve "^25.5.1" + jest-util "^25.5.0" + jest-worker "^25.5.0" + slash "^3.0.0" + source-map "^0.6.0" + string-length "^3.1.0" + terminal-link "^2.0.0" + v8-to-istanbul "^4.1.3" + optionalDependencies: + node-notifier "^6.0.0" + +"@jest/source-map@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-25.5.0.tgz#df5c20d6050aa292c2c6d3f0d2c7606af315bd1b" + integrity sha512-eIGx0xN12yVpMcPaVpjXPnn3N30QGJCJQSkEDUt9x1fI1Gdvb07Ml6K5iN2hG7NmMP6FDmtPEssE3z6doOYUwQ== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.2.4" + source-map "^0.6.0" + +"@jest/test-result@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.5.0.tgz#139a043230cdeffe9ba2d8341b27f2efc77ce87c" + integrity sha512-oV+hPJgXN7IQf/fHWkcS99y0smKLU2czLBJ9WA0jHITLst58HpQMtzSYxzaBvYc6U5U6jfoMthqsUlUlbRXs0A== + dependencies: + "@jest/console" "^25.5.0" + "@jest/types" "^25.5.0" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^25.5.4": + version "25.5.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.5.4.tgz#9b4e685b36954c38d0f052e596d28161bdc8b737" + integrity sha512-pTJGEkSeg1EkCO2YWq6hbFvKNXk8ejqlxiOg1jBNLnWrgXOkdY6UmqZpwGFXNnRt9B8nO1uWMzLLZ4eCmhkPNA== + dependencies: + "@jest/test-result" "^25.5.0" + graceful-fs "^4.2.4" + jest-haste-map "^25.5.1" + jest-runner "^25.5.4" + jest-runtime "^25.5.4" + +"@jest/transform@^25.5.1": + version "25.5.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.5.1.tgz#0469ddc17699dd2bf985db55fa0fb9309f5c2db3" + integrity sha512-Y8CEoVwXb4QwA6Y/9uDkn0Xfz0finGkieuV0xkdF9UtZGJeLukD5nLkaVrVsODB1ojRWlaoD0AJZpVHCSnJEvg== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^25.5.0" + babel-plugin-istanbul "^6.0.0" + chalk "^3.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^25.5.1" + jest-regex-util "^25.2.6" + jest-util "^25.5.0" + micromatch "^4.0.2" + pirates "^4.0.1" + realpath-native "^2.0.0" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" + +"@jest/types@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" + integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^13.0.0" + +"@jest/types@^25.5.0": + version "25.5.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.5.0.tgz#4d6a4793f7b9599fc3680877b856a97dbccf2a9d" + integrity sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^15.0.0" + chalk "^3.0.0" + +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@rollup/plugin-babel@^5.1.0": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" + integrity sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q== + dependencies: + "@babel/helper-module-imports" "^7.10.4" + "@rollup/pluginutils" "^3.1.0" + +"@rollup/plugin-commonjs@^11.0.0": + version "11.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz#60636c7a722f54b41e419e1709df05c7234557ef" + integrity sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA== + dependencies: + "@rollup/pluginutils" "^3.0.8" + commondir "^1.0.1" + estree-walker "^1.0.1" + glob "^7.1.2" + is-reference "^1.1.2" + magic-string "^0.25.2" + resolve "^1.11.0" + +"@rollup/plugin-json@^4.0.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" + integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw== + dependencies: + "@rollup/pluginutils" "^3.0.8" + +"@rollup/plugin-node-resolve@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz#39bd0034ce9126b39c1699695f440b4b7d2b62e6" + integrity sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.17.0" + +"@rollup/plugin-replace@^2.2.1": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" + integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + magic-string "^0.25.7" + +"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.0.9", "@rollup/pluginutils@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" + integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + dependencies: + "@types/estree" "0.0.39" + estree-walker "^1.0.1" + picomatch "^2.2.2" + +"@rtsao/scc@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" + integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== + +"@sinonjs/commons@^1.7.0": + version "1.8.6" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" + integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== + dependencies: + type-detect "4.0.8" + +"@types/babel__core@^7.1.7": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" + integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.8" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" + integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" + integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.20.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.6.tgz#8dc9f0ae0f202c08d8d4dab648912c8d6038e3f7" + integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== + dependencies: + "@babel/types" "^7.20.7" + +"@types/big.js@^4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/big.js/-/big.js-4.0.5.tgz#62c61697646269e39191f24e55e8272f05f21fc0" + integrity sha512-D9KFrAt05FDSqLo7PU9TDHfDgkarlwdkuwFsg7Zm4xl62tTNaz+zN+Tkcdx2wGLBbSMf8BnoMhOVeUGUaJfLKg== + +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + +"@types/estree@*": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== + +"@types/estree@0.0.39": + version "0.0.39" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" + integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + +"@types/graceful-fs@^4.1.2": + version "4.1.9" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== + +"@types/istanbul-lib-report@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^1.1.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz#e875cc689e47bce549ec81f3df5e6f6f11cfaeb2" + integrity sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw== + dependencies: + "@types/istanbul-lib-coverage" "*" + "@types/istanbul-lib-report" "*" + +"@types/jest@^24.0.25": + version "24.9.1" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.9.1.tgz#02baf9573c78f1b9974a5f36778b366aa77bd534" + integrity sha512-Fb38HkXSVA4L8fGKEZ6le5bB8r6MRWlOCZbVuWZcmOMSCd2wCYOwN1ibj8daIoV9naq7aaOZjrLCoCMptKU/4Q== + dependencies: + jest-diff "^24.3.0" + +"@types/jest@^25.2.1": + version "25.2.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.2.3.tgz#33d27e4c4716caae4eced355097a47ad363fdcaf" + integrity sha512-JXc1nK/tXHiDhV55dvfzqtmP4S3sy3T3ouV2tkViZgxY/zeUkcpQcQPGRlgF4KmWzWW5oiWYSZwtCB+2RsE4Fw== + dependencies: + jest-diff "^25.2.1" + pretty-format "^25.2.1" + +"@types/json-schema@^7.0.3": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + +"@types/node@*": + version "22.10.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766" + integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ== + dependencies: + undici-types "~6.20.0" + +"@types/normalize-package-data@^2.4.0": + version "2.4.4" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" + integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== + +"@types/parse-json@^4.0.0": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" + integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== + +"@types/prettier@^1.19.0": + version "1.19.1" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f" + integrity sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ== + +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== + dependencies: + "@types/node" "*" + +"@types/stack-utils@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" + integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== + +"@types/yargs-parser@*": + version "21.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== + +"@types/yargs@^13.0.0": + version "13.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.12.tgz#d895a88c703b78af0465a9de88aa92c61430b092" + integrity sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ== + dependencies: + "@types/yargs-parser" "*" + +"@types/yargs@^15.0.0": + version "15.0.19" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.19.tgz#328fb89e46109ecbdb70c295d96ff2f46dfd01b9" + integrity sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA== + dependencies: + "@types/yargs-parser" "*" + +"@typescript-eslint/eslint-plugin@^2.12.0": + version "2.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz#6f8ce8a46c7dea4a6f1d171d2bb8fbae6dac2be9" + integrity sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ== + dependencies: + "@typescript-eslint/experimental-utils" "2.34.0" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@2.34.0": + version "2.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz#d3524b644cdb40eebceca67f8cf3e4cc9c8f980f" + integrity sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.34.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + +"@typescript-eslint/parser@^2.12.0": + version "2.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.34.0.tgz#50252630ca319685420e9a39ca05fe185a256bc8" + integrity sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.34.0" + "@typescript-eslint/typescript-estree" "2.34.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/typescript-estree@2.34.0": + version "2.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz#14aeb6353b39ef0732cc7f1b8285294937cf37d5" + integrity sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + +abab@^2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== + +acorn-globals@^4.3.2: + version "4.3.4" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" + integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + +acorn-jsx@^5.2.0: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn-walk@^6.0.1: + version "6.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" + integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== + +acorn@^6.0.1: + version "6.4.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" + integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== + +acorn@^7.1.0, acorn@^7.1.1: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-colors@^4.1.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +ansi-escapes@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-escapes@^4.2.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" + integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== + +ansi-regex@^4.0.0, ansi-regex@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" + integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== + +ansi-regex@^5.0.0, ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +anymatch@^3.0.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +aria-query@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.2.tgz#93f81a43480e33a338f19163a3d10a50c01dcd59" + integrity sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw== + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== + +array-buffer-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f" + integrity sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg== + dependencies: + call-bind "^1.0.5" + is-array-buffer "^3.0.4" + +array-equal@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.2.tgz#a8572e64e822358271250b9156d20d96ef5dec04" + integrity sha512-gUHx76KtnhEgB3HOuFYiCm3FIdEs6ocM2asHvNTkfu/Y09qQVrrVVaOKENmS2KkSaGoxgXNqC+ZVtR/n0MOkSA== + +array-includes@^3.1.6, array-includes@^3.1.8: + version "3.1.8" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" + integrity sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.4" + is-string "^1.0.7" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== + +array.prototype.findlast@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz#3e4fbcb30a15a7f5bf64cf2faae22d139c2e4904" + integrity sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-shim-unscopables "^1.0.2" + +array.prototype.findlastindex@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz#8c35a755c72908719453f87145ca011e39334d0d" + integrity sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-shim-unscopables "^1.0.2" + +array.prototype.flat@^1.3.1, array.prototype.flat@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" + integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527" + integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + +array.prototype.tosorted@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz#fe954678ff53034e717ea3352a03f0b0b86f7ffc" + integrity sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.3" + es-errors "^1.3.0" + es-shim-unscopables "^1.0.2" + +arraybuffer.prototype.slice@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz#097972f4255e41bc3425e37dc3f6421cf9aefde6" + integrity sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A== + dependencies: + array-buffer-byte-length "^1.0.1" + call-bind "^1.0.5" + define-properties "^1.2.1" + es-abstract "^1.22.3" + es-errors "^1.2.1" + get-intrinsic "^1.2.3" + is-array-buffer "^3.0.4" + is-shared-array-buffer "^1.0.2" + +asn1@~0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== + +ast-types-flow@^0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.8.tgz#0a85e1c92695769ac13a428bb653e7538bea27d6" + integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ== + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +asyncro@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/asyncro/-/asyncro-3.0.0.tgz#3c7a732e263bc4a42499042f48d7d858e9c0134e" + integrity sha512-nEnWYfrBmA3taTiuiOoZYmgJ/CNrSoQLeLs29SeLcPu60yaw/mHDBHV0iOZ051fTvsTHxpCY+gXibqT9wbQYfg== + +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== + +aws4@^1.8.0: + version "1.13.2" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.13.2.tgz#0aa167216965ac9474ccfa83892cfb6b3e1e52ef" + integrity sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw== + +axe-core@^4.10.0: + version "4.10.2" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.10.2.tgz#85228e3e1d8b8532a27659b332e39b7fa0e022df" + integrity sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w== + +axobject-query@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-4.1.0.tgz#28768c76d0e3cff21bc62a9e2d0b6ac30042a1ee" + integrity sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ== + +babel-eslint@^10.0.3: + version "10.1.0" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" + integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + eslint-visitor-keys "^1.0.0" + resolve "^1.12.0" + +babel-jest@^25.5.1: + version "25.5.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.5.1.tgz#bc2e6101f849d6f6aec09720ffc7bc5332e62853" + integrity sha512-9dA9+GmMjIzgPnYtkhBg73gOo/RHqPmLruP3BaGL4KEX3Dwz6pI8auSN8G8+iuEG90+GSswyKvslN+JYSaacaQ== + dependencies: + "@jest/transform" "^25.5.1" + "@jest/types" "^25.5.0" + "@types/babel__core" "^7.1.7" + babel-plugin-istanbul "^6.0.0" + babel-preset-jest "^25.5.0" + chalk "^3.0.0" + graceful-fs "^4.2.4" + slash "^3.0.0" + +babel-plugin-annotate-pure-calls@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-annotate-pure-calls/-/babel-plugin-annotate-pure-calls-0.4.0.tgz#78aa00fd878c4fcde4d49f3da397fcf5defbcce8" + integrity sha512-oi4M/PWUJOU9ZyRGoPTfPMqdyMp06jbJAomd3RcyYuzUtBOddv98BqLm96Lucpi2QFoQHkdGQt0ACvw7VzVEQA== + +babel-plugin-dev-expression@^0.2.1: + version "0.2.3" + resolved "https://registry.yarnpkg.com/babel-plugin-dev-expression/-/babel-plugin-dev-expression-0.2.3.tgz#8aaf52155dfb063ed4ddec6280456fbc256fead4" + integrity sha512-rP5LK9QQTzCW61nVVzw88En1oK8t8gTsIeC6E61oelxNsU842yMjF0G1MxhvUpCkxCEIj7sE8/e5ieTheT//uw== + +babel-plugin-istanbul@^6.0.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.5.0.tgz#129c80ba5c7fc75baf3a45b93e2e372d57ca2677" + integrity sha512-u+/W+WAjMlvoocYGTwthAiQSxDcJAyHpQ6oWlHdFZaaN+Rlk8Q7iiwDPg2lN/FyJtAYnKjFxbn7xus4HCFkg5g== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__traverse" "^7.0.6" + +babel-plugin-macros@^2.6.1: + version "2.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" + integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== + dependencies: + "@babel/runtime" "^7.7.2" + cosmiconfig "^6.0.0" + resolve "^1.12.0" + +babel-plugin-polyfill-corejs2@^0.4.10: + version "0.4.12" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.12.tgz#ca55bbec8ab0edeeef3d7b8ffd75322e210879a9" + integrity sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og== + dependencies: + "@babel/compat-data" "^7.22.6" + "@babel/helper-define-polyfill-provider" "^0.6.3" + semver "^6.3.1" + +babel-plugin-polyfill-corejs3@^0.10.6: + version "0.10.6" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" + integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.6.2" + core-js-compat "^3.38.0" + +babel-plugin-polyfill-regenerator@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.0.4.tgz#588641af9a2cb4e299b1400c47672a4a104d2459" + integrity sha512-+/uCzO9JTYVZVGCpZpVAQkgPGt2zkR0VYiZvJ4aVoCe4ccgpKvNQqcjzAgQzSsjK64Jhc5hvrCR3l0087BevkA== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.0.3" + +babel-plugin-polyfill-regenerator@^0.6.1: + version "0.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.3.tgz#abeb1f3f1c762eace37587f42548b08b57789bc8" + integrity sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.6.3" + +babel-plugin-transform-rename-import@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-rename-import/-/babel-plugin-transform-rename-import-2.3.0.tgz#5d9d645f937b0ca5c26a24b2510a06277b6ffd9b" + integrity sha512-dPgJoT57XC0PqSnLgl2FwNvxFrWlspatX2dkk7yjKQj5HHGw071vAcOf+hqW8ClqcBDMvEbm6mevn5yHAD8mlQ== + +babel-preset-current-node-syntax@^0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz#826f1f8e7245ad534714ba001f84f7e906c3b615" + integrity sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.8.3" + "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +babel-preset-jest@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.5.0.tgz#c1d7f191829487a907764c65307faa0e66590b49" + integrity sha512-8ZczygctQkBU+63DtSOKGh7tFL0CeCuz+1ieud9lJ1WPQ9O6A1a/r+LGn6Y705PA6whHQ3T1XuB/PmpfNYf8Fw== + dependencies: + babel-plugin-jest-hoist "^25.5.0" + babel-preset-current-node-syntax "^0.1.2" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== + +bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +braces@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +browser-process-hrtime@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" + integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== + dependencies: + resolve "1.1.7" + +browserslist@^4.24.0, browserslist@^4.24.2: + version "4.24.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== + dependencies: + caniuse-lite "^1.0.30001669" + electron-to-chromium "^1.5.41" + node-releases "^2.0.18" + update-browserslist-db "^1.1.1" + +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== + dependencies: + fast-json-stable-stringify "2.x" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-from@1.x, buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +builtin-modules@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.0.0, camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +caniuse-lite@^1.0.30001669: + version "1.0.30001686" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz#0e04b8d90de8753188e93c9989d56cb19d902670" + integrity sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA== + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== + +chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^4.0.0, chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cli-cursor@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw== + dependencies: + restore-cursor "^2.0.0" + +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + +cli-spinners@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.3.1.tgz#002c1990912d0d59580c93bd36c056de99e4259a" + integrity sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg== + +cli-spinners@^2.2.0: + version "2.9.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" + integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== + +cli-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" + integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== + +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== + +collect-v8-coverage@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== + +component-emitter@^1.2.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.1.tgz#ef1d5796f7d93f135ee6fb684340b26403c97d17" + integrity sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +confusing-browser-globals@^1.0.9: + version "1.0.11" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" + integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== + +convert-source-map@^1.4.0, convert-source-map@^1.6.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== + +core-js-compat@^3.38.0, core-js-compat@^3.38.1: + version "3.39.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.39.0.tgz#b12dccb495f2601dc860bdbe7b4e3ffa8ba63f61" + integrity sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw== + dependencies: + browserslist "^4.24.2" + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== + +cosmiconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" + integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.1.0" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.7.2" + +cross-spawn@^6.0.0, cross-spawn@^6.0.5: + version "6.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.6.tgz#30d0efa0712ddb7eb5a76e1e8721bffafa6b5d57" + integrity sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^7.0.0: + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +cssom@^0.4.1: + version "0.4.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" + integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== + +cssom@~0.3.6: + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== + +cssstyle@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== + dependencies: + cssom "~0.3.6" + +damerau-levenshtein@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" + integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== + dependencies: + assert-plus "^1.0.0" + +data-urls@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + +data-view-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" + integrity sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA== + dependencies: + call-bind "^1.0.6" + es-errors "^1.3.0" + is-data-view "^1.0.1" + +data-view-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz#90721ca95ff280677eb793749fce1011347669e2" + integrity sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + is-data-view "^1.0.1" + +data-view-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz#5e0bbfb4828ed2d1b9b400cd8a7d119bca0ff18a" + integrity sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA== + dependencies: + call-bind "^1.0.6" + es-errors "^1.3.0" + is-data-view "^1.0.1" + +debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== + +decimal.js-light@^2.5.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934" + integrity sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg== + +decode-uri-component@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== + +deep-is@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + +defaults@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== + dependencies: + clone "^1.0.2" + +define-data-property@^1.0.1, define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + +define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + +diff-sequences@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" + integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== + +diff-sequences@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" + integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== + dependencies: + webidl-conversions "^4.0.2" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +electron-to-chromium@^1.5.41: + version "1.5.70" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.70.tgz#8be2f92e54a3d069c0eefcf766a48bf0f78d93e0" + integrity sha512-P6FPqAWIZrC3sHDAwBitJBs7N7IF58m39XVny7DFseQXK2eiMn7nNQizFf63mWDDUnFvaqsM8FI0+ZZfLkdUGA== + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +enquirer@^2.3.4: + version "2.4.1" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" + integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== + dependencies: + ansi-colors "^4.1.1" + strip-ansi "^6.0.1" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.17.5, es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23.2, es-abstract@^1.23.3, es-abstract@^1.23.5: + version "1.23.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.5.tgz#f4599a4946d57ed467515ed10e4f157289cd52fb" + integrity sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ== + dependencies: + array-buffer-byte-length "^1.0.1" + arraybuffer.prototype.slice "^1.0.3" + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + data-view-buffer "^1.0.1" + data-view-byte-length "^1.0.1" + data-view-byte-offset "^1.0.0" + es-define-property "^1.0.0" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-set-tostringtag "^2.0.3" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.6" + get-intrinsic "^1.2.4" + get-symbol-description "^1.0.2" + globalthis "^1.0.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + has-proto "^1.0.3" + has-symbols "^1.0.3" + hasown "^2.0.2" + internal-slot "^1.0.7" + is-array-buffer "^3.0.4" + is-callable "^1.2.7" + is-data-view "^1.0.1" + is-negative-zero "^2.0.3" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.3" + is-string "^1.0.7" + is-typed-array "^1.1.13" + is-weakref "^1.0.2" + object-inspect "^1.13.3" + object-keys "^1.1.1" + object.assign "^4.1.5" + regexp.prototype.flags "^1.5.3" + safe-array-concat "^1.1.2" + safe-regex-test "^1.0.3" + string.prototype.trim "^1.2.9" + string.prototype.trimend "^1.0.8" + string.prototype.trimstart "^1.0.8" + typed-array-buffer "^1.0.2" + typed-array-byte-length "^1.0.1" + typed-array-byte-offset "^1.0.2" + typed-array-length "^1.0.6" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.15" + +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.2.1, es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-iterator-helpers@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.2.0.tgz#2f1a3ab998b30cb2d10b195b587c6d9ebdebf152" + integrity sha512-tpxqxncxnpw3c93u8n3VOzACmRFoVmWJqbWXvX/JfKbkhBw1oslgPrUfeSt2psuqyEJFD6N/9lg5i7bsKpoq+Q== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.3" + es-errors "^1.3.0" + es-set-tostringtag "^2.0.3" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + globalthis "^1.0.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + has-proto "^1.0.3" + has-symbols "^1.0.3" + internal-slot "^1.0.7" + iterator.prototype "^1.1.3" + safe-array-concat "^1.1.2" + +es-object-atoms@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" + integrity sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz#8bb60f0a440c2e4281962428438d58545af39777" + integrity sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== + dependencies: + get-intrinsic "^1.2.4" + has-tostringtag "^1.0.2" + hasown "^2.0.1" + +es-shim-unscopables@^1.0.0, es-shim-unscopables@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz#1f6942e71ecc7835ed1c8a83006d8771a63a3763" + integrity sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== + dependencies: + hasown "^2.0.0" + +es-to-primitive@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.3.0.tgz#96c89c82cc49fd8794a24835ba3e1ff87f214e18" + integrity sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g== + dependencies: + is-callable "^1.2.7" + is-date-object "^1.0.5" + is-symbol "^1.0.4" + +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^1.11.1: + version "1.14.3" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-config-prettier@^6.0.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" + integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== + dependencies: + get-stdin "^6.0.0" + +eslint-config-react-app@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.2.1.tgz#698bf7aeee27f0cea0139eaef261c7bf7dd623df" + integrity sha512-pGIZ8t0mFLcV+6ZirRgYK6RVqUIKRIi9MmgzUEmrIknsn3AdO0I32asO86dJgloHq+9ZPl8UIg8mYrvgP5u2wQ== + dependencies: + confusing-browser-globals "^1.0.9" + +eslint-import-resolver-node@^0.3.9: + version "0.3.9" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" + integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== + dependencies: + debug "^3.2.7" + is-core-module "^2.13.0" + resolve "^1.22.4" + +eslint-module-utils@^2.12.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz#fe4cfb948d61f49203d7b08871982b65b9af0b0b" + integrity sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg== + dependencies: + debug "^3.2.7" + +eslint-plugin-flowtype@^3.13.0: + version "3.13.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.13.0.tgz#e241ebd39c0ce519345a3f074ec1ebde4cf80f2c" + integrity sha512-bhewp36P+t7cEV0b6OdmoRWJCBYRiHFlqPZAG1oS3SF+Y0LQkeDvFSM4oxoxvczD1OdONCXMlJfQFiWLcV9urw== + dependencies: + lodash "^4.17.15" + +eslint-plugin-import@^2.18.2: + version "2.31.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz#310ce7e720ca1d9c0bb3f69adfd1c6bdd7d9e0e7" + integrity sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== + dependencies: + "@rtsao/scc" "^1.1.0" + array-includes "^3.1.8" + array.prototype.findlastindex "^1.2.5" + array.prototype.flat "^1.3.2" + array.prototype.flatmap "^1.3.2" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.9" + eslint-module-utils "^2.12.0" + hasown "^2.0.2" + is-core-module "^2.15.1" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.fromentries "^2.0.8" + object.groupby "^1.0.3" + object.values "^1.2.0" + semver "^6.3.1" + string.prototype.trimend "^1.0.8" + tsconfig-paths "^3.15.0" + +eslint-plugin-jsx-a11y@^6.2.3: + version "6.10.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz#d2812bb23bf1ab4665f1718ea442e8372e638483" + integrity sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q== + dependencies: + aria-query "^5.3.2" + array-includes "^3.1.8" + array.prototype.flatmap "^1.3.2" + ast-types-flow "^0.0.8" + axe-core "^4.10.0" + axobject-query "^4.1.0" + damerau-levenshtein "^1.0.8" + emoji-regex "^9.2.2" + hasown "^2.0.2" + jsx-ast-utils "^3.3.5" + language-tags "^1.0.9" + minimatch "^3.1.2" + object.fromentries "^2.0.8" + safe-regex-test "^1.0.3" + string.prototype.includes "^2.0.1" + +eslint-plugin-prettier@^3.1.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5" + integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-plugin-react-hooks@^2.2.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.5.1.tgz#4ef5930592588ce171abeb26f400c7fbcbc23cd0" + integrity sha512-Y2c4b55R+6ZzwtTppKwSmK/Kar8AdLiC2f9NADCuxbcTgPPg41Gyqa6b9GppgXSvCtkRw43ZE86CT5sejKC6/g== + +eslint-plugin-react@^7.14.3: + version "7.37.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz#cd0935987876ba2900df2f58339f6d92305acc7a" + integrity sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w== + dependencies: + array-includes "^3.1.8" + array.prototype.findlast "^1.2.5" + array.prototype.flatmap "^1.3.2" + array.prototype.tosorted "^1.1.4" + doctrine "^2.1.0" + es-iterator-helpers "^1.1.0" + estraverse "^5.3.0" + hasown "^2.0.2" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.1.2" + object.entries "^1.1.8" + object.fromentries "^2.0.8" + object.values "^1.2.0" + prop-types "^15.8.1" + resolve "^2.0.0-next.5" + semver "^6.3.1" + string.prototype.matchall "^4.0.11" + string.prototype.repeat "^1.0.0" + +eslint-scope@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-utils@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-utils@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint@^6.1.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" + integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.10.0" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^5.0.0" + eslint-utils "^1.4.3" + eslint-visitor-keys "^1.1.0" + espree "^6.1.2" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^7.0.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.14" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.3" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" + table "^5.2.3" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^6.1.2: + version "6.2.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" + integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== + dependencies: + acorn "^7.1.1" + acorn-jsx "^5.2.0" + eslint-visitor-keys "^1.1.0" + +esprima@^4.0.0, esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1, estraverse@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +estree-walker@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" + integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== + +estree-walker@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" + integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +exec-sh@^0.3.2: + version "0.3.6" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" + integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^3.2.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" + integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + p-finally "^2.0.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + +execa@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-25.5.0.tgz#f07f848712a2813bb59167da3fb828ca21f58bba" + integrity sha512-w7KAXo0+6qqZZhovCaBVPSIqQp7/UTcx4M9uKt2m6pd2VB1voyC8JizLRqeEqud3AAVP02g+hbErDu5gu64tlA== + dependencies: + "@jest/types" "^25.5.0" + ansi-styles "^4.0.0" + jest-get-type "^25.2.6" + jest-matcher-utils "^25.5.0" + jest-message-util "^25.5.0" + jest-regex-util "^25.2.6" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== + +extsprintf@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== + +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fb-watchman@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== + dependencies: + bser "2.1.1" + +figures@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" + integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +find-cache-dir@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" + integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== + +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== + dependencies: + map-cache "^0.2.2" + +fs-extra@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^9.0.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@^2.1.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== + +functions-have-names@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +get-symbol-description@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.2.tgz#533744d5aa20aca4e079c8e5daf7fd44202821f5" + integrity sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg== + dependencies: + call-bind "^1.0.5" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== + dependencies: + assert-plus "^1.0.0" + +glob-parent@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^12.1.0: + version "12.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" + integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== + dependencies: + type-fest "^0.8.1" + +globalthis@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" + integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== + dependencies: + define-properties "^1.2.1" + gopd "^1.0.1" + +globalyzer@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465" + integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q== + +globrex@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" + integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== + +gopd@^1.0.1, gopd@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw== + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + +has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.0.1, has-proto@^1.0.3: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.1.0.tgz#deb10494cbbe8809bce168a3b961f42969f5ed43" + integrity sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q== + dependencies: + call-bind "^1.0.7" + +has-symbols@^1.0.3: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + +hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== + dependencies: + whatwg-encoding "^1.0.1" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + +humanize-duration@^3.15.3: + version "3.32.1" + resolved "https://registry.yarnpkg.com/humanize-duration/-/humanize-duration-3.32.1.tgz#922beff5da36fb1cee3de26ada24c592b0fe519b" + integrity sha512-inh5wue5XdfObhu/IGEMiA1nUXigSGcaKNemcbLRKa7jXYGDZXr3LoT9pTIzq2hPEbld7w/qv9h+ikWGz8fL1g== + +iconv-lite@0.4.24, iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0, import-fresh@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +import-local@^3.0.2: + version "3.2.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" + integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inquirer@^7.0.0: + version "7.3.3" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" + integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== + dependencies: + ansi-escapes "^4.2.1" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-width "^3.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.19" + mute-stream "0.0.8" + run-async "^2.4.0" + rxjs "^6.6.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + through "^2.3.6" + +internal-slot@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" + integrity sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g== + dependencies: + es-errors "^1.3.0" + hasown "^2.0.0" + side-channel "^1.0.4" + +interpret@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== + +ip-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + integrity sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw== + +is-accessor-descriptor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz#3223b10628354644b86260db29b3e693f5ceedd4" + integrity sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA== + dependencies: + hasown "^2.0.0" + +is-array-buffer@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.4.tgz#7a1f92b3d61edd2bc65d24f130530ea93d7fae98" + integrity sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + +is-async-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-async-function/-/is-async-function-2.0.0.tgz#8e4418efd3e5d3a6ebb0164c05ef5afb69aa9646" + integrity sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA== + dependencies: + has-tostringtag "^1.0.0" + +is-bigint@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.1.0.tgz#dda7a3445df57a42583db4228682eba7c4170672" + integrity sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ== + dependencies: + has-bigints "^1.0.2" + +is-boolean-object@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.2.0.tgz#9743641e80a62c094b5941c5bb791d66a88e497a" + integrity sha512-kR5g0+dXf/+kXnqI+lu0URKYPKgICtHGGNCDSB10AaUFj3o/HkB3u7WfpRBJGFopxxY0oH3ux7ZsDjLtK7xqvw== + dependencies: + call-bind "^1.0.7" + has-tostringtag "^1.0.2" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-callable@^1.1.3, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-core-module@^2.13.0, is-core-module@^2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" + integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== + dependencies: + hasown "^2.0.2" + +is-data-descriptor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz#2109164426166d32ea38c405c1e0945d9e6a4eeb" + integrity sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw== + dependencies: + hasown "^2.0.0" + +is-data-view@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-data-view/-/is-data-view-1.0.1.tgz#4b4d3a511b70f3dc26d42c03ca9ca515d847759f" + integrity sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w== + dependencies: + is-typed-array "^1.1.13" + +is-date-object@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-descriptor@^0.1.0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.7.tgz#2727eb61fd789dcd5bdf0ed4569f551d2fe3be33" + integrity sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg== + dependencies: + is-accessor-descriptor "^1.0.1" + is-data-descriptor "^1.0.1" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.3.tgz#92d27cb3cd311c4977a4db47df457234a13cb306" + integrity sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw== + dependencies: + is-accessor-descriptor "^1.0.1" + is-data-descriptor "^1.0.1" + +is-docker@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-finalizationregistry@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finalizationregistry/-/is-finalizationregistry-1.1.0.tgz#d74a7d0c5f3578e34a20729e69202e578d495dc2" + integrity sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA== + dependencies: + call-bind "^1.0.7" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-generator-function@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" + integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== + dependencies: + has-tostringtag "^1.0.0" + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + +is-map@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" + integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== + +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== + +is-negative-zero@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" + integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== + +is-number-object@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.1.0.tgz#5a867e9ecc3d294dda740d9f127835857af7eb05" + integrity sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw== + dependencies: + call-bind "^1.0.7" + has-tostringtag "^1.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== + dependencies: + kind-of "^3.0.2" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-reference@^1.1.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + +is-regex@^1.1.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.2.0.tgz#41b9d266e7eb7451312c64efc37e8a7d453077cf" + integrity sha512-B6ohK4ZmoftlUe+uvenXSbPJFo6U37BH7oO1B3nQH8f/7h27N56s85MhUtbFJAziz5dcmuR3i8ovUl35zp8pFA== + dependencies: + call-bind "^1.0.7" + gopd "^1.1.0" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + +is-set@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" + integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== + +is-shared-array-buffer@^1.0.2, is-shared-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz#1237f1cba059cdb62431d378dcc37d9680181688" + integrity sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg== + dependencies: + call-bind "^1.0.7" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +is-string@^1.0.7, is-string@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.1.0.tgz#8cb83c5d57311bf8058bc6c8db294711641da45d" + integrity sha512-PlfzajuF9vSo5wErv3MJAKD/nqf9ngAs1NFQYm16nUYFO2IzxJ2hcm+IOCg+EEopdykNNUhVq5cz35cAUxU8+g== + dependencies: + call-bind "^1.0.7" + has-tostringtag "^1.0.2" + +is-symbol@^1.0.4, is-symbol@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.1.0.tgz#ae993830a56d4781886d39f9f0a46b3e89b7b60b" + integrity sha512-qS8KkNNXUZ/I+nX6QT8ZS1/Yx0A444yhzdTKxCzKkNjQ9sHErBxJnJAgh+f5YhusYECEcjo4XcyH87hn6+ks0A== + dependencies: + call-bind "^1.0.7" + has-symbols "^1.0.3" + safe-regex-test "^1.0.3" + +is-typed-array@^1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" + integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== + dependencies: + which-typed-array "^1.1.14" + +is-typedarray@^1.0.0, is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== + +is-weakmap@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" + integrity sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + +is-weakset@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.3.tgz#e801519df8c0c43e12ff2834eead84ec9e624007" + integrity sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ== + dependencies: + call-bind "^1.0.7" + get-intrinsic "^1.2.4" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-wsl@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== + +istanbul-lib-instrument@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" + integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== + dependencies: + "@babel/core" "^7.7.5" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" + +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + +istanbul-lib-report@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^4.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.0.2: + version "3.1.7" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" + integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +iterator.prototype@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.3.tgz#016c2abe0be3bbdb8319852884f60908ac62bf9c" + integrity sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ== + dependencies: + define-properties "^1.2.1" + get-intrinsic "^1.2.1" + has-symbols "^1.0.3" + reflect.getprototypeof "^1.0.4" + set-function-name "^2.0.1" + +jest-changed-files@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.5.0.tgz#141cc23567ceb3f534526f8614ba39421383634c" + integrity sha512-EOw9QEqapsDT7mKF162m8HFzRPbmP8qJQny6ldVOdOVBz3ACgPm/1nAn5fPQ/NDaYhX/AHkrGwwkCncpAVSXcw== + dependencies: + "@jest/types" "^25.5.0" + execa "^3.2.0" + throat "^5.0.0" + +jest-cli@^25.5.4: + version "25.5.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.5.4.tgz#b9f1a84d1301a92c5c217684cb79840831db9f0d" + integrity sha512-rG8uJkIiOUpnREh1768/N3n27Cm+xPFkSNFO91tgg+8o2rXeVLStz+vkXkGr4UtzH6t1SNbjwoiswd7p4AhHTw== + dependencies: + "@jest/core" "^25.5.4" + "@jest/test-result" "^25.5.0" + "@jest/types" "^25.5.0" + chalk "^3.0.0" + exit "^0.1.2" + graceful-fs "^4.2.4" + import-local "^3.0.2" + is-ci "^2.0.0" + jest-config "^25.5.4" + jest-util "^25.5.0" + jest-validate "^25.5.0" + prompts "^2.0.1" + realpath-native "^2.0.0" + yargs "^15.3.1" + +jest-config@^25.5.4: + version "25.5.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.5.4.tgz#38e2057b3f976ef7309b2b2c8dcd2a708a67f02c" + integrity sha512-SZwR91SwcdK6bz7Gco8qL7YY2sx8tFJYzvg216DLihTWf+LKY/DoJXpM9nTzYakSyfblbqeU48p/p7Jzy05Atg== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^25.5.4" + "@jest/types" "^25.5.0" + babel-jest "^25.5.1" + chalk "^3.0.0" + deepmerge "^4.2.2" + glob "^7.1.1" + graceful-fs "^4.2.4" + jest-environment-jsdom "^25.5.0" + jest-environment-node "^25.5.0" + jest-get-type "^25.2.6" + jest-jasmine2 "^25.5.4" + jest-regex-util "^25.2.6" + jest-resolve "^25.5.1" + jest-util "^25.5.0" + jest-validate "^25.5.0" + micromatch "^4.0.2" + pretty-format "^25.5.0" + realpath-native "^2.0.0" + +jest-diff@^24.3.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" + integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== + dependencies: + chalk "^2.0.1" + diff-sequences "^24.9.0" + jest-get-type "^24.9.0" + pretty-format "^24.9.0" + +jest-diff@^25.2.1, jest-diff@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.5.0.tgz#1dd26ed64f96667c068cef026b677dfa01afcfa9" + integrity sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A== + dependencies: + chalk "^3.0.0" + diff-sequences "^25.2.6" + jest-get-type "^25.2.6" + pretty-format "^25.5.0" + +jest-docblock@^25.3.0: + version "25.3.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-25.3.0.tgz#8b777a27e3477cd77a168c05290c471a575623ef" + integrity sha512-aktF0kCar8+zxRHxQZwxMy70stc9R1mOmrLsT5VO3pIT0uzGRSDAXxSlz4NqQWpuLjPpuMhPRl7H+5FRsvIQAg== + dependencies: + detect-newline "^3.0.0" + +jest-each@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.5.0.tgz#0c3c2797e8225cb7bec7e4d249dcd96b934be516" + integrity sha512-QBogUxna3D8vtiItvn54xXde7+vuzqRrEeaw8r1s+1TG9eZLVJE5ZkKoSUlqFwRjnlaA4hyKGiu9OlkFIuKnjA== + dependencies: + "@jest/types" "^25.5.0" + chalk "^3.0.0" + jest-get-type "^25.2.6" + jest-util "^25.5.0" + pretty-format "^25.5.0" + +jest-environment-jsdom@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.5.0.tgz#dcbe4da2ea997707997040ecf6e2560aec4e9834" + integrity sha512-7Jr02ydaq4jaWMZLY+Skn8wL5nVIYpWvmeatOHL3tOcV3Zw8sjnPpx+ZdeBfc457p8jCR9J6YCc+Lga0oIy62A== + dependencies: + "@jest/environment" "^25.5.0" + "@jest/fake-timers" "^25.5.0" + "@jest/types" "^25.5.0" + jest-mock "^25.5.0" + jest-util "^25.5.0" + jsdom "^15.2.1" + +jest-environment-node@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.5.0.tgz#0f55270d94804902988e64adca37c6ce0f7d07a1" + integrity sha512-iuxK6rQR2En9EID+2k+IBs5fCFd919gVVK5BeND82fYeLWPqvRcFNPKu9+gxTwfB5XwBGBvZ0HFQa+cHtIoslA== + dependencies: + "@jest/environment" "^25.5.0" + "@jest/fake-timers" "^25.5.0" + "@jest/types" "^25.5.0" + jest-mock "^25.5.0" + jest-util "^25.5.0" + semver "^6.3.0" + +jest-get-type@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" + integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== + +jest-get-type@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" + integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== + +jest-haste-map@^25.5.1: + version "25.5.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.5.1.tgz#1df10f716c1d94e60a1ebf7798c9fb3da2620943" + integrity sha512-dddgh9UZjV7SCDQUrQ+5t9yy8iEgKc1AKqZR9YDww8xsVOtzPQSMVLDChc21+g29oTRexb9/B0bIlZL+sWmvAQ== + dependencies: + "@jest/types" "^25.5.0" + "@types/graceful-fs" "^4.1.2" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-serializer "^25.5.0" + jest-util "^25.5.0" + jest-worker "^25.5.0" + micromatch "^4.0.2" + sane "^4.0.3" + walker "^1.0.7" + which "^2.0.2" + optionalDependencies: + fsevents "^2.1.2" + +jest-jasmine2@^25.5.4: + version "25.5.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.5.4.tgz#66ca8b328fb1a3c5364816f8958f6970a8526968" + integrity sha512-9acbWEfbmS8UpdcfqnDO+uBUgKa/9hcRh983IHdM+pKmJPL77G0sWAAK0V0kr5LK3a8cSBfkFSoncXwQlRZfkQ== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^25.5.0" + "@jest/source-map" "^25.5.0" + "@jest/test-result" "^25.5.0" + "@jest/types" "^25.5.0" + chalk "^3.0.0" + co "^4.6.0" + expect "^25.5.0" + is-generator-fn "^2.0.0" + jest-each "^25.5.0" + jest-matcher-utils "^25.5.0" + jest-message-util "^25.5.0" + jest-runtime "^25.5.4" + jest-snapshot "^25.5.1" + jest-util "^25.5.0" + pretty-format "^25.5.0" + throat "^5.0.0" + +jest-leak-detector@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.5.0.tgz#2291c6294b0ce404241bb56fe60e2d0c3e34f0bb" + integrity sha512-rV7JdLsanS8OkdDpZtgBf61L5xZ4NnYLBq72r6ldxahJWWczZjXawRsoHyXzibM5ed7C2QRjpp6ypgwGdKyoVA== + dependencies: + jest-get-type "^25.2.6" + pretty-format "^25.5.0" + +jest-matcher-utils@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.5.0.tgz#fbc98a12d730e5d2453d7f1ed4a4d948e34b7867" + integrity sha512-VWI269+9JS5cpndnpCwm7dy7JtGQT30UHfrnM3mXl22gHGt/b7NkjBqXfbhZ8V4B7ANUsjK18PlSBmG0YH7gjw== + dependencies: + chalk "^3.0.0" + jest-diff "^25.5.0" + jest-get-type "^25.2.6" + pretty-format "^25.5.0" + +jest-message-util@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.5.0.tgz#ea11d93204cc7ae97456e1d8716251185b8880ea" + integrity sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/types" "^25.5.0" + "@types/stack-utils" "^1.0.1" + chalk "^3.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.2" + slash "^3.0.0" + stack-utils "^1.0.1" + +jest-mock@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.5.0.tgz#a91a54dabd14e37ecd61665d6b6e06360a55387a" + integrity sha512-eXWuTV8mKzp/ovHc5+3USJMYsTBhyQ+5A1Mak35dey/RG8GlM4YWVylZuGgVXinaW6tpvk/RSecmF37FKUlpXA== + dependencies: + "@jest/types" "^25.5.0" + +jest-pnp-resolver@^1.2.1: + version "1.2.3" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== + +jest-regex-util@^25.2.1, jest-regex-util@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.2.6.tgz#d847d38ba15d2118d3b06390056028d0f2fd3964" + integrity sha512-KQqf7a0NrtCkYmZZzodPftn7fL1cq3GQAFVMn5Hg8uKx/fIenLEobNanUxb7abQ1sjADHBseG/2FGpsv/wr+Qw== + +jest-resolve-dependencies@^25.5.4: + version "25.5.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.5.4.tgz#85501f53957c8e3be446e863a74777b5a17397a7" + integrity sha512-yFmbPd+DAQjJQg88HveObcGBA32nqNZ02fjYmtL16t1xw9bAttSn5UGRRhzMHIQbsep7znWvAvnD4kDqOFM0Uw== + dependencies: + "@jest/types" "^25.5.0" + jest-regex-util "^25.2.6" + jest-snapshot "^25.5.1" + +jest-resolve@^25.5.1: + version "25.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.5.1.tgz#0e6fbcfa7c26d2a5fe8f456088dc332a79266829" + integrity sha512-Hc09hYch5aWdtejsUZhA+vSzcotf7fajSlPA6EZPE1RmPBAD39XtJhvHWFStid58iit4IPDLI/Da4cwdDmAHiQ== + dependencies: + "@jest/types" "^25.5.0" + browser-resolve "^1.11.3" + chalk "^3.0.0" + graceful-fs "^4.2.4" + jest-pnp-resolver "^1.2.1" + read-pkg-up "^7.0.1" + realpath-native "^2.0.0" + resolve "^1.17.0" + slash "^3.0.0" + +jest-runner@^25.5.4: + version "25.5.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.5.4.tgz#ffec5df3875da5f5c878ae6d0a17b8e4ecd7c71d" + integrity sha512-V/2R7fKZo6blP8E9BL9vJ8aTU4TH2beuqGNxHbxi6t14XzTb+x90B3FRgdvuHm41GY8ch4xxvf0ATH4hdpjTqg== + dependencies: + "@jest/console" "^25.5.0" + "@jest/environment" "^25.5.0" + "@jest/test-result" "^25.5.0" + "@jest/types" "^25.5.0" + chalk "^3.0.0" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-config "^25.5.4" + jest-docblock "^25.3.0" + jest-haste-map "^25.5.1" + jest-jasmine2 "^25.5.4" + jest-leak-detector "^25.5.0" + jest-message-util "^25.5.0" + jest-resolve "^25.5.1" + jest-runtime "^25.5.4" + jest-util "^25.5.0" + jest-worker "^25.5.0" + source-map-support "^0.5.6" + throat "^5.0.0" + +jest-runtime@^25.5.4: + version "25.5.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.5.4.tgz#dc981fe2cb2137abcd319e74ccae7f7eeffbfaab" + integrity sha512-RWTt8LeWh3GvjYtASH2eezkc8AehVoWKK20udV6n3/gC87wlTbE1kIA+opCvNWyyPeBs6ptYsc6nyHUb1GlUVQ== + dependencies: + "@jest/console" "^25.5.0" + "@jest/environment" "^25.5.0" + "@jest/globals" "^25.5.2" + "@jest/source-map" "^25.5.0" + "@jest/test-result" "^25.5.0" + "@jest/transform" "^25.5.1" + "@jest/types" "^25.5.0" + "@types/yargs" "^15.0.0" + chalk "^3.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.4" + jest-config "^25.5.4" + jest-haste-map "^25.5.1" + jest-message-util "^25.5.0" + jest-mock "^25.5.0" + jest-regex-util "^25.2.6" + jest-resolve "^25.5.1" + jest-snapshot "^25.5.1" + jest-util "^25.5.0" + jest-validate "^25.5.0" + realpath-native "^2.0.0" + slash "^3.0.0" + strip-bom "^4.0.0" + yargs "^15.3.1" + +jest-serializer@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.5.0.tgz#a993f484e769b4ed54e70e0efdb74007f503072b" + integrity sha512-LxD8fY1lByomEPflwur9o4e2a5twSQ7TaVNLlFUuToIdoJuBt8tzHfCsZ42Ok6LkKXWzFWf3AGmheuLAA7LcCA== + dependencies: + graceful-fs "^4.2.4" + +jest-snapshot@^25.5.1: + version "25.5.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.5.1.tgz#1a2a576491f9961eb8d00c2e5fd479bc28e5ff7f" + integrity sha512-C02JE1TUe64p2v1auUJ2ze5vcuv32tkv9PyhEb318e8XOKF7MOyXdJ7kdjbvrp3ChPLU2usI7Rjxs97Dj5P0uQ== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^25.5.0" + "@types/prettier" "^1.19.0" + chalk "^3.0.0" + expect "^25.5.0" + graceful-fs "^4.2.4" + jest-diff "^25.5.0" + jest-get-type "^25.2.6" + jest-matcher-utils "^25.5.0" + jest-message-util "^25.5.0" + jest-resolve "^25.5.1" + make-dir "^3.0.0" + natural-compare "^1.4.0" + pretty-format "^25.5.0" + semver "^6.3.0" + +jest-util@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.5.0.tgz#31c63b5d6e901274d264a4fec849230aa3fa35b0" + integrity sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA== + dependencies: + "@jest/types" "^25.5.0" + chalk "^3.0.0" + graceful-fs "^4.2.4" + is-ci "^2.0.0" + make-dir "^3.0.0" + +jest-validate@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.5.0.tgz#fb4c93f332c2e4cf70151a628e58a35e459a413a" + integrity sha512-okUFKqhZIpo3jDdtUXUZ2LxGUZJIlfdYBvZb1aczzxrlyMlqdnnws9MOxezoLGhSaFc2XYaHNReNQfj5zPIWyQ== + dependencies: + "@jest/types" "^25.5.0" + camelcase "^5.3.1" + chalk "^3.0.0" + jest-get-type "^25.2.6" + leven "^3.1.0" + pretty-format "^25.5.0" + +jest-watch-typeahead@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jest-watch-typeahead/-/jest-watch-typeahead-0.5.0.tgz#903dba6112f22daae7e90b0a271853f7ff182008" + integrity sha512-4r36w9vU8+rdg48hj0Z7TvcSqVP6Ao8dk04grlHQNgduyCB0SqrI0xWIl85ZhXrzYvxQ0N5H+rRLAejkQzEHeQ== + dependencies: + ansi-escapes "^4.2.1" + chalk "^3.0.0" + jest-regex-util "^25.2.1" + jest-watcher "^25.2.4" + slash "^3.0.0" + string-length "^3.1.0" + strip-ansi "^6.0.0" + +jest-watcher@^25.2.4, jest-watcher@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.5.0.tgz#d6110d101df98badebe435003956fd4a465e8456" + integrity sha512-XrSfJnVASEl+5+bb51V0Q7WQx65dTSk7NL4yDdVjPnRNpM0hG+ncFmDYJo9O8jaSRcAitVbuVawyXCRoxGrT5Q== + dependencies: + "@jest/test-result" "^25.5.0" + "@jest/types" "^25.5.0" + ansi-escapes "^4.2.1" + chalk "^3.0.0" + jest-util "^25.5.0" + string-length "^3.1.0" + +jest-worker@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" + integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== + dependencies: + merge-stream "^2.0.0" + supports-color "^6.1.0" + +jest-worker@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.5.0.tgz#2611d071b79cea0f43ee57a3d118593ac1547db1" + integrity sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw== + dependencies: + merge-stream "^2.0.0" + supports-color "^7.0.0" + +jest@^25.3.0: + version "25.5.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-25.5.4.tgz#f21107b6489cfe32b076ce2adcadee3587acb9db" + integrity sha512-hHFJROBTqZahnO+X+PMtT6G2/ztqAZJveGqz//FnWWHurizkD05PQGzRZOhF3XP6z7SJmL+5tCfW8qV06JypwQ== + dependencies: + "@jest/core" "^25.5.4" + import-local "^3.0.2" + jest-cli "^25.5.4" + +jpjs@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/jpjs/-/jpjs-1.2.1.tgz#f343833de8838a5beba1f42d5a219be0114c44b7" + integrity sha512-GxJWybWU4NV0RNKi6EIqk6IRPOTqd/h+U7sbtyuD7yUISUzV78LdHnq2xkevJsTlz/EImux4sWj+wfMiwKLkiw== + +js-sha3@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbi@^3.1.4: + version "3.2.5" + resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" + integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== + +jsdom@^15.2.1: + version "15.2.1" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5" + integrity sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g== + dependencies: + abab "^2.0.0" + acorn "^7.1.0" + acorn-globals "^4.3.2" + array-equal "^1.0.0" + cssom "^0.4.1" + cssstyle "^2.0.0" + data-urls "^1.1.0" + domexception "^1.0.1" + escodegen "^1.11.1" + html-encoding-sniffer "^1.0.2" + nwsapi "^2.2.0" + parse5 "5.1.0" + pn "^1.1.0" + request "^2.88.0" + request-promise-native "^1.0.7" + saxes "^3.1.9" + symbol-tree "^3.2.2" + tough-cookie "^3.0.1" + w3c-hr-time "^1.0.1" + w3c-xmlserializer "^1.1.2" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.5" + whatwg-mimetype "^2.3.0" + whatwg-url "^7.0.0" + ws "^7.0.0" + xml-name-validator "^3.0.0" + +jsesc@^3.0.2, jsesc@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + +json5@2.x, json5@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsprim@^1.2.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.4.0" + verror "1.10.0" + +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5: + version "3.3.5" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" + integrity sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ== + dependencies: + array-includes "^3.1.6" + array.prototype.flat "^1.3.1" + object.assign "^4.1.4" + object.values "^1.1.6" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== + dependencies: + is-buffer "^1.1.5" + +kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +language-subtag-registry@^0.3.20: + version "0.3.23" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz#23529e04d9e3b74679d70142df3fd2eb6ec572e7" + integrity sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ== + +language-tags@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.9.tgz#1ffdcd0ec0fafb4b1be7f8b11f306ad0f9c08777" + integrity sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA== + dependencies: + language-subtag-registry "^0.3.20" + +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== + +lodash.memoize@4.x: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== + +lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== + dependencies: + chalk "^2.4.2" + +log-update@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" + integrity sha512-vlP11XfFGyeNQlmEn9tJ66rEW1coA/79m5z6BCkudjbAGE83uhAcGYrBFwfs3AdLiLzGRusRPAbSPK9xZteCmg== + dependencies: + ansi-escapes "^3.0.0" + cli-cursor "^2.0.0" + wrap-ansi "^3.0.1" + +lolex@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" + integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A== + dependencies: + "@sinonjs/commons" "^1.7.0" + +loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +magic-string@^0.25.2, magic-string@^0.25.7: + version "0.25.9" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" + integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== + dependencies: + sourcemap-codec "^1.4.8" + +make-dir@^3.0.0, make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + +make-error@1.x: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== + dependencies: + tmpl "1.0.5" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== + dependencies: + object-visit "^1.0.0" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +micromatch@4.x, micromatch@^4.0.2: + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@0.x, mkdirp@^0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mri@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + +ms@^2.1.1, ms@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== + +node-notifier@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-6.0.0.tgz#cea319e06baa16deec8ce5cd7f133c4a46b68e12" + integrity sha512-SVfQ/wMw+DesunOm5cKqr6yDcvUTDl/yc97ybGHMrteNEY6oekXpNpS3lZwgLlwz0FLgHoiW28ZpmBHUDg37cw== + dependencies: + growly "^1.3.0" + is-wsl "^2.1.1" + semver "^6.3.0" + shellwords "^0.1.1" + which "^1.3.1" + +node-releases@^2.0.18: + version "2.0.18" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" + integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== + +normalize-package-data@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== + dependencies: + path-key "^2.0.0" + +npm-run-path@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +nwsapi@^2.2.0: + version "2.2.16" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.16.tgz#177760bba02c351df1d2644e220c31dfec8cdb43" + integrity sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-inspect@^1.13.1, object-inspect@^1.13.3: + version "1.13.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== + dependencies: + isobject "^3.0.0" + +object.assign@^4.1.4, object.assign@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== + dependencies: + call-bind "^1.0.5" + define-properties "^1.2.1" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +object.entries@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.8.tgz#bffe6f282e01f4d17807204a24f8edd823599c41" + integrity sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + +object.fromentries@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.8.tgz#f7195d8a9b97bd95cbc1999ea939ecd1a2b00c65" + integrity sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" + +object.groupby@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.3.tgz#9b125c36238129f6f7b61954a1e7176148d5002e" + integrity sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== + dependencies: + isobject "^3.0.1" + +object.values@^1.1.6, object.values@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.0.tgz#65405a9d92cee68ac2d303002e0b8470a4d9ab1b" + integrity sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ== + dependencies: + mimic-fn "^1.0.0" + +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +optionator@^0.8.1, optionator@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + +ora@^4.0.3: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-4.1.1.tgz#566cc0348a15c36f5f0e979612842e02ba9dddbc" + integrity sha512-sjYP8QyVWBpBZWD6Vr1M/KwknSw6kJOz41tvGMlwWeClHBtYKTbHMki1PsLZnxKpXMPbTKv9b3pjQu3REib96A== + dependencies: + chalk "^3.0.0" + cli-cursor "^3.1.0" + cli-spinners "^2.2.0" + is-interactive "^1.0.0" + log-symbols "^3.0.0" + mute-stream "0.0.8" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-each-series@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" + integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== + +p-finally@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" + integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-json@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +parse5@5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" + integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== + +pascal-case@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" + integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6, path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== + +picocolors@^1.0.0, picocolors@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + +picomatch@^2.0.4, picomatch@^2.2.2, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pirates@^4.0.1: + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== + +pkg-dir@^4.1.0, pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== + +possible-typed-array-names@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" + integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== + +pretty-format@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" + integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== + dependencies: + "@jest/types" "^24.9.0" + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + react-is "^16.8.4" + +pretty-format@^25.2.1, pretty-format@^25.5.0: + version "25.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a" + integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ== + dependencies: + "@jest/types" "^25.5.0" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + +progress-estimator@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/progress-estimator/-/progress-estimator-0.2.2.tgz#1c3947a5782ea56e40c8fccc290ac7ceeb1b91cb" + integrity sha512-GF76Ac02MTJD6o2nMNtmtOFjwWCnHcvXyn5HOWPQnEMO8OTLw7LAvNmrwe8LmdsB+eZhwUu9fX/c9iQnBxWaFA== + dependencies: + chalk "^2.4.1" + cli-spinners "^1.3.1" + humanize-duration "^3.15.3" + log-update "^2.3.0" + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +prompts@^2.0.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" + +prop-types@^15.8.1: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + +psl@^1.1.28: + version "1.15.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" + integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== + dependencies: + punycode "^2.3.1" + +pump@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" + integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + +qs@~6.5.2: + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +react-is@^16.12.0, react-is@^16.13.1, react-is@^16.8.4: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== + dependencies: + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" + +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + +realpath-native@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866" + integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q== + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== + dependencies: + resolve "^1.1.6" + +reflect.getprototypeof@^1.0.4, reflect.getprototypeof@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.7.tgz#04311b33a1b713ca5eb7b5aed9950a86481858e5" + integrity sha512-bMvFGIUKlc/eSfXNX+aZ+EL95/EgZzuwA0OBPTbZZDEJw/0AkentjMuM1oiRfwHrshqk4RzdgiTg5CcDalXN5g== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.5" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + which-builtin-type "^1.1.4" + +regenerate-unicode-properties@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz#626e39df8c372338ea9b8028d1f99dc3fd9c3db0" + integrity sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA== + dependencies: + regenerate "^1.4.2" + +regenerate@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== + +regenerator-runtime@^0.13.7: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + +regenerator-transform@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" + integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== + dependencies: + "@babel/runtime" "^7.8.4" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexp.prototype.flags@^1.5.2, regexp.prototype.flags@^1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz#b3ae40b1d2499b8350ab2c3fe6ef3845d3a96f42" + integrity sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-errors "^1.3.0" + set-function-name "^2.0.2" + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +regexpp@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +regexpu-core@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-6.2.0.tgz#0e5190d79e542bf294955dccabae04d3c7d53826" + integrity sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA== + dependencies: + regenerate "^1.4.2" + regenerate-unicode-properties "^10.2.0" + regjsgen "^0.8.0" + regjsparser "^0.12.0" + unicode-match-property-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.1.0" + +regjsgen@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.8.0.tgz#df23ff26e0c5b300a6470cad160a9d090c3a37ab" + integrity sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q== + +regjsparser@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.12.0.tgz#0e846df6c6530586429377de56e0475583b088dc" + integrity sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ== + dependencies: + jsesc "~3.0.2" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== + +repeat-element@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" + integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== + +request-promise-core@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" + integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== + dependencies: + lodash "^4.17.19" + +request-promise-native@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" + integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== + dependencies: + request-promise-core "1.1.4" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.88.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg== + +resolve@1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.22.4: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^2.0.0-next.5: + version "2.0.0-next.5" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c" + integrity sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q== + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +rimraf@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +rollup-plugin-sourcemaps@^0.6.2: + version "0.6.3" + resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed" + integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw== + dependencies: + "@rollup/pluginutils" "^3.0.9" + source-map-resolve "^0.6.0" + +rollup-plugin-terser@^5.1.2: + version "5.3.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.3.1.tgz#8c650062c22a8426c64268548957463bf981b413" + integrity sha512-1pkwkervMJQGFYvM9nscrUoncPwiKR/K+bHdjv6PFgRo3cgPHoRT83y2Aa3GvINj4539S15t/tpFPb775TDs6w== + dependencies: + "@babel/code-frame" "^7.5.5" + jest-worker "^24.9.0" + rollup-pluginutils "^2.8.2" + serialize-javascript "^4.0.0" + terser "^4.6.2" + +rollup-plugin-typescript2@^0.27.3: + version "0.27.3" + resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.3.tgz#cd9455ac026d325b20c5728d2cc54a08a771b68b" + integrity sha512-gmYPIFmALj9D3Ga1ZbTZAKTXq1JKlTQBtj299DXhqYz9cL3g/AQfUvbb2UhH+Nf++cCq941W2Mv7UcrcgLzJJg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + find-cache-dir "^3.3.1" + fs-extra "8.1.0" + resolve "1.17.0" + tslib "2.0.1" + +rollup-pluginutils@^2.8.2: + version "2.8.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" + integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== + dependencies: + estree-walker "^0.6.1" + +rollup@^1.32.1: + version "1.32.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4" + integrity sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A== + dependencies: + "@types/estree" "*" + "@types/node" "*" + acorn "^7.1.0" + +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== + +run-async@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + +rxjs@^6.6.0: + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== + dependencies: + tslib "^1.9.0" + +sade@^1.4.2: + version "1.8.1" + resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" + integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A== + dependencies: + mri "^1.1.0" + +safe-array-concat@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb" + integrity sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q== + dependencies: + call-bind "^1.0.7" + get-intrinsic "^1.2.4" + has-symbols "^1.0.3" + isarray "^2.0.5" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-regex-test@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377" + integrity sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw== + dependencies: + call-bind "^1.0.6" + es-errors "^1.3.0" + is-regex "^1.1.4" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +saxes@^3.1.9: + version "3.1.11" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b" + integrity sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g== + dependencies: + xmlchars "^2.1.1" + +"semver@2 || 3 || 4 || 5", semver@^5.5.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@6.x, semver@^6.0.0, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.1.1, semver@^7.3.2, semver@^7.5.3: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + +serialize-javascript@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" + integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== + dependencies: + randombytes "^2.1.0" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== + +set-function-length@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + +set-function-name@^2.0.1, set-function-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" + integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.2" + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== + dependencies: + shebang-regex "^1.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +shelljs@^0.8.3: + version "0.8.5" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" + integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== + +side-channel@^1.0.4, side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-resolve@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" + integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + +source-map-support@^0.5.6, source-map-support@~0.5.12: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" + integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== + +source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@^0.7.3: + version "0.7.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" + integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== + +sourcemap-codec@^1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + +spdx-correct@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" + integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz#5d607d27fc806f66d7b64a766650fa890f04ed66" + integrity sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.20" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz#e44ed19ed318dd1e5888f93325cee800f0f51b89" + integrity sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +sshpk@^1.7.0: + version "1.18.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" + integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stack-utils@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.5.tgz#a19b0b01947e0029c8e451d5d61a498f5bb1471b" + integrity sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ== + dependencies: + escape-string-regexp "^2.0.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g== + +string-length@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837" + integrity sha512-Ttp5YvkGm5v9Ijagtaz1BnN+k9ObpvS0eIBblPMp2YWL8FBmi9qblQ9fexc2k/CXFgrTIteU3jAw3payCnwSTA== + dependencies: + astral-regex "^1.0.0" + strip-ansi "^5.2.0" + +string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string.prototype.includes@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz#eceef21283640761a81dbe16d6c7171a4edf7d92" + integrity sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.3" + +string.prototype.matchall@^4.0.11: + version "4.0.11" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz#1092a72c59268d2abaad76582dccc687c0297e0a" + integrity sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.7" + regexp.prototype.flags "^1.5.2" + set-function-name "^2.0.2" + side-channel "^1.0.6" + +string.prototype.repeat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz#e90872ee0308b29435aa26275f6e1b762daee01a" + integrity sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + +string.prototype.trim@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" + integrity sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.0" + es-object-atoms "^1.0.0" + +string.prototype.trimend@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz#3651b8513719e8a9f48de7f2f77640b26652b229" + integrity sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + +string.prototype.trimstart@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" + integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-json-comments@^3.0.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.0.0, supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-hyperlinks@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" + integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== + dependencies: + has-flag "^4.0.0" + supports-color "^7.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +symbol-tree@^3.2.2: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + +table@^5.2.3: + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== + dependencies: + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +terminal-link@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" + integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== + dependencies: + ansi-escapes "^4.2.1" + supports-hyperlinks "^2.0.0" + +terser@^4.6.2: + version "4.8.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" + integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== + dependencies: + commander "^2.20.0" + source-map "~0.6.1" + source-map-support "~0.5.12" + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +throat@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" + integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + +tiny-glob@^0.2.6: + version "0.2.9" + resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2" + integrity sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg== + dependencies: + globalyzer "0.1.0" + globrex "^0.1.2" + +tiny-invariant@^1.1.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.3.tgz#46680b7a873a0d5d10005995eb90a70d74d60127" + integrity sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg== + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmpl@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +toformat@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/toformat/-/toformat-2.0.0.tgz#7a043fd2dfbe9021a4e36e508835ba32056739d8" + integrity sha512-03SWBVop6nU8bpyZCx7SodpYznbZF5R4ljwNLBcTQzKOD9xuihRo/psX58llS1BMFhhAI08H3luot5GoXJz2pQ== + +tough-cookie@^2.3.3, tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" + integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== + dependencies: + ip-regex "^2.1.0" + psl "^1.1.28" + punycode "^2.1.1" + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== + dependencies: + punycode "^2.1.0" + +ts-jest@^25.3.1: + version "25.5.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.5.1.tgz#2913afd08f28385d54f2f4e828be4d261f4337c7" + integrity sha512-kHEUlZMK8fn8vkxDjwbHlxXRB9dHYpyzqKIGDNxbzs+Rz+ssNDSDNusEK8Fk/sDd4xE6iKoQLfFkFVaskmTJyw== + dependencies: + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + json5 "2.x" + lodash.memoize "4.x" + make-error "1.x" + micromatch "4.x" + mkdirp "0.x" + semver "6.x" + yargs-parser "18.x" + +tsconfig-paths@^3.15.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" + integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + +tsdx@^0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/tsdx/-/tsdx-0.14.1.tgz#8771d509b6fc523ad971bae3a63ebe3a88355ab3" + integrity sha512-keHmFdCL2kx5nYFlBdbE3639HQ2v9iGedAFAajobrUTH2wfX0nLPdDhbHv+GHLQZqf0c5ur1XteE8ek/+Eyj5w== + dependencies: + "@babel/core" "^7.4.4" + "@babel/helper-module-imports" "^7.0.0" + "@babel/parser" "^7.11.5" + "@babel/plugin-proposal-class-properties" "^7.4.4" + "@babel/preset-env" "^7.11.0" + "@babel/traverse" "^7.11.5" + "@rollup/plugin-babel" "^5.1.0" + "@rollup/plugin-commonjs" "^11.0.0" + "@rollup/plugin-json" "^4.0.0" + "@rollup/plugin-node-resolve" "^9.0.0" + "@rollup/plugin-replace" "^2.2.1" + "@types/jest" "^25.2.1" + "@typescript-eslint/eslint-plugin" "^2.12.0" + "@typescript-eslint/parser" "^2.12.0" + ansi-escapes "^4.2.1" + asyncro "^3.0.0" + babel-eslint "^10.0.3" + babel-plugin-annotate-pure-calls "^0.4.0" + babel-plugin-dev-expression "^0.2.1" + babel-plugin-macros "^2.6.1" + babel-plugin-polyfill-regenerator "^0.0.4" + babel-plugin-transform-rename-import "^2.3.0" + camelcase "^6.0.0" + chalk "^4.0.0" + enquirer "^2.3.4" + eslint "^6.1.0" + eslint-config-prettier "^6.0.0" + eslint-config-react-app "^5.2.1" + eslint-plugin-flowtype "^3.13.0" + eslint-plugin-import "^2.18.2" + eslint-plugin-jsx-a11y "^6.2.3" + eslint-plugin-prettier "^3.1.0" + eslint-plugin-react "^7.14.3" + eslint-plugin-react-hooks "^2.2.0" + execa "^4.0.3" + fs-extra "^9.0.0" + jest "^25.3.0" + jest-watch-typeahead "^0.5.0" + jpjs "^1.2.1" + lodash.merge "^4.6.2" + ora "^4.0.3" + pascal-case "^3.1.1" + prettier "^1.19.1" + progress-estimator "^0.2.2" + regenerator-runtime "^0.13.7" + rollup "^1.32.1" + rollup-plugin-sourcemaps "^0.6.2" + rollup-plugin-terser "^5.1.2" + rollup-plugin-typescript2 "^0.27.3" + sade "^1.4.2" + semver "^7.1.1" + shelljs "^0.8.3" + tiny-glob "^0.2.6" + ts-jest "^25.3.1" + tslib "^1.9.3" + typescript "^3.7.3" + +tslib@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" + integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== + +tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.0.3: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + +tsutils@^3.17.1: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +typed-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" + integrity sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + is-typed-array "^1.1.13" + +typed-array-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" + integrity sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + +typed-array-byte-offset@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.3.tgz#3fa9f22567700cc86aaf86a1e7176f74b59600f2" + integrity sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + reflect.getprototypeof "^1.0.6" + +typed-array-length@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.7.tgz#ee4deff984b64be1e118b0de8c9c877d5ce73d3d" + integrity sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + is-typed-array "^1.1.13" + possible-typed-array-names "^1.0.0" + reflect.getprototypeof "^1.0.6" + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +typescript@^3.7.3: + version "3.9.10" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" + integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== + +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== + +unicode-canonical-property-names-ecmascript@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz#cb3173fe47ca743e228216e4a3ddc4c84d628cc2" + integrity sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg== + +unicode-match-property-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" + integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== + dependencies: + unicode-canonical-property-names-ecmascript "^2.0.0" + unicode-property-aliases-ecmascript "^2.0.0" + +unicode-match-property-value-ecmascript@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz#a0401aee72714598f739b68b104e4fe3a0cb3c71" + integrity sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg== + +unicode-property-aliases-ecmascript@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +universalify@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" + integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +update-browserslist-db@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" + integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== + dependencies: + escalade "^3.2.0" + picocolors "^1.1.0" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +v8-compile-cache@^2.0.3: + version "2.4.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" + integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== + +v8-to-istanbul@^4.1.3: + version "4.1.4" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.4.tgz#b97936f21c0e2d9996d4985e5c5156e9d4e49cd6" + integrity sha512-Rw6vJHj1mbdK8edjR7+zuJrpDtKIgNdAvTSAcpYfgMIw+u2dPDntD3dgN4XQFLU2/fvFQdzj+EeSGfd/jnY5fQ== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^1.6.0" + source-map "^0.7.3" + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +w3c-hr-time@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" + integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== + dependencies: + browser-process-hrtime "^1.0.0" + +w3c-xmlserializer@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" + integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== + dependencies: + domexception "^1.0.1" + webidl-conversions "^4.0.2" + xml-name-validator "^3.0.0" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== + dependencies: + makeerror "1.0.12" + +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== + dependencies: + defaults "^1.0.3" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + +whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" + integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +which-boxed-primitive@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.1.0.tgz#2d850d6c4ac37b95441a67890e19f3fda8b6c6d9" + integrity sha512-Ei7Miu/AXe2JJ4iNF5j/UphAgRoma4trE6PtisM09bPygb3egMH3YLW/befsWb1A1AxvNSFidOFTB18XtnIIng== + dependencies: + is-bigint "^1.1.0" + is-boolean-object "^1.2.0" + is-number-object "^1.1.0" + is-string "^1.1.0" + is-symbol "^1.1.0" + +which-builtin-type@^1.1.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/which-builtin-type/-/which-builtin-type-1.2.0.tgz#58042ac9602d78a6d117c7e811349df1268ba63c" + integrity sha512-I+qLGQ/vucCby4tf5HsLmGueEla4ZhwTBSqaooS+Y0BuxN4Cp+okmGuV+8mXZ84KDI9BA+oklo+RzKg0ONdSUA== + dependencies: + call-bind "^1.0.7" + function.prototype.name "^1.1.6" + has-tostringtag "^1.0.2" + is-async-function "^2.0.0" + is-date-object "^1.0.5" + is-finalizationregistry "^1.1.0" + is-generator-function "^1.0.10" + is-regex "^1.1.4" + is-weakref "^1.0.2" + isarray "^2.0.5" + which-boxed-primitive "^1.0.2" + which-collection "^1.0.2" + which-typed-array "^1.1.15" + +which-collection@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.2.tgz#627ef76243920a107e7ce8e96191debe4b16c2a0" + integrity sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== + dependencies: + is-map "^2.0.3" + is-set "^2.0.3" + is-weakmap "^2.0.2" + is-weakset "^2.0.3" + +which-module@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" + integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== + +which-typed-array@^1.1.14, which-typed-array@^1.1.15: + version "1.1.16" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.16.tgz#db4db429c4706feca2f01677a144278e4a8c216b" + integrity sha512-g+N+GAWiRj66DngFwHvISJd+ITsyphZvD1vChfVg6cEdnzy53GzB3oy0fUNlvhz7H7+MiqhYr26qxQShCpKTTQ== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.2" + +which@^1.2.9, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +which@^2.0.1, which@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@~1.2.3: + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== + +wrap-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" + integrity sha512-iXR3tDXpbnTpzjKSylUJRkLuOrEC7hwEB221cgn6wtF8wpmz28puFXAEfPT5zrjM3wahygB//VuWEr1vTkDcNQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + +ws@^7.0.0: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + +xmlchars@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + +y18n@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yaml@^1.7.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + +yargs-parser@18.x, yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^15.3.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" diff --git a/src/pages/AddLiquidity/PoolPriceBar.tsx b/src/pages/AddLiquidity/PoolPriceBar.tsx index e0465c63cfc..074930a20ed 100644 --- a/src/pages/AddLiquidity/PoolPriceBar.tsx +++ b/src/pages/AddLiquidity/PoolPriceBar.tsx @@ -1,4 +1,4 @@ -import { Currency, Percent, Price } from '@uniswap/sdk-core' +import { Currency, Percent, Price } from '../../libs/sdk-core' import React, { useContext } from 'react' import { Text } from 'rebass' import { ThemeContext } from 'styled-components' diff --git a/src/pages/AddLiquidity/Review.tsx b/src/pages/AddLiquidity/Review.tsx index 0303303a3b2..faeaa5513ce 100644 --- a/src/pages/AddLiquidity/Review.tsx +++ b/src/pages/AddLiquidity/Review.tsx @@ -3,7 +3,7 @@ import { Field } from '../../state/mint/v3/actions' import { AutoColumn } from 'components/Column' import Card from 'components/Card' import styled from 'styled-components/macro' -import { Currency, CurrencyAmount, Price } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Price } from '../../libs/sdk-core' import { Position } from '@uniswap/v3-sdk' import { PositionPreview } from 'components/PositionPreview' diff --git a/src/pages/AddLiquidity/index.tsx b/src/pages/AddLiquidity/index.tsx index d06be6db83f..c7f9b38ad1c 100644 --- a/src/pages/AddLiquidity/index.tsx +++ b/src/pages/AddLiquidity/index.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useContext, useMemo, useState } from 'react' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, CurrencyAmount, currencyEquals, Percent } from '@uniswap/sdk-core' -import { WETH9 } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, currencyEquals, Percent } from '../../libs/sdk-core' +import { WETH9 } from '../../libs/sdk-core' import { AlertTriangle, AlertCircle } from 'react-feather' import ReactGA from 'react-ga' import { ZERO_PERCENT } from '../../constants/misc' diff --git a/src/pages/AddLiquidity/redirects.tsx b/src/pages/AddLiquidity/redirects.tsx index b3227d2caef..a5f9c5a936c 100644 --- a/src/pages/AddLiquidity/redirects.tsx +++ b/src/pages/AddLiquidity/redirects.tsx @@ -2,7 +2,7 @@ import { useActiveWeb3React } from 'hooks/web3' import React from 'react' import { Redirect, RouteComponentProps } from 'react-router-dom' import AddLiquidity from './index' -import { WETH9 } from '@uniswap/sdk-core' +import { WETH9 } from '../../libs/sdk-core' export function RedirectDuplicateTokenIds( props: RouteComponentProps<{ currencyIdA: string; currencyIdB: string; feeAmount?: string }> diff --git a/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx b/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx index a9cb2bc65f0..5732b5448e5 100644 --- a/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx +++ b/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Fraction, Percent } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent } from '../../libs/sdk-core' import React from 'react' import { Text } from 'rebass' import { ButtonPrimary } from '../../components/Button' diff --git a/src/pages/AddLiquidityV2/PoolPriceBar.tsx b/src/pages/AddLiquidityV2/PoolPriceBar.tsx index 2acde3b4920..b652d74550d 100644 --- a/src/pages/AddLiquidityV2/PoolPriceBar.tsx +++ b/src/pages/AddLiquidityV2/PoolPriceBar.tsx @@ -1,4 +1,4 @@ -import { Currency, Percent, Price } from '@uniswap/sdk-core' +import { Currency, Percent, Price } from '../../libs/sdk-core' import React, { useContext } from 'react' import { Text } from 'rebass' import { ThemeContext } from 'styled-components' diff --git a/src/pages/AddLiquidityV2/index.tsx b/src/pages/AddLiquidityV2/index.tsx index 112955254d5..6b9947a0e5d 100644 --- a/src/pages/AddLiquidityV2/index.tsx +++ b/src/pages/AddLiquidityV2/index.tsx @@ -1,6 +1,6 @@ import { BigNumber } from '@ethersproject/bignumber' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, CurrencyAmount, currencyEquals, Percent, WETH9 } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, currencyEquals, Percent, WETH9 } from '../../libs/sdk-core' import React, { useCallback, useContext, useState } from 'react' import { Plus } from 'react-feather' import ReactGA from 'react-ga' diff --git a/src/pages/Earn/Manage.tsx b/src/pages/Earn/Manage.tsx index 537d100a97c..c82f7d310f3 100644 --- a/src/pages/Earn/Manage.tsx +++ b/src/pages/Earn/Manage.tsx @@ -3,7 +3,7 @@ import { AutoColumn } from '../../components/Column' import styled from 'styled-components/macro' import { Link } from 'react-router-dom' import JSBI from 'jsbi' -import { Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, CurrencyAmount } from '../../libs/sdk-core' import { RouteComponentProps } from 'react-router-dom' import DoubleCurrencyLogo from '../../components/DoubleLogo' import { useCurrency } from '../../hooks/Tokens' diff --git a/src/pages/MigrateV2/MigrateV2Pair.tsx b/src/pages/MigrateV2/MigrateV2Pair.tsx index 1cc028e209d..9f459d47dbe 100644 --- a/src/pages/MigrateV2/MigrateV2Pair.tsx +++ b/src/pages/MigrateV2/MigrateV2Pair.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React, { useCallback, useMemo, useState, useEffect } from 'react' -import { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '@uniswap/sdk-core' +import { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '../../libs/sdk-core' import { FACTORY_ADDRESS } from '@uniswap/v2-sdk' import { Redirect, RouteComponentProps } from 'react-router' import { Text } from 'rebass' diff --git a/src/pages/MigrateV2/index.tsx b/src/pages/MigrateV2/index.tsx index c4708add488..a8e048d9d3e 100644 --- a/src/pages/MigrateV2/index.tsx +++ b/src/pages/MigrateV2/index.tsx @@ -1,6 +1,6 @@ import React, { useContext, useMemo } from 'react' import { Pair } from '@uniswap/v2-sdk' -import { Token, ChainId } from '@uniswap/sdk-core' +import { Token, ChainId } from '../../libs/sdk-core' import { ThemeContext } from 'styled-components' import { AutoColumn } from '../../components/Column' import { AutoRow } from '../../components/Row' diff --git a/src/pages/Pool/PositionPage.tsx b/src/pages/Pool/PositionPage.tsx index 3eec74bb27c..92479cf523d 100644 --- a/src/pages/Pool/PositionPage.tsx +++ b/src/pages/Pool/PositionPage.tsx @@ -34,7 +34,7 @@ import { Ether, currencyEquals, ETHER, -} from '@uniswap/sdk-core' +} from '../../libs/sdk-core' import { useActiveWeb3React } from 'hooks/web3' import { useV3NFTPositionManagerContract } from 'hooks/useContract' import { useIsTransactionPending, useTransactionAdder } from 'state/transactions/hooks' diff --git a/src/pages/PoolFinder/index.tsx b/src/pages/PoolFinder/index.tsx index d9bd7a51661..ab7bc4ba2a6 100644 --- a/src/pages/PoolFinder/index.tsx +++ b/src/pages/PoolFinder/index.tsx @@ -1,4 +1,4 @@ -import { Currency, ETHER, CurrencyAmount, Token } from '@uniswap/sdk-core' +import { Currency, ETHER, CurrencyAmount, Token } from '../../libs/sdk-core' import JSBI from 'jsbi' import React, { useCallback, useEffect, useState } from 'react' import { Plus } from 'react-feather' diff --git a/src/pages/RemoveLiquidity/V3.tsx b/src/pages/RemoveLiquidity/V3.tsx index 7efbe3f24bd..c9572fe7c52 100644 --- a/src/pages/RemoveLiquidity/V3.tsx +++ b/src/pages/RemoveLiquidity/V3.tsx @@ -22,7 +22,7 @@ import ReactGA from 'react-ga' import { useActiveWeb3React } from 'hooks/web3' import { TransactionResponse } from '@ethersproject/providers' import { useTransactionAdder } from 'state/transactions/hooks' -import { Percent, currencyEquals, Token, ETHER } from '@uniswap/sdk-core' +import { Percent, currencyEquals, Token, ETHER } from '../../libs/sdk-core' import { TYPE } from 'theme' import { Wrapper, SmallMaxButton, ResponsiveHeaderText } from './styled' import Loader from 'components/Loader' diff --git a/src/pages/RemoveLiquidity/index.tsx b/src/pages/RemoveLiquidity/index.tsx index fa9b6f8c347..e23f319bdf4 100644 --- a/src/pages/RemoveLiquidity/index.tsx +++ b/src/pages/RemoveLiquidity/index.tsx @@ -1,6 +1,6 @@ import { Contract } from '@ethersproject/contracts' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, currencyEquals, Percent, WETH9 } from '@uniswap/sdk-core' +import { Currency, currencyEquals, Percent, WETH9 } from '../../libs/sdk-core' import React, { useCallback, useContext, useMemo, useState } from 'react' import { ArrowDown, Plus } from 'react-feather' import ReactGA from 'react-ga' diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index be078b864d7..10ea2531996 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Token, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Token, TradeType } from '../../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { AdvancedSwapDetails } from 'components/swap/AdvancedSwapDetails' diff --git a/src/pages/Vote/VotePage.tsx b/src/pages/Vote/VotePage.tsx index 429eecb8855..1ea051c8d05 100644 --- a/src/pages/Vote/VotePage.tsx +++ b/src/pages/Vote/VotePage.tsx @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '../../libs/sdk-core' import { BigNumber } from 'ethers' import useCurrentBlockTimestamp from 'hooks/useCurrentBlockTimestamp' import JSBI from 'jsbi' diff --git a/src/pages/Vote/index.tsx b/src/pages/Vote/index.tsx index 782f4fd6331..98adab2a2e2 100644 --- a/src/pages/Vote/index.tsx +++ b/src/pages/Vote/index.tsx @@ -22,7 +22,7 @@ import DelegateModal from '../../components/vote/DelegateModal' import { useTokenBalance } from '../../state/wallet/hooks' import { useActiveWeb3React } from '../../hooks/web3' import { ZERO_ADDRESS } from '../../constants/misc' -import { Token, CurrencyAmount, ChainId } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, ChainId } from '../../libs/sdk-core' import JSBI from 'jsbi' import { shortenAddress } from '../../utils' import Loader from '../../components/Loader' diff --git a/src/state/application/reducer.test.ts b/src/state/application/reducer.test.ts index 51bed65dbf9..7426da75151 100644 --- a/src/state/application/reducer.test.ts +++ b/src/state/application/reducer.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../../libs/sdk-core' import { createStore, Store } from 'redux' import { addPopup, ApplicationModal, removePopup, setOpenModal, updateBlockNumber } from './actions' import reducer, { ApplicationState } from './reducer' diff --git a/src/state/application/reducer.ts b/src/state/application/reducer.ts index f8299472396..4ff9b58a472 100644 --- a/src/state/application/reducer.ts +++ b/src/state/application/reducer.ts @@ -1,5 +1,6 @@ import { createReducer, nanoid } from '@reduxjs/toolkit' import { addPopup, PopupContent, removePopup, updateBlockNumber, ApplicationModal, setOpenModal } from './actions' +import { ChainId } from '../../libs/sdk-core' type PopupList = Array<{ key: string; show: boolean; content: PopupContent; removeAfterMs: number | null }> diff --git a/src/state/burn/hooks.ts b/src/state/burn/hooks.ts index 6da54033cfd..09493e802ff 100644 --- a/src/state/burn/hooks.ts +++ b/src/state/burn/hooks.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Token, Currency, Percent, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, Currency, Percent, CurrencyAmount } from '../../libs/sdk-core' import { Pair } from '@uniswap/v2-sdk' import { useCallback } from 'react' import { useDispatch, useSelector } from 'react-redux' diff --git a/src/state/burn/v3/hooks.ts b/src/state/burn/v3/hooks.ts index 30749820dfe..1719e8f13bb 100644 --- a/src/state/burn/v3/hooks.ts +++ b/src/state/burn/v3/hooks.ts @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount, Percent, Ether, currencyEquals, ETHER } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, Percent, Ether, currencyEquals, ETHER } from '../../../libs/sdk-core' import { Position } from '@uniswap/v3-sdk' import { usePool } from 'hooks/usePools' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/state/claim/hooks.ts b/src/state/claim/hooks.ts index 027d473023b..249fa0f33b2 100644 --- a/src/state/claim/hooks.ts +++ b/src/state/claim/hooks.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { CurrencyAmount, ChainId, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, ChainId, Token } from '../../libs/sdk-core' import { TransactionResponse } from '@ethersproject/providers' import { useEffect, useState } from 'react' import { UNI } from '../../constants/tokens' diff --git a/src/state/governance/hooks.ts b/src/state/governance/hooks.ts index 7f37630bcf6..7688ca64a35 100644 --- a/src/state/governance/hooks.ts +++ b/src/state/governance/hooks.ts @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '../../libs/sdk-core' import { isAddress } from 'ethers/lib/utils' import { PROPOSAL_DESCRIPTION_TEXT } from '../../constants/proposals' import { UNI } from '../../constants/tokens' diff --git a/src/state/lists/actions.ts b/src/state/lists/actions.ts index a64724c3ac8..285aea25370 100644 --- a/src/state/lists/actions.ts +++ b/src/state/lists/actions.ts @@ -1,5 +1,6 @@ import { ActionCreatorWithPayload, createAction } from '@reduxjs/toolkit' import { TokenList, Version } from '@uniswap/token-lists' +import { ChainId } from '../../libs/sdk-core' export const fetchTokenList: Readonly<{ pending: ActionCreatorWithPayload<{ url: string; requestId: string }> diff --git a/src/state/lists/hooks.ts b/src/state/lists/hooks.ts index 42d80553309..1d7072eb617 100644 --- a/src/state/lists/hooks.ts +++ b/src/state/lists/hooks.ts @@ -1,5 +1,5 @@ import DEFAULT_TOKEN_LIST from '@uniswap/default-token-list' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../../libs/sdk-core' import { TokenList } from '@uniswap/token-lists' import { useMemo } from 'react' import { useSelector } from 'react-redux' diff --git a/src/state/lists/reducer.test.ts b/src/state/lists/reducer.test.ts index 635abb1b2ca..8d9b7fbfd9b 100644 --- a/src/state/lists/reducer.test.ts +++ b/src/state/lists/reducer.test.ts @@ -4,6 +4,7 @@ import { DEFAULT_LIST_OF_LISTS } from '../../constants/lists' import { updateVersion } from '../global/actions' import { fetchTokenList, acceptListUpdate, addList, removeList, enableList } from './actions' import reducer, { ListsState } from './reducer' +import { ChainId } from '../../libs/sdk-core' const STUB_TOKEN_LIST = { name: '', diff --git a/src/state/lists/reducer.ts b/src/state/lists/reducer.ts index 4e857e71999..5988fa201c8 100644 --- a/src/state/lists/reducer.ts +++ b/src/state/lists/reducer.ts @@ -5,6 +5,7 @@ import { TokenList } from '@uniswap/token-lists/dist/types' import { DEFAULT_LIST_OF_LISTS } from '../../constants/lists' import { updateVersion } from '../global/actions' import { acceptListUpdate, addList, fetchTokenList, removeList, enableList, disableList } from './actions' +import { ChainId } from '../../libs/sdk-core' export interface ListsState { readonly byUrl: { diff --git a/src/state/lists/updater.ts b/src/state/lists/updater.ts index b2c5acee66e..c134a1166f5 100644 --- a/src/state/lists/updater.ts +++ b/src/state/lists/updater.ts @@ -10,6 +10,7 @@ import { AppDispatch } from '../index' import { acceptListUpdate } from './actions' import { useActiveListUrls } from './hooks' import { UNSUPPORTED_LIST_URLS } from 'constants/lists' +import { ChainId } from '../../libs/sdk-core' export default function Updater(): null { const { library } = useActiveWeb3React() diff --git a/src/state/lists/wrappedTokenInfo.ts b/src/state/lists/wrappedTokenInfo.ts index 8d7a1d0f1c9..d974e75970d 100644 --- a/src/state/lists/wrappedTokenInfo.ts +++ b/src/state/lists/wrappedTokenInfo.ts @@ -1,4 +1,4 @@ -import { ChainId, Token } from '@uniswap/sdk-core' +import { ChainId, Token } from '../../libs/sdk-core' import { Tags, TokenInfo } from '@uniswap/token-lists' import { TokenList } from '@uniswap/token-lists/dist/types' import { isAddress } from '../../utils' diff --git a/src/state/mint/hooks.ts b/src/state/mint/hooks.ts index 233a44599a2..ed79e0d25e6 100644 --- a/src/state/mint/hooks.ts +++ b/src/state/mint/hooks.ts @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from 'react-redux' import { AppDispatch, AppState } from '../index' import { Field, typeInput } from './actions' import { Pair } from '@uniswap/v2-sdk' -import { Currency, Token, Percent, Price, CurrencyAmount } from '@uniswap/sdk-core' +import { Currency, Token, Percent, Price, CurrencyAmount } from '../../libs/sdk-core' import JSBI from 'jsbi' import { PairState, useV2Pair } from '../../hooks/useV2Pairs' import { useTotalSupply } from '../../hooks/useTotalSupply' diff --git a/src/state/mint/v3/hooks.ts b/src/state/mint/v3/hooks.ts index 62c23c6ddcc..b8a4e670f90 100644 --- a/src/state/mint/v3/hooks.ts +++ b/src/state/mint/v3/hooks.ts @@ -12,7 +12,7 @@ import { TICK_SPACINGS, encodeSqrtRatioX96, } from '@uniswap/v3-sdk/dist/' -import { Currency, Token, CurrencyAmount, currencyEquals, Price, Rounding } from '@uniswap/sdk-core' +import { Currency, Token, CurrencyAmount, currencyEquals, Price, Rounding } from '../../../libs/sdk-core' import { useCallback, useMemo } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useActiveWeb3React } from '../../../hooks/web3' diff --git a/src/state/mint/v3/utils.ts b/src/state/mint/v3/utils.ts index 8c5669879fe..07c80b34b6d 100644 --- a/src/state/mint/v3/utils.ts +++ b/src/state/mint/v3/utils.ts @@ -6,7 +6,7 @@ import { encodeSqrtRatioX96, TickMath, } from '@uniswap/v3-sdk/dist/' -import { Price, Token } from '@uniswap/sdk-core' +import { Price, Token } from '../../../libs/sdk-core' import { tryParseAmount } from 'state/swap/hooks' import JSBI from 'jsbi' diff --git a/src/state/stake/hooks.ts b/src/state/stake/hooks.ts index 4f18d562890..73e9e830966 100644 --- a/src/state/stake/hooks.ts +++ b/src/state/stake/hooks.ts @@ -1,4 +1,4 @@ -import { ChainId, Token, CurrencyAmount, WETH9 } from '@uniswap/sdk-core' +import { ChainId, Token, CurrencyAmount, WETH9 } from '../../libs/sdk-core' import { Pair } from '@uniswap/v2-sdk' import JSBI from 'jsbi' import { useMemo } from 'react' diff --git a/src/state/swap/hooks.ts b/src/state/swap/hooks.ts index 855bc250e66..cc775fe69bc 100644 --- a/src/state/swap/hooks.ts +++ b/src/state/swap/hooks.ts @@ -3,7 +3,7 @@ import { Trade as V3Trade } from '@uniswap/v3-sdk' import { useBestV3TradeExactIn, useBestV3TradeExactOut, V3TradeState } from '../../hooks/useBestV3Trade' import useENS from '../../hooks/useENS' import { parseUnits } from '@ethersproject/units' -import { Currency, CurrencyAmount, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Percent, TradeType } from '../../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { ParsedQs } from 'qs' import { useCallback, useEffect, useState } from 'react' diff --git a/src/state/transactions/actions.ts b/src/state/transactions/actions.ts index b56b712e3fb..fe94dcb5462 100644 --- a/src/state/transactions/actions.ts +++ b/src/state/transactions/actions.ts @@ -1,5 +1,5 @@ import { createAction } from '@reduxjs/toolkit' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../../libs/sdk-core' export interface SerializableTransactionReceipt { to: string diff --git a/src/state/transactions/reducer.test.ts b/src/state/transactions/reducer.test.ts index 8914b83db58..ccd520b0eff 100644 --- a/src/state/transactions/reducer.test.ts +++ b/src/state/transactions/reducer.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../../libs/sdk-core' import { createStore, Store } from 'redux' import { addTransaction, checkedTransaction, clearAllTransactions, finalizeTransaction } from './actions' import reducer, { initialState, TransactionState } from './reducer' diff --git a/src/state/user/hooks.tsx b/src/state/user/hooks.tsx index a2217ef0b8c..e070285cedc 100644 --- a/src/state/user/hooks.tsx +++ b/src/state/user/hooks.tsx @@ -1,4 +1,4 @@ -import { ChainId, Percent, Token } from '@uniswap/sdk-core' +import { ChainId, Percent, Token } from '../../libs/sdk-core' import { Pair } from '@uniswap/v2-sdk' import JSBI from 'jsbi' import flatMap from 'lodash.flatmap' diff --git a/src/state/wallet/hooks.ts b/src/state/wallet/hooks.ts index 8b99c54545d..6ba147f2f85 100644 --- a/src/state/wallet/hooks.ts +++ b/src/state/wallet/hooks.ts @@ -1,4 +1,4 @@ -import { Currency, Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Currency, Token, CurrencyAmount } from '../../libs/sdk-core' import JSBI from 'jsbi' import { useMemo } from 'react' import { UNI } from '../../constants/tokens' diff --git a/src/utils/calculateSlippageAmount.test.ts b/src/utils/calculateSlippageAmount.test.ts index e8245260892..dd47c06f4d1 100644 --- a/src/utils/calculateSlippageAmount.test.ts +++ b/src/utils/calculateSlippageAmount.test.ts @@ -1,5 +1,5 @@ import { AddressZero } from '@ethersproject/constants' -import { ChainId, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' +import { ChainId, CurrencyAmount, Percent, Token } from '../libs/sdk-core' import { calculateSlippageAmount } from './calculateSlippageAmount' describe('#calculateSlippageAmount', () => { diff --git a/src/utils/calculateSlippageAmount.ts b/src/utils/calculateSlippageAmount.ts index 9dd5fbadb86..3af322337c2 100644 --- a/src/utils/calculateSlippageAmount.ts +++ b/src/utils/calculateSlippageAmount.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Fraction, Percent } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent } from '../libs/sdk-core' import JSBI from 'jsbi' const ONE = new Fraction(1, 1) diff --git a/src/utils/computeFiatValuePriceImpact.tsx b/src/utils/computeFiatValuePriceImpact.tsx index f4206253c51..8812d1d0f10 100644 --- a/src/utils/computeFiatValuePriceImpact.tsx +++ b/src/utils/computeFiatValuePriceImpact.tsx @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount, currencyEquals, Percent } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, currencyEquals, Percent } from '../libs/sdk-core' import JSBI from 'jsbi' import { ONE_HUNDRED_PERCENT } from '../constants/misc' diff --git a/src/utils/computeUniCirculation.test.ts b/src/utils/computeUniCirculation.test.ts index 6cc5cbb07b1..bf2cb03cb1d 100644 --- a/src/utils/computeUniCirculation.test.ts +++ b/src/utils/computeUniCirculation.test.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { ChainId, Token, CurrencyAmount } from '@uniswap/sdk-core' +import { ChainId, Token, CurrencyAmount } from '../libs/sdk-core' import { BigNumber } from 'ethers' import { ZERO_ADDRESS } from '../constants/misc' import { computeUniCirculation } from './computeUniCirculation' diff --git a/src/utils/computeUniCirculation.ts b/src/utils/computeUniCirculation.ts index c669887e74c..89d6c14adc7 100644 --- a/src/utils/computeUniCirculation.ts +++ b/src/utils/computeUniCirculation.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, CurrencyAmount } from '../libs/sdk-core' import { BigNumber } from 'ethers' import { STAKING_GENESIS } from '../state/stake/hooks' diff --git a/src/utils/constructSameAddressMap.ts b/src/utils/constructSameAddressMap.ts index 7df238f5cbf..13352de4d31 100644 --- a/src/utils/constructSameAddressMap.ts +++ b/src/utils/constructSameAddressMap.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' export function constructSameAddressMap( address: T, diff --git a/src/utils/currencyId.ts b/src/utils/currencyId.ts index c35e8b9a181..d610dff5dcc 100644 --- a/src/utils/currencyId.ts +++ b/src/utils/currencyId.ts @@ -1,4 +1,4 @@ -import { Currency } from '@uniswap/sdk-core' +import { Currency } from '../libs/sdk-core' export function currencyId(currency: Currency): string { if (currency.isEther) return 'ETH' diff --git a/src/utils/formatTokenAmount.ts b/src/utils/formatTokenAmount.ts index 5a3b0daab6c..651ded83792 100644 --- a/src/utils/formatTokenAmount.ts +++ b/src/utils/formatTokenAmount.ts @@ -1,4 +1,4 @@ -import { Price, CurrencyAmount, Currency, Fraction } from '@uniswap/sdk-core' +import { Price, CurrencyAmount, Currency, Fraction } from '../libs/sdk-core' import JSBI from 'jsbi' export function formatTokenAmount(amount: CurrencyAmount | undefined, sigFigs: number) { diff --git a/src/utils/getExplorerLink.test.ts b/src/utils/getExplorerLink.test.ts index 33f785830b6..68e5fcc0306 100644 --- a/src/utils/getExplorerLink.test.ts +++ b/src/utils/getExplorerLink.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' import { ExplorerDataType, getExplorerLink } from './getExplorerLink' describe('#getExplorerLink', () => { diff --git a/src/utils/getExplorerLink.ts b/src/utils/getExplorerLink.ts index 08ae647feb3..4565dbeb4e8 100644 --- a/src/utils/getExplorerLink.ts +++ b/src/utils/getExplorerLink.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' const ETHERSCAN_PREFIXES: { [chainId in ChainId]: string } = { 1: '', diff --git a/src/utils/getTickToPrice.ts b/src/utils/getTickToPrice.ts index 68494e99822..afa0aa9469f 100644 --- a/src/utils/getTickToPrice.ts +++ b/src/utils/getTickToPrice.ts @@ -1,4 +1,4 @@ -import { Token, Price } from '@uniswap/sdk-core' +import { Token, Price } from '../libs/sdk-core' import { tickToPrice } from '@uniswap/v3-sdk' export function getTickToPrice(baseToken?: Token, quoteToken?: Token, tick?: number): Price | undefined { diff --git a/src/utils/getTradeVersion.ts b/src/utils/getTradeVersion.ts index 059762692d4..43282db38dc 100644 --- a/src/utils/getTradeVersion.ts +++ b/src/utils/getTradeVersion.ts @@ -1,4 +1,4 @@ -import { Currency, TradeType } from '@uniswap/sdk-core' +import { Currency, TradeType } from '../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { Version } from '../hooks/useToggledVersion' diff --git a/src/utils/index.ts b/src/utils/index.ts index b9bde0d3078..763b92a2322 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -2,7 +2,7 @@ import { getAddress } from '@ethersproject/address' import { AddressZero } from '@ethersproject/constants' import { Contract } from '@ethersproject/contracts' import { JsonRpcSigner, Web3Provider } from '@ethersproject/providers' -import { ChainId, Token } from '@uniswap/sdk-core' +import { ChainId, Token } from '../libs/sdk-core' import { FeeAmount } from '@uniswap/v3-sdk/dist/' import { TokenAddressMap } from '../state/lists/hooks' diff --git a/src/utils/isTradeBetter.ts b/src/utils/isTradeBetter.ts index c90e5ac5f41..36ce9ea5921 100644 --- a/src/utils/isTradeBetter.ts +++ b/src/utils/isTradeBetter.ts @@ -1,5 +1,5 @@ import { ZERO_PERCENT, ONE_HUNDRED_PERCENT } from '../constants/misc' -import { Percent, currencyEquals, Currency, TradeType } from '@uniswap/sdk-core' +import { Percent, currencyEquals, Currency, TradeType } from '../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' diff --git a/src/utils/maxAmountSpend.ts b/src/utils/maxAmountSpend.ts index 2e7c0555f38..976ac62280d 100644 --- a/src/utils/maxAmountSpend.ts +++ b/src/utils/maxAmountSpend.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount } from '../libs/sdk-core' import JSBI from 'jsbi' import { MIN_ETH } from '../constants/misc' diff --git a/src/utils/prices.test.ts b/src/utils/prices.test.ts index 9063a13b3ca..93d3f4aacf5 100644 --- a/src/utils/prices.test.ts +++ b/src/utils/prices.test.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { ChainId, Percent, Token, CurrencyAmount, TradeType } from '@uniswap/sdk-core' +import { ChainId, Percent, Token, CurrencyAmount, TradeType } from '../libs/sdk-core' import { Trade, Pair, Route } from '@uniswap/v2-sdk' import { computeRealizedLPFeeAmount, warningSeverity } from './prices' diff --git a/src/utils/prices.ts b/src/utils/prices.ts index c5ca96442c8..fe322784e79 100644 --- a/src/utils/prices.ts +++ b/src/utils/prices.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Currency, CurrencyAmount, Fraction, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent, TradeType } from '../libs/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { diff --git a/src/utils/supportedChainId.ts b/src/utils/supportedChainId.ts index 5d9aefce0c7..984ed06f82b 100644 --- a/src/utils/supportedChainId.ts +++ b/src/utils/supportedChainId.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '../libs/sdk-core' /** * Returns the input chain ID if chain is supported. If not, return undefined diff --git a/src/utils/wrappedCurrency.ts b/src/utils/wrappedCurrency.ts index fda3d0ef181..a592cbb1d00 100644 --- a/src/utils/wrappedCurrency.ts +++ b/src/utils/wrappedCurrency.ts @@ -7,7 +7,7 @@ import { wrappedCurrency as wrappedCurrencyInternal, wrappedCurrencyAmount as wrappedCurrencyAmountInternal, WETH9, -} from '@uniswap/sdk-core' +} from '../libs/sdk-core' import { supportedChainId } from './supportedChainId' export function wrappedCurrency(currency: Currency | undefined, chainId: ChainId | undefined): Token | undefined { diff --git a/yarn.lock b/yarn.lock index e5de0384003..ce6632aab7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12450,10 +12450,10 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsbi@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.1.4.tgz#9654dd02207a66a4911b4e4bb74265bc2cbc9dd0" - integrity sha512-52QRRFSsi9impURE8ZUbzAMCLjPm4THO7H2fcuIvaaeFTbSysvkodbQQXIVsNgq/ypDbq6dJiuGKL0vZ/i9hUg== +jsbi@^3.1.4, jsbi@^3.2.5: + version "3.2.5" + resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" + integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== jsbn@~0.1.0: version "0.1.1" From 1b97b297cec899d938d31aa0706ed29e68429c9a Mon Sep 17 00:00:00 2001 From: alagunoff Date: Tue, 24 Dec 2024 16:03:26 +0300 Subject: [PATCH 04/30] - refactor: set specific node version in nvmrc; use automatic end of line for prettier --- .eslintrc.json | 7 ++++++- .nvmrc | 2 +- .prettierrc | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index ed10a7c4019..386c89a9ac7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,7 +23,12 @@ ], "rules": { "@typescript-eslint/explicit-function-return-type": "off", - "prettier/prettier": "error", + "prettier/prettier": [ + "error", + { + "endOfLine": "auto" + } + ], "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/ban-ts-ignore": "off", diff --git a/.nvmrc b/.nvmrc index b009dfb9d9f..cb406c60ce5 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/* +16.20.2 diff --git a/.prettierrc b/.prettierrc index 31ba22d8430..c9788e84d08 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "semi": false, "singleQuote": true, - "printWidth": 120 + "printWidth": 120, + "endOfLine": "auto" } From 8670d6b9d86c3fb9ef08a3c5b27ef19a699673e9 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Tue, 24 Dec 2024 17:22:32 +0300 Subject: [PATCH 05/30] fix: remove setting node env on server start --- package.json | 2 +- src/components/SearchModal/CurrencySearchModal.tsx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 7c80ed87fa9..a74c57cce1b 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "build": "yarn compile-contract-types && react-scripts build", "integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run'", "postinstall": "yarn compile-contract-types", - "start": "set NODE_OPTIONS=--openssl-legacy-provider && yarn compile-contract-types && react-scripts start", + "start": "yarn compile-contract-types && react-scripts start", "storybook": "start-storybook -p 6006", "test": "react-scripts test --env=jsdom" }, diff --git a/src/components/SearchModal/CurrencySearchModal.tsx b/src/components/SearchModal/CurrencySearchModal.tsx index cb5dd4edfe0..0e72e3d3be3 100644 --- a/src/components/SearchModal/CurrencySearchModal.tsx +++ b/src/components/SearchModal/CurrencySearchModal.tsx @@ -32,7 +32,6 @@ export default function CurrencySearchModal({ onCurrencySelect, selectedCurrency, otherSelectedCurrency, - showCommonBases = false, }: CurrencySearchModalProps) { const [modalView, setModalView] = useState(CurrencyModalView.manage) const lastOpen = useLast(isOpen) @@ -73,7 +72,6 @@ export default function CurrencySearchModal({ onCurrencySelect={handleCurrencySelect} selectedCurrency={selectedCurrency} otherSelectedCurrency={otherSelectedCurrency} - showCommonBases={showCommonBases} showImportView={() => setModalView(CurrencyModalView.importToken)} setImportToken={setImportToken} showManageView={() => setModalView(CurrencyModalView.manage)} From 9f1bbadc689a27e318660cd03dca270c92a9c917 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Wed, 25 Dec 2024 13:35:16 +0300 Subject: [PATCH 06/30] chore: remove some dependencies --- .storybook/main.ts | 16 - .storybook/manager.ts | 4 - .storybook/preview.tsx | 91 - .storybook/theme.ts | 17 - cypress.json | 8 - cypress/integration/add-liquidity.test.ts | 26 - cypress/integration/landing.test.ts | 22 - cypress/integration/lists.test.ts | 11 - cypress/integration/pool.test.ts | 7 - cypress/integration/remove-liquidity.test.ts | 31 - cypress/integration/send.test.ts | 11 - cypress/integration/swap.test.ts | 65 - cypress/support/commands.d.ts | 10 - cypress/support/commands.js | 86 - cypress/support/index.js | 9 - cypress/tsconfig.json | 10 - package.json | 11 - src/components/Badge/Badge.stories.tsx | 44 - src/components/Button/Button.stories.tsx | 153 - .../DoubleLogo/DoubleCurrencyLogo.stories.tsx | 18 - .../LineChart/LineChart.stories.tsx | 90 - src/components/Menu/Menu.stories.tsx | 23 - .../PositionList/PositionList.stories.tsx | 53 - .../PositionListItem.stories.tsx | 31 - yarn.lock | 3775 +---------------- 25 files changed, 155 insertions(+), 4467 deletions(-) delete mode 100644 .storybook/main.ts delete mode 100644 .storybook/manager.ts delete mode 100644 .storybook/preview.tsx delete mode 100644 .storybook/theme.ts delete mode 100644 cypress.json delete mode 100644 cypress/integration/add-liquidity.test.ts delete mode 100644 cypress/integration/landing.test.ts delete mode 100644 cypress/integration/lists.test.ts delete mode 100644 cypress/integration/pool.test.ts delete mode 100644 cypress/integration/remove-liquidity.test.ts delete mode 100644 cypress/integration/send.test.ts delete mode 100644 cypress/integration/swap.test.ts delete mode 100644 cypress/support/commands.d.ts delete mode 100644 cypress/support/commands.js delete mode 100644 cypress/support/index.js delete mode 100644 cypress/tsconfig.json delete mode 100644 src/components/Badge/Badge.stories.tsx delete mode 100644 src/components/Button/Button.stories.tsx delete mode 100644 src/components/DoubleLogo/DoubleCurrencyLogo.stories.tsx delete mode 100644 src/components/LineChart/LineChart.stories.tsx delete mode 100644 src/components/Menu/Menu.stories.tsx delete mode 100644 src/components/PositionList/PositionList.stories.tsx delete mode 100644 src/components/PositionListItem/PositionListItem.stories.tsx diff --git a/.storybook/main.ts b/.storybook/main.ts deleted file mode 100644 index 090fd9cf442..00000000000 --- a/.storybook/main.ts +++ /dev/null @@ -1,16 +0,0 @@ -const { dirname, join, parse, resolve } = require('path') -const { existsSync } = require('fs') - -module.exports = { - stories: ['../src/**/*.stories.@(ts|tsx)'], - addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/preset-create-react-app'], - typescript: { - check: true, - checkOptions: {}, - reactDocgen: 'react-docgen-typescript', - reactDocgenTypescriptOptions: { - shouldExtractLiteralValuesFromEnum: true, - propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true), - }, - }, -} diff --git a/.storybook/manager.ts b/.storybook/manager.ts deleted file mode 100644 index 10d4ed115a0..00000000000 --- a/.storybook/manager.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { addons } from '@storybook/addons' -import { light } from './theme' - -addons.setConfig({ theme: light }) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx deleted file mode 100644 index bd59dc83ea9..00000000000 --- a/.storybook/preview.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import 'inter-ui' -import { Story } from '@storybook/react/types-6-0' -import { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core' -import React from 'react' -import { Provider as StoreProvider } from 'react-redux' -import { ThemeProvider as SCThemeProvider } from 'styled-components' -import { NetworkContextName } from '../src/constants/misc' -import store from '../src/state' -import { FixedGlobalStyle, theme, ThemedGlobalStyle } from '../src/theme' -import getLibrary from '../src/utils/getLibrary' -import * as storybookThemes from './theme' - -export const parameters = { - actions: { argTypesRegex: '^on[A-Z].*' }, - dependencies: { - withStoriesOnly: true, - hideEmpty: true, - }, - docs: { - theme: storybookThemes.light, - }, - viewport: { - viewports: { - mobile: { - name: 'iPhone X', - styles: { - width: '375px', - height: '812px', - }, - }, - tablet: { - name: 'iPad', - styles: { - width: '768px', - height: '1024px', - }, - }, - laptop: { - name: 'Laptop', - styles: { - width: '1024px', - height: '768px', - }, - }, - desktop: { - name: 'Desktop', - styles: { - width: '1440px', - height: '1024px', - }, - }, - }, - }, -} - -export const globalTypes = { - theme: { - name: 'Theme', - description: 'Global theme for components', - defaultValue: 'light', - toolbar: { - icon: 'circlehollow', - items: ['light', 'dark'], - }, - }, -} - -const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName) - -const withProviders = (Component: Story, context: Record) => { - const THEME = theme(context.globals.theme === 'dark') - return ( - <> - - - - - - -
- -
-
-
-
-
- - ) -} - -export const decorators = [withProviders] diff --git a/.storybook/theme.ts b/.storybook/theme.ts deleted file mode 100644 index 0d3045f3868..00000000000 --- a/.storybook/theme.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { create } from '@storybook/theming' - -// this themes the storybook UI -const uniswapBaseTheme = { - brandTitle: 'Uniswap Design', - brandUrl: 'https://uniswap.org', - brandImage: 'https://ipfs.io/ipfs/QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir', -} -export const light = create({ - base: 'light', - ...uniswapBaseTheme, -}) - -// export const dark = create({ -// base: 'dark', -// ...uniswapBaseTheme, -// }) diff --git a/cypress.json b/cypress.json deleted file mode 100644 index c35d015d9f7..00000000000 --- a/cypress.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "baseUrl": "http://localhost:3000", - "pluginsFile": false, - "fixturesFolder": false, - "supportFile": "cypress/support/index.js", - "video": false, - "defaultCommandTimeout": 10000 -} diff --git a/cypress/integration/add-liquidity.test.ts b/cypress/integration/add-liquidity.test.ts deleted file mode 100644 index 372d90dfb25..00000000000 --- a/cypress/integration/add-liquidity.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -describe('Add Liquidity', () => { - it('loads the two correct tokens', () => { - cy.visit('/add/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85/0xc778417E063141139Fce010982780140Aa0cD5Ab/500') - cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'MKR') - cy.get('#add-liquidity-input-tokenb .token-symbol-container').should('contain.text', 'ETH') - }) - - it('does not crash if ETH is duplicated', () => { - cy.visit('/add/0xc778417E063141139Fce010982780140Aa0cD5Ab/0xc778417E063141139Fce010982780140Aa0cD5Ab') - cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'ETH') - cy.get('#add-liquidity-input-tokenb .token-symbol-container').should('not.contain.text', 'ETH') - }) - - it('token not in storage is loaded', () => { - cy.visit('/add/0xb290b2f9f8f108d03ff2af3ac5c8de6de31cdf6d/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85') - cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'SKL') - cy.get('#add-liquidity-input-tokenb .token-symbol-container').should('contain.text', 'MKR') - }) - - it('single token can be selected', () => { - cy.visit('/add/0xb290b2f9f8f108d03ff2af3ac5c8de6de31cdf6d') - cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'SKL') - cy.visit('/add/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85') - cy.get('#add-liquidity-input-tokena .token-symbol-container').should('contain.text', 'MKR') - }) -}) diff --git a/cypress/integration/landing.test.ts b/cypress/integration/landing.test.ts deleted file mode 100644 index a8e5db2260c..00000000000 --- a/cypress/integration/landing.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { TEST_ADDRESS_NEVER_USE_SHORTENED } from '../support/commands' - -describe('Landing Page', () => { - beforeEach(() => cy.visit('/')) - it('loads swap page', () => { - cy.get('#swap-page') - }) - - it('redirects to url /swap', () => { - cy.url().should('include', '/swap') - }) - - it('allows navigation to pool', () => { - cy.get('#pool-nav-link').click() - cy.url().should('include', '/pool') - }) - - it('is connected', () => { - cy.get('#web3-status-connected').click() - cy.get('#web3-account-identifier-row').contains(TEST_ADDRESS_NEVER_USE_SHORTENED) - }) -}) diff --git a/cypress/integration/lists.test.ts b/cypress/integration/lists.test.ts deleted file mode 100644 index 5d83e2d8784..00000000000 --- a/cypress/integration/lists.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -describe('Lists', () => { - beforeEach(() => { - cy.visit('/swap') - }) - - // @TODO check if default lists are active when we have them - it('change list', () => { - cy.get('#swap-currency-output .open-currency-select-button').click() - cy.get('.list-token-manage-button').click() - }) -}) diff --git a/cypress/integration/pool.test.ts b/cypress/integration/pool.test.ts deleted file mode 100644 index d910edb5187..00000000000 --- a/cypress/integration/pool.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -describe('Pool', () => { - beforeEach(() => cy.visit('/pool')) - it('add liquidity links to /add/ETH', () => { - cy.get('#join-pool-button').click() - cy.url().should('contain', '/add/ETH') - }) -}) diff --git a/cypress/integration/remove-liquidity.test.ts b/cypress/integration/remove-liquidity.test.ts deleted file mode 100644 index faea17132a5..00000000000 --- a/cypress/integration/remove-liquidity.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -describe('Remove Liquidity', () => { - it('eth remove', () => { - cy.visit('/remove/v2/ETH/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85') - cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'ETH') - cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'MKR') - }) - - it('eth remove swap order', () => { - cy.visit('/remove/v2/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85/ETH') - cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'MKR') - cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'ETH') - }) - - it('loads the two correct tokens', () => { - cy.visit('/remove/v2/0xc778417E063141139Fce010982780140Aa0cD5Ab/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85') - cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'WETH') - cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'MKR') - }) - - it('does not crash if ETH is duplicated', () => { - cy.visit('/remove/v2/0xc778417E063141139Fce010982780140Aa0cD5Ab/0xc778417E063141139Fce010982780140Aa0cD5Ab') - cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'WETH') - cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'WETH') - }) - - it('token not in storage is loaded', () => { - cy.visit('/remove/v2/0xb290b2f9f8f108d03ff2af3ac5c8de6de31cdf6d/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85') - cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'SKL') - cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'MKR') - }) -}) diff --git a/cypress/integration/send.test.ts b/cypress/integration/send.test.ts deleted file mode 100644 index 35b8dee1089..00000000000 --- a/cypress/integration/send.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -describe('Send', () => { - it('should redirect', () => { - cy.visit('/send') - cy.url().should('include', '/swap') - }) - - it('should redirect with url params', () => { - cy.visit('/send?outputCurrency=ETH&recipient=bob.argent.xyz') - cy.url().should('contain', '/swap?outputCurrency=ETH&recipient=bob.argent.xyz') - }) -}) diff --git a/cypress/integration/swap.test.ts b/cypress/integration/swap.test.ts deleted file mode 100644 index 46216c2f444..00000000000 --- a/cypress/integration/swap.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -describe('Swap', () => { - beforeEach(() => { - cy.visit('/swap') - }) - it('can enter an amount into input', () => { - cy.get('#swap-currency-input .token-amount-input').type('0.001', { delay: 200 }).should('have.value', '0.001') - }) - - it('zero swap amount', () => { - cy.get('#swap-currency-input .token-amount-input').type('0.0', { delay: 200 }).should('have.value', '0.0') - }) - - it('invalid swap amount', () => { - cy.get('#swap-currency-input .token-amount-input').type('\\', { delay: 200 }).should('have.value', '') - }) - - it('can enter an amount into output', () => { - cy.get('#swap-currency-output .token-amount-input').type('0.001', { delay: 200 }).should('have.value', '0.001') - }) - - it('zero output amount', () => { - cy.get('#swap-currency-output .token-amount-input').type('0.0', { delay: 200 }).should('have.value', '0.0') - }) - - it.skip('can swap ETH for DAI', () => { - cy.get('#swap-currency-output .open-currency-select-button').click() - cy.get('.token-item-0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735').should('be.visible') - cy.get('.token-item-0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735').click({ force: true }) - cy.get('#swap-currency-input .token-amount-input').should('be.visible') - cy.get('#swap-currency-input .token-amount-input').type('0.001', { force: true, delay: 200 }) - cy.get('#swap-currency-output .token-amount-input').should('not.equal', '') - cy.get('#swap-button').click() - cy.get('#confirm-swap-or-send').should('contain', 'Confirm Swap') - }) - - it.skip('add a recipient does not exist unless in expert mode', () => { - cy.get('#add-recipient-button').should('not.exist') - }) - - describe('expert mode', () => { - beforeEach(() => { - cy.window().then((win) => { - cy.stub(win, 'prompt').returns('confirm') - }) - cy.get('#open-settings-dialog-button').click() - cy.get('#toggle-expert-mode-button').click() - cy.get('#confirm-expert-mode').click() - }) - - it.skip('add a recipient is visible', () => { - cy.get('#add-recipient-button').should('be.visible') - }) - - it.skip('add a recipient', () => { - cy.get('#add-recipient-button').click() - cy.get('#recipient').should('exist') - }) - - it.skip('remove recipient', () => { - cy.get('#add-recipient-button').click() - cy.get('#remove-recipient-button').click() - cy.get('#recipient').should('not.exist') - }) - }) -}) diff --git a/cypress/support/commands.d.ts b/cypress/support/commands.d.ts deleted file mode 100644 index e7eba62fd3a..00000000000 --- a/cypress/support/commands.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const TEST_ADDRESS_NEVER_USE: string - -export const TEST_ADDRESS_NEVER_USE_SHORTENED: string - -// declare namespace Cypress { -// // eslint-disable-next-line @typescript-eslint/class-name-casing -// interface cy { -// additionalCommands(): void -// } -// } diff --git a/cypress/support/commands.js b/cypress/support/commands.js deleted file mode 100644 index a0c316d542c..00000000000 --- a/cypress/support/commands.js +++ /dev/null @@ -1,86 +0,0 @@ -// *********************************************** -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** - -import { JsonRpcProvider } from '@ethersproject/providers' -import { Wallet } from '@ethersproject/wallet' -import { Eip1193Bridge } from '@ethersproject/experimental/lib/eip1193-bridge' - -const TEST_PRIVATE_KEY = Cypress.env('INTEGRATION_TEST_PRIVATE_KEY') - -// address of the above key -export const TEST_ADDRESS_NEVER_USE = new Wallet(TEST_PRIVATE_KEY).address - -export const TEST_ADDRESS_NEVER_USE_SHORTENED = `${TEST_ADDRESS_NEVER_USE.substr( - 0, - 6 -)}...${TEST_ADDRESS_NEVER_USE.substr(-4, 4)}` - -class CustomizedBridge extends Eip1193Bridge { - chainId = 4 - - async sendAsync(...args) { - console.debug('sendAsync called', ...args) - return this.send(...args) - } - async send(...args) { - console.debug('send called', ...args) - const isCallbackForm = typeof args[0] === 'object' && typeof args[1] === 'function' - let callback - let method - let params - if (isCallbackForm) { - callback = args[1] - method = args[0].method - params = args[0].params - } else { - method = args[0] - params = args[1] - } - if (method === 'eth_requestAccounts' || method === 'eth_accounts') { - if (isCallbackForm) { - callback({ result: [TEST_ADDRESS_NEVER_USE] }) - } else { - return Promise.resolve([TEST_ADDRESS_NEVER_USE]) - } - } - if (method === 'eth_chainId') { - if (isCallbackForm) { - callback(null, { result: '0x4' }) - } else { - return Promise.resolve('0x4') - } - } - try { - const result = await super.send(method, params) - console.debug('result received', method, params, result) - if (isCallbackForm) { - callback(null, { result }) - } else { - return result - } - } catch (error) { - if (isCallbackForm) { - callback(error, null) - } else { - throw error - } - } - } -} - -// sets up the injected provider to be a mock ethereum provider with the given mnemonic/index -Cypress.Commands.overwrite('visit', (original, url, options) => { - return original(url.startsWith('/') && url.length > 2 && !url.startsWith('/#') ? `/#${url}` : url, { - ...options, - onBeforeLoad(win) { - options && options.onBeforeLoad && options.onBeforeLoad(win) - win.localStorage.clear() - const provider = new JsonRpcProvider('https://rinkeby.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847', 4) - const signer = new Wallet(TEST_PRIVATE_KEY, provider) - win.ethereum = new CustomizedBridge(signer, provider) - }, - }) -}) diff --git a/cypress/support/index.js b/cypress/support/index.js deleted file mode 100644 index 3d834ebd4ae..00000000000 --- a/cypress/support/index.js +++ /dev/null @@ -1,9 +0,0 @@ -// *********************************************************** -// This file is processed and loaded automatically before your test files. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.ts using ES2015 syntax: -import './commands' diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json deleted file mode 100644 index 0cbfffb01a2..00000000000 --- a/cypress/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - "baseUrl": "../node_modules", - "target": "es5", - "lib": ["es5", "dom"], - "types": ["cypress"] - }, - "include": ["**/*.ts"] -} diff --git a/package.json b/package.json index a74c57cce1b..ca54291dd92 100644 --- a/package.json +++ b/package.json @@ -11,15 +11,6 @@ "@reach/portal": "^0.10.3", "@react-hook/window-scroll": "^1.3.0", "@reduxjs/toolkit": "^1.3.5", - "@storybook/addon-actions": "^6.1.17", - "@storybook/addon-essentials": "^6.1.17", - "@storybook/addon-links": "^6.1.17", - "@storybook/addons": "^6.1.17", - "@storybook/components": "^6.1.17", - "@storybook/preset-create-react-app": "^3.1.5", - "@storybook/preset-typescript": "^3.0.0", - "@storybook/react": "^6.1.17", - "@storybook/theming": "^6.1.17", "@styled-system/css": "^5.1.5", "@typechain/ethers-v5": "^7.0.0", "@types/jest": "^25.2.1", @@ -36,7 +27,6 @@ "@types/react-window": "^1.8.2", "@types/rebass": "^4.0.7", "@types/styled-components": "^5.1.0", - "@types/testing-library__cypress": "^5.0.5", "@types/ua-parser-js": "^0.7.35", "@types/wcag-contrast": "^3.0.0", "@typescript-eslint/eslint-plugin": "^4.1.0", @@ -62,7 +52,6 @@ "cids": "^1.0.0", "copy-to-clipboard": "^3.2.0", "cross-env": "^7.0.2", - "cypress": "^4.11.0", "eslint": "^7.11.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-prettier": "^3.1.3", diff --git a/src/components/Badge/Badge.stories.tsx b/src/components/Badge/Badge.stories.tsx deleted file mode 100644 index 24d97b13b71..00000000000 --- a/src/components/Badge/Badge.stories.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { Story } from '@storybook/react/types-6-0' -import React, { PropsWithChildren } from 'react' -import Component, { BadgeProps, BadgeVariant } from './index' - -export default { - title: 'Badge', - argTypes: { - variant: { - name: 'variant', - type: { name: 'string', require: false }, - defaultValue: BadgeVariant.DEFAULT, - description: 'badge variant', - control: { - type: 'select', - options: Object.values(BadgeVariant), - }, - }, - }, - args: { - children: '🦄 UNISWAP 🦄', - }, -} - -const Template: Story> = (args) => {args.children} - -export const DefaultBadge = Template.bind({}) -DefaultBadge.args = { - variant: BadgeVariant.DEFAULT, -} - -export const WarningBadge = Template.bind({}) -WarningBadge.args = { - variant: BadgeVariant.WARNING, -} - -export const NegativeBadge = Template.bind({}) -NegativeBadge.args = { - variant: BadgeVariant.NEGATIVE, -} - -export const PositiveBadge = Template.bind({}) -PositiveBadge.args = { - variant: BadgeVariant.POSITIVE, -} diff --git a/src/components/Button/Button.stories.tsx b/src/components/Button/Button.stories.tsx deleted file mode 100644 index 6790862ad25..00000000000 --- a/src/components/Button/Button.stories.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import { Story } from '@storybook/react/types-6-0' -import styled from 'styled-components/macro' -import React from 'react' -import { - ButtonConfirmed, - ButtonDropdown, - ButtonDropdownGrey, - ButtonDropdownLight, - ButtonEmpty, - ButtonError, - ButtonGray, - ButtonLight, - ButtonOutlined, - ButtonPink, - ButtonPrimary, - ButtonRadio, - ButtonSecondary, - ButtonUNIGradient, - ButtonWhite, -} from './index' - -const wrapperCss = styled.main` - font-size: 2em; - margin: 3em; - max-width: 300px; -` - -export default { - title: 'Buttons', - argTypes: { - disabled: { control: { type: 'boolean' } }, - onClick: { action: 'clicked' }, - }, - decorators: [ - (Component: Story) => ( -
- -
- ), - ], -} - -const Unicorn = () => ( - - 🦄 - -) - -export const Radio = () => ( - - -  UNISWAP  - - -) -export const DropdownLight = () => ( - - -  UNISWAP  - - -) -export const DropdownGrey = () => ( - - -  UNISWAP  - - -) -export const Dropdown = () => ( - - -  UNISWAP  - - -) -export const Error = () => ( - - -  UNISWAP  - - -) -export const Confirmed = () => ( - - -  UNISWAP  - - -) -export const White = () => ( - - -  UNISWAP  - - -) -export const Empty = () => ( - - -  UNISWAP  - - -) -export const Outlined = () => ( - - -  UNISWAP  - - -) -export const UNIGradient = () => ( - - -  UNISWAP  - - -) -export const Pink = () => ( - - -  UNISWAP  - - -) -export const Secondary = () => ( - - -  UNISWAP  - - -) -export const Gray = () => ( - - -  UNISWAP  - - -) -export const Light = () => ( - - -  UNISWAP  - - -) -export const Primary = () => ( - - -  UNISWAP  - - -) diff --git a/src/components/DoubleLogo/DoubleCurrencyLogo.stories.tsx b/src/components/DoubleLogo/DoubleCurrencyLogo.stories.tsx deleted file mode 100644 index f7503464cf8..00000000000 --- a/src/components/DoubleLogo/DoubleCurrencyLogo.stories.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { Story } from '@storybook/react/types-6-0' -import React from 'react' -import { DAI, WBTC } from '../../constants/tokens' -import Component, { DoubleCurrencyLogoProps } from './index' - -export default { - title: 'DoubleCurrencyLogo', - decorators: [], -} - -const Template: Story = (args) => - -export const DoubleCurrencyLogo = Template.bind({}) -DoubleCurrencyLogo.args = { - currency0: DAI, - currency1: WBTC, - size: 220, -} diff --git a/src/components/LineChart/LineChart.stories.tsx b/src/components/LineChart/LineChart.stories.tsx deleted file mode 100644 index f91d2636550..00000000000 --- a/src/components/LineChart/LineChart.stories.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { Story } from '@storybook/react/types-6-0' -import React from 'react' -// import Row, { RowFixed } from 'components/Row' -import styled from 'styled-components/macro' -import Component, { LineChartProps } from './' -import { dummyData } from './data' -// import { AutoColumn } from 'components/Column' -// import { TYPE } from 'theme' -// import DoubleCurrencyLogo from 'components/DoubleLogo' -// import { MKR } from 'constants' -// import { ETHER } from '@uniswap/sdk' -// import LineChart from '.' - -const Wrapper = styled.div` - margin: 1em 2em; - max-width: 500px; - & > * { - font-size: 1em; - } -` - -export default { - title: 'Charts', - argTypes: { - disabled: { control: { type: 'boolean' } }, - onClick: { action: 'clicked' }, - }, - decorators: [ - (Component: Story) => ( - - - - ), - ], -} - -const Template: Story = (args) => {args.children} - -export const Basic = Template.bind({}) -Basic.args = { data: dummyData } - -// const Full = () => { -// const [value, setValue] = useState(dummyData[dummyData.length - 1].value) - -// const dummyUSDPrice = 410 // used for conversion - -// const TopLeftContent = () => ( -// -// -// {' '} -// -// ETH / MKR -// -// -// -// -// {value} MKR -// -// -// ($ -// {value -// ? (value * dummyUSDPrice).toLocaleString('USD', { -// currency: 'USD', -// minimumFractionDigits: 2 -// }) -// : null}{' '} -// ) -// -// -// -// ) - -// return ( -// -// } /> -// -// ) -// } - -// export const FullVersion = Template.bind(() => ) -// Full.args = { data: dummyData } -// Full.decorators = [ -// (Story: any) => { -// return ( -// -// -// -// ) -// } -// ] diff --git a/src/components/Menu/Menu.stories.tsx b/src/components/Menu/Menu.stories.tsx deleted file mode 100644 index cc896bd5199..00000000000 --- a/src/components/Menu/Menu.stories.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { Story } from '@storybook/react/types-6-0' -import React from 'react' -import styled from 'styled-components/macro' -import Component from './index' - -const Wrapper = styled.div` - max-width: 150px; -` -export default { - title: 'Menu', - decorators: [ - () => ( - - - - ), - ], -} - -const Template: Story = (args) => - -export const Menu = Template.bind({}) -Menu.args = {} diff --git a/src/components/PositionList/PositionList.stories.tsx b/src/components/PositionList/PositionList.stories.tsx deleted file mode 100644 index 99af15f61ac..00000000000 --- a/src/components/PositionList/PositionList.stories.tsx +++ /dev/null @@ -1,53 +0,0 @@ -// import { Story } from '@storybook/react/types-6-0' -// import React from 'react' -// import { Position } from 'types/position' -// import { basisPointsToPercent } from 'utils' -// import { DAI, WBTC } from '../../constants' -// import Component, { PositionListProps } from './index' -// import { CurrencyAmount } from '@uniswap/sdk-core' -// import JSBI from 'jsbi' - -// const FEE_BIPS = { -// FIVE: basisPointsToPercent(5), -// THIRTY: basisPointsToPercent(30), -// ONE_HUNDRED: basisPointsToPercent(100), -// } -// const daiAmount = CurrencyAmount.fromRawAmount(DAI, JSBI.BigInt(500 * 10 ** 18)) -// const wbtcAmount = CurrencyAmount.fromRawAmount(WBTC, JSBI.BigInt(10 ** 7)) -// const positions = [ -// { -// feesEarned: { -// DAI: 1000, -// WBTC: 0.005, -// }, -// feeLevel: FEE_BIPS.FIVE, -// tokenAmount0: daiAmount, -// tokenAmount1: wbtcAmount, -// tickLower: 40000, -// tickUpper: 60000, -// }, -// { -// feesEarned: { -// DAI: 1000, -// WBTC: 0.005, -// }, -// feeLevel: FEE_BIPS.THIRTY, -// tokenAmount0: daiAmount, -// tokenAmount1: wbtcAmount, -// tickLower: 45000, -// tickUpper: 55000, -// }, -// ] -// const positions: Position[] = [] - -export default { - title: 'PositionList', -} - -// const Template: Story = (args) => - -// export const PositionList = Template.bind({}) -// PositionList.args = { -// positions, -// showUnwrapped: true, -// } diff --git a/src/components/PositionListItem/PositionListItem.stories.tsx b/src/components/PositionListItem/PositionListItem.stories.tsx deleted file mode 100644 index fad9c484582..00000000000 --- a/src/components/PositionListItem/PositionListItem.stories.tsx +++ /dev/null @@ -1,31 +0,0 @@ -// import { Story } from '@storybook/react/types-6-0' -// import { FeeAmount, MAX_TICK, MIN_TICK, TICK_SPACINGS } from '@uniswap/v3-sdk' -// import { BigNumber } from 'ethers' -// import React from 'react' -// import { Position } from 'types/position' -// import Component, { PositionListItemProps } from './index' - -// const position: Position = { -// nonce: BigNumber.from(0), -// operator: '', -// token0: '', -// token1: '', -// fee: FeeAmount.LOW, -// tickLower: MIN_TICK(TICK_SPACINGS[FeeAmount.LOW]), -// tickUpper: MAX_TICK(TICK_SPACINGS[FeeAmount.LOW]), -// liquidity, -// feeGrowthInside0LastX128fee -// feeGrowthInside0LastX128 -// feeGrowthInside1LastX128 -// tokensOwed0 -// tokensOwed1 -// } - -export default { - title: 'PositionListItem', -} - -// const Template: Story = (args) => - -// export const PositionListItem = Template.bind({}) -// PositionListItem.args = {position} diff --git a/yarn.lock b/yarn.lock index ce6632aab7f..f200d9b166e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,7 +16,7 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.5.5": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== @@ -50,28 +50,6 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@7.12.9": - version "7.12.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" - integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.5" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.5" - "@babel/parser" "^7.12.7" - "@babel/template" "^7.12.7" - "@babel/traverse" "^7.12.9" - "@babel/types" "^7.12.7" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.1" - json5 "^2.1.2" - lodash "^4.17.19" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.5", "@babel/core@^7.8.4": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.2.tgz#54e45334ffc0172048e5c93ded36461d3ad4c417" @@ -93,27 +71,6 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/core@^7.12.10": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.15.tgz#a6d40917df027487b54312202a06812c4f7792d0" - integrity sha512-6GXmNYeNjS2Uz+uls5jalOemgIhnTMeaXo+yBUA72kC2uX/8VW6XyhVIo2L8/q0goKQA3EVKx0KOQpVKSeWadQ== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.9" - "@babel/helper-compilation-targets" "^7.13.13" - "@babel/helper-module-transforms" "^7.13.14" - "@babel/helpers" "^7.13.10" - "@babel/parser" "^7.13.15" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.15" - "@babel/types" "^7.13.14" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" - "@babel/generator@^7.12.1", "@babel/generator@^7.13.9", "@babel/generator@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.2.tgz#d5773e8b557d421fd6ce0d5efa5fd7fc22567c30" @@ -123,15 +80,6 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.12.11", "@babel/generator@^7.12.5": - version "7.13.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.9.tgz#3a7aa96f9efb8e2be42d38d80e2ceb4c64d8de39" - integrity sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw== - dependencies: - "@babel/types" "^7.13.0" - jsesc "^2.5.1" - source-map "^0.5.0" - "@babel/helper-annotate-as-pure@^7.0.0", "@babel/helper-annotate-as-pure@^7.10.4", "@babel/helper-annotate-as-pure@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab" @@ -147,7 +95,7 @@ "@babel/helper-explode-assignable-expression" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helper-compilation-targets@^7.12.1", "@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.13", "@babel/helper-compilation-targets@^7.13.16": +"@babel/helper-compilation-targets@^7.12.1", "@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.16": version "7.13.16" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== @@ -169,17 +117,6 @@ "@babel/helper-replace-supers" "^7.13.12" "@babel/helper-split-export-declaration" "^7.12.13" -"@babel/helper-create-class-features-plugin@^7.13.11": - version "7.13.11" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.11.tgz#30d30a005bca2c953f5653fc25091a492177f4f6" - integrity sha512-ays0I7XYq9xbjCSvT+EvysLgfc3tOkwCULHjrnscGT3A9qD4sk3wXnJ3of0MAWsWGjdinFvajHU2smYuqXKMrw== - dependencies: - "@babel/helper-function-name" "^7.12.13" - "@babel/helper-member-expression-to-functions" "^7.13.0" - "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/helper-replace-supers" "^7.13.0" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/helper-create-regexp-features-plugin@^7.12.13": version "7.12.17" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz#a2ac87e9e319269ac655b8d4415e94d38d663cb7" @@ -188,20 +125,6 @@ "@babel/helper-annotate-as-pure" "^7.12.13" regexpu-core "^4.7.1" -"@babel/helper-define-polyfill-provider@^0.1.5": - version "0.1.5" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.1.5.tgz#3c2f91b7971b9fc11fe779c945c014065dea340e" - integrity sha512-nXuzCSwlJ/WKr8qxzW816gwyT6VZgiJG17zR40fou70yfAcqjoNyTLl/DQ+FExw5Hx5KNqshmN8Ldl/r2N7cTg== - dependencies: - "@babel/helper-compilation-targets" "^7.13.0" - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/traverse" "^7.13.0" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - semver "^6.1.2" - "@babel/helper-define-polyfill-provider@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz#a640051772045fedaaecc6f0c6c69f02bdd34bf1" @@ -247,7 +170,7 @@ "@babel/traverse" "^7.13.15" "@babel/types" "^7.13.16" -"@babel/helper-member-expression-to-functions@^7.13.0", "@babel/helper-member-expression-to-functions@^7.13.12": +"@babel/helper-member-expression-to-functions@^7.13.12": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== @@ -261,7 +184,7 @@ dependencies: "@babel/types" "^7.13.12" -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.13.14", "@babel/helper-module-transforms@^7.14.0", "@babel/helper-module-transforms@^7.14.2": +"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.14.0", "@babel/helper-module-transforms@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz#ac1cc30ee47b945e3e0c4db12fa0c5389509dfe5" integrity sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA== @@ -282,11 +205,6 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-plugin-utils@7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" - integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== - "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" @@ -301,7 +219,7 @@ "@babel/helper-wrap-function" "^7.13.0" "@babel/types" "^7.13.0" -"@babel/helper-replace-supers@^7.12.13", "@babel/helper-replace-supers@^7.13.0", "@babel/helper-replace-supers@^7.13.12": +"@babel/helper-replace-supers@^7.12.13", "@babel/helper-replace-supers@^7.13.12": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== @@ -352,7 +270,7 @@ "@babel/traverse" "^7.13.0" "@babel/types" "^7.13.0" -"@babel/helpers@^7.12.1", "@babel/helpers@^7.13.10", "@babel/helpers@^7.14.0": +"@babel/helpers@^7.12.1", "@babel/helpers@^7.14.0": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== @@ -361,15 +279,6 @@ "@babel/traverse" "^7.14.0" "@babel/types" "^7.14.0" -"@babel/helpers@^7.12.5": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.10.tgz#fd8e2ba7488533cdeac45cc158e9ebca5e3c7df8" - integrity sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ== - dependencies: - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.0" - "@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" @@ -384,11 +293,6 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.2.tgz#0c1680aa44ad4605b16cbdcc5c341a61bde9c746" integrity sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ== -"@babel/parser@^7.12.11", "@babel/parser@^7.12.7": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.15.tgz#8e66775fb523599acb6a289e12929fa5ab0954d8" - integrity sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ== - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.13.12": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz#a3484d84d0b549f3fc916b99ee4783f26fabad2a" @@ -398,7 +302,7 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" "@babel/plugin-proposal-optional-chaining" "^7.13.12" -"@babel/plugin-proposal-async-generator-functions@^7.12.1", "@babel/plugin-proposal-async-generator-functions@^7.13.15", "@babel/plugin-proposal-async-generator-functions@^7.14.2": +"@babel/plugin-proposal-async-generator-functions@^7.12.1", "@babel/plugin-proposal-async-generator-functions@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.2.tgz#3a2085abbf5d5f962d480dbc81347385ed62eb1e" integrity sha512-b1AM4F6fwck4N8ItZ/AtC4FP/cqZqmKRQ4FaTDutwSYyjuhtvsGEMLK4N/ztV/ImP40BjIDyMgBQAeAMsQYVFQ== @@ -440,16 +344,7 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-decorators" "^7.12.1" -"@babel/plugin-proposal-decorators@^7.12.12": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.13.15.tgz#e91ccfef2dc24dd5bd5dcc9fc9e2557c684ecfb8" - integrity sha512-ibAMAqUm97yzi+LPgdr5Nqb9CMkeieGHvwPg1ywSGjZrZHQEGqE01HmOio8kxRpA/+VtOHouIVy2FMpBbtltjA== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.13.11" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/plugin-syntax-decorators" "^7.12.13" - -"@babel/plugin-proposal-dynamic-import@^7.12.1", "@babel/plugin-proposal-dynamic-import@^7.13.8", "@babel/plugin-proposal-dynamic-import@^7.14.2": +"@babel/plugin-proposal-dynamic-import@^7.12.1", "@babel/plugin-proposal-dynamic-import@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.2.tgz#01ebabd7c381cff231fa43e302939a9de5be9d9f" integrity sha512-oxVQZIWFh91vuNEMKltqNsKLFWkOIyJc95k2Gv9lWVyDfPUQGSSlbDEgWuJUU1afGE9WwlzpucMZ3yDRHIItkA== @@ -457,15 +352,7 @@ "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-default-from@^7.12.1": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.12.13.tgz#f110284108a9b2b96f01b15b3be9e54c2610a989" - integrity sha512-idIsBT+DGXdOHL82U+8bwX4goHm/z10g8sGGrQroh+HCRcm7mDv/luaGdWJQMTuCX2FsdXS7X0Nyyzp4znAPJA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-syntax-export-default-from" "^7.12.13" - -"@babel/plugin-proposal-export-namespace-from@^7.12.1", "@babel/plugin-proposal-export-namespace-from@^7.12.13", "@babel/plugin-proposal-export-namespace-from@^7.14.2": +"@babel/plugin-proposal-export-namespace-from@^7.12.1", "@babel/plugin-proposal-export-namespace-from@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.2.tgz#62542f94aa9ce8f6dba79eec698af22112253791" integrity sha512-sRxW3z3Zp3pFfLAgVEvzTFutTXax837oOatUIvSG9o5gRj9mKwm3br1Se5f4QalTQs9x4AzlA/HrCWbQIHASUQ== @@ -473,7 +360,7 @@ "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.12.1", "@babel/plugin-proposal-json-strings@^7.13.8", "@babel/plugin-proposal-json-strings@^7.14.2": +"@babel/plugin-proposal-json-strings@^7.12.1", "@babel/plugin-proposal-json-strings@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.2.tgz#830b4e2426a782e8b2878fbfe2cba85b70cbf98c" integrity sha512-w2DtsfXBBJddJacXMBhElGEYqCZQqN99Se1qeYn8DVLB33owlrlLftIbMzn5nz1OITfDVknXF433tBrLEAOEjA== @@ -481,7 +368,7 @@ "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.12.1", "@babel/plugin-proposal-logical-assignment-operators@^7.13.8", "@babel/plugin-proposal-logical-assignment-operators@^7.14.2": +"@babel/plugin-proposal-logical-assignment-operators@^7.12.1", "@babel/plugin-proposal-logical-assignment-operators@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.2.tgz#222348c080a1678e0e74ea63fe76f275882d1fd7" integrity sha512-1JAZtUrqYyGsS7IDmFeaem+/LJqujfLZ2weLR9ugB0ufUPjzf8cguyVT1g5im7f7RXxuLq1xUxEzvm68uYRtGg== @@ -497,7 +384,7 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.12.1", "@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8", "@babel/plugin-proposal-nullish-coalescing-operator@^7.14.2": +"@babel/plugin-proposal-nullish-coalescing-operator@^7.12.1", "@babel/plugin-proposal-nullish-coalescing-operator@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.2.tgz#425b11dc62fc26939a2ab42cbba680bdf5734546" integrity sha512-ebR0zU9OvI2N4qiAC38KIAK75KItpIPTpAtd2r4OZmMFeKbKJpUFLYP2EuDut82+BmYi8sz42B+TfTptJ9iG5Q== @@ -513,7 +400,7 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-numeric-separator@^7.12.1", "@babel/plugin-proposal-numeric-separator@^7.12.13", "@babel/plugin-proposal-numeric-separator@^7.14.2": +"@babel/plugin-proposal-numeric-separator@^7.12.1", "@babel/plugin-proposal-numeric-separator@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.2.tgz#82b4cc06571143faf50626104b335dd71baa4f9e" integrity sha512-DcTQY9syxu9BpU3Uo94fjCB3LN9/hgPS8oUL7KrSW3bA2ePrKZZPJcc5y0hoJAM9dft3pGfErtEUvxXQcfLxUg== @@ -521,16 +408,7 @@ "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069" - integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.0" - "@babel/plugin-transform-parameters" "^7.12.1" - -"@babel/plugin-proposal-object-rest-spread@^7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.13.8", "@babel/plugin-proposal-object-rest-spread@^7.14.2": +"@babel/plugin-proposal-object-rest-spread@^7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.2.tgz#e17d418f81cc103fedd4ce037e181c8056225abc" integrity sha512-hBIQFxwZi8GIp934+nj5uV31mqclC1aYDhctDu5khTi9PCCUOczyy0b34W0oE9U/eJXiqQaKyVsmjeagOaSlbw== @@ -541,7 +419,7 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-transform-parameters" "^7.14.2" -"@babel/plugin-proposal-optional-catch-binding@^7.12.1", "@babel/plugin-proposal-optional-catch-binding@^7.13.8", "@babel/plugin-proposal-optional-catch-binding@^7.14.2": +"@babel/plugin-proposal-optional-catch-binding@^7.12.1", "@babel/plugin-proposal-optional-catch-binding@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.2.tgz#150d4e58e525b16a9a1431bd5326c4eed870d717" integrity sha512-XtkJsmJtBaUbOxZsNk0Fvrv8eiqgneug0A6aqLFZ4TSkar2L5dSXWcnUKHgmjJt49pyB/6ZHvkr3dPgl9MOWRQ== @@ -567,15 +445,6 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.12.7": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz#ba9feb601d422e0adea6760c2bd6bbb7bfec4866" - integrity sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ== - dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-proposal-private-methods@^7.12.1", "@babel/plugin-proposal-private-methods@^7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz#04bd4c6d40f6e6bbfa2f57e2d8094bad900ef787" @@ -630,7 +499,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-decorators@^7.12.1", "@babel/plugin-syntax-decorators@^7.12.13": +"@babel/plugin-syntax-decorators@^7.12.1": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.12.13.tgz#fac829bf3c7ef4a1bc916257b403e58c6bdaf648" integrity sha512-Rw6aIXGuqDLr6/LoBBYE57nKOzQpz/aDkKlMqEwH+Vp0MXbG6H/TfRjaY343LKxzAKAMXIHsQ8JzaZKuDZ9MwA== @@ -644,13 +513,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-export-default-from@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.12.13.tgz#3c807d37efaf0a806f1deb556ccb3b2f562ae9c2" - integrity sha512-gVry0zqoums0hA+EniCYK3gABhjYSLX1dVuwYpPw9DrLNA4/GovXySHVg4FGRsZht09ON/5C2NVx3keq+qqVGQ== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-syntax-export-namespace-from@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" @@ -658,7 +520,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.12.1", "@babel/plugin-syntax-flow@^7.12.13": +"@babel/plugin-syntax-flow@^7.12.1": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.12.13.tgz#5df9962503c0a9c918381c929d51d4d6949e7e86" integrity sha512-J/RYxnlSLXZLVR7wTRsozxKT8qbsx1mNKJzXEEjQ0Kjx1ZACcyHgbanNWNCFtc36IzuWhYWPpvJFFoexoOWFmA== @@ -679,13 +541,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz#9d9d357cc818aa7ae7935917c1257f67677a0926" - integrity sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-jsx@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.13.tgz#044fb81ebad6698fe62c478875575bcbb9b70f15" @@ -714,7 +569,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@7.8.3", "@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": +"@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== @@ -779,21 +634,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-block-scoping@^7.12.1", "@babel/plugin-transform-block-scoping@^7.12.13", "@babel/plugin-transform-block-scoping@^7.14.2": +"@babel/plugin-transform-block-scoping@^7.12.1", "@babel/plugin-transform-block-scoping@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.2.tgz#761cb12ab5a88d640ad4af4aa81f820e6b5fdf5c" integrity sha512-neZZcP19NugZZqNwMTH+KoBjx5WyvESPSIOQb4JHpfd+zPfqcH65RMu5xJju5+6q/Y2VzYrleQTr+b6METyyxg== dependencies: "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-block-scoping@^7.12.12": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.13.tgz#f36e55076d06f41dfd78557ea039c1b581642e61" - integrity sha512-Pxwe0iqWJX4fOOM2kEZeUuAxHMWb9nK+9oh5d11bsLoB0xMg+mkDpt0eYuDZB7ETrY9bbcVlKUGTOGWy7BHsMQ== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.13.0", "@babel/plugin-transform-classes@^7.14.2": +"@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.2.tgz#3f1196c5709f064c252ad056207d87b7aeb2d03d" integrity sha512-7oafAVcucHquA/VZCsXv/gmuiHeYd64UJyyTYU+MPfNu0KeNlxw06IeENBO8bJjXVbolu+j1MM5aKQtH1OMCNg== @@ -813,7 +661,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-destructuring@^7.12.1", "@babel/plugin-transform-destructuring@^7.13.0", "@babel/plugin-transform-destructuring@^7.13.17": +"@babel/plugin-transform-destructuring@^7.12.1", "@babel/plugin-transform-destructuring@^7.13.17": version "7.13.17" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz#678d96576638c19d5b36b332504d3fd6e06dea27" integrity sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA== @@ -851,14 +699,6 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-flow" "^7.12.1" -"@babel/plugin-transform-flow-strip-types@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.13.0.tgz#58177a48c209971e8234e99906cb6bd1122addd3" - integrity sha512-EXAGFMJgSX8gxWD7PZtW/P6M+z74jpx3wm/+9pn+c2dOawPpBkUX7BrfyPvo6ZpXbgRIEuwgwDb/MGlKvu2pOg== - dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/plugin-syntax-flow" "^7.12.13" - "@babel/plugin-transform-for-of@^7.12.1", "@babel/plugin-transform-for-of@^7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz#c799f881a8091ac26b54867a845c3e97d2696062" @@ -888,7 +728,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-modules-amd@^7.12.1", "@babel/plugin-transform-modules-amd@^7.13.0", "@babel/plugin-transform-modules-amd@^7.14.2": +"@babel/plugin-transform-modules-amd@^7.12.1", "@babel/plugin-transform-modules-amd@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.2.tgz#6622806fe1a7c07a1388444222ef9535f2ca17b0" integrity sha512-hPC6XBswt8P3G2D1tSV2HzdKvkqOpmbyoy+g73JG0qlF/qx2y3KaMmXb1fLrpmWGLZYA0ojCvaHdzFWjlmV+Pw== @@ -897,7 +737,7 @@ "@babel/helper-plugin-utils" "^7.13.0" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.12.1", "@babel/plugin-transform-modules-commonjs@^7.13.8", "@babel/plugin-transform-modules-commonjs@^7.14.0": +"@babel/plugin-transform-modules-commonjs@^7.12.1", "@babel/plugin-transform-modules-commonjs@^7.14.0": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz#52bc199cb581e0992edba0f0f80356467587f161" integrity sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ== @@ -918,7 +758,7 @@ "@babel/helper-validator-identifier" "^7.12.11" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.12.1", "@babel/plugin-transform-modules-umd@^7.13.0", "@babel/plugin-transform-modules-umd@^7.14.0": +"@babel/plugin-transform-modules-umd@^7.12.1", "@babel/plugin-transform-modules-umd@^7.14.0": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz#2f8179d1bbc9263665ce4a65f305526b2ea8ac34" integrity sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw== @@ -948,7 +788,7 @@ "@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-replace-supers" "^7.12.13" -"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.13.0", "@babel/plugin-transform-parameters@^7.14.2": +"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.2.tgz#e4290f72e0e9e831000d066427c4667098decc31" integrity sha512-NxoVmA3APNCC1JdMXkdYXuQS+EMdqy0vIwyDHeKHiJKRxmp1qGSdb0JLEIoPRhkx6H/8Qi3RJ3uqOCYw8giy9A== @@ -1004,7 +844,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-react-jsx@^7.12.1", "@babel/plugin-transform-react-jsx@^7.12.12", "@babel/plugin-transform-react-jsx@^7.12.17", "@babel/plugin-transform-react-jsx@^7.13.12": +"@babel/plugin-transform-react-jsx@^7.12.1", "@babel/plugin-transform-react-jsx@^7.12.17", "@babel/plugin-transform-react-jsx@^7.13.12": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.13.12.tgz#1df5dfaf0f4b784b43e96da6f28d630e775f68b3" integrity sha512-jcEI2UqIcpCqB5U5DRxIl0tQEProI2gcu+g8VTIqxLO5Iidojb4d77q+fwGseCvd8af/lJ9masp4QWzBXFE2xA== @@ -1095,7 +935,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-typescript@^7.12.1", "@babel/plugin-transform-typescript@^7.13.0", "@babel/plugin-transform-typescript@^7.3.2": +"@babel/plugin-transform-typescript@^7.12.1": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.13.0.tgz#4a498e1f3600342d2a9e61f60131018f55774853" integrity sha512-elQEwluzaU8R8dbVuW2Q2Y8Nznf7hnjM7+DSCd14Lo5fF63C9qNLbwZYbmZrtV9/ySpSUpkRpQXvJb6xyu4hCQ== @@ -1270,90 +1110,6 @@ core-js-compat "^3.9.0" semver "^6.3.0" -"@babel/preset-env@^7.12.11": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.13.15.tgz#c8a6eb584f96ecba183d3d414a83553a599f478f" - integrity sha512-D4JAPMXcxk69PKe81jRJ21/fP/uYdcTZ3hJDF5QX2HSI9bBxxYw/dumdR6dGumhjxlprHPE4XWoPaqzZUVy2MA== - dependencies: - "@babel/compat-data" "^7.13.15" - "@babel/helper-compilation-targets" "^7.13.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-validator-option" "^7.12.17" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.13.12" - "@babel/plugin-proposal-async-generator-functions" "^7.13.15" - "@babel/plugin-proposal-class-properties" "^7.13.0" - "@babel/plugin-proposal-dynamic-import" "^7.13.8" - "@babel/plugin-proposal-export-namespace-from" "^7.12.13" - "@babel/plugin-proposal-json-strings" "^7.13.8" - "@babel/plugin-proposal-logical-assignment-operators" "^7.13.8" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.13.8" - "@babel/plugin-proposal-numeric-separator" "^7.12.13" - "@babel/plugin-proposal-object-rest-spread" "^7.13.8" - "@babel/plugin-proposal-optional-catch-binding" "^7.13.8" - "@babel/plugin-proposal-optional-chaining" "^7.13.12" - "@babel/plugin-proposal-private-methods" "^7.13.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.12.13" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.12.13" - "@babel/plugin-transform-arrow-functions" "^7.13.0" - "@babel/plugin-transform-async-to-generator" "^7.13.0" - "@babel/plugin-transform-block-scoped-functions" "^7.12.13" - "@babel/plugin-transform-block-scoping" "^7.12.13" - "@babel/plugin-transform-classes" "^7.13.0" - "@babel/plugin-transform-computed-properties" "^7.13.0" - "@babel/plugin-transform-destructuring" "^7.13.0" - "@babel/plugin-transform-dotall-regex" "^7.12.13" - "@babel/plugin-transform-duplicate-keys" "^7.12.13" - "@babel/plugin-transform-exponentiation-operator" "^7.12.13" - "@babel/plugin-transform-for-of" "^7.13.0" - "@babel/plugin-transform-function-name" "^7.12.13" - "@babel/plugin-transform-literals" "^7.12.13" - "@babel/plugin-transform-member-expression-literals" "^7.12.13" - "@babel/plugin-transform-modules-amd" "^7.13.0" - "@babel/plugin-transform-modules-commonjs" "^7.13.8" - "@babel/plugin-transform-modules-systemjs" "^7.13.8" - "@babel/plugin-transform-modules-umd" "^7.13.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.12.13" - "@babel/plugin-transform-new-target" "^7.12.13" - "@babel/plugin-transform-object-super" "^7.12.13" - "@babel/plugin-transform-parameters" "^7.13.0" - "@babel/plugin-transform-property-literals" "^7.12.13" - "@babel/plugin-transform-regenerator" "^7.13.15" - "@babel/plugin-transform-reserved-words" "^7.12.13" - "@babel/plugin-transform-shorthand-properties" "^7.12.13" - "@babel/plugin-transform-spread" "^7.13.0" - "@babel/plugin-transform-sticky-regex" "^7.12.13" - "@babel/plugin-transform-template-literals" "^7.13.0" - "@babel/plugin-transform-typeof-symbol" "^7.12.13" - "@babel/plugin-transform-unicode-escapes" "^7.12.13" - "@babel/plugin-transform-unicode-regex" "^7.12.13" - "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.13.14" - babel-plugin-polyfill-corejs2 "^0.2.0" - babel-plugin-polyfill-corejs3 "^0.2.0" - babel-plugin-polyfill-regenerator "^0.2.0" - core-js-compat "^3.9.0" - semver "^6.3.0" - -"@babel/preset-flow@^7.12.1": - version "7.13.13" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.13.13.tgz#a61a1c149b3f77589d795287744393444d5cdd9e" - integrity sha512-MDtwtamMifqq3R2mC7l3A3uFalUb3NH5TIBQWjN/epEPlZktcLq4se3J+ivckKrLMGsR7H9LW8+pYuIUN9tsKg== - dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-validator-option" "^7.12.17" - "@babel/plugin-transform-flow-strip-types" "^7.13.0" - "@babel/preset-modules@^0.1.3", "@babel/preset-modules@^0.1.4": version "0.1.4" resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" @@ -1378,7 +1134,7 @@ "@babel/plugin-transform-react-jsx-source" "^7.12.1" "@babel/plugin-transform-react-pure-annotations" "^7.12.1" -"@babel/preset-react@^7.12.10", "@babel/preset-react@^7.12.5": +"@babel/preset-react@^7.12.5": version "7.13.13" resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.13.13.tgz#fa6895a96c50763fe693f9148568458d5a839761" integrity sha512-gx+tDLIE06sRjKJkVtpZ/t3mzCDOnPG+ggHZG9lffUbX8+wC739x20YQc9V35Do6ZAxaUc/HhVHIiOzz5MvDmA== @@ -1398,26 +1154,6 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-transform-typescript" "^7.12.1" -"@babel/preset-typescript@^7.12.7", "@babel/preset-typescript@^7.3.3", "@babel/preset-typescript@^7.8.3": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.13.0.tgz#ab107e5f050609d806fbb039bec553b33462c60a" - integrity sha512-LXJwxrHy0N3f6gIJlYbLta1D9BDtHpQeqwzM0LIfjDlr6UE/D5Mc7W4iDiQzaE+ks0sTjT26ArcHWnJVt0QiHw== - dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-validator-option" "^7.12.17" - "@babel/plugin-transform-typescript" "^7.13.0" - -"@babel/register@^7.12.1": - version "7.13.14" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.13.14.tgz#bbfa8f4f027c2ebc432e8e69e078b632605f2d9b" - integrity sha512-iyw0hUwjh/fzN8qklVqZodbyWjEBOG0KdDnBOpv3zzIgK3NmuRXBmIXH39ZBdspkn8LTHvSboN+oYb4MT43+9Q== - dependencies: - find-cache-dir "^2.0.0" - lodash "^4.17.19" - make-dir "^2.1.0" - pirates "^4.0.0" - source-map-support "^0.5.16" - "@babel/runtime-corejs3@^7.10.2": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.14.0.tgz#6bf5fbc0b961f8e3202888cb2cd0fb7a0a9a3f66" @@ -1440,7 +1176,7 @@ dependencies: regenerator-runtime "^0.12.0" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.0", "@babel/runtime@^7.7.6": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.3.1": version "7.13.10" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d" integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw== @@ -1454,7 +1190,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4", "@babel/template@^7.12.13", "@babel/template@^7.12.7", "@babel/template@^7.3.3": +"@babel/template@^7.10.4", "@babel/template@^7.12.13", "@babel/template@^7.3.3": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== @@ -1463,7 +1199,7 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.12.9": +"@babel/traverse@^7.0.0": version "7.13.15" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.15.tgz#c38bf7679334ddd4028e8e1f7b3aa5019f0dada7" integrity sha512-/mpZMNvj6bce59Qzl09fHEs8Bt8NnpEDQYleHUPZQ3wXUMvXi+HJPLars68oAbmp839fGoOkv2pSL2z9ajCIaQ== @@ -1499,20 +1235,6 @@ "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" -"@babel/types@^7.12.7": - version "7.13.14" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.14.tgz#c35a4abb15c7cd45a2746d78ab328e362cbace0d" - integrity sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ== - dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - -"@base2/pretty-print-object@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@base2/pretty-print-object/-/pretty-print-object-1.0.0.tgz#860ce718b0b73f4009e153541faff2cb6b85d047" - integrity sha512-4Th98KlMHr5+JkxfcoDT//6vY8vM+iSPrLNpHhRyLx2CFYi8e2RfqPLdpbnpo0Q5lQC5hNB79yes07zb02fvCw== - "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1536,50 +1258,6 @@ resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18" integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg== -"@cypress/listr-verbose-renderer@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@cypress/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#a77492f4b11dcc7c446a34b3e28721afd33c642a" - integrity sha1-p3SS9LEdzHxEajSz4ochr9M8ZCo= - dependencies: - chalk "^1.1.3" - cli-cursor "^1.0.2" - date-fns "^1.27.2" - figures "^1.7.0" - -"@cypress/request@^2.88.5": - version "2.88.5" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.5.tgz#8d7ecd17b53a849cfd5ab06d5abe7d84976375d7" - integrity sha512-TzEC1XMi1hJkywWpRfD2clreTa/Z+lOrXDCxxBTBPEcY5azdPi56A6Xw+O4tWJnaJH3iIE7G5aDXZC6JgRZLcA== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -"@cypress/xvfb@^1.2.4": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@cypress/xvfb/-/xvfb-1.2.4.tgz#2daf42e8275b39f4aa53c14214e557bd14e7748a" - integrity sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q== - dependencies: - debug "^3.1.0" - lodash.once "^4.1.1" - "@emotion/cache@^10.0.27": version "10.0.29" resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-10.0.29.tgz#87e7e64f412c060102d589fe7c6dc042e6f9d1e0" @@ -1590,7 +1268,7 @@ "@emotion/utils" "0.11.3" "@emotion/weak-memoize" "0.2.5" -"@emotion/core@^10.0.0", "@emotion/core@^10.1.1": +"@emotion/core@^10.0.0": version "10.1.1" resolved "https://registry.yarnpkg.com/@emotion/core/-/core-10.1.1.tgz#c956c1365f2f2481960064bcb8c4732e5fb612c3" integrity sha512-ZMLG6qpXR8x031NXD8HJqugy/AZSkAuMxxqB46pmAR7ze47MhNJ56cdoX243QPZdGctrdfo+s08yZTiwaUcRKA== @@ -1621,7 +1299,7 @@ resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413" integrity sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow== -"@emotion/is-prop-valid@0.8.8", "@emotion/is-prop-valid@^0.8.1", "@emotion/is-prop-valid@^0.8.6": +"@emotion/is-prop-valid@0.8.8", "@emotion/is-prop-valid@^0.8.1": version "0.8.8" resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz#db28b1c4368a259b60a97311d6a952d4fd01ac1a" integrity sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA== @@ -1664,7 +1342,7 @@ "@emotion/serialize" "^0.11.15" "@emotion/utils" "0.11.3" -"@emotion/styled@^10.0.0", "@emotion/styled@^10.0.27": +"@emotion/styled@^10.0.0": version "10.0.27" resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-10.0.27.tgz#12cb67e91f7ad7431e1875b1d83a94b814133eaf" integrity sha512-iK/8Sh7+NLJzyp9a5+vIQIXTYxfT4yB/OJbjzQanB2RZpvmzBQOHZWhpAMZWYEKRNNbsD6WfBw5sVWkb6WzS/Q== @@ -2409,63 +2087,11 @@ "@json-rpc-tools/types" "^1.7.6" "@pedrouid/environment" "^1.0.1" -"@mdx-js/loader@^1.6.22": - version "1.6.22" - resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4" - integrity sha512-9CjGwy595NaxAYp0hF9B/A0lH6C8Rms97e2JS9d3jVUtILn6pT5i5IV965ra3lIWc7Rs1GG1tBdVF7dCowYe6Q== - dependencies: - "@mdx-js/mdx" "1.6.22" - "@mdx-js/react" "1.6.22" - loader-utils "2.0.0" - -"@mdx-js/mdx@1.6.22", "@mdx-js/mdx@^1.6.22": - version "1.6.22" - resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" - integrity sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA== - dependencies: - "@babel/core" "7.12.9" - "@babel/plugin-syntax-jsx" "7.12.1" - "@babel/plugin-syntax-object-rest-spread" "7.8.3" - "@mdx-js/util" "1.6.22" - babel-plugin-apply-mdx-type-prop "1.6.22" - babel-plugin-extract-import-names "1.6.22" - camelcase-css "2.0.1" - detab "2.0.4" - hast-util-raw "6.0.1" - lodash.uniq "4.5.0" - mdast-util-to-hast "10.0.1" - remark-footnotes "2.0.0" - remark-mdx "1.6.22" - remark-parse "8.0.3" - remark-squeeze-paragraphs "4.0.0" - style-to-object "0.3.0" - unified "9.2.0" - unist-builder "2.0.3" - unist-util-visit "2.0.3" - -"@mdx-js/react@1.6.22", "@mdx-js/react@^1.6.22": - version "1.6.22" - resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573" - integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg== - -"@mdx-js/util@1.6.22": - version "1.6.22" - resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" - integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== - "@metamask/safe-event-emitter@2.0.0", "@metamask/safe-event-emitter@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-2.0.0.tgz#af577b477c683fad17c619a78208cede06f9605c" integrity sha512-/kSXhY692qiV1MXu6EeOZvg5nECLclxNXcKCxJ3cXQgYuRymRHpdx/t7JXfsK+JLjwA1e1c1/SBrlQYpusC29Q== -"@mrmlnc/readdir-enhanced@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" - integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== - dependencies: - call-me-maybe "^1.0.1" - glob-to-regexp "^0.3.0" - "@multiformats/base-x@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@multiformats/base-x/-/base-x-4.0.1.tgz#95ff0fa58711789d53aefb2590a8b7a4e715d121" @@ -2484,11 +2110,6 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== -"@nodelib/fs.stat@^1.1.2": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" - integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== - "@nodelib/fs.walk@^1.2.3": version "1.2.6" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" @@ -2533,7 +2154,7 @@ enc-utils "^3.0.0" randombytes "^2.1.0" -"@pmmmwh/react-refresh-webpack-plugin@0.4.3", "@pmmmwh/react-refresh-webpack-plugin@^0.4.3": +"@pmmmwh/react-refresh-webpack-plugin@0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.4.3.tgz#1eec460596d200c0236bf195b078a5d1df89b766" integrity sha512-br5Qwvh8D2OQqSXpd1g/xqXKnK0r+Jz6qVKBbWmpUcrbGOxUrf39V5oZ1876084CGn18uMdR5uvPqBv9UqtBjQ== @@ -2545,7 +2166,7 @@ schema-utils "^2.6.5" source-map "^0.7.3" -"@popperjs/core@^2.4.4", "@popperjs/core@^2.5.4", "@popperjs/core@^2.6.0": +"@popperjs/core@^2.4.4": version "2.9.2" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.9.2.tgz#adea7b6953cbb34651766b0548468e743c6a2353" integrity sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q== @@ -2608,16 +2229,6 @@ "@reach/utils" "0.10.5" tslib "^2.0.0" -"@reach/router@^1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@reach/router/-/router-1.3.4.tgz#d2574b19370a70c80480ed91f3da840136d10f8c" - integrity sha512-+mtn9wjlB9NN2CNnnC/BRYtwdKBfSyyasPYraNAyvaV1occr/5NnB4CVzjEZipNHwYebQwcndGUmpFzxAUoqSA== - dependencies: - create-react-context "0.3.0" - invariant "^2.2.3" - prop-types "^15.6.1" - react-lifecycles-compat "^3.0.4" - "@reach/utils@0.10.5": version "0.10.5" resolved "https://registry.yarnpkg.com/@reach/utils/-/utils-0.10.5.tgz#fbac944d29565f6dd7abd0e1b13950e99b1e470b" @@ -2697,13 +2308,6 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@samverschueren/stream-to-observable@^0.3.0": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz#a21117b19ee9be70c379ec1877537ef2e1c63301" - integrity sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ== - dependencies: - any-observable "^0.3.0" - "@sideway/address@^4.1.0": version "4.1.1" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.1.tgz#9e321e74310963fdf8eebfbee09c7bd69972de4d" @@ -2728,714 +2332,13 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" - integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== - dependencies: - "@sinonjs/commons" "^1.7.0" - -"@storybook/addon-actions@6.2.8", "@storybook/addon-actions@^6.1.17": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.2.8.tgz#e11d01a35e4685e692015a5051c583a0931ecd4a" - integrity sha512-bQE9rmVGThniXWxz57Py5bqC4my7DLCK3gT4U4cXv31zH+NMlJqSNHHfHf/Ob43fTdoCyLcB3vlWsPLra7WOCg== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/client-api" "6.2.8" - "@storybook/components" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/theming" "6.2.8" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.20" - polished "^4.0.5" - prop-types "^15.7.2" - react-inspector "^5.1.0" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - uuid-browser "^3.1.0" - -"@storybook/addon-backgrounds@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.2.8.tgz#9fb199c283c346335503e8a6cd18b0839aea9b8e" - integrity sha512-nsKpoDIYsiYLWe+NCIMWkdUhQIUw0wcfAtSS/+Lm9WXlJ4ateB0guxdZn+676nt1FbO9wR22QQYwLHvUED4v5A== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/components" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/theming" "6.2.8" - core-js "^3.8.2" - global "^4.4.0" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - -"@storybook/addon-controls@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addon-controls/-/addon-controls-6.2.8.tgz#15c79b6c1daae218dcabf240bc0013e2c68bf208" - integrity sha512-VpMo5qPlRVWr1GALWOCRDuompYZm+7z0FRc3x71AkT3sCIZdiPjHHMt7IkG14ranEumusNtBZ2ez8NgKX0mDdQ== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/client-api" "6.2.8" - "@storybook/components" "6.2.8" - "@storybook/node-logger" "6.2.8" - "@storybook/theming" "6.2.8" - core-js "^3.8.2" - ts-dedent "^2.0.0" - -"@storybook/addon-docs@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-6.2.8.tgz#b5d039ad04805eceb99dbbb60a45c6d49096f0c3" - integrity sha512-IWnb10ImrzRMT2qw9785p3wYEI6U9gjsg6H2zKcRJQP5dEboqeX3OFjUKfXkaIWii4nz8MtJjBg5t4BdEYqLdw== - dependencies: - "@babel/core" "^7.12.10" - "@babel/generator" "^7.12.11" - "@babel/parser" "^7.12.11" - "@babel/plugin-transform-react-jsx" "^7.12.12" - "@babel/preset-env" "^7.12.11" - "@jest/transform" "^26.6.2" - "@mdx-js/loader" "^1.6.22" - "@mdx-js/mdx" "^1.6.22" - "@mdx-js/react" "^1.6.22" - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/builder-webpack4" "6.2.8" - "@storybook/client-api" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/components" "6.2.8" - "@storybook/core" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/csf" "0.0.1" - "@storybook/node-logger" "6.2.8" - "@storybook/postinstall" "6.2.8" - "@storybook/source-loader" "6.2.8" - "@storybook/theming" "6.2.8" - acorn "^7.4.1" - acorn-jsx "^5.3.1" - acorn-walk "^7.2.0" - core-js "^3.8.2" - doctrine "^3.0.0" - escodegen "^2.0.0" - fast-deep-equal "^3.1.3" - global "^4.4.0" - html-tags "^3.1.0" - js-string-escape "^1.0.1" - loader-utils "^2.0.0" - lodash "^4.17.20" - prettier "~2.2.1" - prop-types "^15.7.2" - react-element-to-jsx-string "^14.3.2" - regenerator-runtime "^0.13.7" - remark-external-links "^8.0.0" - remark-slug "^6.0.0" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - -"@storybook/addon-essentials@^6.1.17": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addon-essentials/-/addon-essentials-6.2.8.tgz#0a2551d73362f8e7d9758049b7ff3ddbf1f79e10" - integrity sha512-co2+/AYCWqQiokKJbVfJyQvcj0juMGXjLv57kZfJM0L0gP9i4rGtyTjy5VlmB8BmSs650ZuaKgShioC//gUr+g== - dependencies: - "@storybook/addon-actions" "6.2.8" - "@storybook/addon-backgrounds" "6.2.8" - "@storybook/addon-controls" "6.2.8" - "@storybook/addon-docs" "6.2.8" - "@storybook/addon-toolbars" "6.2.8" - "@storybook/addon-viewport" "6.2.8" - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/node-logger" "6.2.8" - core-js "^3.8.2" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - -"@storybook/addon-links@^6.1.17": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.2.8.tgz#5b9a31d84d6ba93d4d05c6e4779ec99151612252" - integrity sha512-r64VQDvWaUaBunY2mBPHYh2oEVYNycB/EH4WvXK1it3hXs1XGCIWLap4lKvIcT894XhykS8Jxx/s8SUGIvRzBA== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/csf" "0.0.1" - "@storybook/router" "6.2.8" - "@types/qs" "^6.9.5" - core-js "^3.8.2" - global "^4.4.0" - prop-types "^15.7.2" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - -"@storybook/addon-toolbars@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addon-toolbars/-/addon-toolbars-6.2.8.tgz#ab6dd7e080feed25d562d468316ac8e47b745ee4" - integrity sha512-BInsquQhEN/AD/any2tRZwreRQVueGrHg9bu1FnJzigpoUJv8VuDwOSIY1Fr1ZfMljhwVxwM5wGmHdVtG+SwDQ== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/client-api" "6.2.8" - "@storybook/components" "6.2.8" - core-js "^3.8.2" - -"@storybook/addon-viewport@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addon-viewport/-/addon-viewport-6.2.8.tgz#65e6d028c757d18a3bb889e23bb80985d59b685b" - integrity sha512-SQvVQ59yGIH1BoBSZNssVeaHAUxCiORDzXzOLK7B6AjKx2hiIgP7+qQlqs2IzWvzdGzTOAZw3JP8+DiOnN1ehg== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/components" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/theming" "6.2.8" - core-js "^3.8.2" - global "^4.4.0" - memoizerific "^1.11.3" - prop-types "^15.7.2" - regenerator-runtime "^0.13.7" - -"@storybook/addons@6.2.8", "@storybook/addons@^6.1.17": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.2.8.tgz#31d9bbd2e8b212490065a25e587621dab83ae392" - integrity sha512-zbavtYi66HAtgAROw5h4mR3mD9239ocCaYiasRanM+qyprguIvADPMGzgOA7COVfNI9MiIkxSA+E9oZ1y5PKfQ== - dependencies: - "@storybook/api" "6.2.8" - "@storybook/channels" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/router" "6.2.8" - "@storybook/theming" "6.2.8" - core-js "^3.8.2" - global "^4.4.0" - regenerator-runtime "^0.13.7" - -"@storybook/api@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.2.8.tgz#9165b25f8b71e08c4af5a30805407b025fbb5b1f" - integrity sha512-jaYT/IzFBUQTx/PqOIBty4HzZnRuk36vsGnBs/CWr8p3JCcnmLRaULsO0Q61rwFj2e4nMFMHEsZXEqRUXk4riw== - dependencies: - "@reach/router" "^1.3.4" - "@storybook/channels" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/csf" "0.0.1" - "@storybook/router" "6.2.8" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.2.8" - "@types/reach__router" "^1.3.7" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.20" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - store2 "^2.12.0" - telejson "^5.1.0" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - -"@storybook/builder-webpack4@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.2.8.tgz#af7b7d72617c38b917b2dfc910d268e022090fcd" - integrity sha512-7fQ9WQVbL/1SHiu853bTwwN8+CprbXycGd6VjN1PeSRXu8LkVOQWsNhWV3lwykOpDpieYSuZU3aS2ThRtWonGA== - dependencies: - "@babel/core" "^7.12.10" - "@babel/plugin-proposal-class-properties" "^7.12.1" - "@babel/plugin-proposal-decorators" "^7.12.12" - "@babel/plugin-proposal-export-default-from" "^7.12.1" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" - "@babel/plugin-proposal-object-rest-spread" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.12.7" - "@babel/plugin-proposal-private-methods" "^7.12.1" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-transform-arrow-functions" "^7.12.1" - "@babel/plugin-transform-block-scoping" "^7.12.12" - "@babel/plugin-transform-classes" "^7.12.1" - "@babel/plugin-transform-destructuring" "^7.12.1" - "@babel/plugin-transform-for-of" "^7.12.1" - "@babel/plugin-transform-parameters" "^7.12.1" - "@babel/plugin-transform-shorthand-properties" "^7.12.1" - "@babel/plugin-transform-spread" "^7.12.1" - "@babel/plugin-transform-template-literals" "^7.12.1" - "@babel/preset-env" "^7.12.11" - "@babel/preset-react" "^7.12.10" - "@babel/preset-typescript" "^7.12.7" - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/channel-postmessage" "6.2.8" - "@storybook/channels" "6.2.8" - "@storybook/client-api" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/components" "6.2.8" - "@storybook/core-common" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/node-logger" "6.2.8" - "@storybook/router" "6.2.8" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.2.8" - "@storybook/ui" "6.2.8" - "@types/node" "^14.0.10" - "@types/webpack" "^4.41.26" - autoprefixer "^9.8.6" - babel-loader "^8.2.2" - babel-plugin-macros "^2.8.0" - babel-plugin-polyfill-corejs3 "^0.1.0" - case-sensitive-paths-webpack-plugin "^2.3.0" - core-js "^3.8.2" - css-loader "^3.6.0" - dotenv-webpack "^1.8.0" - file-loader "^6.2.0" - find-up "^5.0.0" - fork-ts-checker-webpack-plugin "^4.1.6" - fs-extra "^9.0.1" - glob "^7.1.6" - glob-promise "^3.4.0" - global "^4.4.0" - html-webpack-plugin "^4.0.0" - pnp-webpack-plugin "1.6.4" - postcss "^7.0.35" - postcss-flexbugs-fixes "^4.2.1" - postcss-loader "^4.2.0" - raw-loader "^4.0.2" - react-dev-utils "^11.0.3" - stable "^0.1.8" - style-loader "^1.3.0" - terser-webpack-plugin "^3.1.0" - ts-dedent "^2.0.0" - url-loader "^4.1.1" - util-deprecate "^1.0.2" - webpack "4" - webpack-dev-middleware "^3.7.3" - webpack-filter-warnings-plugin "^1.2.1" - webpack-hot-middleware "^2.25.0" - webpack-virtual-modules "^0.2.2" - -"@storybook/channel-postmessage@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.2.8.tgz#8624d8da25cd7bb9ff42bd9a46cd4b105d63d3ec" - integrity sha512-SWBpZopkMDstxuhC0qzhzZoJUbLpGkNFjy+f8BAXLikOWcEISk5e74dZm3Q20yV10KSRUoIGfPqhHG3QmkLwBA== - dependencies: - "@storybook/channels" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/core-events" "6.2.8" - core-js "^3.8.2" - global "^4.4.0" - qs "^6.10.0" - telejson "^5.1.0" - -"@storybook/channels@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.2.8.tgz#81ec350291adfe479eea69e47f670d64ce0fe8a2" - integrity sha512-wn4I1kljyhEYhdJV98SrzQutbeigBwtTtisCdICJrUoENpLBWjZYWg5s+Wam1Q65375ajgIzeL7IZH7/TjxeKg== - dependencies: - core-js "^3.8.2" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - -"@storybook/client-api@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.2.8.tgz#69b02085fcc4f00798d04ac03e6af514d6c87975" - integrity sha512-CZL+ANDUZ2uAdIQ/fe+qLLk7Cba7iT04mwiFIgL4zsG/51RQ8MXksh75RkW1VCLMRiJEuBt3P+Hqe0xs0yLoUw== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/channel-postmessage" "6.2.8" - "@storybook/channels" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/csf" "0.0.1" - "@types/qs" "^6.9.5" - "@types/webpack-env" "^1.16.0" - core-js "^3.8.2" - global "^4.4.0" - lodash "^4.17.20" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - stable "^0.1.8" - store2 "^2.12.0" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - -"@storybook/client-logger@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.2.8.tgz#2e32cc9f0b73e29fb386383ab9e927ab6d3668fc" - integrity sha512-O1pmTmKUwR8KW1Bv4o2z3LII/g5PQqykIvUMEoDLjL4ogS7aDaxXZSlONSPpCyGYcH9pVdHiRex37R7U9N8r3A== - dependencies: - core-js "^3.8.2" - global "^4.4.0" - -"@storybook/components@6.2.8", "@storybook/components@^6.1.17": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.2.8.tgz#303150977965f9750e7528e58fc5d1c0a1220bd2" - integrity sha512-fd0ivsOhHDLISEScWzDIVM4X93gR5Vw0LsxaMW/2qKJZGVHG6cxti5j+LhO41aaGmB7mWcDtgloOWNwTv47YAA== - dependencies: - "@popperjs/core" "^2.6.0" - "@storybook/client-logger" "6.2.8" - "@storybook/csf" "0.0.1" - "@storybook/theming" "6.2.8" - "@types/color-convert" "^2.0.0" - "@types/overlayscrollbars" "^1.12.0" - "@types/react-syntax-highlighter" "11.0.5" - color-convert "^2.0.1" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.20" - markdown-to-jsx "^7.1.0" - memoizerific "^1.11.3" - overlayscrollbars "^1.13.1" - polished "^4.0.5" - prop-types "^15.7.2" - react-colorful "^5.0.1" - react-popper-tooltip "^3.1.1" - react-syntax-highlighter "^13.5.3" - react-textarea-autosize "^8.3.0" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - -"@storybook/core-client@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.2.8.tgz#0a103d8fb6c2e56a9565b7af36f11f4ed9620fe8" - integrity sha512-U26SMRCf2DEd1bHJR/g+jO6ujlEyBK1VudPQvsNjGdWedmtRc0FTQS13k0eQgawDBRC+hKTtTs/IRW5E0dn2KA== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/channel-postmessage" "6.2.8" - "@storybook/client-api" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/csf" "0.0.1" - "@storybook/ui" "6.2.8" - ansi-to-html "^0.6.11" - core-js "^3.8.2" - global "^4.4.0" - lodash "^4.17.20" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - unfetch "^4.2.0" - util-deprecate "^1.0.2" - -"@storybook/core-common@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.2.8.tgz#2dac023450196b3cb2bce3c5fdb04d01741ade20" - integrity sha512-fPSsThcVxmYy/LYPxYiUXVIbAnZ2YAPD6210GaYbM/z+MZePkQ02V/RRyxVNJ2AS5o649TkW13lc7nMWdvzv3A== - dependencies: - "@babel/core" "^7.12.10" - "@babel/plugin-proposal-class-properties" "^7.12.1" - "@babel/plugin-proposal-decorators" "^7.12.12" - "@babel/plugin-proposal-export-default-from" "^7.12.1" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" - "@babel/plugin-proposal-object-rest-spread" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.12.7" - "@babel/plugin-proposal-private-methods" "^7.12.1" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-transform-arrow-functions" "^7.12.1" - "@babel/plugin-transform-block-scoping" "^7.12.12" - "@babel/plugin-transform-classes" "^7.12.1" - "@babel/plugin-transform-destructuring" "^7.12.1" - "@babel/plugin-transform-for-of" "^7.12.1" - "@babel/plugin-transform-parameters" "^7.12.1" - "@babel/plugin-transform-shorthand-properties" "^7.12.1" - "@babel/plugin-transform-spread" "^7.12.1" - "@babel/preset-env" "^7.12.11" - "@babel/preset-react" "^7.12.10" - "@babel/preset-typescript" "^7.12.7" - "@babel/register" "^7.12.1" - "@storybook/node-logger" "6.2.8" - "@storybook/semver" "^7.3.2" - "@types/glob-base" "^0.3.0" - "@types/micromatch" "^4.0.1" - "@types/node" "^14.0.10" - "@types/pretty-hrtime" "^1.0.0" - babel-loader "^8.2.2" - babel-plugin-macros "^3.0.1" - babel-plugin-polyfill-corejs3 "^0.1.0" - chalk "^4.1.0" - core-js "^3.8.2" - express "^4.17.1" - file-system-cache "^1.0.5" - find-up "^5.0.0" - fork-ts-checker-webpack-plugin "^6.0.4" - glob "^7.1.6" - glob-base "^0.3.0" - interpret "^2.2.0" - json5 "^2.1.3" - lazy-universal-dotenv "^3.0.1" - micromatch "^4.0.2" - pkg-dir "^5.0.0" - pretty-hrtime "^1.0.3" - resolve-from "^5.0.0" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - webpack "4" - -"@storybook/core-events@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.2.8.tgz#e33427f7b4b2bd141c788189d50dc92337dd4e81" - integrity sha512-1TVzA5/FEwtgxor2q6tsBBMTmhyJubNWlP3akznume8F7kqoCl+k/ss0PQ0ywlzc9PjWQXS7HGmSVzx0r8gdHQ== - dependencies: - core-js "^3.8.2" - -"@storybook/core-server@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.2.8.tgz#83bd8e229225b3d7e5b11d91850b7b15bdab7525" - integrity sha512-2kNgnsf8eX5QWPQmzP0SIViSKysMDOxSS0doOHd0KJBkcPwj1FUoNithu7RllQPSsphsifLua6OtTjt4UP/ycg== - dependencies: - "@babel/core" "^7.12.10" - "@babel/plugin-transform-template-literals" "^7.12.1" - "@babel/preset-react" "^7.12.10" - "@storybook/addons" "6.2.8" - "@storybook/builder-webpack4" "6.2.8" - "@storybook/core-client" "6.2.8" - "@storybook/core-common" "6.2.8" - "@storybook/node-logger" "6.2.8" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.2.8" - "@storybook/ui" "6.2.8" - "@types/node" "^14.0.10" - "@types/node-fetch" "^2.5.7" - "@types/pretty-hrtime" "^1.0.0" - "@types/webpack" "^4.41.26" - airbnb-js-shims "^2.2.1" - babel-loader "^8.2.2" - better-opn "^2.1.1" - boxen "^4.2.0" - case-sensitive-paths-webpack-plugin "^2.3.0" - chalk "^4.1.0" - cli-table3 "0.6.0" - commander "^6.2.1" - core-js "^3.8.2" - cpy "^8.1.1" - css-loader "^3.6.0" - detect-port "^1.3.0" - dotenv-webpack "^1.8.0" - express "^4.17.1" - file-loader "^6.2.0" - file-system-cache "^1.0.5" - find-up "^5.0.0" - fs-extra "^9.0.1" - global "^4.4.0" - html-webpack-plugin "^4.0.0" - ip "^1.1.5" - node-fetch "^2.6.1" - pnp-webpack-plugin "1.6.4" - pretty-hrtime "^1.0.3" - prompts "^2.4.0" - read-pkg-up "^7.0.1" - regenerator-runtime "^0.13.7" - resolve-from "^5.0.0" - serve-favicon "^2.5.0" - style-loader "^1.3.0" - telejson "^5.1.0" - terser-webpack-plugin "^3.1.0" - ts-dedent "^2.0.0" - url-loader "^4.1.1" - util-deprecate "^1.0.2" - webpack "4" - webpack-dev-middleware "^3.7.3" - webpack-virtual-modules "^0.2.2" - -"@storybook/core@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.2.8.tgz#f157574ad23eebd656c4b47fd3d10caf021adab7" - integrity sha512-9gD/tti/+ZmzEihnrv+FF1+AgjIdCQ6VMFT76UXUEX44WZSqM8O9KA+8Llx2AD4wU928KDWLruP+5UiHkDAJKw== - dependencies: - "@storybook/core-client" "6.2.8" - "@storybook/core-server" "6.2.8" - -"@storybook/csf@0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@storybook/csf/-/csf-0.0.1.tgz#95901507dc02f0bc6f9ac8ee1983e2fc5bb98ce6" - integrity sha512-USTLkZze5gkel8MYCujSRBVIrUQ3YPBrLOx7GNk/0wttvVtlzWXAq9eLbQ4p/NicGxP+3T7KPEMVV//g+yubpw== - dependencies: - lodash "^4.17.15" - -"@storybook/node-logger@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.2.8.tgz#a5cb21e397a3e4945375b73803f901c93513a56c" - integrity sha512-mSbHF1yneRScviISaDQmtRcOBwjHbmdc8p791X4Myl87luqENnt0s8mnTG0H8uH/LGKvtZ2AGST89MqusQ6xUw== - dependencies: - "@types/npmlog" "^4.1.2" - chalk "^4.1.0" - core-js "^3.8.2" - npmlog "^4.1.2" - pretty-hrtime "^1.0.3" - -"@storybook/node-logger@^5.3.17": - version "5.3.21" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.3.21.tgz#f11d45042bd57dc69e9037d8f374d9fd0aad8071" - integrity sha512-8xibncy873JXePCK5MC0qem1MKtWI1Lc4hv6rwURSwYpZtkO7yElay3XAFGUSfz8qFJkoDBmMTxBR3fp4Dln7g== - dependencies: - "@types/npmlog" "^4.1.2" - chalk "^3.0.0" - core-js "^3.0.1" - npmlog "^4.1.2" - pretty-hrtime "^1.0.3" - regenerator-runtime "^0.13.3" - -"@storybook/postinstall@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.2.8.tgz#abf0f1b26f8273b49c10360207d20d3f23eafbb6" - integrity sha512-VaFQ622qSSpBqZpx+BGFGY52VKk4gnlpFs9r6+TgqaoFv9DpRWnj95fhkdtYuumzVhMiJLerdYdKgR/NsM+hJg== - dependencies: - core-js "^3.8.2" - -"@storybook/preset-create-react-app@^3.1.5": - version "3.1.7" - resolved "https://registry.yarnpkg.com/@storybook/preset-create-react-app/-/preset-create-react-app-3.1.7.tgz#e48df77768bdcc4863e3918c11965c45e4110ac8" - integrity sha512-SR+HGSWCrhHA5sszuIHJYdh2tWNi/zu858WB5RM74OBW4ogo8Bv4/7td4p53eWbdm0zBDbnKcrBmwRrAYqwL9Q== - dependencies: - "@pmmmwh/react-refresh-webpack-plugin" "^0.4.3" - "@types/babel__core" "^7.1.7" - "@types/webpack" "^4.41.13" - babel-plugin-react-docgen "^4.1.0" - pnp-webpack-plugin "^1.6.4" - react-docgen-typescript-plugin "^0.6.2" - semver "^7.3.2" - -"@storybook/preset-typescript@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@storybook/preset-typescript/-/preset-typescript-3.0.0.tgz#e157baf6f2c4982c3da3328f5e1a640b3d7db9e4" - integrity sha512-tEbFWg5h/8SPfSCNXPxyqY418704K14q5H/xb9t0ARMXK3kZPTkKqKvdTvYg3UEKBBYbc+GA57UWaL+9b+DbDg== - dependencies: - "@babel/preset-typescript" "^7.8.3" - "@storybook/node-logger" "^5.3.17" - "@types/babel__core" "^7.1.6" - babel-preset-typescript-vue "^1.0.3" - fork-ts-checker-webpack-plugin "^4.1.0" - -"@storybook/react@^6.1.17": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.2.8.tgz#7b3fb79f30a696856e8bb98b2dc6a2b3a48cbdba" - integrity sha512-n8nQmuclm+KvwOKWpZfTFeeUWISZuEUcHQc6MGoi0fzXDnJDPSk4KI6kvIMlr1kSDh41+iZfbbBTil+XWORaRA== - dependencies: - "@babel/preset-flow" "^7.12.1" - "@babel/preset-react" "^7.12.10" - "@pmmmwh/react-refresh-webpack-plugin" "^0.4.3" - "@storybook/addons" "6.2.8" - "@storybook/core" "6.2.8" - "@storybook/core-common" "6.2.8" - "@storybook/node-logger" "6.2.8" - "@storybook/semver" "^7.3.2" - "@types/webpack-env" "^1.16.0" - babel-plugin-add-react-displayname "^0.0.5" - babel-plugin-named-asset-import "^0.3.1" - babel-plugin-react-docgen "^4.2.1" - core-js "^3.8.2" - global "^4.4.0" - lodash "^4.17.20" - prop-types "^15.7.2" - react-dev-utils "^11.0.3" - react-docgen-typescript-plugin "^0.6.2" - react-refresh "^0.8.3" - read-pkg-up "^7.0.1" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - webpack "4" - -"@storybook/router@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.2.8.tgz#70d95e66619ebdeb4da61e2fce930bcc53d45bd1" - integrity sha512-SDoSa5gp/tzv7GIYauDyrKAiqDOg2bZ+JBIjLbAh29U5fJ/wkHbTeHCMhw9B5RE8O/e4dK2NOaYcuJJx+mFbGA== - dependencies: - "@reach/router" "^1.3.4" - "@storybook/client-logger" "6.2.8" - "@types/reach__router" "^1.3.7" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.20" - memoizerific "^1.11.3" - qs "^6.10.0" - ts-dedent "^2.0.0" - -"@storybook/semver@^7.3.2": - version "7.3.2" - resolved "https://registry.yarnpkg.com/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" - integrity sha512-SWeszlsiPsMI0Ps0jVNtH64cI5c0UF3f7KgjVKJoNP30crQ6wUSddY2hsdeczZXEKVJGEn50Q60flcGsQGIcrg== - dependencies: - core-js "^3.6.5" - find-up "^4.1.0" - -"@storybook/source-loader@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/source-loader/-/source-loader-6.2.8.tgz#2dfa0563cbac911685eb6cd575daa55a36a79049" - integrity sha512-e5rOLRPN39mTeRNv5FfIxR7XMb8bhx6kk0SS2ciojkcTg9aLLnguZSfm9E/OBLp/be8//TX4y5m3PwNQSXUrLg== - dependencies: - "@storybook/addons" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/csf" "0.0.1" - core-js "^3.8.2" - estraverse "^5.2.0" - global "^4.4.0" - loader-utils "^2.0.0" - lodash "^4.17.20" - prettier "~2.2.1" - regenerator-runtime "^0.13.7" - -"@storybook/theming@6.2.8", "@storybook/theming@^6.1.17": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.2.8.tgz#1cb4eeaccdb73924186a06630b4fed3201ee6714" - integrity sha512-aQ+VCvzbfaAsq99g0ZsP1/rZFwXqbsTYLaRV/uZ8DA+wLF7uzlAl+FA5HyneStSj9ysyvdyARGxT2SBAT+azyQ== - dependencies: - "@emotion/core" "^10.1.1" - "@emotion/is-prop-valid" "^0.8.6" - "@emotion/styled" "^10.0.27" - "@storybook/client-logger" "6.2.8" - core-js "^3.8.2" - deep-object-diff "^1.1.0" - emotion-theming "^10.0.27" - global "^4.4.0" - memoizerific "^1.11.3" - polished "^4.0.5" - resolve-from "^5.0.0" - ts-dedent "^2.0.0" - -"@storybook/ui@6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.2.8.tgz#331f8f5bb8e6feaf15a3a91b23eba48509882650" - integrity sha512-lPRa6z3ArHEewuIAAtHFdF7VwK7chMGza/PV1gAQT2ywUDibJoTen/qtUP4TKhLSJTOUsZK8q4X7yiN1KJBu5w== - dependencies: - "@emotion/core" "^10.1.1" - "@storybook/addons" "6.2.8" - "@storybook/api" "6.2.8" - "@storybook/channels" "6.2.8" - "@storybook/client-logger" "6.2.8" - "@storybook/components" "6.2.8" - "@storybook/core-events" "6.2.8" - "@storybook/router" "6.2.8" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.2.8" - "@types/markdown-to-jsx" "^6.11.3" - copy-to-clipboard "^3.3.1" - core-js "^3.8.2" - core-js-pure "^3.8.2" - downshift "^6.0.15" - emotion-theming "^10.0.27" - fuse.js "^3.6.1" - global "^4.4.0" - lodash "^4.17.20" - markdown-to-jsx "^6.11.4" - memoizerific "^1.11.3" - polished "^4.0.5" - qs "^6.10.0" - react-draggable "^4.4.3" - react-helmet-async "^1.0.7" - react-sizeme "^3.0.1" - regenerator-runtime "^0.13.7" - resolve-from "^5.0.0" - store2 "^2.12.0" - +"@sinonjs/fake-timers@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" + integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== + dependencies: + "@sinonjs/commons" "^1.7.0" + "@styled-system/background@^5.1.2": version "5.1.2" resolved "https://registry.yarnpkg.com/@styled-system/background/-/background-5.1.2.tgz#75c63d06b497ab372b70186c0bf608d62847a2ba" @@ -3646,20 +2549,6 @@ "@svgr/plugin-svgo" "^5.5.0" loader-utils "^2.0.0" -"@testing-library/dom@^7.11.0": - version "7.30.3" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.30.3.tgz#779ea9bbb92d63302461800a388a5a890ac22519" - integrity sha512-7JhIg2MW6WPwyikH2iL3o7z+FTVgSOd2jqCwTAHqK7Qal2gRRYiUQyURAxtbK9VXm/UTyG9bRihv8C5Tznr2zw== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/runtime" "^7.12.5" - "@types/aria-query" "^4.2.0" - aria-query "^4.2.2" - chalk "^4.1.0" - dom-accessibility-api "^0.5.4" - lz-string "^1.4.4" - pretty-format "^26.6.2" - "@typechain/ethers-v5@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-7.0.0.tgz#cadb5262b3827d1616c21f4ba86a36a71269bd7e" @@ -3670,12 +2559,7 @@ resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA== -"@types/aria-query@^4.2.0": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.1.tgz#78b5433344e2f92e8b306c06a5622c50c245bf6b" - integrity sha512-S6oPal772qJZHoRZLFc/XoZW2gFvwXusYUmXPXkgxJLuEk2vOt7jc4Yo6z/vtI0EBkbPBVrJJ0B+prLIKiWqHg== - -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.6", "@types/babel__core@^7.1.7": +"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": version "7.1.14" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g== @@ -3715,23 +2599,6 @@ dependencies: "@types/node" "*" -"@types/braces@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb" - integrity sha512-TbH79tcyi9FHwbyboOKeRachRq63mSuWYXOflsNO9ZyE5ClQ/JaozNKl+aWUq87qPNsXasXxi2AbgfwIJ+8GQw== - -"@types/color-convert@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/color-convert/-/color-convert-2.0.0.tgz#8f5ee6b9e863dcbee5703f5a517ffb13d3ea4e22" - integrity sha512-m7GG7IKKGuJUXvkZ1qqG3ChccdIM/qBBo913z+Xft0nKCX4hAU/IxKwZBU4cpRZ7GS5kV4vOblUkILtSShCPXQ== - dependencies: - "@types/color-name" "*" - -"@types/color-name@*": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" - integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== - "@types/eslint@^7.2.6": version "7.2.10" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.10.tgz#4b7a9368d46c0f8cd5408c23288a59aa2394d917" @@ -3750,12 +2617,7 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== -"@types/glob-base@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@types/glob-base/-/glob-base-0.3.0.tgz#a581d688347e10e50dd7c17d6f2880a10354319d" - integrity sha1-pYHWiDR+EOUN18F9byiAoQNUMZ0= - -"@types/glob@*", "@types/glob@^7.1.1": +"@types/glob@^7.1.1": version "7.1.3" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== @@ -3770,13 +2632,6 @@ dependencies: "@types/node" "*" -"@types/hast@^2.0.0": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.1.tgz#b16872f2a6144c7025f296fb9636a667ebb79cd9" - integrity sha512-viwwrB+6xGzw+G1eWpF9geV3fnsDgXqHG+cqgiHrvQfDUW5hzhCyV7Sy3UJxhfRFBsgky2SSW33qi/YrIkjX5Q== - dependencies: - "@types/unist" "*" - "@types/history@*": version "4.7.8" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934" @@ -3795,11 +2650,6 @@ resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50" integrity sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA== -"@types/is-function@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83" - integrity sha512-iTs9HReBu7evG77Q4EC8hZnqRt57irBDkK9nvmHroiOIVwYMQc4IvYvdRgwKfYepunIY7Oh/dBuuld+Gj9uo6w== - "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" @@ -3835,7 +2685,7 @@ jest-diff "^25.2.1" pretty-format "^25.2.1" -"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": +"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": version "7.0.7" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== @@ -3862,27 +2712,6 @@ resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-1.26.4.tgz#77bbd5a1aa74ca31edff2aee4f8313ea0d93ca5c" integrity sha512-OIvbVLZQUjyZofqSFpre2VsgvKy0V0JQdRgN0k3H1DTGRdxHiaQjT16+H2gyuhAS9r8B2PQEwrSiqP6/Zka3pQ== -"@types/markdown-to-jsx@^6.11.3": - version "6.11.3" - resolved "https://registry.yarnpkg.com/@types/markdown-to-jsx/-/markdown-to-jsx-6.11.3.tgz#cdd1619308fecbc8be7e6a26f3751260249b020e" - integrity sha512-30nFYpceM/ZEvhGiqWjm5quLUxNeld0HCzJEXMZZDpq53FPkS85mTwkWtCXzCqq8s5JYLgM5W392a02xn8Bdaw== - dependencies: - "@types/react" "*" - -"@types/mdast@^3.0.0": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.3.tgz#2d7d671b1cd1ea3deb306ea75036c2a0407d2deb" - integrity sha512-SXPBMnFVQg1s00dlMCc/jCdvPqdE4mXaMMCeRlxLDmTAEoegHT53xKtkDnzDTOcmMHUfcjyf36/YYZ6SxRdnsw== - dependencies: - "@types/unist" "*" - -"@types/micromatch@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/micromatch/-/micromatch-4.0.1.tgz#9381449dd659fc3823fd2a4190ceacc985083bc7" - integrity sha512-my6fLBvpY70KattTNzYOK6KU1oR1+UCz9ug/JbcF5UrEmeCt9P7DV2t7L8+t18mMPINqGQCE4O8PLOPbI84gxw== - dependencies: - "@types/braces" "*" - "@types/minimatch@*": version "3.0.4" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" @@ -3895,14 +2724,6 @@ dependencies: "@types/node" "*" -"@types/node-fetch@^2.5.7": - version "2.5.10" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.10.tgz#9b4d4a0425562f9fcea70b12cb3fcdd946ca8132" - integrity sha512-IpkX0AasN44hgEad0gEF/V6EgR5n69VEqPEgnmoM8GsIGro3PowbWs4tR6IhxUTyPLpOn+fiGG6nrQhcmoCuIQ== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - "@types/node@*": version "15.0.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67" @@ -3918,36 +2739,16 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.50.tgz#bc8ebf70c392a98ffdba7aab9b46989ea96c1c62" integrity sha512-y7kkh+hX/0jZNxMyBR/6asG0QMSaPSzgeVK63dhWHl4QAXCQB8lExXmzLL6SzmOgKHydtawpMnNhlDbv7DXPEA== -"@types/node@^14.0.10", "@types/node@^14.14.31": - version "14.14.41" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.41.tgz#d0b939d94c1d7bd53d04824af45f1139b8c45615" - integrity sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g== - "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== -"@types/npmlog@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@types/npmlog/-/npmlog-4.1.2.tgz#d070fe6a6b78755d1092a3dc492d34c3d8f871c4" - integrity sha512-4QQmOF5KlwfxJ5IGXFIudkeLCdMABz03RcUXu+LCb24zmln8QW6aDjuGl4d4XPVLf2j+FnjelHTP7dvceAFbhA== - -"@types/overlayscrollbars@^1.12.0": - version "1.12.0" - resolved "https://registry.yarnpkg.com/@types/overlayscrollbars/-/overlayscrollbars-1.12.0.tgz#98456caceca8ad73bd5bb572632a585074e70764" - integrity sha512-h/pScHNKi4mb+TrJGDon8Yb06ujFG0mSg12wIO0sWMUF3dQIe2ExRRdNRviaNt9IjxIiOfnRr7FsQAdHwK4sMg== - "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== -"@types/parse5@^5.0.0": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" - integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== - "@types/pbkdf2@^3.0.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" @@ -3960,11 +2761,6 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== -"@types/pretty-hrtime@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/pretty-hrtime/-/pretty-hrtime-1.0.0.tgz#c5a2d644a135e988b2932f99737e67b3c62528d0" - integrity sha512-xl+5r2rcrxdLViAYkkiLMYsoUs3qEyrAnHFyEzYysgRxdVp3WbhysxIvJIxZp9FvZ2CYezh0TaHZorivH+voOQ== - "@types/prop-types@*": version "15.7.3" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" @@ -3975,18 +2771,11 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== -"@types/qs@^6.9.2", "@types/qs@^6.9.5": +"@types/qs@^6.9.2": version "6.9.6" resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.6.tgz#df9c3c8b31a247ec315e6996566be3171df4b3b1" integrity sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA== -"@types/reach__router@^1.3.7": - version "1.3.7" - resolved "https://registry.yarnpkg.com/@types/reach__router/-/reach__router-1.3.7.tgz#de8ab374259ae7f7499fc1373b9697a5f3cd6428" - integrity sha512-cyBEb8Ef3SJNH5NYEIDGPoMMmYUxROatuxbICusVRQIqZUB85UCt6R2Ok60tKS/TABJsJYaHyNTW3kqbpxlMjg== - dependencies: - "@types/react" "*" - "@types/react-dom@^17.0.1": version "17.0.3" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.3.tgz#7fdf37b8af9d6d40127137865bb3fff8871d7ee1" @@ -4021,13 +2810,6 @@ "@types/history" "*" "@types/react" "*" -"@types/react-syntax-highlighter@11.0.5": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-11.0.5.tgz#0d546261b4021e1f9d85b50401c0a42acb106087" - integrity sha512-VIOi9i2Oj5XsmWWoB72p3KlZoEbdRAcechJa8Ztebw7bDl2YmR+odxIqhtJGp1q2EozHs02US+gzxJ9nuf56qg== - dependencies: - "@types/react" "*" - "@types/react-virtualized-auto-sizer@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/react-virtualized-auto-sizer/-/react-virtualized-auto-sizer-1.0.0.tgz#fc32f30a8dab527b5816f3a757e1e1d040c8f272" @@ -4080,16 +2862,6 @@ dependencies: "@types/node" "*" -"@types/sinonjs__fake-timers@^6.0.1", "@types/sinonjs__fake-timers@^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz#3a84cf5ec3249439015e14049bd3161419bf9eae" - integrity sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg== - -"@types/sizzle@^2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47" - integrity sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg== - "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -4128,14 +2900,6 @@ resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.7.tgz#545158342f949e8fd3bfd813224971ecddc3fac4" integrity sha512-0VBprVqfgFD7Ehb2vd8Lh9TG3jP98gvr8rgehQqzztZNI7o8zS8Ad4jyZneKELphpuE212D8J70LnSNQSyO6bQ== -"@types/testing-library__cypress@^5.0.5": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@types/testing-library__cypress/-/testing-library__cypress-5.0.8.tgz#6a8effce8218c5be42c1775b26dcbdcc273fda62" - integrity sha512-1dTaoaCR6PWVRKXZAHcWvnAzHpTDKUKWw1pq4yzyoyI/RQ4KRySA9EFLwS0uEugTIPPgBaPUnXK5OwTaQoQp7g== - dependencies: - "@testing-library/dom" "^7.11.0" - cypress "*" - "@types/ua-parser-js@^0.7.35": version "0.7.35" resolved "https://registry.yarnpkg.com/@types/ua-parser-js/-/ua-parser-js-0.7.35.tgz#cca67a95deb9165e4b1f449471801e6489d3fe93" @@ -4148,11 +2912,6 @@ dependencies: source-map "^0.6.1" -"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" - integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== - "@types/warning@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/warning/-/warning-3.0.0.tgz#0d2501268ad8f9962b740d387c4654f5f8e23e52" @@ -4163,11 +2922,6 @@ resolved "https://registry.yarnpkg.com/@types/wcag-contrast/-/wcag-contrast-3.0.0.tgz#640a4c36a6b62d54f1dd64a74322595df465148d" integrity sha512-RDinJW4P1bg+dWA6C0/looxA0zyi24gIDHrewzFW/xyU2v97D38KRzXdxMbiVpqovrjTa/xsX8abj3/hpASklg== -"@types/webpack-env@^1.16.0": - version "1.16.0" - resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.16.0.tgz#8c0a9435dfa7b3b1be76562f3070efb3f92637b4" - integrity sha512-Fx+NpfOO0CpeYX2g9bkvX8O5qh9wrU1sOF4g8sft4Mu7z+qfe387YlyY8w8daDyDsKY5vUxM0yxkAYnbkRbZEw== - "@types/webpack-sources@*": version "2.1.0" resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-2.1.0.tgz#8882b0bd62d1e0ce62f183d0d01b72e6e82e8c10" @@ -4177,18 +2931,6 @@ "@types/source-list-map" "*" source-map "^0.7.3" -"@types/webpack@^4.41.13", "@types/webpack@^4.41.26": - version "4.41.27" - resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.27.tgz#f47da488c8037e7f1b2dbf2714fbbacb61ec0ffc" - integrity sha512-wK/oi5gcHi72VMTbOaQ70VcDxSQ1uX8S2tukBK9ARuGXrYM/+u4ou73roc7trXDNmCxCoerE8zruQqX/wuHszA== - dependencies: - "@types/anymatch" "*" - "@types/node" "*" - "@types/tapable" "^1" - "@types/uglify-js" "*" - "@types/webpack-sources" "*" - source-map "^0.6.0" - "@types/webpack@^4.41.8": version "4.41.28" resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.28.tgz#0069a2159b7ad4d83d0b5801942c17d54133897b" @@ -4872,7 +3614,7 @@ acorn-jsx@^5.3.1: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== -acorn-walk@^7.1.1, acorn-walk@^7.2.0: +acorn-walk@^7.1.1: version "7.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== @@ -4882,7 +3624,7 @@ acorn@^6.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^7.1.0, acorn@^7.1.1, acorn@^7.4.0, acorn@^7.4.1: +acorn@^7.1.0, acorn@^7.1.1, acorn@^7.4.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== @@ -4923,29 +3665,6 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -airbnb-js-shims@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/airbnb-js-shims/-/airbnb-js-shims-2.2.1.tgz#db481102d682b98ed1daa4c5baa697a05ce5c040" - integrity sha512-wJNXPH66U2xjgo1Zwyjf9EydvJ2Si94+vSdk6EERcBfB2VZkeltpqIats0cqIZMLCXP3zcyaUKGYQeIBT6XjsQ== - dependencies: - array-includes "^3.0.3" - array.prototype.flat "^1.2.1" - array.prototype.flatmap "^1.2.1" - es5-shim "^4.5.13" - es6-shim "^0.35.5" - function.prototype.name "^1.1.0" - globalthis "^1.0.0" - object.entries "^1.1.0" - object.fromentries "^2.0.0 || ^1.0.0" - object.getownpropertydescriptors "^2.0.3" - object.values "^1.1.0" - promise.allsettled "^1.0.0" - promise.prototype.finally "^3.1.0" - string.prototype.matchall "^4.0.0 || ^3.0.1" - string.prototype.padend "^3.0.0" - string.prototype.padstart "^3.0.0" - symbol.prototype.description "^1.0.0" - ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" @@ -4966,7 +3685,7 @@ ajv@6.5.3: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -4998,13 +3717,6 @@ ansi-align@^2.0.0: dependencies: string-width "^2.0.0" -ansi-align@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" - integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== - dependencies: - string-width "^3.0.0" - ansi-colors@^3.0.0: version "3.2.4" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" @@ -5015,11 +3727,6 @@ ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-escapes@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - ansi-escapes@^4.2.1, ansi-escapes@^4.3.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -5071,23 +3778,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" -ansi-to-html@^0.6.11: - version "0.6.14" - resolved "https://registry.yarnpkg.com/ansi-to-html/-/ansi-to-html-0.6.14.tgz#65fe6d08bba5dd9db33f44a20aec331e0010dad8" - integrity sha512-7ZslfB1+EnFSDO5Ju+ue5Y6It19DRnZXWv8jrGHgIlPna5Mh4jz7BV5jCbQneXNFurQcKoolaaAjHtgSBfOIuA== - dependencies: - entities "^1.1.2" - any-base@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/any-base/-/any-base-1.1.0.tgz#ae101a62bc08a597b4c9ab5b7089d456630549fe" integrity sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg== -any-observable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" - integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== - anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" @@ -5104,29 +3799,16 @@ anymatch@^3.0.3, anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" -app-root-dir@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/app-root-dir/-/app-root-dir-1.0.2.tgz#38187ec2dea7577fff033ffcb12172692ff6e118" - integrity sha1-OBh+wt6nV3//Az/8sSFyaS/24Rg= - -aproba@^1.0.3, aproba@^1.1.1: +aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -arch@^2.1.0, arch@^2.1.2, arch@^2.2.0: +arch@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - arg@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arg/-/arg-2.0.0.tgz#c06e7ff69ab05b3a4a03ebe0407fac4cba657545" @@ -5191,7 +3873,7 @@ array-flatten@^2.1.0: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== -array-includes@^3.0.3, array-includes@^3.1.1, array-includes@^3.1.2, array-includes@^3.1.3: +array-includes@^3.1.1, array-includes@^3.1.2, array-includes@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== @@ -5202,7 +3884,7 @@ array-includes@^3.0.3, array-includes@^3.1.1, array-includes@^3.1.2, array-inclu get-intrinsic "^1.1.1" is-string "^1.0.5" -array-union@^1.0.1, array-union@^1.0.2: +array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= @@ -5224,7 +3906,7 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.flat@^1.2.1, array.prototype.flat@^1.2.3: +array.prototype.flat@^1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== @@ -5233,7 +3915,7 @@ array.prototype.flat@^1.2.1, array.prototype.flat@^1.2.3: define-properties "^1.1.3" es-abstract "^1.18.0-next.1" -array.prototype.flatmap@^1.2.1, array.prototype.flatmap@^1.2.4: +array.prototype.flatmap@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== @@ -5243,17 +3925,6 @@ array.prototype.flatmap@^1.2.1, array.prototype.flatmap@^1.2.4: es-abstract "^1.18.0-next.1" function-bind "^1.1.1" -array.prototype.map@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array.prototype.map/-/array.prototype.map-1.0.3.tgz#1609623618d3d84134a37d4a220030c2bd18420b" - integrity sha512-nNcb30v0wfDyIe26Yif3PcV1JXQp4zEeEfupG7L4SRjnD6HLbO5b2a7eVSba53bOx4YCHYMBHt+Fp4vYstneRA== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.5" - arrify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" @@ -5304,13 +3975,6 @@ ast-types-flow@^0.0.7: resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= -ast-types@^0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.14.2.tgz#600b882df8583e3cd4f2df5fa20fa83759d4bdfd" - integrity sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA== - dependencies: - tslib "^2.0.1" - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -5352,11 +4016,6 @@ async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.2: dependencies: lodash "^4.17.14" -async@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" - integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -5372,7 +4031,7 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -autoprefixer@^9.6.1, autoprefixer@^9.8.6: +autoprefixer@^9.6.1: version "9.8.6" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.6.tgz#3b73594ca1bf9266320c5acf1588d74dea74210f" integrity sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg== @@ -5625,16 +4284,6 @@ babel-loader@8.1.0: pify "^4.0.1" schema-utils "^2.6.5" -babel-loader@^8.2.2: - version "8.2.2" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81" - integrity sha512-JvTd0/D889PQBtUXJ2PXaKU/pjZDMtHA9V2ecm+eNRmmBCMR09a+fmpGTNwnJtFmFl5Ei7Vy47LjBb+L0wQ99g== - dependencies: - find-cache-dir "^3.3.1" - loader-utils "^1.4.0" - make-dir "^3.1.0" - schema-utils "^2.6.5" - babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -5642,19 +4291,6 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-add-react-displayname@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/babel-plugin-add-react-displayname/-/babel-plugin-add-react-displayname-0.0.5.tgz#339d4cddb7b65fd62d1df9db9fe04de134122bd5" - integrity sha1-M51M3be2X9YtHfnbn+BN4TQSK9U= - -babel-plugin-apply-mdx-type-prop@1.6.22: - version "1.6.22" - resolved "https://registry.yarnpkg.com/babel-plugin-apply-mdx-type-prop/-/babel-plugin-apply-mdx-type-prop-1.6.22.tgz#d216e8fd0de91de3f1478ef3231e05446bc8705b" - integrity sha512-VefL+8o+F/DfK24lPZMtJctrCVOfgbqLAGZSkxwhazQv4VxPg3Za/i40fu22KR2m8eEda+IfSOlPLUSIiLcnCQ== - dependencies: - "@babel/helper-plugin-utils" "7.10.4" - "@mdx-js/util" "1.6.22" - babel-plugin-check-es2015-constants@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" @@ -5685,13 +4321,6 @@ babel-plugin-emotion@^10.0.27: find-root "^1.1.0" source-map "^0.5.7" -babel-plugin-extract-import-names@1.6.22: - version "1.6.22" - resolved "https://registry.yarnpkg.com/babel-plugin-extract-import-names/-/babel-plugin-extract-import-names-1.6.22.tgz#de5f9a28eb12f3eb2578bf74472204e66d1a13dc" - integrity sha512-yJ9BsJaISua7d8zNT7oRG1ZLBJCIdZ4PZqmH8qa9N5AK01ifk3fnkc98AXhtzE7UkfCsEumvoQWgoYLhOnJ7jQ== - dependencies: - "@babel/helper-plugin-utils" "7.10.4" - babel-plugin-istanbul@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" @@ -5713,7 +4342,7 @@ babel-plugin-jest-hoist@^26.6.2: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" -babel-plugin-macros@2.8.0, babel-plugin-macros@^2.0.0, babel-plugin-macros@^2.8.0: +babel-plugin-macros@2.8.0, babel-plugin-macros@^2.0.0: version "2.8.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== @@ -5722,16 +4351,7 @@ babel-plugin-macros@2.8.0, babel-plugin-macros@^2.0.0, babel-plugin-macros@^2.8. cosmiconfig "^6.0.0" resolve "^1.12.0" -babel-plugin-macros@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.0.1.tgz#0d412d68f5b3d1b64358f24ab099bd148724e2a9" - integrity sha512-CKt4+Oy9k2wiN+hT1uZzOw7d8zb1anbQpf7KLwaaXRCi/4pzKdFKHf7v5mvoPmjkmxshh7eKZQuRop06r5WP4w== - dependencies: - "@babel/runtime" "^7.12.5" - cosmiconfig "^7.0.0" - resolve "^1.19.0" - -babel-plugin-named-asset-import@^0.3.1, babel-plugin-named-asset-import@^0.3.7: +babel-plugin-named-asset-import@^0.3.7: version "0.3.7" resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.7.tgz#156cd55d3f1228a5765774340937afc8398067dd" integrity sha512-squySRkf+6JGnvjoUtDEjSREJEBirnXi9NqP6rjSYsylxQxqBTz+pkmf395i9E2zsvmYUaI40BHo6SqZUdydlw== @@ -5745,14 +4365,6 @@ babel-plugin-polyfill-corejs2@^0.2.0: "@babel/helper-define-polyfill-provider" "^0.2.0" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.1.0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.1.7.tgz#80449d9d6f2274912e05d9e182b54816904befd0" - integrity sha512-u+gbS9bbPhZWEeyy1oR/YaaSpod/KDT07arZHb80aTpl8H5ZBq+uN1nN9/xtX7jQyfLdPfoqI4Rue/MQSWJquw== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.1.5" - core-js-compat "^3.8.1" - babel-plugin-polyfill-corejs3@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.0.tgz#f4b4bb7b19329827df36ff56f6e6d367026cb7a2" @@ -5768,15 +4380,6 @@ babel-plugin-polyfill-regenerator@^0.2.0: dependencies: "@babel/helper-define-polyfill-provider" "^0.2.0" -babel-plugin-react-docgen@^4.1.0, babel-plugin-react-docgen@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/babel-plugin-react-docgen/-/babel-plugin-react-docgen-4.2.1.tgz#7cc8e2f94e8dc057a06e953162f0810e4e72257b" - integrity sha512-UQ0NmGHj/HAqi5Bew8WvNfCk8wSsmdgNd8ZdMjBCICtyCJCq9LiqgqvjCYe570/Wg7AQArSq1VQ60Dd/CHN7mQ== - dependencies: - ast-types "^0.14.2" - lodash "^4.17.15" - react-docgen "^5.0.0" - "babel-plugin-styled-components@>= 1": version "1.12.0" resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-1.12.0.tgz#1dec1676512177de6b827211e9eda5a30db4f9b9" @@ -6131,16 +4734,6 @@ babel-preset-react-app@^10.0.0: babel-plugin-macros "2.8.0" babel-plugin-transform-react-remove-prop-types "0.4.24" -babel-preset-typescript-vue@^1.0.3: - version "1.1.1" - resolved "https://registry.yarnpkg.com/babel-preset-typescript-vue/-/babel-preset-typescript-vue-1.1.1.tgz#6a617dcb0ee26f911735d5f2bbe530286b2c7c02" - integrity sha512-wXeR7Y4xCsRUEdm4t4qlpv4wnxolS6jU0c7P2E6zJRWeG1sR0e6NL7DRN0tNuUwkUt0PU8bqVo4vzoA2VEuxnw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-typescript" "^7.3.2" - "@babel/preset-typescript" "^7.3.3" - vue-template-compiler "^2.6.11" - babel-register@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" @@ -6258,11 +4851,6 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" -batch-processor@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/batch-processor/-/batch-processor-1.0.0.tgz#75c95c32b748e0850d10c2b168f6bdbe9891ace8" - integrity sha1-dclcMrdI4IUNEMKxaPa9vpiRrOg= - batch@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" @@ -6280,13 +4868,6 @@ bech32@1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -better-opn@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/better-opn/-/better-opn-2.1.1.tgz#94a55b4695dc79288f31d7d0e5f658320759f7c6" - integrity sha512-kIPXZS5qwyKiX/HcRvDYfmBQUa8XP17I0mYZZ0y4UhpYOSvtsLHDYqmomS+Mj20aDvD3knEiQ0ecQy2nhio3yA== - dependencies: - open "^7.0.3" - bfj@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/bfj/-/bfj-7.0.2.tgz#1988ce76f3add9ac2913fd8ba47aad9e651bfbb2" @@ -6336,12 +4917,7 @@ blakejs@^1.1.0: resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= -blob-util@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb" - integrity sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ== - -bluebird@3.7.2, bluebird@^3.3.5, bluebird@^3.5.5, bluebird@^3.7.2: +bluebird@3.7.2, bluebird@^3.5.5: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -6412,20 +4988,6 @@ boxen@1.3.0: term-size "^1.2.0" widest-line "^2.0.0" -boxen@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" - integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^5.3.1" - chalk "^3.0.0" - cli-boxes "^2.2.0" - string-width "^4.1.0" - term-size "^2.1.0" - type-fest "^0.8.1" - widest-line "^3.1.0" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -6546,7 +5108,7 @@ browserslist@^3.2.6: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" -browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.16.3, browserslist@^4.16.6, browserslist@^4.6.2, browserslist@^4.6.4: +browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.6.2, browserslist@^4.6.4: version "4.16.6" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== @@ -6598,11 +5160,6 @@ buffer-alloc@^1.2.0: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - buffer-equal@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-0.0.1.tgz#91bc74b11ea405bc916bc6aa908faafa5b4aac4b" @@ -6724,11 +5281,6 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -cachedir@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" - integrity sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw== - call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -6737,11 +5289,6 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" -call-me-maybe@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" - integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= - caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" @@ -6774,11 +5321,6 @@ camel-case@^4.1.1: pascal-case "^3.1.2" tslib "^2.0.3" -camelcase-css@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" - integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== - camelcase@5.3.1, camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" @@ -6831,21 +5373,11 @@ case-sensitive-paths-webpack-plugin@2.3.0: resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.3.0.tgz#23ac613cc9a856e4f88ff8bb73bbb5e989825cf7" integrity sha512-/4YgnZS8y1UXXmC02xD5rRrBEu6T5ub+mQHLNRj0fzTRbgdBYhsNo2V5EqwgqrExjxsjtF/OpAKAMkKsxbD5XQ== -case-sensitive-paths-webpack-plugin@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4" - integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw== - caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -ccount@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" - integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== - chalk@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" @@ -6864,7 +5396,7 @@ chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^1.0.0, chalk@^1.1.3: +chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= @@ -6891,14 +5423,6 @@ chalk@^4.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - char-regex@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" @@ -6919,7 +5443,7 @@ character-reference-invalid@^1.0.0: resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== -check-more-types@2.24.0, check-more-types@^2.24.0: +check-more-types@2.24.0: version "2.24.0" resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" integrity sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA= @@ -6955,7 +5479,7 @@ chokidar@^2.1.8: optionalDependencies: fsevents "^1.2.7" -chokidar@^3.4.1, chokidar@^3.4.2: +chokidar@^3.4.1: version "3.5.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== @@ -6990,11 +5514,6 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -ci-info@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.1.1.tgz#9a32fcefdf7bcdb6f0a7e1c0f8098ec57897b80a" - integrity sha512-kdRWLBIJwdsYJWYJFtAFFYxybguqeF91qpZaggjG5Nf8QKdizFG2hjqvaTXbxFIcYbSaD74KpAXv6BSm17DHEQ== - cids@^1.0.0: version "1.1.6" resolved "https://registry.yarnpkg.com/cids/-/cids-1.1.6.tgz#ac7aea7dbcabaa64ca242b5d970d596a5c34d006" @@ -7028,11 +5547,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -classnames@^2.2.5: - version "2.3.1" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" - integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== - clean-css@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.3.tgz#507b5de7d97b48ee53d84adb0160ff6216380f78" @@ -7050,62 +5564,6 @@ cli-boxes@^1.0.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= -cli-boxes@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" - integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== - -cli-cursor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" - integrity sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc= - dependencies: - restore-cursor "^1.0.1" - -cli-cursor@^2.0.0, cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -cli-table3@0.6.0, cli-table3@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.0.tgz#b7b1bc65ca8e7b5cef9124e13dc2b21e2ce4faee" - integrity sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ== - dependencies: - object-assign "^4.1.0" - string-width "^4.2.0" - optionalDependencies: - colors "^1.1.2" - -cli-table3@~0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" - integrity sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw== - dependencies: - object-assign "^4.1.0" - string-width "^2.1.1" - optionalDependencies: - colors "^1.1.2" - -cli-truncate@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" - integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= - dependencies: - slice-ansi "0.0.4" - string-width "^1.0.1" - -clipboard@^2.0.0: - version "2.0.8" - resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.8.tgz#ffc6c103dd2967a83005f3f61976aa4655a4cdba" - integrity sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ== - dependencies: - good-listener "^1.2.2" - select "^1.1.2" - tiny-emitter "^2.0.0" - clipboardy@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-1.2.3.tgz#0526361bf78724c1f20be248d428e365433c07ef" @@ -7161,11 +5619,6 @@ coa@^2.0.2: chalk "^2.4.1" q "^1.1.2" -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - collapse-white-space@^1.0.2: version "1.0.6" resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.6.tgz#e63629c0016665792060dbbeb79c42239d2c5287" @@ -7245,23 +5698,13 @@ colorette@^1.2.1, colorette@^1.2.2: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== -colors@^1.1.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" -comma-separated-tokens@^1.0.0: - version "1.0.8" - resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" - integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== - command-line-args@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.7.tgz#f8d1916ecb90e9e121eda6428e41300bfb64cc46" @@ -7271,7 +5714,7 @@ command-line-args@^4.0.7: find-replace "^1.0.3" typical "^2.6.1" -commander@^2.19.0, commander@^2.20.0: +commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -7281,16 +5724,6 @@ commander@^4.1.1: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== -commander@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" - integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== - -commander@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== - common-tags@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" @@ -7346,17 +5779,12 @@ compression@^1.7.4: safe-buffer "5.1.2" vary "~1.1.2" -compute-scroll-into-view@^1.0.17: - version "1.0.17" - resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.17.tgz#6a88f18acd9d42e9cf4baa6bec7e0522607ab7ab" - integrity sha512-j4dx+Fb0URmzbwwMUrhqWM2BEWHdFGx+qZ9qqASHRPqvTYdqvWnHg0H1hIbcyLnvgnoNAVMlwkepyqM3DaIFUg== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.5.0, concat-stream@^1.5.1, concat-stream@^1.6.2: +concat-stream@^1.5.0, concat-stream@^1.5.1: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -7381,11 +5809,6 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" @@ -7472,34 +5895,16 @@ core-js-compat@^3.6.2, core-js-compat@^3.9.0, core-js-compat@^3.9.1: browserslist "^4.16.6" semver "7.0.0" -core-js-compat@^3.8.1: - version "3.10.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.10.1.tgz#62183a3a77ceeffcc420d907a3e6fc67d9b27f1c" - integrity sha512-ZHQTdTPkqvw2CeHiZC970NNJcnwzT6YIueDMASKt+p3WbZsLXOcoD392SkcWhkC0wBBHhlfhqGKKsNCQUozYtg== - dependencies: - browserslist "^4.16.3" - semver "7.0.0" - core-js-pure@^3.0.0: version "3.12.1" resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.12.1.tgz#934da8b9b7221e2a2443dc71dfa5bd77a7ea00b8" integrity sha512-1cch+qads4JnDSWsvc7d6nzlKAippwjUlf6vykkTLW53VSV+NkE6muGBToAjEA8pG90cSfcud3JgVmW2ds5TaQ== -core-js-pure@^3.8.2: - version "3.10.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.10.1.tgz#28642697dfcf02e0fd9f4d9891bd03a22df28ecf" - integrity sha512-PeyJH2SE0KuxY5eCGNWA+W+CeDpB6M1PN3S7Am7jSv/Ttuxz2SnWbIiVQOn/TDaGaGtxo8CRWHkXwJscbUHtVw== - core-js@^2.4.0, core-js@^2.5.0: version "2.6.12" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== -core-js@^3.0.1, core-js@^3.0.4, core-js@^3.8.2: - version "3.10.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.10.1.tgz#e683963978b6806dcc6c0a4a8bd4ab0bdaf3f21a" - integrity sha512-pwCxEXnj27XG47mu7SXAwhLP3L5CrlvCB91ANUkIz40P27kUcvNfSdvyZJ9CLHiVoKSp+TTChMQMSKQEH/IQxA== - core-js@^3.6.5: version "3.12.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.12.1.tgz#6b5af4ff55616c08a44d386f1f510917ff204112" @@ -7542,31 +5947,6 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cp-file@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cp-file/-/cp-file-7.0.0.tgz#b9454cfd07fe3b974ab9ea0e5f29655791a9b8cd" - integrity sha512-0Cbj7gyvFVApzpK/uhCtQ/9kE9UnYpxMzaq5nQQC/Dh4iaj5fxp7iEFIullrYwzj8nf0qnsI1Qsx34hAeAebvw== - dependencies: - graceful-fs "^4.1.2" - make-dir "^3.0.0" - nested-error-stacks "^2.0.0" - p-event "^4.1.0" - -cpy@^8.1.1: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cpy/-/cpy-8.1.2.tgz#e339ea54797ad23f8e3919a5cffd37bfc3f25935" - integrity sha512-dmC4mUesv0OYH2kNFEidtf/skUwv4zePmGeepjyyJ0qTo5+8KhA1o99oIAwVVLzQMAeDJml74d6wPPKb6EZUTg== - dependencies: - arrify "^2.0.1" - cp-file "^7.0.0" - globby "^9.2.0" - has-glob "^1.0.0" - junk "^3.1.0" - nested-error-stacks "^2.1.0" - p-all "^2.1.0" - p-filter "^2.1.0" - p-map "^3.0.0" - create-ecdh@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" @@ -7598,14 +5978,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" -create-react-context@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.3.0.tgz#546dede9dc422def0d3fc2fe03afe0bc0f4f7d8c" - integrity sha512-dNldIoSuNSvlTJ7slIKC/ZFGKexBMBrrcc+TTe1NdmROnaASuLPvqpwj9v4XS4uXZ8+YPu0sNmShX2rXI5LNsw== - dependencies: - gud "^1.0.0" - warning "^4.0.3" - cross-env@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" @@ -7723,25 +6095,6 @@ css-loader@4.3.0: schema-utils "^2.7.1" semver "^7.3.2" -css-loader@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.6.0.tgz#2e4b2c7e6e2d27f8c8f28f61bffcd2e6c91ef645" - integrity sha512-M5lSukoWi1If8dhQAUCvj4H8vUt3vOnwbQBH9DdTm/s4Ym2B/3dPMtYZeJmq7Q3S3Pa+I94DcZ7pc9bP14cWIQ== - dependencies: - camelcase "^5.3.1" - cssesc "^3.0.0" - icss-utils "^4.1.1" - loader-utils "^1.2.3" - normalize-path "^3.0.0" - postcss "^7.0.32" - postcss-modules-extract-imports "^2.0.0" - postcss-modules-local-by-default "^3.0.2" - postcss-modules-scope "^2.2.0" - postcss-modules-values "^3.0.0" - postcss-value-parser "^4.1.0" - schema-utils "^2.7.0" - semver "^6.3.0" - css-prefers-color-scheme@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz#6f830a2714199d4f0d0d0bb8a27916ed65cff1f4" @@ -7924,95 +6277,7 @@ csstype@^3.0.2: cyclist@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" - integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= - -cypress@*: - version "7.1.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.1.0.tgz#6cb5dc22c6271a9d7a79a2477251a95afc77e531" - integrity sha512-AptQP9fVtN/FfOv8rJ9hTGJE2XQFc8saLHT38r/EeyWhzp0q/+P/DYRTDtjGZHeLTCNznAUrT4lal8jm+ouS7Q== - dependencies: - "@cypress/listr-verbose-renderer" "^0.4.1" - "@cypress/request" "^2.88.5" - "@cypress/xvfb" "^1.2.4" - "@types/node" "^14.14.31" - "@types/sinonjs__fake-timers" "^6.0.2" - "@types/sizzle" "^2.3.2" - arch "^2.2.0" - blob-util "^2.0.2" - bluebird "^3.7.2" - cachedir "^2.3.0" - chalk "^4.1.0" - check-more-types "^2.24.0" - cli-table3 "~0.6.0" - commander "^5.1.0" - common-tags "^1.8.0" - dayjs "^1.10.4" - debug "4.3.2" - eventemitter2 "^6.4.3" - execa "4.1.0" - executable "^4.1.1" - extract-zip "^1.7.0" - fs-extra "^9.1.0" - getos "^3.2.1" - is-ci "^3.0.0" - is-installed-globally "~0.4.0" - lazy-ass "^1.6.0" - listr "^0.14.3" - lodash "^4.17.21" - log-symbols "^4.0.0" - minimist "^1.2.5" - ospath "^1.2.2" - pretty-bytes "^5.6.0" - ramda "~0.27.1" - request-progress "^3.0.0" - supports-color "^8.1.1" - tmp "~0.2.1" - untildify "^4.0.0" - url "^0.11.0" - yauzl "^2.10.0" - -cypress@^4.11.0: - version "4.12.1" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-4.12.1.tgz#0ead1b9f4c0917d69d8b57f996b6e01fe693b6ec" - integrity sha512-9SGIPEmqU8vuRA6xst2CMTYd9sCFCxKSzrHt0wr+w2iAQMCIIsXsQ5Gplns1sT6LDbZcmLv6uehabAOl3fhc9Q== - dependencies: - "@cypress/listr-verbose-renderer" "^0.4.1" - "@cypress/request" "^2.88.5" - "@cypress/xvfb" "^1.2.4" - "@types/sinonjs__fake-timers" "^6.0.1" - "@types/sizzle" "^2.3.2" - arch "^2.1.2" - bluebird "^3.7.2" - cachedir "^2.3.0" - chalk "^2.4.2" - check-more-types "^2.24.0" - cli-table3 "~0.5.1" - commander "^4.1.1" - common-tags "^1.8.0" - debug "^4.1.1" - eventemitter2 "^6.4.2" - execa "^1.0.0" - executable "^4.1.1" - extract-zip "^1.7.0" - fs-extra "^8.1.0" - getos "^3.2.1" - is-ci "^2.0.0" - is-installed-globally "^0.3.2" - lazy-ass "^1.6.0" - listr "^0.14.3" - lodash "^4.17.19" - log-symbols "^3.0.0" - minimist "^1.2.5" - moment "^2.27.0" - ospath "^1.2.2" - pretty-bytes "^5.3.0" - ramda "~0.26.1" - request-progress "^3.0.0" - supports-color "^7.1.0" - tmp "~0.1.0" - untildify "^4.0.0" - url "^0.11.0" - yauzl "^2.10.0" + integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= d@1, d@^1.0.1: version "1.0.1" @@ -8043,21 +6308,6 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -date-fns@^1.27.2: - version "1.30.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" - integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== - -dayjs@^1.10.4: - version "1.10.4" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2" - integrity sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw== - -de-indent@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" - integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0= - debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -8072,13 +6322,6 @@ debug@4.3.1, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: dependencies: ms "2.1.2" -debug@4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== - dependencies: - ms "2.1.2" - debug@=3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -8086,7 +6329,7 @@ debug@=3.1.0: dependencies: ms "2.0.0" -debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.6: +debug@^3.1.1, debug@^3.2.6: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -8140,11 +6383,6 @@ deep-is@^0.1.3, deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -deep-object-diff@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/deep-object-diff/-/deep-object-diff-1.1.0.tgz#d6fabf476c2ed1751fc94d5ca693d2ed8c18bc5a" - integrity sha512-b+QLs5vHgS+IoSNcUE4n9HP2NwcHj7aqnJWsjPtuG75Rh5TOaGt0OjAYInh77d5T16V5cRDC+Pw/6ZZZiETBGw== - deepmerge@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" @@ -8217,16 +6455,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -delegate@^3.1.2: - version "3.2.0" - resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166" - integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw== - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -8245,13 +6473,6 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= -detab@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.4.tgz#b927892069aff405fbb9a186fe97a44a92a94b43" - integrity sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g== - dependencies: - repeat-string "^1.5.4" - detect-browser@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.2.0.tgz#c9cd5afa96a6a19fda0bbe9e9be48a6b6e1e9c97" @@ -8287,14 +6508,6 @@ detect-port-alt@1.1.6: address "^1.0.1" debug "^2.6.0" -detect-port@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/detect-port/-/detect-port-1.3.0.tgz#d9c40e9accadd4df5cac6a782aefd014d573d1f1" - integrity sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ== - dependencies: - address "^1.0.1" - debug "^2.6.0" - diff-sequences@^25.2.6: version "25.2.6" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" @@ -8319,13 +6532,6 @@ dijkstrajs@^1.0.1: resolved "https://registry.yarnpkg.com/dijkstrajs/-/dijkstrajs-1.0.1.tgz#d3cd81221e3ea40742cfcde556d4e99e98ddc71b" integrity sha1-082BIh4+pAdCz83lVtTpnpjdxxs= -dir-glob@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" - integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== - dependencies: - path-type "^3.0.0" - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -8375,11 +6581,6 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-accessibility-api@^0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.4.tgz#b06d059cdd4a4ad9a79275f9d414a5c126241166" - integrity sha512-TvrjBckDy2c6v6RLxPv5QXOnU+SmF9nBII5621Ve5fu6Z/BDrENurBEvlC1f44lKEUVqOpK4w9E5Idc5/EgkLQ== - dom-converter@^0.2: version "0.2.0" resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" @@ -8484,35 +6685,16 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" -dotenv-defaults@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/dotenv-defaults/-/dotenv-defaults-1.1.1.tgz#032c024f4b5906d9990eb06d722dc74cc60ec1bd" - integrity sha512-6fPRo9o/3MxKvmRZBD3oNFdxODdhJtIy1zcJeUSCs6HCy4tarUpd+G67UTU9tF6OWXeSPqsm4fPAB+2eY9Rt9Q== - dependencies: - dotenv "^6.2.0" - -dotenv-expand@5.1.0, dotenv-expand@^5.1.0: +dotenv-expand@5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0" integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA== -dotenv-webpack@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-1.8.0.tgz#7ca79cef2497dd4079d43e81e0796bc9d0f68a5e" - integrity sha512-o8pq6NLBehtrqA8Jv8jFQNtG9nhRtVqmoD4yWbgUyoU3+9WBlPe+c2EAiaJok9RB28QvrWvdWLZGeTT5aATDMg== - dependencies: - dotenv-defaults "^1.0.2" - -dotenv@8.2.0, dotenv@^8.0.0: +dotenv@8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== -dotenv@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064" - integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w== - dotignore@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" @@ -8520,16 +6702,6 @@ dotignore@~0.1.2: dependencies: minimatch "^3.0.4" -downshift@^6.0.15: - version "6.1.2" - resolved "https://registry.yarnpkg.com/downshift/-/downshift-6.1.2.tgz#99d9a03d4da4bf369df766effc3b70f7e789950e" - integrity sha512-WnPoQ6miic4+uEzPEfqgeen0t5YREOUabMopU/Juo/UYDMZl0ZACkO6ykWCRg48dlEUmEt6zfaJlj1x7kEy78g== - dependencies: - "@babel/runtime" "^7.13.10" - compute-scroll-into-view "^1.0.17" - prop-types "^15.7.2" - react-is "^17.0.2" - drbg.js@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" @@ -8582,18 +6754,6 @@ electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.723: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz#857e310ca00f0b75da4e1db6ff0e073cc4a91ddf" integrity sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg== -elegant-spinner@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" - integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= - -element-resize-detector@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/element-resize-detector/-/element-resize-detector-1.2.2.tgz#bf7c3ff915957e4e62e86241ed2f9c86b078892b" - integrity sha512-+LOXRkCJc4I5WhEJxIDjhmE3raF8jtOMBDqSCgZTMz2TX3oXAX5pE2+MDeopJlGdXzP7KzPbBJaUGfNaP9HG4A== - dependencies: - batch-processor "1.0.0" - elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" @@ -8612,11 +6772,6 @@ emittery@^0.7.1: resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" integrity sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== -"emoji-regex@>=6.0.0 <=6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" - integrity sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4= - emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -8642,15 +6797,6 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -emotion-theming@^10.0.27: - version "10.0.27" - resolved "https://registry.yarnpkg.com/emotion-theming/-/emotion-theming-10.0.27.tgz#1887baaec15199862c89b1b984b79806f2b9ab10" - integrity sha512-MlF1yu/gYh8u+sLUqA0YuA9JX0P4Hb69WlKc/9OLo+WCXuX6sy/KoIa+qJimgmr2dWqnypYKYPX37esjDBbhdw== - dependencies: - "@babel/runtime" "^7.5.5" - "@emotion/weak-memoize" "0.2.5" - hoist-non-react-statics "^3.3.0" - enc-utils@3.0.0, enc-utils@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/enc-utils/-/enc-utils-3.0.0.tgz#65935d2d6a867fa0ae995f05f3a2f055ce764dcf" @@ -8678,16 +6824,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -endent@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/endent/-/endent-2.0.1.tgz#fb18383a3f37ae3213a5d9f6c4a880d1061eb4c5" - integrity sha512-mADztvcC+vCk4XEZaCz6xIPO2NHQuprv5CAEjuVAu6aZwqAj7nVNlMyl1goPFYqCCpS2OJV9jwpumJLkotZrNw== - dependencies: - dedent "^0.7.0" - fast-json-parse "^1.0.3" - objectorarray "^1.0.4" - -enhanced-resolve@^4.3.0, enhanced-resolve@^4.5.0: +enhanced-resolve@^4.3.0: version "4.5.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz#2f3cfd84dbe3b487f18f2db2ef1e064a571ca5ec" integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg== @@ -8703,7 +6840,7 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" -entities@^1.1.1, entities@^1.1.2: +entities@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== @@ -8734,7 +6871,7 @@ error-stack-parser@^2.0.6: dependencies: stackframe "^1.1.1" -es-abstract@^1.17.0-next.0, es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: +es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: version "1.18.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== @@ -8756,25 +6893,6 @@ es-abstract@^1.17.0-next.0, es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es- string.prototype.trimstart "^1.0.4" unbox-primitive "^1.0.0" -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== - -es-get-iterator@^1.0.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.2.tgz#9234c54aba713486d7ebde0220864af5e2b283f7" - integrity sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.0" - has-symbols "^1.0.1" - is-arguments "^1.1.0" - is-map "^2.0.2" - is-set "^2.0.2" - is-string "^1.0.5" - isarray "^2.0.5" - es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -8793,11 +6911,6 @@ es5-ext@^0.10.35, es5-ext@^0.10.50: es6-symbol "~3.1.3" next-tick "~1.0.0" -es5-shim@^4.5.13: - version "4.5.15" - resolved "https://registry.yarnpkg.com/es5-shim/-/es5-shim-4.5.15.tgz#6a26869b261854a3b045273f5583c52d390217fe" - integrity sha512-FYpuxEjMeDvU4rulKqFdukQyZSTpzhg4ScQHrAosrlVpR6GFyaw14f74yn2+4BugniIS0Frpg7TvwZocU4ZMTw== - es6-iterator@2.0.3, es6-iterator@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" @@ -8807,11 +6920,6 @@ es6-iterator@2.0.3, es6-iterator@~2.0.3: es5-ext "^0.10.35" es6-symbol "^3.1.1" -es6-shim@^0.35.5: - version "0.35.6" - resolved "https://registry.yarnpkg.com/es6-shim/-/es6-shim-0.35.6.tgz#d10578301a83af2de58b9eadb7c2c9945f7388a0" - integrity sha512-EmTr31wppcaIAgblChZiuN/l9Y7DPyw8Xtbg7fIVngn6zMW+IEBJDJngeKC3x6wr0V/vcA2wqeFnaw1bFJbDdA== - es6-symbol@^3.1.1, es6-symbol@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" @@ -9513,11 +7621,6 @@ event-stream@=3.3.4: stream-combiner "~0.0.4" through "~2.3.1" -eventemitter2@^6.4.2, eventemitter2@^6.4.3: - version "6.4.4" - resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.4.tgz#aa96e8275c4dbeb017a5d0e03780c65612a1202b" - integrity sha512-HLU3NDY6wARrLCEwyGKRBvuWYyvW6mHYv72SJJAH3iJN3a6eVUvkjFkcxah1bcTgGVBBrFdIopBJPhCQFMLyXw== - eventemitter3@4.0.7, eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -9564,21 +7667,6 @@ execa@3.4.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" -execa@4.1.0, execa@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -9618,23 +7706,26 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -executable@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" - integrity sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg== +execa@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== dependencies: - pify "^2.2.0" + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" exif-parser@^0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/exif-parser/-/exif-parser-0.1.12.tgz#58a9d2d72c02c1f6f02a0ef4a9166272b7760922" integrity sha1-WKnS1ywCwfbwKg70qRZicrd2CSI= -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - integrity sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g= - exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -9742,16 +7833,6 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-zip@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.7.0.tgz#556cc3ae9df7f452c493a0cfb51cc30277940927" - integrity sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA== - dependencies: - concat-stream "^1.6.2" - debug "^2.6.9" - mkdirp "^0.5.4" - yauzl "^2.10.0" - extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -9779,7 +7860,7 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: +fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== @@ -9789,18 +7870,6 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-glob@^2.2.6: - version "2.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" - integrity sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw== - dependencies: - "@mrmlnc/readdir-enhanced" "^2.2.1" - "@nodelib/fs.stat" "^1.1.2" - glob-parent "^3.1.0" - is-glob "^4.0.0" - merge2 "^1.2.3" - micromatch "^3.1.10" - fast-glob@^3.1.1: version "3.2.5" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" @@ -9813,11 +7882,6 @@ fast-glob@^3.1.1: micromatch "^4.0.2" picomatch "^2.2.1" -fast-json-parse@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/fast-json-parse/-/fast-json-parse-1.0.3.tgz#43e5c61ee4efa9265633046b770fb682a7577c4d" - integrity sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw== - fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -9847,13 +7911,6 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -fault@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" - integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA== - dependencies: - format "^0.2.0" - faye-websocket@^0.11.3: version "0.11.3" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.3.tgz#5c0e9a8968e8912c286639fde977a8b209f2508e" @@ -9868,13 +7925,6 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= - dependencies: - pend "~1.2.0" - fetch-ponyfill@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" @@ -9887,21 +7937,6 @@ figgy-pudding@^3.5.1: resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== -figures@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -9917,23 +7952,6 @@ file-loader@6.1.1: loader-utils "^2.0.0" schema-utils "^3.0.0" -file-loader@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" - integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw== - dependencies: - loader-utils "^2.0.0" - schema-utils "^3.0.0" - -file-system-cache@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/file-system-cache/-/file-system-cache-1.0.5.tgz#84259b36a2bbb8d3d6eb1021d3132ffe64cfff4f" - integrity sha1-hCWbNqK7uNPW6xAh0xMv/mTP/08= - dependencies: - bluebird "^3.3.5" - fs-extra "^0.30.0" - ramda "^0.21.0" - file-type@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-9.0.0.tgz#a68d5ad07f486414dfb2c8866f73161946714a18" @@ -9979,7 +7997,7 @@ finalhandler@~1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -find-cache-dir@^2.0.0, find-cache-dir@^2.1.0: +find-cache-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== @@ -10032,14 +8050,6 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -10107,7 +8117,7 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -fork-ts-checker-webpack-plugin@4.1.6, fork-ts-checker-webpack-plugin@^4.1.0, fork-ts-checker-webpack-plugin@^4.1.6: +fork-ts-checker-webpack-plugin@4.1.6: version "4.1.6" resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.1.6.tgz#5055c703febcf37fa06405d400c122b905167fc5" integrity sha512-DUxuQaKoqfNne8iikd14SAkh5uw4+8vNifp6gmA73yYNS6ywLIWSLD/n/mBzHQRpW3J7rbATEakmiA8JvkTyZw== @@ -10120,33 +8130,6 @@ fork-ts-checker-webpack-plugin@4.1.6, fork-ts-checker-webpack-plugin@^4.1.0, for tapable "^1.0.0" worker-rpc "^0.1.0" -fork-ts-checker-webpack-plugin@^6.0.4: - version "6.2.1" - resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.2.1.tgz#e3a7e64c90e5490a75d43d86d47f02e538c0a13e" - integrity sha512-Pyhn2kav/Y2g6I7aInABgcph/B78jjdXc4kGHzaAUBL4UVthknxM6aMH47JwpnuTJmdOuf6p5vMbIahsBHuWGg== - dependencies: - "@babel/code-frame" "^7.8.3" - "@types/json-schema" "^7.0.5" - chalk "^4.1.0" - chokidar "^3.4.2" - cosmiconfig "^6.0.0" - deepmerge "^4.2.2" - fs-extra "^9.0.0" - memfs "^3.1.2" - minimatch "^3.0.4" - schema-utils "2.7.0" - semver "^7.3.2" - tapable "^1.0.0" - -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -10156,11 +8139,6 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -format@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" - integrity sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs= - fortmatic@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/fortmatic/-/fortmatic-1.1.3.tgz#eaeb8b65677aaa245a67ff5f1b8b7f79380a9b23" @@ -10198,17 +8176,6 @@ from@~0: resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - fs-extra@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -10227,7 +8194,7 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.0, fs-extra@^9.0.1, fs-extra@^9.1.0: +fs-extra@^9.0.1: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== @@ -10244,11 +8211,6 @@ fs-minipass@^2.0.0: dependencies: minipass "^3.0.0" -fs-monkey@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3" - integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== - fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" @@ -10282,45 +8244,11 @@ function-bind@^1.1.1, function-bind@~1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -function.prototype.name@^1.1.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.4.tgz#e4ea839b9d3672ae99d0efd9f38d9191c5eaac83" - integrity sha512-iqy1pIotY/RmhdFZygSSlW0wko2yxkSCKqsuv4pr8QESohpYyG/Z7B/XXvPRKTJS//960rgguE5mSRUsDdaJrQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - functions-have-names "^1.2.2" - functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -functions-have-names@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.2.tgz#98d93991c39da9361f8e50b337c4f6e41f120e21" - integrity sha512-bLgc3asbWdwPbx2mNk2S49kmJCuQeu0nfmaOgbs8WIyzzkw3r4htszdIi9Q9EMezDPTYuJx2wvjZ/EwgAthpnA== - -fuse.js@^3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.6.1.tgz#7de85fdd6e1b3377c23ce010892656385fd9b10c" - integrity sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw== - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -10384,13 +8312,6 @@ get-value@^2.0.3, get-value@^2.0.6: resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= -getos@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/getos/-/getos-3.2.1.tgz#0134d1f4e00eb46144c5a9c0ac4dc087cbb27dc5" - integrity sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q== - dependencies: - async "^3.2.0" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -10406,28 +8327,6 @@ gifwrap@^0.9.2: image-q "^1.1.1" omggif "^1.0.10" -github-slugger@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.3.0.tgz#9bd0a95c5efdfc46005e82a906ef8e2a059124c9" - integrity sha512-gwJScWVNhFYSRDvURk/8yhcFBee6aFjye2a7Lhb2bUyRulpIoek9p0I9Kt7PT67d/nUlZbFu8L9RLiA0woQN8Q== - dependencies: - emoji-regex ">=6.0.0 <=6.1.1" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -10443,18 +8342,6 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -glob-promise@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/glob-promise/-/glob-promise-3.4.0.tgz#b6b8f084504216f702dc2ce8c9bc9ac8866fdb20" - integrity sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw== - dependencies: - "@types/glob" "*" - -glob-to-regexp@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" - integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= - glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" @@ -10479,20 +8366,6 @@ glob@~7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -global-dirs@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.1.0.tgz#e9046a49c806ff04d6c1825e196c8f0091e8df4d" - integrity sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ== - dependencies: - ini "1.3.7" - -global-dirs@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686" - integrity sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA== - dependencies: - ini "2.0.0" - global-modules@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" @@ -10509,7 +8382,7 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" -global@^4.4.0, global@~4.4.0: +global@~4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== @@ -10541,13 +8414,6 @@ globals@^9.18.0: resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== -globalthis@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.2.tgz#2a235d34f4d8036219f7e34929b5de9e18166b8b" - integrity sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ== - dependencies: - define-properties "^1.1.3" - globby@11.0.1: version "11.0.1" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" @@ -10583,28 +8449,7 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" -globby@^9.2.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" - integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg== - dependencies: - "@types/glob" "^7.1.1" - array-union "^1.0.2" - dir-glob "^2.2.2" - fast-glob "^2.2.6" - glob "^7.1.3" - ignore "^4.0.3" - pify "^4.0.1" - slash "^2.0.0" - -good-listener@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50" - integrity sha1-1TswzfkxPf+33JoNR3CWqm0UXFA= - dependencies: - delegate "^3.1.2" - -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: version "4.2.6" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== @@ -10614,11 +8459,6 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -gud@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" - integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw== - gzip-size@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274" @@ -10672,23 +8512,11 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-glob/-/has-glob-1.0.0.tgz#9aaa9eedbffb1ba3990a7b0010fb678ee0081207" - integrity sha1-mqqe7b/7G6OZCnsAEPtnjuAIEgc= - dependencies: - is-glob "^3.0.0" - has-symbols@^1.0.1, has-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -10752,75 +8580,7 @@ hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hast-to-hyperscript@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz#9b67fd188e4c81e8ad66f803855334173920218d" - integrity sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA== - dependencies: - "@types/unist" "^2.0.3" - comma-separated-tokens "^1.0.0" - property-information "^5.3.0" - space-separated-tokens "^1.0.0" - style-to-object "^0.3.0" - unist-util-is "^4.0.0" - web-namespaces "^1.0.0" - -hast-util-from-parse5@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a" - integrity sha512-jeJUWiN5pSxW12Rh01smtVkZgZr33wBokLzKLwinYOUfSzm1Nl/c3GUGebDyOKjdsRgMvoVbV0VpAcpjF4NrJA== - dependencies: - "@types/parse5" "^5.0.0" - hastscript "^6.0.0" - property-information "^5.0.0" - vfile "^4.0.0" - vfile-location "^3.2.0" - web-namespaces "^1.0.0" - -hast-util-parse-selector@^2.0.0: - version "2.2.5" - resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a" - integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ== - -hast-util-raw@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-6.0.1.tgz#973b15930b7529a7b66984c98148b46526885977" - integrity sha512-ZMuiYA+UF7BXBtsTBNcLBF5HzXzkyE6MLzJnL605LKE8GJylNjGc4jjxazAHUtcwT5/CEt6afRKViYB4X66dig== - dependencies: - "@types/hast" "^2.0.0" - hast-util-from-parse5 "^6.0.0" - hast-util-to-parse5 "^6.0.0" - html-void-elements "^1.0.0" - parse5 "^6.0.0" - unist-util-position "^3.0.0" - vfile "^4.0.0" - web-namespaces "^1.0.0" - xtend "^4.0.0" - zwitch "^1.0.0" - -hast-util-to-parse5@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz#1ec44650b631d72952066cea9b1445df699f8479" - integrity sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ== - dependencies: - hast-to-hyperscript "^9.0.0" - property-information "^5.0.0" - web-namespaces "^1.0.0" - xtend "^4.0.0" - zwitch "^1.0.0" - -hastscript@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" - integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w== - dependencies: - "@types/hast" "^2.0.0" - comma-separated-tokens "^1.0.0" - hast-util-parse-selector "^2.0.0" - property-information "^5.0.0" - space-separated-tokens "^1.0.0" - -he@^1.1.0, he@^1.2.0: +he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -10830,11 +8590,6 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -highlight.js@^10.1.1, highlight.js@~10.7.0: - version "10.7.2" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.2.tgz#89319b861edc66c48854ed1e6da21ea89f847360" - integrity sha512-oFLl873u4usRM9K63j4ME9u3etNF0PLiJhSQ8rdfuL51Wn3zkD6drf9ZW0dOzjnZI22YYG24z30JcmfCZjMgYg== - history@^4.9.0: version "4.10.1" resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3" @@ -10908,7 +8663,7 @@ html-encoding-sniffer@^2.0.1: dependencies: whatwg-encoding "^1.0.5" -html-entities@^1.2.0, html-entities@^1.2.1, html-entities@^1.3.1: +html-entities@^1.2.1, html-entities@^1.3.1: version "1.4.0" resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.4.0.tgz#cfbd1b01d2afaf9adca1b10ae7dffab98c71d2dc" integrity sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA== @@ -10938,11 +8693,6 @@ html-parse-stringify2@2.0.1: dependencies: void-elements "^2.0.1" -html-tags@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.1.0.tgz#7b5e6f7e665e9fb41f30007ed9e0d41e97fb2140" - integrity sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg== - html-to-react@^1.3.4: version "1.4.5" resolved "https://registry.yarnpkg.com/html-to-react/-/html-to-react-1.4.5.tgz#59091c11021d1ef315ef738460abb6a4a41fe1ce" @@ -10953,11 +8703,6 @@ html-to-react@^1.3.4: lodash.camelcase "^4.3.0" ramda "^0.27.1" -html-void-elements@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" - integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== - html-webpack-plugin@4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.5.0.tgz#625097650886b97ea5dae331c320e3238f6c121c" @@ -10973,21 +8718,6 @@ html-webpack-plugin@4.5.0: tapable "^1.1.3" util.promisify "1.0.0" -html-webpack-plugin@^4.0.0: - version "4.5.2" - resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz#76fc83fa1a0f12dd5f7da0404a54e2699666bc12" - integrity sha512-q5oYdzjKUIPQVjOosjgvCHQOv9Ett9CYYHlgvJeXG0qQvdSojnBq4vAdQBwn1+yGveAwHCoe/rMR86ozX3+c2A== - dependencies: - "@types/html-minifier-terser" "^5.0.0" - "@types/tapable" "^1.0.5" - "@types/webpack" "^4.41.8" - html-minifier-terser "^5.0.1" - loader-utils "^1.2.3" - lodash "^4.17.20" - pretty-error "^2.1.1" - tapable "^1.1.3" - util.promisify "1.0.0" - htmlparser2@^3.10.1: version "3.10.1" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" @@ -11145,7 +8875,7 @@ iferr@^0.1.5: resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= -ignore@^4.0.3, ignore@^4.0.6: +ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== @@ -11226,11 +8956,6 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= -indent-string@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= - indent-string@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" @@ -11266,29 +8991,14 @@ inherits@2.0.1: inherits@2.0.3: version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" - integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== - -ini@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" - integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= ini@^1.3.5, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -inline-style-parser@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" - integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== - inter-ui@^3.13.1: version "3.18.0" resolved "https://registry.yarnpkg.com/inter-ui/-/inter-ui-3.18.0.tgz#7e231bd09c3d0cf949645ad42e4a6375abe294e9" @@ -11311,12 +9021,7 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" -interpret@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" - integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== - -invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4: +invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -11343,7 +9048,7 @@ is-absolute-url@^2.0.0: resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" integrity sha1-UFMN+4T8yap9vnhS6Do3uTufKqY= -is-absolute-url@^3.0.0, is-absolute-url@^3.0.3: +is-absolute-url@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698" integrity sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q== @@ -11362,7 +9067,7 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-alphabetical@1.0.4, is-alphabetical@^1.0.0: +is-alphabetical@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== @@ -11375,7 +9080,7 @@ is-alphanumerical@^1.0.0: is-alphabetical "^1.0.0" is-decimal "^1.0.0" -is-arguments@^1.0.4, is-arguments@^1.1.0: +is-arguments@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== @@ -11423,7 +9128,7 @@ is-buffer@^1.1.4, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.0, is-buffer@^2.0.2: +is-buffer@^2.0.2: version "2.0.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== @@ -11440,13 +9145,6 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-ci@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994" - integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== - dependencies: - ci-info "^3.1.1" - is-color-stop@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-color-stop/-/is-color-stop-1.1.0.tgz#cfff471aee4dd5c9e158598fbe12967b5cdad345" @@ -11518,14 +9216,6 @@ is-docker@^2.0.0: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-dom@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-dom/-/is-dom-1.1.0.tgz#af1fced292742443bb59ca3f76ab5e80907b4e8a" - integrity sha512-u82f6mvhYxRPKpw8V1N0W8ce1xXwOrQtgGcxl6UCL5zBmZu3is/18K0rR7uFCnMDuAsS/3W54mGL4vsaFUQlEQ== - dependencies: - is-object "^1.0.1" - is-window "^1.0.2" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -11538,11 +9228,6 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -11558,13 +9243,6 @@ is-fn@^1.0.0: resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" integrity sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw= -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" @@ -11575,7 +9253,7 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-function@^1.0.1, is-function@^1.0.2: +is-function@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" integrity sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ== @@ -11585,14 +9263,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" - -is-glob@^3.0.0, is-glob@^3.1.0: +is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= @@ -11616,27 +9287,6 @@ is-hexadecimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== -is-installed-globally@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141" - integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g== - dependencies: - global-dirs "^2.0.1" - is-path-inside "^3.0.1" - -is-installed-globally@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" - integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== - dependencies: - global-dirs "^3.0.0" - is-path-inside "^3.0.2" - -is-map@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" - integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== - is-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" @@ -11674,18 +9324,6 @@ is-obj@^2.0.0: resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== -is-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" - integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== - -is-observable@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" - integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== - dependencies: - symbol-observable "^1.1.0" - is-path-cwd@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" @@ -11705,26 +9343,11 @@ is-path-inside@^2.1.0: dependencies: path-is-inside "^1.0.2" -is-path-inside@^3.0.1, is-path-inside@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= -is-plain-obj@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-plain-object@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b" - integrity sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g== - is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -11737,11 +9360,6 @@ is-potential-custom-element-name@^1.0.0: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== -is-promise@^2.1.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" - integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== - is-regex@^1.0.4, is-regex@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" @@ -11772,11 +9390,6 @@ is-root@2.1.0: resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.1.0.tgz#809e18129cf1129644302a4f8544035d51984a9c" integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg== -is-set@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" - integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== - is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -11804,11 +9417,6 @@ is-typedarray@1.0.0, is-typedarray@^1.0.0, is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - is-what@^3.3.1: version "3.14.1" resolved "https://registry.yarnpkg.com/is-what/-/is-what-3.14.1.tgz#e1222f46ddda85dead0fd1c9df131760e77755c1" @@ -11819,11 +9427,6 @@ is-whitespace-character@^1.0.0: resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz#0858edd94a95594c7c9dd0b5c174ec6e45ee4aa7" integrity sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w== -is-window@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-window/-/is-window-1.0.2.tgz#2c896ca53db97de45d3c33133a65d8c9f563480d" - integrity sha1-LIlspT25feRdPDMTOmXYyfVjSA0= - is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -11856,7 +9459,7 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= -isarray@^2.0.1, isarray@^2.0.5: +isarray@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== @@ -11878,11 +9481,6 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -isobject@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0" - integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA== - isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -11929,19 +9527,6 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -iterate-iterator@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/iterate-iterator/-/iterate-iterator-1.0.1.tgz#1693a768c1ddd79c969051459453f082fe82e9f6" - integrity sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw== - -iterate-value@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/iterate-value/-/iterate-value-1.0.2.tgz#935115bd37d006a52046535ebc8d07e9c9337f57" - integrity sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ== - dependencies: - es-get-iterator "^1.0.2" - iterate-iterator "^1.0.1" - jazzicon@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/jazzicon/-/jazzicon-1.5.0.tgz#d7f36b516023db39ee6eac117f4054e937b65e99" @@ -12383,7 +9968,7 @@ jest-worker@^24.9.0: merge-stream "^2.0.0" supports-color "^6.1.0" -jest-worker@^26.2.1, jest-worker@^26.5.0, jest-worker@^26.6.2: +jest-worker@^26.5.0, jest-worker@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== @@ -12427,11 +10012,6 @@ js-sha3@0.8.0, js-sha3@^0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== -js-string-escape@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" - integrity sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8= - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -12606,20 +10186,13 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2, json5@^2.1.3: +json5@^2.1.2: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== dependencies: minimist "^1.2.5" -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" - jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -12659,11 +10232,6 @@ jsprim@^1.2.2: array-includes "^3.1.2" object.assign "^4.1.2" -junk@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/junk/-/junk-3.1.0.tgz#31499098d902b7e98c5d9b9c80f43457a88abfa1" - integrity sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ== - keccak@^1.0.2: version "1.4.0" resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" @@ -12716,13 +10284,6 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -12753,22 +10314,11 @@ last-call-webpack-plugin@^3.0.0: lodash "^4.17.5" webpack-sources "^1.1.0" -lazy-ass@1.6.0, lazy-ass@^1.6.0: +lazy-ass@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" integrity sha1-eZllXoZGwX8In90YfRUNMyTVRRM= -lazy-universal-dotenv@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lazy-universal-dotenv/-/lazy-universal-dotenv-3.0.1.tgz#a6c8938414bca426ab8c9463940da451a911db38" - integrity sha512-prXSYk799h3GY3iOWnC6ZigYzMPjxN2svgjJ9shk7oMadSNX3wXy0B6F32PMJv7qtMnrIbUxoEHzbutvxR2LBQ== - dependencies: - "@babel/runtime" "^7.5.0" - app-root-dir "^1.0.2" - core-js "^3.0.4" - dotenv "^8.0.0" - dotenv-expand "^5.1.0" - level-codec@~7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" @@ -12852,50 +10402,6 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -listr-silent-renderer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" - integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= - -listr-update-renderer@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" - integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== - dependencies: - chalk "^1.1.3" - cli-truncate "^0.2.1" - elegant-spinner "^1.0.1" - figures "^1.7.0" - indent-string "^3.0.0" - log-symbols "^1.0.2" - log-update "^2.3.0" - strip-ansi "^3.0.1" - -listr-verbose-renderer@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" - integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== - dependencies: - chalk "^2.4.1" - cli-cursor "^2.1.0" - date-fns "^1.27.2" - figures "^2.0.0" - -listr@^0.14.3: - version "0.14.3" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" - integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== - dependencies: - "@samverschueren/stream-to-observable" "^0.3.0" - is-observable "^1.1.0" - is-promise "^2.1.0" - is-stream "^1.1.0" - listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.5.0" - listr-verbose-renderer "^0.5.0" - p-map "^2.0.0" - rxjs "^6.3.3" - load-bmfont@^1.3.1: version "1.4.1" resolved "https://registry.yarnpkg.com/load-bmfont/-/load-bmfont-1.4.1.tgz#c0f5f4711a1e2ccff725a7b6078087ccfcddd3e9" @@ -12975,13 +10481,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -13017,11 +10516,6 @@ lodash.memoize@^4.1.2: resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= -lodash.once@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" - integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= - lodash.template@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" @@ -13042,7 +10536,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash.uniq@4.5.0, lodash.uniq@^4.5.0: +lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= @@ -13052,37 +10546,6 @@ lodash.uniq@4.5.0, lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" - integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= - dependencies: - chalk "^1.0.0" - -log-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - -log-symbols@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - -log-update@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" - integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= - dependencies: - ansi-escapes "^3.0.0" - cli-cursor "^2.0.0" - wrap-ansi "^3.0.1" - loglevel@^1.6.8: version "1.7.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" @@ -13102,14 +10565,6 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" -lowlight@^1.14.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.20.0.tgz#ddb197d33462ad0d93bf19d17b6c301aa3941888" - integrity sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw== - dependencies: - fault "^1.0.0" - highlight.js "~10.7.0" - lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -13142,11 +10597,6 @@ luxon@^1.25.0: resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.26.0.tgz#d3692361fda51473948252061d0f8561df02b578" integrity sha512-+V5QIQ5f6CDXQpWNICELwjwuHdqeJM1UenlZWx5ujcRMc9venvluCjFb4t5NYLhb6IhkbMVOxzVuOqkgMxee2A== -lz-string@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" - integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= - magic-string@^0.25.0, magic-string@^0.25.7: version "0.25.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" @@ -13154,7 +10604,7 @@ magic-string@^0.25.0, magic-string@^0.25.7: dependencies: sourcemap-codec "^1.4.4" -make-dir@^2.0.0, make-dir@^2.1.0: +make-dir@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== @@ -13162,7 +10612,7 @@ make-dir@^2.0.0, make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: +make-dir@^3.0.0, make-dir@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== @@ -13181,11 +10631,6 @@ map-cache@^0.2.2: resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= -map-or-similar@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/map-or-similar/-/map-or-similar-1.5.0.tgz#6de2653174adfb5d9edc33c69d3e92a1b76faf08" - integrity sha1-beJlMXSt+12e3DPGnT6Sobdvrwg= - map-stream@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" @@ -13203,19 +10648,6 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== -markdown-to-jsx@^6.11.4: - version "6.11.4" - resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-6.11.4.tgz#b4528b1ab668aef7fe61c1535c27e837819392c5" - integrity sha512-3lRCD5Sh+tfA52iGgfs/XZiw33f7fFX9Bn55aNnVNUd2GzLDkOWyKYYD8Yju2B1Vn+feiEdgJs8T6Tg0xNokPw== - dependencies: - prop-types "^15.6.2" - unquote "^1.1.0" - -markdown-to-jsx@^7.1.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.1.2.tgz#19d3da4cd8864045cdd13a0d179147fbd6a088d4" - integrity sha512-O8DMCl32V34RrD+ZHxcAPc2+kYytuDIoQYjY36RVdsLK7uHjgNVvFec4yv0X6LgB4YEZgSvK5QtFi5YVqEpoMA== - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -13232,39 +10664,6 @@ mdast-add-list-metadata@1.0.1: dependencies: unist-util-visit-parents "1.1.2" -mdast-squeeze-paragraphs@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" - integrity sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ== - dependencies: - unist-util-remove "^2.0.0" - -mdast-util-definitions@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2" - integrity sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ== - dependencies: - unist-util-visit "^2.0.0" - -mdast-util-to-hast@10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz#0cfc82089494c52d46eb0e3edb7a4eb2aea021eb" - integrity sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA== - dependencies: - "@types/mdast" "^3.0.0" - "@types/unist" "^2.0.0" - mdast-util-definitions "^4.0.0" - mdurl "^1.0.0" - unist-builder "^2.0.0" - unist-util-generated "^1.0.0" - unist-util-position "^3.0.0" - unist-util-visit "^2.0.0" - -mdast-util-to-string@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz#27055500103f51637bd07d01da01eb1967a43527" - integrity sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A== - mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -13275,11 +10674,6 @@ mdn-data@2.0.4: resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== -mdurl@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= - media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -13297,25 +10691,11 @@ memdown@^1.0.0: ltgt "~2.2.0" safe-buffer "~5.1.1" -memfs@^3.1.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.2.2.tgz#5de461389d596e3f23d48bb7c2afb6161f4df40e" - integrity sha512-RE0CwmIM3CEvpcdK3rZ19BC4E6hv9kADkMN5rPduRak58cNArWLi/9jFLsa4rhsjfVxMP3v0jO7FHXq7SvFY5Q== - dependencies: - fs-monkey "1.0.3" - "memoize-one@>=3.1.1 <6", memoize-one@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.1.1.tgz#047b6e3199b508eaec03504de71229b8eb1d75c0" integrity sha512-HKeeBpWvqiVJD57ZUAsJNm71eHTykffzcLZVYWiVfQeI1rJtuEaS7hQiEpWfVVk18donPwJEcFKIkCmPJNOhHA== -memoizerific@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/memoizerific/-/memoizerific-1.11.3.tgz#7c87a4646444c32d75438570905f2dbd1b1a805a" - integrity sha1-fIekZGREwy11Q4VwkF8tvRsagFo= - dependencies: - map-or-similar "^1.5.0" - memory-fs@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -13349,7 +10729,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0: +merge2@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -13457,11 +10837,6 @@ mime@^2.4.4: resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -13474,11 +10849,6 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - mini-create-react-context@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e" @@ -13507,7 +10877,7 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: +minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -13579,7 +10949,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5, mkdirp@~0.5.1: +mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -13591,11 +10961,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -moment@^2.27.0: - version "2.29.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" - integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== - move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -13714,11 +11079,6 @@ neo-async@^2.5.0, neo-async@^2.6.1, neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0fbdcf3e13fe4994781280524f8b96b0cdff9c61" - integrity sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug== - next-tick@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" @@ -13742,13 +11102,6 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-dir@^0.1.10: - version "0.1.17" - resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.17.tgz#5f5665d93351335caabef8f1c554516cf5f1e4e5" - integrity sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU= - dependencies: - minimatch "^3.0.2" - node-fetch@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" @@ -13902,16 +11255,6 @@ npm-run-path@^4.0.0: dependencies: path-key "^3.0.0" -npmlog@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - nth-check@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" @@ -13924,11 +11267,6 @@ num2fraction@^1.2.2: resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4= -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - nwsapi@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" @@ -14008,7 +11346,7 @@ object.entries@^1.1.0, object.entries@^1.1.3: es-abstract "^1.18.0-next.1" has "^1.0.3" -"object.fromentries@^2.0.0 || ^1.0.0", object.fromentries@^2.0.4: +object.fromentries@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== @@ -14018,7 +11356,7 @@ object.entries@^1.1.0, object.entries@^1.1.3: es-abstract "^1.18.0-next.2" has "^1.0.3" -object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0, object.getownpropertydescriptors@^2.1.2: +object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== @@ -14044,11 +11382,6 @@ object.values@^1.1.0, object.values@^1.1.1, object.values@^1.1.3: es-abstract "^1.18.0-next.2" has "^1.0.3" -objectorarray@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/objectorarray/-/objectorarray-1.0.4.tgz#d69b2f0ff7dc2701903d308bb85882f4ddb49483" - integrity sha512-91k8bjcldstRz1bG6zJo8lWD7c6QXcB4nTDUqiEvIL1xAsLoZlOOZZG+nd6YPz+V7zY1580J4Xxh1vZtyv4i/w== - obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -14078,18 +11411,6 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -onetime@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" - integrity sha1-ofeDj4MUxRbwXs78vEzP4EtO14k= - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - onetime@^5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" @@ -14097,7 +11418,7 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -open@^7.0.2, open@^7.0.3: +open@^7.0.2: version "7.4.2" resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== @@ -14171,42 +11492,11 @@ os-tmpdir@^1.0.1: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -ospath@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" - integrity sha1-EnZjl3Sj+O8lcvf+QoDg6kVQwHs= - -overlayscrollbars@^1.13.1: - version "1.13.1" - resolved "https://registry.yarnpkg.com/overlayscrollbars/-/overlayscrollbars-1.13.1.tgz#0b840a88737f43a946b9d87875a2f9e421d0338a" - integrity sha512-gIQfzgGgu1wy80EB4/6DaJGHMEGmizq27xHIESrzXq0Y/J0Ay1P3DWk6tuVmEPIZH15zaBlxeEJOqdJKmowHCQ== - -p-all@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-all/-/p-all-2.1.0.tgz#91419be56b7dee8fe4c5db875d55e0da084244a0" - integrity sha512-HbZxz5FONzz/z2gJfk6bFca0BCiSRF8jU3yCsWOen/vR6lZjfPOu/e7L3uFzTW1i0H8TlC3vqQstEJPQL4/uLA== - dependencies: - p-map "^2.0.0" - p-each-series@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== -p-event@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/p-event/-/p-event-4.2.0.tgz#af4b049c8acd91ae81083ebd1e6f5cae2044c1b5" - integrity sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ== - dependencies: - p-timeout "^3.1.0" - -p-filter@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-filter/-/p-filter-2.1.0.tgz#1b1472562ae7a0f742f0f3d3d3718ea66ff9c09c" - integrity sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw== - dependencies: - p-map "^2.0.0" - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -14259,25 +11549,11 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - p-map@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== -p-map@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" - integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== - dependencies: - aggregate-error "^3.0.0" - p-map@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" @@ -14292,13 +11568,6 @@ p-retry@^3.0.1: dependencies: retry "^0.12.0" -p-timeout@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" - integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== - dependencies: - p-finally "^1.0.0" - p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" @@ -14379,18 +11648,6 @@ parse-entities@^1.1.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" -parse-entities@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" - integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== - dependencies: - character-entities "^1.0.0" - character-entities-legacy "^1.0.0" - character-reference-invalid "^1.0.0" - is-alphanumerical "^1.0.0" - is-decimal "^1.0.0" - is-hexadecimal "^1.0.0" - parse-headers@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.3.tgz#5e8e7512383d140ba02f0c7aa9f49b4399c92515" @@ -14421,7 +11678,7 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse5@6.0.1, parse5@^6.0.0: +parse5@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== @@ -14513,13 +11770,6 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -14543,11 +11793,6 @@ pbkdf2@^3.0.17, pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - penpal@3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/penpal/-/penpal-3.0.7.tgz#d252711ed93b30f1d867eb82342785b3a95f5f75" @@ -14568,7 +11813,7 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== -pify@^2.0.0, pify@^2.2.0: +pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= @@ -14600,7 +11845,7 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= -pirates@^4.0.0, pirates@^4.0.1: +pirates@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== @@ -14635,13 +11880,6 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -pkg-dir@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" - integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== - dependencies: - find-up "^5.0.0" - pkg-up@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" @@ -14654,7 +11892,7 @@ pngjs@^3.0.0, pngjs@^3.3.0, pngjs@^3.3.3: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== -pnp-webpack-plugin@1.6.4, pnp-webpack-plugin@^1.6.4: +pnp-webpack-plugin@1.6.4: version "1.6.4" resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz#c9711ac4dc48a685dabafc86f8b6dd9f8df84149" integrity sha512-7Wjy+9E3WwLOEL30D+m8TSTF7qJJUJLONBnwQp0518siuMxUQUbgZwssaFX+QKlZkjHZcw/IpZCt/H0srrntSg== @@ -14675,13 +11913,6 @@ polished@^3.3.2: dependencies: "@babel/runtime" "^7.12.5" -polished@^4.0.5: - version "4.1.1" - resolved "https://registry.yarnpkg.com/polished/-/polished-4.1.1.tgz#40442cc973348e466f2918cdf647531bb6c29bfb" - integrity sha512-4MZTrfPMPRLD7ac8b+2JZxei58zw6N1hFkdBDERif5Tlj19y3vPoPusrLG+mJIlPTGnUlKw3+yWz0BazvMx1vg== - dependencies: - "@babel/runtime" "^7.12.5" - portfinder@^1.0.26: version "1.0.28" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778" @@ -14856,7 +12087,7 @@ postcss-env-function@^2.0.2: postcss "^7.0.2" postcss-values-parser "^2.0.0" -postcss-flexbugs-fixes@4.2.1, postcss-flexbugs-fixes@^4.2.1: +postcss-flexbugs-fixes@4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.2.1.tgz#9218a65249f30897deab1033aced8578562a6690" integrity sha512-9SiofaZ9CWpQWxOwRh1b/r85KD5y7GgvsNt1056k6OYLvWUun0czCvogfJgylC22uJTwW1KzY3Gz65NZRlvoiQ== @@ -14933,17 +12164,6 @@ postcss-loader@3.0.0: postcss-load-config "^2.0.0" schema-utils "^1.0.0" -postcss-loader@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-4.2.0.tgz#f6993ea3e0f46600fb3ee49bbd010448123a7db4" - integrity sha512-mqgScxHqbiz1yxbnNcPdKYo/6aVt+XExURmEbQlviFVWogDbM4AJ0A/B+ZBpYsJrTRxKw7HyRazg9x0Q9SWwLA== - dependencies: - cosmiconfig "^7.0.0" - klona "^2.0.4" - loader-utils "^2.0.0" - schema-utils "^3.0.0" - semver "^7.3.4" - postcss-logical@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-3.0.0.tgz#2495d0f8b82e9f262725f75f9401b34e7b45d5b5" @@ -15027,7 +12247,7 @@ postcss-modules-extract-imports@^2.0.0: dependencies: postcss "^7.0.5" -postcss-modules-local-by-default@^3.0.2, postcss-modules-local-by-default@^3.0.3: +postcss-modules-local-by-default@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz#bb14e0cc78279d504dbdcbfd7e0ca28993ffbbb0" integrity sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw== @@ -15356,7 +12576,7 @@ postcss@7.0.21: source-map "^0.6.1" supports-color "^6.1.0" -postcss@^7, postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.35, postcss@^7.0.5, postcss@^7.0.6: +postcss@^7, postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: version "7.0.35" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24" integrity sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg== @@ -15411,12 +12631,12 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.1.2, prettier@^2.2.1, prettier@~2.2.1: +prettier@^2.1.2, prettier@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== -pretty-bytes@^5.3.0, pretty-bytes@^5.6.0: +pretty-bytes@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== @@ -15449,18 +12669,6 @@ pretty-format@^26.6.0, pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" -pretty-hrtime@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" - integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= - -prismjs@^1.21.0, prismjs@~1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.23.0.tgz#d3b3967f7d72440690497652a9d40ff046067f33" - integrity sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA== - optionalDependencies: - clipboard "^2.0.0" - private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -15494,27 +12702,6 @@ promise-to-callback@^1.0.0: is-fn "^1.0.0" set-immediate-shim "^1.0.1" -promise.allsettled@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/promise.allsettled/-/promise.allsettled-1.0.4.tgz#65e71f2a604082ed69c548b68603294090ee6803" - integrity sha512-o73CbvQh/OnPFShxHcHxk0baXR2a1m4ozb85ha0H14VEoi/EJJLa9mnPfEWJx9RjA9MLfhdjZ8I6HhWtBa64Ag== - dependencies: - array.prototype.map "^1.0.3" - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - get-intrinsic "^1.0.2" - iterate-value "^1.0.2" - -promise.prototype.finally@^3.1.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/promise.prototype.finally/-/promise.prototype.finally-3.1.2.tgz#b8af89160c9c673cefe3b4c4435b53cfd0287067" - integrity sha512-A2HuJWl2opDH0EafgdjwEw7HysI8ff/n4lW4QEVBCUXFk9QeGecBWv0Deph0UmLe3tTNYegz8MOjsVuE6SMoJA== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.0" - function-bind "^1.1.1" - promise@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/promise/-/promise-8.1.0.tgz#697c25c3dfe7435dd79fcd58c38a135888eaf05e" @@ -15530,7 +12717,7 @@ prompts@2.4.0: kleur "^3.0.3" sisteransi "^1.0.5" -prompts@^2.0.1, prompts@^2.4.0: +prompts@^2.0.1: version "2.4.1" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" integrity sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ== @@ -15538,7 +12725,7 @@ prompts@^2.0.1, prompts@^2.4.0: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.0.0, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -15547,13 +12734,6 @@ prop-types@^15.0.0, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.0, object-assign "^4.1.1" react-is "^16.8.1" -property-information@^5.0.0, property-information@^5.3.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" - integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== - dependencies: - xtend "^4.0.0" - proxy-addr@~2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" @@ -15659,7 +12839,7 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== -qs@^6.10.0, qs@^6.9.4: +qs@^6.9.4: version "6.10.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== @@ -15720,21 +12900,11 @@ raf@^3.4.1: dependencies: performance-now "^2.1.0" -ramda@^0.21.0: - version "0.21.0" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.21.0.tgz#a001abedb3ff61077d4ff1d577d44de77e8d0a35" - integrity sha1-oAGr7bP/YQd9T/HVd9RN536NCjU= - -ramda@^0.27.1, ramda@~0.27.1: +ramda@^0.27.1: version "0.27.1" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw== -ramda@~0.26.1: - version "0.26.1" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" - integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== - randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -15777,14 +12947,6 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" -raw-loader@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.2.tgz#1aac6b7d1ad1501e66efdac1522c73e59a584eb6" - integrity sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA== - dependencies: - loader-utils "^2.0.0" - schema-utils "^3.0.0" - rc@^1.0.1, rc@^1.1.6: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -15814,11 +12976,6 @@ react-clientside-effect@^1.2.2: dependencies: "@babel/runtime" "^7.12.13" -react-colorful@^5.0.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/react-colorful/-/react-colorful-5.1.2.tgz#5cb1506b8f9104b88d02d34984a36c2d1e477e9e" - integrity sha512-FRt9jz6xjiPqQ6bIAQ26kd0oJhHbGBwsA4BDz/F8FDCFuQJDiEl0wVUARNiqRyvQjwfKuhM42P/bMYI0l92hRw== - react-confetti@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/react-confetti/-/react-confetti-6.0.1.tgz#d4f57b5a021dd908a6243b8f63b6009b00818d10" @@ -15863,36 +13020,6 @@ react-device-detect@^1.6.2: dependencies: ua-parser-js "^0.7.24" -react-docgen-typescript-plugin@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/react-docgen-typescript-plugin/-/react-docgen-typescript-plugin-0.6.3.tgz#664b22601df083597ecb1e60bd21beca60125fdf" - integrity sha512-av1S/fmWBNFGgNa4qtkidFjjOz23eEi6EdCtwSWo9WNhGzUMyMygbD/DosMWoeFlZpk9R3MXPkRE7PDH6j5GMQ== - dependencies: - debug "^4.1.1" - endent "^2.0.1" - micromatch "^4.0.2" - react-docgen-typescript "^1.20.5" - tslib "^2.0.0" - -react-docgen-typescript@^1.20.5: - version "1.22.0" - resolved "https://registry.yarnpkg.com/react-docgen-typescript/-/react-docgen-typescript-1.22.0.tgz#00232c8e8e47f4437cac133b879b3e9437284bee" - integrity sha512-MPLbF8vzRwAG3GcjdL+OHQlhgtWsLTXs+7uJiHfEeT3Ur7IsZaNYqRTLQ9sj2nB6M6jylcPCeCmH7qbszJmecg== - -react-docgen@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/react-docgen/-/react-docgen-5.3.1.tgz#940b519646a6c285c2950b96512aed59e8f90934" - integrity sha512-YG7YujVTwlLslr2Ny8nQiUfbBuEwKsLHJdQTSdEga1eY/nRFh/7LjCWUn6ogYhu2WDKg4z+6W/BJtUi+DPUIlA== - dependencies: - "@babel/core" "^7.7.5" - "@babel/runtime" "^7.7.6" - ast-types "^0.14.2" - commander "^2.19.0" - doctrine "^3.0.0" - neo-async "^2.6.1" - node-dir "^0.1.10" - strip-indent "^3.0.0" - react-dom@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" @@ -15902,28 +13029,12 @@ react-dom@^17.0.1: object-assign "^4.1.1" scheduler "^0.20.2" -react-draggable@^4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.4.3.tgz#0727f2cae5813e36b0e4962bf11b2f9ef2b406f3" - integrity sha512-jV4TE59MBuWm7gb6Ns3Q1mxX8Azffb7oTtDtBgFkxRvhDp38YAARmRplrj0+XGkhOJB5XziArX+4HUUABtyZ0w== - dependencies: - classnames "^2.2.5" - prop-types "^15.6.0" - -react-element-to-jsx-string@^14.3.2: - version "14.3.2" - resolved "https://registry.yarnpkg.com/react-element-to-jsx-string/-/react-element-to-jsx-string-14.3.2.tgz#c0000ed54d1f8b4371731b669613f2d4e0f63d5c" - integrity sha512-WZbvG72cjLXAxV7VOuSzuHEaI3RHj10DZu8EcKQpkKcAj7+qAkG5XUeSdX5FXrA0vPrlx0QsnAzZEBJwzV0e+w== - dependencies: - "@base2/pretty-print-object" "1.0.0" - is-plain-object "3.0.1" - react-error-overlay@^6.0.9: version "6.0.9" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew== -react-fast-compare@^3.0.1, react-fast-compare@^3.2.0: +react-fast-compare@^3.0.1: version "3.2.0" resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb" integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA== @@ -15948,20 +13059,9 @@ react-focus-lock@^2.3.1: use-sidecar "^1.0.1" react-ga@^2.5.7: - version "2.7.0" - resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-2.7.0.tgz#24328f157f31e8cffbf4de74a3396536679d8d7c" - integrity sha512-AjC7UOZMvygrWTc2hKxTDvlMXEtbmA0IgJjmkhgmQQ3RkXrWR11xEagLGFGaNyaPnmg24oaIiaNPnEoftUhfXA== - -react-helmet-async@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.0.9.tgz#5b9ed2059de6b4aab47f769532f9fbcbce16c5ca" - integrity sha512-N+iUlo9WR3/u9qGMmP4jiYfaD6pe9IvDTapZLFJz2D3xlTlCM1Bzy4Ab3g72Nbajo/0ZyW+W9hdz8Hbe4l97pQ== - dependencies: - "@babel/runtime" "^7.12.5" - invariant "^2.2.4" - prop-types "^15.7.2" - react-fast-compare "^3.2.0" - shallowequal "^1.1.0" + version "2.7.0" + resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-2.7.0.tgz#24328f157f31e8cffbf4de74a3396536679d8d7c" + integrity sha512-AjC7UOZMvygrWTc2hKxTDvlMXEtbmA0IgJjmkhgmQQ3RkXrWR11xEagLGFGaNyaPnmg24oaIiaNPnEoftUhfXA== react-i18next@^10.7.0: version "10.13.2" @@ -15971,30 +13071,16 @@ react-i18next@^10.7.0: "@babel/runtime" "^7.3.1" html-parse-stringify2 "2.0.1" -react-inspector@^5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/react-inspector/-/react-inspector-5.1.1.tgz#58476c78fde05d5055646ed8ec02030af42953c8" - integrity sha512-GURDaYzoLbW8pMGXwYPDBIv6nqei4kK7LPRZ9q9HCZF54wqXz/dnylBp/kfE9XmekBhHvLDdcYeyIwSrvtOiWg== - dependencies: - "@babel/runtime" "^7.0.0" - is-dom "^1.0.0" - prop-types "^15.0.0" - react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.6: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-is@^17.0.1, react-is@^17.0.2: +react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -react-lifecycles-compat@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" - integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== - react-markdown@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-4.3.1.tgz#39f0633b94a027445b86c9811142d05381300f2f" @@ -16009,16 +13095,7 @@ react-markdown@^4.3.1: unist-util-visit "^1.3.0" xtend "^4.0.1" -react-popper-tooltip@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/react-popper-tooltip/-/react-popper-tooltip-3.1.1.tgz#329569eb7b287008f04fcbddb6370452ad3f9eac" - integrity sha512-EnERAnnKRptQBJyaee5GJScWNUKQPDD2ywvzZyUjst/wj5U64C8/CnSYLNEmP2hG0IJ3ZhtDxE8oDN+KOyavXQ== - dependencies: - "@babel/runtime" "^7.12.5" - "@popperjs/core" "^2.5.4" - react-popper "^2.2.4" - -react-popper@^2.2.3, react-popper@^2.2.4: +react-popper@^2.2.3: version "2.2.5" resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-2.2.5.tgz#1214ef3cec86330a171671a4fbcbeeb65ee58e96" integrity sha512-kxGkS80eQGtLl18+uig1UIf9MKixFSyPxglsgLBxlYnyDf65BiY9B3nZSc6C9XUNDgStROB0fMQlTEz1KxGddw== @@ -16157,16 +13234,6 @@ react-scripts@^4.0.3: optionalDependencies: fsevents "^2.1.3" -react-sizeme@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/react-sizeme/-/react-sizeme-3.0.1.tgz#4d12f4244e0e6a0fb97253e7af0314dc7c83a5a0" - integrity sha512-9Hf1NLgSbny1bha77l9HwvwwxQUJxFUqi44Ih+y3evA+PezBpGdCGlnvye6avss2cIgs9PgdYgMnfuzJWn/RUw== - dependencies: - element-resize-detector "^1.2.2" - invariant "^2.2.4" - shallowequal "^1.1.0" - throttle-debounce "^3.0.1" - react-spring@^8.0.27: version "8.0.27" resolved "https://registry.yarnpkg.com/react-spring/-/react-spring-8.0.27.tgz#97d4dee677f41e0b2adcb696f3839680a3aa356a" @@ -16184,26 +13251,6 @@ react-style-singleton@^2.1.0: invariant "^2.2.4" tslib "^1.0.0" -react-syntax-highlighter@^13.5.3: - version "13.5.3" - resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-13.5.3.tgz#9712850f883a3e19eb858cf93fad7bb357eea9c6" - integrity sha512-crPaF+QGPeHNIblxxCdf2Lg936NAHKhNhuMzRL3F9ct6aYXL3NcZtCL0Rms9+qVo6Y1EQLdXGypBNSbPL/r+qg== - dependencies: - "@babel/runtime" "^7.3.1" - highlight.js "^10.1.1" - lowlight "^1.14.0" - prismjs "^1.21.0" - refractor "^3.1.0" - -react-textarea-autosize@^8.3.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.2.tgz#4f9374d357b0a6f6469956726722549124a1b2db" - integrity sha512-JrMWVgQSaExQByP3ggI1eA8zF4mF0+ddVuX7acUeK2V7bmrpjVOY72vmLz2IXFJSAXoY3D80nEzrn0GWajWK3Q== - dependencies: - "@babel/runtime" "^7.10.2" - use-composed-ref "^1.0.0" - use-latest "^1.0.0" - react-use-gesture@^6.0.14: version "6.0.14" resolved "https://registry.yarnpkg.com/react-use-gesture/-/react-use-gesture-6.0.14.tgz#ab2d35ef72a5fb6060a6160eb12568c276f8a4b1" @@ -16266,7 +13313,7 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.9, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.9, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -16369,15 +13416,6 @@ reflexbox@^4.0.6: "@styled-system/should-forward-prop" "^5.0.0" styled-system "^5.0.0" -refractor@^3.1.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.3.1.tgz#ebbc04b427ea81dc25ad333f7f67a0b5f4f0be3a" - integrity sha512-vaN6R56kLMuBszHSWlwTpcZ8KTMG6aUCok4GrxYDT20UIOXxOc5o6oDc8tNTzSlH3m2sI+Eu9Jo2kVdDcUTWYw== - dependencies: - hastscript "^6.0.0" - parse-entities "^2.0.0" - prismjs "~1.23.0" - regenerate-unicode-properties@^8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" @@ -16519,58 +13557,6 @@ relative-luminance@^2.0.0: dependencies: esm "^3.0.84" -remark-external-links@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/remark-external-links/-/remark-external-links-8.0.0.tgz#308de69482958b5d1cd3692bc9b725ce0240f345" - integrity sha512-5vPSX0kHoSsqtdftSHhIYofVINC8qmp0nctkeU9YoJwV3YfiBRiI6cbFRJ0oI/1F9xS+bopXG0m2KS8VFscuKA== - dependencies: - extend "^3.0.0" - is-absolute-url "^3.0.0" - mdast-util-definitions "^4.0.0" - space-separated-tokens "^1.0.0" - unist-util-visit "^2.0.0" - -remark-footnotes@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f" - integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ== - -remark-mdx@1.6.22: - version "1.6.22" - resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd" - integrity sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ== - dependencies: - "@babel/core" "7.12.9" - "@babel/helper-plugin-utils" "7.10.4" - "@babel/plugin-proposal-object-rest-spread" "7.12.1" - "@babel/plugin-syntax-jsx" "7.12.1" - "@mdx-js/util" "1.6.22" - is-alphabetical "1.0.4" - remark-parse "8.0.3" - unified "9.2.0" - -remark-parse@8.0.3: - version "8.0.3" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1" - integrity sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q== - dependencies: - ccount "^1.0.0" - collapse-white-space "^1.0.2" - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - is-whitespace-character "^1.0.0" - is-word-character "^1.0.0" - markdown-escapes "^1.0.0" - parse-entities "^2.0.0" - repeat-string "^1.5.4" - state-toggle "^1.0.0" - trim "0.0.1" - trim-trailing-lines "^1.0.0" - unherit "^1.0.4" - unist-util-remove-position "^2.0.0" - vfile-location "^3.0.0" - xtend "^4.0.1" - remark-parse@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" @@ -16592,22 +13578,6 @@ remark-parse@^5.0.0: vfile-location "^2.0.0" xtend "^4.0.1" -remark-slug@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/remark-slug/-/remark-slug-6.0.0.tgz#2b54a14a7b50407a5e462ac2f376022cce263e2c" - integrity sha512-ln67v5BrGKHpETnm6z6adlJPhESFJwfuZZ3jrmi+lKTzeZxh2tzFzUfDD4Pm2hRGOarHLuGToO86MNMZ/hA67Q== - dependencies: - github-slugger "^1.0.0" - mdast-util-to-string "^1.0.0" - unist-util-visit "^2.0.0" - -remark-squeeze-paragraphs@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz#76eb0e085295131c84748c8e43810159c5653ead" - integrity sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw== - dependencies: - mdast-squeeze-paragraphs "^4.0.0" - remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -16646,13 +13616,6 @@ replace-ext@1.0.0: resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= -request-progress@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-3.0.0.tgz#4ca754081c7fec63f505e4faa825aa06cd669dbe" - integrity sha1-TKdUCBx/7GP1BeT6qCWqBs1mnb4= - dependencies: - throttleit "^1.0.0" - request-promise-core@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" @@ -16783,7 +13746,7 @@ resolve@1.18.1: is-core-module "^2.0.0" path-parse "^1.0.6" -resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.3.2, resolve@^1.8.1: +resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.3.2, resolve@^1.8.1: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -16806,22 +13769,6 @@ resolve@~1.17.0: dependencies: path-parse "^1.0.6" -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" - integrity sha1-NGYfRohjJ/7SmRR5FSJS35LapUE= - dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - resumer@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" @@ -16867,7 +13814,7 @@ rgba-regex@^1.0.0: resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= -rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.3: +rimraf@^2.5.4, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -16955,18 +13902,13 @@ rustbn.js@~0.2.0: resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== -rxjs@^6.3.3, rxjs@^6.6.3: +rxjs@^6.6.3: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -safe-buffer@5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" - integrity sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg== - safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -17052,15 +13994,6 @@ scheduler@^0.20.2: loose-envify "^1.1.0" object-assign "^4.1.1" -schema-utils@2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.0.tgz#17151f76d8eae67fbbf77960c33c676ad9f4efc7" - integrity sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A== - dependencies: - "@types/json-schema" "^7.0.4" - ajv "^6.12.2" - ajv-keywords "^3.4.1" - schema-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" @@ -17070,7 +14003,7 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -schema-utils@^2.6.5, schema-utils@^2.6.6, schema-utils@^2.7.0, schema-utils@^2.7.1: +schema-utils@^2.6.5, schema-utils@^2.7.0, schema-utils@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg== @@ -17121,11 +14054,6 @@ select-hose@^2.0.0: resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= -select@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d" - integrity sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0= - selfsigned@^1.10.8: version "1.10.11" resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.11.tgz#24929cd906fe0f44b6d01fb23999a739537acbe9" @@ -17158,7 +14086,7 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: +semver@^7.2.1, semver@^7.3.2: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -17203,17 +14131,6 @@ serialize-javascript@^5.0.1: dependencies: randombytes "^2.1.0" -serve-favicon@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/serve-favicon/-/serve-favicon-2.5.0.tgz#935d240cdfe0f5805307fdfe967d88942a2cbcf0" - integrity sha1-k10kDN/g9YBTB/3+ln2IlCosvPA= - dependencies: - etag "~1.8.1" - fresh "0.5.2" - ms "2.1.1" - parseurl "~1.3.2" - safe-buffer "5.1.1" - serve-handler@6.1.3: version "6.1.3" resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.1.3.tgz#1bf8c5ae138712af55c758477533b9117f6435e8" @@ -17266,7 +14183,7 @@ serve@^11.3.2: serve-handler "6.1.3" update-check "1.5.2" -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -17309,11 +14226,6 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" -shallowequal@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" - integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -17379,21 +14291,11 @@ slash@^1.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= -slash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" - integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== - slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= - slice-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" @@ -17484,7 +14386,7 @@ source-map-support@^0.4.15: dependencies: source-map "^0.5.6" -source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.19: +source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.19: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== @@ -17517,11 +14419,6 @@ sourcemap-codec@^1.4.4: resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== -space-separated-tokens@^1.0.0: - version "1.1.5" - resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" - integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== - spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -17677,11 +14574,6 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= -store2@^2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/store2/-/store2-2.12.0.tgz#e1f1b7e1a59b6083b2596a8d067f6ee88fd4d3cf" - integrity sha512-7t+/wpKLanLzSnQPX8WAcuLCCeuSHoWdQuh9SB3xD0kNOM38DNf+0Oa+wmvxmYueRzkmh6IcdKFtvTa+ecgPDw== - stream-browserify@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" @@ -17744,16 +14636,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: +string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -17770,7 +14653,7 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: +string-width@^4.1.0, string-width@^4.2.0: version "4.2.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== @@ -17779,7 +14662,7 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -"string.prototype.matchall@^4.0.0 || ^3.0.1", string.prototype.matchall@^4.0.4: +string.prototype.matchall@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.4.tgz#608f255e93e072107f5de066f81a2dfb78cf6b29" integrity sha512-pknFIWVachNcyqRfaQSeu/FUfpvJTe4uskUSZ9Wc1RijsPuzbZ8TyYT8WCNnntCjUEqQ3vUHMAfVj2+wLAisPQ== @@ -17792,24 +14675,6 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: regexp.prototype.flags "^1.3.1" side-channel "^1.0.4" -string.prototype.padend@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz#6858ca4f35c5268ebd5e8615e1327d55f59ee311" - integrity sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - -string.prototype.padstart@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.padstart/-/string.prototype.padstart-3.1.2.tgz#f9b9ce66bedd7c06acb40ece6e34c6046e1a019d" - integrity sha512-HDpngIP3pd0DeazrfqzuBrQZa+D2arKWquEHfGt5LzVjd+roLC3cjqVI0X8foaZz5rrrhcu8oJAQamW8on9dqw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - string.prototype.trim@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.4.tgz#6014689baf5efaf106ad031a5fa45157666ed1bd" @@ -17926,13 +14791,6 @@ strip-hex-prefix@1.0.0: dependencies: is-hex-prefixed "1.0.0" -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -17943,7 +14801,7 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -style-loader@1.3.0, style-loader@^1.3.0: +style-loader@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.3.0.tgz#828b4a3b3b7e7aa5847ce7bae9e874512114249e" integrity sha512-V7TCORko8rs9rIqkSrlMfkqA63DfoGBBJmK1kKGCcSi+BWb4cqz0SRsnp4l6rU5iwOEd0/2ePv68SV22VXon4Q== @@ -17951,13 +14809,6 @@ style-loader@1.3.0, style-loader@^1.3.0: loader-utils "^2.0.0" schema-utils "^2.7.0" -style-to-object@0.3.0, style-to-object@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" - integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== - dependencies: - inline-style-parser "0.1.1" - styled-components@^4.2.0: version "4.4.1" resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.4.1.tgz#e0631e889f01db67df4de576fedaca463f05c2f2" @@ -18041,13 +14892,6 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - supports-hyperlinks@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" @@ -18080,7 +14924,7 @@ svgo@^1.0.0, svgo@^1.2.2: unquote "~1.1.1" util.promisify "~1.0.0" -symbol-observable@^1.1.0, symbol-observable@^1.2.0: +symbol-observable@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== @@ -18090,16 +14934,6 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -symbol.prototype.description@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/symbol.prototype.description/-/symbol.prototype.description-1.0.4.tgz#c30edd3fe8c040d941cf7dc15842be15adf66855" - integrity sha512-fZkHwJ8ZNRVRzF/+/2OtygyyH06CjC0YZAQRHu9jKKw8RXlJpbizEHvGRUu22Qkg182wJk1ugb5Aovcv3UPrww== - dependencies: - call-bind "^1.0.2" - es-abstract "^1.18.0-next.2" - has-symbols "^1.0.1" - object.getownpropertydescriptors "^2.1.2" - table@^6.0.4: version "6.3.0" resolved "https://registry.yarnpkg.com/table/-/table-6.3.0.tgz#b88c2be1ae7d318638cc064b2c0604baffec79f1" @@ -18153,20 +14987,6 @@ tar@^6.0.2: mkdirp "^1.0.3" yallist "^4.0.0" -telejson@^5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/telejson/-/telejson-5.1.1.tgz#fd83b594ebddfaeb9a5c4b9660c302fc07c9a65c" - integrity sha512-aU7x+nwodmODJPXhU9sC/REOcX/dx1tNbyeOFV1PCTh6e9Mj+bnyfQ7sr13zfJYya9BtpGwnUNn9Fd76Ybj2eg== - dependencies: - "@types/is-function" "^1.0.0" - global "^4.4.0" - is-function "^1.0.2" - is-regex "^1.1.2" - is-symbol "^1.0.3" - isobject "^4.0.0" - lodash "^4.17.21" - memoizerific "^1.11.3" - temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" @@ -18188,11 +15008,6 @@ term-size@^1.2.0: dependencies: execa "^0.7.0" -term-size@^2.1.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" - integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== - terminal-link@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" @@ -18231,22 +15046,7 @@ terser-webpack-plugin@^1.4.3: webpack-sources "^1.4.0" worker-farm "^1.7.0" -terser-webpack-plugin@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-3.1.0.tgz#91e6d39571460ed240c0cf69d295bcf30ebf98cb" - integrity sha512-cjdZte66fYkZ65rQ2oJfrdCAkkhJA7YLYk5eGOcGCSGlq0ieZupRdjedSQXYknMPo2IveQL+tPdrxUkERENCFA== - dependencies: - cacache "^15.0.5" - find-cache-dir "^3.3.1" - jest-worker "^26.2.1" - p-limit "^3.0.2" - schema-utils "^2.6.6" - serialize-javascript "^4.0.0" - source-map "^0.6.1" - terser "^4.8.0" - webpack-sources "^1.4.3" - -terser@^4.1.2, terser@^4.6.2, terser@^4.6.3, terser@^4.8.0: +terser@^4.1.2, terser@^4.6.2, terser@^4.6.3: version "4.8.0" resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== @@ -18291,16 +15091,6 @@ throat@^5.0.0: resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== -throttle-debounce@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-3.0.1.tgz#32f94d84dfa894f786c9a1f290e7a645b6a19abb" - integrity sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg== - -throttleit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" - integrity sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw= - through2@^2.0.0, through2@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" @@ -18336,11 +15126,6 @@ timsort@^0.3.0: resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= -tiny-emitter@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423" - integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q== - tiny-invariant@^1.0.2, tiny-invariant@^1.0.6, tiny-invariant@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875" @@ -18356,20 +15141,6 @@ tinycolor2@^1.4.1: resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.2.tgz#3f6a4d1071ad07676d7fa472e1fac40a719d8803" integrity sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA== -tmp@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" - integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw== - dependencies: - rimraf "^2.6.3" - -tmp@~0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" - integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== - dependencies: - rimraf "^3.0.0" - tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -18486,16 +15257,6 @@ tryer@^1.0.1: resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== -ts-dedent@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-2.1.1.tgz#6dd56870bb5493895171334fa5d7e929107e5bbc" - integrity sha512-riHuwnzAUCfdIeTBNUq7+Yj+ANnrMXo/7+Z74dIdudS7ys2k8aSGMzpJRMFDF7CLwUTbtvi1ZZff/Wl+XxmqIA== - -ts-essentials@^2.0.3: - version "2.0.12" - resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz#c9303f3d74f75fa7528c3d49b80e089ab09d8745" - integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w== - ts-essentials@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.1.tgz#d205508cae0cdadfb73c89503140cf2228389e2d" @@ -18521,7 +15282,7 @@ tslib@^1.0.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3: +tslib@^2.0.0, tslib@^2.0.3: version "2.2.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c" integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w== @@ -18686,11 +15447,6 @@ unbox-primitive@^1.0.0: has-symbols "^1.0.2" which-boxed-primitive "^1.0.2" -unfetch@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" - integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== - unherit@^1.0.4: version "1.1.3" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" @@ -18722,18 +15478,6 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== -unified@9.2.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.0.tgz#67a62c627c40589edebbf60f53edfd4d822027f8" - integrity sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg== - dependencies: - bail "^1.0.0" - extend "^3.0.0" - is-buffer "^2.0.0" - is-plain-obj "^2.0.0" - trough "^1.0.0" - vfile "^4.0.0" - unified@^6.1.5: version "6.2.0" resolved "https://registry.yarnpkg.com/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba" @@ -18787,31 +15531,11 @@ unique-string@^1.0.0: dependencies: crypto-random-string "^1.0.0" -unist-builder@2.0.3, unist-builder@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" - integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== - -unist-util-generated@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" - integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== - unist-util-is@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A== -unist-util-is@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" - integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== - -unist-util-position@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" - integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== - unist-util-remove-position@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz#ec037348b6102c897703eee6d0294ca4755a2020" @@ -18819,32 +15543,11 @@ unist-util-remove-position@^1.0.0: dependencies: unist-util-visit "^1.1.0" -unist-util-remove-position@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz#5d19ca79fdba712301999b2b73553ca8f3b352cc" - integrity sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA== - dependencies: - unist-util-visit "^2.0.0" - -unist-util-remove@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unist-util-remove/-/unist-util-remove-2.1.0.tgz#b0b4738aa7ee445c402fda9328d604a02d010588" - integrity sha512-J8NYPyBm4baYLdCbjmf1bhPu45Cr1MWTm77qd9istEkzWpnN6O9tMsEbB2JhNnBCqGENRqEWomQ+He6au0B27Q== - dependencies: - unist-util-is "^4.0.0" - unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== -unist-util-stringify-position@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" - integrity sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g== - dependencies: - "@types/unist" "^2.0.2" - unist-util-visit-parents@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-1.1.2.tgz#f6e3afee8bdbf961c0e6f028ea3c0480028c3d06" @@ -18857,23 +15560,6 @@ unist-util-visit-parents@^2.0.0: dependencies: unist-util-is "^3.0.0" -unist-util-visit-parents@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" - integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - -unist-util-visit@2.0.3, unist-util-visit@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" - integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" - unist-util-visit@^1.1.0, unist-util-visit@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" @@ -18896,7 +15582,7 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= -unquote@^1.1.0, unquote@~1.1.1: +unquote@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unquote/-/unquote-1.1.1.tgz#8fded7324ec6e88a0ff8b905e7c098cdc086d544" integrity sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ= @@ -18909,11 +15595,6 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" -untildify@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" - integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== - upath@^1.1.1, upath@^1.1.2, upath@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" @@ -18939,7 +15620,7 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= -url-loader@4.1.1, url-loader@^4.1.1: +url-loader@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-4.1.1.tgz#28505e905cae158cf07c92ca622d7f237e70a4e2" integrity sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA== @@ -18969,13 +15650,6 @@ use-callback-ref@^1.2.1, use-callback-ref@^1.2.3: resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.2.5.tgz#6115ed242cfbaed5915499c0a9842ca2912f38a5" integrity sha512-gN3vgMISAgacF7sqsLPByqoePooY3n2emTH59Ur5d/M8eg4WTWu1xp8i8DHjohftIyEx0S08RiYxbffr4j8Peg== -use-composed-ref@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/use-composed-ref/-/use-composed-ref-1.1.0.tgz#9220e4e94a97b7b02d7d27eaeab0b37034438bbc" - integrity sha512-my1lNHGWsSDAhhVAT4MKs6IjBUtG6ZG11uUqexPH9PptiIZDQOzaF4f5tEbJ2+7qvNbtXNBbU3SfmN+fXlWDhg== - dependencies: - ts-essentials "^2.0.3" - use-count-up@^2.2.5: version "2.3.1" resolved "https://registry.yarnpkg.com/use-count-up/-/use-count-up-2.3.1.tgz#e6045f07b47d99ebcc626dd0aa50d475f2e7f48e" @@ -18988,18 +15662,6 @@ use-elapsed-time@^2.1.6: resolved "https://registry.yarnpkg.com/use-elapsed-time/-/use-elapsed-time-2.1.7.tgz#65f2bd1b6f6cb7fd06f302eb820c22b96ff09311" integrity sha512-Kz0lzfiCzL36Uro5vBfhW9FzCMJ6UWNleYFjKPQaZ/hvtYShTcKD7EFyGGgcIsuX9/KVe25fgTTlEaGWf6EzNA== -use-isomorphic-layout-effect@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.1.tgz#7bb6589170cd2987a152042f9084f9effb75c225" - integrity sha512-L7Evj8FGcwo/wpbv/qvSfrkHFtOpCzvM5yl2KVyDJoylVuSvzphiiasmjgQPttIGBAy2WKiBNR98q8w7PiNgKQ== - -use-latest@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/use-latest/-/use-latest-1.2.0.tgz#a44f6572b8288e0972ec411bdd0840ada366f232" - integrity sha512-d2TEuG6nSLKQLAfW3By8mKr8HurOlTkul0sOpxbClIv4SQ4iOd7BYr7VIzdbktUCnv7dua/60xzd8igMU6jmyw== - dependencies: - use-isomorphic-layout-effect "^1.0.0" - use-sidecar@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.0.5.tgz#ffff2a17c1df42e348624b699ba6e5c220527f2b" @@ -19067,11 +15729,6 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid-browser@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/uuid-browser/-/uuid-browser-3.1.0.tgz#0f05a40aef74f9e5951e20efbf44b11871e56410" - integrity sha1-DwWkCu90+eWVHiDvv0SxGHHlZBA= - uuid@^3.3.2, uuid@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -19138,11 +15795,6 @@ vfile-location@^2.0.0: resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.6.tgz#8a274f39411b8719ea5728802e10d9e0dff1519e" integrity sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA== -vfile-location@^3.0.0, vfile-location@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c" - integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA== - vfile-message@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" @@ -19150,14 +15802,6 @@ vfile-message@^1.0.0: dependencies: unist-util-stringify-position "^1.1.1" -vfile-message@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a" - integrity sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ== - dependencies: - "@types/unist" "^2.0.0" - unist-util-stringify-position "^2.0.0" - vfile@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" @@ -19168,16 +15812,6 @@ vfile@^2.0.0: unist-util-stringify-position "^1.0.0" vfile-message "^1.0.0" -vfile@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-4.2.1.tgz#03f1dce28fc625c625bc6514350fbdb00fa9e624" - integrity sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA== - dependencies: - "@types/unist" "^2.0.0" - is-buffer "^2.0.0" - unist-util-stringify-position "^2.0.0" - vfile-message "^2.0.0" - vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" @@ -19188,14 +15822,6 @@ void-elements@^2.0.1: resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= -vue-template-compiler@^2.6.11: - version "2.6.12" - resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.12.tgz#947ed7196744c8a5285ebe1233fe960437fcc57e" - integrity sha512-OzzZ52zS41YUbkCBfdXShQTe69j1gQDZ9HIX8miuC9C3rBCk9wIRjLiZZLrmX9V+Ftq/YEyv1JaVr5Y/hNtByg== - dependencies: - de-indent "^1.0.2" - he "^1.1.0" - w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" @@ -19283,11 +15909,6 @@ wcag-contrast@^3.0.0: dependencies: relative-luminance "^2.0.0" -web-namespaces@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" - integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== - web3-provider-engine@16.0.1: version "16.0.1" resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-16.0.1.tgz#2600a39ede364cdc0a1fc773bf40a94f2177e605" @@ -19326,7 +15947,7 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== -webpack-dev-middleware@^3.7.2, webpack-dev-middleware@^3.7.3: +webpack-dev-middleware@^3.7.2: version "3.7.3" resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz#0639372b143262e2b84ab95d3b91a7597061c2c5" integrity sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ== @@ -19376,21 +15997,6 @@ webpack-dev-server@3.11.1: ws "^6.2.1" yargs "^13.3.2" -webpack-filter-warnings-plugin@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/webpack-filter-warnings-plugin/-/webpack-filter-warnings-plugin-1.2.1.tgz#dc61521cf4f9b4a336fbc89108a75ae1da951cdb" - integrity sha512-Ez6ytc9IseDMLPo0qCuNNYzgtUl8NovOqjIq4uAU8LTD4uoa1w1KpZyyzFtLTEMZpkkOkLfL9eN+KGYdk1Qtwg== - -webpack-hot-middleware@^2.25.0: - version "2.25.0" - resolved "https://registry.yarnpkg.com/webpack-hot-middleware/-/webpack-hot-middleware-2.25.0.tgz#4528a0a63ec37f8f8ef565cf9e534d57d09fe706" - integrity sha512-xs5dPOrGPCzuRXNi8F6rwhawWvQQkeli5Ro48PRuQh8pYPCPmNnltP9itiUPT4xI8oW+y0m59lyyeQk54s5VgA== - dependencies: - ansi-html "0.0.7" - html-entities "^1.2.0" - querystring "^0.2.0" - strip-ansi "^3.0.0" - webpack-log@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" @@ -19417,42 +16023,6 @@ webpack-sources@^1.1.0, webpack-sources@^1.3.0, webpack-sources@^1.4.0, webpack- source-list-map "^2.0.0" source-map "~0.6.1" -webpack-virtual-modules@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.2.2.tgz#20863dc3cb6bb2104729fff951fbe14b18bd0299" - integrity sha512-kDUmfm3BZrei0y+1NTHJInejzxfhtU8eDj2M7OKb2IWrPFAeO1SOH2KuQ68MSZu9IGEHcxbkKKR1v18FrUSOmA== - dependencies: - debug "^3.0.0" - -webpack@4: - version "4.46.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.46.0.tgz#bf9b4404ea20a073605e0a011d188d77cb6ad542" - integrity sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-module-context" "1.9.0" - "@webassemblyjs/wasm-edit" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" - acorn "^6.4.1" - ajv "^6.10.2" - ajv-keywords "^3.4.1" - chrome-trace-event "^1.0.2" - enhanced-resolve "^4.5.0" - eslint-scope "^4.0.3" - json-parse-better-errors "^1.0.2" - loader-runner "^2.4.0" - loader-utils "^1.2.3" - memory-fs "^0.4.1" - micromatch "^3.1.10" - mkdirp "^0.5.3" - neo-async "^2.6.1" - node-libs-browser "^2.2.1" - schema-utils "^1.0.0" - tapable "^1.1.3" - terser-webpack-plugin "^1.4.3" - watchpack "^1.7.4" - webpack-sources "^1.4.1" - webpack@4.44.2: version "4.44.2" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.44.2.tgz#6bfe2b0af055c8b2d1e90ed2cd9363f841266b72" @@ -19557,13 +16127,6 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - widest-line@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" @@ -19571,13 +16134,6 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" -widest-line@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" - integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== - dependencies: - string-width "^4.0.0" - window-getters@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/window-getters/-/window-getters-1.0.0.tgz#b5b264538c4c79cead027f9997850222bf6d0852" @@ -19802,14 +16358,6 @@ worker-rpc@^0.1.0: dependencies: microevent.ts "~0.1.1" -wrap-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" - integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" @@ -20008,20 +16556,7 @@ yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yauzl@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -zwitch@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== From 97ae287c1e7afafaeb3201c3f3c26ca7d05702c0 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Wed, 25 Dec 2024 14:49:38 +0300 Subject: [PATCH 07/30] feat: add our tokens --- package.json | 3 - .../ThemeColorPalette.stories.tsx | 14 -- src/components/Toggle/MultiToggle.stories.tsx | 35 ---- src/constants/tokens.ts | 37 ++++ yarn.lock | 178 +----------------- 5 files changed, 47 insertions(+), 220 deletions(-) delete mode 100644 src/components/ThemeColorPalette/ThemeColorPalette.stories.tsx delete mode 100644 src/components/Toggle/MultiToggle.stories.tsx diff --git a/package.json b/package.json index ca54291dd92..29fa6f706d3 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,6 @@ "rebass": "^4.0.7", "redux-localstorage-simple": "^2.3.1", "serve": "^11.3.2", - "start-server-and-test": "^1.11.0", "styled-components": "^4.2.0", "styled-system": "^5.1.5", "typechain": "^5.0.0", @@ -115,10 +114,8 @@ "compile-v3-core-contract-types": "npx typechain --target ethers-v5 --out-dir src/types/v3 \"./node_modules/@uniswap/v3-core/artifacts/contracts/**/*.json\"", "compile-v3-periphery-contract-types": "npx typechain --target ethers-v5 --out-dir src/types/v3 \"./node_modules/@uniswap/v3-periphery/artifacts/contracts/**/*.json\"", "build": "yarn compile-contract-types && react-scripts build", - "integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run'", "postinstall": "yarn compile-contract-types", "start": "yarn compile-contract-types && react-scripts start", - "storybook": "start-storybook -p 6006", "test": "react-scripts test --env=jsdom" }, "eslintConfig": { diff --git a/src/components/ThemeColorPalette/ThemeColorPalette.stories.tsx b/src/components/ThemeColorPalette/ThemeColorPalette.stories.tsx deleted file mode 100644 index f63a8e43157..00000000000 --- a/src/components/ThemeColorPalette/ThemeColorPalette.stories.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { Story } from '@storybook/react/types-6-0' -import React from 'react' -import Component from './index' - -export default { - title: 'ThemeColorPalette', -} - -const Template: Story = (_args: any, context: Record) => { - const isDarkMode = context.globals.theme === 'dark' - return -} - -export const Palette = Template.bind({}) diff --git a/src/components/Toggle/MultiToggle.stories.tsx b/src/components/Toggle/MultiToggle.stories.tsx deleted file mode 100644 index 5c2838e5428..00000000000 --- a/src/components/Toggle/MultiToggle.stories.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { Story } from '@storybook/react/types-6-0' -import styled from 'styled-components/macro' -import React, { useState } from 'react' -import MultiToggle from './MultiToggle' - -const wrapperCss = styled.main` - font-size: 2em; - margin: 3em; - max-width: 300px; -` - -export default { - title: 'Toggles', - argTypes: { - width: { control: { type: 'string' } }, - }, - decorators: [ - (Component: Story) => ( -
- -
- ), - ], -} - -export const MultiToggleExample = () => { - const [active, setActive] = useState(0) - - function doSomethingWithIndex(index: number) { - // here's where youd update state based on index choice - // switch(index){} ... - setActive(index) - } - return -} diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index f6f43b3f03f..ea641f2568b 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -4,8 +4,29 @@ import { UNI_ADDRESS } from './addresses' export const AMPL = new Token(ChainId.MAINNET, '0xD46bA6D942050d489DBd938a2C909A5d5039A161', 9, 'AMPL', 'Ampleforth') export const DAI = new Token(ChainId.MAINNET, '0x6B175474E89094C44Da98b954EedeAC495271d0F', 18, 'DAI', 'Dai Stablecoin') export const USDC = new Token(ChainId.MAINNET, '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 6, 'USDC', 'USD//C') +export const USDC_POLYGON_AMOY = new Token( + ChainId.POLYGON_AMOY, + '0x24BD3A3EeabC51f11Ff724F4D0ed4b52569952c2', + 6, + 'USDC', + 'USD Coin' +) export const USDT = new Token(ChainId.MAINNET, '0xdAC17F958D2ee523a2206206994597C13D831ec7', 6, 'USDT', 'Tether USD') +export const USDT_POLYGON_AMOY = new Token( + ChainId.POLYGON_AMOY, + '0xF0602a35Fd6895bd62cDB4158BaC82689490afCE', + 6, + 'USDT', + 'Tether USD' +) export const WBTC = new Token(ChainId.MAINNET, '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', 8, 'WBTC', 'Wrapped BTC') +export const WBTC_POLYGON_AMOY = new Token( + ChainId.POLYGON_AMOY, + '0xDcaA4611e721ce9a06D568A0E45dfbBA161A28BA', + 8, + 'WBTC', + 'Wrapped BTC' +) export const FEI = new Token(ChainId.MAINNET, '0x956F47F50A910163D8BF957Cf5846D573E7f87CA', 18, 'FEI', 'Fei USD') export const TRIBE = new Token(ChainId.MAINNET, '0xc7283b66Eb1EB5FB86327f08e1B5816b0720212B', 18, 'TRIBE', 'Tribe') export const FRAX = new Token(ChainId.MAINNET, '0x853d955aCEf822Db058eb8505911ED77F175b99e', 18, 'FRAX', 'Frax') @@ -29,3 +50,19 @@ export const UNI: { [chainId in ChainId]: Token } = { [ChainId.KOVAN]: new Token(ChainId.KOVAN, UNI_ADDRESS[ChainId.KOVAN], 18, 'UNI', 'Uniswap'), [ChainId.POLYGON_AMOY]: new Token(ChainId.POLYGON_AMOY, UNI_ADDRESS[ChainId.POLYGON_AMOY], 18, 'UNI', 'Uniswap'), } + +export const METALAMP = new Token( + ChainId.POLYGON_AMOY, + '0x9d88cEdB5E1E7B09Df99e70580Fd36253Cd0690D', + 18, + 'METALAMP', + 'MetaLamp fun' +) +export const BNB = new Token(ChainId.POLYGON_AMOY, '0xF61C6c1F4866C1296E2d239e9AEb20036272C3DD', 18, 'BNB', 'BNB') +export const SHIBA = new Token( + ChainId.POLYGON_AMOY, + '0x36fE2Bdb44f043034cb45A83C514a93a50b10489', + 18, + 'SHIB', + 'SHIBA INU' +) diff --git a/yarn.lock b/yarn.lock index f200d9b166e..64eca8e8e01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1747,11 +1747,6 @@ resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06" integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== -"@hapi/hoek@^9.0.0": - version "9.2.0" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.0.tgz#f3933a44e365864f4dad5db94158106d511e8131" - integrity sha512-sqKVVVOe5ivCaXDWivIJYVSaEgdQK9ul7a4Kity5Iw7u9+wBAPbX1RMSnLLmp7O4Vzj0WOWwMAJsTL00xwaNug== - "@hapi/joi@^15.1.0": version "15.1.1" resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.1.tgz#c675b8a71296f02833f8d6d243b34c57b8ce19d7" @@ -1769,13 +1764,6 @@ dependencies: "@hapi/hoek" "^8.3.0" -"@hapi/topo@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.0.0.tgz#c19af8577fa393a06e9c77b60995af959be721e7" - integrity sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw== - dependencies: - "@hapi/hoek" "^9.0.0" - "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2308,23 +2296,6 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@sideway/address@^4.1.0": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.1.tgz#9e321e74310963fdf8eebfbee09c7bd69972de4d" - integrity sha512-+I5aaQr3m0OAmMr7RQ3fR9zx55sejEYR2BFJaxL+zT3VM2611X0SHvPWIbAUBZVTn/YzYKbV8gJ2oT/QELknfQ== - dependencies: - "@hapi/hoek" "^9.0.0" - -"@sideway/formula@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c" - integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg== - -"@sideway/pinpoint@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" - integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== - "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -4067,13 +4038,6 @@ axios@^0.18.0: follow-redirects "1.5.10" is-buffer "^2.0.2" -axios@^0.21.1: - version "0.21.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== - dependencies: - follow-redirects "^1.10.0" - axobject-query@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" @@ -4917,7 +4881,7 @@ blakejs@^1.1.0: resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= -bluebird@3.7.2, bluebird@^3.5.5: +bluebird@^3.5.5: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -5443,11 +5407,6 @@ character-reference-invalid@^1.0.0: resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== -check-more-types@2.24.0: - version "2.24.0" - resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" - integrity sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA= - check-types@^11.1.1: version "11.1.2" resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.1.2.tgz#86a7c12bf5539f6324eb0e70ca8896c0e38f3e2f" @@ -6315,13 +6274,6 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6. dependencies: ms "2.0.0" -debug@4.3.1, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - debug@=3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -6336,6 +6288,13 @@ debug@^3.1.1, debug@^3.2.6: dependencies: ms "^2.1.1" +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -6711,7 +6670,7 @@ drbg.js@^1.0.1: create-hash "^1.1.2" create-hmac "^1.1.4" -duplexer@^0.1.1, duplexer@~0.1.1: +duplexer@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== @@ -7608,19 +7567,6 @@ eve-raphael@0.5.0: resolved "https://registry.yarnpkg.com/eve-raphael/-/eve-raphael-0.5.0.tgz#17c754b792beef3fa6684d79cf5a47c63c4cda30" integrity sha1-F8dUt5K+7z+maE15z1pHxjxM2jA= -event-stream@=3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - integrity sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE= - dependencies: - duplexer "~0.1.1" - from "~0" - map-stream "~0.1.0" - pause-stream "0.0.11" - split "0.3" - stream-combiner "~0.0.4" - through "~2.3.1" - eventemitter3@4.0.7, eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -7651,22 +7597,6 @@ exec-sh@^0.3.2: resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== -execa@3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" - integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - p-finally "^2.0.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -8095,11 +8025,6 @@ follow-redirects@^1.0.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== -follow-redirects@^1.10.0: - version "1.13.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267" - integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA== - for-each@~0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -8171,11 +8096,6 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" -from@~0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" - integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= - fs-extra@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -9986,17 +9906,6 @@ jest@26.6.0: import-local "^3.0.2" jest-cli "^26.6.0" -joi@^17.3.0: - version "17.4.0" - resolved "https://registry.yarnpkg.com/joi/-/joi-17.4.0.tgz#b5c2277c8519e016316e49ababd41a1908d9ef20" - integrity sha512-F4WiW2xaV6wc1jxete70Rw4V/VuMd6IN+a5ilZsxG4uYtUXWu2kq9W5P2dz30e7Gmw8RCbY/u/uk+dMPma9tAg== - dependencies: - "@hapi/hoek" "^9.0.0" - "@hapi/topo" "^5.0.0" - "@sideway/address" "^4.1.0" - "@sideway/formula" "^3.0.0" - "@sideway/pinpoint" "^2.0.0" - jpeg-js@0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.2.tgz#8b345b1ae4abde64c2da2fe67ea216a114ac279d" @@ -10314,11 +10223,6 @@ last-call-webpack-plugin@^3.0.0: lodash "^4.17.5" webpack-sources "^1.1.0" -lazy-ass@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" - integrity sha1-eZllXoZGwX8In90YfRUNMyTVRRM= - level-codec@~7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" @@ -10631,11 +10535,6 @@ map-cache@^0.2.2: resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" - integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= - map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" @@ -11502,11 +11401,6 @@ p-finally@^1.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= -p-finally@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" - integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== - p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -11775,13 +11669,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" - integrity sha1-/lo0sMvOErWqaitAPuLnO2AvFEU= - dependencies: - through "~2.3" - pbkdf2@^3.0.17, pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" @@ -12747,13 +12634,6 @@ prr@~1.0.1: resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= -ps-tree@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" - integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== - dependencies: - event-stream "=3.3.4" - pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -14480,13 +14360,6 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - integrity sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8= - dependencies: - through "2" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -14538,19 +14411,6 @@ stackframe@^1.1.1: resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.2.0.tgz#52429492d63c62eb989804c11552e3d22e779303" integrity sha512-GrdeshiRmS1YLMYgzF16olf2jJ/IzxXY9lhKOskuVziubpTYcYqyOwYeJKzQkwy7uN0fYSsbsC4RQaXf9LCrYA== -start-server-and-test@^1.11.0: - version "1.12.1" - resolved "https://registry.yarnpkg.com/start-server-and-test/-/start-server-and-test-1.12.1.tgz#bf84eb5c5a4c8a98b93ed36519035b3f76179f0e" - integrity sha512-qGQ2HQiF2yDIfyaHsXkHfoE5UOl4zJUbJ/gx2xOkfX7iPMXW9qHmoFyaMfIDJVLNkxCK7RxSrvWEI9hNVKQluw== - dependencies: - bluebird "3.7.2" - check-more-types "2.24.0" - debug "4.3.1" - execa "3.4.0" - lazy-ass "1.6.0" - ps-tree "1.2.0" - wait-on "5.3.0" - state-toggle@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" @@ -14582,13 +14442,6 @@ stream-browserify@^2.0.1: inherits "~2.0.1" readable-stream "^2.0.2" -stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" - integrity sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ= - dependencies: - duplexer "~0.1.1" - stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" @@ -15099,7 +14952,7 @@ through2@^2.0.0, through2@^2.0.3: readable-stream "~2.3.6" xtend "~4.0.1" -through@2, through@~2.3, through@~2.3.1, through@~2.3.4, through@~2.3.8: +through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -15836,17 +15689,6 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" -wait-on@5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-5.3.0.tgz#584e17d4b3fe7b46ac2b9f8e5e102c005c2776c7" - integrity sha512-DwrHrnTK+/0QFaB9a8Ol5Lna3k7WvUR4jzSKmz0YaPBpuN2sACyiPVKVfj6ejnjcajAcvn3wlbTyMIn9AZouOg== - dependencies: - axios "^0.21.1" - joi "^17.3.0" - lodash "^4.17.21" - minimist "^1.2.5" - rxjs "^6.6.3" - walker@^1.0.7, walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" From a34e5bc3693698e8820ae2c3151f80b19fdb217c Mon Sep 17 00:00:00 2001 From: alagunoff Date: Wed, 25 Dec 2024 16:03:49 +0300 Subject: [PATCH 08/30] - feat: set METALAMP as a default token to swap; populate list of tokens for polygon amoy chain - refactor: replace library for taking default tokens list from with a local json --- package.json | 1 - src/components/SearchModal/CommonBases.tsx | 14 +- src/components/SearchModal/CurrencySearch.tsx | 25 +- .../SearchModal/CurrencySearchModal.tsx | 2 + src/constants/lists.ts | 4 +- src/constants/routing.ts | 22 +- .../tokenLists/uniswap-default.tokenlist.json | 470 ++++++++++++++++++ src/state/lists/hooks.ts | 2 +- src/state/swap/hooks.ts | 4 +- yarn.lock | 5 - 10 files changed, 505 insertions(+), 44 deletions(-) create mode 100644 src/constants/tokenLists/uniswap-default.tokenlist.json diff --git a/package.json b/package.json index 29fa6f706d3..0b78a99814a 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "@types/wcag-contrast": "^3.0.0", "@typescript-eslint/eslint-plugin": "^4.1.0", "@typescript-eslint/parser": "^4.1.0", - "@uniswap/default-token-list": "^2.0.0", "@uniswap/governance": "^1.0.2", "@uniswap/liquidity-staker": "^1.0.2", "@uniswap/merkle-distributor": "1.0.1", diff --git a/src/components/SearchModal/CommonBases.tsx b/src/components/SearchModal/CommonBases.tsx index 8f829bae231..62ec76a04bd 100644 --- a/src/components/SearchModal/CommonBases.tsx +++ b/src/components/SearchModal/CommonBases.tsx @@ -43,21 +43,9 @@ export default function CommonBases({ - { - if (!selectedCurrency || !currencyEquals(selectedCurrency, ETHER)) { - onSelect(ETHER) - } - }} - disable={selectedCurrency?.isEther} - > - - - ETH - - {(typeof chainId === 'number' ? SUGGESTED_BASES[chainId] ?? [] : []).map((token: Token) => { const selected = selectedCurrency?.isToken && selectedCurrency.address === token.address + return ( !selected && onSelect(token)} disable={selected} key={token.address}> diff --git a/src/components/SearchModal/CurrencySearch.tsx b/src/components/SearchModal/CurrencySearch.tsx index 804339631e5..814f747614f 100644 --- a/src/components/SearchModal/CurrencySearch.tsx +++ b/src/components/SearchModal/CurrencySearch.tsx @@ -1,4 +1,4 @@ -import { Currency, ETHER, Token } from '../../libs/sdk-core' +import { Currency, Token } from '../../libs/sdk-core' import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react' import ReactGA from 'react-ga' import { useTranslation } from 'react-i18next' @@ -106,14 +106,6 @@ export function CurrencySearch({ const filteredSortedTokens = useSortedTokensByQuery(sortedTokens, debouncedQuery) - const filteredSortedTokensWithETH: Currency[] = useMemo(() => { - const s = debouncedQuery.toLowerCase().trim() - if (s === '' || s === 'e' || s === 'et' || s === 'eth') { - return [ETHER, ...filteredSortedTokens] - } - return filteredSortedTokens - }, [debouncedQuery, filteredSortedTokens]) - const handleCurrencySelect = useCallback( (currency: Currency) => { onCurrencySelect(currency) @@ -139,20 +131,17 @@ export function CurrencySearch({ const handleEnter = useCallback( (e: KeyboardEvent) => { if (e.key === 'Enter') { - const s = debouncedQuery.toLowerCase().trim() - if (s === 'eth') { - handleCurrencySelect(ETHER) - } else if (filteredSortedTokensWithETH.length > 0) { + if (filteredSortedTokens.length > 0) { if ( - filteredSortedTokensWithETH[0].symbol?.toLowerCase() === debouncedQuery.trim().toLowerCase() || - filteredSortedTokensWithETH.length === 1 + filteredSortedTokens[0].symbol?.toLowerCase() === debouncedQuery.trim().toLowerCase() || + filteredSortedTokens.length === 1 ) { - handleCurrencySelect(filteredSortedTokensWithETH[0]) + handleCurrencySelect(filteredSortedTokens[0]) } } } }, - [filteredSortedTokensWithETH, handleCurrencySelect, debouncedQuery] + [filteredSortedTokens, handleCurrencySelect, debouncedQuery] ) // menu ui @@ -201,7 +190,7 @@ export function CurrencySearch({ {({ height }) => ( (CurrencyModalView.manage) const lastOpen = useLast(isOpen) @@ -75,6 +76,7 @@ export default function CurrencySearchModal({ showImportView={() => setModalView(CurrencyModalView.importToken)} setImportToken={setImportToken} showManageView={() => setModalView(CurrencyModalView.manage)} + showCommonBases={showCommonBases} /> ) : modalView === CurrencyModalView.importToken && importToken ? ( = { [ChainId.MAINNET]: [DAI, USDC, USDT, WBTC], + [ChainId.POLYGON_AMOY]: [METALAMP, USDT_POLYGON_AMOY, USDC_POLYGON_AMOY, WBTC_POLYGON_AMOY], } // used to construct the list of all pairs we consider by default in the frontend export const BASES_TO_TRACK_LIQUIDITY_FOR: ChainTokenList = { diff --git a/src/constants/tokenLists/uniswap-default.tokenlist.json b/src/constants/tokenLists/uniswap-default.tokenlist.json new file mode 100644 index 00000000000..1ce2a70ec45 --- /dev/null +++ b/src/constants/tokenLists/uniswap-default.tokenlist.json @@ -0,0 +1,470 @@ +{ + "name": "Uniswap Default List", + "timestamp": "2021-01-21T23:57:10.982Z", + "version": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "tags": {}, + "logoURI": "ipfs://QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir", + "keywords": ["uniswap", "default"], + "tokens": [ + { + "chainId": 1, + "address": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9", + "name": "Aave", + "symbol": "AAVE", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/12645/thumb/AAVE.png?1601374110" + }, + { + "chainId": 1, + "address": "0xfF20817765cB7f73d4bde2e66e067E58D11095C2", + "name": "Amp", + "symbol": "AMP", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/12409/thumb/amp-200x200.png?1599625397" + }, + { + "name": "Aragon Network Token", + "address": "0x960b236A07cf122663c4303350609A66A7B288C0", + "symbol": "ANT", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x960b236A07cf122663c4303350609A66A7B288C0/logo.png" + }, + { + "name": "Balancer", + "address": "0xba100000625a3754423978a60c9317c58a424e3D", + "symbol": "BAL", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xba100000625a3754423978a60c9317c58a424e3D/logo.png" + }, + { + "chainId": 1, + "address": "0xBA11D00c5f74255f56a5E366F4F77f5A186d7f55", + "name": "Band Protocol", + "symbol": "BAND", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/9545/thumb/band-protocol.png?1568730326" + }, + { + "name": "Bancor Network Token", + "address": "0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C", + "symbol": "BNT", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C/logo.png" + }, + { + "name": "Compound", + "address": "0xc00e94Cb662C3520282E6f5717214004A7f26888", + "symbol": "COMP", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xc00e94Cb662C3520282E6f5717214004A7f26888/logo.png" + }, + { + "name": "Curve DAO Token", + "address": "0xD533a949740bb3306d119CC777fa900bA034cd52", + "symbol": "CRV", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xD533a949740bb3306d119CC777fa900bA034cd52/logo.png" + }, + { + "chainId": 1, + "address": "0x41e5560054824eA6B0732E656E3Ad64E20e94E45", + "name": "Civic", + "symbol": "CVC", + "decimals": 8, + "logoURI": "https://assets.coingecko.com/coins/images/788/thumb/civic.png?1547034556" + }, + { + "name": "Dai Stablecoin", + "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F", + "symbol": "DAI", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png" + }, + { + "chainId": 1, + "address": "0x0AbdAce70D3790235af448C88547603b945604ea", + "name": "district0x", + "symbol": "DNT", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/849/thumb/district0x.png?1547223762" + }, + { + "name": "Gnosis Token", + "address": "0x6810e776880C02933D47DB1b9fc05908e5386b96", + "symbol": "GNO", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6810e776880C02933D47DB1b9fc05908e5386b96/logo.png" + }, + { + "chainId": 1, + "address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7", + "name": "The Graph", + "symbol": "GRT", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/13397/thumb/Graph_Token.png?1608145566" + }, + { + "chainId": 1, + "address": "0x85Eee30c52B0b379b046Fb0F85F4f3Dc3009aFEC", + "name": "Keep Network", + "symbol": "KEEP", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/3373/thumb/IuNzUb5b_400x400.jpg?1589526336" + }, + { + "name": "Kyber Network Crystal", + "address": "0xdd974D5C2e2928deA5F71b9825b8b646686BD200", + "symbol": "KNC", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdd974D5C2e2928deA5F71b9825b8b646686BD200/logo.png" + }, + { + "name": "ChainLink Token", + "address": "0x514910771AF9Ca656af840dff83E8264EcF986CA", + "symbol": "LINK", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x514910771AF9Ca656af840dff83E8264EcF986CA/logo.png" + }, + { + "name": "Loom Network", + "address": "0xA4e8C3Ec456107eA67d3075bF9e3DF3A75823DB0", + "symbol": "LOOM", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA4e8C3Ec456107eA67d3075bF9e3DF3A75823DB0/logo.png" + }, + { + "name": "LoopringCoin V2", + "address": "0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD", + "symbol": "LRC", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD/logo.png" + }, + { + "chainId": 1, + "address": "0x0F5D2fB29fb7d3CFeE444a200298f468908cC942", + "name": "Decentraland", + "symbol": "MANA", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/878/thumb/decentraland-mana.png?1550108745" + }, + { + "name": "Maker", + "address": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2", + "symbol": "MKR", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2/logo.png" + }, + { + "chainId": 1, + "address": "0xec67005c4E498Ec7f55E092bd1d35cbC47C91892", + "name": "Melon", + "symbol": "MLN", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/605/thumb/melon.png?1547034295" + }, + { + "name": "Numeraire", + "address": "0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671", + "symbol": "NMR", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671/logo.png" + }, + { + "chainId": 1, + "address": "0x4fE83213D56308330EC302a8BD641f1d0113A4Cc", + "name": "NuCypher", + "symbol": "NU", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/3318/thumb/photo1198982838879365035.jpg?1547037916" + }, + { + "name": "Orchid", + "address": "0x4575f41308EC1483f3d399aa9a2826d74Da13Deb", + "symbol": "OXT", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x4575f41308EC1483f3d399aa9a2826d74Da13Deb/logo.png" + }, + { + "name": "Republic Token", + "address": "0x408e41876cCCDC0F92210600ef50372656052a38", + "symbol": "REN", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x408e41876cCCDC0F92210600ef50372656052a38/logo.png" + }, + { + "name": "Reputation Augur v1", + "address": "0x1985365e9f78359a9B6AD760e32412f4a445E862", + "symbol": "REP", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1985365e9f78359a9B6AD760e32412f4a445E862/logo.png" + }, + { + "name": "Reputation Augur v2", + "address": "0x221657776846890989a759BA2973e427DfF5C9bB", + "symbol": "REPv2", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x221657776846890989a759BA2973e427DfF5C9bB/logo.png" + }, + { + "name": "Synthetix Network Token", + "address": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F", + "symbol": "SNX", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F/logo.png" + }, + { + "name": "Storj Token", + "address": "0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC", + "symbol": "STORJ", + "decimals": 8, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC/logo.png" + }, + { + "chainId": 1, + "address": "0x8dAEBADE922dF735c38C80C7eBD708Af50815fAa", + "name": "tBTC", + "symbol": "TBTC", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/11224/thumb/tBTC.png?1589620754" + }, + { + "name": "UMA Voting Token v1", + "address": "0x04Fa0d235C4abf4BcF4787aF4CF447DE572eF828", + "symbol": "UMA", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x04Fa0d235C4abf4BcF4787aF4CF447DE572eF828/logo.png" + }, + { + "name": "Uniswap", + "address": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", + "symbol": "UNI", + "decimals": 18, + "chainId": 1, + "logoURI": "ipfs://QmXttGpZrECX5qCyXbBQiqgQNytVGeZW5Anewvh2jc4psg" + }, + { + "name": "USDCoin", + "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "symbol": "USDC", + "decimals": 6, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" + }, + { + "name": "Tether USD", + "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", + "symbol": "USDT", + "decimals": 6, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png" + }, + { + "name": "Wrapped BTC", + "address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", + "symbol": "WBTC", + "decimals": 8, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png" + }, + { + "name": "Wrapped Ether", + "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "symbol": "WETH", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png" + }, + { + "chainId": 1, + "address": "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e", + "name": "yearn finance", + "symbol": "YFI", + "decimals": 18, + "logoURI": "https://assets.coingecko.com/coins/images/11849/thumb/yfi-192x192.png?1598325330" + }, + { + "name": "0x Protocol Token", + "address": "0xE41d2489571d322189246DaFA5ebDe1F4699F498", + "symbol": "ZRX", + "decimals": 18, + "chainId": 1, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xE41d2489571d322189246DaFA5ebDe1F4699F498/logo.png" + }, + { + "name": "Dai Stablecoin", + "address": "0xaD6D458402F60fD3Bd25163575031ACDce07538D", + "symbol": "DAI", + "decimals": 18, + "chainId": 3, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xaD6D458402F60fD3Bd25163575031ACDce07538D/logo.png" + }, + { + "name": "Uniswap", + "address": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", + "symbol": "UNI", + "decimals": 18, + "chainId": 3, + "logoURI": "ipfs://QmXttGpZrECX5qCyXbBQiqgQNytVGeZW5Anewvh2jc4psg" + }, + { + "name": "Wrapped Ether", + "address": "0xc778417E063141139Fce010982780140Aa0cD5Ab", + "symbol": "WETH", + "decimals": 18, + "chainId": 3, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xc778417E063141139Fce010982780140Aa0cD5Ab/logo.png" + }, + { + "name": "Dai Stablecoin", + "address": "0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735", + "symbol": "DAI", + "decimals": 18, + "chainId": 4, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735/logo.png" + }, + { + "name": "Maker", + "address": "0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85", + "symbol": "MKR", + "decimals": 18, + "chainId": 4, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85/logo.png" + }, + { + "name": "Uniswap", + "address": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", + "symbol": "UNI", + "decimals": 18, + "chainId": 4, + "logoURI": "ipfs://QmXttGpZrECX5qCyXbBQiqgQNytVGeZW5Anewvh2jc4psg" + }, + { + "name": "Wrapped Ether", + "address": "0xc778417E063141139Fce010982780140Aa0cD5Ab", + "symbol": "WETH", + "decimals": 18, + "chainId": 4, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xc778417E063141139Fce010982780140Aa0cD5Ab/logo.png" + }, + { + "name": "Uniswap", + "address": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", + "symbol": "UNI", + "decimals": 18, + "chainId": 5, + "logoURI": "ipfs://QmXttGpZrECX5qCyXbBQiqgQNytVGeZW5Anewvh2jc4psg" + }, + { + "name": "Wrapped Ether", + "address": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", + "symbol": "WETH", + "decimals": 18, + "chainId": 5, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6/logo.png" + }, + { + "name": "Dai Stablecoin", + "address": "0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa", + "symbol": "DAI", + "decimals": 18, + "chainId": 42, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa/logo.png" + }, + { + "name": "Maker", + "address": "0xAaF64BFCC32d0F15873a02163e7E500671a4ffcD", + "symbol": "MKR", + "decimals": 18, + "chainId": 42, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xAaF64BFCC32d0F15873a02163e7E500671a4ffcD/logo.png" + }, + { + "name": "Uniswap", + "address": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", + "symbol": "UNI", + "decimals": 18, + "chainId": 42, + "logoURI": "ipfs://QmXttGpZrECX5qCyXbBQiqgQNytVGeZW5Anewvh2jc4psg" + }, + { + "name": "Wrapped Ether", + "address": "0xd0A1E359811322d97991E03f863a0C30C2cF029C", + "symbol": "WETH", + "decimals": 18, + "chainId": 42, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xd0A1E359811322d97991E03f863a0C30C2cF029C/logo.png" + }, + { + "chainId": 80002, + "address": "0x9d88cEdB5E1E7B09Df99e70580Fd36253Cd0690D", + "name": "MetaLamp fun", + "symbol": "METALAMP", + "decimals": 18, + "logoURI": "https://avatars.githubusercontent.com/u/21096588?s=200&v=4" + }, + { + "chainId": 80002, + "address": "0xF61C6c1F4866C1296E2d239e9AEb20036272C3DD", + "name": "BNB", + "symbol": "BNB", + "decimals": 18, + "logoURI": "https://etherscan.io/token/images/binancebnb_32.svg" + }, + { + "chainId": 80002, + "address": "0x36fE2Bdb44f043034cb45A83C514a93a50b10489", + "name": "SHIBA INU", + "symbol": "SHIB", + "decimals": 18, + "logoURI": "https://etherscan.io/token/images/shibainu_ofc_32.svg" + }, + { + "chainId": 80002, + "address": "0x24BD3A3EeabC51f11Ff724F4D0ed4b52569952c2", + "name": "USD Coin", + "symbol": "USDC", + "decimals": 6, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" + }, + { + "chainId": 80002, + "address": "0xF0602a35Fd6895bd62cDB4158BaC82689490afCE", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png" + }, + { + "chainId": 80002, + "address": "0xDcaA4611e721ce9a06D568A0E45dfbBA161A28BA", + "name": "Wrapped BTC", + "symbol": "WBTC", + "decimals": 8, + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png" + } + ] +} diff --git a/src/state/lists/hooks.ts b/src/state/lists/hooks.ts index 1d7072eb617..b709c818aa2 100644 --- a/src/state/lists/hooks.ts +++ b/src/state/lists/hooks.ts @@ -1,4 +1,4 @@ -import DEFAULT_TOKEN_LIST from '@uniswap/default-token-list' +import DEFAULT_TOKEN_LIST from '../../constants/tokenLists/uniswap-default.tokenlist.json' import { ChainId } from '../../libs/sdk-core' import { TokenList } from '@uniswap/token-lists' import { useMemo } from 'react' diff --git a/src/state/swap/hooks.ts b/src/state/swap/hooks.ts index cc775fe69bc..d556d3dd57d 100644 --- a/src/state/swap/hooks.ts +++ b/src/state/swap/hooks.ts @@ -253,8 +253,8 @@ export function queryParametersToSwapState(parsedQs: ParsedQs): SwapState { let inputCurrency = parseCurrencyFromURLParameter(parsedQs.inputCurrency) let outputCurrency = parseCurrencyFromURLParameter(parsedQs.outputCurrency) if (inputCurrency === '' && outputCurrency === '') { - // default to ETH input - inputCurrency = 'ETH' + // default to METALAMP input + inputCurrency = '0x9d88cEdB5E1E7B09Df99e70580Fd36253Cd0690D' } else if (inputCurrency === outputCurrency) { // clear output if identical outputCurrency = '' diff --git a/yarn.lock b/yarn.lock index 64eca8e8e01..67221379f58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3103,11 +3103,6 @@ "@typescript-eslint/types" "4.23.0" eslint-visitor-keys "^2.0.0" -"@uniswap/default-token-list@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@uniswap/default-token-list/-/default-token-list-2.0.0.tgz#095b4c22635e532c817c3ba70e8838d8bd699716" - integrity sha512-P37PqBtUjEB9DIRFfmEsgougkV0555JQKiGPISeN9UFk1UgCQM5sg6+bBaShiyaqEpdtttAaBFI1QESCzPGvXw== - "@uniswap/governance@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@uniswap/governance/-/governance-1.0.2.tgz#7371ab54dea9a5c045275001e2d5325ff2c11a93" From c184d3739929ce39bd3c85c564338e2b7032fd46 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Wed, 25 Dec 2024 17:17:01 +0300 Subject: [PATCH 09/30] feat: change default chain; change rpc url for polygon amoy --- src/connectors/index.ts | 4 ++-- src/constants/addresses.ts | 9 ++++++++- src/state/multicall/updater.tsx | 1 + src/state/wallet/hooks.ts | 1 - 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/connectors/index.ts b/src/connectors/index.ts index 74fc3e9c259..d3c85d631c2 100644 --- a/src/connectors/index.ts +++ b/src/connectors/index.ts @@ -26,7 +26,7 @@ export const NETWORK_URLS: { [key in SupportedChainId]: string } = { [SupportedChainId.ROPSTEN]: `https://ropsten.infura.io/v3/${INFURA_KEY}`, [SupportedChainId.GOERLI]: `https://goerli.infura.io/v3/${INFURA_KEY}`, [SupportedChainId.KOVAN]: `https://kovan.infura.io/v3/${INFURA_KEY}`, - [SupportedChainId.POLYGON_AMOY]: `https://polygon-amoy.drpc.org`, + [SupportedChainId.POLYGON_AMOY]: 'https://rpc-amoy.polygon.technology', } const SUPPORTED_CHAIN_IDS = [ @@ -40,7 +40,7 @@ const SUPPORTED_CHAIN_IDS = [ export const network = new NetworkConnector({ urls: NETWORK_URLS, - defaultChainId: ChainId.MAINNET, + defaultChainId: ChainId.POLYGON_AMOY, }) let networkLibrary: Web3Provider | undefined diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 44eb0b9ce97..8f7ea20033c 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -3,7 +3,14 @@ import { FACTORY_ADDRESS as V3_FACTORY_ADDRESS } from '@uniswap/v3-sdk' import { constructSameAddressMap } from '../utils/constructSameAddressMap' export const UNI_ADDRESS = constructSameAddressMap('0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984') -export const MULTICALL2_ADDRESSES = constructSameAddressMap('0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696') +export const MULTICALL2_ADDRESSES = { + [ChainId.MAINNET]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', + [ChainId.ROPSTEN]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', + [ChainId.RINKEBY]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', + [ChainId.GÖRLI]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', + [ChainId.KOVAN]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', + [ChainId.POLYGON_AMOY]: '0xA06b60533A29a208fBc614272E23bbAf00879B41', +} export const V2_ROUTER_ADDRESS = constructSameAddressMap('0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D') export const GOVERNANCE_ADDRESS = constructSameAddressMap('0x5e4be8Bc9637f0EAA1A755019e06A68ce081D58F') export const TIMELOCK_ADDRESS = constructSameAddressMap('0x1a9C8182C09F50C8318d769245beA52c32BE35BC') diff --git a/src/state/multicall/updater.tsx b/src/state/multicall/updater.tsx index 1d3673997a1..03be922d0f0 100644 --- a/src/state/multicall/updater.tsx +++ b/src/state/multicall/updater.tsx @@ -48,6 +48,7 @@ async function fetchChunk( console.debug(`Fetched results for old block number: ${resultsBlockNumber.toString()} vs. ${minBlockNumber}`) throw new RetryableError('Fetched for old block number') } + return { results, blockNumber: resultsBlockNumber } } diff --git a/src/state/wallet/hooks.ts b/src/state/wallet/hooks.ts index 6ba147f2f85..0f43b5bdfc4 100644 --- a/src/state/wallet/hooks.ts +++ b/src/state/wallet/hooks.ts @@ -113,7 +113,6 @@ export function useCurrencyBalances( const tokens = useMemo(() => currencies?.filter((currency): currency is Token => currency?.isToken ?? false) ?? [], [ currencies, ]) - const tokenBalances = useTokenBalances(account, tokens) const containsETH: boolean = useMemo(() => currencies?.some((currency) => currency?.isEther) ?? false, [currencies]) const ethBalance = useETHBalances(containsETH ? [account] : []) From 76c2e550426441f9f4fa81f54a5c2b3737e35aff Mon Sep 17 00:00:00 2001 From: alagunoff Date: Thu, 26 Dec 2024 11:39:26 +0300 Subject: [PATCH 10/30] feat: remove polygon amoy from displaying when connected --- src/components/Header/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 6755f205766..838a4d2a446 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -306,7 +306,6 @@ const NETWORK_LABELS: { [chainId in ChainId]?: string } = { [ChainId.ROPSTEN]: 'Ropsten', [ChainId.GÖRLI]: 'Görli', [ChainId.KOVAN]: 'Kovan', - [ChainId.POLYGON_AMOY]: 'Polygon Amoy', } export default function Header() { From 7db964035b181dc96620b3eee699c348acc39d8d Mon Sep 17 00:00:00 2001 From: alagunoff Date: Thu, 26 Dec 2024 12:34:35 +0300 Subject: [PATCH 11/30] fix: change multicall2 contract's address for polygon amoy --- src/constants/addresses.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 8f7ea20033c..27c5e44e6f4 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -9,7 +9,7 @@ export const MULTICALL2_ADDRESSES = { [ChainId.RINKEBY]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', [ChainId.GÖRLI]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', [ChainId.KOVAN]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', - [ChainId.POLYGON_AMOY]: '0xA06b60533A29a208fBc614272E23bbAf00879B41', + [ChainId.POLYGON_AMOY]: '0xAc84922226D254Ec01Ad731F3094214940E61f2c', } export const V2_ROUTER_ADDRESS = constructSameAddressMap('0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D') export const GOVERNANCE_ADDRESS = constructSameAddressMap('0x5e4be8Bc9637f0EAA1A755019e06A68ce081D58F') From 6fe7aca16ddc94fc727f37bbe002810747008df9 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Thu, 26 Dec 2024 12:37:54 +0300 Subject: [PATCH 12/30] fix: add correct link to block explorer for polygon amoy --- src/utils/getExplorerLink.ts | 37 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/utils/getExplorerLink.ts b/src/utils/getExplorerLink.ts index 4565dbeb4e8..94ff701b29f 100644 --- a/src/utils/getExplorerLink.ts +++ b/src/utils/getExplorerLink.ts @@ -1,12 +1,12 @@ import { ChainId } from '../libs/sdk-core' -const ETHERSCAN_PREFIXES: { [chainId in ChainId]: string } = { - 1: '', - 3: 'ropsten.', - 4: 'rinkeby.', - 5: 'goerli.', - 42: 'kovan.', - 80002: 'polygon-amoy.', +const CHAIN_ID_TO_PREFIX: { [chainId in ChainId]: string } = { + 1: 'https://etherscan.io', + 3: 'https://ropsten.etherscan.io', + 4: 'https://rinkeby.etherscan.io', + 5: 'https://goerli.etherscan.io', + 42: 'https://kovan.etherscan.io', + 80002: 'https://amoy.polygonscan.com', } export enum ExplorerDataType { @@ -23,21 +23,14 @@ export enum ExplorerDataType { * @param type the type of the data */ export function getExplorerLink(chainId: ChainId, data: string, type: ExplorerDataType): string { - const prefix = `https://${ETHERSCAN_PREFIXES[chainId] || ETHERSCAN_PREFIXES[1]}etherscan.io` - switch (type) { - case ExplorerDataType.TRANSACTION: { - return `${prefix}/tx/${data}` - } - case ExplorerDataType.TOKEN: { - return `${prefix}/token/${data}` - } - case ExplorerDataType.BLOCK: { - return `${prefix}/block/${data}` - } - case ExplorerDataType.ADDRESS: - default: { - return `${prefix}/address/${data}` - } + case ExplorerDataType.TRANSACTION: + return `${CHAIN_ID_TO_PREFIX[chainId]}/tx/${data}` + case ExplorerDataType.TOKEN: + return `${CHAIN_ID_TO_PREFIX[chainId]}/token/${data}` + case ExplorerDataType.BLOCK: + return `${CHAIN_ID_TO_PREFIX[chainId]}/block/${data}` + default: + return `${CHAIN_ID_TO_PREFIX[chainId]}/address/${data}` } } From 04464e1b1f10494f99df8f743dedc08d1c90ae58 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Thu, 26 Dec 2024 12:40:30 +0300 Subject: [PATCH 13/30] chore: use abstract name for block explorer --- src/components/AccountDetails/index.tsx | 4 ++-- src/components/AddressInputPanel/index.tsx | 2 +- src/components/ModalViews/index.tsx | 2 +- src/components/Popups/TransactionPopup.tsx | 2 +- src/components/TransactionConfirmationModal/index.tsx | 2 +- src/components/claim/AddressClaimModal.tsx | 2 +- src/components/claim/ClaimModal.tsx | 2 +- src/components/vote/VoteModal.tsx | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/AccountDetails/index.tsx b/src/components/AccountDetails/index.tsx index 6fff3119b3e..9b1fd4454bc 100644 --- a/src/components/AccountDetails/index.tsx +++ b/src/components/AccountDetails/index.tsx @@ -357,7 +357,7 @@ export default function AccountDetails({ href={chainId && getExplorerLink(chainId, ENSName, ExplorerDataType.ADDRESS)} > - View on Etherscan + View on Block explorer )} @@ -379,7 +379,7 @@ export default function AccountDetails({ href={getExplorerLink(chainId, account, ExplorerDataType.ADDRESS)} > - View on Etherscan + View on Block explorer )} diff --git a/src/components/AddressInputPanel/index.tsx b/src/components/AddressInputPanel/index.tsx index c4f2d65bfeb..6a2b94e5a30 100644 --- a/src/components/AddressInputPanel/index.tsx +++ b/src/components/AddressInputPanel/index.tsx @@ -106,7 +106,7 @@ export default function AddressInputPanel({ href={getExplorerLink(chainId, name ?? address, ExplorerDataType.ADDRESS)} style={{ fontSize: '14px' }} > - (View on Etherscan) + (View on Block explorer) )}
diff --git a/src/components/ModalViews/index.tsx b/src/components/ModalViews/index.tsx index f300ffdd827..891173adfd4 100644 --- a/src/components/ModalViews/index.tsx +++ b/src/components/ModalViews/index.tsx @@ -66,7 +66,7 @@ export function SubmittedView({ href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} style={{ marginLeft: '4px' }} > - View transaction on Etherscan + View transaction on Block explorer )} diff --git a/src/components/Popups/TransactionPopup.tsx b/src/components/Popups/TransactionPopup.tsx index 40258170655..006df7e3604 100644 --- a/src/components/Popups/TransactionPopup.tsx +++ b/src/components/Popups/TransactionPopup.tsx @@ -34,7 +34,7 @@ export default function TransactionPopup({ {summary ?? 'Hash: ' + hash.slice(0, 8) + '...' + hash.slice(58, 65)} {chainId && ( - View on Etherscan + View on Block explorer )} diff --git a/src/components/TransactionConfirmationModal/index.tsx b/src/components/TransactionConfirmationModal/index.tsx index 7a77a399154..eb91c6a9c3d 100644 --- a/src/components/TransactionConfirmationModal/index.tsx +++ b/src/components/TransactionConfirmationModal/index.tsx @@ -115,7 +115,7 @@ export function TransactionSubmittedContent({ {chainId && hash && ( - View on Etherscan + View on Block explorer )} diff --git a/src/components/claim/AddressClaimModal.tsx b/src/components/claim/AddressClaimModal.tsx index c9f8ef4439b..fe903b347d4 100644 --- a/src/components/claim/AddressClaimModal.tsx +++ b/src/components/claim/AddressClaimModal.tsx @@ -183,7 +183,7 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole )} {attempting && hash && !claimConfirmed && chainId && hash && ( - View transaction on Etherscan + View transaction on Block explorer )} diff --git a/src/components/claim/ClaimModal.tsx b/src/components/claim/ClaimModal.tsx index 9b07a117b74..ad67b9f8f55 100644 --- a/src/components/claim/ClaimModal.tsx +++ b/src/components/claim/ClaimModal.tsx @@ -202,7 +202,7 @@ export default function ClaimModal() { href={getExplorerLink(chainId, claimTxn?.hash, ExplorerDataType.TRANSACTION)} style={{ zIndex: 99 }} > - View transaction on Etherscan + View transaction on Block explorer )} diff --git a/src/components/vote/VoteModal.tsx b/src/components/vote/VoteModal.tsx index 0c013ac5909..f8b27694c43 100644 --- a/src/components/vote/VoteModal.tsx +++ b/src/components/vote/VoteModal.tsx @@ -137,7 +137,7 @@ export default function VoteModal({ isOpen, onDismiss, proposalId, support }: Vo href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} style={{ marginLeft: '4px' }} > - View transaction on Etherscan + View transaction on Block explorer )} From 3edbd3b39f0a5cf5949d5a5aeef15183d9730c00 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Thu, 26 Dec 2024 13:17:53 +0300 Subject: [PATCH 14/30] fix: revert deleting eth from tokens --- src/components/Header/index.tsx | 2 +- src/components/SearchModal/CommonBases.tsx | 13 ++++++++++ src/components/SearchModal/CurrencySearch.tsx | 25 +++++++++++++------ src/state/swap/hooks.ts | 4 +-- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 838a4d2a446..4fd430f4ec7 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -384,7 +384,7 @@ export default function Header() { {account && userEthBalance ? ( - {userEthBalance?.toSignificant(4)} ETH + {userEthBalance?.toSignificant(4)} {chainId === 80002 ? 'POL' : 'ETH'} ) : null} diff --git a/src/components/SearchModal/CommonBases.tsx b/src/components/SearchModal/CommonBases.tsx index 62ec76a04bd..d064fb02ddd 100644 --- a/src/components/SearchModal/CommonBases.tsx +++ b/src/components/SearchModal/CommonBases.tsx @@ -43,6 +43,19 @@ export default function CommonBases({ + { + if (!selectedCurrency || !currencyEquals(selectedCurrency, ETHER)) { + onSelect(ETHER) + } + }} + disable={selectedCurrency?.isEther} + > + + + {chainId === 80002 ? 'POL' : 'ETH'} + + {(typeof chainId === 'number' ? SUGGESTED_BASES[chainId] ?? [] : []).map((token: Token) => { const selected = selectedCurrency?.isToken && selectedCurrency.address === token.address diff --git a/src/components/SearchModal/CurrencySearch.tsx b/src/components/SearchModal/CurrencySearch.tsx index 814f747614f..804339631e5 100644 --- a/src/components/SearchModal/CurrencySearch.tsx +++ b/src/components/SearchModal/CurrencySearch.tsx @@ -1,4 +1,4 @@ -import { Currency, Token } from '../../libs/sdk-core' +import { Currency, ETHER, Token } from '../../libs/sdk-core' import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react' import ReactGA from 'react-ga' import { useTranslation } from 'react-i18next' @@ -106,6 +106,14 @@ export function CurrencySearch({ const filteredSortedTokens = useSortedTokensByQuery(sortedTokens, debouncedQuery) + const filteredSortedTokensWithETH: Currency[] = useMemo(() => { + const s = debouncedQuery.toLowerCase().trim() + if (s === '' || s === 'e' || s === 'et' || s === 'eth') { + return [ETHER, ...filteredSortedTokens] + } + return filteredSortedTokens + }, [debouncedQuery, filteredSortedTokens]) + const handleCurrencySelect = useCallback( (currency: Currency) => { onCurrencySelect(currency) @@ -131,17 +139,20 @@ export function CurrencySearch({ const handleEnter = useCallback( (e: KeyboardEvent) => { if (e.key === 'Enter') { - if (filteredSortedTokens.length > 0) { + const s = debouncedQuery.toLowerCase().trim() + if (s === 'eth') { + handleCurrencySelect(ETHER) + } else if (filteredSortedTokensWithETH.length > 0) { if ( - filteredSortedTokens[0].symbol?.toLowerCase() === debouncedQuery.trim().toLowerCase() || - filteredSortedTokens.length === 1 + filteredSortedTokensWithETH[0].symbol?.toLowerCase() === debouncedQuery.trim().toLowerCase() || + filteredSortedTokensWithETH.length === 1 ) { - handleCurrencySelect(filteredSortedTokens[0]) + handleCurrencySelect(filteredSortedTokensWithETH[0]) } } } }, - [filteredSortedTokens, handleCurrencySelect, debouncedQuery] + [filteredSortedTokensWithETH, handleCurrencySelect, debouncedQuery] ) // menu ui @@ -190,7 +201,7 @@ export function CurrencySearch({ {({ height }) => ( Date: Thu, 26 Dec 2024 15:37:04 +0300 Subject: [PATCH 15/30] refactor: remove production builds of sdk-core; use always a development build of sdk --- src/libs/sdk-core/dist/index.js | 7 +- .../dist/sdk-core.cjs.production.min.js | 424 ------------------ .../dist/sdk-core.cjs.production.min.js.map | 1 - 3 files changed, 1 insertion(+), 431 deletions(-) delete mode 100644 src/libs/sdk-core/dist/sdk-core.cjs.production.min.js delete mode 100644 src/libs/sdk-core/dist/sdk-core.cjs.production.min.js.map diff --git a/src/libs/sdk-core/dist/index.js b/src/libs/sdk-core/dist/index.js index c3473ea9bf6..ceefd33d792 100644 --- a/src/libs/sdk-core/dist/index.js +++ b/src/libs/sdk-core/dist/index.js @@ -1,8 +1,3 @@ - 'use strict' -if (process.env.NODE_ENV === 'production') { - module.exports = require('./sdk-core.cjs.production.min.js') -} else { - module.exports = require('./sdk-core.cjs.development.js') -} +module.exports = require('./sdk-core.cjs.development.js') diff --git a/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js b/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js deleted file mode 100644 index 03ff402a968..00000000000 --- a/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js +++ /dev/null @@ -1,424 +0,0 @@ -'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.ChainId || (exports.ChainId = {}))[(r.MAINNET = 1)] = 'MAINNET'), - (r[(r.ROPSTEN = 3)] = 'ROPSTEN'), - (r[(r.RINKEBY = 4)] = 'RINKEBY'), - (r[(r['GÖRLI'] = 5)] = 'GÖRLI'), - (r[(r.KOVAN = 42)] = 'KOVAN'), - ((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 = i.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff') -function f(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 l(t, r, n) { - return r && f(t.prototype, r), n && f(t, n), t -} -function m(t, r) { - ;(t.prototype = Object.create(r.prototype)), (t.prototype.constructor = t), (t.__proto__ = r) -} -function p(t, r) { - return t.isToken && r.isToken ? t.equals(r) : !t.isToken && !r.isToken && t.isEther === r.isEther -} -var h = function (t, r, n) { - ;(t >= 0 && t < 255 && Number.isInteger(t)) || o(!1), (this.decimals = t), (this.symbol = r), (this.name = n) - }, - y = (function (t) { - function r() { - var r - return ((r = t.call(this, 18, 'ETH', 'Ether') || this).isEther = !0), (r.isToken = !1), r - } - return m(r, t), r - })(h) -y.ETHER = new y() -var v, - g, - x = y.ETHER, - E = s(a), - N = s(u), - I = - (((v = {})[exports.Rounding.ROUND_DOWN] = E.ROUND_DOWN), - (v[exports.Rounding.ROUND_HALF_UP] = E.ROUND_HALF_UP), - (v[exports.Rounding.ROUND_UP] = E.ROUND_UP), - v), - R = - (((g = {})[exports.Rounding.ROUND_DOWN] = 0), - (g[exports.Rounding.ROUND_HALF_UP] = 1), - (g[exports.Rounding.ROUND_UP] = 3), - g), - T = (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), - E.set({ precision: t + 1, rounding: I[n] }) - var e = new E(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), - (N.DP = t), - (N.RM = R[n]), - new N(this.numerator.toString()).div(this.denominator.toString()).toFormat(t, r) - ) - }), - l(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 - ) - })(), - F = s(u), - A = (function (t) { - function r(r, n, e) { - var a - return ( - (a = t.call(this, n, e) || this), - i.lessThanOrEqual(a.quotient, d) || o(!1), - (a.currency = r), - (a.decimalScale = i.exponentiate(i.BigInt(10), i.BigInt(r.decimals))), - a - ) - } - m(r, t), - (r.fromRawAmount = function (t, n) { - return new r(t, n) - }), - (r.fromFractionalAmount = function (t, n, e) { - return new r(t, n, e) - }), - (r.ether = function (t) { - return r.fromRawAmount(y.ETHER, t) - }) - var n = r.prototype - return ( - (n.add = function (n) { - p(this.currency, 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) { - p(this.currency, 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: '' }), - (F.DP = this.currency.decimals), - new F(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(t) - ) - }), - r - ) - })(T), - C = new T(i.BigInt(100)) -function O(t) { - return new U(t.numerator, t.denominator) -} -var w, - U = (function (t) { - function r() { - var r - return ((r = t.apply(this, arguments) || this).isPercent = !0), r - } - m(r, t) - var n = r.prototype - return ( - (n.add = function (r) { - return O(t.prototype.add.call(this, r)) - }), - (n.subtract = function (r) { - return O(t.prototype.subtract.call(this, r)) - }), - (n.multiply = function (r) { - return O(t.prototype.multiply.call(this, r)) - }), - (n.divide = function (r) { - return O(t.prototype.divide.call(this, r)) - }), - (n.toSignificant = function (r, n, e) { - return void 0 === r && (r = 5), t.prototype.multiply.call(this, C).toSignificant(r, n, e) - }), - (n.toFixed = function (r, n, e) { - return void 0 === r && (r = 2), t.prototype.multiply.call(this, C).toFixed(r, n, e) - }), - r - ) - })(T), - P = (function (t) { - function r(r, n, e, o) { - var a - return ( - ((a = t.call(this, o, e) || this).baseCurrency = r), - (a.quoteCurrency = n), - (a.scalar = new T( - i.exponentiate(i.BigInt(10), i.BigInt(r.decimals)), - i.exponentiate(i.BigInt(10), i.BigInt(n.decimals)) - )), - a - ) - } - m(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) { - p(this.quoteCurrency, 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) { - p(r.currency, 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) - }), - l(r, [ - { - key: 'adjustedForDecimals', - get: function () { - return t.prototype.multiply.call(this, this.scalar) - }, - }, - ]), - r - ) - })(T) -function _(t) { - try { - return c.getAddress(t) - } catch (r) { - throw new Error(t + ' is not a valid address.') - } -} -var D = (function (t) { - function r(r, n, e, i, o) { - var a - return ( - ((a = t.call(this, e, i, o) || this).isEther = !1), (a.isToken = !0), (a.chainId = r), (a.address = _(n)), a - ) - } - m(r, t) - var n = r.prototype - return ( - (n.equals = function (t) { - return this === t || (this.chainId === t.chainId && this.address === t.address) - }), - (n.sortsBefore = function (t) { - return ( - this.chainId !== t.chainId && o(!1), - this.address === t.address && o(!1), - this.address.toLowerCase() < t.address.toLowerCase() - ) - }), - r - ) - })(h), - b = - (((w = {})[exports.ChainId.MAINNET] = new D( - exports.ChainId.MAINNET, - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (w[exports.ChainId.ROPSTEN] = new D( - exports.ChainId.ROPSTEN, - '0xc778417E063141139Fce010982780140Aa0cD5Ab', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (w[exports.ChainId.RINKEBY] = new D( - exports.ChainId.RINKEBY, - '0xc778417E063141139Fce010982780140Aa0cD5Ab', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (w[exports.ChainId.GÖRLI] = new D( - exports.ChainId.GÖRLI, - '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (w[exports.ChainId.KOVAN] = new D( - exports.ChainId.KOVAN, - '0xd0A1E359811322d97991E03f863a0C30C2cF029C', - 18, - 'WETH9', - 'Wrapped Ether' - )), - w), - q = i.BigInt(Number.MAX_SAFE_INTEGER), - S = i.BigInt(0), - B = i.BigInt(1), - H = i.BigInt(2) -function W(t, r) { - if (t.isToken) return t.chainId !== r && o(!1), t - if (t.isEther) return b[r] - throw new Error('CURRENCY') -} -;(exports.CurrencyAmount = A), - (exports.ETHER = x), - (exports.Ether = y), - (exports.Fraction = T), - (exports.MaxUint256 = d), - (exports.Percent = U), - (exports.Price = P), - (exports.Token = D), - (exports.WETH9 = b), - (exports.computePriceImpact = function (t, r, n) { - var e = t.quote(r), - i = e.subtract(n).divide(e) - return new U(i.numerator, i.denominator) - }), - (exports.currencyEquals = p), - (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, q))) return i.BigInt(Math.floor(Math.sqrt(i.toNumber(t)))) - var r, n - for (r = t, n = i.add(i.divide(t, H), B); i.lessThan(n, r); ) (r = n), (n = i.divide(i.add(i.divide(t, n), n), H)) - return r - }), - (exports.validateAndParseAddress = _), - (exports.wrappedCurrency = W), - (exports.wrappedCurrencyAmount = function (t, r) { - return A.fromFractionalAmount(W(t.currency, r), t.numerator, t.denominator) - }) -//# sourceMappingURL=sdk-core.cjs.production.min.js.map diff --git a/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js.map b/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js.map deleted file mode 100644 index 88d3531ddbf..00000000000 --- a/src/libs/sdk-core/dist/sdk-core.cjs.production.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sdk-core.cjs.production.min.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import { Currency } from '../entities/currency'\n\n/**\n * Compares two currencies for equality\n */\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\n if (currencyA.isToken && currencyB.isToken) {\n return currencyA.equals(currencyB)\n } else if (currencyA.isToken) {\n return false\n } else if (currencyB.isToken) {\n return false\n } else {\n return currencyA.isEther === currencyB.isEther\n }\n}\n","import invariant from 'tiny-invariant'\n\n/**\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\n *\n * The only instance of the base class `Currency` is Ether.\n */\nexport abstract class BaseCurrency {\n public abstract readonly isEther: boolean\n public abstract readonly isToken: boolean\n\n public readonly decimals: number\n public readonly symbol?: string\n public readonly name?: string\n\n /**\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\n * @param decimals decimals of the currency\n * @param symbol symbol of the currency\n * @param name of the currency\n */\n protected constructor(decimals: number, symbol?: string, name?: string) {\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\n\n this.decimals = decimals\n this.symbol = symbol\n this.name = name\n }\n}\n","import { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents the currency Ether\n */\nexport class Ether extends BaseCurrency {\n public readonly isEther: true = true\n public readonly isToken: false = false\n\n /**\n * Only called once by this class\n * @protected\n */\n protected constructor() {\n super(18, 'ETH', 'Ether')\n }\n\n /**\n * The only instance of the class `Ether`.\n */\n public static readonly ETHER: Ether = new Ether()\n}\n\nexport const ETHER = Ether.ETHER\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport _Decimal from 'decimal.js-light'\nimport _Big, { RoundingMode } from 'big.js'\nimport toFormat from 'toformat'\n\nimport { BigintIsh, Rounding } from '../../constants'\n\nconst Decimal = toFormat(_Decimal)\nconst Big = toFormat(_Big)\n\nconst toSignificantRounding = {\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\n}\n\nconst toFixedRounding = {\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\n}\n\nexport class Fraction {\n public readonly numerator: JSBI\n public readonly denominator: JSBI\n\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\n this.numerator = JSBI.BigInt(numerator)\n this.denominator = JSBI.BigInt(denominator)\n }\n\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\n return new Fraction(fractionish)\n\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\n throw new Error('Could not parse fraction')\n }\n\n // performs floor division\n public get quotient(): JSBI {\n return JSBI.divide(this.numerator, this.denominator)\n }\n\n // remainder after floor division\n public get remainder(): Fraction {\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\n }\n\n public invert(): Fraction {\n return new Fraction(this.denominator, this.numerator)\n }\n\n public add(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.add(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public subtract(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.subtract(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public lessThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.lessThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public equalTo(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.equal(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public greaterThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.greaterThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public multiply(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.numerator),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public divide(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(this.denominator, otherParsed.numerator)\n )\n }\n\n public toSignificant(\n significantDigits: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\n\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\n const quotient = new Decimal(this.numerator.toString())\n .div(this.denominator.toString())\n .toSignificantDigits(significantDigits)\n return quotient.toFormat(quotient.decimalPlaces(), format)\n }\n\n public toFixed(\n decimalPlaces: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\n\n Big.DP = decimalPlaces\n Big.RM = toFixedRounding[rounding]\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\n }\n\n /**\n * Helper method for converting any super class back to a fraction\n */\n public get asFraction(): Fraction {\n return new Fraction(this.numerator, this.denominator)\n }\n}\n","import invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport { Currency } from '../currency'\nimport { Ether } from '../ether'\nimport { Fraction } from './fraction'\nimport _Big from 'big.js'\n\nimport toFormat from 'toformat'\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\n\nconst Big = toFormat(_Big)\n\nexport class CurrencyAmount extends Fraction {\n public readonly currency: T\n public readonly decimalScale: JSBI\n\n /**\n * Returns a new currency amount instance from the\n * @param currency the currency in the amount\n * @param rawAmount the raw token or ether amount\n */\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\n return new CurrencyAmount(currency, rawAmount)\n }\n\n /**\n * Construct a currency amount with a denominator that is not equal to 1\n * @param currency the currency\n * @param numerator the numerator of the fractional token amount\n * @param denominator the denominator of the fractional token amount\n */\n public static fromFractionalAmount(\n currency: T,\n numerator: BigintIsh,\n denominator: BigintIsh\n ): CurrencyAmount {\n return new CurrencyAmount(currency, numerator, denominator)\n }\n\n /**\n * Helper that calls the constructor with the ETHER currency\n * @param rawAmount ether amount in wei\n */\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\n }\n\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\n super(numerator, denominator)\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\n this.currency = currency\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\n }\n\n public add(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const added = super.add(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\n }\n\n public subtract(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const subtracted = super.subtract(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\n }\n\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\n const multiplied = super.multiply(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\n }\n\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\n const divided = super.divide(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\n }\n\n public toSignificant(\n significantDigits: number = 6,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(\n decimalPlaces: number = this.currency.decimals,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\n }\n\n public toExact(format: object = { groupSeparator: '' }): string {\n Big.DP = this.currency.decimals\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\n }\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Fraction } from './fraction'\n\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\n\n/**\n * Converts a fraction to a percent\n * @param fraction the fraction to convert\n */\nfunction toPercent(fraction: Fraction): Percent {\n return new Percent(fraction.numerator, fraction.denominator)\n}\n\nexport class Percent extends Fraction {\n /**\n * This boolean prevents a fraction from being interpreted as a Percent\n */\n public readonly isPercent: true = true\n\n add(other: Fraction | BigintIsh): Percent {\n return toPercent(super.add(other))\n }\n\n subtract(other: Fraction | BigintIsh): Percent {\n return toPercent(super.subtract(other))\n }\n\n multiply(other: Fraction | BigintIsh): Percent {\n return toPercent(super.multiply(other))\n }\n\n divide(other: Fraction | BigintIsh): Percent {\n return toPercent(super.divide(other))\n }\n\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\n }\n}\n","import JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport invariant from 'tiny-invariant'\n\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Currency } from '../currency'\nimport { Fraction } from './fraction'\nimport { CurrencyAmount } from './currencyAmount'\n\nexport class Price extends Fraction {\n public readonly baseCurrency: TBase // input i.e. denominator\n public readonly quoteCurrency: TQuote // output i.e. numerator\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\n\n // denominator and numerator _must_ be raw, i.e. in the native representation\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\n super(numerator, denominator)\n\n this.baseCurrency = baseCurrency\n this.quoteCurrency = quoteCurrency\n this.scalar = new Fraction(\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\n )\n }\n\n /**\n * Flip the price, switching the base and quote currency\n */\n public invert(): Price {\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\n }\n\n /**\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\n * @param other the other price\n */\n public multiply(other: Price): Price {\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\n const fraction = super.multiply(other)\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\n }\n\n /**\n * Return the amount of quote currency corresponding to a given amount of the base currency\n * @param currencyAmount the amount of base currency to quote against the price\n */\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\n const result = super.multiply(currencyAmount)\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\n }\n\n /**\n * Get the value scaled by decimals for formatting\n * @private\n */\n private get adjustedForDecimals(): Fraction {\n return super.multiply(this.scalar)\n }\n\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\n }\n}\n","import { getAddress } from '@ethersproject/address'\n\n/**\n * Validates an address and returns the parsed (checksummed) version of that address\n * @param address the unchecksummed hex address\n */\nexport function validateAndParseAddress(address: string): string {\n try {\n return getAddress(address)\n } catch (error) {\n throw new Error(`${address} is not a valid address.`)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\nimport { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents an ERC20 token with a unique address and some metadata.\n */\nexport class Token extends BaseCurrency {\n public readonly isEther: false = false\n public readonly isToken: true = true\n\n public readonly chainId: ChainId | number\n public readonly address: string\n\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\n super(decimals, symbol, name)\n this.chainId = chainId\n this.address = validateAndParseAddress(address)\n }\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Token): boolean {\n // short circuit on reference equality\n if (this === other) {\n return true\n }\n return this.chainId === other.chainId && this.address === other.address\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: Token): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n}\n\nexport const WETH9: { [chainId in ChainId]: Token } = {\n [ChainId.MAINNET]: new Token(\n ChainId.MAINNET,\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.ROPSTEN]: new Token(\n ChainId.ROPSTEN,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.RINKEBY]: new Token(\n ChainId.RINKEBY,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether')\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\n\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\n\nconst ZERO = JSBI.BigInt(0)\nconst ONE = JSBI.BigInt(1)\nconst TWO = JSBI.BigInt(2)\n\n/**\n * Computes floor(sqrt(value))\n * @param value the value for which to compute the square root, rounded down\n */\nexport function sqrt(value: JSBI): JSBI {\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\n\n // rely on built in sqrt if possible\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\n }\n\n let z: JSBI\n let x: JSBI\n z = value\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\n while (JSBI.lessThan(x, z)) {\n z = x\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\n }\n return z\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { Currency, Token, WETH9 } from '../entities'\n\n/**\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\n * @param currency the currency to wrap, if necessary\n * @param chainId the ID of the chain for wrapping\n */\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\n if (currency.isToken) {\n invariant(currency.chainId === chainId, 'CHAIN_ID')\n return currency\n }\n if (currency.isEther) return WETH9[chainId]\n throw new Error('CURRENCY')\n}\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\n\n/**\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\n * @param midPrice mid price before the trade\n * @param inputAmount the input amount of the trade\n * @param outputAmount the output amount of the trade\n */\nexport function computePriceImpact(\n midPrice: Price,\n inputAmount: CurrencyAmount,\n outputAmount: CurrencyAmount\n): Percent {\n const quotedOutputAmount = midPrice.quote(inputAmount)\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\n return new Percent(priceImpact.numerator, priceImpact.denominator)\n}\n","import invariant from 'tiny-invariant'\n\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\n// `maxSize` by removing the last item\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\n\n // short circuit first item add\n if (items.length === 0) {\n items.push(add)\n return null\n } else {\n const isFull = items.length === maxSize\n // short circuit if full and the additional item does not come before the last item\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\n return add\n }\n\n let lo = 0,\n hi = items.length\n\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (comparator(items[mid], add) <= 0) {\n lo = mid + 1\n } else {\n hi = mid\n }\n }\n items.splice(lo, 0, add)\n return isFull ? items.pop()! : null\n }\n}\n","import { ChainId } from '../constants'\nimport { Currency, CurrencyAmount, Token } from '../entities'\nimport { wrappedCurrency } from './wrappedCurrency'\n\n/**\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\n * the input currency amount.\n */\nexport function wrappedCurrencyAmount(\n currencyAmount: CurrencyAmount,\n chainId: ChainId\n): CurrencyAmount {\n return CurrencyAmount.fromFractionalAmount(\n wrappedCurrency(currencyAmount.currency, chainId),\n currencyAmount.numerator,\n currencyAmount.denominator\n )\n}\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","this","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","_this","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","added","subtracted","multiplied","divided","_Fraction","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","MAX_SAFE_INTEGER","ZERO","ONE","TWO","wrappedCurrency","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","value","greaterThanOrEqual","Math","floor","sqrt","toNumber","z","x"],"mappings":"8IAKYA,EAQAC,EAKAC,4KAbAF,EAAAA,kBAAAA,4CAEVA,yBACAA,yBACAA,wBACAA,uBAGUC,EAAAA,oBAAAA,sDAEVA,oCAGUC,EAAAA,mBAAAA,mDAEVA,qCACAA,+BAGWC,EAAaC,EAAKC,OAAO,6YCnBtBC,EAAeC,EAAqBC,UAC9CD,EAAUE,SAAWD,EAAUC,QAC1BF,EAAUG,OAAOF,IACfD,EAAUE,UAEVD,EAAUC,SAGZF,EAAUI,UAAYH,EAAUG,YCNrBC,EAcpB,SAAsBC,EAAkBC,EAAiBC,GAC7CF,GAAY,GAAKA,EAAW,KAAOG,OAAOC,UAAUJ,IAA9DK,WAEKL,SAAWA,OACXC,OAASA,OACTC,KAAOA,GCrBHI,sDASH,GAAI,MAAO,yBARa,aACC,qBAFRP,GAeFO,QAAe,IAAIA,UAG/BC,EAAQD,EAAMC,MCfrBC,EAAUC,EAASC,GACnBC,EAAMF,EAASG,GAEfC,UACHxB,iBAASyB,YAAaN,EAAQM,aAC9BzB,iBAAS0B,eAAgBP,EAAQO,gBACjC1B,iBAAS2B,UAAWR,EAAQQ,YAGzBC,UACH5B,iBAASyB,gBACTzB,iBAAS0B,mBACT1B,iBAAS2B,eAGCE,wBAIQC,EAAsBC,YAAAA,IAAAA,EAAyB7B,EAAKC,OAAO,SACvE2B,UAAY5B,EAAKC,OAAO2B,QACxBC,YAAc7B,EAAKC,OAAO4B,KAGlBC,iBAAP,SAAwBC,MAC1BA,aAAuB/B,GAA+B,iBAAhB+B,GAAmD,iBAAhBA,EAC3E,OAAO,IAAIJ,EAASI,MAElB,cAAeA,GAAe,gBAAiBA,EAAa,OAAOA,QACjE,IAAIC,MA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AKyC,SAAS0F,EAAGD,IACtBA,EAAIC,EACJA,EAAInI,EAAK4C,OAAO5C,EAAKmC,IAAInC,EAAK4C,OAAOgF,EAAOO,GAAIA,GAAIzB,UAE/CwB,sGInBP5C,EACAQ,UAEOjC,EAAeQ,qBACpBsC,EAAgBrB,EAAexB,SAAUgC,GACzCR,EAAe1D,UACf0D,EAAezD"} \ No newline at end of file From f756fc00f8ed2d4269ee55a3acebbad702ef7ead Mon Sep 17 00:00:00 2001 From: alagunoff Date: Thu, 26 Dec 2024 16:18:08 +0300 Subject: [PATCH 16/30] feat: add arguments for Ether class to specify symbol and name for the instance; use different logo for Ether instance based ob the chain selected --- src/assets/images/polygon-matic-logo.png | Bin 0 -> 64571 bytes src/components/CurrencyLogo/index.tsx | 12 +- src/hooks/Tokens.ts | 6 +- src/libs/sdk-core/dist/entities/ether.d.ts | 22 +- .../sdk-core/dist/sdk-core.cjs.development.js | 785 ------------------ .../dist/sdk-core.cjs.development.js.map | 1 - src/libs/sdk-core/dist/sdk-core.esm.js | 4 +- 7 files changed, 26 insertions(+), 804 deletions(-) create mode 100644 src/assets/images/polygon-matic-logo.png delete mode 100644 src/libs/sdk-core/dist/sdk-core.cjs.development.js delete mode 100644 src/libs/sdk-core/dist/sdk-core.cjs.development.js.map diff --git a/src/assets/images/polygon-matic-logo.png b/src/assets/images/polygon-matic-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d719c065a47a6a58732a5beaa6c17191c22a0eeb GIT binary patch literal 64571 zcmeFac{tVE7e9W=Ew`(<-MS=WWxNVSX3-!W!aWqp*hDgBIw72{N=2!I$XFax5=F)g zrAVea$aqMF&XGeIj*brBz2EP*qQ1}fkKcd4=lS&9``jmM@3q%n>$Qfx_I|sU|25WM z^~d@@a5&s5{JuS=I2`vY`0ww_!B67Up80|Qtnk=p>4n4btbzY7!Nn!4!{Nkn_&qxh zoay>RtBtgAOswtCJzg&;#Jx>wDB;K@uHq|8_SW~_eav{suF&6du;ku|&8h6PqQj@; z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>yB}fnj#4?-~Zn*4;Vg_tc2zDJ6<&M$;!~ zY!_P4v6;`?HC@dVN<{b{0WHBDM5t7Guxm>}_u4=FRXc@m6i+3<9VA?_3vHcGd`o=6 z*PoBDF3L_Gj2(GYfqO~#02eY$f4KRw!3huPezgzoW=)rsht3e4HGII9AU8&4LFDtJ z!A?OwvRVkzUlzxvX%x~~HS~a1zslaAGrz6AQoe>eEpQOty(=p^Cgk=qw(J?d;^i<5| z)mR6a&S~9&+*6JWO*z~^A%y9freT^gXCCBKIEUI)&8O>8+)+2!*v6}x_#A$Mk|i1ON7_LvJBFdX(wB^=7o zoL8Mb?DOjnQyc#_sJ*$s>T>&`sip@Z{($NZ|HaAaD&cT}+}~tuDtH+6A+`VckcfsG zPg+7sYe+lq#+ap-JB@WIb`GfxAXqQ(rf)vidTiVY+<%5?Gbl0&E09)Jqu1WwG^gLh1w4Xv^S?LOeDe% zMGGpqTr*qqp1lY5DmC0ZC#GnBo8moMQgGO##*cL%^@V5`&>`H(T?$XU39>P}>oLWF zb^O^6sCad3s$tRHZOp#PMh!fKmr!dpj>(z);43A+JSYgyqa?J{iYi{a+r+w!a6R_J z2z&=pS?B2iliOKkQwk=ZpPHJOai@m%#n>XQ=|>T+9y>J`S4L}YKBMZ(Us^C=z-Si; z`|ds^%8*kY`i?u2oTChEV_&4oFbCLb*P4RmnawBWYSOv;&0w-<7?I17NIpAPbHAde zec=zhdyn%C|1bxAhZlbm|AKcKa%AX1eE0)z$0NSLOX@iP`tMK(i2q`R&EfyGF^p{F nm~?13=L `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/${address}/logo.png` @@ -34,6 +36,7 @@ export default function CurrencyLogo({ size?: string style?: React.CSSProperties }) { + const { chainId } = useWeb3React() const uriLocations = useHttpLocations(currency instanceof WrappedTokenInfo ? currency.logoURI : undefined) const srcs: string[] = useMemo(() => { @@ -50,7 +53,14 @@ export default function CurrencyLogo({ }, [currency, uriLocations]) if (currency?.isEther) { - return + return ( + + ) } return diff --git a/src/hooks/Tokens.ts b/src/hooks/Tokens.ts index 49c0414367d..2bceb600ba4 100644 --- a/src/hooks/Tokens.ts +++ b/src/hooks/Tokens.ts @@ -1,5 +1,5 @@ import { parseBytes32String } from '@ethersproject/strings' -import { Currency, currencyEquals, ETHER, Token } from '../libs/sdk-core' +import { Currency, currencyEquals, Ether, Token } from '../libs/sdk-core' import { arrayify } from 'ethers/lib/utils' import { useMemo } from 'react' import { createTokenFilterFunction } from '../components/SearchModal/filtering' @@ -172,7 +172,9 @@ export function useToken(tokenAddress?: string): Token | undefined | null { } export function useCurrency(currencyId: string | undefined): Currency | null | undefined { + const { chainId } = useActiveWeb3React() const isETH = currencyId?.toUpperCase() === 'ETH' const token = useToken(isETH ? undefined : currencyId) - return isETH ? ETHER : token + + return isETH ? new Ether(chainId === 80002 ? 'POL' : undefined, chainId === 80002 ? 'Polygon' : undefined) : token } diff --git a/src/libs/sdk-core/dist/entities/ether.d.ts b/src/libs/sdk-core/dist/entities/ether.d.ts index 78ded1b62b6..e0967714517 100644 --- a/src/libs/sdk-core/dist/entities/ether.d.ts +++ b/src/libs/sdk-core/dist/entities/ether.d.ts @@ -1,18 +1,14 @@ -import { BaseCurrency } from './baseCurrency'; +import { BaseCurrency } from './baseCurrency' /** * Represents the currency Ether */ export declare class Ether extends BaseCurrency { - readonly isEther: true; - readonly isToken: false; - /** - * Only called once by this class - * @protected - */ - protected constructor(); - /** - * The only instance of the class `Ether`. - */ - static readonly ETHER: Ether; + readonly isEther: true + readonly isToken: false + constructor(symbol?: string, name?: string) + /** + * The only instance of the class `Ether`. + */ + static readonly ETHER: Ether } -export declare const ETHER: Ether; +export declare const ETHER: Ether diff --git a/src/libs/sdk-core/dist/sdk-core.cjs.development.js b/src/libs/sdk-core/dist/sdk-core.cjs.development.js deleted file mode 100644 index 542ca9588eb..00000000000 --- a/src/libs/sdk-core/dist/sdk-core.cjs.development.js +++ /dev/null @@ -1,785 +0,0 @@ -'use strict' - -Object.defineProperty(exports, '__esModule', { value: true }) - -function _interopDefault(ex) { - return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex -} - -var JSBI = _interopDefault(require('jsbi')) -var invariant = _interopDefault(require('tiny-invariant')) -var _Decimal = _interopDefault(require('decimal.js-light')) -var _Big = _interopDefault(require('big.js')) -var toFormat = _interopDefault(require('toformat')) -var address = require('@ethersproject/address') - -;(function (ChainId) { - ChainId[(ChainId['MAINNET'] = 1)] = 'MAINNET' - ChainId[(ChainId['ROPSTEN'] = 3)] = 'ROPSTEN' - ChainId[(ChainId['RINKEBY'] = 4)] = 'RINKEBY' - ChainId[(ChainId['G\xD6RLI'] = 5)] = 'G\xD6RLI' - ChainId[(ChainId['KOVAN'] = 42)] = 'KOVAN' - ChainId[(ChainId['POLYGON_AMOY'] = 80002)] = 'POLYGON_AMOY' -})(exports.ChainId || (exports.ChainId = {})) -;(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) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i] - descriptor.enumerable = descriptor.enumerable || false - descriptor.configurable = true - if ('value' in descriptor) descriptor.writable = true - Object.defineProperty(target, descriptor.key, descriptor) - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps) - if (staticProps) _defineProperties(Constructor, staticProps) - return Constructor -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype) - subClass.prototype.constructor = subClass - subClass.__proto__ = superClass -} - -/** - * Compares two currencies for equality - */ -function currencyEquals(currencyA, currencyB) { - if (currencyA.isToken && currencyB.isToken) { - return currencyA.equals(currencyB) - } else if (currencyA.isToken) { - return false - } else if (currencyB.isToken) { - return false - } else { - return currencyA.isEther === currencyB.isEther - } -} - -/** - * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. - * - * The only instance of the base class `Currency` is Ether. - */ - -var BaseCurrency = - /** - * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. - * @param decimals decimals of the currency - * @param symbol symbol of the currency - * @param name of the currency - */ - function BaseCurrency(decimals, symbol, name) { - !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? invariant(false, 'DECIMALS') : void 0 - this.decimals = decimals - this.symbol = symbol - this.name = name - } - -/** - * Represents the currency Ether - */ - -var Ether = /*#__PURE__*/ (function (_BaseCurrency) { - _inheritsLoose(Ether, _BaseCurrency) - - /** - * Only called once by this class - * @protected - */ - function Ether() { - var _this - - _this = _BaseCurrency.call(this, 18, 'ETH', 'Ether') || this - _this.isEther = true - _this.isToken = false - return _this - } - - return Ether -})(BaseCurrency) -/** - * The only instance of the class `Ether`. - */ - -Ether.ETHER = /*#__PURE__*/ new Ether() -var ETHER = Ether.ETHER - -var _toSignificantRoundin, _toFixedRounding -var Decimal = /*#__PURE__*/ toFormat(_Decimal) -var Big = /*#__PURE__*/ toFormat(_Big) -var toSignificantRounding = - ((_toSignificantRoundin = {}), - (_toSignificantRoundin[exports.Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN), - (_toSignificantRoundin[exports.Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP), - (_toSignificantRoundin[exports.Rounding.ROUND_UP] = Decimal.ROUND_UP), - _toSignificantRoundin) -var toFixedRounding = - ((_toFixedRounding = {}), - (_toFixedRounding[exports.Rounding.ROUND_DOWN] = 0), - (_toFixedRounding[exports.Rounding.ROUND_HALF_UP] = 1), - (_toFixedRounding[exports.Rounding.ROUND_UP] = 3), - _toFixedRounding) -var Fraction = /*#__PURE__*/ (function () { - function Fraction(numerator, denominator) { - if (denominator === void 0) { - denominator = JSBI.BigInt(1) - } - - this.numerator = JSBI.BigInt(numerator) - this.denominator = JSBI.BigInt(denominator) - } - - Fraction.tryParseFraction = function tryParseFraction(fractionish) { - if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') - return new Fraction(fractionish) - if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish - throw new Error('Could not parse fraction') - } // performs floor division - - var _proto = Fraction.prototype - - _proto.invert = function invert() { - return new Fraction(this.denominator, this.numerator) - } - - _proto.add = function add(other) { - var otherParsed = Fraction.tryParseFraction(other) - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator) - } - - return new Fraction( - JSBI.add( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ), - JSBI.multiply(this.denominator, otherParsed.denominator) - ) - } - - _proto.subtract = function subtract(other) { - var otherParsed = Fraction.tryParseFraction(other) - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator) - } - - return new Fraction( - JSBI.subtract( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ), - JSBI.multiply(this.denominator, otherParsed.denominator) - ) - } - - _proto.lessThan = function lessThan(other) { - var otherParsed = Fraction.tryParseFraction(other) - return JSBI.lessThan( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ) - } - - _proto.equalTo = function equalTo(other) { - var otherParsed = Fraction.tryParseFraction(other) - return JSBI.equal( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ) - } - - _proto.greaterThan = function greaterThan(other) { - var otherParsed = Fraction.tryParseFraction(other) - return JSBI.greaterThan( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ) - } - - _proto.multiply = function multiply(other) { - var otherParsed = Fraction.tryParseFraction(other) - return new Fraction( - JSBI.multiply(this.numerator, otherParsed.numerator), - JSBI.multiply(this.denominator, otherParsed.denominator) - ) - } - - _proto.divide = function divide(other) { - var otherParsed = Fraction.tryParseFraction(other) - return new Fraction( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(this.denominator, otherParsed.numerator) - ) - } - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '', - } - } - - if (rounding === void 0) { - rounding = exports.Rounding.ROUND_HALF_UP - } - - !Number.isInteger(significantDigits) ? invariant(false, significantDigits + ' is not an integer.') : void 0 - !(significantDigits > 0) ? invariant(false, significantDigits + ' is not positive.') : void 0 - Decimal.set({ - precision: significantDigits + 1, - rounding: toSignificantRounding[rounding], - }) - var quotient = new Decimal(this.numerator.toString()) - .div(this.denominator.toString()) - .toSignificantDigits(significantDigits) - return quotient.toFormat(quotient.decimalPlaces(), format) - } - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '', - } - } - - if (rounding === void 0) { - rounding = exports.Rounding.ROUND_HALF_UP - } - - !Number.isInteger(decimalPlaces) ? invariant(false, decimalPlaces + ' is not an integer.') : void 0 - !(decimalPlaces >= 0) ? invariant(false, decimalPlaces + ' is negative.') : void 0 - Big.DP = decimalPlaces - Big.RM = toFixedRounding[rounding] - return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format) - } - /** - * Helper method for converting any super class back to a fraction - */ - - _createClass(Fraction, [ - { - key: 'quotient', - get: function get() { - return JSBI.divide(this.numerator, this.denominator) - }, // remainder after floor division - }, - { - key: 'remainder', - get: function get() { - return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator) - }, - }, - { - key: 'asFraction', - get: function get() { - return new Fraction(this.numerator, this.denominator) - }, - }, - ]) - - return Fraction -})() - -var Big$1 = /*#__PURE__*/ toFormat(_Big) -var CurrencyAmount = /*#__PURE__*/ (function (_Fraction) { - _inheritsLoose(CurrencyAmount, _Fraction) - - function CurrencyAmount(currency, numerator, denominator) { - var _this - - _this = _Fraction.call(this, numerator, denominator) || this - !JSBI.lessThanOrEqual(_this.quotient, MaxUint256) ? invariant(false, 'AMOUNT') : void 0 - _this.currency = currency - _this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals)) - return _this - } - /** - * Returns a new currency amount instance from the - * @param currency the currency in the amount - * @param rawAmount the raw token or ether amount - */ - - CurrencyAmount.fromRawAmount = function fromRawAmount(currency, rawAmount) { - return new CurrencyAmount(currency, rawAmount) - } - /** - * Construct a currency amount with a denominator that is not equal to 1 - * @param currency the currency - * @param numerator the numerator of the fractional token amount - * @param denominator the denominator of the fractional token amount - */ - - CurrencyAmount.fromFractionalAmount = function fromFractionalAmount(currency, numerator, denominator) { - return new CurrencyAmount(currency, numerator, denominator) - } - /** - * Helper that calls the constructor with the ETHER currency - * @param rawAmount ether amount in wei - */ - - CurrencyAmount.ether = function ether(rawAmount) { - return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount) - } - - var _proto = CurrencyAmount.prototype - - _proto.add = function add(other) { - !currencyEquals(this.currency, other.currency) ? invariant(false, 'CURRENCY') : void 0 - - var added = _Fraction.prototype.add.call(this, other) - - return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator) - } - - _proto.subtract = function subtract(other) { - !currencyEquals(this.currency, other.currency) ? invariant(false, 'CURRENCY') : void 0 - - var subtracted = _Fraction.prototype.subtract.call(this, other) - - return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator) - } - - _proto.multiply = function multiply(other) { - var multiplied = _Fraction.prototype.multiply.call(this, other) - - return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator) - } - - _proto.divide = function divide(other) { - var divided = _Fraction.prototype.divide.call(this, other) - - return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator) - } - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 6 - } - - if (rounding === void 0) { - rounding = exports.Rounding.ROUND_DOWN - } - - return _Fraction.prototype.divide.call(this, this.decimalScale).toSignificant(significantDigits, format, rounding) - } - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = this.currency.decimals - } - - if (rounding === void 0) { - rounding = exports.Rounding.ROUND_DOWN - } - - !(decimalPlaces <= this.currency.decimals) ? invariant(false, 'DECIMALS') : void 0 - return _Fraction.prototype.divide.call(this, this.decimalScale).toFixed(decimalPlaces, format, rounding) - } - - _proto.toExact = function toExact(format) { - if (format === void 0) { - format = { - groupSeparator: '', - } - } - - Big$1.DP = this.currency.decimals - return new Big$1(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format) - } - - return CurrencyAmount -})(Fraction) - -var ONE_HUNDRED = /*#__PURE__*/ new Fraction(/*#__PURE__*/ JSBI.BigInt(100)) -/** - * Converts a fraction to a percent - * @param fraction the fraction to convert - */ - -function toPercent(fraction) { - return new Percent(fraction.numerator, fraction.denominator) -} - -var Percent = /*#__PURE__*/ (function (_Fraction) { - _inheritsLoose(Percent, _Fraction) - - function Percent() { - var _this - - _this = _Fraction.apply(this, arguments) || this - /** - * This boolean prevents a fraction from being interpreted as a Percent - */ - - _this.isPercent = true - return _this - } - - var _proto = Percent.prototype - - _proto.add = function add(other) { - return toPercent(_Fraction.prototype.add.call(this, other)) - } - - _proto.subtract = function subtract(other) { - return toPercent(_Fraction.prototype.subtract.call(this, other)) - } - - _proto.multiply = function multiply(other) { - return toPercent(_Fraction.prototype.multiply.call(this, other)) - } - - _proto.divide = function divide(other) { - return toPercent(_Fraction.prototype.divide.call(this, other)) - } - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 5 - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding) - } - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 2 - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding) - } - - return Percent -})(Fraction) - -var Price = /*#__PURE__*/ (function (_Fraction) { - _inheritsLoose(Price, _Fraction) - - // denominator and numerator _must_ be raw, i.e. in the native representation - function Price(baseCurrency, quoteCurrency, denominator, numerator) { - var _this - - _this = _Fraction.call(this, numerator, denominator) || this - _this.baseCurrency = baseCurrency - _this.quoteCurrency = quoteCurrency - _this.scalar = new Fraction( - JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)), - JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals)) - ) - return _this - } - /** - * Flip the price, switching the base and quote currency - */ - - var _proto = Price.prototype - - _proto.invert = function invert() { - return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator) - } - /** - * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency - * @param other the other price - */ - - _proto.multiply = function multiply(other) { - !currencyEquals(this.quoteCurrency, other.baseCurrency) ? invariant(false, 'TOKEN') : void 0 - - var fraction = _Fraction.prototype.multiply.call(this, other) - - return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator) - } - /** - * Return the amount of quote currency corresponding to a given amount of the base currency - * @param currencyAmount the amount of base currency to quote against the price - */ - - _proto.quote = function quote(currencyAmount) { - !currencyEquals(currencyAmount.currency, this.baseCurrency) ? invariant(false, 'TOKEN') : void 0 - - var result = _Fraction.prototype.multiply.call(this, currencyAmount) - - return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator) - } - /** - * Get the value scaled by decimals for formatting - * @private - */ - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 6 - } - - return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding) - } - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 4 - } - - return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding) - } - - _createClass(Price, [ - { - key: 'adjustedForDecimals', - get: function get() { - return _Fraction.prototype.multiply.call(this, this.scalar) - }, - }, - ]) - - return Price -})(Fraction) - -/** - * Validates an address and returns the parsed (checksummed) version of that address - * @param address the unchecksummed hex address - */ - -function validateAndParseAddress(address$1) { - try { - return address.getAddress(address$1) - } catch (error) { - throw new Error(address$1 + ' is not a valid address.') - } -} - -var _WETH -/** - * Represents an ERC20 token with a unique address and some metadata. - */ - -var Token = /*#__PURE__*/ (function (_BaseCurrency) { - _inheritsLoose(Token, _BaseCurrency) - - function Token(chainId, address, decimals, symbol, name) { - var _this - - _this = _BaseCurrency.call(this, decimals, symbol, name) || this - _this.isEther = false - _this.isToken = true - _this.chainId = chainId - _this.address = validateAndParseAddress(address) - return _this - } - /** - * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. - * @param other other token to compare - */ - - var _proto = Token.prototype - - _proto.equals = function equals(other) { - // short circuit on reference equality - if (this === other) { - return true - } - - return this.chainId === other.chainId && this.address === other.address - } - /** - * Returns true if the address of this token sorts before the address of the other token - * @param other other token to compare - * @throws if the tokens have the same address - * @throws if the tokens are on different chains - */ - - _proto.sortsBefore = function sortsBefore(other) { - !(this.chainId === other.chainId) ? invariant(false, 'CHAIN_IDS') : void 0 - !(this.address !== other.address) ? invariant(false, 'ADDRESSES') : void 0 - return this.address.toLowerCase() < other.address.toLowerCase() - } - - return Token -})(BaseCurrency) -var WETH9 = - ((_WETH = {}), - (_WETH[exports.ChainId.MAINNET] = /*#__PURE__*/ new Token( - exports.ChainId.MAINNET, - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[exports.ChainId.ROPSTEN] = /*#__PURE__*/ new Token( - exports.ChainId.ROPSTEN, - '0xc778417E063141139Fce010982780140Aa0cD5Ab', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[exports.ChainId.RINKEBY] = /*#__PURE__*/ new Token( - exports.ChainId.RINKEBY, - '0xc778417E063141139Fce010982780140Aa0cD5Ab', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[exports.ChainId.GÖRLI] = /*#__PURE__*/ new Token( - exports.ChainId.GÖRLI, - '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[exports.ChainId.KOVAN] = /*#__PURE__*/ new Token( - exports.ChainId.KOVAN, - '0xd0A1E359811322d97991E03f863a0C30C2cF029C', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[exports.ChainId.POLYGON_AMOY] = /*#__PURE__*/ new Token( - exports.ChainId.POLYGON_AMOY, - '0xd7a19e388c52D3580B6428F29494883A5d40C330', - 18, - 'WETH9', - 'Wrapped Ether' - )), - _WETH) - -/** - * Returns the percent difference between the mid price and the execution price, i.e. price impact. - * @param midPrice mid price before the trade - * @param inputAmount the input amount of the trade - * @param outputAmount the output amount of the trade - */ - -function computePriceImpact(midPrice, inputAmount, outputAmount) { - var quotedOutputAmount = midPrice.quote(inputAmount) // calculate price impact := (exactQuote - outputAmount) / exactQuote - - var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount) - return new Percent(priceImpact.numerator, priceImpact.denominator) -} - -// `maxSize` by removing the last item - -function sortedInsert(items, add, maxSize, comparator) { - !(maxSize > 0) ? invariant(false, 'MAX_SIZE_ZERO') : void 0 // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize - - !(items.length <= maxSize) ? invariant(false, 'ITEMS_SIZE') : void 0 // short circuit first item add - - if (items.length === 0) { - items.push(add) - return null - } else { - var isFull = items.length === maxSize // short circuit if full and the additional item does not come before the last item - - if (isFull && comparator(items[items.length - 1], add) <= 0) { - return add - } - - var lo = 0, - hi = items.length - - while (lo < hi) { - var mid = (lo + hi) >>> 1 - - if (comparator(items[mid], add) <= 0) { - lo = mid + 1 - } else { - hi = mid - } - } - - items.splice(lo, 0, add) - return isFull ? items.pop() : null - } -} - -var MAX_SAFE_INTEGER = /*#__PURE__*/ JSBI.BigInt(Number.MAX_SAFE_INTEGER) -var ZERO = /*#__PURE__*/ JSBI.BigInt(0) -var ONE = /*#__PURE__*/ JSBI.BigInt(1) -var TWO = /*#__PURE__*/ JSBI.BigInt(2) -/** - * Computes floor(sqrt(value)) - * @param value the value for which to compute the square root, rounded down - */ - -function sqrt(value) { - !JSBI.greaterThanOrEqual(value, ZERO) ? invariant(false, 'NEGATIVE') : void 0 // rely on built in sqrt if possible - - if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) { - return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value)))) - } - - var z - var x - z = value - x = JSBI.add(JSBI.divide(value, TWO), ONE) - - while (JSBI.lessThan(x, z)) { - z = x - x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO) - } - - return z -} - -/** - * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token - * @param currency the currency to wrap, if necessary - * @param chainId the ID of the chain for wrapping - */ - -function wrappedCurrency(currency, chainId) { - if (currency.isToken) { - !(currency.chainId === chainId) ? invariant(false, 'CHAIN_ID') : void 0 - return currency - } - - if (currency.isEther) return WETH9[chainId] - throw new Error('CURRENCY') -} - -/** - * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. - * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns - * the input currency amount. - */ - -function wrappedCurrencyAmount(currencyAmount, chainId) { - return CurrencyAmount.fromFractionalAmount( - wrappedCurrency(currencyAmount.currency, chainId), - currencyAmount.numerator, - currencyAmount.denominator - ) -} - -exports.CurrencyAmount = CurrencyAmount -exports.ETHER = ETHER -exports.Ether = Ether -exports.Fraction = Fraction -exports.MaxUint256 = MaxUint256 -exports.Percent = Percent -exports.Price = Price -exports.Token = Token -exports.WETH9 = WETH9 -exports.computePriceImpact = computePriceImpact -exports.currencyEquals = currencyEquals -exports.sortedInsert = sortedInsert -exports.sqrt = sqrt -exports.validateAndParseAddress = validateAndParseAddress -exports.wrappedCurrency = wrappedCurrency -exports.wrappedCurrencyAmount = wrappedCurrencyAmount -//# sourceMappingURL=sdk-core.cjs.development.js.map diff --git a/src/libs/sdk-core/dist/sdk-core.cjs.development.js.map b/src/libs/sdk-core/dist/sdk-core.cjs.development.js.map deleted file mode 100644 index fe7e30bda05..00000000000 --- a/src/libs/sdk-core/dist/sdk-core.cjs.development.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sdk-core.cjs.development.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import { Currency } from '../entities/currency'\n\n/**\n * Compares two currencies for equality\n */\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\n if (currencyA.isToken && currencyB.isToken) {\n return currencyA.equals(currencyB)\n } else if (currencyA.isToken) {\n return false\n } else if (currencyB.isToken) {\n return false\n } else {\n return currencyA.isEther === currencyB.isEther\n }\n}\n","import invariant from 'tiny-invariant'\n\n/**\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\n *\n * The only instance of the base class `Currency` is Ether.\n */\nexport abstract class BaseCurrency {\n public abstract readonly isEther: boolean\n public abstract readonly isToken: boolean\n\n public readonly decimals: number\n public readonly symbol?: string\n public readonly name?: string\n\n /**\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\n * @param decimals decimals of the currency\n * @param symbol symbol of the currency\n * @param name of the currency\n */\n protected constructor(decimals: number, symbol?: string, name?: string) {\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\n\n this.decimals = decimals\n this.symbol = symbol\n this.name = name\n }\n}\n","import { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents the currency Ether\n */\nexport class Ether extends BaseCurrency {\n public readonly isEther: true = true\n public readonly isToken: false = false\n\n /**\n * Only called once by this class\n * @protected\n */\n protected constructor() {\n super(18, 'ETH', 'Ether')\n }\n\n /**\n * The only instance of the class `Ether`.\n */\n public static readonly ETHER: Ether = new Ether()\n}\n\nexport const ETHER = Ether.ETHER\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport _Decimal from 'decimal.js-light'\nimport _Big, { RoundingMode } from 'big.js'\nimport toFormat from 'toformat'\n\nimport { BigintIsh, Rounding } from '../../constants'\n\nconst Decimal = toFormat(_Decimal)\nconst Big = toFormat(_Big)\n\nconst toSignificantRounding = {\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\n}\n\nconst toFixedRounding = {\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\n}\n\nexport class Fraction {\n public readonly numerator: JSBI\n public readonly denominator: JSBI\n\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\n this.numerator = JSBI.BigInt(numerator)\n this.denominator = JSBI.BigInt(denominator)\n }\n\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\n return new Fraction(fractionish)\n\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\n throw new Error('Could not parse fraction')\n }\n\n // performs floor division\n public get quotient(): JSBI {\n return JSBI.divide(this.numerator, this.denominator)\n }\n\n // remainder after floor division\n public get remainder(): Fraction {\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\n }\n\n public invert(): Fraction {\n return new Fraction(this.denominator, this.numerator)\n }\n\n public add(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.add(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public subtract(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.subtract(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public lessThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.lessThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public equalTo(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.equal(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public greaterThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.greaterThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public multiply(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.numerator),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public divide(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(this.denominator, otherParsed.numerator)\n )\n }\n\n public toSignificant(\n significantDigits: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\n\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\n const quotient = new Decimal(this.numerator.toString())\n .div(this.denominator.toString())\n .toSignificantDigits(significantDigits)\n return quotient.toFormat(quotient.decimalPlaces(), format)\n }\n\n public toFixed(\n decimalPlaces: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\n\n Big.DP = decimalPlaces\n Big.RM = toFixedRounding[rounding]\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\n }\n\n /**\n * Helper method for converting any super class back to a fraction\n */\n public get asFraction(): Fraction {\n return new Fraction(this.numerator, this.denominator)\n }\n}\n","import invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport { Currency } from '../currency'\nimport { Ether } from '../ether'\nimport { Fraction } from './fraction'\nimport _Big from 'big.js'\n\nimport toFormat from 'toformat'\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\n\nconst Big = toFormat(_Big)\n\nexport class CurrencyAmount extends Fraction {\n public readonly currency: T\n public readonly decimalScale: JSBI\n\n /**\n * Returns a new currency amount instance from the\n * @param currency the currency in the amount\n * @param rawAmount the raw token or ether amount\n */\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\n return new CurrencyAmount(currency, rawAmount)\n }\n\n /**\n * Construct a currency amount with a denominator that is not equal to 1\n * @param currency the currency\n * @param numerator the numerator of the fractional token amount\n * @param denominator the denominator of the fractional token amount\n */\n public static fromFractionalAmount(\n currency: T,\n numerator: BigintIsh,\n denominator: BigintIsh\n ): CurrencyAmount {\n return new CurrencyAmount(currency, numerator, denominator)\n }\n\n /**\n * Helper that calls the constructor with the ETHER currency\n * @param rawAmount ether amount in wei\n */\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\n }\n\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\n super(numerator, denominator)\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\n this.currency = currency\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\n }\n\n public add(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const added = super.add(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\n }\n\n public subtract(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const subtracted = super.subtract(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\n }\n\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\n const multiplied = super.multiply(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\n }\n\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\n const divided = super.divide(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\n }\n\n public toSignificant(\n significantDigits: number = 6,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(\n decimalPlaces: number = this.currency.decimals,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\n }\n\n public toExact(format: object = { groupSeparator: '' }): string {\n Big.DP = this.currency.decimals\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\n }\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Fraction } from './fraction'\n\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\n\n/**\n * Converts a fraction to a percent\n * @param fraction the fraction to convert\n */\nfunction toPercent(fraction: Fraction): Percent {\n return new Percent(fraction.numerator, fraction.denominator)\n}\n\nexport class Percent extends Fraction {\n /**\n * This boolean prevents a fraction from being interpreted as a Percent\n */\n public readonly isPercent: true = true\n\n add(other: Fraction | BigintIsh): Percent {\n return toPercent(super.add(other))\n }\n\n subtract(other: Fraction | BigintIsh): Percent {\n return toPercent(super.subtract(other))\n }\n\n multiply(other: Fraction | BigintIsh): Percent {\n return toPercent(super.multiply(other))\n }\n\n divide(other: Fraction | BigintIsh): Percent {\n return toPercent(super.divide(other))\n }\n\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\n }\n}\n","import JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport invariant from 'tiny-invariant'\n\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Currency } from '../currency'\nimport { Fraction } from './fraction'\nimport { CurrencyAmount } from './currencyAmount'\n\nexport class Price extends Fraction {\n public readonly baseCurrency: TBase // input i.e. denominator\n public readonly quoteCurrency: TQuote // output i.e. numerator\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\n\n // denominator and numerator _must_ be raw, i.e. in the native representation\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\n super(numerator, denominator)\n\n this.baseCurrency = baseCurrency\n this.quoteCurrency = quoteCurrency\n this.scalar = new Fraction(\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\n )\n }\n\n /**\n * Flip the price, switching the base and quote currency\n */\n public invert(): Price {\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\n }\n\n /**\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\n * @param other the other price\n */\n public multiply(other: Price): Price {\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\n const fraction = super.multiply(other)\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\n }\n\n /**\n * Return the amount of quote currency corresponding to a given amount of the base currency\n * @param currencyAmount the amount of base currency to quote against the price\n */\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\n const result = super.multiply(currencyAmount)\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\n }\n\n /**\n * Get the value scaled by decimals for formatting\n * @private\n */\n private get adjustedForDecimals(): Fraction {\n return super.multiply(this.scalar)\n }\n\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\n }\n}\n","import { getAddress } from '@ethersproject/address'\n\n/**\n * Validates an address and returns the parsed (checksummed) version of that address\n * @param address the unchecksummed hex address\n */\nexport function validateAndParseAddress(address: string): string {\n try {\n return getAddress(address)\n } catch (error) {\n throw new Error(`${address} is not a valid address.`)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\nimport { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents an ERC20 token with a unique address and some metadata.\n */\nexport class Token extends BaseCurrency {\n public readonly isEther: false = false\n public readonly isToken: true = true\n\n public readonly chainId: ChainId | number\n public readonly address: string\n\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\n super(decimals, symbol, name)\n this.chainId = chainId\n this.address = validateAndParseAddress(address)\n }\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Token): boolean {\n // short circuit on reference equality\n if (this === other) {\n return true\n }\n return this.chainId === other.chainId && this.address === other.address\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: Token): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n}\n\nexport const WETH9: { [chainId in ChainId]: Token } = {\n [ChainId.MAINNET]: new Token(\n ChainId.MAINNET,\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.ROPSTEN]: new Token(\n ChainId.ROPSTEN,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.RINKEBY]: new Token(\n ChainId.RINKEBY,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether')\n}\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\n\n/**\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\n * @param midPrice mid price before the trade\n * @param inputAmount the input amount of the trade\n * @param outputAmount the output amount of the trade\n */\nexport function computePriceImpact(\n midPrice: Price,\n inputAmount: CurrencyAmount,\n outputAmount: CurrencyAmount\n): Percent {\n const quotedOutputAmount = midPrice.quote(inputAmount)\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\n return new Percent(priceImpact.numerator, priceImpact.denominator)\n}\n","import invariant from 'tiny-invariant'\n\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\n// `maxSize` by removing the last item\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\n\n // short circuit first item add\n if (items.length === 0) {\n items.push(add)\n return null\n } else {\n const isFull = items.length === maxSize\n // short circuit if full and the additional item does not come before the last item\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\n return add\n }\n\n let lo = 0,\n hi = items.length\n\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (comparator(items[mid], add) <= 0) {\n lo = mid + 1\n } else {\n hi = mid\n }\n }\n items.splice(lo, 0, add)\n return isFull ? items.pop()! : null\n }\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\n\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\n\nconst ZERO = JSBI.BigInt(0)\nconst ONE = JSBI.BigInt(1)\nconst TWO = JSBI.BigInt(2)\n\n/**\n * Computes floor(sqrt(value))\n * @param value the value for which to compute the square root, rounded down\n */\nexport function sqrt(value: JSBI): JSBI {\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\n\n // rely on built in sqrt if possible\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\n }\n\n let z: JSBI\n let x: JSBI\n z = value\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\n while (JSBI.lessThan(x, z)) {\n z = x\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\n }\n return z\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { Currency, Token, WETH9 } from '../entities'\n\n/**\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\n * @param currency the currency to wrap, if necessary\n * @param chainId the ID of the chain for wrapping\n */\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\n if (currency.isToken) {\n invariant(currency.chainId === chainId, 'CHAIN_ID')\n return currency\n }\n if (currency.isEther) return WETH9[chainId]\n throw new Error('CURRENCY')\n}\n","import { ChainId } from '../constants'\nimport { Currency, CurrencyAmount, Token } from '../entities'\nimport { wrappedCurrency } from './wrappedCurrency'\n\n/**\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\n * the input currency amount.\n */\nexport function wrappedCurrencyAmount(\n currencyAmount: CurrencyAmount,\n chainId: ChainId\n): CurrencyAmount {\n return CurrencyAmount.fromFractionalAmount(\n wrappedCurrency(currencyAmount.currency, chainId),\n currencyAmount.numerator,\n currencyAmount.denominator\n )\n}\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","added","subtracted","multiplied","divided","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","computePriceImpact","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","sortedInsert","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","MAX_SAFE_INTEGER","ZERO","ONE","TWO","sqrt","value","greaterThanOrEqual","Math","floor","toNumber","z","x","wrappedCurrency","wrappedCurrencyAmount"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AgCA,CAAhC,CAAZ,EAAgDR,GAAhD,CAAJ;AACD;;AACD,SAAOO,CAAP;AACD;;AC1BD;;;;;;AAKA,SAAgBE,gBAAgBrE,UAAoB8B;AAClD,MAAI9B,QAAQ,CAACxD,OAAb,EAAsB;AACpB,MAAUwD,QAAQ,CAAC8B,OAAT,KAAqBA,OAA/B,KAAA7E,SAAS,QAA+B,UAA/B,CAAT,CAAA;AACA,WAAO+C,QAAP;AACD;;AACD,MAAIA,QAAQ,CAACtD,OAAb,EAAsB,OAAOuF,KAAK,CAACH,OAAD,CAAZ;AACtB,QAAM,IAAI3D,KAAJ,CAAU,UAAV,CAAN;AACD;;ACZD;;;;;;AAKA,SAAgBmG,sBACdhD,gBACAQ;AAEA,SAAO/B,cAAc,CAACO,oBAAf,CACL+D,eAAe,CAAC/C,cAAc,CAACtB,QAAhB,EAA0B8B,OAA1B,CADV,EAELR,cAAc,CAACvD,SAFV,EAGLuD,cAAc,CAACtD,WAHV,CAAP;AAKD;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/src/libs/sdk-core/dist/sdk-core.esm.js b/src/libs/sdk-core/dist/sdk-core.esm.js index 27ba2671107..fe37fd776e1 100644 --- a/src/libs/sdk-core/dist/sdk-core.esm.js +++ b/src/libs/sdk-core/dist/sdk-core.esm.js @@ -102,10 +102,10 @@ var Ether = /*#__PURE__*/ (function (_BaseCurrency) { * Only called once by this class * @protected */ - function Ether() { + function Ether(symbol = 'ETH', name = 'Ether') { var _this - _this = _BaseCurrency.call(this, 18, 'ETH', 'Ether') || this + _this = _BaseCurrency.call(this, 18, symbol, name) || this _this.isEther = true _this.isToken = false return _this From 9eff17fb4c69a9c248e8c247e6b19529b104ca1e Mon Sep 17 00:00:00 2001 From: alagunoff Date: Thu, 26 Dec 2024 17:31:24 +0300 Subject: [PATCH 17/30] feat: add bases for trade for polygon amoy --- src/constants/addresses.ts | 9 ++++++++- src/constants/routing.ts | 7 +++++++ src/hooks/useUSDCPrice.ts | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 27c5e44e6f4..561ed787c0c 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -21,7 +21,14 @@ export const ARGENT_WALLET_DETECTOR_ADDRESS: { [chainId in ChainId]?: string } = [ChainId.MAINNET]: '0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8', } export const V3_CORE_FACTORY_ADDRESSES = constructSameAddressMap(V3_FACTORY_ADDRESS) -export const QUOTER_ADDRESSES = constructSameAddressMap('0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6') +export const QUOTER_ADDRESSES = { + [ChainId.MAINNET]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', + [ChainId.ROPSTEN]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', + [ChainId.RINKEBY]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', + [ChainId.GÖRLI]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', + [ChainId.KOVAN]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', + [ChainId.POLYGON_AMOY]: '0x81f1D9f16D42eF8009d14217cD3C0BE1B73494C0', +} export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = constructSameAddressMap( '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' ) diff --git a/src/constants/routing.ts b/src/constants/routing.ts index d74a9c63580..8428da87562 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -56,6 +56,13 @@ const WETH_ONLY: ChainTokenList = { export const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = { ...WETH_ONLY, [ChainId.MAINNET]: [...WETH_ONLY[ChainId.MAINNET], DAI, USDC, USDT, WBTC], + [ChainId.POLYGON_AMOY]: [ + ...WETH_ONLY[ChainId.POLYGON_AMOY], + METALAMP, + USDC_POLYGON_AMOY, + USDT_POLYGON_AMOY, + WBTC_POLYGON_AMOY, + ], } export const ADDITIONAL_BASES: { [chainId in ChainId]?: { [tokenAddress: string]: Token[] } } = { [ChainId.MAINNET]: { diff --git a/src/hooks/useUSDCPrice.ts b/src/hooks/useUSDCPrice.ts index 4804472bbdb..3883cfe3db4 100644 --- a/src/hooks/useUSDCPrice.ts +++ b/src/hooks/useUSDCPrice.ts @@ -27,7 +27,7 @@ export default function useUSDCPrice(currency?: Currency): Price Date: Fri, 27 Dec 2024 12:46:54 +0300 Subject: [PATCH 18/30] refactor: merge two usdc tokens --- src/components/PositionListItem/index.tsx | 4 +-- src/constants/addresses.ts | 9 ++++++- src/constants/routing.ts | 13 +++++----- src/constants/tokens.ts | 19 ++++++++------ src/hooks/useERC20Permit.ts | 2 +- src/hooks/useUSDCPrice.ts | 30 +++++++++++++++++------ src/state/stake/hooks.ts | 2 +- 7 files changed, 52 insertions(+), 27 deletions(-) diff --git a/src/components/PositionListItem/index.tsx b/src/components/PositionListItem/index.tsx index 638b9fd583b..2c67b1ab275 100644 --- a/src/components/PositionListItem/index.tsx +++ b/src/components/PositionListItem/index.tsx @@ -8,7 +8,7 @@ import { Link } from 'react-router-dom' import styled from 'styled-components/macro' import { HideSmall, MEDIA_WIDTHS, SmallOnly } from 'theme' import { PositionDetails } from 'types/position' -import { WETH9, Price, Token, Percent } from '../../libs/sdk-core' +import { WETH9, Price, Token, Percent, ChainId } from '../../libs/sdk-core' import { formatPrice } from 'utils/formatTokenAmount' import Loader from 'components/Loader' import { unwrappedToken } from 'utils/wrappedCurrency' @@ -134,7 +134,7 @@ export function getPriceOrderingFromPositionForUI( const token1 = position.amount1.currency // if token0 is a dollar-stable asset, set it as the quote token - const stables = [DAI, USDC, USDT] + const stables = [DAI, USDC[ChainId.MAINNET], USDT] if (stables.some((stable) => stable.equals(token0))) { return { priceLower: position.token0PriceUpper.invert(), diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 561ed787c0c..906a4b2a738 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -20,7 +20,14 @@ export const MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = { export const ARGENT_WALLET_DETECTOR_ADDRESS: { [chainId in ChainId]?: string } = { [ChainId.MAINNET]: '0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8', } -export const V3_CORE_FACTORY_ADDRESSES = constructSameAddressMap(V3_FACTORY_ADDRESS) +export const V3_CORE_FACTORY_ADDRESSES = { + [ChainId.MAINNET]: V3_FACTORY_ADDRESS, + [ChainId.ROPSTEN]: V3_FACTORY_ADDRESS, + [ChainId.RINKEBY]: V3_FACTORY_ADDRESS, + [ChainId.GÖRLI]: V3_FACTORY_ADDRESS, + [ChainId.KOVAN]: V3_FACTORY_ADDRESS, + [ChainId.POLYGON_AMOY]: '0x8fa8F86d4339afdC0A1911E8C8b22bF096DBeC65', +} export const QUOTER_ADDRESSES = { [ChainId.MAINNET]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', [ChainId.ROPSTEN]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', diff --git a/src/constants/routing.ts b/src/constants/routing.ts index 8428da87562..fdaf2382217 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -17,7 +17,6 @@ import { WBTC, METALAMP, USDT_POLYGON_AMOY, - USDC_POLYGON_AMOY, WBTC_POLYGON_AMOY, } from './tokens' @@ -55,11 +54,11 @@ const WETH_ONLY: ChainTokenList = { // used to construct intermediary pairs for trading export const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = { ...WETH_ONLY, - [ChainId.MAINNET]: [...WETH_ONLY[ChainId.MAINNET], DAI, USDC, USDT, WBTC], + [ChainId.MAINNET]: [...WETH_ONLY[ChainId.MAINNET], DAI, USDC[ChainId.MAINNET], USDT, WBTC], [ChainId.POLYGON_AMOY]: [ ...WETH_ONLY[ChainId.POLYGON_AMOY], METALAMP, - USDC_POLYGON_AMOY, + USDC[ChainId.POLYGON_AMOY], USDT_POLYGON_AMOY, WBTC_POLYGON_AMOY, ], @@ -89,13 +88,13 @@ export const CUSTOM_BASES: { [chainId in ChainId]?: { [tokenAddress: string]: To } // used for display in the default list when adding liquidity export const SUGGESTED_BASES: Partial = { - [ChainId.MAINNET]: [DAI, USDC, USDT, WBTC], - [ChainId.POLYGON_AMOY]: [METALAMP, USDT_POLYGON_AMOY, USDC_POLYGON_AMOY, WBTC_POLYGON_AMOY], + [ChainId.MAINNET]: [DAI, USDC[ChainId.MAINNET], USDT, WBTC], + [ChainId.POLYGON_AMOY]: [METALAMP, USDT_POLYGON_AMOY, USDC[ChainId.POLYGON_AMOY], WBTC_POLYGON_AMOY], } // used to construct the list of all pairs we consider by default in the frontend export const BASES_TO_TRACK_LIQUIDITY_FOR: ChainTokenList = { ...WETH_ONLY, - [ChainId.MAINNET]: [...WETH_ONLY[ChainId.MAINNET], DAI, USDC, USDT, WBTC], + [ChainId.MAINNET]: [...WETH_ONLY[ChainId.MAINNET], DAI, USDC[ChainId.MAINNET], USDT, WBTC], } export const PINNED_PAIRS: { readonly [chainId in ChainId]?: [Token, Token][] } = { [ChainId.MAINNET]: [ @@ -103,7 +102,7 @@ export const PINNED_PAIRS: { readonly [chainId in ChainId]?: [Token, Token][] } new Token(ChainId.MAINNET, '0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643', 8, 'cDAI', 'Compound Dai'), new Token(ChainId.MAINNET, '0x39AA39c021dfbaE8faC545936693aC917d5E7563', 8, 'cUSDC', 'Compound USD Coin'), ], - [USDC, USDT], + [USDC[ChainId.MAINNET], USDT], [DAI, USDT], ], } diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index ea641f2568b..63320b4a561 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -3,14 +3,17 @@ import { UNI_ADDRESS } from './addresses' export const AMPL = new Token(ChainId.MAINNET, '0xD46bA6D942050d489DBd938a2C909A5d5039A161', 9, 'AMPL', 'Ampleforth') export const DAI = new Token(ChainId.MAINNET, '0x6B175474E89094C44Da98b954EedeAC495271d0F', 18, 'DAI', 'Dai Stablecoin') -export const USDC = new Token(ChainId.MAINNET, '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 6, 'USDC', 'USD//C') -export const USDC_POLYGON_AMOY = new Token( - ChainId.POLYGON_AMOY, - '0x24BD3A3EeabC51f11Ff724F4D0ed4b52569952c2', - 6, - 'USDC', - 'USD Coin' -) +export const USDC = { + [ChainId.MAINNET]: new Token(ChainId.MAINNET, '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 6, 'USDC', 'USD//C'), + [ChainId.POLYGON_AMOY]: new Token( + ChainId.POLYGON_AMOY, + '0x24BD3A3EeabC51f11Ff724F4D0ed4b52569952c2', + 6, + 'USDC', + 'USD Coin' + ), +} + export const USDT = new Token(ChainId.MAINNET, '0xdAC17F958D2ee523a2206206994597C13D831ec7', 6, 'USDT', 'Tether USD') export const USDT_POLYGON_AMOY = new Token( ChainId.POLYGON_AMOY, diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index 48bb47a2875..0376293f4f3 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -34,7 +34,7 @@ const PERMITTABLE_TOKENS: { } } = { [ChainId.MAINNET]: { - [USDC.address]: { type: PermitType.AMOUNT, name: 'USD Coin', version: '2' }, + [USDC[ChainId.MAINNET].address]: { type: PermitType.AMOUNT, name: 'USD Coin', version: '2' }, [DAI.address]: { type: PermitType.ALLOWED, name: 'Dai Stablecoin', version: '1' }, [UNI[ChainId.MAINNET].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, }, diff --git a/src/hooks/useUSDCPrice.ts b/src/hooks/useUSDCPrice.ts index 3883cfe3db4..594e5498659 100644 --- a/src/hooks/useUSDCPrice.ts +++ b/src/hooks/useUSDCPrice.ts @@ -7,7 +7,8 @@ import { useActiveWeb3React } from './web3' // USDC amount used when calculating spot price for a given currency. // The amount is large enough to filter low liquidity pairs. -const usdcCurrencyAmount = CurrencyAmount.fromRawAmount(USDC, 100_000e6) +const usdcCurrencyAmountMainnet = CurrencyAmount.fromRawAmount(USDC[ChainId.MAINNET], 100_000e6) +const usdcCurrencyAmountPolygonAmoy = CurrencyAmount.fromRawAmount(USDC[ChainId.POLYGON_AMOY], 100_000e6) /** * Returns the price in USDC of the input currency @@ -16,10 +17,25 @@ const usdcCurrencyAmount = CurrencyAmount.fromRawAmount(USDC, 100_000e6) export default function useUSDCPrice(currency?: Currency): Price | undefined { const { chainId } = useActiveWeb3React() - const v2USDCTrade = useV2TradeExactOut(currency, chainId === ChainId.MAINNET ? usdcCurrencyAmount : undefined, { - maxHops: 2, - }) - const v3USDCTrade = useBestV3TradeExactOut(currency, chainId === ChainId.MAINNET ? usdcCurrencyAmount : undefined) + const v2USDCTrade = useV2TradeExactOut( + currency, + chainId === ChainId.MAINNET + ? usdcCurrencyAmountMainnet + : chainId === ChainId.POLYGON_AMOY + ? usdcCurrencyAmountPolygonAmoy + : undefined, + { + maxHops: 2, + } + ) + const v3USDCTrade = useBestV3TradeExactOut( + currency, + chainId === ChainId.MAINNET + ? usdcCurrencyAmountMainnet + : chainId === ChainId.POLYGON_AMOY + ? usdcCurrencyAmountPolygonAmoy + : undefined + ) return useMemo(() => { if (!currency || !chainId) { @@ -40,10 +56,10 @@ export default function useUSDCPrice(currency?: Currency): Price Date: Fri, 27 Dec 2024 15:34:12 +0300 Subject: [PATCH 19/30] feat: add position manager contract address for polygon amoy --- src/constants/addresses.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 906a4b2a738..ba94e9c4ac8 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -36,9 +36,14 @@ export const QUOTER_ADDRESSES = { [ChainId.KOVAN]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', [ChainId.POLYGON_AMOY]: '0x81f1D9f16D42eF8009d14217cD3C0BE1B73494C0', } -export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = constructSameAddressMap( - '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' -) +export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = { + [ChainId.MAINNET]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', + [ChainId.ROPSTEN]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', + [ChainId.RINKEBY]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', + [ChainId.GÖRLI]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', + [ChainId.KOVAN]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', + [ChainId.POLYGON_AMOY]: '0xeE925437D6b4be09883dA245050268Ac2AEE752b', +} export const ENS_REGISTRAR_ADDRESSES = { [ChainId.MAINNET]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', [ChainId.GÖRLI]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', From 501d3acb4785f037401ffd56bb598e0e749f54f2 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Fri, 27 Dec 2024 19:08:11 +0300 Subject: [PATCH 20/30] feat: fork v2-sdk and v3-sdk; use data only for publishing in sdk-core --- package.json | 11 +- .../CurrencyInputPanel/FiatValue.tsx | 2 +- src/components/CurrencyInputPanel/index.tsx | 2 +- src/components/CurrencyLogo/index.tsx | 2 +- src/components/DoubleLogo/index.tsx | 2 +- .../FormattedCurrencyAmount/index.tsx | 2 +- src/components/Header/UniBalanceContent.tsx | 2 +- src/components/Header/index.tsx | 2 +- src/components/NavigationTabs/index.tsx | 2 +- src/components/Popups/ClaimPopup.tsx | 2 +- src/components/PositionCard/Sushi.tsx | 2 +- src/components/PositionCard/V2.tsx | 2 +- src/components/PositionCard/index.tsx | 2 +- src/components/PositionListItem/index.tsx | 2 +- src/components/PositionPreview/index.tsx | 2 +- src/components/RangeSelector/index.tsx | 2 +- src/components/RateToggle/index.tsx | 2 +- src/components/SearchModal/CommonBases.tsx | 2 +- src/components/SearchModal/CurrencyList.tsx | 2 +- src/components/SearchModal/CurrencySearch.tsx | 2 +- .../SearchModal/CurrencySearchModal.tsx | 2 +- src/components/SearchModal/ImportRow.tsx | 2 +- src/components/SearchModal/ImportToken.tsx | 2 +- src/components/SearchModal/Manage.tsx | 2 +- src/components/SearchModal/ManageTokens.tsx | 2 +- src/components/SearchModal/filtering.ts | 2 +- src/components/SearchModal/sorting.ts | 2 +- src/components/Settings/index.tsx | 2 +- src/components/TokenWarningModal/index.tsx | 2 +- .../TransactionConfirmationModal/index.tsx | 2 +- src/components/TransactionSettings/index.tsx | 2 +- src/components/claim/AddressClaimModal.tsx | 2 +- src/components/claim/ClaimModal.tsx | 2 +- src/components/earn/PoolCard.tsx | 2 +- src/components/earn/StakingModal.tsx | 2 +- src/components/swap/AdvancedSwapDetails.tsx | 2 +- src/components/swap/ConfirmSwapModal.tsx | 2 +- src/components/swap/FormattedPriceImpact.tsx | 2 +- src/components/swap/SwapHeader.tsx | 2 +- src/components/swap/SwapModalFooter.tsx | 2 +- src/components/swap/SwapModalHeader.tsx | 2 +- src/components/swap/SwapRoute.tsx | 2 +- src/components/swap/TradePrice.tsx | 2 +- .../swap/UnsupportedCurrencyFooter.tsx | 2 +- .../swap/confirmPriceImpactWithoutFee.ts | 2 +- src/components/vote/VoteModal.tsx | 2 +- src/connectors/Fortmatic.ts | 2 +- src/connectors/index.ts | 2 +- src/constants/addresses.ts | 2 +- src/constants/governance.ts | 2 +- src/constants/misc.ts | 2 +- src/constants/routing.ts | 2 +- src/constants/tokens.ts | 2 +- src/hooks/Tokens.ts | 6 +- src/hooks/useAddTokenToMetamask.ts | 2 +- src/hooks/useAllCurrencyCombinations.ts | 2 +- src/hooks/useAllV3Routes.ts | 2 +- src/hooks/useApproveCallback.ts | 2 +- src/hooks/useBestV3Trade.ts | 2 +- src/hooks/useColor.ts | 2 +- src/hooks/useContract.ts | 2 +- src/hooks/useERC20Permit.ts | 2 +- src/hooks/useFetchListCallback.ts | 2 +- src/hooks/useIsSwapUnsupported.ts | 2 +- src/hooks/usePools.ts | 2 +- src/hooks/useSwapCallback.ts | 2 +- src/hooks/useSwapSlippageTolerance.ts | 2 +- src/hooks/useTickToPrice.ts | 2 +- src/hooks/useTokenAllowance.ts | 2 +- src/hooks/useTotalSupply.ts | 2 +- src/hooks/useUSDCPrice.ts | 2 +- src/hooks/useV2Pairs.ts | 2 +- src/hooks/useV2Trade.ts | 2 +- src/hooks/useV3PositionFees.ts | 2 +- src/hooks/useV3SwapPools.ts | 2 +- src/hooks/useWrapCallback.ts | 2 +- src/hooks/web3.ts | 2 +- src/libs/sdk-core/.gitignore | 38 - src/libs/sdk-core/LICENSE | 21 - src/libs/sdk-core/README.md | 8 - src/libs/sdk-core/dist/constants.d.ts | 20 - .../sdk-core/dist/entities/baseCurrency.d.ts | 19 - src/libs/sdk-core/dist/entities/currency.d.ts | 3 - src/libs/sdk-core/dist/entities/ether.d.ts | 14 - .../entities/fractions/currencyAmount.d.ts | 35 - .../dist/entities/fractions/fraction.d.ts | 24 - .../dist/entities/fractions/index.d.ts | 4 - .../dist/entities/fractions/percent.d.ts | 14 - .../dist/entities/fractions/price.d.ts | 31 - src/libs/sdk-core/dist/entities/index.d.ts | 4 - src/libs/sdk-core/dist/entities/token.d.ts | 27 - src/libs/sdk-core/dist/index.d.ts | 3 - src/libs/sdk-core/dist/index.js | 3 - src/libs/sdk-core/dist/sdk-core.esm.js | 855 --- src/libs/sdk-core/dist/sdk-core.esm.js.map | 1 - .../dist/utils/computePriceImpact.d.ts | 8 - .../sdk-core/dist/utils/currencyEquals.d.ts | 5 - src/libs/sdk-core/dist/utils/index.d.ts | 7 - .../sdk-core/dist/utils/sortedInsert.d.ts | 1 - src/libs/sdk-core/dist/utils/sqrt.d.ts | 7 - .../dist/utils/validateAndParseAddress.d.ts | 5 - .../sdk-core/dist/utils/wrappedCurrency.d.ts | 8 - .../dist/utils/wrappedCurrencyAmount.d.ts | 11 - src/libs/sdk-core/package.json | 44 - src/libs/sdk-core/yarn.lock | 6823 ----------------- src/pages/AddLiquidity/PoolPriceBar.tsx | 2 +- src/pages/AddLiquidity/Review.tsx | 2 +- src/pages/AddLiquidity/index.tsx | 4 +- src/pages/AddLiquidity/redirects.tsx | 2 +- .../AddLiquidityV2/ConfirmAddModalBottom.tsx | 2 +- src/pages/AddLiquidityV2/PoolPriceBar.tsx | 2 +- src/pages/AddLiquidityV2/index.tsx | 2 +- src/pages/Earn/Manage.tsx | 2 +- src/pages/MigrateV2/MigrateV2Pair.tsx | 2 +- src/pages/MigrateV2/index.tsx | 2 +- src/pages/Pool/PositionPage.tsx | 2 +- src/pages/PoolFinder/index.tsx | 2 +- src/pages/RemoveLiquidity/V3.tsx | 2 +- src/pages/RemoveLiquidity/index.tsx | 2 +- src/pages/Swap/index.tsx | 2 +- src/pages/Vote/VotePage.tsx | 2 +- src/pages/Vote/index.tsx | 2 +- src/state/application/reducer.test.ts | 2 +- src/state/application/reducer.ts | 2 +- src/state/burn/hooks.ts | 2 +- src/state/burn/v3/hooks.ts | 2 +- src/state/claim/hooks.ts | 2 +- src/state/governance/hooks.ts | 2 +- src/state/lists/actions.ts | 2 +- src/state/lists/hooks.ts | 2 +- src/state/lists/reducer.test.ts | 2 +- src/state/lists/reducer.ts | 2 +- src/state/lists/updater.ts | 2 +- src/state/lists/wrappedTokenInfo.ts | 2 +- src/state/mint/hooks.ts | 2 +- src/state/mint/v3/hooks.ts | 2 +- src/state/mint/v3/utils.ts | 2 +- src/state/stake/hooks.ts | 2 +- src/state/swap/hooks.ts | 2 +- src/state/transactions/actions.ts | 2 +- src/state/transactions/reducer.test.ts | 2 +- src/state/user/hooks.tsx | 2 +- src/state/wallet/hooks.ts | 2 +- src/utils/calculateSlippageAmount.test.ts | 2 +- src/utils/calculateSlippageAmount.ts | 2 +- src/utils/computeFiatValuePriceImpact.tsx | 2 +- src/utils/computeUniCirculation.test.ts | 2 +- src/utils/computeUniCirculation.ts | 2 +- src/utils/constructSameAddressMap.ts | 2 +- src/utils/currencyId.ts | 2 +- src/utils/formatTokenAmount.ts | 2 +- src/utils/getExplorerLink.test.ts | 2 +- src/utils/getExplorerLink.ts | 2 +- src/utils/getTickToPrice.ts | 2 +- src/utils/getTradeVersion.ts | 2 +- src/utils/index.ts | 2 +- src/utils/isTradeBetter.ts | 2 +- src/utils/maxAmountSpend.ts | 2 +- src/utils/prices.test.ts | 2 +- src/utils/prices.ts | 2 +- src/utils/supportedChainId.ts | 2 +- src/utils/wrappedCurrency.ts | 2 +- yarn.lock | 18 +- 163 files changed, 146 insertions(+), 8198 deletions(-) delete mode 100644 src/libs/sdk-core/.gitignore delete mode 100644 src/libs/sdk-core/LICENSE delete mode 100644 src/libs/sdk-core/README.md delete mode 100644 src/libs/sdk-core/dist/constants.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/baseCurrency.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/currency.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/ether.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/fractions/currencyAmount.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/fractions/fraction.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/fractions/index.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/fractions/percent.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/fractions/price.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/index.d.ts delete mode 100644 src/libs/sdk-core/dist/entities/token.d.ts delete mode 100644 src/libs/sdk-core/dist/index.d.ts delete mode 100644 src/libs/sdk-core/dist/index.js delete mode 100644 src/libs/sdk-core/dist/sdk-core.esm.js delete mode 100644 src/libs/sdk-core/dist/sdk-core.esm.js.map delete mode 100644 src/libs/sdk-core/dist/utils/computePriceImpact.d.ts delete mode 100644 src/libs/sdk-core/dist/utils/currencyEquals.d.ts delete mode 100644 src/libs/sdk-core/dist/utils/index.d.ts delete mode 100644 src/libs/sdk-core/dist/utils/sortedInsert.d.ts delete mode 100644 src/libs/sdk-core/dist/utils/sqrt.d.ts delete mode 100644 src/libs/sdk-core/dist/utils/validateAndParseAddress.d.ts delete mode 100644 src/libs/sdk-core/dist/utils/wrappedCurrency.d.ts delete mode 100644 src/libs/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts delete mode 100644 src/libs/sdk-core/package.json delete mode 100644 src/libs/sdk-core/yarn.lock diff --git a/package.json b/package.json index 0b78a99814a..98133ee5454 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,10 @@ "@uniswap/token-lists": "^1.0.0-beta.19", "@uniswap/v2-core": "1.0.0", "@uniswap/v2-periphery": "^1.1.0-beta.0", - "@uniswap/v2-sdk": "^3.0.0-alpha.0", + "@uniswap/v2-sdk": "file:./uniswap-packages-forks/v2-sdk", "@uniswap/v3-core": "1.0.0", "@uniswap/v3-periphery": "1.0.0", - "@uniswap/v3-sdk": "^3.0.0-alpha.6", + "@uniswap/v3-sdk": "file:./uniswap-packages-forks/v3-sdk", "@web3-react/core": "^6.0.9", "@web3-react/fortmatic-connector": "^6.0.9", "@web3-react/injected-connector": "^6.0.7", @@ -104,8 +104,7 @@ "workbox-strategies": "^6.1.0" }, "resolutions": { - "@walletconnect/web3-provider": "1.4.2-rc.2", - "jsbi": "^3.2.5" + "@walletconnect/web3-provider": "1.4.2-rc.2" }, "scripts": { "compile-contract-types": "yarn compile-external-abi-types && yarn compile-v3-core-contract-types && yarn compile-v3-periphery-contract-types", @@ -136,7 +135,5 @@ ] }, "license": "GPL-3.0-or-later", - "dependencies": { - "jsbi": "^3.1.4" - } + "dependencies": {} } diff --git a/src/components/CurrencyInputPanel/FiatValue.tsx b/src/components/CurrencyInputPanel/FiatValue.tsx index deb0857e9d1..e94d553400e 100644 --- a/src/components/CurrencyInputPanel/FiatValue.tsx +++ b/src/components/CurrencyInputPanel/FiatValue.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Percent } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core' import React, { useMemo } from 'react' import useTheme from '../../hooks/useTheme' import { TYPE } from '../../theme' diff --git a/src/components/CurrencyInputPanel/index.tsx b/src/components/CurrencyInputPanel/index.tsx index 77c992f449a..db70a905f79 100644 --- a/src/components/CurrencyInputPanel/index.tsx +++ b/src/components/CurrencyInputPanel/index.tsx @@ -1,5 +1,5 @@ import { Pair } from '@uniswap/v2-sdk' -import { Currency, CurrencyAmount, Percent, Token } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' import React, { useState, useCallback } from 'react' import styled from 'styled-components/macro' import { darken } from 'polished' diff --git a/src/components/CurrencyLogo/index.tsx b/src/components/CurrencyLogo/index.tsx index 9e423ba8823..855d9a2db84 100644 --- a/src/components/CurrencyLogo/index.tsx +++ b/src/components/CurrencyLogo/index.tsx @@ -1,4 +1,4 @@ -import { ChainId, Currency } from '../../libs/sdk-core' +import { ChainId, Currency } from '@uniswap/sdk-core' import React, { useMemo } from 'react' import styled from 'styled-components/macro' import EthereumLogo from '../../assets/images/ethereum-logo.png' diff --git a/src/components/DoubleLogo/index.tsx b/src/components/DoubleLogo/index.tsx index c9688e7040c..b8828073e49 100644 --- a/src/components/DoubleLogo/index.tsx +++ b/src/components/DoubleLogo/index.tsx @@ -1,4 +1,4 @@ -import { Currency } from '../../libs/sdk-core' +import { Currency } from '@uniswap/sdk-core' import React from 'react' import styled from 'styled-components/macro' import CurrencyLogo from '../CurrencyLogo' diff --git a/src/components/FormattedCurrencyAmount/index.tsx b/src/components/FormattedCurrencyAmount/index.tsx index 3829ce74a7c..5421ad22ebc 100644 --- a/src/components/FormattedCurrencyAmount/index.tsx +++ b/src/components/FormattedCurrencyAmount/index.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React from 'react' -import { Currency, CurrencyAmount, Fraction } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, Fraction } from '@uniswap/sdk-core' const CURRENCY_AMOUNT_MIN = new Fraction(JSBI.BigInt(1), JSBI.BigInt(1000000)) diff --git a/src/components/Header/UniBalanceContent.tsx b/src/components/Header/UniBalanceContent.tsx index 7e8a483fc28..deed875fa9f 100644 --- a/src/components/Header/UniBalanceContent.tsx +++ b/src/components/Header/UniBalanceContent.tsx @@ -1,4 +1,4 @@ -import { ChainId, CurrencyAmount, Token } from '../../libs/sdk-core' +import { ChainId, CurrencyAmount, Token } from '@uniswap/sdk-core' import React, { useMemo } from 'react' import { X } from 'react-feather' import styled from 'styled-components/macro' diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 4fd430f4ec7..cc84a6982bd 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -1,4 +1,4 @@ -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import useScrollPosition from '@react-hook/window-scroll' import React, { useState } from 'react' import { Text } from 'rebass' diff --git a/src/components/NavigationTabs/index.tsx b/src/components/NavigationTabs/index.tsx index adf5bf4ba00..d6acc5c3d42 100644 --- a/src/components/NavigationTabs/index.tsx +++ b/src/components/NavigationTabs/index.tsx @@ -3,7 +3,7 @@ import styled from 'styled-components/macro' import { darken } from 'polished' import { useTranslation } from 'react-i18next' import { NavLink, Link as HistoryLink } from 'react-router-dom' -import { Percent } from '../../libs/sdk-core' +import { Percent } from '@uniswap/sdk-core' import { ArrowLeft } from 'react-feather' import { RowBetween } from '../Row' diff --git a/src/components/Popups/ClaimPopup.tsx b/src/components/Popups/ClaimPopup.tsx index 5925d7680ac..f1ca2b0edc9 100644 --- a/src/components/Popups/ClaimPopup.tsx +++ b/src/components/Popups/ClaimPopup.tsx @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '../../libs/sdk-core' +import { CurrencyAmount, Token } from '@uniswap/sdk-core' import React, { useEffect } from 'react' import { X } from 'react-feather' import styled, { keyframes } from 'styled-components' diff --git a/src/components/PositionCard/Sushi.tsx b/src/components/PositionCard/Sushi.tsx index ec5a2d010f0..f6619403a1a 100644 --- a/src/components/PositionCard/Sushi.tsx +++ b/src/components/PositionCard/Sushi.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Token } from '../../libs/sdk-core' +import { Token } from '@uniswap/sdk-core' import { Link } from 'react-router-dom' import { Text } from 'rebass' import styled from 'styled-components/macro' diff --git a/src/components/PositionCard/V2.tsx b/src/components/PositionCard/V2.tsx index 3bae33a4055..233022e17f2 100644 --- a/src/components/PositionCard/V2.tsx +++ b/src/components/PositionCard/V2.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React, { useState } from 'react' -import { Percent, CurrencyAmount, Token } from '../../libs/sdk-core' +import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core' import { Pair } from '@uniswap/v2-sdk' import { ChevronDown, ChevronUp } from 'react-feather' import { Link } from 'react-router-dom' diff --git a/src/components/PositionCard/index.tsx b/src/components/PositionCard/index.tsx index 04148a25fde..ee7de8d4348 100644 --- a/src/components/PositionCard/index.tsx +++ b/src/components/PositionCard/index.tsx @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Percent, CurrencyAmount, Token } from '../../libs/sdk-core' +import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core' import { Pair } from '@uniswap/v2-sdk' import { darken } from 'polished' import React, { useState } from 'react' diff --git a/src/components/PositionListItem/index.tsx b/src/components/PositionListItem/index.tsx index 2c67b1ab275..383992036ef 100644 --- a/src/components/PositionListItem/index.tsx +++ b/src/components/PositionListItem/index.tsx @@ -8,7 +8,7 @@ import { Link } from 'react-router-dom' import styled from 'styled-components/macro' import { HideSmall, MEDIA_WIDTHS, SmallOnly } from 'theme' import { PositionDetails } from 'types/position' -import { WETH9, Price, Token, Percent, ChainId } from '../../libs/sdk-core' +import { WETH9, Price, Token, Percent, ChainId } from '@uniswap/sdk-core' import { formatPrice } from 'utils/formatTokenAmount' import Loader from 'components/Loader' import { unwrappedToken } from 'utils/wrappedCurrency' diff --git a/src/components/PositionPreview/index.tsx b/src/components/PositionPreview/index.tsx index 6648d8a4619..839fee08cf8 100644 --- a/src/components/PositionPreview/index.tsx +++ b/src/components/PositionPreview/index.tsx @@ -8,7 +8,7 @@ import CurrencyLogo from 'components/CurrencyLogo' import { unwrappedToken } from 'utils/wrappedCurrency' import { Break } from 'components/earn/styled' import { useTranslation } from 'react-i18next' -import { Currency } from '../../libs/sdk-core' +import { Currency } from '@uniswap/sdk-core' import RateToggle from 'components/RateToggle' import DoubleCurrencyLogo from 'components/DoubleLogo' import RangeBadge from 'components/Badge/RangeBadge' diff --git a/src/components/RangeSelector/index.tsx b/src/components/RangeSelector/index.tsx index 23e8e7f9bb4..ad153cb16a6 100644 --- a/src/components/RangeSelector/index.tsx +++ b/src/components/RangeSelector/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Currency, Price, Token } from '../../libs/sdk-core' +import { Currency, Price, Token } from '@uniswap/sdk-core' import StepCounter from 'components/InputStepCounter/InputStepCounter' import { RowBetween } from 'components/Row' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/components/RateToggle/index.tsx b/src/components/RateToggle/index.tsx index 39b5005d828..30d68b7266c 100644 --- a/src/components/RateToggle/index.tsx +++ b/src/components/RateToggle/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Currency } from '../../libs/sdk-core' +import { Currency } from '@uniswap/sdk-core' import { ToggleElement, ToggleWrapper } from 'components/Toggle/MultiToggle' import { useActiveWeb3React } from 'hooks/web3' import { wrappedCurrency } from 'utils/wrappedCurrency' diff --git a/src/components/SearchModal/CommonBases.tsx b/src/components/SearchModal/CommonBases.tsx index d064fb02ddd..8f466373598 100644 --- a/src/components/SearchModal/CommonBases.tsx +++ b/src/components/SearchModal/CommonBases.tsx @@ -1,6 +1,6 @@ import React from 'react' import { Text } from 'rebass' -import { ChainId, Currency, currencyEquals, Token, ETHER } from '../../libs/sdk-core' +import { ChainId, Currency, currencyEquals, Token, ETHER } from '@uniswap/sdk-core' import styled from 'styled-components/macro' import { SUGGESTED_BASES } from '../../constants/routing' diff --git a/src/components/SearchModal/CurrencyList.tsx b/src/components/SearchModal/CurrencyList.tsx index a4719a43d51..ffc10f0363f 100644 --- a/src/components/SearchModal/CurrencyList.tsx +++ b/src/components/SearchModal/CurrencyList.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, currencyEquals, Token } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, currencyEquals, Token } from '@uniswap/sdk-core' import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react' import { FixedSizeList } from 'react-window' import { Text } from 'rebass' diff --git a/src/components/SearchModal/CurrencySearch.tsx b/src/components/SearchModal/CurrencySearch.tsx index 804339631e5..b5726279415 100644 --- a/src/components/SearchModal/CurrencySearch.tsx +++ b/src/components/SearchModal/CurrencySearch.tsx @@ -1,4 +1,4 @@ -import { Currency, ETHER, Token } from '../../libs/sdk-core' +import { Currency, ETHER, Token } from '@uniswap/sdk-core' import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react' import ReactGA from 'react-ga' import { useTranslation } from 'react-i18next' diff --git a/src/components/SearchModal/CurrencySearchModal.tsx b/src/components/SearchModal/CurrencySearchModal.tsx index 82a82b69cfe..12a7a4ee343 100644 --- a/src/components/SearchModal/CurrencySearchModal.tsx +++ b/src/components/SearchModal/CurrencySearchModal.tsx @@ -1,4 +1,4 @@ -import { Currency, Token } from '../../libs/sdk-core' +import { Currency, Token } from '@uniswap/sdk-core' import React, { useCallback, useEffect, useState } from 'react' import useLast from '../../hooks/useLast' import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo' diff --git a/src/components/SearchModal/ImportRow.tsx b/src/components/SearchModal/ImportRow.tsx index 4644a0a97b1..b9abcde89d1 100644 --- a/src/components/SearchModal/ImportRow.tsx +++ b/src/components/SearchModal/ImportRow.tsx @@ -1,5 +1,5 @@ import React, { CSSProperties } from 'react' -import { Token } from '../../libs/sdk-core' +import { Token } from '@uniswap/sdk-core' import { AutoRow, RowFixed } from 'components/Row' import { AutoColumn } from 'components/Column' import CurrencyLogo from 'components/CurrencyLogo' diff --git a/src/components/SearchModal/ImportToken.tsx b/src/components/SearchModal/ImportToken.tsx index 9f0a31ad887..410a92e4fc7 100644 --- a/src/components/SearchModal/ImportToken.tsx +++ b/src/components/SearchModal/ImportToken.tsx @@ -1,6 +1,6 @@ import { TokenList } from '@uniswap/token-lists/dist/types' import React from 'react' -import { Token, Currency } from '../../libs/sdk-core' +import { Token, Currency } from '@uniswap/sdk-core' import styled from 'styled-components/macro' import { TYPE, CloseIcon } from 'theme' import Card from 'components/Card' diff --git a/src/components/SearchModal/Manage.tsx b/src/components/SearchModal/Manage.tsx index 9a33745e39f..aeeb4211332 100644 --- a/src/components/SearchModal/Manage.tsx +++ b/src/components/SearchModal/Manage.tsx @@ -5,7 +5,7 @@ import { ArrowLeft } from 'react-feather' import { Text } from 'rebass' import { CloseIcon } from 'theme' import styled from 'styled-components/macro' -import { Token } from '../../libs/sdk-core' +import { Token } from '@uniswap/sdk-core' import { ManageLists } from './ManageLists' import ManageTokens from './ManageTokens' import { TokenList } from '@uniswap/token-lists' diff --git a/src/components/SearchModal/ManageTokens.tsx b/src/components/SearchModal/ManageTokens.tsx index 04cbb403dd7..b3aa934fd62 100644 --- a/src/components/SearchModal/ManageTokens.tsx +++ b/src/components/SearchModal/ManageTokens.tsx @@ -7,7 +7,7 @@ import { TYPE, ExternalLinkIcon, TrashIcon, ButtonText, ExternalLink } from 'the import { useToken } from 'hooks/Tokens' import styled from 'styled-components/macro' import { useUserAddedTokens, useRemoveUserAddedToken } from 'state/user/hooks' -import { Token } from '../../libs/sdk-core' +import { Token } from '@uniswap/sdk-core' import CurrencyLogo from 'components/CurrencyLogo' import { isAddress } from 'utils' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/components/SearchModal/filtering.ts b/src/components/SearchModal/filtering.ts index 260a921d5ee..23dfa2cf554 100644 --- a/src/components/SearchModal/filtering.ts +++ b/src/components/SearchModal/filtering.ts @@ -1,7 +1,7 @@ import { TokenInfo } from '@uniswap/token-lists' import { useMemo } from 'react' import { isAddress } from '../../utils' -import { Token } from '../../libs/sdk-core' +import { Token } from '@uniswap/sdk-core' const alwaysTrue = () => true diff --git a/src/components/SearchModal/sorting.ts b/src/components/SearchModal/sorting.ts index 0dd9c936d2f..2b270748800 100644 --- a/src/components/SearchModal/sorting.ts +++ b/src/components/SearchModal/sorting.ts @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount, Currency } from '../../libs/sdk-core' +import { Token, CurrencyAmount, Currency } from '@uniswap/sdk-core' import { useMemo } from 'react' import { useAllTokenBalances } from '../../state/wallet/hooks' diff --git a/src/components/Settings/index.tsx b/src/components/Settings/index.tsx index 2a1066fbdf6..8b8b9f77aa2 100644 --- a/src/components/Settings/index.tsx +++ b/src/components/Settings/index.tsx @@ -15,7 +15,7 @@ import QuestionHelper from '../QuestionHelper' import { RowBetween, RowFixed } from '../Row' import Toggle from '../Toggle' import TransactionSettings from '../TransactionSettings' -import { Percent } from '../../libs/sdk-core' +import { Percent } from '@uniswap/sdk-core' const StyledMenuIcon = styled(Settings)` height: 20px; diff --git a/src/components/TokenWarningModal/index.tsx b/src/components/TokenWarningModal/index.tsx index a08f7b4a163..8f21614098b 100644 --- a/src/components/TokenWarningModal/index.tsx +++ b/src/components/TokenWarningModal/index.tsx @@ -1,4 +1,4 @@ -import { Token } from '../../libs/sdk-core' +import { Token } from '@uniswap/sdk-core' import React from 'react' import Modal from '../Modal' import { ImportToken } from 'components/SearchModal/ImportToken' diff --git a/src/components/TransactionConfirmationModal/index.tsx b/src/components/TransactionConfirmationModal/index.tsx index eb91c6a9c3d..abbc804f436 100644 --- a/src/components/TransactionConfirmationModal/index.tsx +++ b/src/components/TransactionConfirmationModal/index.tsx @@ -1,4 +1,4 @@ -import { ChainId, Currency } from '../../libs/sdk-core' +import { ChainId, Currency } from '@uniswap/sdk-core' import React, { useContext } from 'react' import styled, { ThemeContext } from 'styled-components' import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink' diff --git a/src/components/TransactionSettings/index.tsx b/src/components/TransactionSettings/index.tsx index 121fcddd458..d55c0023605 100644 --- a/src/components/TransactionSettings/index.tsx +++ b/src/components/TransactionSettings/index.tsx @@ -1,5 +1,5 @@ import React, { useState, useContext } from 'react' -import { Percent } from '../../libs/sdk-core' +import { Percent } from '@uniswap/sdk-core' import styled, { ThemeContext } from 'styled-components' import QuestionHelper from '../QuestionHelper' diff --git a/src/components/claim/AddressClaimModal.tsx b/src/components/claim/AddressClaimModal.tsx index fe903b347d4..1e288993e55 100644 --- a/src/components/claim/AddressClaimModal.tsx +++ b/src/components/claim/AddressClaimModal.tsx @@ -18,7 +18,7 @@ import { isAddress } from 'ethers/lib/utils' import Confetti from '../Confetti' import { CardNoise, CardBGImage, CardBGImageSmaller } from '../earn/styled' import { useIsTransactionPending } from '../../state/transactions/hooks' -import { CurrencyAmount, Token } from '../../libs/sdk-core' +import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { shortenAddress } from '../../utils' const ContentWrapper = styled(AutoColumn)` diff --git a/src/components/claim/ClaimModal.tsx b/src/components/claim/ClaimModal.tsx index ad67b9f8f55..b7b5f93788e 100644 --- a/src/components/claim/ClaimModal.tsx +++ b/src/components/claim/ClaimModal.tsx @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { CurrencyAmount, Token } from '../../libs/sdk-core' +import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { isAddress } from 'ethers/lib/utils' import React, { useEffect, useState } from 'react' import { Text } from 'rebass' diff --git a/src/components/earn/PoolCard.tsx b/src/components/earn/PoolCard.tsx index 4abb1e9213b..9ee6c1173e7 100644 --- a/src/components/earn/PoolCard.tsx +++ b/src/components/earn/PoolCard.tsx @@ -4,7 +4,7 @@ import { RowBetween } from '../Row' import styled from 'styled-components/macro' import { TYPE, StyledInternalLink } from '../../theme' import DoubleCurrencyLogo from '../DoubleLogo' -import { CurrencyAmount, Token } from '../../libs/sdk-core' +import { CurrencyAmount, Token } from '@uniswap/sdk-core' import JSBI from 'jsbi' import { ButtonPrimary } from '../Button' import { StakingInfo } from '../../state/stake/hooks' diff --git a/src/components/earn/StakingModal.tsx b/src/components/earn/StakingModal.tsx index ac173c47971..cfe206669be 100644 --- a/src/components/earn/StakingModal.tsx +++ b/src/components/earn/StakingModal.tsx @@ -11,7 +11,7 @@ import { ButtonConfirmed, ButtonError } from '../Button' import ProgressCircles from '../ProgressSteps' import CurrencyInputPanel from '../CurrencyInputPanel' import { Pair } from '@uniswap/v2-sdk' -import { Token, CurrencyAmount } from '../../libs/sdk-core' +import { Token, CurrencyAmount } from '@uniswap/sdk-core' import { useActiveWeb3React } from '../../hooks/web3' import { maxAmountSpend } from '../../utils/maxAmountSpend' import { usePairContract, useStakingContract } from '../../hooks/useContract' diff --git a/src/components/swap/AdvancedSwapDetails.tsx b/src/components/swap/AdvancedSwapDetails.tsx index c4bed309e06..c9c1471c03c 100644 --- a/src/components/swap/AdvancedSwapDetails.tsx +++ b/src/components/swap/AdvancedSwapDetails.tsx @@ -1,4 +1,4 @@ -import { Percent, Currency, TradeType } from '../../libs/sdk-core' +import { Percent, Currency, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import React, { useContext, useMemo } from 'react' diff --git a/src/components/swap/ConfirmSwapModal.tsx b/src/components/swap/ConfirmSwapModal.tsx index 9087227babb..97161a6a6ab 100644 --- a/src/components/swap/ConfirmSwapModal.tsx +++ b/src/components/swap/ConfirmSwapModal.tsx @@ -1,4 +1,4 @@ -import { Currency, currencyEquals, Percent, TradeType } from '../../libs/sdk-core' +import { Currency, currencyEquals, Percent, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import React, { useCallback, useMemo } from 'react' diff --git a/src/components/swap/FormattedPriceImpact.tsx b/src/components/swap/FormattedPriceImpact.tsx index d33f7742897..5f1e1621431 100644 --- a/src/components/swap/FormattedPriceImpact.tsx +++ b/src/components/swap/FormattedPriceImpact.tsx @@ -1,4 +1,4 @@ -import { Percent } from '../../libs/sdk-core' +import { Percent } from '@uniswap/sdk-core' import React from 'react' import { warningSeverity } from '../../utils/prices' import { ErrorText, ErrorPill } from './styleds' diff --git a/src/components/swap/SwapHeader.tsx b/src/components/swap/SwapHeader.tsx index 6033af8088b..6d3d9329a92 100644 --- a/src/components/swap/SwapHeader.tsx +++ b/src/components/swap/SwapHeader.tsx @@ -1,7 +1,7 @@ import React from 'react' import styled from 'styled-components/macro' import SettingsTab from '../Settings' -import { Percent } from '../../libs/sdk-core' +import { Percent } from '@uniswap/sdk-core' import { RowBetween, RowFixed } from '../Row' import { TYPE } from '../../theme' diff --git a/src/components/swap/SwapModalFooter.tsx b/src/components/swap/SwapModalFooter.tsx index 4a22ae04b6e..9617a2b0591 100644 --- a/src/components/swap/SwapModalFooter.tsx +++ b/src/components/swap/SwapModalFooter.tsx @@ -1,4 +1,4 @@ -import { Currency, TradeType } from '../../libs/sdk-core' +import { Currency, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' diff --git a/src/components/swap/SwapModalHeader.tsx b/src/components/swap/SwapModalHeader.tsx index 4ced7d6bd77..5a8eabcb54c 100644 --- a/src/components/swap/SwapModalHeader.tsx +++ b/src/components/swap/SwapModalHeader.tsx @@ -1,4 +1,4 @@ -import { Currency, Percent, TradeType } from '../../libs/sdk-core' +import { Currency, Percent, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import React, { useContext, useState } from 'react' diff --git a/src/components/swap/SwapRoute.tsx b/src/components/swap/SwapRoute.tsx index 4fb771a1169..569f64b3271 100644 --- a/src/components/swap/SwapRoute.tsx +++ b/src/components/swap/SwapRoute.tsx @@ -1,4 +1,4 @@ -import { Currency, TradeType } from '../../libs/sdk-core' +import { Currency, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade, FeeAmount } from '@uniswap/v3-sdk' import React, { Fragment, memo, useContext } from 'react' diff --git a/src/components/swap/TradePrice.tsx b/src/components/swap/TradePrice.tsx index d900789b19a..d8843cf9e04 100644 --- a/src/components/swap/TradePrice.tsx +++ b/src/components/swap/TradePrice.tsx @@ -1,5 +1,5 @@ import React, { useCallback } from 'react' -import { Price, Currency } from '../../libs/sdk-core' +import { Price, Currency } from '@uniswap/sdk-core' import { useContext } from 'react' import { Text } from 'rebass' import styled, { ThemeContext } from 'styled-components' diff --git a/src/components/swap/UnsupportedCurrencyFooter.tsx b/src/components/swap/UnsupportedCurrencyFooter.tsx index 3681de12b03..c8ca3ffe350 100644 --- a/src/components/swap/UnsupportedCurrencyFooter.tsx +++ b/src/components/swap/UnsupportedCurrencyFooter.tsx @@ -8,7 +8,7 @@ import { RowBetween, AutoRow } from 'components/Row' import { AutoColumn } from 'components/Column' import CurrencyLogo from 'components/CurrencyLogo' import { useActiveWeb3React } from 'hooks/web3' -import { Currency, Token } from '../../libs/sdk-core' +import { Currency, Token } from '@uniswap/sdk-core' import { wrappedCurrency } from 'utils/wrappedCurrency' import { useUnsupportedTokens } from '../../hooks/Tokens' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' diff --git a/src/components/swap/confirmPriceImpactWithoutFee.ts b/src/components/swap/confirmPriceImpactWithoutFee.ts index fcc39412525..392768bc8e4 100644 --- a/src/components/swap/confirmPriceImpactWithoutFee.ts +++ b/src/components/swap/confirmPriceImpactWithoutFee.ts @@ -1,4 +1,4 @@ -import { Percent } from '../../libs/sdk-core' +import { Percent } from '@uniswap/sdk-core' import { ALLOWED_PRICE_IMPACT_HIGH, PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN } from '../../constants/misc' /** diff --git a/src/components/vote/VoteModal.tsx b/src/components/vote/VoteModal.tsx index f8b27694c43..4b14efd105a 100644 --- a/src/components/vote/VoteModal.tsx +++ b/src/components/vote/VoteModal.tsx @@ -13,7 +13,7 @@ import Circle from '../../assets/images/blue-loader.svg' import { useVoteCallback, useUserVotes } from '../../state/governance/hooks' import { ExternalLink } from '../../theme/components' import { formatTokenAmount } from 'utils/formatTokenAmount' -import { CurrencyAmount, Token } from '../../libs/sdk-core' +import { CurrencyAmount, Token } from '@uniswap/sdk-core' const ContentWrapper = styled(AutoColumn)` width: 100%; diff --git a/src/connectors/Fortmatic.ts b/src/connectors/Fortmatic.ts index 1e8627fd81c..8cb80e52237 100644 --- a/src/connectors/Fortmatic.ts +++ b/src/connectors/Fortmatic.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { FortmaticConnector as FortmaticConnectorCore } from '@web3-react/fortmatic-connector' export const OVERLAY_READY = 'OVERLAY_READY' diff --git a/src/connectors/index.ts b/src/connectors/index.ts index d3c85d631c2..73f73deece3 100644 --- a/src/connectors/index.ts +++ b/src/connectors/index.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { Web3Provider } from '@ethersproject/providers' import { InjectedConnector } from '@web3-react/injected-connector' import { WalletConnectConnector } from '@web3-react/walletconnect-connector' diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index ba94e9c4ac8..ada515983c4 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { FACTORY_ADDRESS as V3_FACTORY_ADDRESS } from '@uniswap/v3-sdk' import { constructSameAddressMap } from '../utils/constructSameAddressMap' diff --git a/src/constants/governance.ts b/src/constants/governance.ts index 20a444916cf..c8b4f83c582 100644 --- a/src/constants/governance.ts +++ b/src/constants/governance.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { GOVERNANCE_ADDRESS, TIMELOCK_ADDRESS, UNI_ADDRESS } from './addresses' export const COMMON_CONTRACT_NAMES: { [chainId in ChainId]?: { [address: string]: string } } = { diff --git a/src/constants/misc.ts b/src/constants/misc.ts index 2b8df2202ec..2ede179ffd9 100644 --- a/src/constants/misc.ts +++ b/src/constants/misc.ts @@ -1,4 +1,4 @@ -import { Percent } from '../libs/sdk-core' +import { Percent } from '@uniswap/sdk-core' import JSBI from 'jsbi' export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' diff --git a/src/constants/routing.ts b/src/constants/routing.ts index fdaf2382217..4e35ab04315 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -1,5 +1,5 @@ // a list of tokens by chain -import { ChainId, Token, WETH9 } from '../libs/sdk-core' +import { ChainId, Token, WETH9 } from '@uniswap/sdk-core' import { AMPL, DAI, diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index 63320b4a561..a87ff13196e 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -1,4 +1,4 @@ -import { ChainId, Token } from '../libs/sdk-core' +import { ChainId, Token } from '@uniswap/sdk-core' import { UNI_ADDRESS } from './addresses' export const AMPL = new Token(ChainId.MAINNET, '0xD46bA6D942050d489DBd938a2C909A5d5039A161', 9, 'AMPL', 'Ampleforth') diff --git a/src/hooks/Tokens.ts b/src/hooks/Tokens.ts index 2bceb600ba4..a0ca8c74041 100644 --- a/src/hooks/Tokens.ts +++ b/src/hooks/Tokens.ts @@ -1,5 +1,5 @@ import { parseBytes32String } from '@ethersproject/strings' -import { Currency, currencyEquals, Ether, Token } from '../libs/sdk-core' +import { Currency, currencyEquals, ETHER, POL, Token } from '@uniswap/sdk-core' import { arrayify } from 'ethers/lib/utils' import { useMemo } from 'react' import { createTokenFilterFunction } from '../components/SearchModal/filtering' @@ -172,9 +172,9 @@ export function useToken(tokenAddress?: string): Token | undefined | null { } export function useCurrency(currencyId: string | undefined): Currency | null | undefined { - const { chainId } = useActiveWeb3React() const isETH = currencyId?.toUpperCase() === 'ETH' + const isPOL = currencyId?.toUpperCase() === 'POL' const token = useToken(isETH ? undefined : currencyId) - return isETH ? new Ether(chainId === 80002 ? 'POL' : undefined, chainId === 80002 ? 'Polygon' : undefined) : token + return isETH ? ETHER : isPOL ? POL : token } diff --git a/src/hooks/useAddTokenToMetamask.ts b/src/hooks/useAddTokenToMetamask.ts index 24d80229735..3b5b12ae92b 100644 --- a/src/hooks/useAddTokenToMetamask.ts +++ b/src/hooks/useAddTokenToMetamask.ts @@ -1,6 +1,6 @@ import { getTokenLogoURL } from './../components/CurrencyLogo/index' import { wrappedCurrency } from 'utils/wrappedCurrency' -import { Currency, Token } from '../libs/sdk-core' +import { Currency, Token } from '@uniswap/sdk-core' import { useCallback, useState } from 'react' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/hooks/useAllCurrencyCombinations.ts b/src/hooks/useAllCurrencyCombinations.ts index 58476420628..7a209a7370a 100644 --- a/src/hooks/useAllCurrencyCombinations.ts +++ b/src/hooks/useAllCurrencyCombinations.ts @@ -1,4 +1,4 @@ -import { Currency, Token } from '../libs/sdk-core' +import { Currency, Token } from '@uniswap/sdk-core' import flatMap from 'lodash.flatmap' import { useMemo } from 'react' import { ADDITIONAL_BASES, BASES_TO_CHECK_TRADES_AGAINST, CUSTOM_BASES } from '../constants/routing' diff --git a/src/hooks/useAllV3Routes.ts b/src/hooks/useAllV3Routes.ts index d5fb2a21e97..fec692e0ae4 100644 --- a/src/hooks/useAllV3Routes.ts +++ b/src/hooks/useAllV3Routes.ts @@ -1,4 +1,4 @@ -import { ChainId, Currency } from '../libs/sdk-core' +import { ChainId, Currency } from '@uniswap/sdk-core' import { Pool, Route } from '@uniswap/v3-sdk' import { useMemo } from 'react' import { useUserSingleHopOnly } from '../state/user/hooks' diff --git a/src/hooks/useApproveCallback.ts b/src/hooks/useApproveCallback.ts index 324d65e76bd..c2c2656cd16 100644 --- a/src/hooks/useApproveCallback.ts +++ b/src/hooks/useApproveCallback.ts @@ -1,6 +1,6 @@ import { MaxUint256 } from '@ethersproject/constants' import { TransactionResponse } from '@ethersproject/providers' -import { CurrencyAmount, ChainId, Percent, Currency, TradeType } from '../libs/sdk-core' +import { CurrencyAmount, ChainId, Percent, Currency, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { useCallback, useMemo } from 'react' diff --git a/src/hooks/useBestV3Trade.ts b/src/hooks/useBestV3Trade.ts index a598910f0fe..e1f7283dada 100644 --- a/src/hooks/useBestV3Trade.ts +++ b/src/hooks/useBestV3Trade.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, TradeType } from '../libs/sdk-core' +import { Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core' import { encodeRouteToPath, Route, Trade } from '@uniswap/v3-sdk' import { BigNumber } from 'ethers' import { useMemo } from 'react' diff --git a/src/hooks/useColor.ts b/src/hooks/useColor.ts index a299ba17323..5d1575435f0 100644 --- a/src/hooks/useColor.ts +++ b/src/hooks/useColor.ts @@ -2,7 +2,7 @@ import { useState, useLayoutEffect } from 'react' import { shade } from 'polished' import Vibrant from 'node-vibrant' import { hex } from 'wcag-contrast' -import { Token, ChainId } from '../libs/sdk-core' +import { Token, ChainId } from '@uniswap/sdk-core' import uriToHttp from 'utils/uriToHttp' async function getColorFromToken(token: Token): Promise { diff --git a/src/hooks/useContract.ts b/src/hooks/useContract.ts index 9ce3a1d8887..1e0a836c4af 100644 --- a/src/hooks/useContract.ts +++ b/src/hooks/useContract.ts @@ -1,5 +1,5 @@ import { Contract } from '@ethersproject/contracts' -import { ChainId, WETH9 } from '../libs/sdk-core' +import { ChainId, WETH9 } from '@uniswap/sdk-core' import { abi as GOVERNANCE_ABI } from '@uniswap/governance/build/GovernorAlpha.json' import { abi as UNI_ABI } from '@uniswap/governance/build/Uni.json' import { abi as STAKING_REWARDS_ABI } from '@uniswap/liquidity-staker/build/StakingRewards.json' diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index 0376293f4f3..b991e93038c 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { ChainId, Percent, CurrencyAmount, Currency, TradeType, Token } from '../libs/sdk-core' +import { ChainId, Percent, CurrencyAmount, Currency, TradeType, Token } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { splitSignature } from 'ethers/lib/utils' diff --git a/src/hooks/useFetchListCallback.ts b/src/hooks/useFetchListCallback.ts index 2ed26f535bb..1a4a8ec3d48 100644 --- a/src/hooks/useFetchListCallback.ts +++ b/src/hooks/useFetchListCallback.ts @@ -1,5 +1,5 @@ import { nanoid } from '@reduxjs/toolkit' -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { TokenList } from '@uniswap/token-lists' import { useCallback } from 'react' import { useDispatch } from 'react-redux' diff --git a/src/hooks/useIsSwapUnsupported.ts b/src/hooks/useIsSwapUnsupported.ts index 82b66866a49..739e971a516 100644 --- a/src/hooks/useIsSwapUnsupported.ts +++ b/src/hooks/useIsSwapUnsupported.ts @@ -1,4 +1,4 @@ -import { Currency, Token } from '../libs/sdk-core' +import { Currency, Token } from '@uniswap/sdk-core' import { useMemo } from 'react' import { useUnsupportedTokens } from './Tokens' diff --git a/src/hooks/usePools.ts b/src/hooks/usePools.ts index db7c965c349..560f9e28b7e 100644 --- a/src/hooks/usePools.ts +++ b/src/hooks/usePools.ts @@ -1,7 +1,7 @@ import { computePoolAddress } from '@uniswap/v3-sdk' import { V3_CORE_FACTORY_ADDRESSES } from '../constants/addresses' import { IUniswapV3PoolStateInterface } from '../types/v3/IUniswapV3PoolState' -import { Token, Currency } from '../libs/sdk-core' +import { Token, Currency } from '@uniswap/sdk-core' import { useMemo } from 'react' import { useActiveWeb3React } from './web3' import { useMultipleContractSingleData } from '../state/multicall/hooks' diff --git a/src/hooks/useSwapCallback.ts b/src/hooks/useSwapCallback.ts index ff21762d583..ce04803ba18 100644 --- a/src/hooks/useSwapCallback.ts +++ b/src/hooks/useSwapCallback.ts @@ -1,7 +1,7 @@ import { BigNumber } from '@ethersproject/bignumber' import { Router, Trade as V2Trade } from '@uniswap/v2-sdk' import { SwapRouter, Trade as V3Trade } from '@uniswap/v3-sdk' -import { ChainId, Currency, Percent, TradeType } from '../libs/sdk-core' +import { ChainId, Currency, Percent, TradeType } from '@uniswap/sdk-core' import { useMemo } from 'react' import { SWAP_ROUTER_ADDRESSES } from '../constants/addresses' import { calculateGasMargin } from '../utils/calculateGasMargin' diff --git a/src/hooks/useSwapSlippageTolerance.ts b/src/hooks/useSwapSlippageTolerance.ts index ee816a14dae..f5ad6d2aa2f 100644 --- a/src/hooks/useSwapSlippageTolerance.ts +++ b/src/hooks/useSwapSlippageTolerance.ts @@ -1,4 +1,4 @@ -import { Currency, Percent, TradeType } from '../libs/sdk-core' +import { Currency, Percent, TradeType } from '@uniswap/sdk-core' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { useMemo } from 'react' diff --git a/src/hooks/useTickToPrice.ts b/src/hooks/useTickToPrice.ts index 772e121b632..e6e5ffdb0e7 100644 --- a/src/hooks/useTickToPrice.ts +++ b/src/hooks/useTickToPrice.ts @@ -1,4 +1,4 @@ -import { Token, Price } from '../libs/sdk-core' +import { Token, Price } from '@uniswap/sdk-core' import { tickToPrice } from '@uniswap/v3-sdk' export function getTickToPrice( diff --git a/src/hooks/useTokenAllowance.ts b/src/hooks/useTokenAllowance.ts index 167c8415940..4e62c36d02e 100644 --- a/src/hooks/useTokenAllowance.ts +++ b/src/hooks/useTokenAllowance.ts @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount } from '../libs/sdk-core' +import { Token, CurrencyAmount } from '@uniswap/sdk-core' import { useMemo } from 'react' import { useSingleCallResult } from '../state/multicall/hooks' import { useTokenContract } from './useContract' diff --git a/src/hooks/useTotalSupply.ts b/src/hooks/useTotalSupply.ts index 15f1b0d46c6..f247d5325a4 100644 --- a/src/hooks/useTotalSupply.ts +++ b/src/hooks/useTotalSupply.ts @@ -1,5 +1,5 @@ import { BigNumber } from '@ethersproject/bignumber' -import { Token, CurrencyAmount, Currency } from '../libs/sdk-core' +import { Token, CurrencyAmount, Currency } from '@uniswap/sdk-core' import { useTokenContract } from './useContract' import { useSingleCallResult } from '../state/multicall/hooks' diff --git a/src/hooks/useUSDCPrice.ts b/src/hooks/useUSDCPrice.ts index 594e5498659..33061904fae 100644 --- a/src/hooks/useUSDCPrice.ts +++ b/src/hooks/useUSDCPrice.ts @@ -1,4 +1,4 @@ -import { ChainId, Currency, CurrencyAmount, Price, Token } from '../libs/sdk-core' +import { ChainId, Currency, CurrencyAmount, Price, Token } from '@uniswap/sdk-core' import { useMemo } from 'react' import { USDC } from '../constants/tokens' import { useV2TradeExactOut } from './useV2Trade' diff --git a/src/hooks/useV2Pairs.ts b/src/hooks/useV2Pairs.ts index a077da515ed..2bf74e58ea4 100644 --- a/src/hooks/useV2Pairs.ts +++ b/src/hooks/useV2Pairs.ts @@ -5,7 +5,7 @@ import { Interface } from '@ethersproject/abi' import { useActiveWeb3React } from './web3' import { useMultipleContractSingleData } from '../state/multicall/hooks' import { wrappedCurrency } from '../utils/wrappedCurrency' -import { Currency, CurrencyAmount } from '../libs/sdk-core' +import { Currency, CurrencyAmount } from '@uniswap/sdk-core' const PAIR_INTERFACE = new Interface(IUniswapV2PairABI) diff --git a/src/hooks/useV2Trade.ts b/src/hooks/useV2Trade.ts index 8ec733e4b52..f8a203b2375 100644 --- a/src/hooks/useV2Trade.ts +++ b/src/hooks/useV2Trade.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, TradeType } from '../libs/sdk-core' +import { Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core' import { Pair, Trade } from '@uniswap/v2-sdk' import { useMemo } from 'react' import { isTradeBetter } from 'utils/isTradeBetter' diff --git a/src/hooks/useV3PositionFees.ts b/src/hooks/useV3PositionFees.ts index da97ec28f65..93b4cdc5ff8 100644 --- a/src/hooks/useV3PositionFees.ts +++ b/src/hooks/useV3PositionFees.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react' import { useV3NFTPositionManagerContract } from './useContract' import { BigNumber } from '@ethersproject/bignumber' import { Pool } from '@uniswap/v3-sdk' -import { CurrencyAmount, Token, currencyEquals, ETHER, Ether } from '../libs/sdk-core' +import { CurrencyAmount, Token, currencyEquals, ETHER, Ether } from '@uniswap/sdk-core' import { useBlockNumber } from 'state/application/hooks' import { unwrappedToken } from 'utils/wrappedCurrency' diff --git a/src/hooks/useV3SwapPools.ts b/src/hooks/useV3SwapPools.ts index cf11a8a64f4..70a4bd5f419 100644 --- a/src/hooks/useV3SwapPools.ts +++ b/src/hooks/useV3SwapPools.ts @@ -1,4 +1,4 @@ -import { Currency, Token } from '../libs/sdk-core' +import { Currency, Token } from '@uniswap/sdk-core' import { FeeAmount, Pool } from '@uniswap/v3-sdk' import { useMemo } from 'react' import { useAllCurrencyCombinations } from './useAllCurrencyCombinations' diff --git a/src/hooks/useWrapCallback.ts b/src/hooks/useWrapCallback.ts index 124b2eb44c2..5a719f04f81 100644 --- a/src/hooks/useWrapCallback.ts +++ b/src/hooks/useWrapCallback.ts @@ -1,4 +1,4 @@ -import { Currency, currencyEquals, WETH9 } from '../libs/sdk-core' +import { Currency, currencyEquals, WETH9 } from '@uniswap/sdk-core' import { useMemo } from 'react' import { tryParseAmount } from '../state/swap/hooks' import { useTransactionAdder } from '../state/transactions/hooks' diff --git a/src/hooks/web3.ts b/src/hooks/web3.ts index f768c531460..b45860bb995 100644 --- a/src/hooks/web3.ts +++ b/src/hooks/web3.ts @@ -1,5 +1,5 @@ import { Web3Provider } from '@ethersproject/providers' -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { useWeb3React as useWeb3ReactCore } from '@web3-react/core' import { Web3ReactContextInterface } from '@web3-react/core/dist/types' import { useEffect, useState } from 'react' diff --git a/src/libs/sdk-core/.gitignore b/src/libs/sdk-core/.gitignore deleted file mode 100644 index e37cd8efc1b..00000000000 --- a/src/libs/sdk-core/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# generated contract types -/src/types/v3 -/src/abis/types - -# dependencies -/node_modules - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -/.netlify - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -notes.txt -.idea/ - -.vscode/ - -package-lock.json - -cypress/videos -cypress/screenshots -cypress/fixtures/example.json \ No newline at end of file diff --git a/src/libs/sdk-core/LICENSE b/src/libs/sdk-core/LICENSE deleted file mode 100644 index 0c6c24ca9dd..00000000000 --- a/src/libs/sdk-core/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Uniswap Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/libs/sdk-core/README.md b/src/libs/sdk-core/README.md deleted file mode 100644 index 86f69f1dbd3..00000000000 --- a/src/libs/sdk-core/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Uniswap SDK Core - -[![Unit Tests](https://github.com/Uniswap/uniswap-sdk-core/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3A%22Unit+Tests%22) -[![Lint](https://github.com/Uniswap/uniswap-sdk-core/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3ALint) -[![npm version](https://img.shields.io/npm/v/@uniswap/sdk-core/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk-core/v/latest) -[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk-core/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk-core@latest) - -This code is shared across Uniswap TypeScript SDKs. diff --git a/src/libs/sdk-core/dist/constants.d.ts b/src/libs/sdk-core/dist/constants.d.ts deleted file mode 100644 index e363b20d37b..00000000000 --- a/src/libs/sdk-core/dist/constants.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import JSBI from 'jsbi' -export declare type BigintIsh = JSBI | string | number -export declare enum ChainId { - MAINNET = 1, - ROPSTEN = 3, - RINKEBY = 4, - GÖRLI = 5, - KOVAN = 42, - POLYGON_AMOY = 80002, -} -export declare enum TradeType { - EXACT_INPUT = 0, - EXACT_OUTPUT = 1, -} -export declare enum Rounding { - ROUND_DOWN = 0, - ROUND_HALF_UP = 1, - ROUND_UP = 2, -} -export declare const MaxUint256: JSBI diff --git a/src/libs/sdk-core/dist/entities/baseCurrency.d.ts b/src/libs/sdk-core/dist/entities/baseCurrency.d.ts deleted file mode 100644 index c56bf6b49a8..00000000000 --- a/src/libs/sdk-core/dist/entities/baseCurrency.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. - * - * The only instance of the base class `Currency` is Ether. - */ -export declare abstract class BaseCurrency { - abstract readonly isEther: boolean; - abstract readonly isToken: boolean; - readonly decimals: number; - readonly symbol?: string; - readonly name?: string; - /** - * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. - * @param decimals decimals of the currency - * @param symbol symbol of the currency - * @param name of the currency - */ - protected constructor(decimals: number, symbol?: string, name?: string); -} diff --git a/src/libs/sdk-core/dist/entities/currency.d.ts b/src/libs/sdk-core/dist/entities/currency.d.ts deleted file mode 100644 index 997946a07f5..00000000000 --- a/src/libs/sdk-core/dist/entities/currency.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Ether } from './ether'; -import { Token } from './token'; -export declare type Currency = Ether | Token; diff --git a/src/libs/sdk-core/dist/entities/ether.d.ts b/src/libs/sdk-core/dist/entities/ether.d.ts deleted file mode 100644 index e0967714517..00000000000 --- a/src/libs/sdk-core/dist/entities/ether.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BaseCurrency } from './baseCurrency' -/** - * Represents the currency Ether - */ -export declare class Ether extends BaseCurrency { - readonly isEther: true - readonly isToken: false - constructor(symbol?: string, name?: string) - /** - * The only instance of the class `Ether`. - */ - static readonly ETHER: Ether -} -export declare const ETHER: Ether diff --git a/src/libs/sdk-core/dist/entities/fractions/currencyAmount.d.ts b/src/libs/sdk-core/dist/entities/fractions/currencyAmount.d.ts deleted file mode 100644 index 294019b4aa8..00000000000 --- a/src/libs/sdk-core/dist/entities/fractions/currencyAmount.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import JSBI from 'jsbi'; -import { Currency } from '../currency'; -import { Ether } from '../ether'; -import { Fraction } from './fraction'; -import { BigintIsh, Rounding } from '../../constants'; -export declare class CurrencyAmount extends Fraction { - readonly currency: T; - readonly decimalScale: JSBI; - /** - * Returns a new currency amount instance from the - * @param currency the currency in the amount - * @param rawAmount the raw token or ether amount - */ - static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount; - /** - * Construct a currency amount with a denominator that is not equal to 1 - * @param currency the currency - * @param numerator the numerator of the fractional token amount - * @param denominator the denominator of the fractional token amount - */ - static fromFractionalAmount(currency: T, numerator: BigintIsh, denominator: BigintIsh): CurrencyAmount; - /** - * Helper that calls the constructor with the ETHER currency - * @param rawAmount ether amount in wei - */ - static ether(rawAmount: BigintIsh): CurrencyAmount; - protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh); - add(other: CurrencyAmount): CurrencyAmount; - subtract(other: CurrencyAmount): CurrencyAmount; - multiply(other: Fraction | BigintIsh): CurrencyAmount; - divide(other: Fraction | BigintIsh): CurrencyAmount; - toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; - toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; - toExact(format?: object): string; -} diff --git a/src/libs/sdk-core/dist/entities/fractions/fraction.d.ts b/src/libs/sdk-core/dist/entities/fractions/fraction.d.ts deleted file mode 100644 index 414770af5e3..00000000000 --- a/src/libs/sdk-core/dist/entities/fractions/fraction.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import JSBI from 'jsbi'; -import { BigintIsh, Rounding } from '../../constants'; -export declare class Fraction { - readonly numerator: JSBI; - readonly denominator: JSBI; - constructor(numerator: BigintIsh, denominator?: BigintIsh); - private static tryParseFraction; - get quotient(): JSBI; - get remainder(): Fraction; - invert(): Fraction; - add(other: Fraction | BigintIsh): Fraction; - subtract(other: Fraction | BigintIsh): Fraction; - lessThan(other: Fraction | BigintIsh): boolean; - equalTo(other: Fraction | BigintIsh): boolean; - greaterThan(other: Fraction | BigintIsh): boolean; - multiply(other: Fraction | BigintIsh): Fraction; - divide(other: Fraction | BigintIsh): Fraction; - toSignificant(significantDigits: number, format?: object, rounding?: Rounding): string; - toFixed(decimalPlaces: number, format?: object, rounding?: Rounding): string; - /** - * Helper method for converting any super class back to a fraction - */ - get asFraction(): Fraction; -} diff --git a/src/libs/sdk-core/dist/entities/fractions/index.d.ts b/src/libs/sdk-core/dist/entities/fractions/index.d.ts deleted file mode 100644 index 616c23384e2..00000000000 --- a/src/libs/sdk-core/dist/entities/fractions/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { CurrencyAmount } from './currencyAmount'; -export { Fraction } from './fraction'; -export { Percent } from './percent'; -export { Price } from './price'; diff --git a/src/libs/sdk-core/dist/entities/fractions/percent.d.ts b/src/libs/sdk-core/dist/entities/fractions/percent.d.ts deleted file mode 100644 index 6f373cf3282..00000000000 --- a/src/libs/sdk-core/dist/entities/fractions/percent.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BigintIsh, Rounding } from '../../constants'; -import { Fraction } from './fraction'; -export declare class Percent extends Fraction { - /** - * This boolean prevents a fraction from being interpreted as a Percent - */ - readonly isPercent: true; - add(other: Fraction | BigintIsh): Percent; - subtract(other: Fraction | BigintIsh): Percent; - multiply(other: Fraction | BigintIsh): Percent; - divide(other: Fraction | BigintIsh): Percent; - toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; - toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; -} diff --git a/src/libs/sdk-core/dist/entities/fractions/price.d.ts b/src/libs/sdk-core/dist/entities/fractions/price.d.ts deleted file mode 100644 index b04db496080..00000000000 --- a/src/libs/sdk-core/dist/entities/fractions/price.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BigintIsh, Rounding } from '../../constants'; -import { Currency } from '../currency'; -import { Fraction } from './fraction'; -import { CurrencyAmount } from './currencyAmount'; -export declare class Price extends Fraction { - readonly baseCurrency: TBase; - readonly quoteCurrency: TQuote; - readonly scalar: Fraction; - constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh); - /** - * Flip the price, switching the base and quote currency - */ - invert(): Price; - /** - * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency - * @param other the other price - */ - multiply(other: Price): Price; - /** - * Return the amount of quote currency corresponding to a given amount of the base currency - * @param currencyAmount the amount of base currency to quote against the price - */ - quote(currencyAmount: CurrencyAmount): CurrencyAmount; - /** - * Get the value scaled by decimals for formatting - * @private - */ - private get adjustedForDecimals(); - toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; - toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; -} diff --git a/src/libs/sdk-core/dist/entities/index.d.ts b/src/libs/sdk-core/dist/entities/index.d.ts deleted file mode 100644 index 623a38d0b91..00000000000 --- a/src/libs/sdk-core/dist/entities/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './fractions'; -export * from './currency'; -export * from './ether'; -export * from './token'; diff --git a/src/libs/sdk-core/dist/entities/token.d.ts b/src/libs/sdk-core/dist/entities/token.d.ts deleted file mode 100644 index 53ec6fd2e27..00000000000 --- a/src/libs/sdk-core/dist/entities/token.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ChainId } from '../constants' -import { BaseCurrency } from './baseCurrency' -/** - * Represents an ERC20 token with a unique address and some metadata. - */ -export declare class Token extends BaseCurrency { - readonly isEther: false - readonly isToken: true - readonly chainId: ChainId | number - readonly address: string - constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) - /** - * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. - * @param other other token to compare - */ - equals(other: Token): boolean - /** - * Returns true if the address of this token sorts before the address of the other token - * @param other other token to compare - * @throws if the tokens have the same address - * @throws if the tokens are on different chains - */ - sortsBefore(other: Token): boolean -} -export declare const WETH9: { - [chainId in ChainId]: Token -} diff --git a/src/libs/sdk-core/dist/index.d.ts b/src/libs/sdk-core/dist/index.d.ts deleted file mode 100644 index 0e9ce96a650..00000000000 --- a/src/libs/sdk-core/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './constants'; -export * from './entities'; -export * from './utils'; diff --git a/src/libs/sdk-core/dist/index.js b/src/libs/sdk-core/dist/index.js deleted file mode 100644 index ceefd33d792..00000000000 --- a/src/libs/sdk-core/dist/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('./sdk-core.cjs.development.js') diff --git a/src/libs/sdk-core/dist/sdk-core.esm.js b/src/libs/sdk-core/dist/sdk-core.esm.js deleted file mode 100644 index fe37fd776e1..00000000000 --- a/src/libs/sdk-core/dist/sdk-core.esm.js +++ /dev/null @@ -1,855 +0,0 @@ -import JSBI from 'jsbi' -import invariant from 'tiny-invariant' -import _Decimal from 'decimal.js-light' -import _Big from 'big.js' -import toFormat from 'toformat' -import { getAddress } from '@ethersproject/address' - -var ChainId -;(function (ChainId) { - ChainId[(ChainId['MAINNET'] = 1)] = 'MAINNET' - ChainId[(ChainId['ROPSTEN'] = 3)] = 'ROPSTEN' - ChainId[(ChainId['RINKEBY'] = 4)] = 'RINKEBY' - ChainId[(ChainId['G\xD6RLI'] = 5)] = 'G\xD6RLI' - ChainId[(ChainId['KOVAN'] = 42)] = 'KOVAN' - ChainId[(ChainId['POLYGON_AMOY'] = 80002)] = 'POLYGON_AMOY' -})(ChainId || (ChainId = {})) - -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) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i] - descriptor.enumerable = descriptor.enumerable || false - descriptor.configurable = true - if ('value' in descriptor) descriptor.writable = true - Object.defineProperty(target, descriptor.key, descriptor) - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps) - if (staticProps) _defineProperties(Constructor, staticProps) - return Constructor -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype) - subClass.prototype.constructor = subClass - subClass.__proto__ = superClass -} - -/** - * Compares two currencies for equality - */ -function currencyEquals(currencyA, currencyB) { - if (currencyA.isToken && currencyB.isToken) { - return currencyA.equals(currencyB) - } else if (currencyA.isToken) { - return false - } else if (currencyB.isToken) { - return false - } else { - return currencyA.isEther === currencyB.isEther - } -} - -/** - * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. - * - * The only instance of the base class `Currency` is Ether. - */ - -var BaseCurrency = - /** - * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. - * @param decimals decimals of the currency - * @param symbol symbol of the currency - * @param name of the currency - */ - function BaseCurrency(decimals, symbol, name) { - !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'DECIMALS') - : invariant(false) - : void 0 - this.decimals = decimals - this.symbol = symbol - this.name = name - } - -/** - * Represents the currency Ether - */ - -var Ether = /*#__PURE__*/ (function (_BaseCurrency) { - _inheritsLoose(Ether, _BaseCurrency) - - /** - * Only called once by this class - * @protected - */ - function Ether(symbol = 'ETH', name = 'Ether') { - var _this - - _this = _BaseCurrency.call(this, 18, symbol, name) || this - _this.isEther = true - _this.isToken = false - return _this - } - - return Ether -})(BaseCurrency) -/** - * The only instance of the class `Ether`. - */ - -Ether.ETHER = /*#__PURE__*/ new Ether() -var ETHER = Ether.ETHER - -var _toSignificantRoundin, _toFixedRounding -var Decimal = /*#__PURE__*/ toFormat(_Decimal) -var Big = /*#__PURE__*/ toFormat(_Big) -var toSignificantRounding = - ((_toSignificantRoundin = {}), - (_toSignificantRoundin[Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN), - (_toSignificantRoundin[Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP), - (_toSignificantRoundin[Rounding.ROUND_UP] = Decimal.ROUND_UP), - _toSignificantRoundin) -var toFixedRounding = - ((_toFixedRounding = {}), - (_toFixedRounding[Rounding.ROUND_DOWN] = 0), - (_toFixedRounding[Rounding.ROUND_HALF_UP] = 1), - (_toFixedRounding[Rounding.ROUND_UP] = 3), - _toFixedRounding) -var Fraction = /*#__PURE__*/ (function () { - function Fraction(numerator, denominator) { - if (denominator === void 0) { - denominator = JSBI.BigInt(1) - } - - this.numerator = JSBI.BigInt(numerator) - this.denominator = JSBI.BigInt(denominator) - } - - Fraction.tryParseFraction = function tryParseFraction(fractionish) { - if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') - return new Fraction(fractionish) - if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish - throw new Error('Could not parse fraction') - } // performs floor division - - var _proto = Fraction.prototype - - _proto.invert = function invert() { - return new Fraction(this.denominator, this.numerator) - } - - _proto.add = function add(other) { - var otherParsed = Fraction.tryParseFraction(other) - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator) - } - - return new Fraction( - JSBI.add( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ), - JSBI.multiply(this.denominator, otherParsed.denominator) - ) - } - - _proto.subtract = function subtract(other) { - var otherParsed = Fraction.tryParseFraction(other) - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator) - } - - return new Fraction( - JSBI.subtract( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ), - JSBI.multiply(this.denominator, otherParsed.denominator) - ) - } - - _proto.lessThan = function lessThan(other) { - var otherParsed = Fraction.tryParseFraction(other) - return JSBI.lessThan( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ) - } - - _proto.equalTo = function equalTo(other) { - var otherParsed = Fraction.tryParseFraction(other) - return JSBI.equal( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ) - } - - _proto.greaterThan = function greaterThan(other) { - var otherParsed = Fraction.tryParseFraction(other) - return JSBI.greaterThan( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(otherParsed.numerator, this.denominator) - ) - } - - _proto.multiply = function multiply(other) { - var otherParsed = Fraction.tryParseFraction(other) - return new Fraction( - JSBI.multiply(this.numerator, otherParsed.numerator), - JSBI.multiply(this.denominator, otherParsed.denominator) - ) - } - - _proto.divide = function divide(other) { - var otherParsed = Fraction.tryParseFraction(other) - return new Fraction( - JSBI.multiply(this.numerator, otherParsed.denominator), - JSBI.multiply(this.denominator, otherParsed.numerator) - ) - } - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '', - } - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_HALF_UP - } - - !Number.isInteger(significantDigits) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, significantDigits + ' is not an integer.') - : invariant(false) - : void 0 - !(significantDigits > 0) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, significantDigits + ' is not positive.') - : invariant(false) - : void 0 - Decimal.set({ - precision: significantDigits + 1, - rounding: toSignificantRounding[rounding], - }) - var quotient = new Decimal(this.numerator.toString()) - .div(this.denominator.toString()) - .toSignificantDigits(significantDigits) - return quotient.toFormat(quotient.decimalPlaces(), format) - } - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '', - } - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_HALF_UP - } - - !Number.isInteger(decimalPlaces) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, decimalPlaces + ' is not an integer.') - : invariant(false) - : void 0 - !(decimalPlaces >= 0) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, decimalPlaces + ' is negative.') - : invariant(false) - : void 0 - Big.DP = decimalPlaces - Big.RM = toFixedRounding[rounding] - return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format) - } - /** - * Helper method for converting any super class back to a fraction - */ - - _createClass(Fraction, [ - { - key: 'quotient', - get: function get() { - return JSBI.divide(this.numerator, this.denominator) - }, // remainder after floor division - }, - { - key: 'remainder', - get: function get() { - return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator) - }, - }, - { - key: 'asFraction', - get: function get() { - return new Fraction(this.numerator, this.denominator) - }, - }, - ]) - - return Fraction -})() - -var Big$1 = /*#__PURE__*/ toFormat(_Big) -var CurrencyAmount = /*#__PURE__*/ (function (_Fraction) { - _inheritsLoose(CurrencyAmount, _Fraction) - - function CurrencyAmount(currency, numerator, denominator) { - var _this - - _this = _Fraction.call(this, numerator, denominator) || this - !JSBI.lessThanOrEqual(_this.quotient, MaxUint256) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'AMOUNT') - : invariant(false) - : void 0 - _this.currency = currency - _this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals)) - return _this - } - /** - * Returns a new currency amount instance from the - * @param currency the currency in the amount - * @param rawAmount the raw token or ether amount - */ - - CurrencyAmount.fromRawAmount = function fromRawAmount(currency, rawAmount) { - return new CurrencyAmount(currency, rawAmount) - } - /** - * Construct a currency amount with a denominator that is not equal to 1 - * @param currency the currency - * @param numerator the numerator of the fractional token amount - * @param denominator the denominator of the fractional token amount - */ - - CurrencyAmount.fromFractionalAmount = function fromFractionalAmount(currency, numerator, denominator) { - return new CurrencyAmount(currency, numerator, denominator) - } - /** - * Helper that calls the constructor with the ETHER currency - * @param rawAmount ether amount in wei - */ - - CurrencyAmount.ether = function ether(rawAmount) { - return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount) - } - - var _proto = CurrencyAmount.prototype - - _proto.add = function add(other) { - !currencyEquals(this.currency, other.currency) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'CURRENCY') - : invariant(false) - : void 0 - - var added = _Fraction.prototype.add.call(this, other) - - return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator) - } - - _proto.subtract = function subtract(other) { - !currencyEquals(this.currency, other.currency) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'CURRENCY') - : invariant(false) - : void 0 - - var subtracted = _Fraction.prototype.subtract.call(this, other) - - return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator) - } - - _proto.multiply = function multiply(other) { - var multiplied = _Fraction.prototype.multiply.call(this, other) - - return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator) - } - - _proto.divide = function divide(other) { - var divided = _Fraction.prototype.divide.call(this, other) - - return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator) - } - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 6 - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_DOWN - } - - return _Fraction.prototype.divide.call(this, this.decimalScale).toSignificant(significantDigits, format, rounding) - } - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = this.currency.decimals - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_DOWN - } - - !(decimalPlaces <= this.currency.decimals) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'DECIMALS') - : invariant(false) - : void 0 - return _Fraction.prototype.divide.call(this, this.decimalScale).toFixed(decimalPlaces, format, rounding) - } - - _proto.toExact = function toExact(format) { - if (format === void 0) { - format = { - groupSeparator: '', - } - } - - Big$1.DP = this.currency.decimals - return new Big$1(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format) - } - - return CurrencyAmount -})(Fraction) - -var ONE_HUNDRED = /*#__PURE__*/ new Fraction(/*#__PURE__*/ JSBI.BigInt(100)) -/** - * Converts a fraction to a percent - * @param fraction the fraction to convert - */ - -function toPercent(fraction) { - return new Percent(fraction.numerator, fraction.denominator) -} - -var Percent = /*#__PURE__*/ (function (_Fraction) { - _inheritsLoose(Percent, _Fraction) - - function Percent() { - var _this - - _this = _Fraction.apply(this, arguments) || this - /** - * This boolean prevents a fraction from being interpreted as a Percent - */ - - _this.isPercent = true - return _this - } - - var _proto = Percent.prototype - - _proto.add = function add(other) { - return toPercent(_Fraction.prototype.add.call(this, other)) - } - - _proto.subtract = function subtract(other) { - return toPercent(_Fraction.prototype.subtract.call(this, other)) - } - - _proto.multiply = function multiply(other) { - return toPercent(_Fraction.prototype.multiply.call(this, other)) - } - - _proto.divide = function divide(other) { - return toPercent(_Fraction.prototype.divide.call(this, other)) - } - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 5 - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding) - } - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 2 - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding) - } - - return Percent -})(Fraction) - -var Price = /*#__PURE__*/ (function (_Fraction) { - _inheritsLoose(Price, _Fraction) - - // denominator and numerator _must_ be raw, i.e. in the native representation - function Price(baseCurrency, quoteCurrency, denominator, numerator) { - var _this - - _this = _Fraction.call(this, numerator, denominator) || this - _this.baseCurrency = baseCurrency - _this.quoteCurrency = quoteCurrency - _this.scalar = new Fraction( - JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)), - JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals)) - ) - return _this - } - /** - * Flip the price, switching the base and quote currency - */ - - var _proto = Price.prototype - - _proto.invert = function invert() { - return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator) - } - /** - * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency - * @param other the other price - */ - - _proto.multiply = function multiply(other) { - !currencyEquals(this.quoteCurrency, other.baseCurrency) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'TOKEN') - : invariant(false) - : void 0 - - var fraction = _Fraction.prototype.multiply.call(this, other) - - return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator) - } - /** - * Return the amount of quote currency corresponding to a given amount of the base currency - * @param currencyAmount the amount of base currency to quote against the price - */ - - _proto.quote = function quote(currencyAmount) { - !currencyEquals(currencyAmount.currency, this.baseCurrency) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'TOKEN') - : invariant(false) - : void 0 - - var result = _Fraction.prototype.multiply.call(this, currencyAmount) - - return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator) - } - /** - * Get the value scaled by decimals for formatting - * @private - */ - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 6 - } - - return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding) - } - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 4 - } - - return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding) - } - - _createClass(Price, [ - { - key: 'adjustedForDecimals', - get: function get() { - return _Fraction.prototype.multiply.call(this, this.scalar) - }, - }, - ]) - - return Price -})(Fraction) - -/** - * Validates an address and returns the parsed (checksummed) version of that address - * @param address the unchecksummed hex address - */ - -function validateAndParseAddress(address) { - try { - return getAddress(address) - } catch (error) { - throw new Error(address + ' is not a valid address.') - } -} - -var _WETH -/** - * Represents an ERC20 token with a unique address and some metadata. - */ - -var Token = /*#__PURE__*/ (function (_BaseCurrency) { - _inheritsLoose(Token, _BaseCurrency) - - function Token(chainId, address, decimals, symbol, name) { - var _this - - _this = _BaseCurrency.call(this, decimals, symbol, name) || this - _this.isEther = false - _this.isToken = true - _this.chainId = chainId - _this.address = validateAndParseAddress(address) - return _this - } - /** - * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. - * @param other other token to compare - */ - - var _proto = Token.prototype - - _proto.equals = function equals(other) { - // short circuit on reference equality - if (this === other) { - return true - } - - return this.chainId === other.chainId && this.address === other.address - } - /** - * Returns true if the address of this token sorts before the address of the other token - * @param other other token to compare - * @throws if the tokens have the same address - * @throws if the tokens are on different chains - */ - - _proto.sortsBefore = function sortsBefore(other) { - !(this.chainId === other.chainId) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'CHAIN_IDS') - : invariant(false) - : void 0 - !(this.address !== other.address) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'ADDRESSES') - : invariant(false) - : void 0 - return this.address.toLowerCase() < other.address.toLowerCase() - } - - return Token -})(BaseCurrency) -var WETH9 = - ((_WETH = {}), - (_WETH[ChainId.MAINNET] = /*#__PURE__*/ new Token( - ChainId.MAINNET, - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[ChainId.ROPSTEN] = /*#__PURE__*/ new Token( - ChainId.ROPSTEN, - '0xc778417E063141139Fce010982780140Aa0cD5Ab', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[ChainId.RINKEBY] = /*#__PURE__*/ new Token( - ChainId.RINKEBY, - '0xc778417E063141139Fce010982780140Aa0cD5Ab', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[ChainId.GÖRLI] = /*#__PURE__*/ new Token( - ChainId.GÖRLI, - '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[ChainId.KOVAN] = /*#__PURE__*/ new Token( - ChainId.KOVAN, - '0xd0A1E359811322d97991E03f863a0C30C2cF029C', - 18, - 'WETH9', - 'Wrapped Ether' - )), - (_WETH[ChainId.POLYGON_AMOY] = /*#__PURE__*/ new Token( - ChainId.POLYGON_AMOY, - '0xd7a19e388c52D3580B6428F29494883A5d40C330', - 18, - 'WETH9', - 'Wrapped Ether' - )), - _WETH) - -/** - * Returns the percent difference between the mid price and the execution price, i.e. price impact. - * @param midPrice mid price before the trade - * @param inputAmount the input amount of the trade - * @param outputAmount the output amount of the trade - */ - -function computePriceImpact(midPrice, inputAmount, outputAmount) { - var quotedOutputAmount = midPrice.quote(inputAmount) // calculate price impact := (exactQuote - outputAmount) / exactQuote - - var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount) - return new Percent(priceImpact.numerator, priceImpact.denominator) -} - -// `maxSize` by removing the last item - -function sortedInsert(items, add, maxSize, comparator) { - !(maxSize > 0) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'MAX_SIZE_ZERO') - : invariant(false) - : void 0 // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize - - !(items.length <= maxSize) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'ITEMS_SIZE') - : invariant(false) - : void 0 // short circuit first item add - - if (items.length === 0) { - items.push(add) - return null - } else { - var isFull = items.length === maxSize // short circuit if full and the additional item does not come before the last item - - if (isFull && comparator(items[items.length - 1], add) <= 0) { - return add - } - - var lo = 0, - hi = items.length - - while (lo < hi) { - var mid = (lo + hi) >>> 1 - - if (comparator(items[mid], add) <= 0) { - lo = mid + 1 - } else { - hi = mid - } - } - - items.splice(lo, 0, add) - return isFull ? items.pop() : null - } -} - -var MAX_SAFE_INTEGER = /*#__PURE__*/ JSBI.BigInt(Number.MAX_SAFE_INTEGER) -var ZERO = /*#__PURE__*/ JSBI.BigInt(0) -var ONE = /*#__PURE__*/ JSBI.BigInt(1) -var TWO = /*#__PURE__*/ JSBI.BigInt(2) -/** - * Computes floor(sqrt(value)) - * @param value the value for which to compute the square root, rounded down - */ - -function sqrt(value) { - !JSBI.greaterThanOrEqual(value, ZERO) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'NEGATIVE') - : invariant(false) - : void 0 // rely on built in sqrt if possible - - if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) { - return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value)))) - } - - var z - var x - z = value - x = JSBI.add(JSBI.divide(value, TWO), ONE) - - while (JSBI.lessThan(x, z)) { - z = x - x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO) - } - - return z -} - -/** - * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token - * @param currency the currency to wrap, if necessary - * @param chainId the ID of the chain for wrapping - */ - -function wrappedCurrency(currency, chainId) { - if (currency.isToken) { - !(currency.chainId === chainId) - ? process.env.NODE_ENV !== 'production' - ? invariant(false, 'CHAIN_ID') - : invariant(false) - : void 0 - return currency - } - - if (currency.isEther) return WETH9[chainId] - throw new Error('CURRENCY') -} - -/** - * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. - * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns - * the input currency amount. - */ - -function wrappedCurrencyAmount(currencyAmount, chainId) { - return CurrencyAmount.fromFractionalAmount( - wrappedCurrency(currencyAmount.currency, chainId), - currencyAmount.numerator, - currencyAmount.denominator - ) -} - -export { - ChainId, - CurrencyAmount, - ETHER, - Ether, - Fraction, - MaxUint256, - Percent, - Price, - Rounding, - Token, - TradeType, - WETH9, - computePriceImpact, - currencyEquals, - sortedInsert, - sqrt, - validateAndParseAddress, - wrappedCurrency, - wrappedCurrencyAmount, -} -//# sourceMappingURL=sdk-core.esm.js.map diff --git a/src/libs/sdk-core/dist/sdk-core.esm.js.map b/src/libs/sdk-core/dist/sdk-core.esm.js.map deleted file mode 100644 index 643d3380023..00000000000 --- a/src/libs/sdk-core/dist/sdk-core.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sdk-core.esm.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import { Currency } from '../entities/currency'\n\n/**\n * Compares two currencies for equality\n */\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\n if (currencyA.isToken && currencyB.isToken) {\n return currencyA.equals(currencyB)\n } else if (currencyA.isToken) {\n return false\n } else if (currencyB.isToken) {\n return false\n } else {\n return currencyA.isEther === currencyB.isEther\n }\n}\n","import invariant from 'tiny-invariant'\n\n/**\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\n *\n * The only instance of the base class `Currency` is Ether.\n */\nexport abstract class BaseCurrency {\n public abstract readonly isEther: boolean\n public abstract readonly isToken: boolean\n\n public readonly decimals: number\n public readonly symbol?: string\n public readonly name?: string\n\n /**\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\n * @param decimals decimals of the currency\n * @param symbol symbol of the currency\n * @param name of the currency\n */\n protected constructor(decimals: number, symbol?: string, name?: string) {\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\n\n this.decimals = decimals\n this.symbol = symbol\n this.name = name\n }\n}\n","import { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents the currency Ether\n */\nexport class Ether extends BaseCurrency {\n public readonly isEther: true = true\n public readonly isToken: false = false\n\n /**\n * Only called once by this class\n * @protected\n */\n protected constructor() {\n super(18, 'ETH', 'Ether')\n }\n\n /**\n * The only instance of the class `Ether`.\n */\n public static readonly ETHER: Ether = new Ether()\n}\n\nexport const ETHER = Ether.ETHER\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport _Decimal from 'decimal.js-light'\nimport _Big, { RoundingMode } from 'big.js'\nimport toFormat from 'toformat'\n\nimport { BigintIsh, Rounding } from '../../constants'\n\nconst Decimal = toFormat(_Decimal)\nconst Big = toFormat(_Big)\n\nconst toSignificantRounding = {\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\n}\n\nconst toFixedRounding = {\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\n}\n\nexport class Fraction {\n public readonly numerator: JSBI\n public readonly denominator: JSBI\n\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\n this.numerator = JSBI.BigInt(numerator)\n this.denominator = JSBI.BigInt(denominator)\n }\n\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\n return new Fraction(fractionish)\n\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\n throw new Error('Could not parse fraction')\n }\n\n // performs floor division\n public get quotient(): JSBI {\n return JSBI.divide(this.numerator, this.denominator)\n }\n\n // remainder after floor division\n public get remainder(): Fraction {\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\n }\n\n public invert(): Fraction {\n return new Fraction(this.denominator, this.numerator)\n }\n\n public add(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.add(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public subtract(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\n }\n return new Fraction(\n JSBI.subtract(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n ),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public lessThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.lessThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public equalTo(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.equal(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public greaterThan(other: Fraction | BigintIsh): boolean {\n const otherParsed = Fraction.tryParseFraction(other)\n return JSBI.greaterThan(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(otherParsed.numerator, this.denominator)\n )\n }\n\n public multiply(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.numerator),\n JSBI.multiply(this.denominator, otherParsed.denominator)\n )\n }\n\n public divide(other: Fraction | BigintIsh): Fraction {\n const otherParsed = Fraction.tryParseFraction(other)\n return new Fraction(\n JSBI.multiply(this.numerator, otherParsed.denominator),\n JSBI.multiply(this.denominator, otherParsed.numerator)\n )\n }\n\n public toSignificant(\n significantDigits: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\n\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\n const quotient = new Decimal(this.numerator.toString())\n .div(this.denominator.toString())\n .toSignificantDigits(significantDigits)\n return quotient.toFormat(quotient.decimalPlaces(), format)\n }\n\n public toFixed(\n decimalPlaces: number,\n format: object = { groupSeparator: '' },\n rounding: Rounding = Rounding.ROUND_HALF_UP\n ): string {\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\n\n Big.DP = decimalPlaces\n Big.RM = toFixedRounding[rounding]\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\n }\n\n /**\n * Helper method for converting any super class back to a fraction\n */\n public get asFraction(): Fraction {\n return new Fraction(this.numerator, this.denominator)\n }\n}\n","import invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport { Currency } from '../currency'\nimport { Ether } from '../ether'\nimport { Fraction } from './fraction'\nimport _Big from 'big.js'\n\nimport toFormat from 'toformat'\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\n\nconst Big = toFormat(_Big)\n\nexport class CurrencyAmount extends Fraction {\n public readonly currency: T\n public readonly decimalScale: JSBI\n\n /**\n * Returns a new currency amount instance from the\n * @param currency the currency in the amount\n * @param rawAmount the raw token or ether amount\n */\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\n return new CurrencyAmount(currency, rawAmount)\n }\n\n /**\n * Construct a currency amount with a denominator that is not equal to 1\n * @param currency the currency\n * @param numerator the numerator of the fractional token amount\n * @param denominator the denominator of the fractional token amount\n */\n public static fromFractionalAmount(\n currency: T,\n numerator: BigintIsh,\n denominator: BigintIsh\n ): CurrencyAmount {\n return new CurrencyAmount(currency, numerator, denominator)\n }\n\n /**\n * Helper that calls the constructor with the ETHER currency\n * @param rawAmount ether amount in wei\n */\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\n }\n\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\n super(numerator, denominator)\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\n this.currency = currency\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\n }\n\n public add(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const added = super.add(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\n }\n\n public subtract(other: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\n const subtracted = super.subtract(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\n }\n\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\n const multiplied = super.multiply(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\n }\n\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\n const divided = super.divide(other)\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\n }\n\n public toSignificant(\n significantDigits: number = 6,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(\n decimalPlaces: number = this.currency.decimals,\n format?: object,\n rounding: Rounding = Rounding.ROUND_DOWN\n ): string {\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\n }\n\n public toExact(format: object = { groupSeparator: '' }): string {\n Big.DP = this.currency.decimals\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\n }\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Fraction } from './fraction'\n\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\n\n/**\n * Converts a fraction to a percent\n * @param fraction the fraction to convert\n */\nfunction toPercent(fraction: Fraction): Percent {\n return new Percent(fraction.numerator, fraction.denominator)\n}\n\nexport class Percent extends Fraction {\n /**\n * This boolean prevents a fraction from being interpreted as a Percent\n */\n public readonly isPercent: true = true\n\n add(other: Fraction | BigintIsh): Percent {\n return toPercent(super.add(other))\n }\n\n subtract(other: Fraction | BigintIsh): Percent {\n return toPercent(super.subtract(other))\n }\n\n multiply(other: Fraction | BigintIsh): Percent {\n return toPercent(super.multiply(other))\n }\n\n divide(other: Fraction | BigintIsh): Percent {\n return toPercent(super.divide(other))\n }\n\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\n }\n}\n","import JSBI from 'jsbi'\nimport { currencyEquals } from '../../utils/currencyEquals'\nimport invariant from 'tiny-invariant'\n\nimport { BigintIsh, Rounding } from '../../constants'\nimport { Currency } from '../currency'\nimport { Fraction } from './fraction'\nimport { CurrencyAmount } from './currencyAmount'\n\nexport class Price extends Fraction {\n public readonly baseCurrency: TBase // input i.e. denominator\n public readonly quoteCurrency: TQuote // output i.e. numerator\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\n\n // denominator and numerator _must_ be raw, i.e. in the native representation\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\n super(numerator, denominator)\n\n this.baseCurrency = baseCurrency\n this.quoteCurrency = quoteCurrency\n this.scalar = new Fraction(\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\n )\n }\n\n /**\n * Flip the price, switching the base and quote currency\n */\n public invert(): Price {\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\n }\n\n /**\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\n * @param other the other price\n */\n public multiply(other: Price): Price {\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\n const fraction = super.multiply(other)\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\n }\n\n /**\n * Return the amount of quote currency corresponding to a given amount of the base currency\n * @param currencyAmount the amount of base currency to quote against the price\n */\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\n const result = super.multiply(currencyAmount)\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\n }\n\n /**\n * Get the value scaled by decimals for formatting\n * @private\n */\n private get adjustedForDecimals(): Fraction {\n return super.multiply(this.scalar)\n }\n\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\n }\n\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\n }\n}\n","import { getAddress } from '@ethersproject/address'\n\n/**\n * Validates an address and returns the parsed (checksummed) version of that address\n * @param address the unchecksummed hex address\n */\nexport function validateAndParseAddress(address: string): string {\n try {\n return getAddress(address)\n } catch (error) {\n throw new Error(`${address} is not a valid address.`)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\nimport { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents an ERC20 token with a unique address and some metadata.\n */\nexport class Token extends BaseCurrency {\n public readonly isEther: false = false\n public readonly isToken: true = true\n\n public readonly chainId: ChainId | number\n public readonly address: string\n\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\n super(decimals, symbol, name)\n this.chainId = chainId\n this.address = validateAndParseAddress(address)\n }\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Token): boolean {\n // short circuit on reference equality\n if (this === other) {\n return true\n }\n return this.chainId === other.chainId && this.address === other.address\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: Token): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n}\n\nexport const WETH9: { [chainId in ChainId]: Token } = {\n [ChainId.MAINNET]: new Token(\n ChainId.MAINNET,\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.ROPSTEN]: new Token(\n ChainId.ROPSTEN,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.RINKEBY]: new Token(\n ChainId.RINKEBY,\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n 18,\n 'WETH9',\n 'Wrapped Ether'\n ),\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether')\n}\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\n\n/**\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\n * @param midPrice mid price before the trade\n * @param inputAmount the input amount of the trade\n * @param outputAmount the output amount of the trade\n */\nexport function computePriceImpact(\n midPrice: Price,\n inputAmount: CurrencyAmount,\n outputAmount: CurrencyAmount\n): Percent {\n const quotedOutputAmount = midPrice.quote(inputAmount)\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\n return new Percent(priceImpact.numerator, priceImpact.denominator)\n}\n","import invariant from 'tiny-invariant'\n\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\n// `maxSize` by removing the last item\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\n\n // short circuit first item add\n if (items.length === 0) {\n items.push(add)\n return null\n } else {\n const isFull = items.length === maxSize\n // short circuit if full and the additional item does not come before the last item\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\n return add\n }\n\n let lo = 0,\n hi = items.length\n\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (comparator(items[mid], add) <= 0) {\n lo = mid + 1\n } else {\n hi = mid\n }\n }\n items.splice(lo, 0, add)\n return isFull ? items.pop()! : null\n }\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\n\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\n\nconst ZERO = JSBI.BigInt(0)\nconst ONE = JSBI.BigInt(1)\nconst TWO = JSBI.BigInt(2)\n\n/**\n * Computes floor(sqrt(value))\n * @param value the value for which to compute the square root, rounded down\n */\nexport function sqrt(value: JSBI): JSBI {\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\n\n // rely on built in sqrt if possible\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\n }\n\n let z: JSBI\n let x: JSBI\n z = value\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\n while (JSBI.lessThan(x, z)) {\n z = x\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\n }\n return z\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId } from '../constants'\nimport { Currency, Token, WETH9 } from '../entities'\n\n/**\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\n * @param currency the currency to wrap, if necessary\n * @param chainId the ID of the chain for wrapping\n */\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\n if (currency.isToken) {\n invariant(currency.chainId === chainId, 'CHAIN_ID')\n return currency\n }\n if (currency.isEther) return WETH9[chainId]\n throw new Error('CURRENCY')\n}\n","import { ChainId } from '../constants'\nimport { Currency, CurrencyAmount, Token } from '../entities'\nimport { wrappedCurrency } from './wrappedCurrency'\n\n/**\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\n * the input currency amount.\n */\nexport function wrappedCurrencyAmount(\n currencyAmount: CurrencyAmount,\n chainId: ChainId\n): CurrencyAmount {\n return CurrencyAmount.fromFractionalAmount(\n wrappedCurrency(currencyAmount.currency, chainId),\n currencyAmount.numerator,\n currencyAmount.denominator\n )\n}\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","added","subtracted","multiplied","divided","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","computePriceImpact","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","sortedInsert","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","MAX_SAFE_INTEGER","ZERO","ONE","TWO","sqrt","value","greaterThanOrEqual","Math","floor","toNumber","z","x","wrappedCurrency","wrappedCurrencyAmount"],"mappings":";;;;;;;IAKYA;;AAAZ,WAAYA;AACVA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,gCAAA,aAAA;AACAA,EAAAA,8BAAA,UAAA;AACD,CAND,EAAYA,OAAO,KAAPA,OAAO,KAAA,CAAnB;;IAQYC;;AAAZ,WAAYA;AACVA,EAAAA,uCAAA,gBAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAHD,EAAYA,SAAS,KAATA,SAAS,KAAA,CAArB;;IAKYC;;AAAZ,WAAYA;AACVA,EAAAA,oCAAA,eAAA;AACAA,EAAAA,uCAAA,kBAAA;AACAA,EAAAA,kCAAA,aAAA;AACD,CAJD,EAAYA,QAAQ,KAARA,QAAQ,KAAA,CAApB;;IAMaC,UAAU,gBAAGC,IAAI,CAACC,MAAL,CAAY,oEAAZ;;;;;;;;;;;;;;;;;;;;;;;;ACtB1B;;;AAGA,SAAgBC,eAAeC,WAAqBC;AAClD,MAAID,SAAS,CAACE,OAAV,IAAqBD,SAAS,CAACC,OAAnC,EAA4C;AAC1C,WAAOF,SAAS,CAACG,MAAV,CAAiBF,SAAjB,CAAP;AACD,GAFD,MAEO,IAAID,SAAS,CAACE,OAAd,EAAuB;AAC5B,WAAO,KAAP;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,CAACvD,SAFV,EAGLuD,cAAc,CAACtD,WAHV,CAAP;AAKD;;;;"} \ No newline at end of file diff --git a/src/libs/sdk-core/dist/utils/computePriceImpact.d.ts b/src/libs/sdk-core/dist/utils/computePriceImpact.d.ts deleted file mode 100644 index 0161f44e74b..00000000000 --- a/src/libs/sdk-core/dist/utils/computePriceImpact.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Currency, CurrencyAmount, Percent, Price } from '../entities'; -/** - * Returns the percent difference between the mid price and the execution price, i.e. price impact. - * @param midPrice mid price before the trade - * @param inputAmount the input amount of the trade - * @param outputAmount the output amount of the trade - */ -export declare function computePriceImpact(midPrice: Price, inputAmount: CurrencyAmount, outputAmount: CurrencyAmount): Percent; diff --git a/src/libs/sdk-core/dist/utils/currencyEquals.d.ts b/src/libs/sdk-core/dist/utils/currencyEquals.d.ts deleted file mode 100644 index f434dc5bba9..00000000000 --- a/src/libs/sdk-core/dist/utils/currencyEquals.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Currency } from '../entities/currency'; -/** - * Compares two currencies for equality - */ -export declare function currencyEquals(currencyA: Currency, currencyB: Currency): boolean; diff --git a/src/libs/sdk-core/dist/utils/index.d.ts b/src/libs/sdk-core/dist/utils/index.d.ts deleted file mode 100644 index 6440331c9e6..00000000000 --- a/src/libs/sdk-core/dist/utils/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { computePriceImpact } from './computePriceImpact'; -export { currencyEquals } from './currencyEquals'; -export { validateAndParseAddress } from './validateAndParseAddress'; -export { sortedInsert } from './sortedInsert'; -export { sqrt } from './sqrt'; -export { wrappedCurrency } from './wrappedCurrency'; -export { wrappedCurrencyAmount } from './wrappedCurrencyAmount'; diff --git a/src/libs/sdk-core/dist/utils/sortedInsert.d.ts b/src/libs/sdk-core/dist/utils/sortedInsert.d.ts deleted file mode 100644 index 562be26f112..00000000000 --- a/src/libs/sdk-core/dist/utils/sortedInsert.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null; diff --git a/src/libs/sdk-core/dist/utils/sqrt.d.ts b/src/libs/sdk-core/dist/utils/sqrt.d.ts deleted file mode 100644 index f1adc876d72..00000000000 --- a/src/libs/sdk-core/dist/utils/sqrt.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import JSBI from 'jsbi'; -export declare const MAX_SAFE_INTEGER: JSBI; -/** - * Computes floor(sqrt(value)) - * @param value the value for which to compute the square root, rounded down - */ -export declare function sqrt(value: JSBI): JSBI; diff --git a/src/libs/sdk-core/dist/utils/validateAndParseAddress.d.ts b/src/libs/sdk-core/dist/utils/validateAndParseAddress.d.ts deleted file mode 100644 index 98f35a8beb2..00000000000 --- a/src/libs/sdk-core/dist/utils/validateAndParseAddress.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Validates an address and returns the parsed (checksummed) version of that address - * @param address the unchecksummed hex address - */ -export declare function validateAndParseAddress(address: string): string; diff --git a/src/libs/sdk-core/dist/utils/wrappedCurrency.d.ts b/src/libs/sdk-core/dist/utils/wrappedCurrency.d.ts deleted file mode 100644 index 70a51073993..00000000000 --- a/src/libs/sdk-core/dist/utils/wrappedCurrency.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ChainId } from '../constants' -import { Currency, Token } from '../entities' -/** - * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token - * @param currency the currency to wrap, if necessary - * @param chainId the ID of the chain for wrapping - */ -export declare function wrappedCurrency(currency: Currency, chainId: ChainId): Token diff --git a/src/libs/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts b/src/libs/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts deleted file mode 100644 index 129599b41dc..00000000000 --- a/src/libs/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ChainId } from '../constants' -import { Currency, CurrencyAmount, Token } from '../entities' -/** - * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. - * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns - * the input currency amount. - */ -export declare function wrappedCurrencyAmount( - currencyAmount: CurrencyAmount, - chainId: ChainId -): CurrencyAmount diff --git a/src/libs/sdk-core/package.json b/src/libs/sdk-core/package.json deleted file mode 100644 index b6cee43afba..00000000000 --- a/src/libs/sdk-core/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@uniswap/sdk-core", - "license": "MIT", - "version": "3.0.0-alpha.1", - "description": "⚒️ An SDK for building applications on top of Uniswap V3", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "files": [ - "dist" - ], - "repository": "https://github.com/Uniswap/uniswap-sdk-core.git", - "keywords": [ - "uniswap", - "ethereum" - ], - "module": "dist/sdk-core.esm.js", - "scripts": { - "build": "tsdx build", - "start": "tsdx watch", - "test": "tsdx test", - "prepublishOnly": "tsdx build" - }, - "dependencies": { - "@ethersproject/address": "^5.0.2", - "big.js": "^5.2.2", - "decimal.js-light": "^2.5.0", - "jsbi": "^3.1.4", - "tiny-invariant": "^1.1.0", - "toformat": "^2.0.0" - }, - "devDependencies": { - "@types/big.js": "^4.0.5", - "@types/jest": "^24.0.25", - "tsdx": "^0.14.1" - }, - "engines": { - "node": ">=10" - }, - "prettier": { - "printWidth": 120, - "semi": false, - "singleQuote": true - } -} diff --git a/src/libs/sdk-core/yarn.lock b/src/libs/sdk-core/yarn.lock deleted file mode 100644 index 9c008be4fa8..00000000000 --- a/src/libs/sdk-core/yarn.lock +++ /dev/null @@ -1,6823 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ampproject/remapping@^2.2.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" - integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== - dependencies: - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.24" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2", "@babel/code-frame@^7.5.5": - version "7.26.2" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" - integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - js-tokens "^4.0.0" - picocolors "^1.0.0" - -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.3.tgz#99488264a56b2aded63983abd6a417f03b92ed02" - integrity sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g== - -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.4.4", "@babel/core@^7.7.5": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" - integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.0" - "@babel/generator" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.0" - "@babel/parser" "^7.26.0" - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.26.0" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/generator@^7.26.0", "@babel/generator@^7.26.3": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" - integrity sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== - dependencies: - "@babel/parser" "^7.26.3" - "@babel/types" "^7.26.3" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - -"@babel/helper-annotate-as-pure@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" - integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== - dependencies: - "@babel/types" "^7.25.9" - -"@babel/helper-compilation-targets@^7.10.4", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" - integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== - dependencies: - "@babel/compat-data" "^7.25.9" - "@babel/helper-validator-option" "^7.25.9" - browserslist "^4.24.0" - lru-cache "^5.1.1" - semver "^6.3.1" - -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" - integrity sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-member-expression-to-functions" "^7.25.9" - "@babel/helper-optimise-call-expression" "^7.25.9" - "@babel/helper-replace-supers" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" - "@babel/traverse" "^7.25.9" - semver "^6.3.1" - -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.25.9": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.26.3.tgz#5169756ecbe1d95f7866b90bb555b022595302a0" - integrity sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong== - dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - regexpu-core "^6.2.0" - semver "^6.3.1" - -"@babel/helper-define-polyfill-provider@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.0.3.tgz#df9da66285b884ce66417abdd0b6ca91198149bd" - integrity sha512-dULDd/APiP4JowYDAMosecKOi/1v+UId99qhBGiO3myM29KtAVKS/R3x3OJJNBR0FeYB1BcYb2dCwkhqvxWXXQ== - dependencies: - "@babel/helper-compilation-targets" "^7.10.4" - "@babel/helper-module-imports" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/traverse" "^7.11.5" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - semver "^6.1.2" - -"@babel/helper-define-polyfill-provider@^0.6.2", "@babel/helper-define-polyfill-provider@^0.6.3": - version "0.6.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" - integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== - dependencies: - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-plugin-utils" "^7.22.5" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - -"@babel/helper-member-expression-to-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" - integrity sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" - integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" - integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== - dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-optimise-call-expression@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" - integrity sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== - dependencies: - "@babel/types" "^7.25.9" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" - integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== - -"@babel/helper-remap-async-to-generator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" - integrity sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-wrap-function" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-replace-supers@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz#ba447224798c3da3f8713fc272b145e33da6a5c5" - integrity sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.25.9" - "@babel/helper-optimise-call-expression" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-skip-transparent-expression-wrappers@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" - integrity sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-string-parser@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" - integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== - -"@babel/helper-validator-identifier@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" - integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== - -"@babel/helper-validator-option@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" - integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== - -"@babel/helper-wrap-function@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz#d99dfd595312e6c894bd7d237470025c85eea9d0" - integrity sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g== - dependencies: - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helpers@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" - integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== - dependencies: - "@babel/template" "^7.25.9" - "@babel/types" "^7.26.0" - -"@babel/parser@^7.1.0", "@babel/parser@^7.11.5", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.3", "@babel/parser@^7.7.0": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" - integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== - dependencies: - "@babel/types" "^7.26.3" - -"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" - integrity sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/plugin-bugfix-safari-class-field-initializer-scope@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz#af9e4fb63ccb8abcb92375b2fcfe36b60c774d30" - integrity sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz#e8dc26fcd616e6c5bf2bd0d5a2c151d4f92a9137" - integrity sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz#807a667f9158acac6f6164b4beb85ad9ebc9e1d1" - integrity sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" - "@babel/plugin-transform-optional-chaining" "^7.25.9" - -"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz#de7093f1e7deaf68eadd7cc6b07f2ab82543269e" - integrity sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/plugin-proposal-class-properties@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" - integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": - version "7.21.0-placeholder-for-preset-env.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" - integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-bigint@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.8.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-import-assertions@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" - integrity sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-syntax-import-attributes@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" - integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-syntax-import-meta@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" - integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-arrow-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz#7821d4410bee5daaadbb4cdd9a6649704e176845" - integrity sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-async-generator-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" - integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-remap-async-to-generator" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/plugin-transform-async-to-generator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz#c80008dacae51482793e5a9c08b39a5be7e12d71" - integrity sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== - dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-remap-async-to-generator" "^7.25.9" - -"@babel/plugin-transform-block-scoped-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz#5700691dbd7abb93de300ca7be94203764fce458" - integrity sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-block-scoping@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz#c33665e46b06759c93687ca0f84395b80c0473a1" - integrity sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-class-properties@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz#a8ce84fedb9ad512549984101fa84080a9f5f51f" - integrity sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-class-static-block@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz#6c8da219f4eb15cae9834ec4348ff8e9e09664a0" - integrity sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-classes@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz#7152457f7880b593a63ade8a861e6e26a4469f52" - integrity sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-replace-supers" "^7.25.9" - "@babel/traverse" "^7.25.9" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz#db36492c78460e534b8852b1d5befe3c923ef10b" - integrity sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/template" "^7.25.9" - -"@babel/plugin-transform-destructuring@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz#966ea2595c498224340883602d3cfd7a0c79cea1" - integrity sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-dotall-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz#bad7945dd07734ca52fe3ad4e872b40ed09bb09a" - integrity sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-duplicate-keys@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz#8850ddf57dce2aebb4394bb434a7598031059e6d" - integrity sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-duplicate-named-capturing-groups-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz#6f7259b4de127721a08f1e5165b852fcaa696d31" - integrity sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-dynamic-import@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz#23e917de63ed23c6600c5dd06d94669dce79f7b8" - integrity sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-exponentiation-operator@^7.25.9": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" - integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-export-namespace-from@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz#90745fe55053394f554e40584cda81f2c8a402a2" - integrity sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-for-of@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz#4bdc7d42a213397905d89f02350c5267866d5755" - integrity sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" - -"@babel/plugin-transform-function-name@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz#939d956e68a606661005bfd550c4fc2ef95f7b97" - integrity sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== - dependencies: - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/plugin-transform-json-strings@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz#c86db407cb827cded902a90c707d2781aaa89660" - integrity sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz#1a1c6b4d4aa59bc4cad5b6b3a223a0abd685c9de" - integrity sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-logical-assignment-operators@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz#b19441a8c39a2fda0902900b306ea05ae1055db7" - integrity sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-member-expression-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz#63dff19763ea64a31f5e6c20957e6a25e41ed5de" - integrity sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-modules-amd@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz#49ba478f2295101544abd794486cd3088dddb6c5" - integrity sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== - dependencies: - "@babel/helper-module-transforms" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-modules-commonjs@^7.25.9": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" - integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== - dependencies: - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-modules-systemjs@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" - integrity sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== - dependencies: - "@babel/helper-module-transforms" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/plugin-transform-modules-umd@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz#6710079cdd7c694db36529a1e8411e49fcbf14c9" - integrity sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== - dependencies: - "@babel/helper-module-transforms" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz#454990ae6cc22fd2a0fa60b3a2c6f63a38064e6a" - integrity sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-new-target@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz#42e61711294b105c248336dcb04b77054ea8becd" - integrity sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz#bcb1b0d9e948168102d5f7104375ca21c3266949" - integrity sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-numeric-separator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz#bfed75866261a8b643468b0ccfd275f2033214a1" - integrity sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-object-rest-spread@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz#0203725025074164808bcf1a2cfa90c652c99f18" - integrity sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== - dependencies: - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/plugin-transform-parameters" "^7.25.9" - -"@babel/plugin-transform-object-super@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz#385d5de135162933beb4a3d227a2b7e52bb4cf03" - integrity sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-replace-supers" "^7.25.9" - -"@babel/plugin-transform-optional-catch-binding@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz#10e70d96d52bb1f10c5caaac59ac545ea2ba7ff3" - integrity sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-optional-chaining@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz#e142eb899d26ef715435f201ab6e139541eee7dd" - integrity sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" - -"@babel/plugin-transform-parameters@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz#b856842205b3e77e18b7a7a1b94958069c7ba257" - integrity sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-private-methods@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz#847f4139263577526455d7d3223cd8bda51e3b57" - integrity sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-private-property-in-object@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz#9c8b73e64e6cc3cbb2743633885a7dd2c385fe33" - integrity sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-create-class-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-property-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz#d72d588bd88b0dec8b62e36f6fda91cedfe28e3f" - integrity sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-regenerator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz#03a8a4670d6cebae95305ac6defac81ece77740b" - integrity sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - regenerator-transform "^0.15.2" - -"@babel/plugin-transform-regexp-modifiers@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz#2f5837a5b5cd3842a919d8147e9903cc7455b850" - integrity sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-reserved-words@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz#0398aed2f1f10ba3f78a93db219b27ef417fb9ce" - integrity sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-shorthand-properties@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz#bb785e6091f99f826a95f9894fc16fde61c163f2" - integrity sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-spread@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz#24a35153931b4ba3d13cec4a7748c21ab5514ef9" - integrity sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" - -"@babel/plugin-transform-sticky-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz#c7f02b944e986a417817b20ba2c504dfc1453d32" - integrity sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-template-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" - integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-typeof-symbol@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" - integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-unicode-escapes@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz#a75ef3947ce15363fccaa38e2dd9bc70b2788b82" - integrity sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-unicode-property-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz#a901e96f2c1d071b0d1bb5dc0d3c880ce8f53dd3" - integrity sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-unicode-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz#5eae747fe39eacf13a8bd006a4fb0b5d1fa5e9b1" - integrity sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-transform-unicode-sets-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz#65114c17b4ffc20fa5b163c63c70c0d25621fabe" - integrity sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/preset-env@^7.11.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" - integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== - dependencies: - "@babel/compat-data" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-validator-option" "^7.25.9" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" - "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.25.9" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.25.9" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.25.9" - "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" - "@babel/plugin-syntax-import-assertions" "^7.26.0" - "@babel/plugin-syntax-import-attributes" "^7.26.0" - "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" - "@babel/plugin-transform-arrow-functions" "^7.25.9" - "@babel/plugin-transform-async-generator-functions" "^7.25.9" - "@babel/plugin-transform-async-to-generator" "^7.25.9" - "@babel/plugin-transform-block-scoped-functions" "^7.25.9" - "@babel/plugin-transform-block-scoping" "^7.25.9" - "@babel/plugin-transform-class-properties" "^7.25.9" - "@babel/plugin-transform-class-static-block" "^7.26.0" - "@babel/plugin-transform-classes" "^7.25.9" - "@babel/plugin-transform-computed-properties" "^7.25.9" - "@babel/plugin-transform-destructuring" "^7.25.9" - "@babel/plugin-transform-dotall-regex" "^7.25.9" - "@babel/plugin-transform-duplicate-keys" "^7.25.9" - "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" - "@babel/plugin-transform-dynamic-import" "^7.25.9" - "@babel/plugin-transform-exponentiation-operator" "^7.25.9" - "@babel/plugin-transform-export-namespace-from" "^7.25.9" - "@babel/plugin-transform-for-of" "^7.25.9" - "@babel/plugin-transform-function-name" "^7.25.9" - "@babel/plugin-transform-json-strings" "^7.25.9" - "@babel/plugin-transform-literals" "^7.25.9" - "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" - "@babel/plugin-transform-member-expression-literals" "^7.25.9" - "@babel/plugin-transform-modules-amd" "^7.25.9" - "@babel/plugin-transform-modules-commonjs" "^7.25.9" - "@babel/plugin-transform-modules-systemjs" "^7.25.9" - "@babel/plugin-transform-modules-umd" "^7.25.9" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" - "@babel/plugin-transform-new-target" "^7.25.9" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" - "@babel/plugin-transform-numeric-separator" "^7.25.9" - "@babel/plugin-transform-object-rest-spread" "^7.25.9" - "@babel/plugin-transform-object-super" "^7.25.9" - "@babel/plugin-transform-optional-catch-binding" "^7.25.9" - "@babel/plugin-transform-optional-chaining" "^7.25.9" - "@babel/plugin-transform-parameters" "^7.25.9" - "@babel/plugin-transform-private-methods" "^7.25.9" - "@babel/plugin-transform-private-property-in-object" "^7.25.9" - "@babel/plugin-transform-property-literals" "^7.25.9" - "@babel/plugin-transform-regenerator" "^7.25.9" - "@babel/plugin-transform-regexp-modifiers" "^7.26.0" - "@babel/plugin-transform-reserved-words" "^7.25.9" - "@babel/plugin-transform-shorthand-properties" "^7.25.9" - "@babel/plugin-transform-spread" "^7.25.9" - "@babel/plugin-transform-sticky-regex" "^7.25.9" - "@babel/plugin-transform-template-literals" "^7.25.9" - "@babel/plugin-transform-typeof-symbol" "^7.25.9" - "@babel/plugin-transform-unicode-escapes" "^7.25.9" - "@babel/plugin-transform-unicode-property-regex" "^7.25.9" - "@babel/plugin-transform-unicode-regex" "^7.25.9" - "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" - "@babel/preset-modules" "0.1.6-no-external-plugins" - babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.10.6" - babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.38.1" - semver "^6.3.1" - -"@babel/preset-modules@0.1.6-no-external-plugins": - version "0.1.6-no-external-plugins" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" - integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/types" "^7.4.4" - esutils "^2.0.2" - -"@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" - integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/template@^7.25.9", "@babel/template@^7.3.3": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" - integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== - dependencies: - "@babel/code-frame" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.11.5", "@babel/traverse@^7.25.9", "@babel/traverse@^7.7.0": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.26.3.tgz#1ebfc75bd748d8f96b3cc63af5e82ebd4c37ba35" - integrity sha512-yTmc8J+Sj8yLzwr4PD5Xb/WF3bOYu2C2OoSZPzbuqRm4n98XirsbzaX+GloeO376UnSYIYJ4NCanwV5/ugZkwA== - dependencies: - "@babel/code-frame" "^7.26.2" - "@babel/generator" "^7.26.3" - "@babel/parser" "^7.26.3" - "@babel/template" "^7.25.9" - "@babel/types" "^7.26.3" - debug "^4.3.1" - globals "^11.1.0" - -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.26.3", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" - integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@cnakazawa/watch@^1.0.3": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" - integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== - dependencies: - exec-sh "^0.3.2" - minimist "^1.2.0" - -"@ethersproject/address@^5.0.2": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" - integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - -"@ethersproject/bignumber@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" - integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - bn.js "^5.2.1" - -"@ethersproject/bytes@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" - integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== - dependencies: - "@ethersproject/logger" "^5.7.0" - -"@ethersproject/keccak256@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" - integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" - integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== - -"@ethersproject/rlp@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" - integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/console@^25.5.0": - version "25.5.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.5.0.tgz#770800799d510f37329c508a9edd0b7b447d9abb" - integrity sha512-T48kZa6MK1Y6k4b89sexwmSF4YLeZS/Udqg3Jj3jG/cHH+N/sLFCEoXEDMOKugJQ9FxPN1osxIknvKkxt6MKyw== - dependencies: - "@jest/types" "^25.5.0" - chalk "^3.0.0" - jest-message-util "^25.5.0" - jest-util "^25.5.0" - slash "^3.0.0" - -"@jest/core@^25.5.4": - version "25.5.4" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.5.4.tgz#3ef7412f7339210f003cdf36646bbca786efe7b4" - integrity sha512-3uSo7laYxF00Dg/DMgbn4xMJKmDdWvZnf89n8Xj/5/AeQ2dOQmn6b6Hkj/MleyzZWXpwv+WSdYWl4cLsy2JsoA== - dependencies: - "@jest/console" "^25.5.0" - "@jest/reporters" "^25.5.1" - "@jest/test-result" "^25.5.0" - "@jest/transform" "^25.5.1" - "@jest/types" "^25.5.0" - ansi-escapes "^4.2.1" - chalk "^3.0.0" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-changed-files "^25.5.0" - jest-config "^25.5.4" - jest-haste-map "^25.5.1" - jest-message-util "^25.5.0" - jest-regex-util "^25.2.6" - jest-resolve "^25.5.1" - jest-resolve-dependencies "^25.5.4" - jest-runner "^25.5.4" - jest-runtime "^25.5.4" - jest-snapshot "^25.5.1" - jest-util "^25.5.0" - jest-validate "^25.5.0" - jest-watcher "^25.5.0" - micromatch "^4.0.2" - p-each-series "^2.1.0" - realpath-native "^2.0.0" - rimraf "^3.0.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - -"@jest/environment@^25.5.0": - version "25.5.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.5.0.tgz#aa33b0c21a716c65686638e7ef816c0e3a0c7b37" - integrity sha512-U2VXPEqL07E/V7pSZMSQCvV5Ea4lqOlT+0ZFijl/i316cRMHvZ4qC+jBdryd+lmRetjQo0YIQr6cVPNxxK87mA== - dependencies: - "@jest/fake-timers" "^25.5.0" - "@jest/types" "^25.5.0" - jest-mock "^25.5.0" - -"@jest/fake-timers@^25.5.0": - version "25.5.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.5.0.tgz#46352e00533c024c90c2bc2ad9f2959f7f114185" - integrity sha512-9y2+uGnESw/oyOI3eww9yaxdZyHq7XvprfP/eeoCsjqKYts2yRlsHS/SgjPDV8FyMfn2nbMy8YzUk6nyvdLOpQ== - dependencies: - "@jest/types" "^25.5.0" - jest-message-util "^25.5.0" - jest-mock "^25.5.0" - jest-util "^25.5.0" - lolex "^5.0.0" - -"@jest/globals@^25.5.2": - version "25.5.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-25.5.2.tgz#5e45e9de8d228716af3257eeb3991cc2e162ca88" - integrity sha512-AgAS/Ny7Q2RCIj5kZ+0MuKM1wbF0WMLxbCVl/GOMoCNbODRdJ541IxJ98xnZdVSZXivKpJlNPIWa3QmY0l4CXA== - dependencies: - "@jest/environment" "^25.5.0" - "@jest/types" "^25.5.0" - expect "^25.5.0" - -"@jest/reporters@^25.5.1": - version "25.5.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.5.1.tgz#cb686bcc680f664c2dbaf7ed873e93aa6811538b" - integrity sha512-3jbd8pPDTuhYJ7vqiHXbSwTJQNavczPs+f1kRprRDxETeE3u6srJ+f0NPuwvOmk+lmunZzPkYWIFZDLHQPkviw== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^25.5.0" - "@jest/test-result" "^25.5.0" - "@jest/transform" "^25.5.1" - "@jest/types" "^25.5.0" - chalk "^3.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.2" - graceful-fs "^4.2.4" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.2" - jest-haste-map "^25.5.1" - jest-resolve "^25.5.1" - jest-util "^25.5.0" - jest-worker "^25.5.0" - slash "^3.0.0" - source-map "^0.6.0" - string-length "^3.1.0" - terminal-link "^2.0.0" - v8-to-istanbul "^4.1.3" - optionalDependencies: - node-notifier "^6.0.0" - -"@jest/source-map@^25.5.0": - version "25.5.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-25.5.0.tgz#df5c20d6050aa292c2c6d3f0d2c7606af315bd1b" - integrity sha512-eIGx0xN12yVpMcPaVpjXPnn3N30QGJCJQSkEDUt9x1fI1Gdvb07Ml6K5iN2hG7NmMP6FDmtPEssE3z6doOYUwQ== - dependencies: - callsites "^3.0.0" - graceful-fs "^4.2.4" - source-map "^0.6.0" - -"@jest/test-result@^25.5.0": - version "25.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.5.0.tgz#139a043230cdeffe9ba2d8341b27f2efc77ce87c" - integrity sha512-oV+hPJgXN7IQf/fHWkcS99y0smKLU2czLBJ9WA0jHITLst58HpQMtzSYxzaBvYc6U5U6jfoMthqsUlUlbRXs0A== - dependencies: - "@jest/console" "^25.5.0" - "@jest/types" "^25.5.0" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@jest/test-sequencer@^25.5.4": - version "25.5.4" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.5.4.tgz#9b4e685b36954c38d0f052e596d28161bdc8b737" - integrity sha512-pTJGEkSeg1EkCO2YWq6hbFvKNXk8ejqlxiOg1jBNLnWrgXOkdY6UmqZpwGFXNnRt9B8nO1uWMzLLZ4eCmhkPNA== - dependencies: - "@jest/test-result" "^25.5.0" - graceful-fs "^4.2.4" - jest-haste-map "^25.5.1" - jest-runner "^25.5.4" - jest-runtime "^25.5.4" - -"@jest/transform@^25.5.1": - version "25.5.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.5.1.tgz#0469ddc17699dd2bf985db55fa0fb9309f5c2db3" - integrity sha512-Y8CEoVwXb4QwA6Y/9uDkn0Xfz0finGkieuV0xkdF9UtZGJeLukD5nLkaVrVsODB1ojRWlaoD0AJZpVHCSnJEvg== - dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^25.5.0" - babel-plugin-istanbul "^6.0.0" - chalk "^3.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.2.4" - jest-haste-map "^25.5.1" - jest-regex-util "^25.2.6" - jest-util "^25.5.0" - micromatch "^4.0.2" - pirates "^4.0.1" - realpath-native "^2.0.0" - slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" - -"@jest/types@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" - integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^13.0.0" - -"@jest/types@^25.5.0": - version "25.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.5.0.tgz#4d6a4793f7b9599fc3680877b856a97dbccf2a9d" - integrity sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^15.0.0" - chalk "^3.0.0" - -"@jridgewell/gen-mapping@^0.3.5": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" - integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== - dependencies: - "@jridgewell/set-array" "^1.2.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.24" - -"@jridgewell/resolve-uri@^3.1.0": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" - integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== - -"@jridgewell/set-array@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" - integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" - integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== - -"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": - version "0.3.25" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@rollup/plugin-babel@^5.1.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" - integrity sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q== - dependencies: - "@babel/helper-module-imports" "^7.10.4" - "@rollup/pluginutils" "^3.1.0" - -"@rollup/plugin-commonjs@^11.0.0": - version "11.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz#60636c7a722f54b41e419e1709df05c7234557ef" - integrity sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA== - dependencies: - "@rollup/pluginutils" "^3.0.8" - commondir "^1.0.1" - estree-walker "^1.0.1" - glob "^7.1.2" - is-reference "^1.1.2" - magic-string "^0.25.2" - resolve "^1.11.0" - -"@rollup/plugin-json@^4.0.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" - integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw== - dependencies: - "@rollup/pluginutils" "^3.0.8" - -"@rollup/plugin-node-resolve@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz#39bd0034ce9126b39c1699695f440b4b7d2b62e6" - integrity sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - builtin-modules "^3.1.0" - deepmerge "^4.2.2" - is-module "^1.0.0" - resolve "^1.17.0" - -"@rollup/plugin-replace@^2.2.1": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" - integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - magic-string "^0.25.7" - -"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.0.9", "@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" - -"@rtsao/scc@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" - integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== - -"@sinonjs/commons@^1.7.0": - version "1.8.6" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" - integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== - dependencies: - type-detect "4.0.8" - -"@types/babel__core@^7.1.7": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" - integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== - dependencies: - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.6.8" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" - integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" - integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.20.6" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.6.tgz#8dc9f0ae0f202c08d8d4dab648912c8d6038e3f7" - integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== - dependencies: - "@babel/types" "^7.20.7" - -"@types/big.js@^4.0.5": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@types/big.js/-/big.js-4.0.5.tgz#62c61697646269e39191f24e55e8272f05f21fc0" - integrity sha512-D9KFrAt05FDSqLo7PU9TDHfDgkarlwdkuwFsg7Zm4xl62tTNaz+zN+Tkcdx2wGLBbSMf8BnoMhOVeUGUaJfLKg== - -"@types/eslint-visitor-keys@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" - integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== - -"@types/estree@*": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" - integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== - -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - -"@types/graceful-fs@^4.1.2": - version "4.1.9" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" - integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== - dependencies: - "@types/node" "*" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" - integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== - -"@types/istanbul-lib-report@*": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" - integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^1.1.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz#e875cc689e47bce549ec81f3df5e6f6f11cfaeb2" - integrity sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw== - dependencies: - "@types/istanbul-lib-coverage" "*" - "@types/istanbul-lib-report" "*" - -"@types/jest@^24.0.25": - version "24.9.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.9.1.tgz#02baf9573c78f1b9974a5f36778b366aa77bd534" - integrity sha512-Fb38HkXSVA4L8fGKEZ6le5bB8r6MRWlOCZbVuWZcmOMSCd2wCYOwN1ibj8daIoV9naq7aaOZjrLCoCMptKU/4Q== - dependencies: - jest-diff "^24.3.0" - -"@types/jest@^25.2.1": - version "25.2.3" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.2.3.tgz#33d27e4c4716caae4eced355097a47ad363fdcaf" - integrity sha512-JXc1nK/tXHiDhV55dvfzqtmP4S3sy3T3ouV2tkViZgxY/zeUkcpQcQPGRlgF4KmWzWW5oiWYSZwtCB+2RsE4Fw== - dependencies: - jest-diff "^25.2.1" - pretty-format "^25.2.1" - -"@types/json-schema@^7.0.3": - version "7.0.15" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== - -"@types/node@*": - version "22.10.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766" - integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ== - dependencies: - undici-types "~6.20.0" - -"@types/normalize-package-data@^2.4.0": - version "2.4.4" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" - integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== - -"@types/parse-json@^4.0.0": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" - integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== - -"@types/prettier@^1.19.0": - version "1.19.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f" - integrity sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ== - -"@types/resolve@1.17.1": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" - integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== - dependencies: - "@types/node" "*" - -"@types/stack-utils@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" - integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== - -"@types/yargs-parser@*": - version "21.0.3" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" - integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== - -"@types/yargs@^13.0.0": - version "13.0.12" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.12.tgz#d895a88c703b78af0465a9de88aa92c61430b092" - integrity sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ== - dependencies: - "@types/yargs-parser" "*" - -"@types/yargs@^15.0.0": - version "15.0.19" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.19.tgz#328fb89e46109ecbdb70c295d96ff2f46dfd01b9" - integrity sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA== - dependencies: - "@types/yargs-parser" "*" - -"@typescript-eslint/eslint-plugin@^2.12.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz#6f8ce8a46c7dea4a6f1d171d2bb8fbae6dac2be9" - integrity sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ== - dependencies: - "@typescript-eslint/experimental-utils" "2.34.0" - functional-red-black-tree "^1.0.1" - regexpp "^3.0.0" - tsutils "^3.17.1" - -"@typescript-eslint/experimental-utils@2.34.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz#d3524b644cdb40eebceca67f8cf3e4cc9c8f980f" - integrity sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.34.0" - eslint-scope "^5.0.0" - eslint-utils "^2.0.0" - -"@typescript-eslint/parser@^2.12.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.34.0.tgz#50252630ca319685420e9a39ca05fe185a256bc8" - integrity sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA== - dependencies: - "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.34.0" - "@typescript-eslint/typescript-estree" "2.34.0" - eslint-visitor-keys "^1.1.0" - -"@typescript-eslint/typescript-estree@2.34.0": - version "2.34.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz#14aeb6353b39ef0732cc7f1b8285294937cf37d5" - integrity sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg== - dependencies: - debug "^4.1.1" - eslint-visitor-keys "^1.1.0" - glob "^7.1.6" - is-glob "^4.0.1" - lodash "^4.17.15" - semver "^7.3.2" - tsutils "^3.17.1" - -abab@^2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" - integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== - -acorn-globals@^4.3.2: - version "4.3.4" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" - integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== - dependencies: - acorn "^6.0.1" - acorn-walk "^6.0.1" - -acorn-jsx@^5.2.0: - version "5.3.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn-walk@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" - integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== - -acorn@^6.0.1: - version "6.4.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" - integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== - -acorn@^7.1.0, acorn@^7.1.1: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-colors@^4.1.1: - version "4.1.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" - integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== - -ansi-escapes@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" - integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== - -ansi-regex@^4.0.0, ansi-regex@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" - integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== - -ansi-regex@^5.0.0, ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -anymatch@^3.0.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -aria-query@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.2.tgz#93f81a43480e33a338f19163a3d10a50c01dcd59" - integrity sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw== - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== - -array-buffer-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f" - integrity sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg== - dependencies: - call-bind "^1.0.5" - is-array-buffer "^3.0.4" - -array-equal@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.2.tgz#a8572e64e822358271250b9156d20d96ef5dec04" - integrity sha512-gUHx76KtnhEgB3HOuFYiCm3FIdEs6ocM2asHvNTkfu/Y09qQVrrVVaOKENmS2KkSaGoxgXNqC+ZVtR/n0MOkSA== - -array-includes@^3.1.6, array-includes@^3.1.8: - version "3.1.8" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" - integrity sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-object-atoms "^1.0.0" - get-intrinsic "^1.2.4" - is-string "^1.0.7" - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== - -array.prototype.findlast@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz#3e4fbcb30a15a7f5bf64cf2faae22d139c2e4904" - integrity sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-errors "^1.3.0" - es-object-atoms "^1.0.0" - es-shim-unscopables "^1.0.2" - -array.prototype.findlastindex@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz#8c35a755c72908719453f87145ca011e39334d0d" - integrity sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-errors "^1.3.0" - es-object-atoms "^1.0.0" - es-shim-unscopables "^1.0.2" - -array.prototype.flat@^1.3.1, array.prototype.flat@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" - integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - es-shim-unscopables "^1.0.0" - -array.prototype.flatmap@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527" - integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - es-shim-unscopables "^1.0.0" - -array.prototype.tosorted@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz#fe954678ff53034e717ea3352a03f0b0b86f7ffc" - integrity sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.3" - es-errors "^1.3.0" - es-shim-unscopables "^1.0.2" - -arraybuffer.prototype.slice@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz#097972f4255e41bc3425e37dc3f6421cf9aefde6" - integrity sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A== - dependencies: - array-buffer-byte-length "^1.0.1" - call-bind "^1.0.5" - define-properties "^1.2.1" - es-abstract "^1.22.3" - es-errors "^1.2.1" - get-intrinsic "^1.2.3" - is-array-buffer "^3.0.4" - is-shared-array-buffer "^1.0.2" - -asn1@~0.2.3: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== - -ast-types-flow@^0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.8.tgz#0a85e1c92695769ac13a428bb653e7538bea27d6" - integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ== - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -asyncro@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/asyncro/-/asyncro-3.0.0.tgz#3c7a732e263bc4a42499042f48d7d858e9c0134e" - integrity sha512-nEnWYfrBmA3taTiuiOoZYmgJ/CNrSoQLeLs29SeLcPu60yaw/mHDBHV0iOZ051fTvsTHxpCY+gXibqT9wbQYfg== - -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -available-typed-arrays@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" - integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== - dependencies: - possible-typed-array-names "^1.0.0" - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== - -aws4@^1.8.0: - version "1.13.2" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.13.2.tgz#0aa167216965ac9474ccfa83892cfb6b3e1e52ef" - integrity sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw== - -axe-core@^4.10.0: - version "4.10.2" - resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.10.2.tgz#85228e3e1d8b8532a27659b332e39b7fa0e022df" - integrity sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w== - -axobject-query@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-4.1.0.tgz#28768c76d0e3cff21bc62a9e2d0b6ac30042a1ee" - integrity sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ== - -babel-eslint@^10.0.3: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - -babel-jest@^25.5.1: - version "25.5.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.5.1.tgz#bc2e6101f849d6f6aec09720ffc7bc5332e62853" - integrity sha512-9dA9+GmMjIzgPnYtkhBg73gOo/RHqPmLruP3BaGL4KEX3Dwz6pI8auSN8G8+iuEG90+GSswyKvslN+JYSaacaQ== - dependencies: - "@jest/transform" "^25.5.1" - "@jest/types" "^25.5.0" - "@types/babel__core" "^7.1.7" - babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^25.5.0" - chalk "^3.0.0" - graceful-fs "^4.2.4" - slash "^3.0.0" - -babel-plugin-annotate-pure-calls@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/babel-plugin-annotate-pure-calls/-/babel-plugin-annotate-pure-calls-0.4.0.tgz#78aa00fd878c4fcde4d49f3da397fcf5defbcce8" - integrity sha512-oi4M/PWUJOU9ZyRGoPTfPMqdyMp06jbJAomd3RcyYuzUtBOddv98BqLm96Lucpi2QFoQHkdGQt0ACvw7VzVEQA== - -babel-plugin-dev-expression@^0.2.1: - version "0.2.3" - resolved "https://registry.yarnpkg.com/babel-plugin-dev-expression/-/babel-plugin-dev-expression-0.2.3.tgz#8aaf52155dfb063ed4ddec6280456fbc256fead4" - integrity sha512-rP5LK9QQTzCW61nVVzw88En1oK8t8gTsIeC6E61oelxNsU842yMjF0G1MxhvUpCkxCEIj7sE8/e5ieTheT//uw== - -babel-plugin-istanbul@^6.0.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" - integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^5.0.4" - test-exclude "^6.0.0" - -babel-plugin-jest-hoist@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.5.0.tgz#129c80ba5c7fc75baf3a45b93e2e372d57ca2677" - integrity sha512-u+/W+WAjMlvoocYGTwthAiQSxDcJAyHpQ6oWlHdFZaaN+Rlk8Q7iiwDPg2lN/FyJtAYnKjFxbn7xus4HCFkg5g== - dependencies: - "@babel/template" "^7.3.3" - "@babel/types" "^7.3.3" - "@types/babel__traverse" "^7.0.6" - -babel-plugin-macros@^2.6.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" - integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== - dependencies: - "@babel/runtime" "^7.7.2" - cosmiconfig "^6.0.0" - resolve "^1.12.0" - -babel-plugin-polyfill-corejs2@^0.4.10: - version "0.4.12" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.12.tgz#ca55bbec8ab0edeeef3d7b8ffd75322e210879a9" - integrity sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og== - dependencies: - "@babel/compat-data" "^7.22.6" - "@babel/helper-define-polyfill-provider" "^0.6.3" - semver "^6.3.1" - -babel-plugin-polyfill-corejs3@^0.10.6: - version "0.10.6" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" - integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.2" - core-js-compat "^3.38.0" - -babel-plugin-polyfill-regenerator@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.0.4.tgz#588641af9a2cb4e299b1400c47672a4a104d2459" - integrity sha512-+/uCzO9JTYVZVGCpZpVAQkgPGt2zkR0VYiZvJ4aVoCe4ccgpKvNQqcjzAgQzSsjK64Jhc5hvrCR3l0087BevkA== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.0.3" - -babel-plugin-polyfill-regenerator@^0.6.1: - version "0.6.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.3.tgz#abeb1f3f1c762eace37587f42548b08b57789bc8" - integrity sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.3" - -babel-plugin-transform-rename-import@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-rename-import/-/babel-plugin-transform-rename-import-2.3.0.tgz#5d9d645f937b0ca5c26a24b2510a06277b6ffd9b" - integrity sha512-dPgJoT57XC0PqSnLgl2FwNvxFrWlspatX2dkk7yjKQj5HHGw071vAcOf+hqW8ClqcBDMvEbm6mevn5yHAD8mlQ== - -babel-preset-current-node-syntax@^0.1.2: - version "0.1.4" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz#826f1f8e7245ad534714ba001f84f7e906c3b615" - integrity sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w== - dependencies: - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -babel-preset-jest@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.5.0.tgz#c1d7f191829487a907764c65307faa0e66590b49" - integrity sha512-8ZczygctQkBU+63DtSOKGh7tFL0CeCuz+1ieud9lJ1WPQ9O6A1a/r+LGn6Y705PA6whHQ3T1XuB/PmpfNYf8Fw== - dependencies: - babel-plugin-jest-hoist "^25.5.0" - babel-preset-current-node-syntax "^0.1.2" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== - dependencies: - tweetnacl "^0.14.3" - -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - -bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - -browser-resolve@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" - -browserslist@^4.24.0, browserslist@^4.24.2: - version "4.24.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" - integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== - dependencies: - caniuse-lite "^1.0.30001669" - electron-to-chromium "^1.5.41" - node-releases "^2.0.18" - update-browserslist-db "^1.1.1" - -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -buffer-from@1.x, buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -builtin-modules@^3.1.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" - integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" - integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== - dependencies: - es-define-property "^1.0.0" - es-errors "^1.3.0" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - set-function-length "^1.2.1" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^5.0.0, camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -caniuse-lite@^1.0.30001669: - version "1.0.30001686" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz#0e04b8d90de8753188e93c9989d56cb19d902670" - integrity sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA== - -capture-exit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" - integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== - dependencies: - rsvp "^4.8.4" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== - -chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chalk@^4.0.0, chalk@^4.1.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cli-cursor@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw== - dependencies: - restore-cursor "^2.0.0" - -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-spinners@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.3.1.tgz#002c1990912d0d59580c93bd36c056de99e4259a" - integrity sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg== - -cli-spinners@^2.2.0: - version "2.9.2" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" - integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== - -collect-v8-coverage@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" - integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^2.20.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== - -component-emitter@^1.2.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.1.tgz#ef1d5796f7d93f135ee6fb684340b26403c97d17" - integrity sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -confusing-browser-globals@^1.0.9: - version "1.0.11" - resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" - integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== - -convert-source-map@^1.4.0, convert-source-map@^1.6.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== - -convert-source-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" - integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== - -core-js-compat@^3.38.0, core-js-compat@^3.38.1: - version "3.39.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.39.0.tgz#b12dccb495f2601dc860bdbe7b4e3ffa8ba63f61" - integrity sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw== - dependencies: - browserslist "^4.24.2" - -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== - -cosmiconfig@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" - integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.1.0" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.7.2" - -cross-spawn@^6.0.0, cross-spawn@^6.0.5: - version "6.0.6" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.6.tgz#30d0efa0712ddb7eb5a76e1e8721bffafa6b5d57" - integrity sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.0: - version "7.0.6" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" - integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -cssom@^0.4.1: - version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" - integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== - -cssom@~0.3.6: - version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - -cssstyle@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" - integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== - dependencies: - cssom "~0.3.6" - -damerau-levenshtein@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" - integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== - dependencies: - assert-plus "^1.0.0" - -data-urls@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== - dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" - -data-view-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" - integrity sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-data-view "^1.0.1" - -data-view-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz#90721ca95ff280677eb793749fce1011347669e2" - integrity sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ== - dependencies: - call-bind "^1.0.7" - es-errors "^1.3.0" - is-data-view "^1.0.1" - -data-view-byte-offset@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz#5e0bbfb4828ed2d1b9b400cd8a7d119bca0ff18a" - integrity sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-data-view "^1.0.1" - -debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^3.2.7: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.3.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" - integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== - dependencies: - ms "^2.1.3" - -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - -decimal.js-light@^2.5.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934" - integrity sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg== - -decode-uri-component@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" - integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== - -deep-is@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -deepmerge@^4.2.2: - version "4.3.1" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" - integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== - -defaults@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" - integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== - dependencies: - clone "^1.0.2" - -define-data-property@^1.0.1, define-data-property@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" - integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== - dependencies: - es-define-property "^1.0.0" - es-errors "^1.3.0" - gopd "^1.0.1" - -define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" - integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== - dependencies: - define-data-property "^1.0.1" - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -diff-sequences@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" - integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== - -diff-sequences@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" - integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== - dependencies: - webidl-conversions "^4.0.2" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -electron-to-chromium@^1.5.41: - version "1.5.70" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.70.tgz#8be2f92e54a3d069c0eefcf766a48bf0f78d93e0" - integrity sha512-P6FPqAWIZrC3sHDAwBitJBs7N7IF58m39XVny7DFseQXK2eiMn7nNQizFf63mWDDUnFvaqsM8FI0+ZZfLkdUGA== - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -emoji-regex@^9.2.2: - version "9.2.2" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" - integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== - -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -enquirer@^2.3.4: - version "2.4.1" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" - integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== - dependencies: - ansi-colors "^4.1.1" - strip-ansi "^6.0.1" - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.17.5, es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23.2, es-abstract@^1.23.3, es-abstract@^1.23.5: - version "1.23.5" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.5.tgz#f4599a4946d57ed467515ed10e4f157289cd52fb" - integrity sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ== - dependencies: - array-buffer-byte-length "^1.0.1" - arraybuffer.prototype.slice "^1.0.3" - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - data-view-buffer "^1.0.1" - data-view-byte-length "^1.0.1" - data-view-byte-offset "^1.0.0" - es-define-property "^1.0.0" - es-errors "^1.3.0" - es-object-atoms "^1.0.0" - es-set-tostringtag "^2.0.3" - es-to-primitive "^1.2.1" - function.prototype.name "^1.1.6" - get-intrinsic "^1.2.4" - get-symbol-description "^1.0.2" - globalthis "^1.0.4" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" - has-proto "^1.0.3" - has-symbols "^1.0.3" - hasown "^2.0.2" - internal-slot "^1.0.7" - is-array-buffer "^3.0.4" - is-callable "^1.2.7" - is-data-view "^1.0.1" - is-negative-zero "^2.0.3" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.3" - is-string "^1.0.7" - is-typed-array "^1.1.13" - is-weakref "^1.0.2" - object-inspect "^1.13.3" - object-keys "^1.1.1" - object.assign "^4.1.5" - regexp.prototype.flags "^1.5.3" - safe-array-concat "^1.1.2" - safe-regex-test "^1.0.3" - string.prototype.trim "^1.2.9" - string.prototype.trimend "^1.0.8" - string.prototype.trimstart "^1.0.8" - typed-array-buffer "^1.0.2" - typed-array-byte-length "^1.0.1" - typed-array-byte-offset "^1.0.2" - typed-array-length "^1.0.6" - unbox-primitive "^1.0.2" - which-typed-array "^1.1.15" - -es-define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" - integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== - dependencies: - get-intrinsic "^1.2.4" - -es-errors@^1.2.1, es-errors@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" - integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== - -es-iterator-helpers@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.2.0.tgz#2f1a3ab998b30cb2d10b195b587c6d9ebdebf152" - integrity sha512-tpxqxncxnpw3c93u8n3VOzACmRFoVmWJqbWXvX/JfKbkhBw1oslgPrUfeSt2psuqyEJFD6N/9lg5i7bsKpoq+Q== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.3" - es-errors "^1.3.0" - es-set-tostringtag "^2.0.3" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - globalthis "^1.0.4" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" - has-proto "^1.0.3" - has-symbols "^1.0.3" - internal-slot "^1.0.7" - iterator.prototype "^1.1.3" - safe-array-concat "^1.1.2" - -es-object-atoms@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" - integrity sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== - dependencies: - es-errors "^1.3.0" - -es-set-tostringtag@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz#8bb60f0a440c2e4281962428438d58545af39777" - integrity sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== - dependencies: - get-intrinsic "^1.2.4" - has-tostringtag "^1.0.2" - hasown "^2.0.1" - -es-shim-unscopables@^1.0.0, es-shim-unscopables@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz#1f6942e71ecc7835ed1c8a83006d8771a63a3763" - integrity sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== - dependencies: - hasown "^2.0.0" - -es-to-primitive@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.3.0.tgz#96c89c82cc49fd8794a24835ba3e1ff87f214e18" - integrity sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g== - dependencies: - is-callable "^1.2.7" - is-date-object "^1.0.5" - is-symbol "^1.0.4" - -escalade@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" - integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -escodegen@^1.11.1: - version "1.14.3" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== - dependencies: - esprima "^4.0.1" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -eslint-config-prettier@^6.0.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" - integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== - dependencies: - get-stdin "^6.0.0" - -eslint-config-react-app@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.2.1.tgz#698bf7aeee27f0cea0139eaef261c7bf7dd623df" - integrity sha512-pGIZ8t0mFLcV+6ZirRgYK6RVqUIKRIi9MmgzUEmrIknsn3AdO0I32asO86dJgloHq+9ZPl8UIg8mYrvgP5u2wQ== - dependencies: - confusing-browser-globals "^1.0.9" - -eslint-import-resolver-node@^0.3.9: - version "0.3.9" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" - integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== - dependencies: - debug "^3.2.7" - is-core-module "^2.13.0" - resolve "^1.22.4" - -eslint-module-utils@^2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz#fe4cfb948d61f49203d7b08871982b65b9af0b0b" - integrity sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg== - dependencies: - debug "^3.2.7" - -eslint-plugin-flowtype@^3.13.0: - version "3.13.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.13.0.tgz#e241ebd39c0ce519345a3f074ec1ebde4cf80f2c" - integrity sha512-bhewp36P+t7cEV0b6OdmoRWJCBYRiHFlqPZAG1oS3SF+Y0LQkeDvFSM4oxoxvczD1OdONCXMlJfQFiWLcV9urw== - dependencies: - lodash "^4.17.15" - -eslint-plugin-import@^2.18.2: - version "2.31.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz#310ce7e720ca1d9c0bb3f69adfd1c6bdd7d9e0e7" - integrity sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== - dependencies: - "@rtsao/scc" "^1.1.0" - array-includes "^3.1.8" - array.prototype.findlastindex "^1.2.5" - array.prototype.flat "^1.3.2" - array.prototype.flatmap "^1.3.2" - debug "^3.2.7" - doctrine "^2.1.0" - eslint-import-resolver-node "^0.3.9" - eslint-module-utils "^2.12.0" - hasown "^2.0.2" - is-core-module "^2.15.1" - is-glob "^4.0.3" - minimatch "^3.1.2" - object.fromentries "^2.0.8" - object.groupby "^1.0.3" - object.values "^1.2.0" - semver "^6.3.1" - string.prototype.trimend "^1.0.8" - tsconfig-paths "^3.15.0" - -eslint-plugin-jsx-a11y@^6.2.3: - version "6.10.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz#d2812bb23bf1ab4665f1718ea442e8372e638483" - integrity sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q== - dependencies: - aria-query "^5.3.2" - array-includes "^3.1.8" - array.prototype.flatmap "^1.3.2" - ast-types-flow "^0.0.8" - axe-core "^4.10.0" - axobject-query "^4.1.0" - damerau-levenshtein "^1.0.8" - emoji-regex "^9.2.2" - hasown "^2.0.2" - jsx-ast-utils "^3.3.5" - language-tags "^1.0.9" - minimatch "^3.1.2" - object.fromentries "^2.0.8" - safe-regex-test "^1.0.3" - string.prototype.includes "^2.0.1" - -eslint-plugin-prettier@^3.1.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5" - integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-plugin-react-hooks@^2.2.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.5.1.tgz#4ef5930592588ce171abeb26f400c7fbcbc23cd0" - integrity sha512-Y2c4b55R+6ZzwtTppKwSmK/Kar8AdLiC2f9NADCuxbcTgPPg41Gyqa6b9GppgXSvCtkRw43ZE86CT5sejKC6/g== - -eslint-plugin-react@^7.14.3: - version "7.37.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz#cd0935987876ba2900df2f58339f6d92305acc7a" - integrity sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w== - dependencies: - array-includes "^3.1.8" - array.prototype.findlast "^1.2.5" - array.prototype.flatmap "^1.3.2" - array.prototype.tosorted "^1.1.4" - doctrine "^2.1.0" - es-iterator-helpers "^1.1.0" - estraverse "^5.3.0" - hasown "^2.0.2" - jsx-ast-utils "^2.4.1 || ^3.0.0" - minimatch "^3.1.2" - object.entries "^1.1.8" - object.fromentries "^2.0.8" - object.values "^1.2.0" - prop-types "^15.8.1" - resolve "^2.0.0-next.5" - semver "^6.3.1" - string.prototype.matchall "^4.0.11" - string.prototype.repeat "^1.0.0" - -eslint-scope@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-utils@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint@^6.1.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" - integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^7.0.0" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.14" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.3" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" - table "^5.2.3" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -espree@^6.1.2: - version "6.2.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" - integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== - dependencies: - acorn "^7.1.1" - acorn-jsx "^5.2.0" - eslint-visitor-keys "^1.1.0" - -esprima@^4.0.0, esprima@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.0.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" - integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1, estraverse@^4.2.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -estree-walker@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" - integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== - -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -exec-sh@^0.3.2: - version "0.3.6" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" - integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^3.2.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" - integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - p-finally "^2.0.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -execa@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expect@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-25.5.0.tgz#f07f848712a2813bb59167da3fb828ca21f58bba" - integrity sha512-w7KAXo0+6qqZZhovCaBVPSIqQp7/UTcx4M9uKt2m6pd2VB1voyC8JizLRqeEqud3AAVP02g+hbErDu5gu64tlA== - dependencies: - "@jest/types" "^25.5.0" - ansi-styles "^4.0.0" - jest-get-type "^25.2.6" - jest-matcher-utils "^25.5.0" - jest-message-util "^25.5.0" - jest-regex-util "^25.2.6" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== - -extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-diff@^1.1.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" - integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== - -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -fb-watchman@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" - integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== - dependencies: - bser "2.1.1" - -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -find-cache-dir@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" - integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== - dependencies: - commondir "^1.0.1" - make-dir "^3.0.2" - pkg-dir "^4.1.0" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== - dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" - -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - -for-each@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== - dependencies: - is-callable "^1.1.3" - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== - dependencies: - map-cache "^0.2.2" - -fs-extra@8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^9.0.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -fsevents@^2.1.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -function-bind@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" - integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== - -function.prototype.name@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" - integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - functions-have-names "^1.2.3" - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== - -functions-have-names@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" - integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" - integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== - dependencies: - es-errors "^1.3.0" - function-bind "^1.1.2" - has-proto "^1.0.1" - has-symbols "^1.0.3" - hasown "^2.0.0" - -get-package-type@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" - integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== - -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -get-symbol-description@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.2.tgz#533744d5aa20aca4e079c8e5daf7fd44202821f5" - integrity sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg== - dependencies: - call-bind "^1.0.5" - es-errors "^1.3.0" - get-intrinsic "^1.2.4" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== - dependencies: - assert-plus "^1.0.0" - -glob-parent@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" - -globalthis@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" - integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== - dependencies: - define-properties "^1.2.1" - gopd "^1.0.1" - -globalyzer@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465" - integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q== - -globrex@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" - integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== - -gopd@^1.0.1, gopd@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" - integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== - -graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw== - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - -has-bigints@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" - integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" - integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== - dependencies: - es-define-property "^1.0.0" - -has-proto@^1.0.1, has-proto@^1.0.3: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.1.0.tgz#deb10494cbbe8809bce168a3b961f42969f5ed43" - integrity sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q== - dependencies: - call-bind "^1.0.7" - -has-symbols@^1.0.3: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" - integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== - -has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" - integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== - dependencies: - has-symbols "^1.0.3" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" - integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== - dependencies: - function-bind "^1.1.2" - -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== - dependencies: - whatwg-encoding "^1.0.1" - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - -humanize-duration@^3.15.3: - version "3.32.1" - resolved "https://registry.yarnpkg.com/humanize-duration/-/humanize-duration-3.32.1.tgz#922beff5da36fb1cee3de26ada24c592b0fe519b" - integrity sha512-inh5wue5XdfObhu/IGEMiA1nUXigSGcaKNemcbLRKa7jXYGDZXr3LoT9pTIzq2hPEbld7w/qv9h+ikWGz8fL1g== - -iconv-lite@0.4.24, iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -import-fresh@^3.0.0, import-fresh@^3.1.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-local@^3.0.2: - version "3.2.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" - integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inquirer@^7.0.0: - version "7.3.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" - integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.19" - mute-stream "0.0.8" - run-async "^2.4.0" - rxjs "^6.6.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - -internal-slot@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" - integrity sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g== - dependencies: - es-errors "^1.3.0" - hasown "^2.0.0" - side-channel "^1.0.4" - -interpret@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -ip-regex@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw== - -is-accessor-descriptor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz#3223b10628354644b86260db29b3e693f5ceedd4" - integrity sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA== - dependencies: - hasown "^2.0.0" - -is-array-buffer@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.4.tgz#7a1f92b3d61edd2bc65d24f130530ea93d7fae98" - integrity sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.2.1" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - -is-async-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-async-function/-/is-async-function-2.0.0.tgz#8e4418efd3e5d3a6ebb0164c05ef5afb69aa9646" - integrity sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA== - dependencies: - has-tostringtag "^1.0.0" - -is-bigint@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.1.0.tgz#dda7a3445df57a42583db4228682eba7c4170672" - integrity sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ== - dependencies: - has-bigints "^1.0.2" - -is-boolean-object@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.2.0.tgz#9743641e80a62c094b5941c5bb791d66a88e497a" - integrity sha512-kR5g0+dXf/+kXnqI+lu0URKYPKgICtHGGNCDSB10AaUFj3o/HkB3u7WfpRBJGFopxxY0oH3ux7ZsDjLtK7xqvw== - dependencies: - call-bind "^1.0.7" - has-tostringtag "^1.0.2" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-callable@^1.1.3, is-callable@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" - integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - -is-core-module@^2.13.0, is-core-module@^2.15.1: - version "2.15.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" - integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== - dependencies: - hasown "^2.0.2" - -is-data-descriptor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz#2109164426166d32ea38c405c1e0945d9e6a4eeb" - integrity sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw== - dependencies: - hasown "^2.0.0" - -is-data-view@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-data-view/-/is-data-view-1.0.1.tgz#4b4d3a511b70f3dc26d42c03ca9ca515d847759f" - integrity sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w== - dependencies: - is-typed-array "^1.1.13" - -is-date-object@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - -is-descriptor@^0.1.0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.7.tgz#2727eb61fd789dcd5bdf0ed4569f551d2fe3be33" - integrity sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg== - dependencies: - is-accessor-descriptor "^1.0.1" - is-data-descriptor "^1.0.1" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.3.tgz#92d27cb3cd311c4977a4db47df457234a13cb306" - integrity sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw== - dependencies: - is-accessor-descriptor "^1.0.1" - is-data-descriptor "^1.0.1" - -is-docker@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-finalizationregistry@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finalizationregistry/-/is-finalizationregistry-1.1.0.tgz#d74a7d0c5f3578e34a20729e69202e578d495dc2" - integrity sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA== - dependencies: - call-bind "^1.0.7" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-generator-function@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" - integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== - dependencies: - has-tostringtag "^1.0.0" - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - -is-map@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" - integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== - -is-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" - integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== - -is-negative-zero@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" - integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== - -is-number-object@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.1.0.tgz#5a867e9ecc3d294dda740d9f127835857af7eb05" - integrity sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw== - dependencies: - call-bind "^1.0.7" - has-tostringtag "^1.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== - dependencies: - kind-of "^3.0.2" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-reference@^1.1.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" - integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== - dependencies: - "@types/estree" "*" - -is-regex@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.2.0.tgz#41b9d266e7eb7451312c64efc37e8a7d453077cf" - integrity sha512-B6ohK4ZmoftlUe+uvenXSbPJFo6U37BH7oO1B3nQH8f/7h27N56s85MhUtbFJAziz5dcmuR3i8ovUl35zp8pFA== - dependencies: - call-bind "^1.0.7" - gopd "^1.1.0" - has-tostringtag "^1.0.2" - hasown "^2.0.2" - -is-set@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" - integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== - -is-shared-array-buffer@^1.0.2, is-shared-array-buffer@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz#1237f1cba059cdb62431d378dcc37d9680181688" - integrity sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg== - dependencies: - call-bind "^1.0.7" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -is-string@^1.0.7, is-string@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.1.0.tgz#8cb83c5d57311bf8058bc6c8db294711641da45d" - integrity sha512-PlfzajuF9vSo5wErv3MJAKD/nqf9ngAs1NFQYm16nUYFO2IzxJ2hcm+IOCg+EEopdykNNUhVq5cz35cAUxU8+g== - dependencies: - call-bind "^1.0.7" - has-tostringtag "^1.0.2" - -is-symbol@^1.0.4, is-symbol@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.1.0.tgz#ae993830a56d4781886d39f9f0a46b3e89b7b60b" - integrity sha512-qS8KkNNXUZ/I+nX6QT8ZS1/Yx0A444yhzdTKxCzKkNjQ9sHErBxJnJAgh+f5YhusYECEcjo4XcyH87hn6+ks0A== - dependencies: - call-bind "^1.0.7" - has-symbols "^1.0.3" - safe-regex-test "^1.0.3" - -is-typed-array@^1.1.13: - version "1.1.13" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" - integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== - dependencies: - which-typed-array "^1.1.14" - -is-typedarray@^1.0.0, is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - -is-weakmap@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" - integrity sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== - -is-weakref@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" - integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== - dependencies: - call-bind "^1.0.2" - -is-weakset@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.3.tgz#e801519df8c0c43e12ff2834eead84ec9e624007" - integrity sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ== - dependencies: - call-bind "^1.0.7" - get-intrinsic "^1.2.4" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -is-wsl@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -isarray@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -isarray@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== - -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" - integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== - -istanbul-lib-instrument@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== - dependencies: - "@babel/core" "^7.7.5" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - -istanbul-lib-instrument@^5.0.4: - version "5.2.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" - integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== - dependencies: - "@babel/core" "^7.12.3" - "@babel/parser" "^7.14.7" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.2.0" - semver "^6.3.0" - -istanbul-lib-report@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" - integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^4.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" - integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.0.2: - version "3.1.7" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" - integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -iterator.prototype@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.3.tgz#016c2abe0be3bbdb8319852884f60908ac62bf9c" - integrity sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ== - dependencies: - define-properties "^1.2.1" - get-intrinsic "^1.2.1" - has-symbols "^1.0.3" - reflect.getprototypeof "^1.0.4" - set-function-name "^2.0.1" - -jest-changed-files@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.5.0.tgz#141cc23567ceb3f534526f8614ba39421383634c" - integrity sha512-EOw9QEqapsDT7mKF162m8HFzRPbmP8qJQny6ldVOdOVBz3ACgPm/1nAn5fPQ/NDaYhX/AHkrGwwkCncpAVSXcw== - dependencies: - "@jest/types" "^25.5.0" - execa "^3.2.0" - throat "^5.0.0" - -jest-cli@^25.5.4: - version "25.5.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.5.4.tgz#b9f1a84d1301a92c5c217684cb79840831db9f0d" - integrity sha512-rG8uJkIiOUpnREh1768/N3n27Cm+xPFkSNFO91tgg+8o2rXeVLStz+vkXkGr4UtzH6t1SNbjwoiswd7p4AhHTw== - dependencies: - "@jest/core" "^25.5.4" - "@jest/test-result" "^25.5.0" - "@jest/types" "^25.5.0" - chalk "^3.0.0" - exit "^0.1.2" - graceful-fs "^4.2.4" - import-local "^3.0.2" - is-ci "^2.0.0" - jest-config "^25.5.4" - jest-util "^25.5.0" - jest-validate "^25.5.0" - prompts "^2.0.1" - realpath-native "^2.0.0" - yargs "^15.3.1" - -jest-config@^25.5.4: - version "25.5.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.5.4.tgz#38e2057b3f976ef7309b2b2c8dcd2a708a67f02c" - integrity sha512-SZwR91SwcdK6bz7Gco8qL7YY2sx8tFJYzvg216DLihTWf+LKY/DoJXpM9nTzYakSyfblbqeU48p/p7Jzy05Atg== - dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^25.5.4" - "@jest/types" "^25.5.0" - babel-jest "^25.5.1" - chalk "^3.0.0" - deepmerge "^4.2.2" - glob "^7.1.1" - graceful-fs "^4.2.4" - jest-environment-jsdom "^25.5.0" - jest-environment-node "^25.5.0" - jest-get-type "^25.2.6" - jest-jasmine2 "^25.5.4" - jest-regex-util "^25.2.6" - jest-resolve "^25.5.1" - jest-util "^25.5.0" - jest-validate "^25.5.0" - micromatch "^4.0.2" - pretty-format "^25.5.0" - realpath-native "^2.0.0" - -jest-diff@^24.3.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" - integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== - dependencies: - chalk "^2.0.1" - diff-sequences "^24.9.0" - jest-get-type "^24.9.0" - pretty-format "^24.9.0" - -jest-diff@^25.2.1, jest-diff@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.5.0.tgz#1dd26ed64f96667c068cef026b677dfa01afcfa9" - integrity sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A== - dependencies: - chalk "^3.0.0" - diff-sequences "^25.2.6" - jest-get-type "^25.2.6" - pretty-format "^25.5.0" - -jest-docblock@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-25.3.0.tgz#8b777a27e3477cd77a168c05290c471a575623ef" - integrity sha512-aktF0kCar8+zxRHxQZwxMy70stc9R1mOmrLsT5VO3pIT0uzGRSDAXxSlz4NqQWpuLjPpuMhPRl7H+5FRsvIQAg== - dependencies: - detect-newline "^3.0.0" - -jest-each@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.5.0.tgz#0c3c2797e8225cb7bec7e4d249dcd96b934be516" - integrity sha512-QBogUxna3D8vtiItvn54xXde7+vuzqRrEeaw8r1s+1TG9eZLVJE5ZkKoSUlqFwRjnlaA4hyKGiu9OlkFIuKnjA== - dependencies: - "@jest/types" "^25.5.0" - chalk "^3.0.0" - jest-get-type "^25.2.6" - jest-util "^25.5.0" - pretty-format "^25.5.0" - -jest-environment-jsdom@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.5.0.tgz#dcbe4da2ea997707997040ecf6e2560aec4e9834" - integrity sha512-7Jr02ydaq4jaWMZLY+Skn8wL5nVIYpWvmeatOHL3tOcV3Zw8sjnPpx+ZdeBfc457p8jCR9J6YCc+Lga0oIy62A== - dependencies: - "@jest/environment" "^25.5.0" - "@jest/fake-timers" "^25.5.0" - "@jest/types" "^25.5.0" - jest-mock "^25.5.0" - jest-util "^25.5.0" - jsdom "^15.2.1" - -jest-environment-node@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.5.0.tgz#0f55270d94804902988e64adca37c6ce0f7d07a1" - integrity sha512-iuxK6rQR2En9EID+2k+IBs5fCFd919gVVK5BeND82fYeLWPqvRcFNPKu9+gxTwfB5XwBGBvZ0HFQa+cHtIoslA== - dependencies: - "@jest/environment" "^25.5.0" - "@jest/fake-timers" "^25.5.0" - "@jest/types" "^25.5.0" - jest-mock "^25.5.0" - jest-util "^25.5.0" - semver "^6.3.0" - -jest-get-type@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" - integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== - -jest-get-type@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" - integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== - -jest-haste-map@^25.5.1: - version "25.5.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.5.1.tgz#1df10f716c1d94e60a1ebf7798c9fb3da2620943" - integrity sha512-dddgh9UZjV7SCDQUrQ+5t9yy8iEgKc1AKqZR9YDww8xsVOtzPQSMVLDChc21+g29oTRexb9/B0bIlZL+sWmvAQ== - dependencies: - "@jest/types" "^25.5.0" - "@types/graceful-fs" "^4.1.2" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.4" - jest-serializer "^25.5.0" - jest-util "^25.5.0" - jest-worker "^25.5.0" - micromatch "^4.0.2" - sane "^4.0.3" - walker "^1.0.7" - which "^2.0.2" - optionalDependencies: - fsevents "^2.1.2" - -jest-jasmine2@^25.5.4: - version "25.5.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.5.4.tgz#66ca8b328fb1a3c5364816f8958f6970a8526968" - integrity sha512-9acbWEfbmS8UpdcfqnDO+uBUgKa/9hcRh983IHdM+pKmJPL77G0sWAAK0V0kr5LK3a8cSBfkFSoncXwQlRZfkQ== - dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^25.5.0" - "@jest/source-map" "^25.5.0" - "@jest/test-result" "^25.5.0" - "@jest/types" "^25.5.0" - chalk "^3.0.0" - co "^4.6.0" - expect "^25.5.0" - is-generator-fn "^2.0.0" - jest-each "^25.5.0" - jest-matcher-utils "^25.5.0" - jest-message-util "^25.5.0" - jest-runtime "^25.5.4" - jest-snapshot "^25.5.1" - jest-util "^25.5.0" - pretty-format "^25.5.0" - throat "^5.0.0" - -jest-leak-detector@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.5.0.tgz#2291c6294b0ce404241bb56fe60e2d0c3e34f0bb" - integrity sha512-rV7JdLsanS8OkdDpZtgBf61L5xZ4NnYLBq72r6ldxahJWWczZjXawRsoHyXzibM5ed7C2QRjpp6ypgwGdKyoVA== - dependencies: - jest-get-type "^25.2.6" - pretty-format "^25.5.0" - -jest-matcher-utils@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.5.0.tgz#fbc98a12d730e5d2453d7f1ed4a4d948e34b7867" - integrity sha512-VWI269+9JS5cpndnpCwm7dy7JtGQT30UHfrnM3mXl22gHGt/b7NkjBqXfbhZ8V4B7ANUsjK18PlSBmG0YH7gjw== - dependencies: - chalk "^3.0.0" - jest-diff "^25.5.0" - jest-get-type "^25.2.6" - pretty-format "^25.5.0" - -jest-message-util@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.5.0.tgz#ea11d93204cc7ae97456e1d8716251185b8880ea" - integrity sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA== - dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/types" "^25.5.0" - "@types/stack-utils" "^1.0.1" - chalk "^3.0.0" - graceful-fs "^4.2.4" - micromatch "^4.0.2" - slash "^3.0.0" - stack-utils "^1.0.1" - -jest-mock@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.5.0.tgz#a91a54dabd14e37ecd61665d6b6e06360a55387a" - integrity sha512-eXWuTV8mKzp/ovHc5+3USJMYsTBhyQ+5A1Mak35dey/RG8GlM4YWVylZuGgVXinaW6tpvk/RSecmF37FKUlpXA== - dependencies: - "@jest/types" "^25.5.0" - -jest-pnp-resolver@^1.2.1: - version "1.2.3" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" - integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== - -jest-regex-util@^25.2.1, jest-regex-util@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.2.6.tgz#d847d38ba15d2118d3b06390056028d0f2fd3964" - integrity sha512-KQqf7a0NrtCkYmZZzodPftn7fL1cq3GQAFVMn5Hg8uKx/fIenLEobNanUxb7abQ1sjADHBseG/2FGpsv/wr+Qw== - -jest-resolve-dependencies@^25.5.4: - version "25.5.4" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.5.4.tgz#85501f53957c8e3be446e863a74777b5a17397a7" - integrity sha512-yFmbPd+DAQjJQg88HveObcGBA32nqNZ02fjYmtL16t1xw9bAttSn5UGRRhzMHIQbsep7znWvAvnD4kDqOFM0Uw== - dependencies: - "@jest/types" "^25.5.0" - jest-regex-util "^25.2.6" - jest-snapshot "^25.5.1" - -jest-resolve@^25.5.1: - version "25.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.5.1.tgz#0e6fbcfa7c26d2a5fe8f456088dc332a79266829" - integrity sha512-Hc09hYch5aWdtejsUZhA+vSzcotf7fajSlPA6EZPE1RmPBAD39XtJhvHWFStid58iit4IPDLI/Da4cwdDmAHiQ== - dependencies: - "@jest/types" "^25.5.0" - browser-resolve "^1.11.3" - chalk "^3.0.0" - graceful-fs "^4.2.4" - jest-pnp-resolver "^1.2.1" - read-pkg-up "^7.0.1" - realpath-native "^2.0.0" - resolve "^1.17.0" - slash "^3.0.0" - -jest-runner@^25.5.4: - version "25.5.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.5.4.tgz#ffec5df3875da5f5c878ae6d0a17b8e4ecd7c71d" - integrity sha512-V/2R7fKZo6blP8E9BL9vJ8aTU4TH2beuqGNxHbxi6t14XzTb+x90B3FRgdvuHm41GY8ch4xxvf0ATH4hdpjTqg== - dependencies: - "@jest/console" "^25.5.0" - "@jest/environment" "^25.5.0" - "@jest/test-result" "^25.5.0" - "@jest/types" "^25.5.0" - chalk "^3.0.0" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-config "^25.5.4" - jest-docblock "^25.3.0" - jest-haste-map "^25.5.1" - jest-jasmine2 "^25.5.4" - jest-leak-detector "^25.5.0" - jest-message-util "^25.5.0" - jest-resolve "^25.5.1" - jest-runtime "^25.5.4" - jest-util "^25.5.0" - jest-worker "^25.5.0" - source-map-support "^0.5.6" - throat "^5.0.0" - -jest-runtime@^25.5.4: - version "25.5.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.5.4.tgz#dc981fe2cb2137abcd319e74ccae7f7eeffbfaab" - integrity sha512-RWTt8LeWh3GvjYtASH2eezkc8AehVoWKK20udV6n3/gC87wlTbE1kIA+opCvNWyyPeBs6ptYsc6nyHUb1GlUVQ== - dependencies: - "@jest/console" "^25.5.0" - "@jest/environment" "^25.5.0" - "@jest/globals" "^25.5.2" - "@jest/source-map" "^25.5.0" - "@jest/test-result" "^25.5.0" - "@jest/transform" "^25.5.1" - "@jest/types" "^25.5.0" - "@types/yargs" "^15.0.0" - chalk "^3.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.4" - jest-config "^25.5.4" - jest-haste-map "^25.5.1" - jest-message-util "^25.5.0" - jest-mock "^25.5.0" - jest-regex-util "^25.2.6" - jest-resolve "^25.5.1" - jest-snapshot "^25.5.1" - jest-util "^25.5.0" - jest-validate "^25.5.0" - realpath-native "^2.0.0" - slash "^3.0.0" - strip-bom "^4.0.0" - yargs "^15.3.1" - -jest-serializer@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.5.0.tgz#a993f484e769b4ed54e70e0efdb74007f503072b" - integrity sha512-LxD8fY1lByomEPflwur9o4e2a5twSQ7TaVNLlFUuToIdoJuBt8tzHfCsZ42Ok6LkKXWzFWf3AGmheuLAA7LcCA== - dependencies: - graceful-fs "^4.2.4" - -jest-snapshot@^25.5.1: - version "25.5.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.5.1.tgz#1a2a576491f9961eb8d00c2e5fd479bc28e5ff7f" - integrity sha512-C02JE1TUe64p2v1auUJ2ze5vcuv32tkv9PyhEb318e8XOKF7MOyXdJ7kdjbvrp3ChPLU2usI7Rjxs97Dj5P0uQ== - dependencies: - "@babel/types" "^7.0.0" - "@jest/types" "^25.5.0" - "@types/prettier" "^1.19.0" - chalk "^3.0.0" - expect "^25.5.0" - graceful-fs "^4.2.4" - jest-diff "^25.5.0" - jest-get-type "^25.2.6" - jest-matcher-utils "^25.5.0" - jest-message-util "^25.5.0" - jest-resolve "^25.5.1" - make-dir "^3.0.0" - natural-compare "^1.4.0" - pretty-format "^25.5.0" - semver "^6.3.0" - -jest-util@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.5.0.tgz#31c63b5d6e901274d264a4fec849230aa3fa35b0" - integrity sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA== - dependencies: - "@jest/types" "^25.5.0" - chalk "^3.0.0" - graceful-fs "^4.2.4" - is-ci "^2.0.0" - make-dir "^3.0.0" - -jest-validate@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.5.0.tgz#fb4c93f332c2e4cf70151a628e58a35e459a413a" - integrity sha512-okUFKqhZIpo3jDdtUXUZ2LxGUZJIlfdYBvZb1aczzxrlyMlqdnnws9MOxezoLGhSaFc2XYaHNReNQfj5zPIWyQ== - dependencies: - "@jest/types" "^25.5.0" - camelcase "^5.3.1" - chalk "^3.0.0" - jest-get-type "^25.2.6" - leven "^3.1.0" - pretty-format "^25.5.0" - -jest-watch-typeahead@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jest-watch-typeahead/-/jest-watch-typeahead-0.5.0.tgz#903dba6112f22daae7e90b0a271853f7ff182008" - integrity sha512-4r36w9vU8+rdg48hj0Z7TvcSqVP6Ao8dk04grlHQNgduyCB0SqrI0xWIl85ZhXrzYvxQ0N5H+rRLAejkQzEHeQ== - dependencies: - ansi-escapes "^4.2.1" - chalk "^3.0.0" - jest-regex-util "^25.2.1" - jest-watcher "^25.2.4" - slash "^3.0.0" - string-length "^3.1.0" - strip-ansi "^6.0.0" - -jest-watcher@^25.2.4, jest-watcher@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.5.0.tgz#d6110d101df98badebe435003956fd4a465e8456" - integrity sha512-XrSfJnVASEl+5+bb51V0Q7WQx65dTSk7NL4yDdVjPnRNpM0hG+ncFmDYJo9O8jaSRcAitVbuVawyXCRoxGrT5Q== - dependencies: - "@jest/test-result" "^25.5.0" - "@jest/types" "^25.5.0" - ansi-escapes "^4.2.1" - chalk "^3.0.0" - jest-util "^25.5.0" - string-length "^3.1.0" - -jest-worker@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" - integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== - dependencies: - merge-stream "^2.0.0" - supports-color "^6.1.0" - -jest-worker@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.5.0.tgz#2611d071b79cea0f43ee57a3d118593ac1547db1" - integrity sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw== - dependencies: - merge-stream "^2.0.0" - supports-color "^7.0.0" - -jest@^25.3.0: - version "25.5.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-25.5.4.tgz#f21107b6489cfe32b076ce2adcadee3587acb9db" - integrity sha512-hHFJROBTqZahnO+X+PMtT6G2/ztqAZJveGqz//FnWWHurizkD05PQGzRZOhF3XP6z7SJmL+5tCfW8qV06JypwQ== - dependencies: - "@jest/core" "^25.5.4" - import-local "^3.0.2" - jest-cli "^25.5.4" - -jpjs@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/jpjs/-/jpjs-1.2.1.tgz#f343833de8838a5beba1f42d5a219be0114c44b7" - integrity sha512-GxJWybWU4NV0RNKi6EIqk6IRPOTqd/h+U7sbtyuD7yUISUzV78LdHnq2xkevJsTlz/EImux4sWj+wfMiwKLkiw== - -js-sha3@0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbi@^3.1.4: - version "3.2.5" - resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" - integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== - -jsdom@^15.2.1: - version "15.2.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5" - integrity sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g== - dependencies: - abab "^2.0.0" - acorn "^7.1.0" - acorn-globals "^4.3.2" - array-equal "^1.0.0" - cssom "^0.4.1" - cssstyle "^2.0.0" - data-urls "^1.1.0" - domexception "^1.0.1" - escodegen "^1.11.1" - html-encoding-sniffer "^1.0.2" - nwsapi "^2.2.0" - parse5 "5.1.0" - pn "^1.1.0" - request "^2.88.0" - request-promise-native "^1.0.7" - saxes "^3.1.9" - symbol-tree "^3.2.2" - tough-cookie "^3.0.1" - w3c-hr-time "^1.0.1" - w3c-xmlserializer "^1.1.2" - webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^7.0.0" - ws "^7.0.0" - xml-name-validator "^3.0.0" - -jsesc@^3.0.2, jsesc@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" - integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - -json5@2.x, json5@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -json5@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" - integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== - dependencies: - minimist "^1.2.0" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - -"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5: - version "3.3.5" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" - integrity sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ== - dependencies: - array-includes "^3.1.6" - array.prototype.flat "^1.3.1" - object.assign "^4.1.4" - object.values "^1.1.6" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== - dependencies: - is-buffer "^1.1.5" - -kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -language-subtag-registry@^0.3.20: - version "0.3.23" - resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz#23529e04d9e3b74679d70142df3fd2eb6ec572e7" - integrity sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ== - -language-tags@^1.0.9: - version "1.0.9" - resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.9.tgz#1ffdcd0ec0fafb4b1be7f8b11f306ad0f9c08777" - integrity sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA== - dependencies: - language-subtag-registry "^0.3.20" - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== - -lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== - -lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - -log-update@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" - integrity sha512-vlP11XfFGyeNQlmEn9tJ66rEW1coA/79m5z6BCkudjbAGE83uhAcGYrBFwfs3AdLiLzGRusRPAbSPK9xZteCmg== - dependencies: - ansi-escapes "^3.0.0" - cli-cursor "^2.0.0" - wrap-ansi "^3.0.1" - -lolex@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" - integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A== - dependencies: - "@sinonjs/commons" "^1.7.0" - -loose-envify@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -lower-case@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" - integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== - dependencies: - tslib "^2.0.3" - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -magic-string@^0.25.2, magic-string@^0.25.7: - version "0.25.9" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" - integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== - dependencies: - sourcemap-codec "^1.4.8" - -make-dir@^3.0.0, make-dir@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -make-dir@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" - integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== - dependencies: - semver "^7.5.3" - -make-error@1.x: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -makeerror@1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" - integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== - dependencies: - tmpl "1.0.5" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== - dependencies: - object-visit "^1.0.0" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -micromatch@4.x, micromatch@^4.0.2: - version "4.0.8" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" - integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== - dependencies: - braces "^3.0.3" - picomatch "^2.3.1" - -micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.6: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@0.x, mkdirp@^0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - -mri@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" - integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== - -ms@^2.1.1, ms@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -no-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" - integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== - dependencies: - lower-case "^2.0.2" - tslib "^2.0.3" - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== - -node-notifier@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-6.0.0.tgz#cea319e06baa16deec8ce5cd7f133c4a46b68e12" - integrity sha512-SVfQ/wMw+DesunOm5cKqr6yDcvUTDl/yc97ybGHMrteNEY6oekXpNpS3lZwgLlwz0FLgHoiW28ZpmBHUDg37cw== - dependencies: - growly "^1.3.0" - is-wsl "^2.1.1" - semver "^6.3.0" - shellwords "^0.1.1" - which "^1.3.1" - -node-releases@^2.0.18: - version "2.0.18" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" - integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== - -normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== - dependencies: - path-key "^2.0.0" - -npm-run-path@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -nwsapi@^2.2.0: - version "2.2.16" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.16.tgz#177760bba02c351df1d2644e220c31dfec8cdb43" - integrity sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ== - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-inspect@^1.13.1, object-inspect@^1.13.3: - version "1.13.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" - integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== - -object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== - dependencies: - isobject "^3.0.0" - -object.assign@^4.1.4, object.assign@^4.1.5: - version "4.1.5" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" - integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== - dependencies: - call-bind "^1.0.5" - define-properties "^1.2.1" - has-symbols "^1.0.3" - object-keys "^1.1.1" - -object.entries@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.8.tgz#bffe6f282e01f4d17807204a24f8edd823599c41" - integrity sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - -object.fromentries@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.8.tgz#f7195d8a9b97bd95cbc1999ea939ecd1a2b00c65" - integrity sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-object-atoms "^1.0.0" - -object.groupby@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.3.tgz#9b125c36238129f6f7b61954a1e7176148d5002e" - integrity sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== - dependencies: - isobject "^3.0.1" - -object.values@^1.1.6, object.values@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.0.tgz#65405a9d92cee68ac2d303002e0b8470a4d9ab1b" - integrity sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ== - dependencies: - mimic-fn "^1.0.0" - -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.8.1, optionator@^0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -ora@^4.0.3: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-4.1.1.tgz#566cc0348a15c36f5f0e979612842e02ba9dddbc" - integrity sha512-sjYP8QyVWBpBZWD6Vr1M/KwknSw6kJOz41tvGMlwWeClHBtYKTbHMki1PsLZnxKpXMPbTKv9b3pjQu3REib96A== - dependencies: - chalk "^3.0.0" - cli-cursor "^3.1.0" - cli-spinners "^2.2.0" - is-interactive "^1.0.0" - log-symbols "^3.0.0" - mute-stream "0.0.8" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - -p-each-series@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" - integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== - -p-finally@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" - integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parse5@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" - integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== - -pascal-case@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" - integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6, path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== - -picocolors@^1.0.0, picocolors@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" - integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== - -picomatch@^2.0.4, picomatch@^2.2.2, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pirates@^4.0.1: - version "4.0.6" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" - integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== - -pkg-dir@^4.1.0, pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== - -possible-typed-array-names@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" - integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - -pretty-format@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" - integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== - dependencies: - "@jest/types" "^24.9.0" - ansi-regex "^4.0.0" - ansi-styles "^3.2.0" - react-is "^16.8.4" - -pretty-format@^25.2.1, pretty-format@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a" - integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ== - dependencies: - "@jest/types" "^25.5.0" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^16.12.0" - -progress-estimator@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/progress-estimator/-/progress-estimator-0.2.2.tgz#1c3947a5782ea56e40c8fccc290ac7ceeb1b91cb" - integrity sha512-GF76Ac02MTJD6o2nMNtmtOFjwWCnHcvXyn5HOWPQnEMO8OTLw7LAvNmrwe8LmdsB+eZhwUu9fX/c9iQnBxWaFA== - dependencies: - chalk "^2.4.1" - cli-spinners "^1.3.1" - humanize-duration "^3.15.3" - log-update "^2.3.0" - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -prompts@^2.0.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" - integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -prop-types@^15.8.1: - version "15.8.1" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" - integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.13.1" - -psl@^1.1.28: - version "1.15.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" - integrity sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w== - dependencies: - punycode "^2.3.1" - -pump@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" - integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" - integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== - -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -react-is@^16.12.0, react-is@^16.13.1, react-is@^16.8.4: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" - integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== - -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -realpath-native@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866" - integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q== - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== - dependencies: - resolve "^1.1.6" - -reflect.getprototypeof@^1.0.4, reflect.getprototypeof@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.7.tgz#04311b33a1b713ca5eb7b5aed9950a86481858e5" - integrity sha512-bMvFGIUKlc/eSfXNX+aZ+EL95/EgZzuwA0OBPTbZZDEJw/0AkentjMuM1oiRfwHrshqk4RzdgiTg5CcDalXN5g== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.5" - es-errors "^1.3.0" - get-intrinsic "^1.2.4" - gopd "^1.0.1" - which-builtin-type "^1.1.4" - -regenerate-unicode-properties@^10.2.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz#626e39df8c372338ea9b8028d1f99dc3fd9c3db0" - integrity sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA== - dependencies: - regenerate "^1.4.2" - -regenerate@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" - integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== - -regenerator-runtime@^0.13.7: - version "0.13.11" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" - integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== - -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - -regenerator-transform@^0.15.2: - version "0.15.2" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" - integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== - dependencies: - "@babel/runtime" "^7.8.4" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexp.prototype.flags@^1.5.2, regexp.prototype.flags@^1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz#b3ae40b1d2499b8350ab2c3fe6ef3845d3a96f42" - integrity sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-errors "^1.3.0" - set-function-name "^2.0.2" - -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -regexpp@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - -regexpu-core@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-6.2.0.tgz#0e5190d79e542bf294955dccabae04d3c7d53826" - integrity sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA== - dependencies: - regenerate "^1.4.2" - regenerate-unicode-properties "^10.2.0" - regjsgen "^0.8.0" - regjsparser "^0.12.0" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.1.0" - -regjsgen@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.8.0.tgz#df23ff26e0c5b300a6470cad160a9d090c3a37ab" - integrity sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q== - -regjsparser@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.12.0.tgz#0e846df6c6530586429377de56e0475583b088dc" - integrity sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ== - dependencies: - jsesc "~3.0.2" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== - -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise-native@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" - integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== - dependencies: - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.88.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== - -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg== - -resolve@1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.22.4: - version "1.22.8" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" - integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== - dependencies: - is-core-module "^2.13.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -resolve@^2.0.0-next.5: - version "2.0.0-next.5" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c" - integrity sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA== - dependencies: - is-core-module "^2.13.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q== - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -rimraf@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -rollup-plugin-sourcemaps@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed" - integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw== - dependencies: - "@rollup/pluginutils" "^3.0.9" - source-map-resolve "^0.6.0" - -rollup-plugin-terser@^5.1.2: - version "5.3.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.3.1.tgz#8c650062c22a8426c64268548957463bf981b413" - integrity sha512-1pkwkervMJQGFYvM9nscrUoncPwiKR/K+bHdjv6PFgRo3cgPHoRT83y2Aa3GvINj4539S15t/tpFPb775TDs6w== - dependencies: - "@babel/code-frame" "^7.5.5" - jest-worker "^24.9.0" - rollup-pluginutils "^2.8.2" - serialize-javascript "^4.0.0" - terser "^4.6.2" - -rollup-plugin-typescript2@^0.27.3: - version "0.27.3" - resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.3.tgz#cd9455ac026d325b20c5728d2cc54a08a771b68b" - integrity sha512-gmYPIFmALj9D3Ga1ZbTZAKTXq1JKlTQBtj299DXhqYz9cL3g/AQfUvbb2UhH+Nf++cCq941W2Mv7UcrcgLzJJg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - find-cache-dir "^3.3.1" - fs-extra "8.1.0" - resolve "1.17.0" - tslib "2.0.1" - -rollup-pluginutils@^2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" - integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== - dependencies: - estree-walker "^0.6.1" - -rollup@^1.32.1: - version "1.32.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4" - integrity sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A== - dependencies: - "@types/estree" "*" - "@types/node" "*" - acorn "^7.1.0" - -rsvp@^4.8.4: - version "4.8.5" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" - integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== - -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -rxjs@^6.6.0: - version "6.6.7" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" - integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== - dependencies: - tslib "^1.9.0" - -sade@^1.4.2: - version "1.8.1" - resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" - integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A== - dependencies: - mri "^1.1.0" - -safe-array-concat@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb" - integrity sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q== - dependencies: - call-bind "^1.0.7" - get-intrinsic "^1.2.4" - has-symbols "^1.0.3" - isarray "^2.0.5" - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-regex-test@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377" - integrity sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-regex "^1.1.4" - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sane@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" - integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== - dependencies: - "@cnakazawa/watch" "^1.0.3" - anymatch "^2.0.0" - capture-exit "^2.0.0" - exec-sh "^0.3.2" - execa "^1.0.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - -saxes@^3.1.9: - version "3.1.11" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b" - integrity sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g== - dependencies: - xmlchars "^2.1.1" - -"semver@2 || 3 || 4 || 5", semver@^5.5.0: - version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@6.x, semver@^6.0.0, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.1.1, semver@^7.3.2, semver@^7.5.3: - version "7.6.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== - -serialize-javascript@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" - integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== - dependencies: - randombytes "^2.1.0" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - -set-function-length@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" - integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== - dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" - -set-function-name@^2.0.1, set-function-name@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" - integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== - dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" - functions-have-names "^1.2.3" - has-property-descriptors "^1.0.2" - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== - dependencies: - shebang-regex "^1.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -shelljs@^0.8.3: - version "0.8.5" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" - integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - -side-channel@^1.0.4, side-channel@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" - integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== - dependencies: - call-bind "^1.0.7" - es-errors "^1.3.0" - get-intrinsic "^1.2.4" - object-inspect "^1.13.1" - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-resolve@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" - integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - -source-map-support@^0.5.6, source-map-support@~0.5.12: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@^0.7.3: - version "0.7.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" - integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== - -sourcemap-codec@^1.4.8: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - -spdx-correct@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" - integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz#5d607d27fc806f66d7b64a766650fa890f04ed66" - integrity sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.20" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz#e44ed19ed318dd1e5888f93325cee800f0f51b89" - integrity sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== - -sshpk@^1.7.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" - integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -stack-utils@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.5.tgz#a19b0b01947e0029c8e451d5d61a498f5bb1471b" - integrity sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ== - dependencies: - escape-string-regexp "^2.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g== - -string-length@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837" - integrity sha512-Ttp5YvkGm5v9Ijagtaz1BnN+k9ObpvS0eIBblPMp2YWL8FBmi9qblQ9fexc2k/CXFgrTIteU3jAw3payCnwSTA== - dependencies: - astral-regex "^1.0.0" - strip-ansi "^5.2.0" - -string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string.prototype.includes@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz#eceef21283640761a81dbe16d6c7171a4edf7d92" - integrity sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.3" - -string.prototype.matchall@^4.0.11: - version "4.0.11" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz#1092a72c59268d2abaad76582dccc687c0297e0a" - integrity sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-errors "^1.3.0" - es-object-atoms "^1.0.0" - get-intrinsic "^1.2.4" - gopd "^1.0.1" - has-symbols "^1.0.3" - internal-slot "^1.0.7" - regexp.prototype.flags "^1.5.2" - set-function-name "^2.0.2" - side-channel "^1.0.6" - -string.prototype.repeat@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz#e90872ee0308b29435aa26275f6e1b762daee01a" - integrity sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - -string.prototype.trim@^1.2.9: - version "1.2.9" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" - integrity sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.0" - es-object-atoms "^1.0.0" - -string.prototype.trimend@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz#3651b8513719e8a9f48de7f2f77640b26652b229" - integrity sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - -string.prototype.trimstart@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" - integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-json-comments@^3.0.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.0.0, supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-hyperlinks@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" - integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== - dependencies: - has-flag "^4.0.0" - supports-color "^7.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -symbol-tree@^3.2.2: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - -terminal-link@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" - integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== - dependencies: - ansi-escapes "^4.2.1" - supports-hyperlinks "^2.0.0" - -terser@^4.6.2: - version "4.8.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" - integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== - dependencies: - commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" - -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== - -throat@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" - integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - -tiny-glob@^0.2.6: - version "0.2.9" - resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2" - integrity sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg== - dependencies: - globalyzer "0.1.0" - globrex "^0.1.2" - -tiny-invariant@^1.1.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.3.tgz#46680b7a873a0d5d10005995eb90a70d74d60127" - integrity sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg== - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tmpl@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" - integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -toformat@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/toformat/-/toformat-2.0.0.tgz#7a043fd2dfbe9021a4e36e508835ba32056739d8" - integrity sha512-03SWBVop6nU8bpyZCx7SodpYznbZF5R4ljwNLBcTQzKOD9xuihRo/psX58llS1BMFhhAI08H3luot5GoXJz2pQ== - -tough-cookie@^2.3.3, tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" - integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== - dependencies: - ip-regex "^2.1.0" - psl "^1.1.28" - punycode "^2.1.1" - -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== - dependencies: - punycode "^2.1.0" - -ts-jest@^25.3.1: - version "25.5.1" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.5.1.tgz#2913afd08f28385d54f2f4e828be4d261f4337c7" - integrity sha512-kHEUlZMK8fn8vkxDjwbHlxXRB9dHYpyzqKIGDNxbzs+Rz+ssNDSDNusEK8Fk/sDd4xE6iKoQLfFkFVaskmTJyw== - dependencies: - bs-logger "0.x" - buffer-from "1.x" - fast-json-stable-stringify "2.x" - json5 "2.x" - lodash.memoize "4.x" - make-error "1.x" - micromatch "4.x" - mkdirp "0.x" - semver "6.x" - yargs-parser "18.x" - -tsconfig-paths@^3.15.0: - version "3.15.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" - integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== - dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.2" - minimist "^1.2.6" - strip-bom "^3.0.0" - -tsdx@^0.14.1: - version "0.14.1" - resolved "https://registry.yarnpkg.com/tsdx/-/tsdx-0.14.1.tgz#8771d509b6fc523ad971bae3a63ebe3a88355ab3" - integrity sha512-keHmFdCL2kx5nYFlBdbE3639HQ2v9iGedAFAajobrUTH2wfX0nLPdDhbHv+GHLQZqf0c5ur1XteE8ek/+Eyj5w== - dependencies: - "@babel/core" "^7.4.4" - "@babel/helper-module-imports" "^7.0.0" - "@babel/parser" "^7.11.5" - "@babel/plugin-proposal-class-properties" "^7.4.4" - "@babel/preset-env" "^7.11.0" - "@babel/traverse" "^7.11.5" - "@rollup/plugin-babel" "^5.1.0" - "@rollup/plugin-commonjs" "^11.0.0" - "@rollup/plugin-json" "^4.0.0" - "@rollup/plugin-node-resolve" "^9.0.0" - "@rollup/plugin-replace" "^2.2.1" - "@types/jest" "^25.2.1" - "@typescript-eslint/eslint-plugin" "^2.12.0" - "@typescript-eslint/parser" "^2.12.0" - ansi-escapes "^4.2.1" - asyncro "^3.0.0" - babel-eslint "^10.0.3" - babel-plugin-annotate-pure-calls "^0.4.0" - babel-plugin-dev-expression "^0.2.1" - babel-plugin-macros "^2.6.1" - babel-plugin-polyfill-regenerator "^0.0.4" - babel-plugin-transform-rename-import "^2.3.0" - camelcase "^6.0.0" - chalk "^4.0.0" - enquirer "^2.3.4" - eslint "^6.1.0" - eslint-config-prettier "^6.0.0" - eslint-config-react-app "^5.2.1" - eslint-plugin-flowtype "^3.13.0" - eslint-plugin-import "^2.18.2" - eslint-plugin-jsx-a11y "^6.2.3" - eslint-plugin-prettier "^3.1.0" - eslint-plugin-react "^7.14.3" - eslint-plugin-react-hooks "^2.2.0" - execa "^4.0.3" - fs-extra "^9.0.0" - jest "^25.3.0" - jest-watch-typeahead "^0.5.0" - jpjs "^1.2.1" - lodash.merge "^4.6.2" - ora "^4.0.3" - pascal-case "^3.1.1" - prettier "^1.19.1" - progress-estimator "^0.2.2" - regenerator-runtime "^0.13.7" - rollup "^1.32.1" - rollup-plugin-sourcemaps "^0.6.2" - rollup-plugin-terser "^5.1.2" - rollup-plugin-typescript2 "^0.27.3" - sade "^1.4.2" - semver "^7.1.1" - shelljs "^0.8.3" - tiny-glob "^0.2.6" - ts-jest "^25.3.1" - tslib "^1.9.3" - typescript "^3.7.3" - -tslib@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" - integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== - -tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tslib@^2.0.3: - version "2.8.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" - integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== - -tsutils@^3.17.1: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== - dependencies: - prelude-ls "~1.1.2" - -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -typed-array-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" - integrity sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ== - dependencies: - call-bind "^1.0.7" - es-errors "^1.3.0" - is-typed-array "^1.1.13" - -typed-array-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" - integrity sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw== - dependencies: - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - -typed-array-byte-offset@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.3.tgz#3fa9f22567700cc86aaf86a1e7176f74b59600f2" - integrity sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw== - dependencies: - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - reflect.getprototypeof "^1.0.6" - -typed-array-length@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.7.tgz#ee4deff984b64be1e118b0de8c9c877d5ce73d3d" - integrity sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg== - dependencies: - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - is-typed-array "^1.1.13" - possible-typed-array-names "^1.0.0" - reflect.getprototypeof "^1.0.6" - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -typescript@^3.7.3: - version "3.9.10" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" - integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== - -unbox-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" - integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== - dependencies: - call-bind "^1.0.2" - has-bigints "^1.0.2" - has-symbols "^1.0.3" - which-boxed-primitive "^1.0.2" - -undici-types@~6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" - integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== - -unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz#cb3173fe47ca743e228216e4a3ddc4c84d628cc2" - integrity sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg== - -unicode-match-property-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" - integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== - dependencies: - unicode-canonical-property-names-ecmascript "^2.0.0" - unicode-property-aliases-ecmascript "^2.0.0" - -unicode-match-property-value-ecmascript@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz#a0401aee72714598f739b68b104e4fe3a0cb3c71" - integrity sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg== - -unicode-property-aliases-ecmascript@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" - integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -universalify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" - integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -update-browserslist-db@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" - integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== - dependencies: - escalade "^3.2.0" - picocolors "^1.1.0" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -v8-compile-cache@^2.0.3: - version "2.4.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" - integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== - -v8-to-istanbul@^4.1.3: - version "4.1.4" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.4.tgz#b97936f21c0e2d9996d4985e5c5156e9d4e49cd6" - integrity sha512-Rw6vJHj1mbdK8edjR7+zuJrpDtKIgNdAvTSAcpYfgMIw+u2dPDntD3dgN4XQFLU2/fvFQdzj+EeSGfd/jnY5fQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - source-map "^0.7.3" - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -w3c-hr-time@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - -w3c-xmlserializer@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" - integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== - dependencies: - domexception "^1.0.1" - webidl-conversions "^4.0.2" - xml-name-validator "^3.0.0" - -walker@^1.0.7, walker@~1.0.5: - version "1.0.8" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" - integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== - dependencies: - makeerror "1.0.12" - -wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== - dependencies: - defaults "^1.0.3" - -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - -whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -which-boxed-primitive@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.1.0.tgz#2d850d6c4ac37b95441a67890e19f3fda8b6c6d9" - integrity sha512-Ei7Miu/AXe2JJ4iNF5j/UphAgRoma4trE6PtisM09bPygb3egMH3YLW/befsWb1A1AxvNSFidOFTB18XtnIIng== - dependencies: - is-bigint "^1.1.0" - is-boolean-object "^1.2.0" - is-number-object "^1.1.0" - is-string "^1.1.0" - is-symbol "^1.1.0" - -which-builtin-type@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/which-builtin-type/-/which-builtin-type-1.2.0.tgz#58042ac9602d78a6d117c7e811349df1268ba63c" - integrity sha512-I+qLGQ/vucCby4tf5HsLmGueEla4ZhwTBSqaooS+Y0BuxN4Cp+okmGuV+8mXZ84KDI9BA+oklo+RzKg0ONdSUA== - dependencies: - call-bind "^1.0.7" - function.prototype.name "^1.1.6" - has-tostringtag "^1.0.2" - is-async-function "^2.0.0" - is-date-object "^1.0.5" - is-finalizationregistry "^1.1.0" - is-generator-function "^1.0.10" - is-regex "^1.1.4" - is-weakref "^1.0.2" - isarray "^2.0.5" - which-boxed-primitive "^1.0.2" - which-collection "^1.0.2" - which-typed-array "^1.1.15" - -which-collection@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.2.tgz#627ef76243920a107e7ce8e96191debe4b16c2a0" - integrity sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== - dependencies: - is-map "^2.0.3" - is-set "^2.0.3" - is-weakmap "^2.0.2" - is-weakset "^2.0.3" - -which-module@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" - integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== - -which-typed-array@^1.1.14, which-typed-array@^1.1.15: - version "1.1.16" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.16.tgz#db4db429c4706feca2f01677a144278e4a8c216b" - integrity sha512-g+N+GAWiRj66DngFwHvISJd+ITsyphZvD1vChfVg6cEdnzy53GzB3oy0fUNlvhz7H7+MiqhYr26qxQShCpKTTQ== - dependencies: - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.2" - -which@^1.2.9, which@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -which@^2.0.1, which@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -word-wrap@~1.2.3: - version "1.2.5" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" - integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== - -wrap-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" - integrity sha512-iXR3tDXpbnTpzjKSylUJRkLuOrEC7hwEB221cgn6wtF8wpmz28puFXAEfPT5zrjM3wahygB//VuWEr1vTkDcNQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -write-file-atomic@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== - dependencies: - imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - -ws@^7.0.0: - version "7.5.10" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" - integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== - -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - -xmlchars@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== - -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yaml@^1.7.2: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - -yargs-parser@18.x, yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs@^15.3.1: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" diff --git a/src/pages/AddLiquidity/PoolPriceBar.tsx b/src/pages/AddLiquidity/PoolPriceBar.tsx index 074930a20ed..e0465c63cfc 100644 --- a/src/pages/AddLiquidity/PoolPriceBar.tsx +++ b/src/pages/AddLiquidity/PoolPriceBar.tsx @@ -1,4 +1,4 @@ -import { Currency, Percent, Price } from '../../libs/sdk-core' +import { Currency, Percent, Price } from '@uniswap/sdk-core' import React, { useContext } from 'react' import { Text } from 'rebass' import { ThemeContext } from 'styled-components' diff --git a/src/pages/AddLiquidity/Review.tsx b/src/pages/AddLiquidity/Review.tsx index faeaa5513ce..0303303a3b2 100644 --- a/src/pages/AddLiquidity/Review.tsx +++ b/src/pages/AddLiquidity/Review.tsx @@ -3,7 +3,7 @@ import { Field } from '../../state/mint/v3/actions' import { AutoColumn } from 'components/Column' import Card from 'components/Card' import styled from 'styled-components/macro' -import { Currency, CurrencyAmount, Price } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, Price } from '@uniswap/sdk-core' import { Position } from '@uniswap/v3-sdk' import { PositionPreview } from 'components/PositionPreview' diff --git a/src/pages/AddLiquidity/index.tsx b/src/pages/AddLiquidity/index.tsx index c7f9b38ad1c..d06be6db83f 100644 --- a/src/pages/AddLiquidity/index.tsx +++ b/src/pages/AddLiquidity/index.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useContext, useMemo, useState } from 'react' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, CurrencyAmount, currencyEquals, Percent } from '../../libs/sdk-core' -import { WETH9 } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, currencyEquals, Percent } from '@uniswap/sdk-core' +import { WETH9 } from '@uniswap/sdk-core' import { AlertTriangle, AlertCircle } from 'react-feather' import ReactGA from 'react-ga' import { ZERO_PERCENT } from '../../constants/misc' diff --git a/src/pages/AddLiquidity/redirects.tsx b/src/pages/AddLiquidity/redirects.tsx index a5f9c5a936c..b3227d2caef 100644 --- a/src/pages/AddLiquidity/redirects.tsx +++ b/src/pages/AddLiquidity/redirects.tsx @@ -2,7 +2,7 @@ import { useActiveWeb3React } from 'hooks/web3' import React from 'react' import { Redirect, RouteComponentProps } from 'react-router-dom' import AddLiquidity from './index' -import { WETH9 } from '../../libs/sdk-core' +import { WETH9 } from '@uniswap/sdk-core' export function RedirectDuplicateTokenIds( props: RouteComponentProps<{ currencyIdA: string; currencyIdB: string; feeAmount?: string }> diff --git a/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx b/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx index 5732b5448e5..a9cb2bc65f0 100644 --- a/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx +++ b/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Fraction, Percent } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent } from '@uniswap/sdk-core' import React from 'react' import { Text } from 'rebass' import { ButtonPrimary } from '../../components/Button' diff --git a/src/pages/AddLiquidityV2/PoolPriceBar.tsx b/src/pages/AddLiquidityV2/PoolPriceBar.tsx index b652d74550d..2acde3b4920 100644 --- a/src/pages/AddLiquidityV2/PoolPriceBar.tsx +++ b/src/pages/AddLiquidityV2/PoolPriceBar.tsx @@ -1,4 +1,4 @@ -import { Currency, Percent, Price } from '../../libs/sdk-core' +import { Currency, Percent, Price } from '@uniswap/sdk-core' import React, { useContext } from 'react' import { Text } from 'rebass' import { ThemeContext } from 'styled-components' diff --git a/src/pages/AddLiquidityV2/index.tsx b/src/pages/AddLiquidityV2/index.tsx index 6b9947a0e5d..112955254d5 100644 --- a/src/pages/AddLiquidityV2/index.tsx +++ b/src/pages/AddLiquidityV2/index.tsx @@ -1,6 +1,6 @@ import { BigNumber } from '@ethersproject/bignumber' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, CurrencyAmount, currencyEquals, Percent, WETH9 } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, currencyEquals, Percent, WETH9 } from '@uniswap/sdk-core' import React, { useCallback, useContext, useState } from 'react' import { Plus } from 'react-feather' import ReactGA from 'react-ga' diff --git a/src/pages/Earn/Manage.tsx b/src/pages/Earn/Manage.tsx index c82f7d310f3..537d100a97c 100644 --- a/src/pages/Earn/Manage.tsx +++ b/src/pages/Earn/Manage.tsx @@ -3,7 +3,7 @@ import { AutoColumn } from '../../components/Column' import styled from 'styled-components/macro' import { Link } from 'react-router-dom' import JSBI from 'jsbi' -import { Token, CurrencyAmount } from '../../libs/sdk-core' +import { Token, CurrencyAmount } from '@uniswap/sdk-core' import { RouteComponentProps } from 'react-router-dom' import DoubleCurrencyLogo from '../../components/DoubleLogo' import { useCurrency } from '../../hooks/Tokens' diff --git a/src/pages/MigrateV2/MigrateV2Pair.tsx b/src/pages/MigrateV2/MigrateV2Pair.tsx index 9f459d47dbe..1cc028e209d 100644 --- a/src/pages/MigrateV2/MigrateV2Pair.tsx +++ b/src/pages/MigrateV2/MigrateV2Pair.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React, { useCallback, useMemo, useState, useEffect } from 'react' -import { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '../../libs/sdk-core' +import { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '@uniswap/sdk-core' import { FACTORY_ADDRESS } from '@uniswap/v2-sdk' import { Redirect, RouteComponentProps } from 'react-router' import { Text } from 'rebass' diff --git a/src/pages/MigrateV2/index.tsx b/src/pages/MigrateV2/index.tsx index a8e048d9d3e..c4708add488 100644 --- a/src/pages/MigrateV2/index.tsx +++ b/src/pages/MigrateV2/index.tsx @@ -1,6 +1,6 @@ import React, { useContext, useMemo } from 'react' import { Pair } from '@uniswap/v2-sdk' -import { Token, ChainId } from '../../libs/sdk-core' +import { Token, ChainId } from '@uniswap/sdk-core' import { ThemeContext } from 'styled-components' import { AutoColumn } from '../../components/Column' import { AutoRow } from '../../components/Row' diff --git a/src/pages/Pool/PositionPage.tsx b/src/pages/Pool/PositionPage.tsx index 92479cf523d..3eec74bb27c 100644 --- a/src/pages/Pool/PositionPage.tsx +++ b/src/pages/Pool/PositionPage.tsx @@ -34,7 +34,7 @@ import { Ether, currencyEquals, ETHER, -} from '../../libs/sdk-core' +} from '@uniswap/sdk-core' import { useActiveWeb3React } from 'hooks/web3' import { useV3NFTPositionManagerContract } from 'hooks/useContract' import { useIsTransactionPending, useTransactionAdder } from 'state/transactions/hooks' diff --git a/src/pages/PoolFinder/index.tsx b/src/pages/PoolFinder/index.tsx index ab7bc4ba2a6..d9bd7a51661 100644 --- a/src/pages/PoolFinder/index.tsx +++ b/src/pages/PoolFinder/index.tsx @@ -1,4 +1,4 @@ -import { Currency, ETHER, CurrencyAmount, Token } from '../../libs/sdk-core' +import { Currency, ETHER, CurrencyAmount, Token } from '@uniswap/sdk-core' import JSBI from 'jsbi' import React, { useCallback, useEffect, useState } from 'react' import { Plus } from 'react-feather' diff --git a/src/pages/RemoveLiquidity/V3.tsx b/src/pages/RemoveLiquidity/V3.tsx index c9572fe7c52..7efbe3f24bd 100644 --- a/src/pages/RemoveLiquidity/V3.tsx +++ b/src/pages/RemoveLiquidity/V3.tsx @@ -22,7 +22,7 @@ import ReactGA from 'react-ga' import { useActiveWeb3React } from 'hooks/web3' import { TransactionResponse } from '@ethersproject/providers' import { useTransactionAdder } from 'state/transactions/hooks' -import { Percent, currencyEquals, Token, ETHER } from '../../libs/sdk-core' +import { Percent, currencyEquals, Token, ETHER } from '@uniswap/sdk-core' import { TYPE } from 'theme' import { Wrapper, SmallMaxButton, ResponsiveHeaderText } from './styled' import Loader from 'components/Loader' diff --git a/src/pages/RemoveLiquidity/index.tsx b/src/pages/RemoveLiquidity/index.tsx index e23f319bdf4..fa9b6f8c347 100644 --- a/src/pages/RemoveLiquidity/index.tsx +++ b/src/pages/RemoveLiquidity/index.tsx @@ -1,6 +1,6 @@ import { Contract } from '@ethersproject/contracts' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, currencyEquals, Percent, WETH9 } from '../../libs/sdk-core' +import { Currency, currencyEquals, Percent, WETH9 } from '@uniswap/sdk-core' import React, { useCallback, useContext, useMemo, useState } from 'react' import { ArrowDown, Plus } from 'react-feather' import ReactGA from 'react-ga' diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index 10ea2531996..be078b864d7 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Token, TradeType } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, Token, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { AdvancedSwapDetails } from 'components/swap/AdvancedSwapDetails' diff --git a/src/pages/Vote/VotePage.tsx b/src/pages/Vote/VotePage.tsx index 1ea051c8d05..429eecb8855 100644 --- a/src/pages/Vote/VotePage.tsx +++ b/src/pages/Vote/VotePage.tsx @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '../../libs/sdk-core' +import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { BigNumber } from 'ethers' import useCurrentBlockTimestamp from 'hooks/useCurrentBlockTimestamp' import JSBI from 'jsbi' diff --git a/src/pages/Vote/index.tsx b/src/pages/Vote/index.tsx index 98adab2a2e2..782f4fd6331 100644 --- a/src/pages/Vote/index.tsx +++ b/src/pages/Vote/index.tsx @@ -22,7 +22,7 @@ import DelegateModal from '../../components/vote/DelegateModal' import { useTokenBalance } from '../../state/wallet/hooks' import { useActiveWeb3React } from '../../hooks/web3' import { ZERO_ADDRESS } from '../../constants/misc' -import { Token, CurrencyAmount, ChainId } from '../../libs/sdk-core' +import { Token, CurrencyAmount, ChainId } from '@uniswap/sdk-core' import JSBI from 'jsbi' import { shortenAddress } from '../../utils' import Loader from '../../components/Loader' diff --git a/src/state/application/reducer.test.ts b/src/state/application/reducer.test.ts index 7426da75151..51bed65dbf9 100644 --- a/src/state/application/reducer.test.ts +++ b/src/state/application/reducer.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { createStore, Store } from 'redux' import { addPopup, ApplicationModal, removePopup, setOpenModal, updateBlockNumber } from './actions' import reducer, { ApplicationState } from './reducer' diff --git a/src/state/application/reducer.ts b/src/state/application/reducer.ts index 4ff9b58a472..7543f1e901e 100644 --- a/src/state/application/reducer.ts +++ b/src/state/application/reducer.ts @@ -1,6 +1,6 @@ import { createReducer, nanoid } from '@reduxjs/toolkit' import { addPopup, PopupContent, removePopup, updateBlockNumber, ApplicationModal, setOpenModal } from './actions' -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' type PopupList = Array<{ key: string; show: boolean; content: PopupContent; removeAfterMs: number | null }> diff --git a/src/state/burn/hooks.ts b/src/state/burn/hooks.ts index 09493e802ff..6da54033cfd 100644 --- a/src/state/burn/hooks.ts +++ b/src/state/burn/hooks.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Token, Currency, Percent, CurrencyAmount } from '../../libs/sdk-core' +import { Token, Currency, Percent, CurrencyAmount } from '@uniswap/sdk-core' import { Pair } from '@uniswap/v2-sdk' import { useCallback } from 'react' import { useDispatch, useSelector } from 'react-redux' diff --git a/src/state/burn/v3/hooks.ts b/src/state/burn/v3/hooks.ts index 1719e8f13bb..30749820dfe 100644 --- a/src/state/burn/v3/hooks.ts +++ b/src/state/burn/v3/hooks.ts @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount, Percent, Ether, currencyEquals, ETHER } from '../../../libs/sdk-core' +import { Token, CurrencyAmount, Percent, Ether, currencyEquals, ETHER } from '@uniswap/sdk-core' import { Position } from '@uniswap/v3-sdk' import { usePool } from 'hooks/usePools' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/state/claim/hooks.ts b/src/state/claim/hooks.ts index 249fa0f33b2..027d473023b 100644 --- a/src/state/claim/hooks.ts +++ b/src/state/claim/hooks.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { CurrencyAmount, ChainId, Token } from '../../libs/sdk-core' +import { CurrencyAmount, ChainId, Token } from '@uniswap/sdk-core' import { TransactionResponse } from '@ethersproject/providers' import { useEffect, useState } from 'react' import { UNI } from '../../constants/tokens' diff --git a/src/state/governance/hooks.ts b/src/state/governance/hooks.ts index 7688ca64a35..7f37630bcf6 100644 --- a/src/state/governance/hooks.ts +++ b/src/state/governance/hooks.ts @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '../../libs/sdk-core' +import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { isAddress } from 'ethers/lib/utils' import { PROPOSAL_DESCRIPTION_TEXT } from '../../constants/proposals' import { UNI } from '../../constants/tokens' diff --git a/src/state/lists/actions.ts b/src/state/lists/actions.ts index 285aea25370..6f9d9e1eb37 100644 --- a/src/state/lists/actions.ts +++ b/src/state/lists/actions.ts @@ -1,6 +1,6 @@ import { ActionCreatorWithPayload, createAction } from '@reduxjs/toolkit' import { TokenList, Version } from '@uniswap/token-lists' -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' export const fetchTokenList: Readonly<{ pending: ActionCreatorWithPayload<{ url: string; requestId: string }> diff --git a/src/state/lists/hooks.ts b/src/state/lists/hooks.ts index b709c818aa2..522d61ecaf3 100644 --- a/src/state/lists/hooks.ts +++ b/src/state/lists/hooks.ts @@ -1,5 +1,5 @@ import DEFAULT_TOKEN_LIST from '../../constants/tokenLists/uniswap-default.tokenlist.json' -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { TokenList } from '@uniswap/token-lists' import { useMemo } from 'react' import { useSelector } from 'react-redux' diff --git a/src/state/lists/reducer.test.ts b/src/state/lists/reducer.test.ts index 8d9b7fbfd9b..216dbde55d3 100644 --- a/src/state/lists/reducer.test.ts +++ b/src/state/lists/reducer.test.ts @@ -4,7 +4,7 @@ import { DEFAULT_LIST_OF_LISTS } from '../../constants/lists' import { updateVersion } from '../global/actions' import { fetchTokenList, acceptListUpdate, addList, removeList, enableList } from './actions' import reducer, { ListsState } from './reducer' -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' const STUB_TOKEN_LIST = { name: '', diff --git a/src/state/lists/reducer.ts b/src/state/lists/reducer.ts index 5988fa201c8..7015219841f 100644 --- a/src/state/lists/reducer.ts +++ b/src/state/lists/reducer.ts @@ -5,7 +5,7 @@ import { TokenList } from '@uniswap/token-lists/dist/types' import { DEFAULT_LIST_OF_LISTS } from '../../constants/lists' import { updateVersion } from '../global/actions' import { acceptListUpdate, addList, fetchTokenList, removeList, enableList, disableList } from './actions' -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' export interface ListsState { readonly byUrl: { diff --git a/src/state/lists/updater.ts b/src/state/lists/updater.ts index c134a1166f5..debd7dc627f 100644 --- a/src/state/lists/updater.ts +++ b/src/state/lists/updater.ts @@ -10,7 +10,7 @@ import { AppDispatch } from '../index' import { acceptListUpdate } from './actions' import { useActiveListUrls } from './hooks' import { UNSUPPORTED_LIST_URLS } from 'constants/lists' -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' export default function Updater(): null { const { library } = useActiveWeb3React() diff --git a/src/state/lists/wrappedTokenInfo.ts b/src/state/lists/wrappedTokenInfo.ts index d974e75970d..8d7a1d0f1c9 100644 --- a/src/state/lists/wrappedTokenInfo.ts +++ b/src/state/lists/wrappedTokenInfo.ts @@ -1,4 +1,4 @@ -import { ChainId, Token } from '../../libs/sdk-core' +import { ChainId, Token } from '@uniswap/sdk-core' import { Tags, TokenInfo } from '@uniswap/token-lists' import { TokenList } from '@uniswap/token-lists/dist/types' import { isAddress } from '../../utils' diff --git a/src/state/mint/hooks.ts b/src/state/mint/hooks.ts index ed79e0d25e6..233a44599a2 100644 --- a/src/state/mint/hooks.ts +++ b/src/state/mint/hooks.ts @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from 'react-redux' import { AppDispatch, AppState } from '../index' import { Field, typeInput } from './actions' import { Pair } from '@uniswap/v2-sdk' -import { Currency, Token, Percent, Price, CurrencyAmount } from '../../libs/sdk-core' +import { Currency, Token, Percent, Price, CurrencyAmount } from '@uniswap/sdk-core' import JSBI from 'jsbi' import { PairState, useV2Pair } from '../../hooks/useV2Pairs' import { useTotalSupply } from '../../hooks/useTotalSupply' diff --git a/src/state/mint/v3/hooks.ts b/src/state/mint/v3/hooks.ts index b8a4e670f90..62c23c6ddcc 100644 --- a/src/state/mint/v3/hooks.ts +++ b/src/state/mint/v3/hooks.ts @@ -12,7 +12,7 @@ import { TICK_SPACINGS, encodeSqrtRatioX96, } from '@uniswap/v3-sdk/dist/' -import { Currency, Token, CurrencyAmount, currencyEquals, Price, Rounding } from '../../../libs/sdk-core' +import { Currency, Token, CurrencyAmount, currencyEquals, Price, Rounding } from '@uniswap/sdk-core' import { useCallback, useMemo } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useActiveWeb3React } from '../../../hooks/web3' diff --git a/src/state/mint/v3/utils.ts b/src/state/mint/v3/utils.ts index 07c80b34b6d..8c5669879fe 100644 --- a/src/state/mint/v3/utils.ts +++ b/src/state/mint/v3/utils.ts @@ -6,7 +6,7 @@ import { encodeSqrtRatioX96, TickMath, } from '@uniswap/v3-sdk/dist/' -import { Price, Token } from '../../../libs/sdk-core' +import { Price, Token } from '@uniswap/sdk-core' import { tryParseAmount } from 'state/swap/hooks' import JSBI from 'jsbi' diff --git a/src/state/stake/hooks.ts b/src/state/stake/hooks.ts index 68b5a7c4722..f73d12be0b2 100644 --- a/src/state/stake/hooks.ts +++ b/src/state/stake/hooks.ts @@ -1,4 +1,4 @@ -import { ChainId, Token, CurrencyAmount, WETH9 } from '../../libs/sdk-core' +import { ChainId, Token, CurrencyAmount, WETH9 } from '@uniswap/sdk-core' import { Pair } from '@uniswap/v2-sdk' import JSBI from 'jsbi' import { useMemo } from 'react' diff --git a/src/state/swap/hooks.ts b/src/state/swap/hooks.ts index cc775fe69bc..855bc250e66 100644 --- a/src/state/swap/hooks.ts +++ b/src/state/swap/hooks.ts @@ -3,7 +3,7 @@ import { Trade as V3Trade } from '@uniswap/v3-sdk' import { useBestV3TradeExactIn, useBestV3TradeExactOut, V3TradeState } from '../../hooks/useBestV3Trade' import useENS from '../../hooks/useENS' import { parseUnits } from '@ethersproject/units' -import { Currency, CurrencyAmount, Percent, TradeType } from '../../libs/sdk-core' +import { Currency, CurrencyAmount, Percent, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { ParsedQs } from 'qs' import { useCallback, useEffect, useState } from 'react' diff --git a/src/state/transactions/actions.ts b/src/state/transactions/actions.ts index fe94dcb5462..b56b712e3fb 100644 --- a/src/state/transactions/actions.ts +++ b/src/state/transactions/actions.ts @@ -1,5 +1,5 @@ import { createAction } from '@reduxjs/toolkit' -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' export interface SerializableTransactionReceipt { to: string diff --git a/src/state/transactions/reducer.test.ts b/src/state/transactions/reducer.test.ts index ccd520b0eff..8914b83db58 100644 --- a/src/state/transactions/reducer.test.ts +++ b/src/state/transactions/reducer.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { createStore, Store } from 'redux' import { addTransaction, checkedTransaction, clearAllTransactions, finalizeTransaction } from './actions' import reducer, { initialState, TransactionState } from './reducer' diff --git a/src/state/user/hooks.tsx b/src/state/user/hooks.tsx index e070285cedc..a2217ef0b8c 100644 --- a/src/state/user/hooks.tsx +++ b/src/state/user/hooks.tsx @@ -1,4 +1,4 @@ -import { ChainId, Percent, Token } from '../../libs/sdk-core' +import { ChainId, Percent, Token } from '@uniswap/sdk-core' import { Pair } from '@uniswap/v2-sdk' import JSBI from 'jsbi' import flatMap from 'lodash.flatmap' diff --git a/src/state/wallet/hooks.ts b/src/state/wallet/hooks.ts index 0f43b5bdfc4..93537db6947 100644 --- a/src/state/wallet/hooks.ts +++ b/src/state/wallet/hooks.ts @@ -1,4 +1,4 @@ -import { Currency, Token, CurrencyAmount } from '../../libs/sdk-core' +import { Currency, Token, CurrencyAmount } from '@uniswap/sdk-core' import JSBI from 'jsbi' import { useMemo } from 'react' import { UNI } from '../../constants/tokens' diff --git a/src/utils/calculateSlippageAmount.test.ts b/src/utils/calculateSlippageAmount.test.ts index dd47c06f4d1..e8245260892 100644 --- a/src/utils/calculateSlippageAmount.test.ts +++ b/src/utils/calculateSlippageAmount.test.ts @@ -1,5 +1,5 @@ import { AddressZero } from '@ethersproject/constants' -import { ChainId, CurrencyAmount, Percent, Token } from '../libs/sdk-core' +import { ChainId, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' import { calculateSlippageAmount } from './calculateSlippageAmount' describe('#calculateSlippageAmount', () => { diff --git a/src/utils/calculateSlippageAmount.ts b/src/utils/calculateSlippageAmount.ts index 3af322337c2..9dd5fbadb86 100644 --- a/src/utils/calculateSlippageAmount.ts +++ b/src/utils/calculateSlippageAmount.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Fraction, Percent } from '../libs/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent } from '@uniswap/sdk-core' import JSBI from 'jsbi' const ONE = new Fraction(1, 1) diff --git a/src/utils/computeFiatValuePriceImpact.tsx b/src/utils/computeFiatValuePriceImpact.tsx index 8812d1d0f10..f4206253c51 100644 --- a/src/utils/computeFiatValuePriceImpact.tsx +++ b/src/utils/computeFiatValuePriceImpact.tsx @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount, currencyEquals, Percent } from '../libs/sdk-core' +import { Token, CurrencyAmount, currencyEquals, Percent } from '@uniswap/sdk-core' import JSBI from 'jsbi' import { ONE_HUNDRED_PERCENT } from '../constants/misc' diff --git a/src/utils/computeUniCirculation.test.ts b/src/utils/computeUniCirculation.test.ts index bf2cb03cb1d..6cc5cbb07b1 100644 --- a/src/utils/computeUniCirculation.test.ts +++ b/src/utils/computeUniCirculation.test.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { ChainId, Token, CurrencyAmount } from '../libs/sdk-core' +import { ChainId, Token, CurrencyAmount } from '@uniswap/sdk-core' import { BigNumber } from 'ethers' import { ZERO_ADDRESS } from '../constants/misc' import { computeUniCirculation } from './computeUniCirculation' diff --git a/src/utils/computeUniCirculation.ts b/src/utils/computeUniCirculation.ts index 89d6c14adc7..c669887e74c 100644 --- a/src/utils/computeUniCirculation.ts +++ b/src/utils/computeUniCirculation.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Token, CurrencyAmount } from '../libs/sdk-core' +import { Token, CurrencyAmount } from '@uniswap/sdk-core' import { BigNumber } from 'ethers' import { STAKING_GENESIS } from '../state/stake/hooks' diff --git a/src/utils/constructSameAddressMap.ts b/src/utils/constructSameAddressMap.ts index 13352de4d31..7df238f5cbf 100644 --- a/src/utils/constructSameAddressMap.ts +++ b/src/utils/constructSameAddressMap.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' export function constructSameAddressMap( address: T, diff --git a/src/utils/currencyId.ts b/src/utils/currencyId.ts index d610dff5dcc..c35e8b9a181 100644 --- a/src/utils/currencyId.ts +++ b/src/utils/currencyId.ts @@ -1,4 +1,4 @@ -import { Currency } from '../libs/sdk-core' +import { Currency } from '@uniswap/sdk-core' export function currencyId(currency: Currency): string { if (currency.isEther) return 'ETH' diff --git a/src/utils/formatTokenAmount.ts b/src/utils/formatTokenAmount.ts index 651ded83792..5a3b0daab6c 100644 --- a/src/utils/formatTokenAmount.ts +++ b/src/utils/formatTokenAmount.ts @@ -1,4 +1,4 @@ -import { Price, CurrencyAmount, Currency, Fraction } from '../libs/sdk-core' +import { Price, CurrencyAmount, Currency, Fraction } from '@uniswap/sdk-core' import JSBI from 'jsbi' export function formatTokenAmount(amount: CurrencyAmount | undefined, sigFigs: number) { diff --git a/src/utils/getExplorerLink.test.ts b/src/utils/getExplorerLink.test.ts index 68e5fcc0306..33f785830b6 100644 --- a/src/utils/getExplorerLink.test.ts +++ b/src/utils/getExplorerLink.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' import { ExplorerDataType, getExplorerLink } from './getExplorerLink' describe('#getExplorerLink', () => { diff --git a/src/utils/getExplorerLink.ts b/src/utils/getExplorerLink.ts index 94ff701b29f..76038f88aee 100644 --- a/src/utils/getExplorerLink.ts +++ b/src/utils/getExplorerLink.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' const CHAIN_ID_TO_PREFIX: { [chainId in ChainId]: string } = { 1: 'https://etherscan.io', diff --git a/src/utils/getTickToPrice.ts b/src/utils/getTickToPrice.ts index afa0aa9469f..68494e99822 100644 --- a/src/utils/getTickToPrice.ts +++ b/src/utils/getTickToPrice.ts @@ -1,4 +1,4 @@ -import { Token, Price } from '../libs/sdk-core' +import { Token, Price } from '@uniswap/sdk-core' import { tickToPrice } from '@uniswap/v3-sdk' export function getTickToPrice(baseToken?: Token, quoteToken?: Token, tick?: number): Price | undefined { diff --git a/src/utils/getTradeVersion.ts b/src/utils/getTradeVersion.ts index 43282db38dc..059762692d4 100644 --- a/src/utils/getTradeVersion.ts +++ b/src/utils/getTradeVersion.ts @@ -1,4 +1,4 @@ -import { Currency, TradeType } from '../libs/sdk-core' +import { Currency, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { Version } from '../hooks/useToggledVersion' diff --git a/src/utils/index.ts b/src/utils/index.ts index 763b92a2322..b9bde0d3078 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -2,7 +2,7 @@ import { getAddress } from '@ethersproject/address' import { AddressZero } from '@ethersproject/constants' import { Contract } from '@ethersproject/contracts' import { JsonRpcSigner, Web3Provider } from '@ethersproject/providers' -import { ChainId, Token } from '../libs/sdk-core' +import { ChainId, Token } from '@uniswap/sdk-core' import { FeeAmount } from '@uniswap/v3-sdk/dist/' import { TokenAddressMap } from '../state/lists/hooks' diff --git a/src/utils/isTradeBetter.ts b/src/utils/isTradeBetter.ts index 36ce9ea5921..c90e5ac5f41 100644 --- a/src/utils/isTradeBetter.ts +++ b/src/utils/isTradeBetter.ts @@ -1,5 +1,5 @@ import { ZERO_PERCENT, ONE_HUNDRED_PERCENT } from '../constants/misc' -import { Percent, currencyEquals, Currency, TradeType } from '../libs/sdk-core' +import { Percent, currencyEquals, Currency, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' diff --git a/src/utils/maxAmountSpend.ts b/src/utils/maxAmountSpend.ts index 976ac62280d..2e7c0555f38 100644 --- a/src/utils/maxAmountSpend.ts +++ b/src/utils/maxAmountSpend.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount } from '../libs/sdk-core' +import { Currency, CurrencyAmount } from '@uniswap/sdk-core' import JSBI from 'jsbi' import { MIN_ETH } from '../constants/misc' diff --git a/src/utils/prices.test.ts b/src/utils/prices.test.ts index 93d3f4aacf5..9063a13b3ca 100644 --- a/src/utils/prices.test.ts +++ b/src/utils/prices.test.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { ChainId, Percent, Token, CurrencyAmount, TradeType } from '../libs/sdk-core' +import { ChainId, Percent, Token, CurrencyAmount, TradeType } from '@uniswap/sdk-core' import { Trade, Pair, Route } from '@uniswap/v2-sdk' import { computeRealizedLPFeeAmount, warningSeverity } from './prices' diff --git a/src/utils/prices.ts b/src/utils/prices.ts index fe322784e79..c5ca96442c8 100644 --- a/src/utils/prices.ts +++ b/src/utils/prices.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Currency, CurrencyAmount, Fraction, Percent, TradeType } from '../libs/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent, TradeType } from '@uniswap/sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk' import { diff --git a/src/utils/supportedChainId.ts b/src/utils/supportedChainId.ts index 984ed06f82b..5d9aefce0c7 100644 --- a/src/utils/supportedChainId.ts +++ b/src/utils/supportedChainId.ts @@ -1,4 +1,4 @@ -import { ChainId } from '../libs/sdk-core' +import { ChainId } from '@uniswap/sdk-core' /** * Returns the input chain ID if chain is supported. If not, return undefined diff --git a/src/utils/wrappedCurrency.ts b/src/utils/wrappedCurrency.ts index a592cbb1d00..fda3d0ef181 100644 --- a/src/utils/wrappedCurrency.ts +++ b/src/utils/wrappedCurrency.ts @@ -7,7 +7,7 @@ import { wrappedCurrency as wrappedCurrencyInternal, wrappedCurrencyAmount as wrappedCurrencyAmountInternal, WETH9, -} from '../libs/sdk-core' +} from '@uniswap/sdk-core' import { supportedChainId } from './supportedChainId' export function wrappedCurrency(currency: Currency | undefined, chainId: ChainId | undefined): Token | undefined { diff --git a/yarn.lock b/yarn.lock index 67221379f58..ae52467d3fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3130,10 +3130,8 @@ resolved "https://registry.yarnpkg.com/@uniswap/merkle-distributor/-/merkle-distributor-1.0.1.tgz#dc3d911f65a860fc3f0cae074bdcd08ed6a27a4d" integrity sha512-5gDiTI5hrXIh5UWTrxKYjw30QQDnpl8ckDSpefldNenDlYO1RKkdUYMYpvrqGi2r7YzLYTlO6+TDlNs6O7hDRw== -"@uniswap/sdk-core@^3.0.0-alpha.1": +"@uniswap/sdk-core@file:uniswap-packages-forks/sdk-core": version "3.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-3.0.0-alpha.1.tgz#8d735755818658fd4a6113cb6d30ed637f9e8347" - integrity sha512-dCRBMKtmVmQCoG6sju3j/ki81e82zyqcWm0g+eU3JU0hzbSo6i31wzkOQPHMRO6FcYIJ6+9qx3Sy0B7VoZ6t9g== dependencies: "@ethersproject/address" "^5.0.2" big.js "^5.2.2" @@ -3165,14 +3163,12 @@ "@uniswap/lib" "1.1.1" "@uniswap/v2-core" "1.0.0" -"@uniswap/v2-sdk@^3.0.0-alpha.0": +"@uniswap/v2-sdk@file:./uniswap-packages-forks/v2-sdk": version "3.0.0-alpha.0" - resolved "https://registry.yarnpkg.com/@uniswap/v2-sdk/-/v2-sdk-3.0.0-alpha.0.tgz#5bbd3133f832bf8b36bacf9213b06de520313e28" - integrity sha512-KHgdCldJ0JY6NC7KImJuU00G5E7X3LNq5yyVy5tGqf2S9fzBf/az91tlVSZzkEyALmH+8RiSvtqKjSNMXTXTfw== dependencies: "@ethersproject/address" "^5.0.0" "@ethersproject/solidity" "^5.0.0" - "@uniswap/sdk-core" "^3.0.0-alpha.1" + "@uniswap/sdk-core" "file:../../AppData/Local/Yarn/Cache/v6/npm-@uniswap-v2-sdk-3.0.0-alpha.0-f1f74993-b968-4d03-b793-38921ad14899-1735313914952/node_modules/@uniswap/sdk-core" tiny-invariant "^1.1.0" tiny-warning "^1.0.3" @@ -3192,14 +3188,12 @@ "@uniswap/v3-core" "1.0.0" base64-sol "1.0.1" -"@uniswap/v3-sdk@^3.0.0-alpha.6": +"@uniswap/v3-sdk@file:./uniswap-packages-forks/v3-sdk": version "3.0.0-alpha.6" - resolved "https://registry.yarnpkg.com/@uniswap/v3-sdk/-/v3-sdk-3.0.0-alpha.6.tgz#8050c2970757446e38c024e1ed8f6771ad7aae98" - integrity sha512-FsOB2SAeLbZ9lANeaKnc12A+NSfZ2qTeKbRx7JJE9cJrhzR2fg1lSjI9foRcO3uz6aLE87cobELR815sZmPnTw== dependencies: "@ethersproject/abi" "^5.0.12" "@ethersproject/solidity" "^5.0.9" - "@uniswap/sdk-core" "^3.0.0-alpha.1" + "@uniswap/sdk-core" "file:../../AppData/Local/Yarn/Cache/v6/npm-@uniswap-v3-sdk-3.0.0-alpha.6-8cc04188-5211-461b-a835-9421f513ff67-1735313914956/node_modules/@uniswap/sdk-core" "@uniswap/v3-periphery" "1.0.0" tiny-invariant "^1.1.0" tiny-warning "^1.0.3" @@ -9934,7 +9928,7 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsbi@^3.1.4, jsbi@^3.2.5: +jsbi@^3.1.4: version "3.2.5" resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== From fb70efd0f9230c2a1728c0a4a367178aeacfa415 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Fri, 27 Dec 2024 19:22:32 +0300 Subject: [PATCH 21/30] feat: add folder to index --- uniswap-packages-forks/sdk-core | 1 + uniswap-packages-forks/v2-sdk | 1 + uniswap-packages-forks/v3-sdk | 1 + 3 files changed, 3 insertions(+) create mode 160000 uniswap-packages-forks/sdk-core create mode 160000 uniswap-packages-forks/v2-sdk create mode 160000 uniswap-packages-forks/v3-sdk diff --git a/uniswap-packages-forks/sdk-core b/uniswap-packages-forks/sdk-core new file mode 160000 index 00000000000..d61d31e5f6e --- /dev/null +++ b/uniswap-packages-forks/sdk-core @@ -0,0 +1 @@ +Subproject commit d61d31e5f6e79e174f3e4226c04e8c5cfcf3e227 diff --git a/uniswap-packages-forks/v2-sdk b/uniswap-packages-forks/v2-sdk new file mode 160000 index 00000000000..a0e880df2eb --- /dev/null +++ b/uniswap-packages-forks/v2-sdk @@ -0,0 +1 @@ +Subproject commit a0e880df2ebce40311740e3cc009ffb08438e704 diff --git a/uniswap-packages-forks/v3-sdk b/uniswap-packages-forks/v3-sdk new file mode 160000 index 00000000000..a15f43fd118 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk @@ -0,0 +1 @@ +Subproject commit a15f43fd1185813612dc2eb15fcdb7fe987543f2 From edb5c7c540df0e65c94a009cd1c4fff63e0e086e Mon Sep 17 00:00:00 2001 From: alagunoff Date: Fri, 27 Dec 2024 19:29:38 +0300 Subject: [PATCH 22/30] feat: add forked packages to git tracking --- uniswap-packages-forks/sdk-core | 1 - uniswap-packages-forks/sdk-core/LICENSE | 21 + uniswap-packages-forks/sdk-core/README.md | 8 + .../sdk-core/dist/constants.d.ts | 20 + .../sdk-core/dist/entities/baseCurrency.d.ts | 19 + .../sdk-core/dist/entities/currency.d.ts | 4 + .../sdk-core/dist/entities/ether.d.ts | 18 + .../entities/fractions/currencyAmount.d.ts | 41 + .../dist/entities/fractions/fraction.d.ts | 24 + .../dist/entities/fractions/index.d.ts | 4 + .../dist/entities/fractions/percent.d.ts | 14 + .../dist/entities/fractions/price.d.ts | 31 + .../sdk-core/dist/entities/index.d.ts | 5 + .../sdk-core/dist/entities/pol.d.ts | 18 + .../sdk-core/dist/entities/token.d.ts | 27 + .../sdk-core/dist/index.d.ts | 3 + uniswap-packages-forks/sdk-core/dist/index.js | 8 + .../sdk-core/dist/sdk-core.cjs.development.js | 740 ++++ .../dist/sdk-core.cjs.development.js.map | 1 + .../dist/sdk-core.cjs.production.min.js | 2 + .../dist/sdk-core.cjs.production.min.js.map | 1 + .../sdk-core/dist/sdk-core.esm.js | 723 ++++ .../sdk-core/dist/sdk-core.esm.js.map | 1 + .../dist/utils/computePriceImpact.d.ts | 8 + .../sdk-core/dist/utils/currencyEquals.d.ts | 5 + .../sdk-core/dist/utils/index.d.ts | 7 + .../sdk-core/dist/utils/sortedInsert.d.ts | 1 + .../sdk-core/dist/utils/sqrt.d.ts | 7 + .../dist/utils/validateAndParseAddress.d.ts | 5 + .../sdk-core/dist/utils/wrappedCurrency.d.ts | 8 + .../dist/utils/wrappedCurrencyAmount.d.ts | 8 + uniswap-packages-forks/sdk-core/package.json | 44 + uniswap-packages-forks/v2-sdk | 1 - uniswap-packages-forks/v2-sdk/LICENSE | 21 + uniswap-packages-forks/v2-sdk/README.md | 9 + .../v2-sdk/dist/constants.d.ts | 9 + .../v2-sdk/dist/entities/index.d.ts | 3 + .../v2-sdk/dist/entities/pair.d.ts | 43 + .../v2-sdk/dist/entities/route.d.ts | 12 + .../v2-sdk/dist/entities/trade.d.ts | 103 + .../v2-sdk/dist/errors.d.ts | 16 + uniswap-packages-forks/v2-sdk/dist/index.d.ts | 4 + uniswap-packages-forks/v2-sdk/dist/index.js | 8 + .../v2-sdk/dist/router.d.ts | 64 + .../v2-sdk/dist/v2-sdk.cjs.development.js | 1260 ++++++ .../v2-sdk/dist/v2-sdk.cjs.development.js.map | 1 + .../v2-sdk/dist/v2-sdk.cjs.production.min.js | 2 + .../dist/v2-sdk.cjs.production.min.js.map | 1 + .../v2-sdk/dist/v2-sdk.esm.js | 1243 ++++++ .../v2-sdk/dist/v2-sdk.esm.js.map | 1 + uniswap-packages-forks/v2-sdk/package.json | 45 + uniswap-packages-forks/v3-sdk | 1 - uniswap-packages-forks/v3-sdk/LICENSE | 21 + uniswap-packages-forks/v3-sdk/README.md | 15 + .../v3-sdk/dist/constants.d.ts | 17 + .../v3-sdk/dist/entities/index.d.ts | 7 + .../v3-sdk/dist/entities/pool.d.ts | 65 + .../v3-sdk/dist/entities/position.d.ts | 126 + .../v3-sdk/dist/entities/route.d.ts | 26 + .../v3-sdk/dist/entities/tick.d.ts | 13 + .../dist/entities/tickDataProvider.d.ts | 31 + .../dist/entities/tickListDataProvider.d.ts | 15 + .../v3-sdk/dist/entities/trade.d.ts | 132 + uniswap-packages-forks/v3-sdk/dist/index.d.ts | 5 + uniswap-packages-forks/v3-sdk/dist/index.js | 8 + .../v3-sdk/dist/internalConstants.d.ts | 6 + .../dist/nonfungiblePositionManager.d.ts | 123 + .../v3-sdk/dist/selfPermit.d.ts | 22 + .../v3-sdk/dist/swapRouter.d.ts | 60 + .../v3-sdk/dist/utils/calldata.d.ts | 15 + .../v3-sdk/dist/utils/computePoolAddress.d.ts | 8 + .../v3-sdk/dist/utils/encodeRouteToPath.d.ts | 8 + .../v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts | 8 + .../v3-sdk/dist/utils/fullMath.d.ts | 8 + .../v3-sdk/dist/utils/index.d.ts | 14 + .../v3-sdk/dist/utils/isSorted.d.ts | 1 + .../v3-sdk/dist/utils/liquidityMath.d.ts | 8 + .../dist/utils/maxLiquidityForAmounts.d.ts | 14 + .../v3-sdk/dist/utils/mostSignificantBit.d.ts | 2 + .../v3-sdk/dist/utils/nearestUsableTick.d.ts | 6 + .../dist/utils/priceTickConversions.d.ts | 15 + .../v3-sdk/dist/utils/sqrtPriceMath.d.ts | 13 + .../v3-sdk/dist/utils/swapMath.d.ts | 9 + .../v3-sdk/dist/utils/tickList.d.ts | 23 + .../v3-sdk/dist/utils/tickMath.d.ts | 34 + .../v3-sdk/dist/v3-sdk.cjs.development.js | 3389 +++++++++++++++++ .../v3-sdk/dist/v3-sdk.cjs.development.js.map | 1 + .../v3-sdk/dist/v3-sdk.cjs.production.min.js | 2 + .../dist/v3-sdk.cjs.production.min.js.map | 1 + .../v3-sdk/dist/v3-sdk.esm.js | 3360 ++++++++++++++++ .../v3-sdk/dist/v3-sdk.esm.js.map | 1 + uniswap-packages-forks/v3-sdk/package.json | 47 + 92 files changed, 12350 insertions(+), 3 deletions(-) delete mode 160000 uniswap-packages-forks/sdk-core create mode 100644 uniswap-packages-forks/sdk-core/LICENSE create mode 100644 uniswap-packages-forks/sdk-core/README.md create mode 100644 uniswap-packages-forks/sdk-core/dist/constants.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/baseCurrency.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/currency.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/ether.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/currencyAmount.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/fraction.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/index.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/percent.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/price.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/index.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/pol.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/entities/token.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/index.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/index.js create mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js create mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js.map create mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js create mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js.map create mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js create mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js.map create mode 100644 uniswap-packages-forks/sdk-core/dist/utils/computePriceImpact.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/utils/currencyEquals.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/utils/index.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/utils/sortedInsert.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/utils/sqrt.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/utils/validateAndParseAddress.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrency.d.ts create mode 100644 uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts create mode 100644 uniswap-packages-forks/sdk-core/package.json delete mode 160000 uniswap-packages-forks/v2-sdk create mode 100644 uniswap-packages-forks/v2-sdk/LICENSE create mode 100644 uniswap-packages-forks/v2-sdk/README.md create mode 100644 uniswap-packages-forks/v2-sdk/dist/constants.d.ts create mode 100644 uniswap-packages-forks/v2-sdk/dist/entities/index.d.ts create mode 100644 uniswap-packages-forks/v2-sdk/dist/entities/pair.d.ts create mode 100644 uniswap-packages-forks/v2-sdk/dist/entities/route.d.ts create mode 100644 uniswap-packages-forks/v2-sdk/dist/entities/trade.d.ts create mode 100644 uniswap-packages-forks/v2-sdk/dist/errors.d.ts create mode 100644 uniswap-packages-forks/v2-sdk/dist/index.d.ts create mode 100644 uniswap-packages-forks/v2-sdk/dist/index.js create mode 100644 uniswap-packages-forks/v2-sdk/dist/router.d.ts create mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js create mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js.map create mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js create mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js.map create mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js create mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js.map create mode 100644 uniswap-packages-forks/v2-sdk/package.json delete mode 160000 uniswap-packages-forks/v3-sdk create mode 100644 uniswap-packages-forks/v3-sdk/LICENSE create mode 100644 uniswap-packages-forks/v3-sdk/README.md create mode 100644 uniswap-packages-forks/v3-sdk/dist/constants.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/index.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/pool.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/position.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/route.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/tick.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/tickDataProvider.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/tickListDataProvider.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/trade.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/index.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/index.js create mode 100644 uniswap-packages-forks/v3-sdk/dist/internalConstants.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/nonfungiblePositionManager.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/selfPermit.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/swapRouter.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/calldata.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/computePoolAddress.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/encodeRouteToPath.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/fullMath.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/index.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/isSorted.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/liquidityMath.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/maxLiquidityForAmounts.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/mostSignificantBit.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/nearestUsableTick.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/priceTickConversions.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/sqrtPriceMath.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/swapMath.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/tickList.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/tickMath.d.ts create mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js create mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js.map create mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js create mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js.map create mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js create mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js.map create mode 100644 uniswap-packages-forks/v3-sdk/package.json diff --git a/uniswap-packages-forks/sdk-core b/uniswap-packages-forks/sdk-core deleted file mode 160000 index d61d31e5f6e..00000000000 --- a/uniswap-packages-forks/sdk-core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d61d31e5f6e79e174f3e4226c04e8c5cfcf3e227 diff --git a/uniswap-packages-forks/sdk-core/LICENSE b/uniswap-packages-forks/sdk-core/LICENSE new file mode 100644 index 00000000000..0c6c24ca9dd --- /dev/null +++ b/uniswap-packages-forks/sdk-core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Uniswap Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/uniswap-packages-forks/sdk-core/README.md b/uniswap-packages-forks/sdk-core/README.md new file mode 100644 index 00000000000..86f69f1dbd3 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/README.md @@ -0,0 +1,8 @@ +# Uniswap SDK Core + +[![Unit Tests](https://github.com/Uniswap/uniswap-sdk-core/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3A%22Unit+Tests%22) +[![Lint](https://github.com/Uniswap/uniswap-sdk-core/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3ALint) +[![npm version](https://img.shields.io/npm/v/@uniswap/sdk-core/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk-core/v/latest) +[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk-core/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk-core@latest) + +This code is shared across Uniswap TypeScript SDKs. diff --git a/uniswap-packages-forks/sdk-core/dist/constants.d.ts b/uniswap-packages-forks/sdk-core/dist/constants.d.ts new file mode 100644 index 00000000000..1bd20cab92f --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/constants.d.ts @@ -0,0 +1,20 @@ +import JSBI from 'jsbi'; +export declare type BigintIsh = JSBI | string | number; +export declare enum ChainId { + MAINNET = 1, + ROPSTEN = 3, + RINKEBY = 4, + GÖRLI = 5, + KOVAN = 42, + POLYGON_AMOY = 80002 +} +export declare enum TradeType { + EXACT_INPUT = 0, + EXACT_OUTPUT = 1 +} +export declare enum Rounding { + ROUND_DOWN = 0, + ROUND_HALF_UP = 1, + ROUND_UP = 2 +} +export declare const MaxUint256: JSBI; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/baseCurrency.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/baseCurrency.d.ts new file mode 100644 index 00000000000..c56bf6b49a8 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/baseCurrency.d.ts @@ -0,0 +1,19 @@ +/** + * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. + * + * The only instance of the base class `Currency` is Ether. + */ +export declare abstract class BaseCurrency { + abstract readonly isEther: boolean; + abstract readonly isToken: boolean; + readonly decimals: number; + readonly symbol?: string; + readonly name?: string; + /** + * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. + * @param decimals decimals of the currency + * @param symbol symbol of the currency + * @param name of the currency + */ + protected constructor(decimals: number, symbol?: string, name?: string); +} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/currency.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/currency.d.ts new file mode 100644 index 00000000000..2b02f15ab6e --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/currency.d.ts @@ -0,0 +1,4 @@ +import { Ether } from './ether'; +import { Pol } from './pol'; +import { Token } from './token'; +export declare type Currency = Ether | Pol | Token; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/ether.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/ether.d.ts new file mode 100644 index 00000000000..78ded1b62b6 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/ether.d.ts @@ -0,0 +1,18 @@ +import { BaseCurrency } from './baseCurrency'; +/** + * Represents the currency Ether + */ +export declare class Ether extends BaseCurrency { + readonly isEther: true; + readonly isToken: false; + /** + * Only called once by this class + * @protected + */ + protected constructor(); + /** + * The only instance of the class `Ether`. + */ + static readonly ETHER: Ether; +} +export declare const ETHER: Ether; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/currencyAmount.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/currencyAmount.d.ts new file mode 100644 index 00000000000..e53ce44741e --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/fractions/currencyAmount.d.ts @@ -0,0 +1,41 @@ +import JSBI from 'jsbi'; +import { Currency } from '../currency'; +import { Ether } from '../ether'; +import { Pol } from '../pol'; +import { Fraction } from './fraction'; +import { BigintIsh, Rounding } from '../../constants'; +export declare class CurrencyAmount extends Fraction { + readonly currency: T; + readonly decimalScale: JSBI; + /** + * Returns a new currency amount instance from the + * @param currency the currency in the amount + * @param rawAmount the raw token or ether amount + */ + static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount; + /** + * Construct a currency amount with a denominator that is not equal to 1 + * @param currency the currency + * @param numerator the numerator of the fractional token amount + * @param denominator the denominator of the fractional token amount + */ + static fromFractionalAmount(currency: T, numerator: BigintIsh, denominator: BigintIsh): CurrencyAmount; + /** + * Helper that calls the constructor with the ETHER currency + * @param rawAmount ether amount in wei + */ + static ether(rawAmount: BigintIsh): CurrencyAmount; + /** + * Helper that calls the constructor with the POL currency + * @param rawAmount pol amount in wei + */ + static pol(rawAmount: BigintIsh): CurrencyAmount; + protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh); + add(other: CurrencyAmount): CurrencyAmount; + subtract(other: CurrencyAmount): CurrencyAmount; + multiply(other: Fraction | BigintIsh): CurrencyAmount; + divide(other: Fraction | BigintIsh): CurrencyAmount; + toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; + toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; + toExact(format?: object): string; +} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/fraction.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/fraction.d.ts new file mode 100644 index 00000000000..414770af5e3 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/fractions/fraction.d.ts @@ -0,0 +1,24 @@ +import JSBI from 'jsbi'; +import { BigintIsh, Rounding } from '../../constants'; +export declare class Fraction { + readonly numerator: JSBI; + readonly denominator: JSBI; + constructor(numerator: BigintIsh, denominator?: BigintIsh); + private static tryParseFraction; + get quotient(): JSBI; + get remainder(): Fraction; + invert(): Fraction; + add(other: Fraction | BigintIsh): Fraction; + subtract(other: Fraction | BigintIsh): Fraction; + lessThan(other: Fraction | BigintIsh): boolean; + equalTo(other: Fraction | BigintIsh): boolean; + greaterThan(other: Fraction | BigintIsh): boolean; + multiply(other: Fraction | BigintIsh): Fraction; + divide(other: Fraction | BigintIsh): Fraction; + toSignificant(significantDigits: number, format?: object, rounding?: Rounding): string; + toFixed(decimalPlaces: number, format?: object, rounding?: Rounding): string; + /** + * Helper method for converting any super class back to a fraction + */ + get asFraction(): Fraction; +} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/index.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/index.d.ts new file mode 100644 index 00000000000..616c23384e2 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/fractions/index.d.ts @@ -0,0 +1,4 @@ +export { CurrencyAmount } from './currencyAmount'; +export { Fraction } from './fraction'; +export { Percent } from './percent'; +export { Price } from './price'; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/percent.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/percent.d.ts new file mode 100644 index 00000000000..6f373cf3282 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/fractions/percent.d.ts @@ -0,0 +1,14 @@ +import { BigintIsh, Rounding } from '../../constants'; +import { Fraction } from './fraction'; +export declare class Percent extends Fraction { + /** + * This boolean prevents a fraction from being interpreted as a Percent + */ + readonly isPercent: true; + add(other: Fraction | BigintIsh): Percent; + subtract(other: Fraction | BigintIsh): Percent; + multiply(other: Fraction | BigintIsh): Percent; + divide(other: Fraction | BigintIsh): Percent; + toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; + toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; +} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/price.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/price.d.ts new file mode 100644 index 00000000000..b04db496080 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/fractions/price.d.ts @@ -0,0 +1,31 @@ +import { BigintIsh, Rounding } from '../../constants'; +import { Currency } from '../currency'; +import { Fraction } from './fraction'; +import { CurrencyAmount } from './currencyAmount'; +export declare class Price extends Fraction { + readonly baseCurrency: TBase; + readonly quoteCurrency: TQuote; + readonly scalar: Fraction; + constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh); + /** + * Flip the price, switching the base and quote currency + */ + invert(): Price; + /** + * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency + * @param other the other price + */ + multiply(other: Price): Price; + /** + * Return the amount of quote currency corresponding to a given amount of the base currency + * @param currencyAmount the amount of base currency to quote against the price + */ + quote(currencyAmount: CurrencyAmount): CurrencyAmount; + /** + * Get the value scaled by decimals for formatting + * @private + */ + private get adjustedForDecimals(); + toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; + toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; +} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/index.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/index.d.ts new file mode 100644 index 00000000000..2cbfd261cab --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/index.d.ts @@ -0,0 +1,5 @@ +export * from './fractions'; +export * from './currency'; +export * from './ether'; +export * from './pol'; +export * from './token'; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/pol.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/pol.d.ts new file mode 100644 index 00000000000..ffd1cbb267a --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/pol.d.ts @@ -0,0 +1,18 @@ +import { BaseCurrency } from './baseCurrency'; +/** + * Represents the currency Pol + */ +export declare class Pol extends BaseCurrency { + readonly isEther: true; + readonly isToken: false; + /** + * Only called once by this class + * @protected + */ + protected constructor(); + /** + * The only instance of the class `Pol`. + */ + static readonly POL: Pol; +} +export declare const POL: Pol; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/token.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/token.d.ts new file mode 100644 index 00000000000..65c8f126ca5 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/entities/token.d.ts @@ -0,0 +1,27 @@ +import { ChainId } from '../constants'; +import { BaseCurrency } from './baseCurrency'; +/** + * Represents an ERC20 token with a unique address and some metadata. + */ +export declare class Token extends BaseCurrency { + readonly isEther: false; + readonly isToken: true; + readonly chainId: ChainId | number; + readonly address: string; + constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string); + /** + * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. + * @param other other token to compare + */ + equals(other: Token): boolean; + /** + * Returns true if the address of this token sorts before the address of the other token + * @param other other token to compare + * @throws if the tokens have the same address + * @throws if the tokens are on different chains + */ + sortsBefore(other: Token): boolean; +} +export declare const WETH9: { + [chainId in ChainId]: Token; +}; diff --git a/uniswap-packages-forks/sdk-core/dist/index.d.ts b/uniswap-packages-forks/sdk-core/dist/index.d.ts new file mode 100644 index 00000000000..0e9ce96a650 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/index.d.ts @@ -0,0 +1,3 @@ +export * from './constants'; +export * from './entities'; +export * from './utils'; diff --git a/uniswap-packages-forks/sdk-core/dist/index.js b/uniswap-packages-forks/sdk-core/dist/index.js new file mode 100644 index 00000000000..c3473ea9bf6 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/index.js @@ -0,0 +1,8 @@ + +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./sdk-core.cjs.production.min.js') +} else { + module.exports = require('./sdk-core.cjs.development.js') +} diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js new file mode 100644 index 00000000000..07585205128 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js @@ -0,0 +1,740 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var JSBI = _interopDefault(require('jsbi')); +var invariant = _interopDefault(require('tiny-invariant')); +var _Decimal = _interopDefault(require('decimal.js-light')); +var _Big = _interopDefault(require('big.js')); +var toFormat = _interopDefault(require('toformat')); +var address = require('@ethersproject/address'); + +(function (ChainId) { + ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; + ChainId[ChainId["ROPSTEN"] = 3] = "ROPSTEN"; + ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY"; + ChainId[ChainId["G\xD6RLI"] = 5] = "G\xD6RLI"; + ChainId[ChainId["KOVAN"] = 42] = "KOVAN"; + ChainId[ChainId["POLYGON_AMOY"] = 80002] = "POLYGON_AMOY"; +})(exports.ChainId || (exports.ChainId = {})); + +(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) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +/** + * Compares two currencies for equality + */ +function currencyEquals(currencyA, currencyB) { + if (currencyA.isToken && currencyB.isToken) { + return currencyA.equals(currencyB); + } else if (currencyA.isToken) { + return false; + } else if (currencyB.isToken) { + return false; + } else { + return currencyA.isEther === currencyB.isEther; + } +} + +/** + * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. + * + * The only instance of the base class `Currency` is Ether. + */ + +var BaseCurrency = +/** + * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. + * @param decimals decimals of the currency + * @param symbol symbol of the currency + * @param name of the currency + */ +function BaseCurrency(decimals, symbol, name) { + !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? invariant(false, 'DECIMALS') : void 0; + this.decimals = decimals; + this.symbol = symbol; + this.name = name; +}; + +/** + * Represents the currency Ether + */ + +var Ether = /*#__PURE__*/function (_BaseCurrency) { + _inheritsLoose(Ether, _BaseCurrency); + + /** + * Only called once by this class + * @protected + */ + function Ether() { + var _this; + + _this = _BaseCurrency.call(this, 18, 'ETH', 'Ether') || this; + _this.isEther = true; + _this.isToken = false; + return _this; + } + + return Ether; +}(BaseCurrency); +/** + * The only instance of the class `Ether`. + */ + +Ether.ETHER = /*#__PURE__*/new Ether(); +var ETHER = Ether.ETHER; + +/** + * Represents the currency Pol + */ + +var Pol = /*#__PURE__*/function (_BaseCurrency) { + _inheritsLoose(Pol, _BaseCurrency); + + /** + * Only called once by this class + * @protected + */ + function Pol() { + var _this; + + _this = _BaseCurrency.call(this, 18, 'POL', 'Pol') || this; + _this.isEther = true; + _this.isToken = false; + return _this; + } + + return Pol; +}(BaseCurrency); +/** + * The only instance of the class `Pol`. + */ + +Pol.POL = /*#__PURE__*/new Pol(); +var POL = Pol.POL; + +var _toSignificantRoundin, _toFixedRounding; +var Decimal = /*#__PURE__*/toFormat(_Decimal); +var Big = /*#__PURE__*/toFormat(_Big); +var toSignificantRounding = (_toSignificantRoundin = {}, _toSignificantRoundin[exports.Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN, _toSignificantRoundin[exports.Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP, _toSignificantRoundin[exports.Rounding.ROUND_UP] = Decimal.ROUND_UP, _toSignificantRoundin); +var toFixedRounding = (_toFixedRounding = {}, _toFixedRounding[exports.Rounding.ROUND_DOWN] = 0, _toFixedRounding[exports.Rounding.ROUND_HALF_UP] = 1, _toFixedRounding[exports.Rounding.ROUND_UP] = 3, _toFixedRounding); +var Fraction = /*#__PURE__*/function () { + function Fraction(numerator, denominator) { + if (denominator === void 0) { + denominator = JSBI.BigInt(1); + } + + this.numerator = JSBI.BigInt(numerator); + this.denominator = JSBI.BigInt(denominator); + } + + Fraction.tryParseFraction = function tryParseFraction(fractionish) { + if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') return new Fraction(fractionish); + if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish; + throw new Error('Could not parse fraction'); + } // performs floor division + ; + + var _proto = Fraction.prototype; + + _proto.invert = function invert() { + return new Fraction(this.denominator, this.numerator); + }; + + _proto.add = function add(other) { + var otherParsed = Fraction.tryParseFraction(other); + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator); + } + + return new Fraction(JSBI.add(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.subtract = function subtract(other) { + var otherParsed = Fraction.tryParseFraction(other); + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator); + } + + return new Fraction(JSBI.subtract(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.lessThan = function lessThan(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.lessThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.equalTo = function equalTo(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.equal(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.greaterThan = function greaterThan(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.greaterThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.multiply = function multiply(other) { + var otherParsed = Fraction.tryParseFraction(other); + return new Fraction(JSBI.multiply(this.numerator, otherParsed.numerator), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.divide = function divide(other) { + var otherParsed = Fraction.tryParseFraction(other); + return new Fraction(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(this.denominator, otherParsed.numerator)); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + if (rounding === void 0) { + rounding = exports.Rounding.ROUND_HALF_UP; + } + + !Number.isInteger(significantDigits) ? invariant(false, significantDigits + " is not an integer.") : void 0; + !(significantDigits > 0) ? invariant(false, significantDigits + " is not positive.") : void 0; + Decimal.set({ + precision: significantDigits + 1, + rounding: toSignificantRounding[rounding] + }); + var quotient = new Decimal(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(significantDigits); + return quotient.toFormat(quotient.decimalPlaces(), format); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + if (rounding === void 0) { + rounding = exports.Rounding.ROUND_HALF_UP; + } + + !Number.isInteger(decimalPlaces) ? invariant(false, decimalPlaces + " is not an integer.") : void 0; + !(decimalPlaces >= 0) ? invariant(false, decimalPlaces + " is negative.") : void 0; + Big.DP = decimalPlaces; + Big.RM = toFixedRounding[rounding]; + return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format); + } + /** + * Helper method for converting any super class back to a fraction + */ + ; + + _createClass(Fraction, [{ + key: "quotient", + get: function get() { + return JSBI.divide(this.numerator, this.denominator); + } // remainder after floor division + + }, { + key: "remainder", + get: function get() { + return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator); + } + }, { + key: "asFraction", + get: function get() { + return new Fraction(this.numerator, this.denominator); + } + }]); + + return Fraction; +}(); + +var Big$1 = /*#__PURE__*/toFormat(_Big); +var CurrencyAmount = /*#__PURE__*/function (_Fraction) { + _inheritsLoose(CurrencyAmount, _Fraction); + + function CurrencyAmount(currency, numerator, denominator) { + var _this; + + _this = _Fraction.call(this, numerator, denominator) || this; + !JSBI.lessThanOrEqual(_this.quotient, MaxUint256) ? invariant(false, 'AMOUNT') : void 0; + _this.currency = currency; + _this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals)); + return _this; + } + /** + * Returns a new currency amount instance from the + * @param currency the currency in the amount + * @param rawAmount the raw token or ether amount + */ + + + CurrencyAmount.fromRawAmount = function fromRawAmount(currency, rawAmount) { + return new CurrencyAmount(currency, rawAmount); + } + /** + * Construct a currency amount with a denominator that is not equal to 1 + * @param currency the currency + * @param numerator the numerator of the fractional token amount + * @param denominator the denominator of the fractional token amount + */ + ; + + CurrencyAmount.fromFractionalAmount = function fromFractionalAmount(currency, numerator, denominator) { + return new CurrencyAmount(currency, numerator, denominator); + } + /** + * Helper that calls the constructor with the ETHER currency + * @param rawAmount ether amount in wei + */ + ; + + CurrencyAmount.ether = function ether(rawAmount) { + return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount); + } + /** + * Helper that calls the constructor with the POL currency + * @param rawAmount pol amount in wei + */ + ; + + CurrencyAmount.pol = function pol(rawAmount) { + return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount); + }; + + var _proto = CurrencyAmount.prototype; + + _proto.add = function add(other) { + !currencyEquals(this.currency, other.currency) ? invariant(false, 'CURRENCY') : void 0; + + var added = _Fraction.prototype.add.call(this, other); + + return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator); + }; + + _proto.subtract = function subtract(other) { + !currencyEquals(this.currency, other.currency) ? invariant(false, 'CURRENCY') : void 0; + + var subtracted = _Fraction.prototype.subtract.call(this, other); + + return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator); + }; + + _proto.multiply = function multiply(other) { + var multiplied = _Fraction.prototype.multiply.call(this, other); + + return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator); + }; + + _proto.divide = function divide(other) { + var divided = _Fraction.prototype.divide.call(this, other); + + return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 6; + } + + if (rounding === void 0) { + rounding = exports.Rounding.ROUND_DOWN; + } + + return _Fraction.prototype.divide.call(this, this.decimalScale).toSignificant(significantDigits, format, rounding); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = this.currency.decimals; + } + + if (rounding === void 0) { + rounding = exports.Rounding.ROUND_DOWN; + } + + !(decimalPlaces <= this.currency.decimals) ? invariant(false, 'DECIMALS') : void 0; + return _Fraction.prototype.divide.call(this, this.decimalScale).toFixed(decimalPlaces, format, rounding); + }; + + _proto.toExact = function toExact(format) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + Big$1.DP = this.currency.decimals; + return new Big$1(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format); + }; + + return CurrencyAmount; +}(Fraction); + +var ONE_HUNDRED = /*#__PURE__*/new Fraction( /*#__PURE__*/JSBI.BigInt(100)); +/** + * Converts a fraction to a percent + * @param fraction the fraction to convert + */ + +function toPercent(fraction) { + return new Percent(fraction.numerator, fraction.denominator); +} + +var Percent = /*#__PURE__*/function (_Fraction) { + _inheritsLoose(Percent, _Fraction); + + function Percent() { + var _this; + + _this = _Fraction.apply(this, arguments) || this; + /** + * This boolean prevents a fraction from being interpreted as a Percent + */ + + _this.isPercent = true; + return _this; + } + + var _proto = Percent.prototype; + + _proto.add = function add(other) { + return toPercent(_Fraction.prototype.add.call(this, other)); + }; + + _proto.subtract = function subtract(other) { + return toPercent(_Fraction.prototype.subtract.call(this, other)); + }; + + _proto.multiply = function multiply(other) { + return toPercent(_Fraction.prototype.multiply.call(this, other)); + }; + + _proto.divide = function divide(other) { + return toPercent(_Fraction.prototype.divide.call(this, other)); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 5; + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 2; + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding); + }; + + return Percent; +}(Fraction); + +var Price = /*#__PURE__*/function (_Fraction) { + _inheritsLoose(Price, _Fraction); + + // denominator and numerator _must_ be raw, i.e. in the native representation + function Price(baseCurrency, quoteCurrency, denominator, numerator) { + var _this; + + _this = _Fraction.call(this, numerator, denominator) || this; + _this.baseCurrency = baseCurrency; + _this.quoteCurrency = quoteCurrency; + _this.scalar = new Fraction(JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)), JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))); + return _this; + } + /** + * Flip the price, switching the base and quote currency + */ + + + var _proto = Price.prototype; + + _proto.invert = function invert() { + return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator); + } + /** + * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency + * @param other the other price + */ + ; + + _proto.multiply = function multiply(other) { + !currencyEquals(this.quoteCurrency, other.baseCurrency) ? invariant(false, 'TOKEN') : void 0; + + var fraction = _Fraction.prototype.multiply.call(this, other); + + return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator); + } + /** + * Return the amount of quote currency corresponding to a given amount of the base currency + * @param currencyAmount the amount of base currency to quote against the price + */ + ; + + _proto.quote = function quote(currencyAmount) { + !currencyEquals(currencyAmount.currency, this.baseCurrency) ? invariant(false, 'TOKEN') : void 0; + + var result = _Fraction.prototype.multiply.call(this, currencyAmount); + + return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator); + } + /** + * Get the value scaled by decimals for formatting + * @private + */ + ; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 6; + } + + return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 4; + } + + return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding); + }; + + _createClass(Price, [{ + key: "adjustedForDecimals", + get: function get() { + return _Fraction.prototype.multiply.call(this, this.scalar); + } + }]); + + return Price; +}(Fraction); + +/** + * Validates an address and returns the parsed (checksummed) version of that address + * @param address the unchecksummed hex address + */ + +function validateAndParseAddress(address$1) { + try { + return address.getAddress(address$1); + } catch (error) { + throw new Error(address$1 + " is not a valid address."); + } +} + +var _WETH; +/** + * Represents an ERC20 token with a unique address and some metadata. + */ + +var Token = /*#__PURE__*/function (_BaseCurrency) { + _inheritsLoose(Token, _BaseCurrency); + + function Token(chainId, address, decimals, symbol, name) { + var _this; + + _this = _BaseCurrency.call(this, decimals, symbol, name) || this; + _this.isEther = false; + _this.isToken = true; + _this.chainId = chainId; + _this.address = validateAndParseAddress(address); + return _this; + } + /** + * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. + * @param other other token to compare + */ + + + var _proto = Token.prototype; + + _proto.equals = function equals(other) { + // short circuit on reference equality + if (this === other) { + return true; + } + + return this.chainId === other.chainId && this.address === other.address; + } + /** + * Returns true if the address of this token sorts before the address of the other token + * @param other other token to compare + * @throws if the tokens have the same address + * @throws if the tokens are on different chains + */ + ; + + _proto.sortsBefore = function sortsBefore(other) { + !(this.chainId === other.chainId) ? invariant(false, 'CHAIN_IDS') : void 0; + !(this.address !== other.address) ? invariant(false, 'ADDRESSES') : void 0; + return this.address.toLowerCase() < other.address.toLowerCase(); + }; + + return Token; +}(BaseCurrency); +var WETH9 = (_WETH = {}, _WETH[exports.ChainId.MAINNET] = /*#__PURE__*/new Token(exports.ChainId.MAINNET, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.ROPSTEN] = /*#__PURE__*/new Token(exports.ChainId.ROPSTEN, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.RINKEBY] = /*#__PURE__*/new Token(exports.ChainId.RINKEBY, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.GÖRLI] = /*#__PURE__*/new Token(exports.ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.KOVAN] = /*#__PURE__*/new Token(exports.ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.POLYGON_AMOY] = /*#__PURE__*/new Token(exports.ChainId.POLYGON_AMOY, '0xd7a19e388c52D3580B6428F29494883A5d40C330', 18, 'WETH9', 'Wrapped Ether'), _WETH); + +/** + * Returns the percent difference between the mid price and the execution price, i.e. price impact. + * @param midPrice mid price before the trade + * @param inputAmount the input amount of the trade + * @param outputAmount the output amount of the trade + */ + +function computePriceImpact(midPrice, inputAmount, outputAmount) { + var quotedOutputAmount = midPrice.quote(inputAmount); // calculate price impact := (exactQuote - outputAmount) / exactQuote + + var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount); + return new Percent(priceImpact.numerator, priceImpact.denominator); +} + +// `maxSize` by removing the last item + +function sortedInsert(items, add, maxSize, comparator) { + !(maxSize > 0) ? invariant(false, 'MAX_SIZE_ZERO') : void 0; // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize + + !(items.length <= maxSize) ? invariant(false, 'ITEMS_SIZE') : void 0; // short circuit first item add + + if (items.length === 0) { + items.push(add); + return null; + } else { + var isFull = items.length === maxSize; // short circuit if full and the additional item does not come before the last item + + if (isFull && comparator(items[items.length - 1], add) <= 0) { + return add; + } + + var lo = 0, + hi = items.length; + + while (lo < hi) { + var mid = lo + hi >>> 1; + + if (comparator(items[mid], add) <= 0) { + lo = mid + 1; + } else { + hi = mid; + } + } + + items.splice(lo, 0, add); + return isFull ? items.pop() : null; + } +} + +var MAX_SAFE_INTEGER = /*#__PURE__*/JSBI.BigInt(Number.MAX_SAFE_INTEGER); +var ZERO = /*#__PURE__*/JSBI.BigInt(0); +var ONE = /*#__PURE__*/JSBI.BigInt(1); +var TWO = /*#__PURE__*/JSBI.BigInt(2); +/** + * Computes floor(sqrt(value)) + * @param value the value for which to compute the square root, rounded down + */ + +function sqrt(value) { + !JSBI.greaterThanOrEqual(value, ZERO) ? invariant(false, 'NEGATIVE') : void 0; // rely on built in sqrt if possible + + if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) { + return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value)))); + } + + var z; + var x; + z = value; + x = JSBI.add(JSBI.divide(value, TWO), ONE); + + while (JSBI.lessThan(x, z)) { + z = x; + x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO); + } + + return z; +} + +/** + * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token + * @param currency the currency to wrap, if necessary + * @param chainId the ID of the chain for wrapping + */ + +function wrappedCurrency(currency, chainId) { + if (currency.isToken) { + !(currency.chainId === chainId) ? invariant(false, 'CHAIN_ID') : void 0; + return currency; + } + + if (currency.isEther) return WETH9[chainId]; + throw new Error('CURRENCY'); +} + +/** + * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. + * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns + * the input currency amount. + */ + +function wrappedCurrencyAmount(currencyAmount, chainId) { + return CurrencyAmount.fromFractionalAmount(wrappedCurrency(currencyAmount.currency, chainId), currencyAmount.numerator, currencyAmount.denominator); +} + +exports.CurrencyAmount = CurrencyAmount; +exports.ETHER = ETHER; +exports.Ether = Ether; +exports.Fraction = Fraction; +exports.MaxUint256 = MaxUint256; +exports.POL = POL; +exports.Percent = Percent; +exports.Pol = Pol; +exports.Price = Price; +exports.Token = Token; +exports.WETH9 = WETH9; +exports.computePriceImpact = computePriceImpact; +exports.currencyEquals = currencyEquals; +exports.sortedInsert = sortedInsert; +exports.sqrt = sqrt; +exports.validateAndParseAddress = validateAndParseAddress; +exports.wrappedCurrency = wrappedCurrency; +exports.wrappedCurrencyAmount = wrappedCurrencyAmount; +//# sourceMappingURL=sdk-core.cjs.development.js.map diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js.map b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js.map new file mode 100644 index 00000000000..e70f1e4aa00 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sdk-core.cjs.development.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/pol.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\r\n\r\n// exports for external consumption\r\nexport type BigintIsh = JSBI | string | number\r\n\r\nexport enum ChainId {\r\n MAINNET = 1,\r\n ROPSTEN = 3,\r\n RINKEBY = 4,\r\n GÖRLI = 5,\r\n KOVAN = 42,\r\n POLYGON_AMOY = 80002,\r\n}\r\n\r\nexport enum TradeType {\r\n EXACT_INPUT,\r\n EXACT_OUTPUT\r\n}\r\n\r\nexport enum Rounding {\r\n ROUND_DOWN,\r\n ROUND_HALF_UP,\r\n ROUND_UP\r\n}\r\n\r\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\r\n","import { Currency } from '../entities/currency'\r\n\r\n/**\r\n * Compares two currencies for equality\r\n */\r\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\r\n if (currencyA.isToken && currencyB.isToken) {\r\n return currencyA.equals(currencyB)\r\n } else if (currencyA.isToken) {\r\n return false\r\n } else if (currencyB.isToken) {\r\n return false\r\n } else {\r\n return currencyA.isEther === currencyB.isEther\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n/**\r\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\r\n *\r\n * The only instance of the base class `Currency` is Ether.\r\n */\r\nexport abstract class BaseCurrency {\r\n public abstract readonly isEther: boolean\r\n public abstract readonly isToken: boolean\r\n\r\n public readonly decimals: number\r\n public readonly symbol?: string\r\n public readonly name?: string\r\n\r\n /**\r\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\r\n * @param decimals decimals of the currency\r\n * @param symbol symbol of the currency\r\n * @param name of the currency\r\n */\r\n protected constructor(decimals: number, symbol?: string, name?: string) {\r\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\r\n\r\n this.decimals = decimals\r\n this.symbol = symbol\r\n this.name = name\r\n }\r\n}\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Ether\r\n */\r\nexport class Ether extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'ETH', 'Ether')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Ether`.\r\n */\r\n public static readonly ETHER: Ether = new Ether()\r\n}\r\n\r\nexport const ETHER = Ether.ETHER\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Pol\r\n */\r\nexport class Pol extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'POL', 'Pol')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Pol`.\r\n */\r\n public static readonly POL: Pol = new Pol()\r\n}\r\n\r\nexport const POL = Pol.POL\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\nimport _Decimal from 'decimal.js-light'\r\nimport _Big, { RoundingMode } from 'big.js'\r\nimport toFormat from 'toformat'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\n\r\nconst Decimal = toFormat(_Decimal)\r\nconst Big = toFormat(_Big)\r\n\r\nconst toSignificantRounding = {\r\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\r\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\r\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\r\n}\r\n\r\nconst toFixedRounding = {\r\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\r\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\r\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\r\n}\r\n\r\nexport class Fraction {\r\n public readonly numerator: JSBI\r\n public readonly denominator: JSBI\r\n\r\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\r\n this.numerator = JSBI.BigInt(numerator)\r\n this.denominator = JSBI.BigInt(denominator)\r\n }\r\n\r\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\r\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\r\n return new Fraction(fractionish)\r\n\r\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\r\n throw new Error('Could not parse fraction')\r\n }\r\n\r\n // performs floor division\r\n public get quotient(): JSBI {\r\n return JSBI.divide(this.numerator, this.denominator)\r\n }\r\n\r\n // remainder after floor division\r\n public get remainder(): Fraction {\r\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\r\n }\r\n\r\n public invert(): Fraction {\r\n return new Fraction(this.denominator, this.numerator)\r\n }\r\n\r\n public add(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.add(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public subtract(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.subtract(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public lessThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.lessThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public equalTo(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.equal(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public greaterThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.greaterThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.numerator),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(this.denominator, otherParsed.numerator)\r\n )\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\r\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\r\n\r\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\r\n const quotient = new Decimal(this.numerator.toString())\r\n .div(this.denominator.toString())\r\n .toSignificantDigits(significantDigits)\r\n return quotient.toFormat(quotient.decimalPlaces(), format)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\r\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\r\n\r\n Big.DP = decimalPlaces\r\n Big.RM = toFixedRounding[rounding]\r\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\r\n }\r\n\r\n /**\r\n * Helper method for converting any super class back to a fraction\r\n */\r\n public get asFraction(): Fraction {\r\n return new Fraction(this.numerator, this.denominator)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport { Currency } from '../currency'\r\nimport { Ether } from '../ether'\r\nimport { Pol } from '../pol'\r\nimport { Fraction } from './fraction'\r\nimport _Big from 'big.js'\r\n\r\nimport toFormat from 'toformat'\r\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\r\n\r\nconst Big = toFormat(_Big)\r\n\r\nexport class CurrencyAmount extends Fraction {\r\n public readonly currency: T\r\n public readonly decimalScale: JSBI\r\n\r\n /**\r\n * Returns a new currency amount instance from the\r\n * @param currency the currency in the amount\r\n * @param rawAmount the raw token or ether amount\r\n */\r\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\r\n return new CurrencyAmount(currency, rawAmount)\r\n }\r\n\r\n /**\r\n * Construct a currency amount with a denominator that is not equal to 1\r\n * @param currency the currency\r\n * @param numerator the numerator of the fractional token amount\r\n * @param denominator the denominator of the fractional token amount\r\n */\r\n public static fromFractionalAmount(\r\n currency: T,\r\n numerator: BigintIsh,\r\n denominator: BigintIsh\r\n ): CurrencyAmount {\r\n return new CurrencyAmount(currency, numerator, denominator)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the ETHER currency\r\n * @param rawAmount ether amount in wei\r\n */\r\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the POL currency\r\n * @param rawAmount pol amount in wei\r\n */\r\n public static pol(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount)\r\n }\r\n\r\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\r\n super(numerator, denominator)\r\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\r\n this.currency = currency\r\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\r\n }\r\n\r\n public add(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const added = super.add(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\r\n }\r\n\r\n public subtract(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const subtracted = super.subtract(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\r\n const multiplied = super.multiply(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\r\n const divided = super.divide(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number = 6,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number = this.currency.decimals,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\r\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\r\n }\r\n\r\n public toExact(format: object = { groupSeparator: '' }): string {\r\n Big.DP = this.currency.decimals\r\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Fraction } from './fraction'\r\n\r\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\r\n\r\n/**\r\n * Converts a fraction to a percent\r\n * @param fraction the fraction to convert\r\n */\r\nfunction toPercent(fraction: Fraction): Percent {\r\n return new Percent(fraction.numerator, fraction.denominator)\r\n}\r\n\r\nexport class Percent extends Fraction {\r\n /**\r\n * This boolean prevents a fraction from being interpreted as a Percent\r\n */\r\n public readonly isPercent: true = true\r\n\r\n add(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.add(other))\r\n }\r\n\r\n subtract(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.subtract(other))\r\n }\r\n\r\n multiply(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.multiply(other))\r\n }\r\n\r\n divide(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.divide(other))\r\n }\r\n\r\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport invariant from 'tiny-invariant'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Currency } from '../currency'\r\nimport { Fraction } from './fraction'\r\nimport { CurrencyAmount } from './currencyAmount'\r\n\r\nexport class Price extends Fraction {\r\n public readonly baseCurrency: TBase // input i.e. denominator\r\n public readonly quoteCurrency: TQuote // output i.e. numerator\r\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\r\n\r\n // denominator and numerator _must_ be raw, i.e. in the native representation\r\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\r\n super(numerator, denominator)\r\n\r\n this.baseCurrency = baseCurrency\r\n this.quoteCurrency = quoteCurrency\r\n this.scalar = new Fraction(\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\r\n )\r\n }\r\n\r\n /**\r\n * Flip the price, switching the base and quote currency\r\n */\r\n public invert(): Price {\r\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\r\n }\r\n\r\n /**\r\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\r\n * @param other the other price\r\n */\r\n public multiply(other: Price): Price {\r\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\r\n const fraction = super.multiply(other)\r\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\r\n }\r\n\r\n /**\r\n * Return the amount of quote currency corresponding to a given amount of the base currency\r\n * @param currencyAmount the amount of base currency to quote against the price\r\n */\r\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\r\n const result = super.multiply(currencyAmount)\r\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\r\n }\r\n\r\n /**\r\n * Get the value scaled by decimals for formatting\r\n * @private\r\n */\r\n private get adjustedForDecimals(): Fraction {\r\n return super.multiply(this.scalar)\r\n }\r\n\r\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import { getAddress } from '@ethersproject/address'\r\n\r\n/**\r\n * Validates an address and returns the parsed (checksummed) version of that address\r\n * @param address the unchecksummed hex address\r\n */\r\nexport function validateAndParseAddress(address: string): string {\r\n try {\r\n return getAddress(address)\r\n } catch (error) {\r\n throw new Error(`${address} is not a valid address.`)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\r\nimport { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents an ERC20 token with a unique address and some metadata.\r\n */\r\nexport class Token extends BaseCurrency {\r\n public readonly isEther: false = false\r\n public readonly isToken: true = true\r\n\r\n public readonly chainId: ChainId | number\r\n public readonly address: string\r\n\r\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\r\n super(decimals, symbol, name)\r\n this.chainId = chainId\r\n this.address = validateAndParseAddress(address)\r\n }\r\n\r\n /**\r\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\r\n * @param other other token to compare\r\n */\r\n public equals(other: Token): boolean {\r\n // short circuit on reference equality\r\n if (this === other) {\r\n return true\r\n }\r\n return this.chainId === other.chainId && this.address === other.address\r\n }\r\n\r\n /**\r\n * Returns true if the address of this token sorts before the address of the other token\r\n * @param other other token to compare\r\n * @throws if the tokens have the same address\r\n * @throws if the tokens are on different chains\r\n */\r\n public sortsBefore(other: Token): boolean {\r\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\r\n invariant(this.address !== other.address, 'ADDRESSES')\r\n return this.address.toLowerCase() < other.address.toLowerCase()\r\n }\r\n}\r\n\r\nexport const WETH9: { [chainId in ChainId]: Token } = {\r\n [ChainId.MAINNET]: new Token(\r\n ChainId.MAINNET,\r\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.ROPSTEN]: new Token(\r\n ChainId.ROPSTEN,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.RINKEBY]: new Token(\r\n ChainId.RINKEBY,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.POLYGON_AMOY]: new Token(\r\n ChainId.POLYGON_AMOY,\r\n '0xd7a19e388c52D3580B6428F29494883A5d40C330',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n )\r\n}\r\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\r\n\r\n/**\r\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\r\n * @param midPrice mid price before the trade\r\n * @param inputAmount the input amount of the trade\r\n * @param outputAmount the output amount of the trade\r\n */\r\nexport function computePriceImpact(\r\n midPrice: Price,\r\n inputAmount: CurrencyAmount,\r\n outputAmount: CurrencyAmount\r\n): Percent {\r\n const quotedOutputAmount = midPrice.quote(inputAmount)\r\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\r\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\r\n return new Percent(priceImpact.numerator, priceImpact.denominator)\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\r\n// `maxSize` by removing the last item\r\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\r\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\r\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\r\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\r\n\r\n // short circuit first item add\r\n if (items.length === 0) {\r\n items.push(add)\r\n return null\r\n } else {\r\n const isFull = items.length === maxSize\r\n // short circuit if full and the additional item does not come before the last item\r\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\r\n return add\r\n }\r\n\r\n let lo = 0,\r\n hi = items.length\r\n\r\n while (lo < hi) {\r\n const mid = (lo + hi) >>> 1\r\n if (comparator(items[mid], add) <= 0) {\r\n lo = mid + 1\r\n } else {\r\n hi = mid\r\n }\r\n }\r\n items.splice(lo, 0, add)\r\n return isFull ? items.pop()! : null\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\n\r\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\r\n\r\nconst ZERO = JSBI.BigInt(0)\r\nconst ONE = JSBI.BigInt(1)\r\nconst TWO = JSBI.BigInt(2)\r\n\r\n/**\r\n * Computes floor(sqrt(value))\r\n * @param value the value for which to compute the square root, rounded down\r\n */\r\nexport function sqrt(value: JSBI): JSBI {\r\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\r\n\r\n // rely on built in sqrt if possible\r\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\r\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\r\n }\r\n\r\n let z: JSBI\r\n let x: JSBI\r\n z = value\r\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\r\n while (JSBI.lessThan(x, z)) {\r\n z = x\r\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\r\n }\r\n return z\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { Currency, Token, WETH9 } from '../entities'\r\n\r\n/**\r\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\r\n * @param currency the currency to wrap, if necessary\r\n * @param chainId the ID of the chain for wrapping\r\n */\r\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\r\n if (currency.isToken) {\r\n invariant(currency.chainId === chainId, 'CHAIN_ID')\r\n return currency\r\n }\r\n if (currency.isEther) return WETH9[chainId]\r\n throw new Error('CURRENCY')\r\n}\r\n","import { ChainId } from '../constants'\r\nimport { Currency, CurrencyAmount, Token } from '../entities'\r\nimport { wrappedCurrency } from './wrappedCurrency'\r\n\r\n/**\r\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\r\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\r\n * the input currency amount.\r\n */\r\nexport function wrappedCurrencyAmount(\r\n currencyAmount: CurrencyAmount,\r\n chainId: ChainId\r\n): CurrencyAmount {\r\n return CurrencyAmount.fromFractionalAmount(\r\n wrappedCurrency(currencyAmount.currency, chainId),\r\n currencyAmount.numerator,\r\n currencyAmount.denominator\r\n )\r\n}\r\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Pol","POL","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","pol","added","subtracted","multiplied","divided","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","POLYGON_AMOY","computePriceImpact","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","sortedInsert","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","MAX_SAFE_INTEGER","ZERO","ONE","TWO","sqrt","value","greaterThanOrEqual","Math","floor","toNumber","z","x","wrappedCurrency","wrappedCurrencyAmount"],"mappings":";;;;;;;;;;;;;AAKA,WAAYA;AACVA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,gCAAA,aAAA;AACAA,EAAAA,8BAAA,UAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAPD,EAAYA,eAAO,KAAPA,eAAO,KAAA,CAAnB;;AASA,WAAYC;AACVA,EAAAA,uCAAA,gBAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAHD,EAAYA,iBAAS,KAATA,iBAAS,KAAA,CAArB;;AAKA,WAAYC;AACVA,EAAAA,oCAAA,eAAA;AACAA,EAAAA,uCAAA,kBAAA;AACAA,EAAAA,kCAAA,aAAA;AACD,CAJD,EAAYA,gBAAQ,KAARA,gBAAQ,KAAA,CAApB;;IAMaC,UAAU,gBAAGC,IAAI,CAACC,MAAL,CAAY,oEAAZ;;;;;;;;;;;;;;;;;;;;;;;;ACvB1B;;;AAGA,SAAgBC,eAAeC,WAAqBC;AAClD,MAAID,SAAS,CAACE,OAAV,IAAqBD,SAAS,CAACC,OAAnC,EAA4C;AAC1C,WAAOF,SAAS,CAACG,MAAV,CAAiBF,SAAjB,CAAP;AACD,GAFD,MAEO,IAAID,SAAS,CAACE,OAAd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,QAAQ,CAAC+B,OAAT,KAAqBA,OAA/B,KAAAhF,SAAS,QAA+B,UAA/B,CAAT,CAAA;AACA,WAAOiD,QAAP;AACD;;AACD,MAAIA,QAAQ,CAACxD,OAAb,EAAsB,OAAO0F,KAAK,CAACH,OAAD,CAAZ;AACtB,QAAM,IAAI5D,KAAJ,CAAU,UAAV,CAAN;AACD;;ACZD;;;;;;AAKA,SAAgBqG,sBACdjD,gBACAQ;AAEA,SAAOhC,cAAc,CAACO,oBAAf,CACLiE,eAAe,CAAChD,cAAc,CAACvB,QAAhB,EAA0B+B,OAA1B,CADV,EAELR,cAAc,CAACxD,SAFV,EAGLwD,cAAc,CAACvD,WAHV,CAAP;AAKD;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js new file mode 100644 index 00000000000..08f0aa10e57 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js @@ -0,0 +1,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.ChainId||(exports.ChainId={}))[r.MAINNET=1]="MAINNET",r[r.ROPSTEN=3]="ROPSTEN",r[r.RINKEBY=4]="RINKEBY",r[r["GÖRLI"]=5]="GÖRLI",r[r.KOVAN=42]="KOVAN",r[r.POLYGON_AMOY=80002]="POLYGON_AMOY",(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=i.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function f(t,r){for(var n=0;n=0&&t<255&&Number.isInteger(t)||o(!1),this.decimals=t,this.symbol=r,this.name=n},y=function(t){function r(){var r;return(r=t.call(this,18,"ETH","Ether")||this).isEther=!0,r.isToken=!1,r}return p(r,t),r}(h);y.ETHER=new y;var v=y.ETHER,g=function(t){function r(){var r;return(r=t.call(this,18,"POL","Pol")||this).isEther=!0,r.isToken=!1,r}return p(r,t),r}(h);g.POL=new g;var x,E,N=g.POL,O=s(a),I=s(u),R=((x={})[exports.Rounding.ROUND_DOWN]=O.ROUND_DOWN,x[exports.Rounding.ROUND_HALF_UP]=O.ROUND_HALF_UP,x[exports.Rounding.ROUND_UP]=O.ROUND_UP,x),T=((E={})[exports.Rounding.ROUND_DOWN]=0,E[exports.Rounding.ROUND_HALF_UP]=1,E[exports.Rounding.ROUND_UP]=3,E),A=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),O.set({precision:t+1,rounding:R[n]});var e=new O(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),I.DP=t,I.RM=T[n],new I(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,r)},l(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}(),P=s(u),F=function(t){function r(r,n,e){var a;return a=t.call(this,n,e)||this,i.lessThanOrEqual(a.quotient,d)||o(!1),a.currency=r,a.decimalScale=i.exponentiate(i.BigInt(10),i.BigInt(r.decimals)),a}p(r,t),r.fromRawAmount=function(t,n){return new r(t,n)},r.fromFractionalAmount=function(t,n,e){return new r(t,n,e)},r.ether=function(t){return r.fromRawAmount(y.ETHER,t)},r.pol=function(t){return r.fromRawAmount(g.POL,t)};var n=r.prototype;return n.add=function(n){m(this.currency,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){m(this.currency,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:""}),P.DP=this.currency.decimals,new P(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(t)},r}(A),C=new A(i.BigInt(100));function w(t){return new U(t.numerator,t.denominator)}var _,U=function(t){function r(){var r;return(r=t.apply(this,arguments)||this).isPercent=!0,r}p(r,t);var n=r.prototype;return n.add=function(r){return w(t.prototype.add.call(this,r))},n.subtract=function(r){return w(t.prototype.subtract.call(this,r))},n.multiply=function(r){return w(t.prototype.multiply.call(this,r))},n.divide=function(r){return w(t.prototype.divide.call(this,r))},n.toSignificant=function(r,n,e){return void 0===r&&(r=5),t.prototype.multiply.call(this,C).toSignificant(r,n,e)},n.toFixed=function(r,n,e){return void 0===r&&(r=2),t.prototype.multiply.call(this,C).toFixed(r,n,e)},r}(A),D=function(t){function r(r,n,e,o){var a;return(a=t.call(this,o,e)||this).baseCurrency=r,a.quoteCurrency=n,a.scalar=new A(i.exponentiate(i.BigInt(10),i.BigInt(r.decimals)),i.exponentiate(i.BigInt(10),i.BigInt(n.decimals))),a}p(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){m(this.quoteCurrency,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){m(r.currency,this.baseCurrency)||o(!1);var n=t.prototype.multiply.call(this,r);return F.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)},l(r,[{key:"adjustedForDecimals",get:function(){return t.prototype.multiply.call(this,this.scalar)}}]),r}(A);function b(t){try{return c.getAddress(t)}catch(r){throw new Error(t+" is not a valid address.")}}var q=function(t){function r(r,n,e,i,o){var a;return(a=t.call(this,e,i,o)||this).isEther=!1,a.isToken=!0,a.chainId=r,a.address=b(n),a}p(r,t);var n=r.prototype;return n.equals=function(t){return this===t||this.chainId===t.chainId&&this.address===t.address},n.sortsBefore=function(t){return this.chainId!==t.chainId&&o(!1),this.address===t.address&&o(!1),this.address.toLowerCase()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>>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,L)||o(!1),i.lessThan(t,S))return i.BigInt(Math.floor(Math.sqrt(i.toNumber(t))));var r,n;for(r=t,n=i.add(i.divide(t,H),W);i.lessThan(n,r);)r=n,n=i.divide(i.add(i.divide(t,n),n),H);return r},exports.validateAndParseAddress=b,exports.wrappedCurrency=k,exports.wrappedCurrencyAmount=function(t,r){return F.fromFractionalAmount(k(t.currency,r),t.numerator,t.denominator)}; +//# sourceMappingURL=sdk-core.cjs.production.min.js.map diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js.map b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js.map new file mode 100644 index 00000000000..969e396b880 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sdk-core.cjs.production.min.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/pol.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\r\n\r\n// exports for external consumption\r\nexport type BigintIsh = JSBI | string | number\r\n\r\nexport enum ChainId {\r\n MAINNET = 1,\r\n ROPSTEN = 3,\r\n RINKEBY = 4,\r\n GÖRLI = 5,\r\n KOVAN = 42,\r\n POLYGON_AMOY = 80002,\r\n}\r\n\r\nexport enum TradeType {\r\n EXACT_INPUT,\r\n EXACT_OUTPUT\r\n}\r\n\r\nexport enum Rounding {\r\n ROUND_DOWN,\r\n ROUND_HALF_UP,\r\n ROUND_UP\r\n}\r\n\r\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\r\n","import { Currency } from '../entities/currency'\r\n\r\n/**\r\n * Compares two currencies for equality\r\n */\r\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\r\n if (currencyA.isToken && currencyB.isToken) {\r\n return currencyA.equals(currencyB)\r\n } else if (currencyA.isToken) {\r\n return false\r\n } else if (currencyB.isToken) {\r\n return false\r\n } else {\r\n return currencyA.isEther === currencyB.isEther\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n/**\r\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\r\n *\r\n * The only instance of the base class `Currency` is Ether.\r\n */\r\nexport abstract class BaseCurrency {\r\n public abstract readonly isEther: boolean\r\n public abstract readonly isToken: boolean\r\n\r\n public readonly decimals: number\r\n public readonly symbol?: string\r\n public readonly name?: string\r\n\r\n /**\r\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\r\n * @param decimals decimals of the currency\r\n * @param symbol symbol of the currency\r\n * @param name of the currency\r\n */\r\n protected constructor(decimals: number, symbol?: string, name?: string) {\r\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\r\n\r\n this.decimals = decimals\r\n this.symbol = symbol\r\n this.name = name\r\n }\r\n}\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Ether\r\n */\r\nexport class Ether extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'ETH', 'Ether')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Ether`.\r\n */\r\n public static readonly ETHER: Ether = new Ether()\r\n}\r\n\r\nexport const ETHER = Ether.ETHER\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Pol\r\n */\r\nexport class Pol extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'POL', 'Pol')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Pol`.\r\n */\r\n public static readonly POL: Pol = new Pol()\r\n}\r\n\r\nexport const POL = Pol.POL\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\nimport _Decimal from 'decimal.js-light'\r\nimport _Big, { RoundingMode } from 'big.js'\r\nimport toFormat from 'toformat'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\n\r\nconst Decimal = toFormat(_Decimal)\r\nconst Big = toFormat(_Big)\r\n\r\nconst toSignificantRounding = {\r\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\r\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\r\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\r\n}\r\n\r\nconst toFixedRounding = {\r\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\r\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\r\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\r\n}\r\n\r\nexport class Fraction {\r\n public readonly numerator: JSBI\r\n public readonly denominator: JSBI\r\n\r\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\r\n this.numerator = JSBI.BigInt(numerator)\r\n this.denominator = JSBI.BigInt(denominator)\r\n }\r\n\r\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\r\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\r\n return new Fraction(fractionish)\r\n\r\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\r\n throw new Error('Could not parse fraction')\r\n }\r\n\r\n // performs floor division\r\n public get quotient(): JSBI {\r\n return JSBI.divide(this.numerator, this.denominator)\r\n }\r\n\r\n // remainder after floor division\r\n public get remainder(): Fraction {\r\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\r\n }\r\n\r\n public invert(): Fraction {\r\n return new Fraction(this.denominator, this.numerator)\r\n }\r\n\r\n public add(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.add(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public subtract(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.subtract(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public lessThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.lessThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public equalTo(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.equal(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public greaterThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.greaterThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.numerator),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(this.denominator, otherParsed.numerator)\r\n )\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\r\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\r\n\r\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\r\n const quotient = new Decimal(this.numerator.toString())\r\n .div(this.denominator.toString())\r\n .toSignificantDigits(significantDigits)\r\n return quotient.toFormat(quotient.decimalPlaces(), format)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\r\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\r\n\r\n Big.DP = decimalPlaces\r\n Big.RM = toFixedRounding[rounding]\r\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\r\n }\r\n\r\n /**\r\n * Helper method for converting any super class back to a fraction\r\n */\r\n public get asFraction(): Fraction {\r\n return new Fraction(this.numerator, this.denominator)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport { Currency } from '../currency'\r\nimport { Ether } from '../ether'\r\nimport { Pol } from '../pol'\r\nimport { Fraction } from './fraction'\r\nimport _Big from 'big.js'\r\n\r\nimport toFormat from 'toformat'\r\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\r\n\r\nconst Big = toFormat(_Big)\r\n\r\nexport class CurrencyAmount extends Fraction {\r\n public readonly currency: T\r\n public readonly decimalScale: JSBI\r\n\r\n /**\r\n * Returns a new currency amount instance from the\r\n * @param currency the currency in the amount\r\n * @param rawAmount the raw token or ether amount\r\n */\r\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\r\n return new CurrencyAmount(currency, rawAmount)\r\n }\r\n\r\n /**\r\n * Construct a currency amount with a denominator that is not equal to 1\r\n * @param currency the currency\r\n * @param numerator the numerator of the fractional token amount\r\n * @param denominator the denominator of the fractional token amount\r\n */\r\n public static fromFractionalAmount(\r\n currency: T,\r\n numerator: BigintIsh,\r\n denominator: BigintIsh\r\n ): CurrencyAmount {\r\n return new CurrencyAmount(currency, numerator, denominator)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the ETHER currency\r\n * @param rawAmount ether amount in wei\r\n */\r\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the POL currency\r\n * @param rawAmount pol amount in wei\r\n */\r\n public static pol(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount)\r\n }\r\n\r\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\r\n super(numerator, denominator)\r\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\r\n this.currency = currency\r\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\r\n }\r\n\r\n public add(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const added = super.add(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\r\n }\r\n\r\n public subtract(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const subtracted = super.subtract(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\r\n const multiplied = super.multiply(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\r\n const divided = super.divide(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number = 6,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number = this.currency.decimals,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\r\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\r\n }\r\n\r\n public toExact(format: object = { groupSeparator: '' }): string {\r\n Big.DP = this.currency.decimals\r\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Fraction } from './fraction'\r\n\r\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\r\n\r\n/**\r\n * Converts a fraction to a percent\r\n * @param fraction the fraction to convert\r\n */\r\nfunction toPercent(fraction: Fraction): Percent {\r\n return new Percent(fraction.numerator, fraction.denominator)\r\n}\r\n\r\nexport class Percent extends Fraction {\r\n /**\r\n * This boolean prevents a fraction from being interpreted as a Percent\r\n */\r\n public readonly isPercent: true = true\r\n\r\n add(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.add(other))\r\n }\r\n\r\n subtract(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.subtract(other))\r\n }\r\n\r\n multiply(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.multiply(other))\r\n }\r\n\r\n divide(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.divide(other))\r\n }\r\n\r\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport invariant from 'tiny-invariant'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Currency } from '../currency'\r\nimport { Fraction } from './fraction'\r\nimport { CurrencyAmount } from './currencyAmount'\r\n\r\nexport class Price extends Fraction {\r\n public readonly baseCurrency: TBase // input i.e. denominator\r\n public readonly quoteCurrency: TQuote // output i.e. numerator\r\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\r\n\r\n // denominator and numerator _must_ be raw, i.e. in the native representation\r\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\r\n super(numerator, denominator)\r\n\r\n this.baseCurrency = baseCurrency\r\n this.quoteCurrency = quoteCurrency\r\n this.scalar = new Fraction(\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\r\n )\r\n }\r\n\r\n /**\r\n * Flip the price, switching the base and quote currency\r\n */\r\n public invert(): Price {\r\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\r\n }\r\n\r\n /**\r\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\r\n * @param other the other price\r\n */\r\n public multiply(other: Price): Price {\r\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\r\n const fraction = super.multiply(other)\r\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\r\n }\r\n\r\n /**\r\n * Return the amount of quote currency corresponding to a given amount of the base currency\r\n * @param currencyAmount the amount of base currency to quote against the price\r\n */\r\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\r\n const result = super.multiply(currencyAmount)\r\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\r\n }\r\n\r\n /**\r\n * Get the value scaled by decimals for formatting\r\n * @private\r\n */\r\n private get adjustedForDecimals(): Fraction {\r\n return super.multiply(this.scalar)\r\n }\r\n\r\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import { getAddress } from '@ethersproject/address'\r\n\r\n/**\r\n * Validates an address and returns the parsed (checksummed) version of that address\r\n * @param address the unchecksummed hex address\r\n */\r\nexport function validateAndParseAddress(address: string): string {\r\n try {\r\n return getAddress(address)\r\n } catch (error) {\r\n throw new Error(`${address} is not a valid address.`)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\r\nimport { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents an ERC20 token with a unique address and some metadata.\r\n */\r\nexport class Token extends BaseCurrency {\r\n public readonly isEther: false = false\r\n public readonly isToken: true = true\r\n\r\n public readonly chainId: ChainId | number\r\n public readonly address: string\r\n\r\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\r\n super(decimals, symbol, name)\r\n this.chainId = chainId\r\n this.address = validateAndParseAddress(address)\r\n }\r\n\r\n /**\r\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\r\n * @param other other token to compare\r\n */\r\n public equals(other: Token): boolean {\r\n // short circuit on reference equality\r\n if (this === other) {\r\n return true\r\n }\r\n return this.chainId === other.chainId && this.address === other.address\r\n }\r\n\r\n /**\r\n * Returns true if the address of this token sorts before the address of the other token\r\n * @param other other token to compare\r\n * @throws if the tokens have the same address\r\n * @throws if the tokens are on different chains\r\n */\r\n public sortsBefore(other: Token): boolean {\r\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\r\n invariant(this.address !== other.address, 'ADDRESSES')\r\n return this.address.toLowerCase() < other.address.toLowerCase()\r\n }\r\n}\r\n\r\nexport const WETH9: { [chainId in ChainId]: Token } = {\r\n [ChainId.MAINNET]: new Token(\r\n ChainId.MAINNET,\r\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.ROPSTEN]: new Token(\r\n ChainId.ROPSTEN,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.RINKEBY]: new Token(\r\n ChainId.RINKEBY,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.POLYGON_AMOY]: new Token(\r\n ChainId.POLYGON_AMOY,\r\n '0xd7a19e388c52D3580B6428F29494883A5d40C330',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n )\r\n}\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\n\r\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\r\n\r\nconst ZERO = JSBI.BigInt(0)\r\nconst ONE = JSBI.BigInt(1)\r\nconst TWO = JSBI.BigInt(2)\r\n\r\n/**\r\n * Computes floor(sqrt(value))\r\n * @param value the value for which to compute the square root, rounded down\r\n */\r\nexport function sqrt(value: JSBI): JSBI {\r\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\r\n\r\n // rely on built in sqrt if possible\r\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\r\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\r\n }\r\n\r\n let z: JSBI\r\n let x: JSBI\r\n z = value\r\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\r\n while (JSBI.lessThan(x, z)) {\r\n z = x\r\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\r\n }\r\n return z\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { Currency, Token, WETH9 } from '../entities'\r\n\r\n/**\r\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\r\n * @param currency the currency to wrap, if necessary\r\n * @param chainId the ID of the chain for wrapping\r\n */\r\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\r\n if (currency.isToken) {\r\n invariant(currency.chainId === chainId, 'CHAIN_ID')\r\n return currency\r\n }\r\n if (currency.isEther) return WETH9[chainId]\r\n throw new Error('CURRENCY')\r\n}\r\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\r\n\r\n/**\r\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\r\n * @param midPrice mid price before the trade\r\n * @param inputAmount the input amount of the trade\r\n * @param outputAmount the output amount of the trade\r\n */\r\nexport function computePriceImpact(\r\n midPrice: Price,\r\n inputAmount: CurrencyAmount,\r\n outputAmount: CurrencyAmount\r\n): Percent {\r\n const quotedOutputAmount = midPrice.quote(inputAmount)\r\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\r\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\r\n return new Percent(priceImpact.numerator, priceImpact.denominator)\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\r\n// `maxSize` by removing the last item\r\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\r\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\r\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\r\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\r\n\r\n // short circuit first item add\r\n if (items.length === 0) {\r\n items.push(add)\r\n return null\r\n } else {\r\n const isFull = items.length === maxSize\r\n // short circuit if full and the additional item does not come before the last item\r\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\r\n return add\r\n }\r\n\r\n let lo = 0,\r\n hi = items.length\r\n\r\n while (lo < hi) {\r\n const mid = (lo + hi) >>> 1\r\n if (comparator(items[mid], add) <= 0) {\r\n lo = mid + 1\r\n } else {\r\n hi = mid\r\n }\r\n }\r\n items.splice(lo, 0, add)\r\n return isFull ? items.pop()! : null\r\n }\r\n}\r\n","import { ChainId } from '../constants'\r\nimport { Currency, CurrencyAmount, Token } from '../entities'\r\nimport { wrappedCurrency } from './wrappedCurrency'\r\n\r\n/**\r\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\r\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\r\n * the input currency amount.\r\n */\r\nexport function wrappedCurrencyAmount(\r\n currencyAmount: CurrencyAmount,\r\n chainId: ChainId\r\n): CurrencyAmount {\r\n return CurrencyAmount.fromFractionalAmount(\r\n wrappedCurrency(currencyAmount.currency, chainId),\r\n currencyAmount.numerator,\r\n currencyAmount.denominator\r\n )\r\n}\r\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Pol","POL","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","this","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","_this","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","pol","added","subtracted","multiplied","divided","_Fraction","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","POLYGON_AMOY","MAX_SAFE_INTEGER","ZERO","ONE","TWO","wrappedCurrency","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","value","greaterThanOrEqual","Math","floor","sqrt","toNumber","z","x"],"mappings":"8IAKYA,EASAC,EAKAC,4KAdAF,EAAAA,kBAAAA,4CAEVA,yBACAA,yBACAA,wBACAA,sBACAA,wCAGUC,EAAAA,oBAAAA,sDAEVA,oCAGUC,EAAAA,mBAAAA,mDAEVA,qCACAA,+BAGWC,EAAaC,EAAKC,OAAO,6YCpBtBC,EAAeC,EAAqBC,UAC9CD,EAAUE,SAAWD,EAAUC,QAC1BF,EAAUG,OAAOF,IACfD,EAAUE,UAEVD,EAAUC,SAGZF,EAAUI,UAAYH,EAAUG,YCNrBC,EAcpB,SAAsBC,EAAkBC,EAAiBC,GAC7CF,GAAY,GAAKA,EAAW,KAAOG,OAAOC,UAAUJ,IAA9DK,WAEKL,SAAWA,OACXC,OAASA,OACTC,KAAOA,GCrBHI,sDASH,GAAI,MAAO,yBARa,aACC,qBAFRP,GAeFO,QAAe,IAAIA,MAG/BC,EAAQD,EAAMC,MClBdC,sDASH,GAAI,MAAO,uBARa,aACC,qBAFVT,GAeAS,MAAW,IAAIA,UAG3BC,EAAMD,EAAIC,ICfjBC,EAAUC,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xG,MAGqB,IAAjBuG,EAAMG,cACRH,EAAMI,KAAKpF,GACJ,SAEDqF,EAASL,EAAMG,SAAWF,KAE5BI,GAAUH,EAAWF,EAAMA,EAAMG,OAAS,GAAInF,IAAQ,SACjDA,UAGLsF,EAAK,EACPC,EAAKP,EAAMG,OAENG,EAAKC,GAAI,KACRC,EAAOF,EAAKC,IAAQ,EACtBL,EAAWF,EAAMQ,GAAMxF,IAAQ,EACjCsF,EAAKE,EAAM,EAEXD,EAAKC,SAGTR,EAAMS,OAAOH,EAAI,EAAGtF,GACbqF,EAASL,EAAMU,MAAS,4BHnBdC,MACThI,EAAKiI,mBAAmBD,EAAOpB,IAAzC9F,MAGId,EAAK2C,SAASqF,EAAOrB,UAChB3G,EAAKC,OAAOiI,KAAKC,MAAMD,KAAKE,KAAKpI,EAAKqI,SAASL,UAGpDM,EACAC,MACJD,EAAIN,EACJO,EAAIvI,EAAKqC,IAAIrC,EAAK8C,OAAOkF,EAAOlB,GAAMD,GAC/B7G,EAAK2C,SAAS4F,EAAGD,IACtBA,EAAIC,EACJA,EAAIvI,EAAK8C,OAAO9C,EAAKqC,IAAIrC,EAAK8C,OAAOkF,EAAOO,GAAIA,GAAIzB,UAE/CwB,sGInBP7C,EACAQ,UAEOlC,EAAeQ,qBACpBwC,EAAgBtB,EAAezB,SAAUiC,GACzCR,EAAe3D,UACf2D,EAAe1D"} \ No newline at end of file diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js b/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js new file mode 100644 index 00000000000..86ca202ba97 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js @@ -0,0 +1,723 @@ +import JSBI from 'jsbi'; +import invariant from 'tiny-invariant'; +import _Decimal from 'decimal.js-light'; +import _Big from 'big.js'; +import toFormat from 'toformat'; +import { getAddress } from '@ethersproject/address'; + +var ChainId; + +(function (ChainId) { + ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; + ChainId[ChainId["ROPSTEN"] = 3] = "ROPSTEN"; + ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY"; + ChainId[ChainId["G\xD6RLI"] = 5] = "G\xD6RLI"; + ChainId[ChainId["KOVAN"] = 42] = "KOVAN"; + ChainId[ChainId["POLYGON_AMOY"] = 80002] = "POLYGON_AMOY"; +})(ChainId || (ChainId = {})); + +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) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +/** + * Compares two currencies for equality + */ +function currencyEquals(currencyA, currencyB) { + if (currencyA.isToken && currencyB.isToken) { + return currencyA.equals(currencyB); + } else if (currencyA.isToken) { + return false; + } else if (currencyB.isToken) { + return false; + } else { + return currencyA.isEther === currencyB.isEther; + } +} + +/** + * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. + * + * The only instance of the base class `Currency` is Ether. + */ + +var BaseCurrency = +/** + * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. + * @param decimals decimals of the currency + * @param symbol symbol of the currency + * @param name of the currency + */ +function BaseCurrency(decimals, symbol, name) { + !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'DECIMALS') : invariant(false) : void 0; + this.decimals = decimals; + this.symbol = symbol; + this.name = name; +}; + +/** + * Represents the currency Ether + */ + +var Ether = /*#__PURE__*/function (_BaseCurrency) { + _inheritsLoose(Ether, _BaseCurrency); + + /** + * Only called once by this class + * @protected + */ + function Ether() { + var _this; + + _this = _BaseCurrency.call(this, 18, 'ETH', 'Ether') || this; + _this.isEther = true; + _this.isToken = false; + return _this; + } + + return Ether; +}(BaseCurrency); +/** + * The only instance of the class `Ether`. + */ + +Ether.ETHER = /*#__PURE__*/new Ether(); +var ETHER = Ether.ETHER; + +/** + * Represents the currency Pol + */ + +var Pol = /*#__PURE__*/function (_BaseCurrency) { + _inheritsLoose(Pol, _BaseCurrency); + + /** + * Only called once by this class + * @protected + */ + function Pol() { + var _this; + + _this = _BaseCurrency.call(this, 18, 'POL', 'Pol') || this; + _this.isEther = true; + _this.isToken = false; + return _this; + } + + return Pol; +}(BaseCurrency); +/** + * The only instance of the class `Pol`. + */ + +Pol.POL = /*#__PURE__*/new Pol(); +var POL = Pol.POL; + +var _toSignificantRoundin, _toFixedRounding; +var Decimal = /*#__PURE__*/toFormat(_Decimal); +var Big = /*#__PURE__*/toFormat(_Big); +var toSignificantRounding = (_toSignificantRoundin = {}, _toSignificantRoundin[Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN, _toSignificantRoundin[Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP, _toSignificantRoundin[Rounding.ROUND_UP] = Decimal.ROUND_UP, _toSignificantRoundin); +var toFixedRounding = (_toFixedRounding = {}, _toFixedRounding[Rounding.ROUND_DOWN] = 0, _toFixedRounding[Rounding.ROUND_HALF_UP] = 1, _toFixedRounding[Rounding.ROUND_UP] = 3, _toFixedRounding); +var Fraction = /*#__PURE__*/function () { + function Fraction(numerator, denominator) { + if (denominator === void 0) { + denominator = JSBI.BigInt(1); + } + + this.numerator = JSBI.BigInt(numerator); + this.denominator = JSBI.BigInt(denominator); + } + + Fraction.tryParseFraction = function tryParseFraction(fractionish) { + if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') return new Fraction(fractionish); + if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish; + throw new Error('Could not parse fraction'); + } // performs floor division + ; + + var _proto = Fraction.prototype; + + _proto.invert = function invert() { + return new Fraction(this.denominator, this.numerator); + }; + + _proto.add = function add(other) { + var otherParsed = Fraction.tryParseFraction(other); + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator); + } + + return new Fraction(JSBI.add(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.subtract = function subtract(other) { + var otherParsed = Fraction.tryParseFraction(other); + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator); + } + + return new Fraction(JSBI.subtract(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.lessThan = function lessThan(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.lessThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.equalTo = function equalTo(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.equal(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.greaterThan = function greaterThan(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.greaterThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.multiply = function multiply(other) { + var otherParsed = Fraction.tryParseFraction(other); + return new Fraction(JSBI.multiply(this.numerator, otherParsed.numerator), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.divide = function divide(other) { + var otherParsed = Fraction.tryParseFraction(other); + return new Fraction(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(this.denominator, otherParsed.numerator)); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_HALF_UP; + } + + !Number.isInteger(significantDigits) ? process.env.NODE_ENV !== "production" ? invariant(false, significantDigits + " is not an integer.") : invariant(false) : void 0; + !(significantDigits > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, significantDigits + " is not positive.") : invariant(false) : void 0; + Decimal.set({ + precision: significantDigits + 1, + rounding: toSignificantRounding[rounding] + }); + var quotient = new Decimal(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(significantDigits); + return quotient.toFormat(quotient.decimalPlaces(), format); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_HALF_UP; + } + + !Number.isInteger(decimalPlaces) ? process.env.NODE_ENV !== "production" ? invariant(false, decimalPlaces + " is not an integer.") : invariant(false) : void 0; + !(decimalPlaces >= 0) ? process.env.NODE_ENV !== "production" ? invariant(false, decimalPlaces + " is negative.") : invariant(false) : void 0; + Big.DP = decimalPlaces; + Big.RM = toFixedRounding[rounding]; + return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format); + } + /** + * Helper method for converting any super class back to a fraction + */ + ; + + _createClass(Fraction, [{ + key: "quotient", + get: function get() { + return JSBI.divide(this.numerator, this.denominator); + } // remainder after floor division + + }, { + key: "remainder", + get: function get() { + return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator); + } + }, { + key: "asFraction", + get: function get() { + return new Fraction(this.numerator, this.denominator); + } + }]); + + return Fraction; +}(); + +var Big$1 = /*#__PURE__*/toFormat(_Big); +var CurrencyAmount = /*#__PURE__*/function (_Fraction) { + _inheritsLoose(CurrencyAmount, _Fraction); + + function CurrencyAmount(currency, numerator, denominator) { + var _this; + + _this = _Fraction.call(this, numerator, denominator) || this; + !JSBI.lessThanOrEqual(_this.quotient, MaxUint256) ? process.env.NODE_ENV !== "production" ? invariant(false, 'AMOUNT') : invariant(false) : void 0; + _this.currency = currency; + _this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals)); + return _this; + } + /** + * Returns a new currency amount instance from the + * @param currency the currency in the amount + * @param rawAmount the raw token or ether amount + */ + + + CurrencyAmount.fromRawAmount = function fromRawAmount(currency, rawAmount) { + return new CurrencyAmount(currency, rawAmount); + } + /** + * Construct a currency amount with a denominator that is not equal to 1 + * @param currency the currency + * @param numerator the numerator of the fractional token amount + * @param denominator the denominator of the fractional token amount + */ + ; + + CurrencyAmount.fromFractionalAmount = function fromFractionalAmount(currency, numerator, denominator) { + return new CurrencyAmount(currency, numerator, denominator); + } + /** + * Helper that calls the constructor with the ETHER currency + * @param rawAmount ether amount in wei + */ + ; + + CurrencyAmount.ether = function ether(rawAmount) { + return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount); + } + /** + * Helper that calls the constructor with the POL currency + * @param rawAmount pol amount in wei + */ + ; + + CurrencyAmount.pol = function pol(rawAmount) { + return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount); + }; + + var _proto = CurrencyAmount.prototype; + + _proto.add = function add(other) { + !currencyEquals(this.currency, other.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CURRENCY') : invariant(false) : void 0; + + var added = _Fraction.prototype.add.call(this, other); + + return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator); + }; + + _proto.subtract = function subtract(other) { + !currencyEquals(this.currency, other.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CURRENCY') : invariant(false) : void 0; + + var subtracted = _Fraction.prototype.subtract.call(this, other); + + return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator); + }; + + _proto.multiply = function multiply(other) { + var multiplied = _Fraction.prototype.multiply.call(this, other); + + return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator); + }; + + _proto.divide = function divide(other) { + var divided = _Fraction.prototype.divide.call(this, other); + + return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 6; + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_DOWN; + } + + return _Fraction.prototype.divide.call(this, this.decimalScale).toSignificant(significantDigits, format, rounding); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = this.currency.decimals; + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_DOWN; + } + + !(decimalPlaces <= this.currency.decimals) ? process.env.NODE_ENV !== "production" ? invariant(false, 'DECIMALS') : invariant(false) : void 0; + return _Fraction.prototype.divide.call(this, this.decimalScale).toFixed(decimalPlaces, format, rounding); + }; + + _proto.toExact = function toExact(format) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + Big$1.DP = this.currency.decimals; + return new Big$1(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format); + }; + + return CurrencyAmount; +}(Fraction); + +var ONE_HUNDRED = /*#__PURE__*/new Fraction( /*#__PURE__*/JSBI.BigInt(100)); +/** + * Converts a fraction to a percent + * @param fraction the fraction to convert + */ + +function toPercent(fraction) { + return new Percent(fraction.numerator, fraction.denominator); +} + +var Percent = /*#__PURE__*/function (_Fraction) { + _inheritsLoose(Percent, _Fraction); + + function Percent() { + var _this; + + _this = _Fraction.apply(this, arguments) || this; + /** + * This boolean prevents a fraction from being interpreted as a Percent + */ + + _this.isPercent = true; + return _this; + } + + var _proto = Percent.prototype; + + _proto.add = function add(other) { + return toPercent(_Fraction.prototype.add.call(this, other)); + }; + + _proto.subtract = function subtract(other) { + return toPercent(_Fraction.prototype.subtract.call(this, other)); + }; + + _proto.multiply = function multiply(other) { + return toPercent(_Fraction.prototype.multiply.call(this, other)); + }; + + _proto.divide = function divide(other) { + return toPercent(_Fraction.prototype.divide.call(this, other)); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 5; + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 2; + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding); + }; + + return Percent; +}(Fraction); + +var Price = /*#__PURE__*/function (_Fraction) { + _inheritsLoose(Price, _Fraction); + + // denominator and numerator _must_ be raw, i.e. in the native representation + function Price(baseCurrency, quoteCurrency, denominator, numerator) { + var _this; + + _this = _Fraction.call(this, numerator, denominator) || this; + _this.baseCurrency = baseCurrency; + _this.quoteCurrency = quoteCurrency; + _this.scalar = new Fraction(JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)), JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))); + return _this; + } + /** + * Flip the price, switching the base and quote currency + */ + + + var _proto = Price.prototype; + + _proto.invert = function invert() { + return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator); + } + /** + * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency + * @param other the other price + */ + ; + + _proto.multiply = function multiply(other) { + !currencyEquals(this.quoteCurrency, other.baseCurrency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + + var fraction = _Fraction.prototype.multiply.call(this, other); + + return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator); + } + /** + * Return the amount of quote currency corresponding to a given amount of the base currency + * @param currencyAmount the amount of base currency to quote against the price + */ + ; + + _proto.quote = function quote(currencyAmount) { + !currencyEquals(currencyAmount.currency, this.baseCurrency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + + var result = _Fraction.prototype.multiply.call(this, currencyAmount); + + return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator); + } + /** + * Get the value scaled by decimals for formatting + * @private + */ + ; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 6; + } + + return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 4; + } + + return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding); + }; + + _createClass(Price, [{ + key: "adjustedForDecimals", + get: function get() { + return _Fraction.prototype.multiply.call(this, this.scalar); + } + }]); + + return Price; +}(Fraction); + +/** + * Validates an address and returns the parsed (checksummed) version of that address + * @param address the unchecksummed hex address + */ + +function validateAndParseAddress(address) { + try { + return getAddress(address); + } catch (error) { + throw new Error(address + " is not a valid address."); + } +} + +var _WETH; +/** + * Represents an ERC20 token with a unique address and some metadata. + */ + +var Token = /*#__PURE__*/function (_BaseCurrency) { + _inheritsLoose(Token, _BaseCurrency); + + function Token(chainId, address, decimals, symbol, name) { + var _this; + + _this = _BaseCurrency.call(this, decimals, symbol, name) || this; + _this.isEther = false; + _this.isToken = true; + _this.chainId = chainId; + _this.address = validateAndParseAddress(address); + return _this; + } + /** + * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. + * @param other other token to compare + */ + + + var _proto = Token.prototype; + + _proto.equals = function equals(other) { + // short circuit on reference equality + if (this === other) { + return true; + } + + return this.chainId === other.chainId && this.address === other.address; + } + /** + * Returns true if the address of this token sorts before the address of the other token + * @param other other token to compare + * @throws if the tokens have the same address + * @throws if the tokens are on different chains + */ + ; + + _proto.sortsBefore = function sortsBefore(other) { + !(this.chainId === other.chainId) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_IDS') : invariant(false) : void 0; + !(this.address !== other.address) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ADDRESSES') : invariant(false) : void 0; + return this.address.toLowerCase() < other.address.toLowerCase(); + }; + + return Token; +}(BaseCurrency); +var WETH9 = (_WETH = {}, _WETH[ChainId.MAINNET] = /*#__PURE__*/new Token(ChainId.MAINNET, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.ROPSTEN] = /*#__PURE__*/new Token(ChainId.ROPSTEN, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.RINKEBY] = /*#__PURE__*/new Token(ChainId.RINKEBY, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.GÖRLI] = /*#__PURE__*/new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.KOVAN] = /*#__PURE__*/new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.POLYGON_AMOY] = /*#__PURE__*/new Token(ChainId.POLYGON_AMOY, '0xd7a19e388c52D3580B6428F29494883A5d40C330', 18, 'WETH9', 'Wrapped Ether'), _WETH); + +/** + * Returns the percent difference between the mid price and the execution price, i.e. price impact. + * @param midPrice mid price before the trade + * @param inputAmount the input amount of the trade + * @param outputAmount the output amount of the trade + */ + +function computePriceImpact(midPrice, inputAmount, outputAmount) { + var quotedOutputAmount = midPrice.quote(inputAmount); // calculate price impact := (exactQuote - outputAmount) / exactQuote + + var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount); + return new Percent(priceImpact.numerator, priceImpact.denominator); +} + +// `maxSize` by removing the last item + +function sortedInsert(items, add, maxSize, comparator) { + !(maxSize > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_SIZE_ZERO') : invariant(false) : void 0; // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize + + !(items.length <= maxSize) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ITEMS_SIZE') : invariant(false) : void 0; // short circuit first item add + + if (items.length === 0) { + items.push(add); + return null; + } else { + var isFull = items.length === maxSize; // short circuit if full and the additional item does not come before the last item + + if (isFull && comparator(items[items.length - 1], add) <= 0) { + return add; + } + + var lo = 0, + hi = items.length; + + while (lo < hi) { + var mid = lo + hi >>> 1; + + if (comparator(items[mid], add) <= 0) { + lo = mid + 1; + } else { + hi = mid; + } + } + + items.splice(lo, 0, add); + return isFull ? items.pop() : null; + } +} + +var MAX_SAFE_INTEGER = /*#__PURE__*/JSBI.BigInt(Number.MAX_SAFE_INTEGER); +var ZERO = /*#__PURE__*/JSBI.BigInt(0); +var ONE = /*#__PURE__*/JSBI.BigInt(1); +var TWO = /*#__PURE__*/JSBI.BigInt(2); +/** + * Computes floor(sqrt(value)) + * @param value the value for which to compute the square root, rounded down + */ + +function sqrt(value) { + !JSBI.greaterThanOrEqual(value, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'NEGATIVE') : invariant(false) : void 0; // rely on built in sqrt if possible + + if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) { + return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value)))); + } + + var z; + var x; + z = value; + x = JSBI.add(JSBI.divide(value, TWO), ONE); + + while (JSBI.lessThan(x, z)) { + z = x; + x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO); + } + + return z; +} + +/** + * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token + * @param currency the currency to wrap, if necessary + * @param chainId the ID of the chain for wrapping + */ + +function wrappedCurrency(currency, chainId) { + if (currency.isToken) { + !(currency.chainId === chainId) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; + return currency; + } + + if (currency.isEther) return WETH9[chainId]; + throw new Error('CURRENCY'); +} + +/** + * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. + * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns + * the input currency amount. + */ + +function wrappedCurrencyAmount(currencyAmount, chainId) { + return CurrencyAmount.fromFractionalAmount(wrappedCurrency(currencyAmount.currency, chainId), currencyAmount.numerator, currencyAmount.denominator); +} + +export { ChainId, CurrencyAmount, ETHER, Ether, Fraction, MaxUint256, POL, Percent, Pol, Price, Rounding, Token, TradeType, WETH9, computePriceImpact, currencyEquals, sortedInsert, sqrt, validateAndParseAddress, wrappedCurrency, wrappedCurrencyAmount }; +//# sourceMappingURL=sdk-core.esm.js.map diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js.map b/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js.map new file mode 100644 index 00000000000..a55eb1a5f52 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sdk-core.esm.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/pol.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\r\n\r\n// exports for external consumption\r\nexport type BigintIsh = JSBI | string | number\r\n\r\nexport enum ChainId {\r\n MAINNET = 1,\r\n ROPSTEN = 3,\r\n RINKEBY = 4,\r\n GÖRLI = 5,\r\n KOVAN = 42,\r\n POLYGON_AMOY = 80002,\r\n}\r\n\r\nexport enum TradeType {\r\n EXACT_INPUT,\r\n EXACT_OUTPUT\r\n}\r\n\r\nexport enum Rounding {\r\n ROUND_DOWN,\r\n ROUND_HALF_UP,\r\n ROUND_UP\r\n}\r\n\r\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\r\n","import { Currency } from '../entities/currency'\r\n\r\n/**\r\n * Compares two currencies for equality\r\n */\r\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\r\n if (currencyA.isToken && currencyB.isToken) {\r\n return currencyA.equals(currencyB)\r\n } else if (currencyA.isToken) {\r\n return false\r\n } else if (currencyB.isToken) {\r\n return false\r\n } else {\r\n return currencyA.isEther === currencyB.isEther\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n/**\r\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\r\n *\r\n * The only instance of the base class `Currency` is Ether.\r\n */\r\nexport abstract class BaseCurrency {\r\n public abstract readonly isEther: boolean\r\n public abstract readonly isToken: boolean\r\n\r\n public readonly decimals: number\r\n public readonly symbol?: string\r\n public readonly name?: string\r\n\r\n /**\r\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\r\n * @param decimals decimals of the currency\r\n * @param symbol symbol of the currency\r\n * @param name of the currency\r\n */\r\n protected constructor(decimals: number, symbol?: string, name?: string) {\r\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\r\n\r\n this.decimals = decimals\r\n this.symbol = symbol\r\n this.name = name\r\n }\r\n}\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Ether\r\n */\r\nexport class Ether extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'ETH', 'Ether')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Ether`.\r\n */\r\n public static readonly ETHER: Ether = new Ether()\r\n}\r\n\r\nexport const ETHER = Ether.ETHER\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Pol\r\n */\r\nexport class Pol extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'POL', 'Pol')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Pol`.\r\n */\r\n public static readonly POL: Pol = new Pol()\r\n}\r\n\r\nexport const POL = Pol.POL\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\nimport _Decimal from 'decimal.js-light'\r\nimport _Big, { RoundingMode } from 'big.js'\r\nimport toFormat from 'toformat'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\n\r\nconst Decimal = toFormat(_Decimal)\r\nconst Big = toFormat(_Big)\r\n\r\nconst toSignificantRounding = {\r\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\r\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\r\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\r\n}\r\n\r\nconst toFixedRounding = {\r\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\r\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\r\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\r\n}\r\n\r\nexport class Fraction {\r\n public readonly numerator: JSBI\r\n public readonly denominator: JSBI\r\n\r\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\r\n this.numerator = JSBI.BigInt(numerator)\r\n this.denominator = JSBI.BigInt(denominator)\r\n }\r\n\r\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\r\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\r\n return new Fraction(fractionish)\r\n\r\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\r\n throw new Error('Could not parse fraction')\r\n }\r\n\r\n // performs floor division\r\n public get quotient(): JSBI {\r\n return JSBI.divide(this.numerator, this.denominator)\r\n }\r\n\r\n // remainder after floor division\r\n public get remainder(): Fraction {\r\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\r\n }\r\n\r\n public invert(): Fraction {\r\n return new Fraction(this.denominator, this.numerator)\r\n }\r\n\r\n public add(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.add(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public subtract(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.subtract(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public lessThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.lessThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public equalTo(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.equal(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public greaterThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.greaterThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.numerator),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(this.denominator, otherParsed.numerator)\r\n )\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\r\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\r\n\r\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\r\n const quotient = new Decimal(this.numerator.toString())\r\n .div(this.denominator.toString())\r\n .toSignificantDigits(significantDigits)\r\n return quotient.toFormat(quotient.decimalPlaces(), format)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\r\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\r\n\r\n Big.DP = decimalPlaces\r\n Big.RM = toFixedRounding[rounding]\r\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\r\n }\r\n\r\n /**\r\n * Helper method for converting any super class back to a fraction\r\n */\r\n public get asFraction(): Fraction {\r\n return new Fraction(this.numerator, this.denominator)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport { Currency } from '../currency'\r\nimport { Ether } from '../ether'\r\nimport { Pol } from '../pol'\r\nimport { Fraction } from './fraction'\r\nimport _Big from 'big.js'\r\n\r\nimport toFormat from 'toformat'\r\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\r\n\r\nconst Big = toFormat(_Big)\r\n\r\nexport class CurrencyAmount extends Fraction {\r\n public readonly currency: T\r\n public readonly decimalScale: JSBI\r\n\r\n /**\r\n * Returns a new currency amount instance from the\r\n * @param currency the currency in the amount\r\n * @param rawAmount the raw token or ether amount\r\n */\r\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\r\n return new CurrencyAmount(currency, rawAmount)\r\n }\r\n\r\n /**\r\n * Construct a currency amount with a denominator that is not equal to 1\r\n * @param currency the currency\r\n * @param numerator the numerator of the fractional token amount\r\n * @param denominator the denominator of the fractional token amount\r\n */\r\n public static fromFractionalAmount(\r\n currency: T,\r\n numerator: BigintIsh,\r\n denominator: BigintIsh\r\n ): CurrencyAmount {\r\n return new CurrencyAmount(currency, numerator, denominator)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the ETHER currency\r\n * @param rawAmount ether amount in wei\r\n */\r\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the POL currency\r\n * @param rawAmount pol amount in wei\r\n */\r\n public static pol(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount)\r\n }\r\n\r\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\r\n super(numerator, denominator)\r\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\r\n this.currency = currency\r\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\r\n }\r\n\r\n public add(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const added = super.add(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\r\n }\r\n\r\n public subtract(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const subtracted = super.subtract(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\r\n const multiplied = super.multiply(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\r\n const divided = super.divide(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number = 6,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number = this.currency.decimals,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\r\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\r\n }\r\n\r\n public toExact(format: object = { groupSeparator: '' }): string {\r\n Big.DP = this.currency.decimals\r\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Fraction } from './fraction'\r\n\r\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\r\n\r\n/**\r\n * Converts a fraction to a percent\r\n * @param fraction the fraction to convert\r\n */\r\nfunction toPercent(fraction: Fraction): Percent {\r\n return new Percent(fraction.numerator, fraction.denominator)\r\n}\r\n\r\nexport class Percent extends Fraction {\r\n /**\r\n * This boolean prevents a fraction from being interpreted as a Percent\r\n */\r\n public readonly isPercent: true = true\r\n\r\n add(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.add(other))\r\n }\r\n\r\n subtract(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.subtract(other))\r\n }\r\n\r\n multiply(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.multiply(other))\r\n }\r\n\r\n divide(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.divide(other))\r\n }\r\n\r\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport invariant from 'tiny-invariant'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Currency } from '../currency'\r\nimport { Fraction } from './fraction'\r\nimport { CurrencyAmount } from './currencyAmount'\r\n\r\nexport class Price extends Fraction {\r\n public readonly baseCurrency: TBase // input i.e. denominator\r\n public readonly quoteCurrency: TQuote // output i.e. numerator\r\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\r\n\r\n // denominator and numerator _must_ be raw, i.e. in the native representation\r\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\r\n super(numerator, denominator)\r\n\r\n this.baseCurrency = baseCurrency\r\n this.quoteCurrency = quoteCurrency\r\n this.scalar = new Fraction(\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\r\n )\r\n }\r\n\r\n /**\r\n * Flip the price, switching the base and quote currency\r\n */\r\n public invert(): Price {\r\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\r\n }\r\n\r\n /**\r\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\r\n * @param other the other price\r\n */\r\n public multiply(other: Price): Price {\r\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\r\n const fraction = super.multiply(other)\r\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\r\n }\r\n\r\n /**\r\n * Return the amount of quote currency corresponding to a given amount of the base currency\r\n * @param currencyAmount the amount of base currency to quote against the price\r\n */\r\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\r\n const result = super.multiply(currencyAmount)\r\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\r\n }\r\n\r\n /**\r\n * Get the value scaled by decimals for formatting\r\n * @private\r\n */\r\n private get adjustedForDecimals(): Fraction {\r\n return super.multiply(this.scalar)\r\n }\r\n\r\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import { getAddress } from '@ethersproject/address'\r\n\r\n/**\r\n * Validates an address and returns the parsed (checksummed) version of that address\r\n * @param address the unchecksummed hex address\r\n */\r\nexport function validateAndParseAddress(address: string): string {\r\n try {\r\n return getAddress(address)\r\n } catch (error) {\r\n throw new Error(`${address} is not a valid address.`)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\r\nimport { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents an ERC20 token with a unique address and some metadata.\r\n */\r\nexport class Token extends BaseCurrency {\r\n public readonly isEther: false = false\r\n public readonly isToken: true = true\r\n\r\n public readonly chainId: ChainId | number\r\n public readonly address: string\r\n\r\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\r\n super(decimals, symbol, name)\r\n this.chainId = chainId\r\n this.address = validateAndParseAddress(address)\r\n }\r\n\r\n /**\r\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\r\n * @param other other token to compare\r\n */\r\n public equals(other: Token): boolean {\r\n // short circuit on reference equality\r\n if (this === other) {\r\n return true\r\n }\r\n return this.chainId === other.chainId && this.address === other.address\r\n }\r\n\r\n /**\r\n * Returns true if the address of this token sorts before the address of the other token\r\n * @param other other token to compare\r\n * @throws if the tokens have the same address\r\n * @throws if the tokens are on different chains\r\n */\r\n public sortsBefore(other: Token): boolean {\r\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\r\n invariant(this.address !== other.address, 'ADDRESSES')\r\n return this.address.toLowerCase() < other.address.toLowerCase()\r\n }\r\n}\r\n\r\nexport const WETH9: { [chainId in ChainId]: Token } = {\r\n [ChainId.MAINNET]: new Token(\r\n ChainId.MAINNET,\r\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.ROPSTEN]: new Token(\r\n ChainId.ROPSTEN,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.RINKEBY]: new Token(\r\n ChainId.RINKEBY,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.POLYGON_AMOY]: new Token(\r\n ChainId.POLYGON_AMOY,\r\n '0xd7a19e388c52D3580B6428F29494883A5d40C330',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n )\r\n}\r\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\r\n\r\n/**\r\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\r\n * @param midPrice mid price before the trade\r\n * @param inputAmount the input amount of the trade\r\n * @param outputAmount the output amount of the trade\r\n */\r\nexport function computePriceImpact(\r\n midPrice: Price,\r\n inputAmount: CurrencyAmount,\r\n outputAmount: CurrencyAmount\r\n): Percent {\r\n const quotedOutputAmount = midPrice.quote(inputAmount)\r\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\r\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\r\n return new Percent(priceImpact.numerator, priceImpact.denominator)\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\r\n// `maxSize` by removing the last item\r\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\r\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\r\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\r\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\r\n\r\n // short circuit first item add\r\n if (items.length === 0) {\r\n items.push(add)\r\n return null\r\n } else {\r\n const isFull = items.length === maxSize\r\n // short circuit if full and the additional item does not come before the last item\r\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\r\n return add\r\n }\r\n\r\n let lo = 0,\r\n hi = items.length\r\n\r\n while (lo < hi) {\r\n const mid = (lo + hi) >>> 1\r\n if (comparator(items[mid], add) <= 0) {\r\n lo = mid + 1\r\n } else {\r\n hi = mid\r\n }\r\n }\r\n items.splice(lo, 0, add)\r\n return isFull ? items.pop()! : null\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\n\r\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\r\n\r\nconst ZERO = JSBI.BigInt(0)\r\nconst ONE = JSBI.BigInt(1)\r\nconst TWO = JSBI.BigInt(2)\r\n\r\n/**\r\n * Computes floor(sqrt(value))\r\n * @param value the value for which to compute the square root, rounded down\r\n */\r\nexport function sqrt(value: JSBI): JSBI {\r\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\r\n\r\n // rely on built in sqrt if possible\r\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\r\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\r\n }\r\n\r\n let z: JSBI\r\n let x: JSBI\r\n z = value\r\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\r\n while (JSBI.lessThan(x, z)) {\r\n z = x\r\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\r\n }\r\n return z\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { Currency, Token, WETH9 } from '../entities'\r\n\r\n/**\r\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\r\n * @param currency the currency to wrap, if necessary\r\n * @param chainId the ID of the chain for wrapping\r\n */\r\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\r\n if (currency.isToken) {\r\n invariant(currency.chainId === chainId, 'CHAIN_ID')\r\n return currency\r\n }\r\n if (currency.isEther) return WETH9[chainId]\r\n throw new Error('CURRENCY')\r\n}\r\n","import { ChainId } from '../constants'\r\nimport { Currency, CurrencyAmount, Token } from '../entities'\r\nimport { wrappedCurrency } from './wrappedCurrency'\r\n\r\n/**\r\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\r\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\r\n * the input currency amount.\r\n */\r\nexport function wrappedCurrencyAmount(\r\n currencyAmount: CurrencyAmount,\r\n chainId: ChainId\r\n): CurrencyAmount {\r\n return CurrencyAmount.fromFractionalAmount(\r\n wrappedCurrency(currencyAmount.currency, chainId),\r\n currencyAmount.numerator,\r\n currencyAmount.denominator\r\n )\r\n}\r\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Pol","POL","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","pol","added","subtracted","multiplied","divided","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","POLYGON_AMOY","computePriceImpact","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","sortedInsert","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","MAX_SAFE_INTEGER","ZERO","ONE","TWO","sqrt","value","greaterThanOrEqual","Math","floor","toNumber","z","x","wrappedCurrency","wrappedCurrencyAmount"],"mappings":";;;;;;;IAKYA;;AAAZ,WAAYA;AACVA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,gCAAA,aAAA;AACAA,EAAAA,8BAAA,UAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAPD,EAAYA,OAAO,KAAPA,OAAO,KAAA,CAAnB;;IASYC;;AAAZ,WAAYA;AACVA,EAAAA,uCAAA,gBAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAHD,EAAYA,SAAS,KAATA,SAAS,KAAA,CAArB;;IAKYC;;AAAZ,WAAYA;AACVA,EAAAA,oCAAA,eAAA;AACAA,EAAAA,uCAAA,kBAAA;AACAA,EAAAA,kCAAA,aAAA;AACD,CAJD,EAAYA,QAAQ,KAARA,QAAQ,KAAA,CAApB;;IAMaC,UAAU,gBAAGC,IAAI,CAACC,MAAL,CAAY,oEAAZ;;;;;;;;;;;;;;;;;;;;;;;;ACvB1B;;;AAGA,SAAgBC,eAAeC,WAAqBC;AAClD,MAAID,SAAS,CAACE,OAAV,IAAqBD,SAAS,CAACC,OAAnC,EAA4C;AAC1C,WAAOF,SAAS,CAACG,MAAV,CAAiBF,SAAjB,CAAP;AACD,GAFD,MAEO,IAAID,SAAS,CAACE,OAAd,EAAuB;AAC5B,WAAO,KAAP;AACD,GAFM,MAEA,IAAID,SAAS,CAACC,OAAd,EAAuB;AAC5B,WAAO,KAAP;AACD,GAFM,MAEA;AACL,WAAOF,SAAS,CAACI,OAAV,KAAsBH,SAAS,CAACG,OAAvC;AACD;AACF;;ACbD;;;;;;AAKA,IAAsBC,YAAtB;AAQE;;;;;;AAMA,sBAAsBC,QAAtB,EAAwCC,MAAxC,EAAyDC,IAAzD;AACE,IAAUF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,CAAT,GAAAA,SAAS,OAAT;AACA,WAAOiD,QAAP;AACD;;AACD,MAAIA,QAAQ,CAACxD,OAAb,EAAsB,OAAO0F,KAAK,CAACH,OAAD,CAAZ;AACtB,QAAM,IAAI5D,KAAJ,CAAU,UAAV,CAAN;AACD;;ACZD;;;;;;AAKA,SAAgBqG,sBACdjD,gBACAQ;AAEA,SAAOhC,cAAc,CAACO,oBAAf,CACLiE,eAAe,CAAChD,cAAc,CAACvB,QAAhB,EAA0B+B,OAA1B,CADV,EAELR,cAAc,CAACxD,SAFV,EAGLwD,cAAc,CAACvD,WAHV,CAAP;AAKD;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/sdk-core/dist/utils/computePriceImpact.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/computePriceImpact.d.ts new file mode 100644 index 00000000000..0161f44e74b --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/utils/computePriceImpact.d.ts @@ -0,0 +1,8 @@ +import { Currency, CurrencyAmount, Percent, Price } from '../entities'; +/** + * Returns the percent difference between the mid price and the execution price, i.e. price impact. + * @param midPrice mid price before the trade + * @param inputAmount the input amount of the trade + * @param outputAmount the output amount of the trade + */ +export declare function computePriceImpact(midPrice: Price, inputAmount: CurrencyAmount, outputAmount: CurrencyAmount): Percent; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/currencyEquals.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/currencyEquals.d.ts new file mode 100644 index 00000000000..f434dc5bba9 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/utils/currencyEquals.d.ts @@ -0,0 +1,5 @@ +import { Currency } from '../entities/currency'; +/** + * Compares two currencies for equality + */ +export declare function currencyEquals(currencyA: Currency, currencyB: Currency): boolean; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/index.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/index.d.ts new file mode 100644 index 00000000000..6440331c9e6 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/utils/index.d.ts @@ -0,0 +1,7 @@ +export { computePriceImpact } from './computePriceImpact'; +export { currencyEquals } from './currencyEquals'; +export { validateAndParseAddress } from './validateAndParseAddress'; +export { sortedInsert } from './sortedInsert'; +export { sqrt } from './sqrt'; +export { wrappedCurrency } from './wrappedCurrency'; +export { wrappedCurrencyAmount } from './wrappedCurrencyAmount'; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/sortedInsert.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/sortedInsert.d.ts new file mode 100644 index 00000000000..562be26f112 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/utils/sortedInsert.d.ts @@ -0,0 +1 @@ +export declare function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/sqrt.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/sqrt.d.ts new file mode 100644 index 00000000000..f1adc876d72 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/utils/sqrt.d.ts @@ -0,0 +1,7 @@ +import JSBI from 'jsbi'; +export declare const MAX_SAFE_INTEGER: JSBI; +/** + * Computes floor(sqrt(value)) + * @param value the value for which to compute the square root, rounded down + */ +export declare function sqrt(value: JSBI): JSBI; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/validateAndParseAddress.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/validateAndParseAddress.d.ts new file mode 100644 index 00000000000..98f35a8beb2 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/utils/validateAndParseAddress.d.ts @@ -0,0 +1,5 @@ +/** + * Validates an address and returns the parsed (checksummed) version of that address + * @param address the unchecksummed hex address + */ +export declare function validateAndParseAddress(address: string): string; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrency.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrency.d.ts new file mode 100644 index 00000000000..f49dfde0de1 --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrency.d.ts @@ -0,0 +1,8 @@ +import { ChainId } from '../constants'; +import { Currency, Token } from '../entities'; +/** + * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token + * @param currency the currency to wrap, if necessary + * @param chainId the ID of the chain for wrapping + */ +export declare function wrappedCurrency(currency: Currency, chainId: ChainId): Token; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts new file mode 100644 index 00000000000..4815b4560af --- /dev/null +++ b/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts @@ -0,0 +1,8 @@ +import { ChainId } from '../constants'; +import { Currency, CurrencyAmount, Token } from '../entities'; +/** + * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. + * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns + * the input currency amount. + */ +export declare function wrappedCurrencyAmount(currencyAmount: CurrencyAmount, chainId: ChainId): CurrencyAmount; diff --git a/uniswap-packages-forks/sdk-core/package.json b/uniswap-packages-forks/sdk-core/package.json new file mode 100644 index 00000000000..b6cee43afba --- /dev/null +++ b/uniswap-packages-forks/sdk-core/package.json @@ -0,0 +1,44 @@ +{ + "name": "@uniswap/sdk-core", + "license": "MIT", + "version": "3.0.0-alpha.1", + "description": "⚒️ An SDK for building applications on top of Uniswap V3", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "files": [ + "dist" + ], + "repository": "https://github.com/Uniswap/uniswap-sdk-core.git", + "keywords": [ + "uniswap", + "ethereum" + ], + "module": "dist/sdk-core.esm.js", + "scripts": { + "build": "tsdx build", + "start": "tsdx watch", + "test": "tsdx test", + "prepublishOnly": "tsdx build" + }, + "dependencies": { + "@ethersproject/address": "^5.0.2", + "big.js": "^5.2.2", + "decimal.js-light": "^2.5.0", + "jsbi": "^3.1.4", + "tiny-invariant": "^1.1.0", + "toformat": "^2.0.0" + }, + "devDependencies": { + "@types/big.js": "^4.0.5", + "@types/jest": "^24.0.25", + "tsdx": "^0.14.1" + }, + "engines": { + "node": ">=10" + }, + "prettier": { + "printWidth": 120, + "semi": false, + "singleQuote": true + } +} diff --git a/uniswap-packages-forks/v2-sdk b/uniswap-packages-forks/v2-sdk deleted file mode 160000 index a0e880df2eb..00000000000 --- a/uniswap-packages-forks/v2-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a0e880df2ebce40311740e3cc009ffb08438e704 diff --git a/uniswap-packages-forks/v2-sdk/LICENSE b/uniswap-packages-forks/v2-sdk/LICENSE new file mode 100644 index 00000000000..0c6c24ca9dd --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Uniswap Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/uniswap-packages-forks/v2-sdk/README.md b/uniswap-packages-forks/v2-sdk/README.md new file mode 100644 index 00000000000..fec6b24779d --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/README.md @@ -0,0 +1,9 @@ +# Uniswap V2 SDK + +[![Unit Tests](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3A%22Unit+Tests%22) +[![Lint](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3ALint) +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) +[![npm version](https://img.shields.io/npm/v/@uniswap/v2-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v2-sdk/v/latest) +[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v2-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v2-sdk@latest) + +In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/). diff --git a/uniswap-packages-forks/v2-sdk/dist/constants.d.ts b/uniswap-packages-forks/v2-sdk/dist/constants.d.ts new file mode 100644 index 00000000000..e56173452df --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/constants.d.ts @@ -0,0 +1,9 @@ +import JSBI from 'jsbi'; +export declare const FACTORY_ADDRESS = "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"; +export declare const INIT_CODE_HASH = "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f"; +export declare const MINIMUM_LIQUIDITY: JSBI; +export declare const ZERO: JSBI; +export declare const ONE: JSBI; +export declare const FIVE: JSBI; +export declare const _997: JSBI; +export declare const _1000: JSBI; diff --git a/uniswap-packages-forks/v2-sdk/dist/entities/index.d.ts b/uniswap-packages-forks/v2-sdk/dist/entities/index.d.ts new file mode 100644 index 00000000000..6a0392c912f --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/entities/index.d.ts @@ -0,0 +1,3 @@ +export * from './pair'; +export * from './route'; +export * from './trade'; diff --git a/uniswap-packages-forks/v2-sdk/dist/entities/pair.d.ts b/uniswap-packages-forks/v2-sdk/dist/entities/pair.d.ts new file mode 100644 index 00000000000..47862b80075 --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/entities/pair.d.ts @@ -0,0 +1,43 @@ +import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'; +export declare const computePairAddress: ({ factoryAddress, tokenA, tokenB }: { + factoryAddress: string; + tokenA: Token; + tokenB: Token; +}) => string; +export declare class Pair { + readonly liquidityToken: Token; + private readonly tokenAmounts; + static getAddress(tokenA: Token, tokenB: Token): string; + constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount); + /** + * Returns true if the token is either token0 or token1 + * @param token to check + */ + involvesToken(token: Token): boolean; + /** + * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0 + */ + get token0Price(): Price; + /** + * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1 + */ + get token1Price(): Price; + /** + * Return the price of the given token in terms of the other token in the pair. + * @param token token to return price of + */ + priceOf(token: Token): Price; + /** + * Returns the chain ID of the tokens in the pair. + */ + get chainId(): ChainId | number; + get token0(): Token; + get token1(): Token; + get reserve0(): CurrencyAmount; + get reserve1(): CurrencyAmount; + reserveOf(token: Token): CurrencyAmount; + getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair]; + getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair]; + getLiquidityMinted(totalSupply: CurrencyAmount, tokenAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount): CurrencyAmount; + getLiquidityValue(token: Token, totalSupply: CurrencyAmount, liquidity: CurrencyAmount, feeOn?: boolean, kLast?: BigintIsh): CurrencyAmount; +} diff --git a/uniswap-packages-forks/v2-sdk/dist/entities/route.d.ts b/uniswap-packages-forks/v2-sdk/dist/entities/route.d.ts new file mode 100644 index 00000000000..8dec7204919 --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/entities/route.d.ts @@ -0,0 +1,12 @@ +import { ChainId, Currency, Price, Token } from '@uniswap/sdk-core'; +import { Pair } from './pair'; +export declare class Route { + readonly pairs: Pair[]; + readonly path: Token[]; + readonly input: TInput; + readonly output: TOutput; + constructor(pairs: Pair[], input: TInput, output: TOutput); + private _midPrice; + get midPrice(): Price; + get chainId(): ChainId | number; +} diff --git a/uniswap-packages-forks/v2-sdk/dist/entities/trade.d.ts b/uniswap-packages-forks/v2-sdk/dist/entities/trade.d.ts new file mode 100644 index 00000000000..b2ea6997667 --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/entities/trade.d.ts @@ -0,0 +1,103 @@ +import { Currency, CurrencyAmount, Percent, Price, TradeType } from '@uniswap/sdk-core'; +import { Pair } from './pair'; +import { Route } from './route'; +interface InputOutput { + readonly inputAmount: CurrencyAmount; + readonly outputAmount: CurrencyAmount; +} +export declare function inputOutputComparator(a: InputOutput, b: InputOutput): number; +export declare function tradeComparator(a: Trade, b: Trade): number; +export interface BestTradeOptions { + maxNumResults?: number; + maxHops?: number; +} +/** + * Represents a trade executed against a list of pairs. + * Does not account for slippage, i.e. trades that front run this trade and move the price. + */ +export declare class Trade { + /** + * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies. + */ + readonly route: Route; + /** + * The type of the trade, either exact in or exact out. + */ + readonly tradeType: TTradeType; + /** + * The input amount for the trade assuming no slippage. + */ + readonly inputAmount: CurrencyAmount; + /** + * The output amount for the trade assuming no slippage. + */ + readonly outputAmount: CurrencyAmount; + /** + * The price expressed in terms of output amount/input amount. + */ + readonly executionPrice: Price; + /** + * The percent difference between the mid price before the trade and the trade execution price. + */ + readonly priceImpact: Percent; + /** + * Constructs an exact in trade with the given amount in and route + * @param route route of the exact in trade + * @param amountIn the amount being passed in + */ + static exactIn(route: Route, amountIn: CurrencyAmount): Trade; + /** + * Constructs an exact out trade with the given amount out and route + * @param route route of the exact out trade + * @param amountOut the amount returned by the trade + */ + static exactOut(route: Route, amountOut: CurrencyAmount): Trade; + constructor(route: Route, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount, tradeType: TTradeType); + /** + * Get the minimum amount that must be received from this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + minimumAmountOut(slippageTolerance: Percent): CurrencyAmount; + /** + * Get the maximum amount in that can be spent via this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + maximumAmountIn(slippageTolerance: Percent): CurrencyAmount; + /** + * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token + * amount to an output token, making at most `maxHops` hops. + * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pairs the pairs to consider in finding the best trade + * @param nextAmountIn exact amount of input currency to spend + * @param currencyOut the desired currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair + * @param currentPairs used in recursion; the current list of pairs + * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter + * @param bestTrades used in recursion; the current list of best trades + */ + static bestTradeExactIn(pairs: Pair[], currencyAmountIn: CurrencyAmount, currencyOut: TOutput, { maxNumResults, maxHops }?: BestTradeOptions, currentPairs?: Pair[], nextAmountIn?: CurrencyAmount, bestTrades?: Trade[]): Trade[]; + /** + * Return the execution price after accounting for slippage tolerance + * @param slippageTolerance the allowed tolerated slippage + */ + worstExecutionPrice(slippageTolerance: Percent): Price; + /** + * similar to the above method but instead targets a fixed output amount + * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token + * to an output token amount, making at most `maxHops` hops + * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pairs the pairs to consider in finding the best trade + * @param currencyIn the currency to spend + * @param nextAmountOut the exact amount of currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair + * @param currentPairs used in recursion; the current list of pairs + * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter + * @param bestTrades used in recursion; the current list of best trades + */ + static bestTradeExactOut(pairs: Pair[], currencyIn: TInput, currencyAmountOut: CurrencyAmount, { maxNumResults, maxHops }?: BestTradeOptions, currentPairs?: Pair[], nextAmountOut?: CurrencyAmount, bestTrades?: Trade[]): Trade[]; +} +export {}; diff --git a/uniswap-packages-forks/v2-sdk/dist/errors.d.ts b/uniswap-packages-forks/v2-sdk/dist/errors.d.ts new file mode 100644 index 00000000000..e08d20c800f --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/errors.d.ts @@ -0,0 +1,16 @@ +/** + * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be + * obtained by sending any amount of input. + */ +export declare class InsufficientReservesError extends Error { + readonly isInsufficientReservesError: true; + constructor(); +} +/** + * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less + * than the price of a single unit of output after fees. + */ +export declare class InsufficientInputAmountError extends Error { + readonly isInsufficientInputAmountError: true; + constructor(); +} diff --git a/uniswap-packages-forks/v2-sdk/dist/index.d.ts b/uniswap-packages-forks/v2-sdk/dist/index.d.ts new file mode 100644 index 00000000000..d9c3baf2f8a --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/index.d.ts @@ -0,0 +1,4 @@ +export { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY } from './constants'; +export * from './errors'; +export * from './entities'; +export * from './router'; diff --git a/uniswap-packages-forks/v2-sdk/dist/index.js b/uniswap-packages-forks/v2-sdk/dist/index.js new file mode 100644 index 00000000000..b9df67ce78c --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/index.js @@ -0,0 +1,8 @@ + +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./v2-sdk.cjs.production.min.js') +} else { + module.exports = require('./v2-sdk.cjs.development.js') +} diff --git a/uniswap-packages-forks/v2-sdk/dist/router.d.ts b/uniswap-packages-forks/v2-sdk/dist/router.d.ts new file mode 100644 index 00000000000..bdd3058661a --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/router.d.ts @@ -0,0 +1,64 @@ +import { Currency, Percent, TradeType } from '@uniswap/sdk-core'; +import { Trade } from 'entities'; +/** + * Options for producing the arguments to send call to the router. + */ +export interface TradeOptions { + /** + * How much the execution price is allowed to move unfavorably from the trade execution price. + */ + allowedSlippage: Percent; + /** + * How long the swap is valid until it expires, in seconds. + * This will be used to produce a `deadline` parameter which is computed from when the swap call parameters + * are generated. + */ + ttl: number; + /** + * The account that should receive the output of the swap. + */ + recipient: string; + /** + * Whether any of the tokens in the path are fee on transfer tokens, which should be handled with special methods + */ + feeOnTransfer?: boolean; +} +export interface TradeOptionsDeadline extends Omit { + /** + * When the transaction expires. + * This is an atlernate to specifying the ttl, for when you do not want to use local time. + */ + deadline: number; +} +/** + * The parameters to use in the call to the Uniswap V2 Router to execute a trade. + */ +export interface SwapParameters { + /** + * The method to call on the Uniswap V2 Router. + */ + methodName: string; + /** + * The arguments to pass to the method, all hex encoded. + */ + args: (string | string[])[]; + /** + * The amount of wei to send in hex. + */ + value: string; +} +/** + * Represents the Uniswap V2 Router, and has static methods for helping execute trades. + */ +export declare abstract class Router { + /** + * Cannot be constructed. + */ + private constructor(); + /** + * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. + * @param trade to produce call parameters for + * @param options options for the call parameters + */ + static swapCallParameters(trade: Trade, options: TradeOptions | TradeOptionsDeadline): SwapParameters; +} diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js new file mode 100644 index 00000000000..b4b836ace2f --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js @@ -0,0 +1,1260 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var JSBI = _interopDefault(require('jsbi')); +var sdkCore = require('@uniswap/sdk-core'); +var invariant = _interopDefault(require('tiny-invariant')); +var solidity = require('@ethersproject/solidity'); +var address = require('@ethersproject/address'); +var _Decimal = _interopDefault(require('decimal.js-light')); +var _Big = _interopDefault(require('big.js')); +var toFormat = _interopDefault(require('toformat')); + +var FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'; +var INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'; +var MINIMUM_LIQUIDITY = /*#__PURE__*/JSBI.BigInt(1000); // exports for internal consumption + +var ZERO = /*#__PURE__*/JSBI.BigInt(0); +var ONE = /*#__PURE__*/JSBI.BigInt(1); +var FIVE = /*#__PURE__*/JSBI.BigInt(5); +var _997 = /*#__PURE__*/JSBI.BigInt(997); +var _1000 = /*#__PURE__*/JSBI.BigInt(1000); + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} + +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); +} + +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } +} + +function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + + return _construct.apply(null, arguments); +} + +function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} + +function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + + _cache.set(Class, Wrapper); + } + + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + + return _wrapNativeSuper(Class); +} + +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; +} + +function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it; + + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + it = o[Symbol.iterator](); + return it.next.bind(it); +} + +// see https://stackoverflow.com/a/41102306 +var CAN_SET_PROTOTYPE = ('setPrototypeOf' in Object); +/** + * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be + * obtained by sending any amount of input. + */ + +var InsufficientReservesError = /*#__PURE__*/function (_Error) { + _inheritsLoose(InsufficientReservesError, _Error); + + function InsufficientReservesError() { + var _this; + + _this = _Error.call(this) || this; + _this.isInsufficientReservesError = true; + _this.name = _this.constructor.name; + if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(_assertThisInitialized(_this), (this instanceof InsufficientReservesError ? this.constructor : void 0).prototype); + return _this; + } + + return InsufficientReservesError; +}( /*#__PURE__*/_wrapNativeSuper(Error)); +/** + * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less + * than the price of a single unit of output after fees. + */ + +var InsufficientInputAmountError = /*#__PURE__*/function (_Error2) { + _inheritsLoose(InsufficientInputAmountError, _Error2); + + function InsufficientInputAmountError() { + var _this2; + + _this2 = _Error2.call(this) || this; + _this2.isInsufficientInputAmountError = true; + _this2.name = _this2.constructor.name; + if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(_assertThisInitialized(_this2), (this instanceof InsufficientInputAmountError ? this.constructor : void 0).prototype); + return _this2; + } + + return InsufficientInputAmountError; +}( /*#__PURE__*/_wrapNativeSuper(Error)); + +var computePairAddress = function computePairAddress(_ref) { + var factoryAddress = _ref.factoryAddress, + tokenA = _ref.tokenA, + tokenB = _ref.tokenB; + + var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], + token0 = _ref2[0], + token1 = _ref2[1]; // does safety checks + + + return address.getCreate2Address(factoryAddress, solidity.keccak256(['bytes'], [solidity.pack(['address', 'address'], [token0.address, token1.address])]), INIT_CODE_HASH); +}; +var Pair = /*#__PURE__*/function () { + function Pair(currencyAmountA, tokenAmountB) { + var tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks + ? [currencyAmountA, tokenAmountB] : [tokenAmountB, currencyAmountA]; + this.liquidityToken = new sdkCore.Token(tokenAmounts[0].currency.chainId, Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency), 18, 'UNI-V2', 'Uniswap V2'); + this.tokenAmounts = tokenAmounts; + } + + Pair.getAddress = function getAddress(tokenA, tokenB) { + return computePairAddress({ + factoryAddress: FACTORY_ADDRESS, + tokenA: tokenA, + tokenB: tokenB + }); + } + /** + * Returns true if the token is either token0 or token1 + * @param token to check + */ + ; + + var _proto = Pair.prototype; + + _proto.involvesToken = function involvesToken(token) { + return token.equals(this.token0) || token.equals(this.token1); + } + /** + * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0 + */ + ; + + /** + * Return the price of the given token in terms of the other token in the pair. + * @param token token to return price of + */ + _proto.priceOf = function priceOf(token) { + !this.involvesToken(token) ? invariant(false, 'TOKEN') : void 0; + return token.equals(this.token0) ? this.token0Price : this.token1Price; + } + /** + * Returns the chain ID of the tokens in the pair. + */ + ; + + _proto.reserveOf = function reserveOf(token) { + !this.involvesToken(token) ? invariant(false, 'TOKEN') : void 0; + return token.equals(this.token0) ? this.reserve0 : this.reserve1; + }; + + _proto.getOutputAmount = function getOutputAmount(inputAmount) { + !this.involvesToken(inputAmount.currency) ? invariant(false, 'TOKEN') : void 0; + + if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) { + throw new InsufficientReservesError(); + } + + var inputReserve = this.reserveOf(inputAmount.currency); + var outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0); + var inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997); + var numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient); + var denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee); + var outputAmount = sdkCore.CurrencyAmount.fromRawAmount(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0, JSBI.divide(numerator, denominator)); + + if (JSBI.equal(outputAmount.quotient, ZERO)) { + throw new InsufficientInputAmountError(); + } + + return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]; + }; + + _proto.getInputAmount = function getInputAmount(outputAmount) { + !this.involvesToken(outputAmount.currency) ? invariant(false, 'TOKEN') : void 0; + + if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO) || JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)) { + throw new InsufficientReservesError(); + } + + var outputReserve = this.reserveOf(outputAmount.currency); + var inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0); + var numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000); + var denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997); + var inputAmount = sdkCore.CurrencyAmount.fromRawAmount(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0, JSBI.add(JSBI.divide(numerator, denominator), ONE)); + return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]; + }; + + _proto.getLiquidityMinted = function getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB) { + !totalSupply.currency.equals(this.liquidityToken) ? invariant(false, 'LIQUIDITY') : void 0; + var tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks + ? [tokenAmountA, tokenAmountB] : [tokenAmountB, tokenAmountA]; + !(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1)) ? invariant(false, 'TOKEN') : void 0; + var liquidity; + + if (JSBI.equal(totalSupply.quotient, ZERO)) { + liquidity = JSBI.subtract(sdkCore.sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)), MINIMUM_LIQUIDITY); + } else { + var amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient); + var amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient); + liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1; + } + + if (!JSBI.greaterThan(liquidity, ZERO)) { + throw new InsufficientInputAmountError(); + } + + return sdkCore.CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity); + }; + + _proto.getLiquidityValue = function getLiquidityValue(token, totalSupply, liquidity, feeOn, kLast) { + if (feeOn === void 0) { + feeOn = false; + } + + !this.involvesToken(token) ? invariant(false, 'TOKEN') : void 0; + !totalSupply.currency.equals(this.liquidityToken) ? invariant(false, 'TOTAL_SUPPLY') : void 0; + !liquidity.currency.equals(this.liquidityToken) ? invariant(false, 'LIQUIDITY') : void 0; + !JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient) ? invariant(false, 'LIQUIDITY') : void 0; + var totalSupplyAdjusted; + + if (!feeOn) { + totalSupplyAdjusted = totalSupply; + } else { + !!!kLast ? invariant(false, 'K_LAST') : void 0; + var kLastParsed = JSBI.BigInt(kLast); + + if (!JSBI.equal(kLastParsed, ZERO)) { + var rootK = sdkCore.sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient)); + var rootKLast = sdkCore.sqrt(kLastParsed); + + if (JSBI.greaterThan(rootK, rootKLast)) { + var numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast)); + var denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast); + var feeLiquidity = JSBI.divide(numerator, denominator); + totalSupplyAdjusted = totalSupply.add(sdkCore.CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity)); + } else { + totalSupplyAdjusted = totalSupply; + } + } else { + totalSupplyAdjusted = totalSupply; + } + } + + return sdkCore.CurrencyAmount.fromRawAmount(token, JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)); + }; + + _createClass(Pair, [{ + key: "token0Price", + get: function get() { + var result = this.tokenAmounts[1].divide(this.tokenAmounts[0]); + return new sdkCore.Price(this.token0, this.token1, result.denominator, result.numerator); + } + /** + * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1 + */ + + }, { + key: "token1Price", + get: function get() { + var result = this.tokenAmounts[0].divide(this.tokenAmounts[1]); + return new sdkCore.Price(this.token1, this.token0, result.denominator, result.numerator); + } + }, { + key: "chainId", + get: function get() { + return this.token0.chainId; + } + }, { + key: "token0", + get: function get() { + return this.tokenAmounts[0].currency; + } + }, { + key: "token1", + get: function get() { + return this.tokenAmounts[1].currency; + } + }, { + key: "reserve0", + get: function get() { + return this.tokenAmounts[0]; + } + }, { + key: "reserve1", + get: function get() { + return this.tokenAmounts[1]; + } + }]); + + return Pair; +}(); + +var Route = /*#__PURE__*/function () { + function Route(pairs, input, output) { + this._midPrice = null; + !(pairs.length > 0) ? invariant(false, 'PAIRS') : void 0; + var chainId = pairs[0].chainId; + !pairs.every(function (pair) { + return pair.chainId === chainId; + }) ? invariant(false, 'CHAIN_IDS') : void 0; + var wrappedInput = sdkCore.wrappedCurrency(input, chainId); + !pairs[0].involvesToken(wrappedInput) ? invariant(false, 'INPUT') : void 0; + !(typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(sdkCore.wrappedCurrency(output, chainId))) ? invariant(false, 'OUTPUT') : void 0; + var path = [wrappedInput]; + + for (var _iterator = _createForOfIteratorHelperLoose(pairs.entries()), _step; !(_step = _iterator()).done;) { + var _step$value = _step.value, + i = _step$value[0], + pair = _step$value[1]; + var currentInput = path[i]; + !(currentInput.equals(pair.token0) || currentInput.equals(pair.token1)) ? invariant(false, 'PATH') : void 0; + + var _output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0; + + path.push(_output); + } + + this.pairs = pairs; + this.path = path; + this.input = input; + this.output = output; + } + + _createClass(Route, [{ + key: "midPrice", + get: function get() { + if (this._midPrice !== null) return this._midPrice; + var prices = []; + + for (var _iterator2 = _createForOfIteratorHelperLoose(this.pairs.entries()), _step2; !(_step2 = _iterator2()).done;) { + var _step2$value = _step2.value, + i = _step2$value[0], + pair = _step2$value[1]; + prices.push(this.path[i].equals(pair.token0) ? new sdkCore.Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient) : new sdkCore.Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)); + } + + var reduced = prices.slice(1).reduce(function (accumulator, currentValue) { + return accumulator.multiply(currentValue); + }, prices[0]); + return this._midPrice = new sdkCore.Price(this.input, this.output, reduced.denominator, reduced.numerator); + } + }, { + key: "chainId", + get: function get() { + return this.pairs[0].chainId; + } + }]); + + return Route; +}(); + +var ChainId; + +(function (ChainId) { + ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; + ChainId[ChainId["ROPSTEN"] = 3] = "ROPSTEN"; + ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY"; + ChainId[ChainId["G\xD6RLI"] = 5] = "G\xD6RLI"; + ChainId[ChainId["KOVAN"] = 42] = "KOVAN"; +})(ChainId || (ChainId = {})); + +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 = {})); + +function _defineProperties$1(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass$1(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$1(Constructor, staticProps); + return Constructor; +} + +function _inheritsLoose$1(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} +/** + * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. + * + * The only instance of the base class `Currency` is Ether. + */ + + +var BaseCurrency = +/** + * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. + * @param decimals decimals of the currency + * @param symbol symbol of the currency + * @param name of the currency + */ +function BaseCurrency(decimals, symbol, name) { + !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? invariant(false, 'DECIMALS') : void 0; + this.decimals = decimals; + this.symbol = symbol; + this.name = name; +}; + +var _toSignificantRoundin, _toFixedRounding; + +var Decimal = /*#__PURE__*/toFormat(_Decimal); +var Big = /*#__PURE__*/toFormat(_Big); +var toSignificantRounding = (_toSignificantRoundin = {}, _toSignificantRoundin[Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN, _toSignificantRoundin[Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP, _toSignificantRoundin[Rounding.ROUND_UP] = Decimal.ROUND_UP, _toSignificantRoundin); +var toFixedRounding = (_toFixedRounding = {}, _toFixedRounding[Rounding.ROUND_DOWN] = 0, _toFixedRounding[Rounding.ROUND_HALF_UP] = 1, _toFixedRounding[Rounding.ROUND_UP] = 3, _toFixedRounding); + +var Fraction = /*#__PURE__*/function () { + function Fraction(numerator, denominator) { + if (denominator === void 0) { + denominator = JSBI.BigInt(1); + } + + this.numerator = JSBI.BigInt(numerator); + this.denominator = JSBI.BigInt(denominator); + } + + Fraction.tryParseFraction = function tryParseFraction(fractionish) { + if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') return new Fraction(fractionish); + if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish; + throw new Error('Could not parse fraction'); + } // performs floor division + ; + + var _proto = Fraction.prototype; + + _proto.invert = function invert() { + return new Fraction(this.denominator, this.numerator); + }; + + _proto.add = function add(other) { + var otherParsed = Fraction.tryParseFraction(other); + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator); + } + + return new Fraction(JSBI.add(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.subtract = function subtract(other) { + var otherParsed = Fraction.tryParseFraction(other); + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator); + } + + return new Fraction(JSBI.subtract(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.lessThan = function lessThan(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.lessThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.equalTo = function equalTo(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.equal(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.greaterThan = function greaterThan(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.greaterThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.multiply = function multiply(other) { + var otherParsed = Fraction.tryParseFraction(other); + return new Fraction(JSBI.multiply(this.numerator, otherParsed.numerator), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.divide = function divide(other) { + var otherParsed = Fraction.tryParseFraction(other); + return new Fraction(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(this.denominator, otherParsed.numerator)); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_HALF_UP; + } + + !Number.isInteger(significantDigits) ? invariant(false, significantDigits + " is not an integer.") : void 0; + !(significantDigits > 0) ? invariant(false, significantDigits + " is not positive.") : void 0; + Decimal.set({ + precision: significantDigits + 1, + rounding: toSignificantRounding[rounding] + }); + var quotient = new Decimal(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(significantDigits); + return quotient.toFormat(quotient.decimalPlaces(), format); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_HALF_UP; + } + + !Number.isInteger(decimalPlaces) ? invariant(false, decimalPlaces + " is not an integer.") : void 0; + !(decimalPlaces >= 0) ? invariant(false, decimalPlaces + " is negative.") : void 0; + Big.DP = decimalPlaces; + Big.RM = toFixedRounding[rounding]; + return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format); + } + /** + * Helper method for converting any super class back to a fraction + */ + ; + + _createClass$1(Fraction, [{ + key: "quotient", + get: function get() { + return JSBI.divide(this.numerator, this.denominator); + } // remainder after floor division + + }, { + key: "remainder", + get: function get() { + return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator); + } + }, { + key: "asFraction", + get: function get() { + return new Fraction(this.numerator, this.denominator); + } + }]); + + return Fraction; +}(); + +var ONE_HUNDRED = /*#__PURE__*/new Fraction( /*#__PURE__*/JSBI.BigInt(100)); +/** + * Converts a fraction to a percent + * @param fraction the fraction to convert + */ + +function toPercent(fraction) { + return new Percent(fraction.numerator, fraction.denominator); +} + +var Percent = /*#__PURE__*/function (_Fraction) { + _inheritsLoose$1(Percent, _Fraction); + + function Percent() { + var _this; + + _this = _Fraction.apply(this, arguments) || this; + /** + * This boolean prevents a fraction from being interpreted as a Percent + */ + + _this.isPercent = true; + return _this; + } + + var _proto = Percent.prototype; + + _proto.add = function add(other) { + return toPercent(_Fraction.prototype.add.call(this, other)); + }; + + _proto.subtract = function subtract(other) { + return toPercent(_Fraction.prototype.subtract.call(this, other)); + }; + + _proto.multiply = function multiply(other) { + return toPercent(_Fraction.prototype.multiply.call(this, other)); + }; + + _proto.divide = function divide(other) { + return toPercent(_Fraction.prototype.divide.call(this, other)); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 5; + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 2; + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding); + }; + + return Percent; +}(Fraction); +/** + * Validates an address and returns the parsed (checksummed) version of that address + * @param address the unchecksummed hex address + */ + + +function validateAndParseAddress(address$1) { + try { + return address.getAddress(address$1); + } catch (error) { + throw new Error(address$1 + " is not a valid address."); + } +} + +var _WETH; +/** + * Represents an ERC20 token with a unique address and some metadata. + */ + + +var Token = /*#__PURE__*/function (_BaseCurrency) { + _inheritsLoose$1(Token, _BaseCurrency); + + function Token(chainId, address, decimals, symbol, name) { + var _this; + + _this = _BaseCurrency.call(this, decimals, symbol, name) || this; + _this.isEther = false; + _this.isToken = true; + _this.chainId = chainId; + _this.address = validateAndParseAddress(address); + return _this; + } + /** + * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. + * @param other other token to compare + */ + + + var _proto = Token.prototype; + + _proto.equals = function equals(other) { + // short circuit on reference equality + if (this === other) { + return true; + } + + return this.chainId === other.chainId && this.address === other.address; + } + /** + * Returns true if the address of this token sorts before the address of the other token + * @param other other token to compare + * @throws if the tokens have the same address + * @throws if the tokens are on different chains + */ + ; + + _proto.sortsBefore = function sortsBefore(other) { + !(this.chainId === other.chainId) ? invariant(false, 'CHAIN_IDS') : void 0; + !(this.address !== other.address) ? invariant(false, 'ADDRESSES') : void 0; + return this.address.toLowerCase() < other.address.toLowerCase(); + }; + + return Token; +}(BaseCurrency); + +var WETH9 = (_WETH = {}, _WETH[ChainId.MAINNET] = /*#__PURE__*/new Token(ChainId.MAINNET, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.ROPSTEN] = /*#__PURE__*/new Token(ChainId.ROPSTEN, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.RINKEBY] = /*#__PURE__*/new Token(ChainId.RINKEBY, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.GÖRLI] = /*#__PURE__*/new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.KOVAN] = /*#__PURE__*/new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'), _WETH); +/** + * Returns the percent difference between the mid price and the execution price, i.e. price impact. + * @param midPrice mid price before the trade + * @param inputAmount the input amount of the trade + * @param outputAmount the output amount of the trade + */ + +function computePriceImpact(midPrice, inputAmount, outputAmount) { + var quotedOutputAmount = midPrice.quote(inputAmount); // calculate price impact := (exactQuote - outputAmount) / exactQuote + + var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount); + return new Percent(priceImpact.numerator, priceImpact.denominator); +} // `maxSize` by removing the last item + +// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first + +function inputOutputComparator(a, b) { + // must have same input and output token for comparison + !sdkCore.currencyEquals(a.inputAmount.currency, b.inputAmount.currency) ? invariant(false, 'INPUT_CURRENCY') : void 0; + !sdkCore.currencyEquals(a.outputAmount.currency, b.outputAmount.currency) ? invariant(false, 'OUTPUT_CURRENCY') : void 0; + + if (a.outputAmount.equalTo(b.outputAmount)) { + if (a.inputAmount.equalTo(b.inputAmount)) { + return 0; + } // trade A requires less input than trade B, so A should come first + + + if (a.inputAmount.lessThan(b.inputAmount)) { + return -1; + } else { + return 1; + } + } else { + // tradeA has less output than trade B, so should come second + if (a.outputAmount.lessThan(b.outputAmount)) { + return 1; + } else { + return -1; + } + } +} // extension of the input output comparator that also considers other dimensions of the trade in ranking them + +function tradeComparator(a, b) { + var ioComp = inputOutputComparator(a, b); + + if (ioComp !== 0) { + return ioComp; + } // consider lowest slippage next, since these are less likely to fail + + + if (a.priceImpact.lessThan(b.priceImpact)) { + return -1; + } else if (a.priceImpact.greaterThan(b.priceImpact)) { + return 1; + } // finally consider the number of hops since each hop costs gas + + + return a.route.path.length - b.route.path.length; +} +/** + * Represents a trade executed against a list of pairs. + * Does not account for slippage, i.e. trades that front run this trade and move the price. + */ + +var Trade = /*#__PURE__*/function () { + function Trade(route, amount, tradeType) { + this.route = route; + this.tradeType = tradeType; + var tokenAmounts = new Array(route.path.length); + + if (tradeType === sdkCore.TradeType.EXACT_INPUT) { + !sdkCore.currencyEquals(amount.currency, route.input) ? invariant(false, 'INPUT') : void 0; + tokenAmounts[0] = sdkCore.wrappedCurrencyAmount(amount, route.chainId); + + for (var i = 0; i < route.path.length - 1; i++) { + var pair = route.pairs[i]; + + var _pair$getOutputAmount = pair.getOutputAmount(tokenAmounts[i]), + outputAmount = _pair$getOutputAmount[0]; + + tokenAmounts[i + 1] = outputAmount; + } + + this.inputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator); + this.outputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.output, tokenAmounts[tokenAmounts.length - 1].numerator, tokenAmounts[tokenAmounts.length - 1].denominator); + } else { + !sdkCore.currencyEquals(amount.currency, route.output) ? invariant(false, 'OUTPUT') : void 0; + tokenAmounts[tokenAmounts.length - 1] = sdkCore.wrappedCurrencyAmount(amount, route.chainId); + + for (var _i = route.path.length - 1; _i > 0; _i--) { + var _pair = route.pairs[_i - 1]; + + var _pair$getInputAmount = _pair.getInputAmount(tokenAmounts[_i]), + inputAmount = _pair$getInputAmount[0]; + + tokenAmounts[_i - 1] = inputAmount; + } + + this.inputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.input, tokenAmounts[0].numerator, tokenAmounts[0].denominator); + this.outputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator); + } + + this.executionPrice = new sdkCore.Price(this.inputAmount.currency, this.outputAmount.currency, this.inputAmount.quotient, this.outputAmount.quotient); + this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount); + } + /** + * Constructs an exact in trade with the given amount in and route + * @param route route of the exact in trade + * @param amountIn the amount being passed in + */ + + + Trade.exactIn = function exactIn(route, amountIn) { + return new Trade(route, amountIn, sdkCore.TradeType.EXACT_INPUT); + } + /** + * Constructs an exact out trade with the given amount out and route + * @param route route of the exact out trade + * @param amountOut the amount returned by the trade + */ + ; + + Trade.exactOut = function exactOut(route, amountOut) { + return new Trade(route, amountOut, sdkCore.TradeType.EXACT_OUTPUT); + } + /** + * Get the minimum amount that must be received from this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + ; + + var _proto = Trade.prototype; + + _proto.minimumAmountOut = function minimumAmountOut(slippageTolerance) { + !!slippageTolerance.lessThan(ZERO) ? invariant(false, 'SLIPPAGE_TOLERANCE') : void 0; + + if (this.tradeType === sdkCore.TradeType.EXACT_OUTPUT) { + return this.outputAmount; + } else { + var slippageAdjustedAmountOut = new sdkCore.Fraction(ONE).add(slippageTolerance).invert().multiply(this.outputAmount.quotient).quotient; + return sdkCore.CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut); + } + } + /** + * Get the maximum amount in that can be spent via this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + ; + + _proto.maximumAmountIn = function maximumAmountIn(slippageTolerance) { + !!slippageTolerance.lessThan(ZERO) ? invariant(false, 'SLIPPAGE_TOLERANCE') : void 0; + + if (this.tradeType === sdkCore.TradeType.EXACT_INPUT) { + return this.inputAmount; + } else { + var slippageAdjustedAmountIn = new sdkCore.Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient).quotient; + return sdkCore.CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn); + } + } + /** + * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token + * amount to an output token, making at most `maxHops` hops. + * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pairs the pairs to consider in finding the best trade + * @param nextAmountIn exact amount of input currency to spend + * @param currencyOut the desired currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair + * @param currentPairs used in recursion; the current list of pairs + * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter + * @param bestTrades used in recursion; the current list of best trades + */ + ; + + Trade.bestTradeExactIn = function bestTradeExactIn(pairs, currencyAmountIn, currencyOut, _temp, // used in recursion. + currentPairs, nextAmountIn, bestTrades) { + var _ref = _temp === void 0 ? {} : _temp, + _ref$maxNumResults = _ref.maxNumResults, + maxNumResults = _ref$maxNumResults === void 0 ? 3 : _ref$maxNumResults, + _ref$maxHops = _ref.maxHops, + maxHops = _ref$maxHops === void 0 ? 3 : _ref$maxHops; + + if (currentPairs === void 0) { + currentPairs = []; + } + + if (nextAmountIn === void 0) { + nextAmountIn = currencyAmountIn; + } + + if (bestTrades === void 0) { + bestTrades = []; + } + + !(pairs.length > 0) ? invariant(false, 'PAIRS') : void 0; + !(maxHops > 0) ? invariant(false, 'MAX_HOPS') : void 0; + !(currencyAmountIn === nextAmountIn || currentPairs.length > 0) ? invariant(false, 'INVALID_RECURSION') : void 0; + var chainId = nextAmountIn.currency.isToken ? nextAmountIn.currency.chainId : currencyOut.isToken ? currencyOut.chainId : undefined; + !(chainId !== undefined) ? invariant(false, 'CHAIN_ID') : void 0; + var amountIn = sdkCore.wrappedCurrencyAmount(nextAmountIn, chainId); + var tokenOut = sdkCore.wrappedCurrency(currencyOut, chainId); + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; // pair irrelevant + + if (!sdkCore.currencyEquals(pair.token0, amountIn.currency) && !sdkCore.currencyEquals(pair.token1, amountIn.currency)) continue; + if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue; + var amountOut = void 0; + + try { + ; + + var _pair$getOutputAmount2 = pair.getOutputAmount(amountIn); + + amountOut = _pair$getOutputAmount2[0]; + } catch (error) { + // input too low + if (error.isInsufficientInputAmountError) { + continue; + } + + throw error; + } // we have arrived at the output token, so this is the final trade of one of the paths + + + if (sdkCore.currencyEquals(amountOut.currency, tokenOut)) { + sdkCore.sortedInsert(bestTrades, new Trade(new Route([].concat(currentPairs, [pair]), currencyAmountIn.currency, currencyOut), currencyAmountIn, sdkCore.TradeType.EXACT_INPUT), maxNumResults, tradeComparator); + } else if (maxHops > 1 && pairs.length > 1) { + var pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length)); // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops + + Trade.bestTradeExactIn(pairsExcludingThisPair, currencyAmountIn, currencyOut, { + maxNumResults: maxNumResults, + maxHops: maxHops - 1 + }, [].concat(currentPairs, [pair]), amountOut, bestTrades); + } + } + + return bestTrades; + } + /** + * Return the execution price after accounting for slippage tolerance + * @param slippageTolerance the allowed tolerated slippage + */ + ; + + _proto.worstExecutionPrice = function worstExecutionPrice(slippageTolerance) { + return new sdkCore.Price(this.inputAmount.currency, this.outputAmount.currency, this.maximumAmountIn(slippageTolerance).quotient, this.minimumAmountOut(slippageTolerance).quotient); + } + /** + * similar to the above method but instead targets a fixed output amount + * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token + * to an output token amount, making at most `maxHops` hops + * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pairs the pairs to consider in finding the best trade + * @param currencyIn the currency to spend + * @param nextAmountOut the exact amount of currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair + * @param currentPairs used in recursion; the current list of pairs + * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter + * @param bestTrades used in recursion; the current list of best trades + */ + ; + + Trade.bestTradeExactOut = function bestTradeExactOut(pairs, currencyIn, currencyAmountOut, _temp2, // used in recursion. + currentPairs, nextAmountOut, bestTrades) { + var _ref2 = _temp2 === void 0 ? {} : _temp2, + _ref2$maxNumResults = _ref2.maxNumResults, + maxNumResults = _ref2$maxNumResults === void 0 ? 3 : _ref2$maxNumResults, + _ref2$maxHops = _ref2.maxHops, + maxHops = _ref2$maxHops === void 0 ? 3 : _ref2$maxHops; + + if (currentPairs === void 0) { + currentPairs = []; + } + + if (nextAmountOut === void 0) { + nextAmountOut = currencyAmountOut; + } + + if (bestTrades === void 0) { + bestTrades = []; + } + + !(pairs.length > 0) ? invariant(false, 'PAIRS') : void 0; + !(maxHops > 0) ? invariant(false, 'MAX_HOPS') : void 0; + !(currencyAmountOut === nextAmountOut || currentPairs.length > 0) ? invariant(false, 'INVALID_RECURSION') : void 0; + var chainId = nextAmountOut.currency.isToken ? nextAmountOut.currency.chainId : currencyIn.isToken ? currencyIn.chainId : undefined; + !(chainId !== undefined) ? invariant(false, 'CHAIN_ID') : void 0; + var amountOut = sdkCore.wrappedCurrencyAmount(nextAmountOut, chainId); + var tokenIn = sdkCore.wrappedCurrency(currencyIn, chainId); + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; // pair irrelevant + + if (!sdkCore.currencyEquals(pair.token0, amountOut.currency) && !sdkCore.currencyEquals(pair.token1, amountOut.currency)) continue; + if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue; + var amountIn = void 0; + + try { + ; + + var _pair$getInputAmount2 = pair.getInputAmount(amountOut); + + amountIn = _pair$getInputAmount2[0]; + } catch (error) { + // not enough liquidity in this pair + if (error.isInsufficientReservesError) { + continue; + } + + throw error; + } // we have arrived at the input token, so this is the first trade of one of the paths + + + if (sdkCore.currencyEquals(amountIn.currency, tokenIn)) { + sdkCore.sortedInsert(bestTrades, new Trade(new Route([pair].concat(currentPairs), currencyIn, currencyAmountOut.currency), currencyAmountOut, sdkCore.TradeType.EXACT_OUTPUT), maxNumResults, tradeComparator); + } else if (maxHops > 1 && pairs.length > 1) { + var pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length)); // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops + + Trade.bestTradeExactOut(pairsExcludingThisPair, currencyIn, currencyAmountOut, { + maxNumResults: maxNumResults, + maxHops: maxHops - 1 + }, [pair].concat(currentPairs), amountIn, bestTrades); + } + } + + return bestTrades; + }; + + return Trade; +}(); + +function toHex(currencyAmount) { + return "0x" + currencyAmount.quotient.toString(16); +} + +var ZERO_HEX = '0x0'; +/** + * Represents the Uniswap V2 Router, and has static methods for helping execute trades. + */ + +var Router = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function Router() {} + /** + * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. + * @param trade to produce call parameters for + * @param options options for the call parameters + */ + + + Router.swapCallParameters = function swapCallParameters(trade, options) { + var etherIn = trade.inputAmount.currency.isEther; + var etherOut = trade.outputAmount.currency.isEther; // the router does not support both ether in and out + + !!(etherIn && etherOut) ? invariant(false, 'ETHER_IN_OUT') : void 0; + !(!('ttl' in options) || options.ttl > 0) ? invariant(false, 'TTL') : void 0; + var to = sdkCore.validateAndParseAddress(options.recipient); + var amountIn = toHex(trade.maximumAmountIn(options.allowedSlippage)); + var amountOut = toHex(trade.minimumAmountOut(options.allowedSlippage)); + var path = trade.route.path.map(function (token) { + return token.address; + }); + var deadline = 'ttl' in options ? "0x" + (Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16) : "0x" + options.deadline.toString(16); + var useFeeOnTransfer = Boolean(options.feeOnTransfer); + var methodName; + var args; + var value; + + switch (trade.tradeType) { + case sdkCore.TradeType.EXACT_INPUT: + if (etherIn) { + methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'; // (uint amountOutMin, address[] calldata path, address to, uint deadline) + + args = [amountOut, path, to, deadline]; + value = amountIn; + } else if (etherOut) { + methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'; // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) + + args = [amountIn, amountOut, path, to, deadline]; + value = ZERO_HEX; + } else { + methodName = useFeeOnTransfer ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens' : 'swapExactTokensForTokens'; // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) + + args = [amountIn, amountOut, path, to, deadline]; + value = ZERO_HEX; + } + + break; + + case sdkCore.TradeType.EXACT_OUTPUT: + !!useFeeOnTransfer ? invariant(false, 'EXACT_OUT_FOT') : void 0; + + if (etherIn) { + methodName = 'swapETHForExactTokens'; // (uint amountOut, address[] calldata path, address to, uint deadline) + + args = [amountOut, path, to, deadline]; + value = amountIn; + } else if (etherOut) { + methodName = 'swapTokensForExactETH'; // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) + + args = [amountOut, amountIn, path, to, deadline]; + value = ZERO_HEX; + } else { + methodName = 'swapTokensForExactTokens'; // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) + + args = [amountOut, amountIn, path, to, deadline]; + value = ZERO_HEX; + } + + break; + } + + return { + methodName: methodName, + args: args, + value: value + }; + }; + + return Router; +}(); + +exports.FACTORY_ADDRESS = FACTORY_ADDRESS; +exports.INIT_CODE_HASH = INIT_CODE_HASH; +exports.InsufficientInputAmountError = InsufficientInputAmountError; +exports.InsufficientReservesError = InsufficientReservesError; +exports.MINIMUM_LIQUIDITY = MINIMUM_LIQUIDITY; +exports.Pair = Pair; +exports.Route = Route; +exports.Router = Router; +exports.Trade = Trade; +exports.computePairAddress = computePairAddress; +exports.inputOutputComparator = inputOutputComparator; +exports.tradeComparator = tradeComparator; +//# sourceMappingURL=v2-sdk.cjs.development.js.map diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js.map b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js.map new file mode 100644 index 00000000000..06e6bb8f6eb --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v2-sdk.cjs.development.js","sources":["../src/constants.ts","../src/errors.ts","../src/entities/pair.ts","../src/entities/route.ts","../../../sdk-core/src/constants.ts","../src/entities/trade.ts","../src/router.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\nexport const FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'\n\nexport const INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'\n\nexport const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)\n\n// exports for internal consumption\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\nexport const FIVE = JSBI.BigInt(5)\nexport const _997 = JSBI.BigInt(997)\nexport const _1000 = JSBI.BigInt(1000)\n","// see https://stackoverflow.com/a/41102306\nconst CAN_SET_PROTOTYPE = 'setPrototypeOf' in Object\n\n/**\n * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be\n * obtained by sending any amount of input.\n */\nexport class InsufficientReservesError extends Error {\n public readonly isInsufficientReservesError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\n/**\n * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less\n * than the price of a single unit of output after fees.\n */\nexport class InsufficientInputAmountError extends Error {\n public readonly isInsufficientInputAmountError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n","import { BigintIsh, ChainId, Price, sqrt, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { pack, keccak256 } from '@ethersproject/solidity'\nimport { getCreate2Address } from '@ethersproject/address'\n\nimport { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY, FIVE, _997, _1000, ONE, ZERO } from '../constants'\nimport { InsufficientReservesError, InsufficientInputAmountError } from '../errors'\n\nexport const computePairAddress = ({\n factoryAddress,\n tokenA,\n tokenB\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n}): string => {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]),\n INIT_CODE_HASH\n )\n}\nexport class Pair {\n public readonly liquidityToken: Token\n private readonly tokenAmounts: [CurrencyAmount, CurrencyAmount]\n\n public static getAddress(tokenA: Token, tokenB: Token): string {\n return computePairAddress({ factoryAddress: FACTORY_ADDRESS, tokenA, tokenB })\n }\n\n public constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount) {\n const tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [currencyAmountA, tokenAmountB]\n : [tokenAmountB, currencyAmountA]\n this.liquidityToken = new Token(\n tokenAmounts[0].currency.chainId,\n Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency),\n 18,\n 'UNI-V2',\n 'Uniswap V2'\n )\n this.tokenAmounts = tokenAmounts as [CurrencyAmount, CurrencyAmount]\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0\n */\n public get token0Price(): Price {\n const result = this.tokenAmounts[1].divide(this.tokenAmounts[0])\n return new Price(this.token0, this.token1, result.denominator, result.numerator)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1\n */\n public get token1Price(): Price {\n const result = this.tokenAmounts[0].divide(this.tokenAmounts[1])\n return new Price(this.token1, this.token0, result.denominator, result.numerator)\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pair.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pair.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n public get token0(): Token {\n return this.tokenAmounts[0].currency\n }\n\n public get token1(): Token {\n return this.tokenAmounts[1].currency\n }\n\n public get reserve0(): CurrencyAmount {\n return this.tokenAmounts[0]\n }\n\n public get reserve1(): CurrencyAmount {\n return this.tokenAmounts[1]\n }\n\n public reserveOf(token: Token): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.reserve0 : this.reserve1\n }\n\n public getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) {\n throw new InsufficientReservesError()\n }\n const inputReserve = this.reserveOf(inputAmount.currency)\n const outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997)\n const numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient)\n const denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee)\n const outputAmount = CurrencyAmount.fromRawAmount(\n inputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.divide(numerator, denominator)\n )\n if (JSBI.equal(outputAmount.quotient, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(outputAmount.currency), 'TOKEN')\n if (\n JSBI.equal(this.reserve0.quotient, ZERO) ||\n JSBI.equal(this.reserve1.quotient, ZERO) ||\n JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)\n ) {\n throw new InsufficientReservesError()\n }\n\n const outputReserve = this.reserveOf(outputAmount.currency)\n const inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000)\n const denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997)\n const inputAmount = CurrencyAmount.fromRawAmount(\n outputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.add(JSBI.divide(numerator, denominator), ONE)\n )\n return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getLiquidityMinted(\n totalSupply: CurrencyAmount,\n tokenAmountA: CurrencyAmount,\n tokenAmountB: CurrencyAmount\n ): CurrencyAmount {\n invariant(totalSupply.currency.equals(this.liquidityToken), 'LIQUIDITY')\n const tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [tokenAmountA, tokenAmountB]\n : [tokenAmountB, tokenAmountA]\n invariant(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1), 'TOKEN')\n\n let liquidity: JSBI\n if (JSBI.equal(totalSupply.quotient, ZERO)) {\n liquidity = JSBI.subtract(\n sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)),\n MINIMUM_LIQUIDITY\n )\n } else {\n const amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient)\n const amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient)\n liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1\n }\n if (!JSBI.greaterThan(liquidity, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity)\n }\n\n public getLiquidityValue(\n token: Token,\n totalSupply: CurrencyAmount,\n liquidity: CurrencyAmount,\n feeOn: boolean = false,\n kLast?: BigintIsh\n ): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n invariant(totalSupply.currency.equals(this.liquidityToken), 'TOTAL_SUPPLY')\n invariant(liquidity.currency.equals(this.liquidityToken), 'LIQUIDITY')\n invariant(JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient), 'LIQUIDITY')\n\n let totalSupplyAdjusted: CurrencyAmount\n if (!feeOn) {\n totalSupplyAdjusted = totalSupply\n } else {\n invariant(!!kLast, 'K_LAST')\n const kLastParsed = JSBI.BigInt(kLast)\n if (!JSBI.equal(kLastParsed, ZERO)) {\n const rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient))\n const rootKLast = sqrt(kLastParsed)\n if (JSBI.greaterThan(rootK, rootKLast)) {\n const numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast))\n const denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast)\n const feeLiquidity = JSBI.divide(numerator, denominator)\n totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity))\n } else {\n totalSupplyAdjusted = totalSupply\n }\n } else {\n totalSupplyAdjusted = totalSupply\n }\n }\n\n return CurrencyAmount.fromRawAmount(\n token,\n JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)\n )\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\n\nimport { Pair } from './pair'\n\nexport class Route {\n public readonly pairs: Pair[]\n public readonly path: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n public constructor(pairs: Pair[], input: TInput, output: TOutput) {\n invariant(pairs.length > 0, 'PAIRS')\n const chainId: ChainId | number = pairs[0].chainId\n invariant(\n pairs.every(pair => pair.chainId === chainId),\n 'CHAIN_IDS'\n )\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pairs[0].involvesToken(wrappedInput), 'INPUT')\n invariant(\n typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(wrappedCurrency(output, chainId)),\n 'OUTPUT'\n )\n\n const path: Token[] = [wrappedInput]\n for (const [i, pair] of pairs.entries()) {\n const currentInput = path[i]\n invariant(currentInput.equals(pair.token0) || currentInput.equals(pair.token1), 'PATH')\n const output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0\n path.push(output)\n }\n\n this.pairs = pairs\n this.path = path\n this.input = input\n this.output = output\n }\n\n private _midPrice: Price | null = null\n\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n const prices: Price[] = []\n for (const [i, pair] of this.pairs.entries()) {\n prices.push(\n this.path[i].equals(pair.token0)\n ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient)\n : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)\n )\n }\n const reduced = prices.slice(1).reduce((accumulator, currentValue) => accumulator.multiply(currentValue), prices[0])\n return (this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator))\n }\n\n public get chainId(): ChainId | number {\n return this.pairs[0].chainId\n }\n}\n","import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import {\n ChainId,\n Currency,\n CurrencyAmount,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n wrappedCurrency,\n TradeType,\n wrappedCurrencyAmount\n} from '@uniswap/sdk-core'\nimport { computePriceImpact, Token } from '../../../../sdk-core'\nimport { ONE, ZERO } from '../constants'\nimport invariant from 'tiny-invariant'\n\nimport { Pair } from './pair'\nimport { Route } from './route'\n\n// minimal interface so the input output comparator may be shared across types\ninterface InputOutput {\n readonly inputAmount: CurrencyAmount\n readonly outputAmount: CurrencyAmount\n}\n\n// comparator function that allows sorting trades by their output amounts, in decreasing order, and then input amounts\n// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first\nexport function inputOutputComparator(\n a: InputOutput,\n b: InputOutput\n): number {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n return 0\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n const ioComp = inputOutputComparator(a, b)\n if (ioComp !== 0) {\n return ioComp\n }\n\n // consider lowest slippage next, since these are less likely to fail\n if (a.priceImpact.lessThan(b.priceImpact)) {\n return -1\n } else if (a.priceImpact.greaterThan(b.priceImpact)) {\n return 1\n }\n\n // finally consider the number of hops since each hop costs gas\n return a.route.path.length - b.route.path.length\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pairs.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public readonly executionPrice: Price\n /**\n * The percent difference between the mid price before the trade and the trade execution price.\n */\n public readonly priceImpact: Percent\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Trade {\n return new Trade(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Trade {\n return new Trade(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n public constructor(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ) {\n this.route = route\n this.tradeType = tradeType\n\n const tokenAmounts: CurrencyAmount[] = new Array(route.path.length)\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n tokenAmounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.path.length - 1; i++) {\n const pair = route.pairs[i]\n const [outputAmount] = pair.getOutputAmount(tokenAmounts[i])\n tokenAmounts[i + 1] = outputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n this.outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n tokenAmounts[tokenAmounts.length - 1].numerator,\n tokenAmounts[tokenAmounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n tokenAmounts[tokenAmounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.path.length - 1; i > 0; i--) {\n const pair = route.pairs[i - 1]\n const [inputAmount] = pair.getInputAmount(tokenAmounts[i])\n tokenAmounts[i - 1] = inputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(\n route.input,\n tokenAmounts[0].numerator,\n tokenAmounts[0].denominator\n )\n this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n this.executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n )\n this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount)\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactIn(\n pairs: Pair[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountIn.currency) && !currencyEquals(pair.token1, amountIn.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = pair.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (currencyEquals(amountOut.currency, tokenOut)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([...currentPairs, pair], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n Trade.bestTradeExactIn(\n pairsExcludingThisPair,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPairs, pair],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactOut(\n pairs: Pair[],\n currencyIn: TInput,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? (currencyIn as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountOut.currency) && !currencyEquals(pair.token1, amountOut.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = pair.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pair\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([pair, ...currentPairs], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n Trade.bestTradeExactOut(\n pairsExcludingThisPair,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pair, ...currentPairs],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { Currency, CurrencyAmount, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport { Trade } from 'entities'\nimport invariant from 'tiny-invariant'\nimport { Token } from '../../../sdk-core'\n\n/**\n * Options for producing the arguments to send call to the router.\n */\nexport interface TradeOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n allowedSlippage: Percent\n /**\n * How long the swap is valid until it expires, in seconds.\n * This will be used to produce a `deadline` parameter which is computed from when the swap call parameters\n * are generated.\n */\n ttl: number\n /**\n * The account that should receive the output of the swap.\n */\n recipient: string\n\n /**\n * Whether any of the tokens in the path are fee on transfer tokens, which should be handled with special methods\n */\n feeOnTransfer?: boolean\n}\n\nexport interface TradeOptionsDeadline extends Omit {\n /**\n * When the transaction expires.\n * This is an atlernate to specifying the ttl, for when you do not want to use local time.\n */\n deadline: number\n}\n\n/**\n * The parameters to use in the call to the Uniswap V2 Router to execute a trade.\n */\nexport interface SwapParameters {\n /**\n * The method to call on the Uniswap V2 Router.\n */\n methodName: string\n /**\n * The arguments to pass to the method, all hex encoded.\n */\n args: (string | string[])[]\n /**\n * The amount of wei to send in hex.\n */\n value: string\n}\n\nfunction toHex(currencyAmount: CurrencyAmount) {\n return `0x${currencyAmount.quotient.toString(16)}`\n}\n\nconst ZERO_HEX = '0x0'\n\n/**\n * Represents the Uniswap V2 Router, and has static methods for helping execute trades.\n */\nexport abstract class Router {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: TradeOptions | TradeOptionsDeadline\n ): SwapParameters {\n const etherIn = trade.inputAmount.currency.isEther\n const etherOut = trade.outputAmount.currency.isEther\n // the router does not support both ether in and out\n invariant(!(etherIn && etherOut), 'ETHER_IN_OUT')\n invariant(!('ttl' in options) || options.ttl > 0, 'TTL')\n\n const to: string = validateAndParseAddress(options.recipient)\n const amountIn: string = toHex(trade.maximumAmountIn(options.allowedSlippage))\n const amountOut: string = toHex(trade.minimumAmountOut(options.allowedSlippage))\n const path: string[] = trade.route.path.map((token: Token) => token.address)\n const deadline =\n 'ttl' in options\n ? `0x${(Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16)}`\n : `0x${options.deadline.toString(16)}`\n\n const useFeeOnTransfer = Boolean(options.feeOnTransfer)\n\n let methodName: string\n let args: (string | string[])[]\n let value: string\n switch (trade.tradeType) {\n case TradeType.EXACT_INPUT:\n if (etherIn) {\n methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'\n // (uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = useFeeOnTransfer\n ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens'\n : 'swapExactTokensForTokens'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n }\n break\n case TradeType.EXACT_OUTPUT:\n invariant(!useFeeOnTransfer, 'EXACT_OUT_FOT')\n if (etherIn) {\n methodName = 'swapETHForExactTokens'\n // (uint amountOut, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = 'swapTokensForExactETH'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = 'swapTokensForExactTokens'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n }\n break\n }\n return {\n methodName,\n args,\n value\n }\n }\n}\n"],"names":["FACTORY_ADDRESS","INIT_CODE_HASH","MINIMUM_LIQUIDITY","JSBI","BigInt","ZERO","ONE","FIVE","_997","_1000","CAN_SET_PROTOTYPE","Object","InsufficientReservesError","name","constructor","setPrototypeOf","prototype","Error","InsufficientInputAmountError","computePairAddress","factoryAddress","tokenA","tokenB","sortsBefore","token0","token1","getCreate2Address","keccak256","pack","address","Pair","currencyAmountA","tokenAmountB","tokenAmounts","currency","liquidityToken","Token","chainId","getAddress","involvesToken","token","equals","priceOf","invariant","token0Price","token1Price","reserveOf","reserve0","reserve1","getOutputAmount","inputAmount","equal","quotient","inputReserve","outputReserve","inputAmountWithFee","multiply","numerator","denominator","add","outputAmount","CurrencyAmount","fromRawAmount","divide","subtract","getInputAmount","greaterThanOrEqual","getLiquidityMinted","totalSupply","tokenAmountA","liquidity","sqrt","amount0","amount1","lessThanOrEqual","greaterThan","getLiquidityValue","feeOn","kLast","totalSupplyAdjusted","kLastParsed","rootK","rootKLast","feeLiquidity","result","Price","Route","pairs","input","output","length","every","pair","wrappedInput","wrappedCurrency","path","entries","i","currentInput","push","_midPrice","prices","reduced","slice","reduce","accumulator","currentValue","ChainId","TradeType","inputOutputComparator","a","b","currencyEquals","equalTo","lessThan","tradeComparator","ioComp","priceImpact","route","Trade","amount","tradeType","Array","EXACT_INPUT","wrappedCurrencyAmount","fromFractionalAmount","executionPrice","computePriceImpact","midPrice","exactIn","amountIn","exactOut","amountOut","EXACT_OUTPUT","minimumAmountOut","slippageTolerance","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","bestTradeExactIn","currencyAmountIn","currencyOut","currentPairs","nextAmountIn","bestTrades","maxNumResults","maxHops","isToken","undefined","tokenOut","error","isInsufficientInputAmountError","sortedInsert","pairsExcludingThisPair","concat","worstExecutionPrice","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","toHex","currencyAmount","toString","ZERO_HEX","Router","swapCallParameters","trade","options","etherIn","isEther","etherOut","ttl","to","validateAndParseAddress","recipient","allowedSlippage","map","deadline","Math","floor","Date","getTime","useFeeOnTransfer","Boolean","feeOnTransfer","methodName","args","value"],"mappings":";;;;;;;;;;;;;;;IAEaA,eAAe,GAAG;IAElBC,cAAc,GAAG;IAEjBC,iBAAiB,gBAAGC,IAAI,CAACC,MAAL,CAAY,IAAZ;;AAG1B,IAAMC,IAAI,gBAAGF,IAAI,CAACC,MAAL,CAAY,CAAZ,CAAb;AACA,IAAME,GAAG,gBAAGH,IAAI,CAACC,MAAL,CAAY,CAAZ,CAAZ;AACA,IAAMG,IAAI,gBAAGJ,IAAI,CAACC,MAAL,CAAY,CAAZ,CAAb;AACA,IAAMI,IAAI,gBAAGL,IAAI,CAACC,MAAL,CAAY,GAAZ,CAAb;AACA,IAAMK,KAAK,gBAAGN,IAAI,CAACC,MAAL,CAAY,IAAZ,CAAd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,GAAG,CAAC1D,SAAD,EAAYrC,IAAZ,EAAkBiF,EAAlB,EAAsBK,QAAtB,CAAP;AACAU,UAAAA,KAAK,GAAG7D,QAAR;AACD,SALD,MAKO,IAAI4C,QAAJ,EAAc;AACnBe,UAAAA,UAAU,GAAG,uBAAb,CADmB;;AAGnBC,UAAAA,IAAI,GAAG,CAAC1D,SAAD,EAAYF,QAAZ,EAAsBnC,IAAtB,EAA4BiF,EAA5B,EAAgCK,QAAhC,CAAP;AACAU,UAAAA,KAAK,GAAGxB,QAAR;AACD,SALM,MAKA;AACLsB,UAAAA,UAAU,GAAG,0BAAb,CADK;;AAGLC,UAAAA,IAAI,GAAG,CAAC1D,SAAD,EAAYF,QAAZ,EAAsBnC,IAAtB,EAA4BiF,EAA5B,EAAgCK,QAAhC,CAAP;AACAU,UAAAA,KAAK,GAAGxB,QAAR;AACD;;AACD;AAvCJ;;AAyCA,WAAO;AACLsB,MAAAA,UAAU,EAAVA,UADK;AAELC,MAAAA,IAAI,EAAJA,IAFK;AAGLC,MAAAA,KAAK,EAALA;AAHK,KAAP;AAKD,GAhFH;;AAAA;AAAA;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js new file mode 100644 index 00000000000..2412c860d5b --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js @@ -0,0 +1,2 @@ +"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("jsbi")),r=require("@uniswap/sdk-core"),n=t(require("tiny-invariant")),o=require("@ethersproject/solidity"),i=require("@ethersproject/address"),u=t(require("decimal.js-light")),a=t(require("big.js")),s=t(require("toformat")),c="0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",p=e.BigInt(1e3),l=e.BigInt(0),d=e.BigInt(1),m=e.BigInt(5),h=e.BigInt(997),f=e.BigInt(1e3);function y(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)}var b,P,x,_="setPrototypeOf"in Object,N=function(t){function e(){var r;return(r=t.call(this)||this).isInsufficientReservesError=!0,r.name=r.constructor.name,_&&Object.setPrototypeOf(E(r),(this instanceof e?this.constructor:void 0).prototype),r}return T(e,t),e}(w(Error)),R=function(t){function e(){var r;return(r=t.call(this)||this).isInsufficientInputAmountError=!0,r.name=r.constructor.name,_&&Object.setPrototypeOf(E(r),(this instanceof e?this.constructor:void 0).prototype),r}return T(e,t),e}(w(Error)),C=function(t){var e=t.factoryAddress,r=t.tokenA,n=t.tokenB,u=r.sortsBefore(n)?[r,n]:[n,r];return i.getCreate2Address(e,o.keccak256(["bytes"],[o.pack(["address","address"],[u[0].address,u[1].address])]),c)},U=function(){function t(e,n){var o=e.currency.sortsBefore(n.currency)?[e,n]:[n,e];this.liquidityToken=new r.Token(o[0].currency.chainId,t.getAddress(o[0].currency,o[1].currency),18,"UNI-V2","Uniswap V2"),this.tokenAmounts=o}t.getAddress=function(t,e){return C({factoryAddress:"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",tokenA:t,tokenB:e})};var o=t.prototype;return o.involvesToken=function(t){return t.equals(this.token0)||t.equals(this.token1)},o.priceOf=function(t){return this.involvesToken(t)||n(!1),t.equals(this.token0)?this.token0Price:this.token1Price},o.reserveOf=function(t){return this.involvesToken(t)||n(!1),t.equals(this.token0)?this.reserve0:this.reserve1},o.getOutputAmount=function(o){if(this.involvesToken(o.currency)||n(!1),e.equal(this.reserve0.quotient,l)||e.equal(this.reserve1.quotient,l))throw new N;var i=this.reserveOf(o.currency),u=this.reserveOf(o.currency.equals(this.token0)?this.token1:this.token0),a=e.multiply(o.quotient,h),s=e.multiply(a,u.quotient),c=e.add(e.multiply(i.quotient,f),a),p=r.CurrencyAmount.fromRawAmount(o.currency.equals(this.token0)?this.token1:this.token0,e.divide(s,c));if(e.equal(p.quotient,l))throw new R;return[p,new t(i.add(o),u.subtract(p))]},o.getInputAmount=function(o){if(this.involvesToken(o.currency)||n(!1),e.equal(this.reserve0.quotient,l)||e.equal(this.reserve1.quotient,l)||e.greaterThanOrEqual(o.quotient,this.reserveOf(o.currency).quotient))throw new N;var i=this.reserveOf(o.currency),u=this.reserveOf(o.currency.equals(this.token0)?this.token1:this.token0),a=e.multiply(e.multiply(u.quotient,o.quotient),f),s=e.multiply(e.subtract(i.quotient,o.quotient),h),c=r.CurrencyAmount.fromRawAmount(o.currency.equals(this.token0)?this.token1:this.token0,e.add(e.divide(a,s),d));return[c,new t(u.add(c),i.subtract(o))]},o.getLiquidityMinted=function(t,o,i){t.currency.equals(this.liquidityToken)||n(!1);var u,a=o.currency.sortsBefore(i.currency)?[o,i]:[i,o];if(a[0].currency.equals(this.token0)&&a[1].currency.equals(this.token1)||n(!1),e.equal(t.quotient,l))u=e.subtract(r.sqrt(e.multiply(a[0].quotient,a[1].quotient)),p);else{var s=e.divide(e.multiply(a[0].quotient,t.quotient),this.reserve0.quotient),c=e.divide(e.multiply(a[1].quotient,t.quotient),this.reserve1.quotient);u=e.lessThanOrEqual(s,c)?s:c}if(!e.greaterThan(u,l))throw new R;return r.CurrencyAmount.fromRawAmount(this.liquidityToken,u)},o.getLiquidityValue=function(t,o,i,u,a){var s;if(void 0===u&&(u=!1),this.involvesToken(t)||n(!1),o.currency.equals(this.liquidityToken)||n(!1),i.currency.equals(this.liquidityToken)||n(!1),e.lessThanOrEqual(i.quotient,o.quotient)||n(!1),u){a||n(!1);var c=e.BigInt(a);if(e.equal(c,l))s=o;else{var p=r.sqrt(e.multiply(this.reserve0.quotient,this.reserve1.quotient)),d=r.sqrt(c);if(e.greaterThan(p,d)){var h=e.multiply(o.quotient,e.subtract(p,d)),f=e.add(e.multiply(p,m),d),y=e.divide(h,f);s=o.add(r.CurrencyAmount.fromRawAmount(this.liquidityToken,y))}else s=o}}else s=o;return r.CurrencyAmount.fromRawAmount(t,e.divide(e.multiply(i.quotient,this.reserveOf(t).quotient),s.quotient))},v(t,[{key:"token0Price",get:function(){var t=this.tokenAmounts[1].divide(this.tokenAmounts[0]);return new r.Price(this.token0,this.token1,t.denominator,t.numerator)}},{key:"token1Price",get:function(){var t=this.tokenAmounts[0].divide(this.tokenAmounts[1]);return new r.Price(this.token1,this.token0,t.denominator,t.numerator)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"token0",get:function(){return this.tokenAmounts[0].currency}},{key:"token1",get:function(){return this.tokenAmounts[1].currency}},{key:"reserve0",get:function(){return this.tokenAmounts[0]}},{key:"reserve1",get:function(){return this.tokenAmounts[1]}}]),t}(),F=function(){function t(t,e,o){this._midPrice=null,t.length>0||n(!1);var i=t[0].chainId;t.every((function(t){return t.chainId===i}))||n(!1);var u=r.wrappedCurrency(e,i);t[0].involvesToken(u)||n(!1),void 0===o||t[t.length-1].involvesToken(r.wrappedCurrency(o,i))||n(!1);for(var a,s=[u],c=O(t.entries());!(a=c()).done;){var p=a.value,l=p[1],d=s[p[0]];d.equals(l.token0)||d.equals(l.token1)||n(!1);var m=d.equals(l.token0)?l.token1:l.token0;s.push(m)}this.pairs=t,this.path=s,this.input=e,this.output=o}return v(t,[{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;for(var t,e=[],n=O(this.pairs.entries());!(t=n()).done;){var o=t.value,i=o[1];e.push(this.path[o[0]].equals(i.token0)?new r.Price(i.reserve0.currency,i.reserve1.currency,i.reserve0.quotient,i.reserve1.quotient):new r.Price(i.reserve1.currency,i.reserve0.currency,i.reserve1.quotient,i.reserve0.quotient))}var u=e.slice(1).reduce((function(t,e){return t.multiply(e)}),e[0]);return this._midPrice=new r.Price(this.input,this.output,u.denominator,u.numerator)}},{key:"chainId",get:function(){return this.pairs[0].chainId}}]),t}();function D(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}!function(t){t[t.MAINNET=1]="MAINNET",t[t.ROPSTEN=3]="ROPSTEN",t[t.RINKEBY=4]="RINKEBY",t[t["GÖRLI"]=5]="GÖRLI",t[t.KOVAN=42]="KOVAN"}(b||(b={})),function(t){t[t.EXACT_INPUT=0]="EXACT_INPUT",t[t.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(P||(P={})),function(t){t[t.ROUND_DOWN=0]="ROUND_DOWN",t[t.ROUND_HALF_UP=1]="ROUND_HALF_UP",t[t.ROUND_UP=2]="ROUND_UP"}(x||(x={}));var S,B,H=function(t,e,r){t>=0&&t<255&&Number.isInteger(t)||n(!1),this.decimals=t,this.symbol=e,this.name=r},j=s(u),L=s(a),W=((S={})[x.ROUND_DOWN]=j.ROUND_DOWN,S[x.ROUND_HALF_UP]=j.ROUND_HALF_UP,S[x.ROUND_UP]=j.ROUND_UP,S),M=((B={})[x.ROUND_DOWN]=0,B[x.ROUND_HALF_UP]=1,B[x.ROUND_UP]=3,B),X=function(){function t(t,r){void 0===r&&(r=e.BigInt(1)),this.numerator=e.BigInt(t),this.denominator=e.BigInt(r)}t.tryParseFraction=function(r){if(r instanceof e||"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,o=t.prototype;return o.invert=function(){return new t(this.denominator,this.numerator)},o.add=function(r){var n=t.tryParseFraction(r);return e.equal(this.denominator,n.denominator)?new t(e.add(this.numerator,n.numerator),this.denominator):new t(e.add(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator)),e.multiply(this.denominator,n.denominator))},o.subtract=function(r){var n=t.tryParseFraction(r);return e.equal(this.denominator,n.denominator)?new t(e.subtract(this.numerator,n.numerator),this.denominator):new t(e.subtract(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator)),e.multiply(this.denominator,n.denominator))},o.lessThan=function(r){var n=t.tryParseFraction(r);return e.lessThan(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator))},o.equalTo=function(r){var n=t.tryParseFraction(r);return e.equal(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator))},o.greaterThan=function(r){var n=t.tryParseFraction(r);return e.greaterThan(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator))},o.multiply=function(r){var n=t.tryParseFraction(r);return new t(e.multiply(this.numerator,n.numerator),e.multiply(this.denominator,n.denominator))},o.divide=function(r){var n=t.tryParseFraction(r);return new t(e.multiply(this.numerator,n.denominator),e.multiply(this.denominator,n.numerator))},o.toSignificant=function(t,e,r){void 0===e&&(e={groupSeparator:""}),void 0===r&&(r=x.ROUND_HALF_UP),Number.isInteger(t)||n(!1),t>0||n(!1),j.set({precision:t+1,rounding:W[r]});var o=new j(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return o.toFormat(o.decimalPlaces(),e)},o.toFixed=function(t,e,r){return void 0===e&&(e={groupSeparator:""}),void 0===r&&(r=x.ROUND_HALF_UP),Number.isInteger(t)||n(!1),t>=0||n(!1),L.DP=t,L.RM=M[r],new L(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,e)},(r=[{key:"quotient",get:function(){return e.divide(this.numerator,this.denominator)}},{key:"remainder",get:function(){return new t(e.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function(){return new t(this.numerator,this.denominator)}}])&&function(t,e){for(var r=0;r0;l--){var d=t.pairs[l-1].getInputAmount(s[l]);s[l-1]=d[0]}this.inputAmount=r.CurrencyAmount.fromFractionalAmount(t.input,s[0].numerator,s[0].denominator),this.outputAmount=r.CurrencyAmount.fromFractionalAmount(t.output,e.numerator,e.denominator)}this.executionPrice=new r.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient),this.priceImpact=(i=this.outputAmount,a=(u=t.midPrice.quote(this.inputAmount)).subtract(i).divide(u),new G(a.numerator,a.denominator))}t.exactIn=function(e,n){return new t(e,n,r.TradeType.EXACT_INPUT)},t.exactOut=function(e,n){return new t(e,n,r.TradeType.EXACT_OUTPUT)};var e=t.prototype;return e.minimumAmountOut=function(t){if(t.lessThan(l)&&n(!1),this.tradeType===r.TradeType.EXACT_OUTPUT)return this.outputAmount;var e=new r.Fraction(d).add(t).invert().multiply(this.outputAmount.quotient).quotient;return r.CurrencyAmount.fromRawAmount(this.outputAmount.currency,e)},e.maximumAmountIn=function(t){if(t.lessThan(l)&&n(!1),this.tradeType===r.TradeType.EXACT_INPUT)return this.inputAmount;var e=new r.Fraction(d).add(t).multiply(this.inputAmount.quotient).quotient;return r.CurrencyAmount.fromRawAmount(this.inputAmount.currency,e)},t.bestTradeExactIn=function(e,o,i,u,a,s,c){var p=void 0===u?{}:u,d=p.maxNumResults,m=void 0===d?3:d,h=p.maxHops,f=void 0===h?3:h;void 0===a&&(a=[]),void 0===s&&(s=o),void 0===c&&(c=[]),e.length>0||n(!1),f>0||n(!1),o===s||a.length>0||n(!1);var y=s.currency.isToken?s.currency.chainId:i.isToken?i.chainId:void 0;void 0===y&&n(!1);for(var v=r.wrappedCurrencyAmount(s,y),T=r.wrappedCurrency(i,y),A=0;A1&&e.length>1){var k=e.slice(0,A).concat(e.slice(A+1,e.length));t.bestTradeExactIn(k,o,i,{maxNumResults:m,maxHops:f-1},[].concat(a,[q]),g,c)}}}return c},e.worstExecutionPrice=function(t){return new r.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(t).quotient,this.minimumAmountOut(t).quotient)},t.bestTradeExactOut=function(e,o,i,u,a,s,c){var p=void 0===u?{}:u,d=p.maxNumResults,m=void 0===d?3:d,h=p.maxHops,f=void 0===h?3:h;void 0===a&&(a=[]),void 0===s&&(s=i),void 0===c&&(c=[]),e.length>0||n(!1),f>0||n(!1),i===s||a.length>0||n(!1);var y=s.currency.isToken?s.currency.chainId:o.isToken?o.chainId:void 0;void 0===y&&n(!1);for(var v=r.wrappedCurrencyAmount(s,y),T=r.wrappedCurrency(o,y),A=0;A1&&e.length>1){var k=e.slice(0,A).concat(e.slice(A+1,e.length));t.bestTradeExactOut(k,o,i,{maxNumResults:m,maxHops:f-1},[q].concat(a),g,c)}}}return c},t}();function tt(t){return"0x"+t.quotient.toString(16)}var et=function(){function t(){}return t.swapCallParameters=function(t,e){var o=t.inputAmount.currency.isEther,i=t.outputAmount.currency.isEther;o&&i&&n(!1),!("ttl"in e)||e.ttl>0||n(!1);var u,a,s,c=r.validateAndParseAddress(e.recipient),p=tt(t.maximumAmountIn(e.allowedSlippage)),l=tt(t.minimumAmountOut(e.allowedSlippage)),d=t.route.path.map((function(t){return t.address})),m="ttl"in e?"0x"+(Math.floor((new Date).getTime()/1e3)+e.ttl).toString(16):"0x"+e.deadline.toString(16),h=Boolean(e.feeOnTransfer);switch(t.tradeType){case r.TradeType.EXACT_INPUT:o?(u=h?"swapExactETHForTokensSupportingFeeOnTransferTokens":"swapExactETHForTokens",a=[l,d,c,m],s=p):i?(u=h?"swapExactTokensForETHSupportingFeeOnTransferTokens":"swapExactTokensForETH",a=[p,l,d,c,m],s="0x0"):(u=h?"swapExactTokensForTokensSupportingFeeOnTransferTokens":"swapExactTokensForTokens",a=[p,l,d,c,m],s="0x0");break;case r.TradeType.EXACT_OUTPUT:h&&n(!1),o?(u="swapETHForExactTokens",a=[l,d,c,m],s=p):i?(u="swapTokensForExactETH",a=[l,p,d,c,m],s="0x0"):(u="swapTokensForExactTokens",a=[l,p,d,c,m],s="0x0")}return{methodName:u,args:a,value:s}},t}();exports.FACTORY_ADDRESS="0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",exports.INIT_CODE_HASH=c,exports.InsufficientInputAmountError=R,exports.InsufficientReservesError=N,exports.MINIMUM_LIQUIDITY=p,exports.Pair=U,exports.Route=F,exports.Router=et,exports.Trade=Z,exports.computePairAddress=C,exports.inputOutputComparator=z,exports.tradeComparator=J; +//# sourceMappingURL=v2-sdk.cjs.production.min.js.map diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js.map b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js.map new file mode 100644 index 00000000000..8746e686ea7 --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v2-sdk.cjs.production.min.js","sources":["../src/constants.ts","../src/errors.ts","../src/entities/pair.ts","../src/entities/route.ts","../../../sdk-core/src/constants.ts","../src/entities/trade.ts","../src/router.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\nexport const FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'\n\nexport const INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'\n\nexport const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)\n\n// exports for internal consumption\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\nexport const FIVE = JSBI.BigInt(5)\nexport const _997 = JSBI.BigInt(997)\nexport const _1000 = JSBI.BigInt(1000)\n","// see https://stackoverflow.com/a/41102306\nconst CAN_SET_PROTOTYPE = 'setPrototypeOf' in Object\n\n/**\n * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be\n * obtained by sending any amount of input.\n */\nexport class InsufficientReservesError extends Error {\n public readonly isInsufficientReservesError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\n/**\n * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less\n * than the price of a single unit of output after fees.\n */\nexport class InsufficientInputAmountError extends Error {\n public readonly isInsufficientInputAmountError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n","import { BigintIsh, ChainId, Price, sqrt, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { pack, keccak256 } from '@ethersproject/solidity'\nimport { getCreate2Address } from '@ethersproject/address'\n\nimport { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY, FIVE, _997, _1000, ONE, ZERO } from '../constants'\nimport { InsufficientReservesError, InsufficientInputAmountError } from '../errors'\n\nexport const computePairAddress = ({\n factoryAddress,\n tokenA,\n tokenB\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n}): string => {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]),\n INIT_CODE_HASH\n )\n}\nexport class Pair {\n public readonly liquidityToken: Token\n private readonly tokenAmounts: [CurrencyAmount, CurrencyAmount]\n\n public static getAddress(tokenA: Token, tokenB: Token): string {\n return computePairAddress({ factoryAddress: FACTORY_ADDRESS, tokenA, tokenB })\n }\n\n public constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount) {\n const tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [currencyAmountA, tokenAmountB]\n : [tokenAmountB, currencyAmountA]\n this.liquidityToken = new Token(\n tokenAmounts[0].currency.chainId,\n Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency),\n 18,\n 'UNI-V2',\n 'Uniswap V2'\n )\n this.tokenAmounts = tokenAmounts as [CurrencyAmount, CurrencyAmount]\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0\n */\n public get token0Price(): Price {\n const result = this.tokenAmounts[1].divide(this.tokenAmounts[0])\n return new Price(this.token0, this.token1, result.denominator, result.numerator)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1\n */\n public get token1Price(): Price {\n const result = this.tokenAmounts[0].divide(this.tokenAmounts[1])\n return new Price(this.token1, this.token0, result.denominator, result.numerator)\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pair.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pair.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n public get token0(): Token {\n return this.tokenAmounts[0].currency\n }\n\n public get token1(): Token {\n return this.tokenAmounts[1].currency\n }\n\n public get reserve0(): CurrencyAmount {\n return this.tokenAmounts[0]\n }\n\n public get reserve1(): CurrencyAmount {\n return this.tokenAmounts[1]\n }\n\n public reserveOf(token: Token): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.reserve0 : this.reserve1\n }\n\n public getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) {\n throw new InsufficientReservesError()\n }\n const inputReserve = this.reserveOf(inputAmount.currency)\n const outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997)\n const numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient)\n const denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee)\n const outputAmount = CurrencyAmount.fromRawAmount(\n inputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.divide(numerator, denominator)\n )\n if (JSBI.equal(outputAmount.quotient, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(outputAmount.currency), 'TOKEN')\n if (\n JSBI.equal(this.reserve0.quotient, ZERO) ||\n JSBI.equal(this.reserve1.quotient, ZERO) ||\n JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)\n ) {\n throw new InsufficientReservesError()\n }\n\n const outputReserve = this.reserveOf(outputAmount.currency)\n const inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000)\n const denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997)\n const inputAmount = CurrencyAmount.fromRawAmount(\n outputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.add(JSBI.divide(numerator, denominator), ONE)\n )\n return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getLiquidityMinted(\n totalSupply: CurrencyAmount,\n tokenAmountA: CurrencyAmount,\n tokenAmountB: CurrencyAmount\n ): CurrencyAmount {\n invariant(totalSupply.currency.equals(this.liquidityToken), 'LIQUIDITY')\n const tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [tokenAmountA, tokenAmountB]\n : [tokenAmountB, tokenAmountA]\n invariant(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1), 'TOKEN')\n\n let liquidity: JSBI\n if (JSBI.equal(totalSupply.quotient, ZERO)) {\n liquidity = JSBI.subtract(\n sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)),\n MINIMUM_LIQUIDITY\n )\n } else {\n const amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient)\n const amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient)\n liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1\n }\n if (!JSBI.greaterThan(liquidity, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity)\n }\n\n public getLiquidityValue(\n token: Token,\n totalSupply: CurrencyAmount,\n liquidity: CurrencyAmount,\n feeOn: boolean = false,\n kLast?: BigintIsh\n ): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n invariant(totalSupply.currency.equals(this.liquidityToken), 'TOTAL_SUPPLY')\n invariant(liquidity.currency.equals(this.liquidityToken), 'LIQUIDITY')\n invariant(JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient), 'LIQUIDITY')\n\n let totalSupplyAdjusted: CurrencyAmount\n if (!feeOn) {\n totalSupplyAdjusted = totalSupply\n } else {\n invariant(!!kLast, 'K_LAST')\n const kLastParsed = JSBI.BigInt(kLast)\n if (!JSBI.equal(kLastParsed, ZERO)) {\n const rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient))\n const rootKLast = sqrt(kLastParsed)\n if (JSBI.greaterThan(rootK, rootKLast)) {\n const numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast))\n const denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast)\n const feeLiquidity = JSBI.divide(numerator, denominator)\n totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity))\n } else {\n totalSupplyAdjusted = totalSupply\n }\n } else {\n totalSupplyAdjusted = totalSupply\n }\n }\n\n return CurrencyAmount.fromRawAmount(\n token,\n JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)\n )\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\n\nimport { Pair } from './pair'\n\nexport class Route {\n public readonly pairs: Pair[]\n public readonly path: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n public constructor(pairs: Pair[], input: TInput, output: TOutput) {\n invariant(pairs.length > 0, 'PAIRS')\n const chainId: ChainId | number = pairs[0].chainId\n invariant(\n pairs.every(pair => pair.chainId === chainId),\n 'CHAIN_IDS'\n )\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pairs[0].involvesToken(wrappedInput), 'INPUT')\n invariant(\n typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(wrappedCurrency(output, chainId)),\n 'OUTPUT'\n )\n\n const path: Token[] = [wrappedInput]\n for (const [i, pair] of pairs.entries()) {\n const currentInput = path[i]\n invariant(currentInput.equals(pair.token0) || currentInput.equals(pair.token1), 'PATH')\n const output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0\n path.push(output)\n }\n\n this.pairs = pairs\n this.path = path\n this.input = input\n this.output = output\n }\n\n private _midPrice: Price | null = null\n\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n const prices: Price[] = []\n for (const [i, pair] of this.pairs.entries()) {\n prices.push(\n this.path[i].equals(pair.token0)\n ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient)\n : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)\n )\n }\n const reduced = prices.slice(1).reduce((accumulator, currentValue) => accumulator.multiply(currentValue), prices[0])\n return (this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator))\n }\n\n public get chainId(): ChainId | number {\n return this.pairs[0].chainId\n }\n}\n","import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import {\n ChainId,\n Currency,\n CurrencyAmount,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n wrappedCurrency,\n TradeType,\n wrappedCurrencyAmount\n} from '@uniswap/sdk-core'\nimport { computePriceImpact, Token } from '../../../../sdk-core'\nimport { ONE, ZERO } from '../constants'\nimport invariant from 'tiny-invariant'\n\nimport { Pair } from './pair'\nimport { Route } from './route'\n\n// minimal interface so the input output comparator may be shared across types\ninterface InputOutput {\n readonly inputAmount: CurrencyAmount\n readonly outputAmount: CurrencyAmount\n}\n\n// comparator function that allows sorting trades by their output amounts, in decreasing order, and then input amounts\n// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first\nexport function inputOutputComparator(\n a: InputOutput,\n b: InputOutput\n): number {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n return 0\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n const ioComp = inputOutputComparator(a, b)\n if (ioComp !== 0) {\n return ioComp\n }\n\n // consider lowest slippage next, since these are less likely to fail\n if (a.priceImpact.lessThan(b.priceImpact)) {\n return -1\n } else if (a.priceImpact.greaterThan(b.priceImpact)) {\n return 1\n }\n\n // finally consider the number of hops since each hop costs gas\n return a.route.path.length - b.route.path.length\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pairs.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public readonly executionPrice: Price\n /**\n * The percent difference between the mid price before the trade and the trade execution price.\n */\n public readonly priceImpact: Percent\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Trade {\n return new Trade(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Trade {\n return new Trade(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n public constructor(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ) {\n this.route = route\n this.tradeType = tradeType\n\n const tokenAmounts: CurrencyAmount[] = new Array(route.path.length)\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n tokenAmounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.path.length - 1; i++) {\n const pair = route.pairs[i]\n const [outputAmount] = pair.getOutputAmount(tokenAmounts[i])\n tokenAmounts[i + 1] = outputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n this.outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n tokenAmounts[tokenAmounts.length - 1].numerator,\n tokenAmounts[tokenAmounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n tokenAmounts[tokenAmounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.path.length - 1; i > 0; i--) {\n const pair = route.pairs[i - 1]\n const [inputAmount] = pair.getInputAmount(tokenAmounts[i])\n tokenAmounts[i - 1] = inputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(\n route.input,\n tokenAmounts[0].numerator,\n tokenAmounts[0].denominator\n )\n this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n this.executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n )\n this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount)\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactIn(\n pairs: Pair[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountIn.currency) && !currencyEquals(pair.token1, amountIn.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = pair.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (currencyEquals(amountOut.currency, tokenOut)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([...currentPairs, pair], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n Trade.bestTradeExactIn(\n pairsExcludingThisPair,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPairs, pair],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactOut(\n pairs: Pair[],\n currencyIn: TInput,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? (currencyIn as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountOut.currency) && !currencyEquals(pair.token1, amountOut.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = pair.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pair\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([pair, ...currentPairs], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n Trade.bestTradeExactOut(\n pairsExcludingThisPair,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pair, ...currentPairs],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { Currency, CurrencyAmount, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport { Trade } from 'entities'\nimport invariant from 'tiny-invariant'\nimport { Token } from '../../../sdk-core'\n\n/**\n * Options for producing the arguments to send call to the router.\n */\nexport interface TradeOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n allowedSlippage: Percent\n /**\n * How long the swap is valid until it expires, in seconds.\n * This will be used to produce a `deadline` parameter which is computed from when the swap call parameters\n * are generated.\n */\n ttl: number\n /**\n * The account that should receive the output of the swap.\n */\n recipient: string\n\n /**\n * Whether any of the tokens in the path are fee on transfer tokens, which should be handled with special methods\n */\n feeOnTransfer?: boolean\n}\n\nexport interface TradeOptionsDeadline extends Omit {\n /**\n * When the transaction expires.\n * This is an atlernate to specifying the ttl, for when you do not want to use local time.\n */\n deadline: number\n}\n\n/**\n * The parameters to use in the call to the Uniswap V2 Router to execute a trade.\n */\nexport interface SwapParameters {\n /**\n * The method to call on the Uniswap V2 Router.\n */\n methodName: string\n /**\n * The arguments to pass to the method, all hex encoded.\n */\n args: (string | string[])[]\n /**\n * The amount of wei to send in hex.\n */\n value: string\n}\n\nfunction toHex(currencyAmount: CurrencyAmount) {\n return `0x${currencyAmount.quotient.toString(16)}`\n}\n\nconst ZERO_HEX = '0x0'\n\n/**\n * Represents the Uniswap V2 Router, and has static methods for helping execute trades.\n */\nexport abstract class Router {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: TradeOptions | TradeOptionsDeadline\n ): SwapParameters {\n const etherIn = trade.inputAmount.currency.isEther\n const etherOut = trade.outputAmount.currency.isEther\n // the router does not support both ether in and out\n invariant(!(etherIn && etherOut), 'ETHER_IN_OUT')\n invariant(!('ttl' in options) || options.ttl > 0, 'TTL')\n\n const to: string = validateAndParseAddress(options.recipient)\n const amountIn: string = toHex(trade.maximumAmountIn(options.allowedSlippage))\n const amountOut: string = toHex(trade.minimumAmountOut(options.allowedSlippage))\n const path: string[] = trade.route.path.map((token: Token) => token.address)\n const deadline =\n 'ttl' in options\n ? `0x${(Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16)}`\n : `0x${options.deadline.toString(16)}`\n\n const useFeeOnTransfer = Boolean(options.feeOnTransfer)\n\n let methodName: string\n let args: (string | string[])[]\n let value: string\n switch (trade.tradeType) {\n case TradeType.EXACT_INPUT:\n if (etherIn) {\n methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'\n // (uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = useFeeOnTransfer\n ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens'\n : 'swapExactTokensForTokens'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n }\n break\n case TradeType.EXACT_OUTPUT:\n invariant(!useFeeOnTransfer, 'EXACT_OUT_FOT')\n if (etherIn) {\n methodName = 'swapETHForExactTokens'\n // (uint amountOut, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = 'swapTokensForExactETH'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = 'swapTokensForExactTokens'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n }\n break\n }\n return {\n methodName,\n args,\n value\n }\n }\n}\n"],"names":["INIT_CODE_HASH","MINIMUM_LIQUIDITY","JSBI","BigInt","ZERO","ONE","FIVE","_997","_1000","CAN_SET_PROTOTYPE","Object","InsufficientReservesError","name","_this","constructor","setPrototypeOf","prototype","Error","InsufficientInputAmountError","_this2","computePairAddress","factoryAddress","tokenA","tokenB","sortsBefore","getCreate2Address","keccak256","pack","address","Pair","currencyAmountA","tokenAmountB","tokenAmounts","currency","liquidityToken","Token","chainId","getAddress","involvesToken","token","equals","this","token0","token1","priceOf","invariant","token0Price","token1Price","reserveOf","reserve0","reserve1","getOutputAmount","inputAmount","equal","quotient","inputReserve","outputReserve","inputAmountWithFee","multiply","numerator","denominator","add","outputAmount","CurrencyAmount","fromRawAmount","divide","subtract","getInputAmount","greaterThanOrEqual","getLiquidityMinted","totalSupply","tokenAmountA","liquidity","sqrt","amount0","amount1","lessThanOrEqual","greaterThan","getLiquidityValue","feeOn","kLast","totalSupplyAdjusted","kLastParsed","rootK","rootKLast","feeLiquidity","result","Price","Route","pairs","input","output","length","every","pair","wrappedInput","wrappedCurrency","path","entries","currentInput","push","_midPrice","prices","reduced","slice","reduce","accumulator","currentValue","ChainId","TradeType","inputOutputComparator","a","b","currencyEquals","equalTo","lessThan","tradeComparator","ioComp","priceImpact","route","Trade","amount","tradeType","Array","EXACT_INPUT","wrappedCurrencyAmount","i","fromFractionalAmount","executionPrice","midPrice","exactIn","amountIn","exactOut","amountOut","EXACT_OUTPUT","minimumAmountOut","slippageTolerance","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","bestTradeExactIn","currencyAmountIn","currencyOut","currentPairs","nextAmountIn","bestTrades","maxNumResults","maxHops","isToken","undefined","tokenOut","error","isInsufficientInputAmountError","sortedInsert","pairsExcludingThisPair","concat","worstExecutionPrice","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","toHex","currencyAmount","toString","Router","swapCallParameters","trade","options","etherIn","isEther","etherOut","ttl","methodName","args","value","to","validateAndParseAddress","recipient","allowedSlippage","map","deadline","Math","floor","Date","getTime","useFeeOnTransfer","Boolean","feeOnTransfer"],"mappings":"2XAIaA,EAAiB,qEAEjBC,EAAoBC,EAAKC,OAAO,KAGhCC,EAAOF,EAAKC,OAAO,GACnBE,EAAMH,EAAKC,OAAO,GAClBG,EAAOJ,EAAKC,OAAO,GACnBI,EAAOL,EAAKC,OAAO,KACnBK,EAAQN,EAAKC,OAAO,q3ECZjC,UAAMM,EAAoB,mBAAoBC,OAMjCC,2FACyC,IAI7CC,KAAOC,EAAKC,YAAYF,KACzBH,GAAmBC,OAAOK,gEAAgCC,gCANnBC,QAclCC,8FAC4C,IAIhDN,KAAOO,EAAKL,YAAYF,KACzBH,GAAmBC,OAAOK,gEAAgCC,gCANhBC,QCZrCG,EAAqB,gBAChCC,IAAAA,eACAC,IAAAA,OACAC,IAAAA,SAMyBD,EAAOE,YAAYD,GAAU,CAACD,EAAQC,GAAU,CAACA,EAAQD,UAC3EG,oBACLJ,EACAK,YAAU,CAAC,SAAU,CAACC,OAAK,CAAC,UAAW,WAAY,MAAQC,aAAgBA,YAC3E5B,IAGS6B,wBAQQC,EAAwCC,OACnDC,EAAeF,EAAgBG,SAAST,YAAYO,EAAaE,UACnE,CAACH,EAAiBC,GAClB,CAACA,EAAcD,QACdI,eAAiB,IAAIC,QACxBH,EAAa,GAAGC,SAASG,QACzBP,EAAKQ,WAAWL,EAAa,GAAGC,SAAUD,EAAa,GAAGC,UAC1D,GACA,SACA,mBAEGD,aAAeA,IAfRK,WAAP,SAAkBf,EAAeC,UAC/BH,EAAmB,CAAEC,eF5BD,6CE4BkCC,OAAAA,EAAQC,OAAAA,gCAqBhEe,cAAA,SAAcC,UACZA,EAAMC,OAAOC,K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zDO,kBA4DNrE,YAAUyB,aACFuD,GAAXhJ,MACI+H,GACFI,EAAa,wBAEbC,EAAO,CAAC5C,EAAWpC,EAAMkF,EAAIK,GAC7BN,EAAQ/C,GACC2C,GACTE,EAAa,wBAEbC,EAAO,CAAC5C,EAAWF,EAAUlC,EAAMkF,EAAIK,GACvCN,EAvEO,QAyEPF,EAAa,2BAEbC,EAAO,CAAC5C,EAAWF,EAAUlC,EAAMkF,EAAIK,GACvCN,EA5EO,aAgFN,CACLF,WAAAA,EACAC,KAAAA,EACAC,MAAAA,iCN7IyB"} \ No newline at end of file diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js new file mode 100644 index 00000000000..1a480fd1b8d --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js @@ -0,0 +1,1243 @@ +import JSBI from 'jsbi'; +import { CurrencyAmount, sqrt, Token as Token$1, Price, wrappedCurrency, currencyEquals, TradeType as TradeType$1, Fraction as Fraction$1, wrappedCurrencyAmount, sortedInsert, validateAndParseAddress as validateAndParseAddress$1 } from '@uniswap/sdk-core'; +import invariant from 'tiny-invariant'; +import { keccak256, pack } from '@ethersproject/solidity'; +import { getCreate2Address, getAddress } from '@ethersproject/address'; +import _Decimal from 'decimal.js-light'; +import _Big from 'big.js'; +import toFormat from 'toformat'; + +var FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'; +var INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'; +var MINIMUM_LIQUIDITY = /*#__PURE__*/JSBI.BigInt(1000); // exports for internal consumption + +var ZERO = /*#__PURE__*/JSBI.BigInt(0); +var ONE = /*#__PURE__*/JSBI.BigInt(1); +var FIVE = /*#__PURE__*/JSBI.BigInt(5); +var _997 = /*#__PURE__*/JSBI.BigInt(997); +var _1000 = /*#__PURE__*/JSBI.BigInt(1000); + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} + +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); +} + +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } +} + +function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + + return _construct.apply(null, arguments); +} + +function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} + +function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + + _cache.set(Class, Wrapper); + } + + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + + return _wrapNativeSuper(Class); +} + +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; +} + +function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it; + + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + it = o[Symbol.iterator](); + return it.next.bind(it); +} + +// see https://stackoverflow.com/a/41102306 +var CAN_SET_PROTOTYPE = ('setPrototypeOf' in Object); +/** + * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be + * obtained by sending any amount of input. + */ + +var InsufficientReservesError = /*#__PURE__*/function (_Error) { + _inheritsLoose(InsufficientReservesError, _Error); + + function InsufficientReservesError() { + var _this; + + _this = _Error.call(this) || this; + _this.isInsufficientReservesError = true; + _this.name = _this.constructor.name; + if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(_assertThisInitialized(_this), (this instanceof InsufficientReservesError ? this.constructor : void 0).prototype); + return _this; + } + + return InsufficientReservesError; +}( /*#__PURE__*/_wrapNativeSuper(Error)); +/** + * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less + * than the price of a single unit of output after fees. + */ + +var InsufficientInputAmountError = /*#__PURE__*/function (_Error2) { + _inheritsLoose(InsufficientInputAmountError, _Error2); + + function InsufficientInputAmountError() { + var _this2; + + _this2 = _Error2.call(this) || this; + _this2.isInsufficientInputAmountError = true; + _this2.name = _this2.constructor.name; + if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(_assertThisInitialized(_this2), (this instanceof InsufficientInputAmountError ? this.constructor : void 0).prototype); + return _this2; + } + + return InsufficientInputAmountError; +}( /*#__PURE__*/_wrapNativeSuper(Error)); + +var computePairAddress = function computePairAddress(_ref) { + var factoryAddress = _ref.factoryAddress, + tokenA = _ref.tokenA, + tokenB = _ref.tokenB; + + var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], + token0 = _ref2[0], + token1 = _ref2[1]; // does safety checks + + + return getCreate2Address(factoryAddress, keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]), INIT_CODE_HASH); +}; +var Pair = /*#__PURE__*/function () { + function Pair(currencyAmountA, tokenAmountB) { + var tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks + ? [currencyAmountA, tokenAmountB] : [tokenAmountB, currencyAmountA]; + this.liquidityToken = new Token$1(tokenAmounts[0].currency.chainId, Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency), 18, 'UNI-V2', 'Uniswap V2'); + this.tokenAmounts = tokenAmounts; + } + + Pair.getAddress = function getAddress(tokenA, tokenB) { + return computePairAddress({ + factoryAddress: FACTORY_ADDRESS, + tokenA: tokenA, + tokenB: tokenB + }); + } + /** + * Returns true if the token is either token0 or token1 + * @param token to check + */ + ; + + var _proto = Pair.prototype; + + _proto.involvesToken = function involvesToken(token) { + return token.equals(this.token0) || token.equals(this.token1); + } + /** + * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0 + */ + ; + + /** + * Return the price of the given token in terms of the other token in the pair. + * @param token token to return price of + */ + _proto.priceOf = function priceOf(token) { + !this.involvesToken(token) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + return token.equals(this.token0) ? this.token0Price : this.token1Price; + } + /** + * Returns the chain ID of the tokens in the pair. + */ + ; + + _proto.reserveOf = function reserveOf(token) { + !this.involvesToken(token) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + return token.equals(this.token0) ? this.reserve0 : this.reserve1; + }; + + _proto.getOutputAmount = function getOutputAmount(inputAmount) { + !this.involvesToken(inputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + + if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) { + throw new InsufficientReservesError(); + } + + var inputReserve = this.reserveOf(inputAmount.currency); + var outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0); + var inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997); + var numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient); + var denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee); + var outputAmount = CurrencyAmount.fromRawAmount(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0, JSBI.divide(numerator, denominator)); + + if (JSBI.equal(outputAmount.quotient, ZERO)) { + throw new InsufficientInputAmountError(); + } + + return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]; + }; + + _proto.getInputAmount = function getInputAmount(outputAmount) { + !this.involvesToken(outputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + + if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO) || JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)) { + throw new InsufficientReservesError(); + } + + var outputReserve = this.reserveOf(outputAmount.currency); + var inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0); + var numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000); + var denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997); + var inputAmount = CurrencyAmount.fromRawAmount(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0, JSBI.add(JSBI.divide(numerator, denominator), ONE)); + return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]; + }; + + _proto.getLiquidityMinted = function getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB) { + !totalSupply.currency.equals(this.liquidityToken) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LIQUIDITY') : invariant(false) : void 0; + var tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks + ? [tokenAmountA, tokenAmountB] : [tokenAmountB, tokenAmountA]; + !(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + var liquidity; + + if (JSBI.equal(totalSupply.quotient, ZERO)) { + liquidity = JSBI.subtract(sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)), MINIMUM_LIQUIDITY); + } else { + var amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient); + var amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient); + liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1; + } + + if (!JSBI.greaterThan(liquidity, ZERO)) { + throw new InsufficientInputAmountError(); + } + + return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity); + }; + + _proto.getLiquidityValue = function getLiquidityValue(token, totalSupply, liquidity, feeOn, kLast) { + if (feeOn === void 0) { + feeOn = false; + } + + !this.involvesToken(token) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + !totalSupply.currency.equals(this.liquidityToken) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOTAL_SUPPLY') : invariant(false) : void 0; + !liquidity.currency.equals(this.liquidityToken) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LIQUIDITY') : invariant(false) : void 0; + !JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LIQUIDITY') : invariant(false) : void 0; + var totalSupplyAdjusted; + + if (!feeOn) { + totalSupplyAdjusted = totalSupply; + } else { + !!!kLast ? process.env.NODE_ENV !== "production" ? invariant(false, 'K_LAST') : invariant(false) : void 0; + var kLastParsed = JSBI.BigInt(kLast); + + if (!JSBI.equal(kLastParsed, ZERO)) { + var rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient)); + var rootKLast = sqrt(kLastParsed); + + if (JSBI.greaterThan(rootK, rootKLast)) { + var numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast)); + var denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast); + var feeLiquidity = JSBI.divide(numerator, denominator); + totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity)); + } else { + totalSupplyAdjusted = totalSupply; + } + } else { + totalSupplyAdjusted = totalSupply; + } + } + + return CurrencyAmount.fromRawAmount(token, JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)); + }; + + _createClass(Pair, [{ + key: "token0Price", + get: function get() { + var result = this.tokenAmounts[1].divide(this.tokenAmounts[0]); + return new Price(this.token0, this.token1, result.denominator, result.numerator); + } + /** + * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1 + */ + + }, { + key: "token1Price", + get: function get() { + var result = this.tokenAmounts[0].divide(this.tokenAmounts[1]); + return new Price(this.token1, this.token0, result.denominator, result.numerator); + } + }, { + key: "chainId", + get: function get() { + return this.token0.chainId; + } + }, { + key: "token0", + get: function get() { + return this.tokenAmounts[0].currency; + } + }, { + key: "token1", + get: function get() { + return this.tokenAmounts[1].currency; + } + }, { + key: "reserve0", + get: function get() { + return this.tokenAmounts[0]; + } + }, { + key: "reserve1", + get: function get() { + return this.tokenAmounts[1]; + } + }]); + + return Pair; +}(); + +var Route = /*#__PURE__*/function () { + function Route(pairs, input, output) { + this._midPrice = null; + !(pairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PAIRS') : invariant(false) : void 0; + var chainId = pairs[0].chainId; + !pairs.every(function (pair) { + return pair.chainId === chainId; + }) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_IDS') : invariant(false) : void 0; + var wrappedInput = wrappedCurrency(input, chainId); + !pairs[0].involvesToken(wrappedInput) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT') : invariant(false) : void 0; + !(typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(wrappedCurrency(output, chainId))) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT') : invariant(false) : void 0; + var path = [wrappedInput]; + + for (var _iterator = _createForOfIteratorHelperLoose(pairs.entries()), _step; !(_step = _iterator()).done;) { + var _step$value = _step.value, + i = _step$value[0], + pair = _step$value[1]; + var currentInput = path[i]; + !(currentInput.equals(pair.token0) || currentInput.equals(pair.token1)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PATH') : invariant(false) : void 0; + + var _output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0; + + path.push(_output); + } + + this.pairs = pairs; + this.path = path; + this.input = input; + this.output = output; + } + + _createClass(Route, [{ + key: "midPrice", + get: function get() { + if (this._midPrice !== null) return this._midPrice; + var prices = []; + + for (var _iterator2 = _createForOfIteratorHelperLoose(this.pairs.entries()), _step2; !(_step2 = _iterator2()).done;) { + var _step2$value = _step2.value, + i = _step2$value[0], + pair = _step2$value[1]; + prices.push(this.path[i].equals(pair.token0) ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient) : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)); + } + + var reduced = prices.slice(1).reduce(function (accumulator, currentValue) { + return accumulator.multiply(currentValue); + }, prices[0]); + return this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator); + } + }, { + key: "chainId", + get: function get() { + return this.pairs[0].chainId; + } + }]); + + return Route; +}(); + +var ChainId; + +(function (ChainId) { + ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; + ChainId[ChainId["ROPSTEN"] = 3] = "ROPSTEN"; + ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY"; + ChainId[ChainId["G\xD6RLI"] = 5] = "G\xD6RLI"; + ChainId[ChainId["KOVAN"] = 42] = "KOVAN"; +})(ChainId || (ChainId = {})); + +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 = {})); + +function _defineProperties$1(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass$1(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$1(Constructor, staticProps); + return Constructor; +} + +function _inheritsLoose$1(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} +/** + * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. + * + * The only instance of the base class `Currency` is Ether. + */ + + +var BaseCurrency = +/** + * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. + * @param decimals decimals of the currency + * @param symbol symbol of the currency + * @param name of the currency + */ +function BaseCurrency(decimals, symbol, name) { + !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, 'DECIMALS') : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + this.decimals = decimals; + this.symbol = symbol; + this.name = name; +}; + +var _toSignificantRoundin, _toFixedRounding; + +var Decimal = /*#__PURE__*/toFormat(_Decimal); +var Big = /*#__PURE__*/toFormat(_Big); +var toSignificantRounding = (_toSignificantRoundin = {}, _toSignificantRoundin[Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN, _toSignificantRoundin[Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP, _toSignificantRoundin[Rounding.ROUND_UP] = Decimal.ROUND_UP, _toSignificantRoundin); +var toFixedRounding = (_toFixedRounding = {}, _toFixedRounding[Rounding.ROUND_DOWN] = 0, _toFixedRounding[Rounding.ROUND_HALF_UP] = 1, _toFixedRounding[Rounding.ROUND_UP] = 3, _toFixedRounding); + +var Fraction = /*#__PURE__*/function () { + function Fraction(numerator, denominator) { + if (denominator === void 0) { + denominator = JSBI.BigInt(1); + } + + this.numerator = JSBI.BigInt(numerator); + this.denominator = JSBI.BigInt(denominator); + } + + Fraction.tryParseFraction = function tryParseFraction(fractionish) { + if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') return new Fraction(fractionish); + if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish; + throw new Error('Could not parse fraction'); + } // performs floor division + ; + + var _proto = Fraction.prototype; + + _proto.invert = function invert() { + return new Fraction(this.denominator, this.numerator); + }; + + _proto.add = function add(other) { + var otherParsed = Fraction.tryParseFraction(other); + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator); + } + + return new Fraction(JSBI.add(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.subtract = function subtract(other) { + var otherParsed = Fraction.tryParseFraction(other); + + if (JSBI.equal(this.denominator, otherParsed.denominator)) { + return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator); + } + + return new Fraction(JSBI.subtract(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.lessThan = function lessThan(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.lessThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.equalTo = function equalTo(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.equal(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.greaterThan = function greaterThan(other) { + var otherParsed = Fraction.tryParseFraction(other); + return JSBI.greaterThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); + }; + + _proto.multiply = function multiply(other) { + var otherParsed = Fraction.tryParseFraction(other); + return new Fraction(JSBI.multiply(this.numerator, otherParsed.numerator), JSBI.multiply(this.denominator, otherParsed.denominator)); + }; + + _proto.divide = function divide(other) { + var otherParsed = Fraction.tryParseFraction(other); + return new Fraction(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(this.denominator, otherParsed.numerator)); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_HALF_UP; + } + + !Number.isInteger(significantDigits) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, significantDigits + " is not an integer.") : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + !(significantDigits > 0) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, significantDigits + " is not positive.") : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + Decimal.set({ + precision: significantDigits + 1, + rounding: toSignificantRounding[rounding] + }); + var quotient = new Decimal(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(significantDigits); + return quotient.toFormat(quotient.decimalPlaces(), format); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (format === void 0) { + format = { + groupSeparator: '' + }; + } + + if (rounding === void 0) { + rounding = Rounding.ROUND_HALF_UP; + } + + !Number.isInteger(decimalPlaces) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, decimalPlaces + " is not an integer.") : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + !(decimalPlaces >= 0) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, decimalPlaces + " is negative.") : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + Big.DP = decimalPlaces; + Big.RM = toFixedRounding[rounding]; + return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format); + } + /** + * Helper method for converting any super class back to a fraction + */ + ; + + _createClass$1(Fraction, [{ + key: "quotient", + get: function get() { + return JSBI.divide(this.numerator, this.denominator); + } // remainder after floor division + + }, { + key: "remainder", + get: function get() { + return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator); + } + }, { + key: "asFraction", + get: function get() { + return new Fraction(this.numerator, this.denominator); + } + }]); + + return Fraction; +}(); + +var ONE_HUNDRED = /*#__PURE__*/new Fraction( /*#__PURE__*/JSBI.BigInt(100)); +/** + * Converts a fraction to a percent + * @param fraction the fraction to convert + */ + +function toPercent(fraction) { + return new Percent(fraction.numerator, fraction.denominator); +} + +var Percent = /*#__PURE__*/function (_Fraction) { + _inheritsLoose$1(Percent, _Fraction); + + function Percent() { + var _this; + + _this = _Fraction.apply(this, arguments) || this; + /** + * This boolean prevents a fraction from being interpreted as a Percent + */ + + _this.isPercent = true; + return _this; + } + + var _proto = Percent.prototype; + + _proto.add = function add(other) { + return toPercent(_Fraction.prototype.add.call(this, other)); + }; + + _proto.subtract = function subtract(other) { + return toPercent(_Fraction.prototype.subtract.call(this, other)); + }; + + _proto.multiply = function multiply(other) { + return toPercent(_Fraction.prototype.multiply.call(this, other)); + }; + + _proto.divide = function divide(other) { + return toPercent(_Fraction.prototype.divide.call(this, other)); + }; + + _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { + if (significantDigits === void 0) { + significantDigits = 5; + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding); + }; + + _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { + if (decimalPlaces === void 0) { + decimalPlaces = 2; + } + + return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding); + }; + + return Percent; +}(Fraction); +/** + * Validates an address and returns the parsed (checksummed) version of that address + * @param address the unchecksummed hex address + */ + + +function validateAndParseAddress(address) { + try { + return getAddress(address); + } catch (error) { + throw new Error(address + " is not a valid address."); + } +} + +var _WETH; +/** + * Represents an ERC20 token with a unique address and some metadata. + */ + + +var Token = /*#__PURE__*/function (_BaseCurrency) { + _inheritsLoose$1(Token, _BaseCurrency); + + function Token(chainId, address, decimals, symbol, name) { + var _this; + + _this = _BaseCurrency.call(this, decimals, symbol, name) || this; + _this.isEther = false; + _this.isToken = true; + _this.chainId = chainId; + _this.address = validateAndParseAddress(address); + return _this; + } + /** + * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. + * @param other other token to compare + */ + + + var _proto = Token.prototype; + + _proto.equals = function equals(other) { + // short circuit on reference equality + if (this === other) { + return true; + } + + return this.chainId === other.chainId && this.address === other.address; + } + /** + * Returns true if the address of this token sorts before the address of the other token + * @param other other token to compare + * @throws if the tokens have the same address + * @throws if the tokens are on different chains + */ + ; + + _proto.sortsBefore = function sortsBefore(other) { + !(this.chainId === other.chainId) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_IDS') : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + !(this.address !== other.address) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, 'ADDRESSES') : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + return this.address.toLowerCase() < other.address.toLowerCase(); + }; + + return Token; +}(BaseCurrency); + +var WETH9 = (_WETH = {}, _WETH[ChainId.MAINNET] = /*#__PURE__*/new Token(ChainId.MAINNET, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.ROPSTEN] = /*#__PURE__*/new Token(ChainId.ROPSTEN, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.RINKEBY] = /*#__PURE__*/new Token(ChainId.RINKEBY, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.GÖRLI] = /*#__PURE__*/new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.KOVAN] = /*#__PURE__*/new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'), _WETH); +/** + * Returns the percent difference between the mid price and the execution price, i.e. price impact. + * @param midPrice mid price before the trade + * @param inputAmount the input amount of the trade + * @param outputAmount the output amount of the trade + */ + +function computePriceImpact(midPrice, inputAmount, outputAmount) { + var quotedOutputAmount = midPrice.quote(inputAmount); // calculate price impact := (exactQuote - outputAmount) / exactQuote + + var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount); + return new Percent(priceImpact.numerator, priceImpact.denominator); +} // `maxSize` by removing the last item + +// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first + +function inputOutputComparator(a, b) { + // must have same input and output token for comparison + !currencyEquals(a.inputAmount.currency, b.inputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT_CURRENCY') : invariant(false) : void 0; + !currencyEquals(a.outputAmount.currency, b.outputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT_CURRENCY') : invariant(false) : void 0; + + if (a.outputAmount.equalTo(b.outputAmount)) { + if (a.inputAmount.equalTo(b.inputAmount)) { + return 0; + } // trade A requires less input than trade B, so A should come first + + + if (a.inputAmount.lessThan(b.inputAmount)) { + return -1; + } else { + return 1; + } + } else { + // tradeA has less output than trade B, so should come second + if (a.outputAmount.lessThan(b.outputAmount)) { + return 1; + } else { + return -1; + } + } +} // extension of the input output comparator that also considers other dimensions of the trade in ranking them + +function tradeComparator(a, b) { + var ioComp = inputOutputComparator(a, b); + + if (ioComp !== 0) { + return ioComp; + } // consider lowest slippage next, since these are less likely to fail + + + if (a.priceImpact.lessThan(b.priceImpact)) { + return -1; + } else if (a.priceImpact.greaterThan(b.priceImpact)) { + return 1; + } // finally consider the number of hops since each hop costs gas + + + return a.route.path.length - b.route.path.length; +} +/** + * Represents a trade executed against a list of pairs. + * Does not account for slippage, i.e. trades that front run this trade and move the price. + */ + +var Trade = /*#__PURE__*/function () { + function Trade(route, amount, tradeType) { + this.route = route; + this.tradeType = tradeType; + var tokenAmounts = new Array(route.path.length); + + if (tradeType === TradeType$1.EXACT_INPUT) { + !currencyEquals(amount.currency, route.input) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT') : invariant(false) : void 0; + tokenAmounts[0] = wrappedCurrencyAmount(amount, route.chainId); + + for (var i = 0; i < route.path.length - 1; i++) { + var pair = route.pairs[i]; + + var _pair$getOutputAmount = pair.getOutputAmount(tokenAmounts[i]), + outputAmount = _pair$getOutputAmount[0]; + + tokenAmounts[i + 1] = outputAmount; + } + + this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator); + this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, tokenAmounts[tokenAmounts.length - 1].numerator, tokenAmounts[tokenAmounts.length - 1].denominator); + } else { + !currencyEquals(amount.currency, route.output) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT') : invariant(false) : void 0; + tokenAmounts[tokenAmounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId); + + for (var _i = route.path.length - 1; _i > 0; _i--) { + var _pair = route.pairs[_i - 1]; + + var _pair$getInputAmount = _pair.getInputAmount(tokenAmounts[_i]), + inputAmount = _pair$getInputAmount[0]; + + tokenAmounts[_i - 1] = inputAmount; + } + + this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, tokenAmounts[0].numerator, tokenAmounts[0].denominator); + this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator); + } + + this.executionPrice = new Price(this.inputAmount.currency, this.outputAmount.currency, this.inputAmount.quotient, this.outputAmount.quotient); + this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount); + } + /** + * Constructs an exact in trade with the given amount in and route + * @param route route of the exact in trade + * @param amountIn the amount being passed in + */ + + + Trade.exactIn = function exactIn(route, amountIn) { + return new Trade(route, amountIn, TradeType$1.EXACT_INPUT); + } + /** + * Constructs an exact out trade with the given amount out and route + * @param route route of the exact out trade + * @param amountOut the amount returned by the trade + */ + ; + + Trade.exactOut = function exactOut(route, amountOut) { + return new Trade(route, amountOut, TradeType$1.EXACT_OUTPUT); + } + /** + * Get the minimum amount that must be received from this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + ; + + var _proto = Trade.prototype; + + _proto.minimumAmountOut = function minimumAmountOut(slippageTolerance) { + !!slippageTolerance.lessThan(ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SLIPPAGE_TOLERANCE') : invariant(false) : void 0; + + if (this.tradeType === TradeType$1.EXACT_OUTPUT) { + return this.outputAmount; + } else { + var slippageAdjustedAmountOut = new Fraction$1(ONE).add(slippageTolerance).invert().multiply(this.outputAmount.quotient).quotient; + return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut); + } + } + /** + * Get the maximum amount in that can be spent via this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + ; + + _proto.maximumAmountIn = function maximumAmountIn(slippageTolerance) { + !!slippageTolerance.lessThan(ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SLIPPAGE_TOLERANCE') : invariant(false) : void 0; + + if (this.tradeType === TradeType$1.EXACT_INPUT) { + return this.inputAmount; + } else { + var slippageAdjustedAmountIn = new Fraction$1(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient).quotient; + return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn); + } + } + /** + * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token + * amount to an output token, making at most `maxHops` hops. + * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pairs the pairs to consider in finding the best trade + * @param nextAmountIn exact amount of input currency to spend + * @param currencyOut the desired currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair + * @param currentPairs used in recursion; the current list of pairs + * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter + * @param bestTrades used in recursion; the current list of best trades + */ + ; + + Trade.bestTradeExactIn = function bestTradeExactIn(pairs, currencyAmountIn, currencyOut, _temp, // used in recursion. + currentPairs, nextAmountIn, bestTrades) { + var _ref = _temp === void 0 ? {} : _temp, + _ref$maxNumResults = _ref.maxNumResults, + maxNumResults = _ref$maxNumResults === void 0 ? 3 : _ref$maxNumResults, + _ref$maxHops = _ref.maxHops, + maxHops = _ref$maxHops === void 0 ? 3 : _ref$maxHops; + + if (currentPairs === void 0) { + currentPairs = []; + } + + if (nextAmountIn === void 0) { + nextAmountIn = currencyAmountIn; + } + + if (bestTrades === void 0) { + bestTrades = []; + } + + !(pairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PAIRS') : invariant(false) : void 0; + !(maxHops > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_HOPS') : invariant(false) : void 0; + !(currencyAmountIn === nextAmountIn || currentPairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INVALID_RECURSION') : invariant(false) : void 0; + var chainId = nextAmountIn.currency.isToken ? nextAmountIn.currency.chainId : currencyOut.isToken ? currencyOut.chainId : undefined; + !(chainId !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; + var amountIn = wrappedCurrencyAmount(nextAmountIn, chainId); + var tokenOut = wrappedCurrency(currencyOut, chainId); + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; // pair irrelevant + + if (!currencyEquals(pair.token0, amountIn.currency) && !currencyEquals(pair.token1, amountIn.currency)) continue; + if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue; + var amountOut = void 0; + + try { + ; + + var _pair$getOutputAmount2 = pair.getOutputAmount(amountIn); + + amountOut = _pair$getOutputAmount2[0]; + } catch (error) { + // input too low + if (error.isInsufficientInputAmountError) { + continue; + } + + throw error; + } // we have arrived at the output token, so this is the final trade of one of the paths + + + if (currencyEquals(amountOut.currency, tokenOut)) { + sortedInsert(bestTrades, new Trade(new Route([].concat(currentPairs, [pair]), currencyAmountIn.currency, currencyOut), currencyAmountIn, TradeType$1.EXACT_INPUT), maxNumResults, tradeComparator); + } else if (maxHops > 1 && pairs.length > 1) { + var pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length)); // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops + + Trade.bestTradeExactIn(pairsExcludingThisPair, currencyAmountIn, currencyOut, { + maxNumResults: maxNumResults, + maxHops: maxHops - 1 + }, [].concat(currentPairs, [pair]), amountOut, bestTrades); + } + } + + return bestTrades; + } + /** + * Return the execution price after accounting for slippage tolerance + * @param slippageTolerance the allowed tolerated slippage + */ + ; + + _proto.worstExecutionPrice = function worstExecutionPrice(slippageTolerance) { + return new Price(this.inputAmount.currency, this.outputAmount.currency, this.maximumAmountIn(slippageTolerance).quotient, this.minimumAmountOut(slippageTolerance).quotient); + } + /** + * similar to the above method but instead targets a fixed output amount + * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token + * to an output token amount, making at most `maxHops` hops + * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pairs the pairs to consider in finding the best trade + * @param currencyIn the currency to spend + * @param nextAmountOut the exact amount of currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair + * @param currentPairs used in recursion; the current list of pairs + * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter + * @param bestTrades used in recursion; the current list of best trades + */ + ; + + Trade.bestTradeExactOut = function bestTradeExactOut(pairs, currencyIn, currencyAmountOut, _temp2, // used in recursion. + currentPairs, nextAmountOut, bestTrades) { + var _ref2 = _temp2 === void 0 ? {} : _temp2, + _ref2$maxNumResults = _ref2.maxNumResults, + maxNumResults = _ref2$maxNumResults === void 0 ? 3 : _ref2$maxNumResults, + _ref2$maxHops = _ref2.maxHops, + maxHops = _ref2$maxHops === void 0 ? 3 : _ref2$maxHops; + + if (currentPairs === void 0) { + currentPairs = []; + } + + if (nextAmountOut === void 0) { + nextAmountOut = currencyAmountOut; + } + + if (bestTrades === void 0) { + bestTrades = []; + } + + !(pairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PAIRS') : invariant(false) : void 0; + !(maxHops > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_HOPS') : invariant(false) : void 0; + !(currencyAmountOut === nextAmountOut || currentPairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INVALID_RECURSION') : invariant(false) : void 0; + var chainId = nextAmountOut.currency.isToken ? nextAmountOut.currency.chainId : currencyIn.isToken ? currencyIn.chainId : undefined; + !(chainId !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; + var amountOut = wrappedCurrencyAmount(nextAmountOut, chainId); + var tokenIn = wrappedCurrency(currencyIn, chainId); + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; // pair irrelevant + + if (!currencyEquals(pair.token0, amountOut.currency) && !currencyEquals(pair.token1, amountOut.currency)) continue; + if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue; + var amountIn = void 0; + + try { + ; + + var _pair$getInputAmount2 = pair.getInputAmount(amountOut); + + amountIn = _pair$getInputAmount2[0]; + } catch (error) { + // not enough liquidity in this pair + if (error.isInsufficientReservesError) { + continue; + } + + throw error; + } // we have arrived at the input token, so this is the first trade of one of the paths + + + if (currencyEquals(amountIn.currency, tokenIn)) { + sortedInsert(bestTrades, new Trade(new Route([pair].concat(currentPairs), currencyIn, currencyAmountOut.currency), currencyAmountOut, TradeType$1.EXACT_OUTPUT), maxNumResults, tradeComparator); + } else if (maxHops > 1 && pairs.length > 1) { + var pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length)); // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops + + Trade.bestTradeExactOut(pairsExcludingThisPair, currencyIn, currencyAmountOut, { + maxNumResults: maxNumResults, + maxHops: maxHops - 1 + }, [pair].concat(currentPairs), amountIn, bestTrades); + } + } + + return bestTrades; + }; + + return Trade; +}(); + +function toHex(currencyAmount) { + return "0x" + currencyAmount.quotient.toString(16); +} + +var ZERO_HEX = '0x0'; +/** + * Represents the Uniswap V2 Router, and has static methods for helping execute trades. + */ + +var Router = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function Router() {} + /** + * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. + * @param trade to produce call parameters for + * @param options options for the call parameters + */ + + + Router.swapCallParameters = function swapCallParameters(trade, options) { + var etherIn = trade.inputAmount.currency.isEther; + var etherOut = trade.outputAmount.currency.isEther; // the router does not support both ether in and out + + !!(etherIn && etherOut) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ETHER_IN_OUT') : invariant(false) : void 0; + !(!('ttl' in options) || options.ttl > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TTL') : invariant(false) : void 0; + var to = validateAndParseAddress$1(options.recipient); + var amountIn = toHex(trade.maximumAmountIn(options.allowedSlippage)); + var amountOut = toHex(trade.minimumAmountOut(options.allowedSlippage)); + var path = trade.route.path.map(function (token) { + return token.address; + }); + var deadline = 'ttl' in options ? "0x" + (Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16) : "0x" + options.deadline.toString(16); + var useFeeOnTransfer = Boolean(options.feeOnTransfer); + var methodName; + var args; + var value; + + switch (trade.tradeType) { + case TradeType$1.EXACT_INPUT: + if (etherIn) { + methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'; // (uint amountOutMin, address[] calldata path, address to, uint deadline) + + args = [amountOut, path, to, deadline]; + value = amountIn; + } else if (etherOut) { + methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'; // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) + + args = [amountIn, amountOut, path, to, deadline]; + value = ZERO_HEX; + } else { + methodName = useFeeOnTransfer ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens' : 'swapExactTokensForTokens'; // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) + + args = [amountIn, amountOut, path, to, deadline]; + value = ZERO_HEX; + } + + break; + + case TradeType$1.EXACT_OUTPUT: + !!useFeeOnTransfer ? process.env.NODE_ENV !== "production" ? invariant(false, 'EXACT_OUT_FOT') : invariant(false) : void 0; + + if (etherIn) { + methodName = 'swapETHForExactTokens'; // (uint amountOut, address[] calldata path, address to, uint deadline) + + args = [amountOut, path, to, deadline]; + value = amountIn; + } else if (etherOut) { + methodName = 'swapTokensForExactETH'; // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) + + args = [amountOut, amountIn, path, to, deadline]; + value = ZERO_HEX; + } else { + methodName = 'swapTokensForExactTokens'; // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) + + args = [amountOut, amountIn, path, to, deadline]; + value = ZERO_HEX; + } + + break; + } + + return { + methodName: methodName, + args: args, + value: value + }; + }; + + return Router; +}(); + +export { FACTORY_ADDRESS, INIT_CODE_HASH, InsufficientInputAmountError, InsufficientReservesError, MINIMUM_LIQUIDITY, Pair, Route, Router, Trade, computePairAddress, inputOutputComparator, tradeComparator }; +//# sourceMappingURL=v2-sdk.esm.js.map diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js.map b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js.map new file mode 100644 index 00000000000..9137cf12bdb --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v2-sdk.esm.js","sources":["../src/constants.ts","../src/errors.ts","../src/entities/pair.ts","../src/entities/route.ts","../../../sdk-core/src/constants.ts","../src/entities/trade.ts","../src/router.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\nexport const FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'\n\nexport const INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'\n\nexport const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)\n\n// exports for internal consumption\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\nexport const FIVE = JSBI.BigInt(5)\nexport const _997 = JSBI.BigInt(997)\nexport const _1000 = JSBI.BigInt(1000)\n","// see https://stackoverflow.com/a/41102306\nconst CAN_SET_PROTOTYPE = 'setPrototypeOf' in Object\n\n/**\n * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be\n * obtained by sending any amount of input.\n */\nexport class InsufficientReservesError extends Error {\n public readonly isInsufficientReservesError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\n/**\n * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less\n * than the price of a single unit of output after fees.\n */\nexport class InsufficientInputAmountError extends Error {\n public readonly isInsufficientInputAmountError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n","import { BigintIsh, ChainId, Price, sqrt, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { pack, keccak256 } from '@ethersproject/solidity'\nimport { getCreate2Address } from '@ethersproject/address'\n\nimport { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY, FIVE, _997, _1000, ONE, ZERO } from '../constants'\nimport { InsufficientReservesError, InsufficientInputAmountError } from '../errors'\n\nexport const computePairAddress = ({\n factoryAddress,\n tokenA,\n tokenB\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n}): string => {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]),\n INIT_CODE_HASH\n )\n}\nexport class Pair {\n public readonly liquidityToken: Token\n private readonly tokenAmounts: [CurrencyAmount, CurrencyAmount]\n\n public static getAddress(tokenA: Token, tokenB: Token): string {\n return computePairAddress({ factoryAddress: FACTORY_ADDRESS, tokenA, tokenB })\n }\n\n public constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount) {\n const tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [currencyAmountA, tokenAmountB]\n : [tokenAmountB, currencyAmountA]\n this.liquidityToken = new Token(\n tokenAmounts[0].currency.chainId,\n Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency),\n 18,\n 'UNI-V2',\n 'Uniswap V2'\n )\n this.tokenAmounts = tokenAmounts as [CurrencyAmount, CurrencyAmount]\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0\n */\n public get token0Price(): Price {\n const result = this.tokenAmounts[1].divide(this.tokenAmounts[0])\n return new Price(this.token0, this.token1, result.denominator, result.numerator)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1\n */\n public get token1Price(): Price {\n const result = this.tokenAmounts[0].divide(this.tokenAmounts[1])\n return new Price(this.token1, this.token0, result.denominator, result.numerator)\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pair.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pair.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n public get token0(): Token {\n return this.tokenAmounts[0].currency\n }\n\n public get token1(): Token {\n return this.tokenAmounts[1].currency\n }\n\n public get reserve0(): CurrencyAmount {\n return this.tokenAmounts[0]\n }\n\n public get reserve1(): CurrencyAmount {\n return this.tokenAmounts[1]\n }\n\n public reserveOf(token: Token): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.reserve0 : this.reserve1\n }\n\n public getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) {\n throw new InsufficientReservesError()\n }\n const inputReserve = this.reserveOf(inputAmount.currency)\n const outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997)\n const numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient)\n const denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee)\n const outputAmount = CurrencyAmount.fromRawAmount(\n inputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.divide(numerator, denominator)\n )\n if (JSBI.equal(outputAmount.quotient, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(outputAmount.currency), 'TOKEN')\n if (\n JSBI.equal(this.reserve0.quotient, ZERO) ||\n JSBI.equal(this.reserve1.quotient, ZERO) ||\n JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)\n ) {\n throw new InsufficientReservesError()\n }\n\n const outputReserve = this.reserveOf(outputAmount.currency)\n const inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000)\n const denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997)\n const inputAmount = CurrencyAmount.fromRawAmount(\n outputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.add(JSBI.divide(numerator, denominator), ONE)\n )\n return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getLiquidityMinted(\n totalSupply: CurrencyAmount,\n tokenAmountA: CurrencyAmount,\n tokenAmountB: CurrencyAmount\n ): CurrencyAmount {\n invariant(totalSupply.currency.equals(this.liquidityToken), 'LIQUIDITY')\n const tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [tokenAmountA, tokenAmountB]\n : [tokenAmountB, tokenAmountA]\n invariant(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1), 'TOKEN')\n\n let liquidity: JSBI\n if (JSBI.equal(totalSupply.quotient, ZERO)) {\n liquidity = JSBI.subtract(\n sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)),\n MINIMUM_LIQUIDITY\n )\n } else {\n const amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient)\n const amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient)\n liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1\n }\n if (!JSBI.greaterThan(liquidity, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity)\n }\n\n public getLiquidityValue(\n token: Token,\n totalSupply: CurrencyAmount,\n liquidity: CurrencyAmount,\n feeOn: boolean = false,\n kLast?: BigintIsh\n ): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n invariant(totalSupply.currency.equals(this.liquidityToken), 'TOTAL_SUPPLY')\n invariant(liquidity.currency.equals(this.liquidityToken), 'LIQUIDITY')\n invariant(JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient), 'LIQUIDITY')\n\n let totalSupplyAdjusted: CurrencyAmount\n if (!feeOn) {\n totalSupplyAdjusted = totalSupply\n } else {\n invariant(!!kLast, 'K_LAST')\n const kLastParsed = JSBI.BigInt(kLast)\n if (!JSBI.equal(kLastParsed, ZERO)) {\n const rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient))\n const rootKLast = sqrt(kLastParsed)\n if (JSBI.greaterThan(rootK, rootKLast)) {\n const numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast))\n const denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast)\n const feeLiquidity = JSBI.divide(numerator, denominator)\n totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity))\n } else {\n totalSupplyAdjusted = totalSupply\n }\n } else {\n totalSupplyAdjusted = totalSupply\n }\n }\n\n return CurrencyAmount.fromRawAmount(\n token,\n JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)\n )\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\n\nimport { Pair } from './pair'\n\nexport class Route {\n public readonly pairs: Pair[]\n public readonly path: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n public constructor(pairs: Pair[], input: TInput, output: TOutput) {\n invariant(pairs.length > 0, 'PAIRS')\n const chainId: ChainId | number = pairs[0].chainId\n invariant(\n pairs.every(pair => pair.chainId === chainId),\n 'CHAIN_IDS'\n )\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pairs[0].involvesToken(wrappedInput), 'INPUT')\n invariant(\n typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(wrappedCurrency(output, chainId)),\n 'OUTPUT'\n )\n\n const path: Token[] = [wrappedInput]\n for (const [i, pair] of pairs.entries()) {\n const currentInput = path[i]\n invariant(currentInput.equals(pair.token0) || currentInput.equals(pair.token1), 'PATH')\n const output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0\n path.push(output)\n }\n\n this.pairs = pairs\n this.path = path\n this.input = input\n this.output = output\n }\n\n private _midPrice: Price | null = null\n\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n const prices: Price[] = []\n for (const [i, pair] of this.pairs.entries()) {\n prices.push(\n this.path[i].equals(pair.token0)\n ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient)\n : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)\n )\n }\n const reduced = prices.slice(1).reduce((accumulator, currentValue) => accumulator.multiply(currentValue), prices[0])\n return (this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator))\n }\n\n public get chainId(): ChainId | number {\n return this.pairs[0].chainId\n }\n}\n","import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import {\n ChainId,\n Currency,\n CurrencyAmount,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n wrappedCurrency,\n TradeType,\n wrappedCurrencyAmount\n} from '@uniswap/sdk-core'\nimport { computePriceImpact, Token } from '../../../../sdk-core'\nimport { ONE, ZERO } from '../constants'\nimport invariant from 'tiny-invariant'\n\nimport { Pair } from './pair'\nimport { Route } from './route'\n\n// minimal interface so the input output comparator may be shared across types\ninterface InputOutput {\n readonly inputAmount: CurrencyAmount\n readonly outputAmount: CurrencyAmount\n}\n\n// comparator function that allows sorting trades by their output amounts, in decreasing order, and then input amounts\n// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first\nexport function inputOutputComparator(\n a: InputOutput,\n b: InputOutput\n): number {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n return 0\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n const ioComp = inputOutputComparator(a, b)\n if (ioComp !== 0) {\n return ioComp\n }\n\n // consider lowest slippage next, since these are less likely to fail\n if (a.priceImpact.lessThan(b.priceImpact)) {\n return -1\n } else if (a.priceImpact.greaterThan(b.priceImpact)) {\n return 1\n }\n\n // finally consider the number of hops since each hop costs gas\n return a.route.path.length - b.route.path.length\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pairs.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public readonly executionPrice: Price\n /**\n * The percent difference between the mid price before the trade and the trade execution price.\n */\n public readonly priceImpact: Percent\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Trade {\n return new Trade(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Trade {\n return new Trade(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n public constructor(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ) {\n this.route = route\n this.tradeType = tradeType\n\n const tokenAmounts: CurrencyAmount[] = new Array(route.path.length)\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n tokenAmounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.path.length - 1; i++) {\n const pair = route.pairs[i]\n const [outputAmount] = pair.getOutputAmount(tokenAmounts[i])\n tokenAmounts[i + 1] = outputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n this.outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n tokenAmounts[tokenAmounts.length - 1].numerator,\n tokenAmounts[tokenAmounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n tokenAmounts[tokenAmounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.path.length - 1; i > 0; i--) {\n const pair = route.pairs[i - 1]\n const [inputAmount] = pair.getInputAmount(tokenAmounts[i])\n tokenAmounts[i - 1] = inputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(\n route.input,\n tokenAmounts[0].numerator,\n tokenAmounts[0].denominator\n )\n this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n this.executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n )\n this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount)\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactIn(\n pairs: Pair[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountIn.currency) && !currencyEquals(pair.token1, amountIn.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = pair.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (currencyEquals(amountOut.currency, tokenOut)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([...currentPairs, pair], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n Trade.bestTradeExactIn(\n pairsExcludingThisPair,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPairs, pair],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactOut(\n pairs: Pair[],\n currencyIn: TInput,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? (currencyIn as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountOut.currency) && !currencyEquals(pair.token1, amountOut.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = pair.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pair\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([pair, ...currentPairs], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n Trade.bestTradeExactOut(\n pairsExcludingThisPair,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pair, ...currentPairs],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { Currency, CurrencyAmount, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport { Trade } from 'entities'\nimport invariant from 'tiny-invariant'\nimport { Token } from '../../../sdk-core'\n\n/**\n * Options for producing the arguments to send call to the router.\n */\nexport interface TradeOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n allowedSlippage: Percent\n /**\n * How long the swap is valid until it expires, in seconds.\n * This will be used to produce a `deadline` parameter which is computed from when the swap call parameters\n * are generated.\n */\n ttl: number\n /**\n * The account that should receive the output of the swap.\n */\n recipient: string\n\n /**\n * Whether any of the tokens in the path are fee on transfer tokens, which should be handled with special methods\n */\n feeOnTransfer?: boolean\n}\n\nexport interface TradeOptionsDeadline extends Omit {\n /**\n * When the transaction expires.\n * This is an atlernate to specifying the ttl, for when you do not want to use local time.\n */\n deadline: number\n}\n\n/**\n * The parameters to use in the call to the Uniswap V2 Router to execute a trade.\n */\nexport interface SwapParameters {\n /**\n * The method to call on the Uniswap V2 Router.\n */\n methodName: string\n /**\n * The arguments to pass to the method, all hex encoded.\n */\n args: (string | string[])[]\n /**\n * The amount of wei to send in hex.\n */\n value: string\n}\n\nfunction toHex(currencyAmount: CurrencyAmount) {\n return `0x${currencyAmount.quotient.toString(16)}`\n}\n\nconst ZERO_HEX = '0x0'\n\n/**\n * Represents the Uniswap V2 Router, and has static methods for helping execute trades.\n */\nexport abstract class Router {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: TradeOptions | TradeOptionsDeadline\n ): SwapParameters {\n const etherIn = trade.inputAmount.currency.isEther\n const etherOut = trade.outputAmount.currency.isEther\n // the router does not support both ether in and out\n invariant(!(etherIn && etherOut), 'ETHER_IN_OUT')\n invariant(!('ttl' in options) || options.ttl > 0, 'TTL')\n\n const to: string = validateAndParseAddress(options.recipient)\n const amountIn: string = toHex(trade.maximumAmountIn(options.allowedSlippage))\n const amountOut: string = toHex(trade.minimumAmountOut(options.allowedSlippage))\n const path: string[] = trade.route.path.map((token: Token) => token.address)\n const deadline =\n 'ttl' in options\n ? `0x${(Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16)}`\n : `0x${options.deadline.toString(16)}`\n\n const useFeeOnTransfer = Boolean(options.feeOnTransfer)\n\n let methodName: string\n let args: (string | string[])[]\n let value: string\n switch (trade.tradeType) {\n case TradeType.EXACT_INPUT:\n if (etherIn) {\n methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'\n // (uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = useFeeOnTransfer\n ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens'\n : 'swapExactTokensForTokens'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n }\n break\n case TradeType.EXACT_OUTPUT:\n invariant(!useFeeOnTransfer, 'EXACT_OUT_FOT')\n if (etherIn) {\n methodName = 'swapETHForExactTokens'\n // (uint amountOut, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = 'swapTokensForExactETH'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = 'swapTokensForExactTokens'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n }\n break\n }\n return {\n methodName,\n args,\n value\n }\n }\n}\n"],"names":["FACTORY_ADDRESS","INIT_CODE_HASH","MINIMUM_LIQUIDITY","JSBI","BigInt","ZERO","ONE","FIVE","_997","_1000","CAN_SET_PROTOTYPE","Object","InsufficientReservesError","name","constructor","setPrototypeOf","prototype","Error","InsufficientInputAmountError","computePairAddress","factoryAddress","tokenA","tokenB","sortsBefore","token0","token1","getCreate2Address","keccak256","pack","address","Pair","currencyAmountA","tokenAmountB","tokenAmounts","currency","liquidityToken","Token","chainId","getAddress","involvesToken","token","equals","priceOf","invariant","token0Price","token1Price","reserveOf","reserve0","reserve1","getOutputAmount","inputAmount","equal","quotient","inputReserve","outputReserve","inputAmountWithFee","multiply","numerator","denominator","add","outputAmount","CurrencyAmount","fromRawAmount","divide","subtract","getInputAmount","greaterThanOrEqual","getLiquidityMinted","totalSupply","tokenAmountA","liquidity","sqrt","amount0","amount1","lessThanOrEqual","greaterThan","getLiquidityValue","feeOn","kLast","totalSupplyAdjusted","kLastParsed","rootK","rootKLast","feeLiquidity","result","Price","Route","pairs","input","output","length","every","pair","wrappedInput","wrappedCurrency","path","entries","i","currentInput","push","_midPrice","prices","reduced","slice","reduce","accumulator","currentValue","ChainId","TradeType","inputOutputComparator","a","b","currencyEquals","equalTo","lessThan","tradeComparator","ioComp","priceImpact","route","Trade","amount","tradeType","Array","EXACT_INPUT","wrappedCurrencyAmount","fromFractionalAmount","executionPrice","computePriceImpact","midPrice","exactIn","amountIn","exactOut","amountOut","EXACT_OUTPUT","minimumAmountOut","slippageTolerance","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","bestTradeExactIn","currencyAmountIn","currencyOut","currentPairs","nextAmountIn","bestTrades","maxNumResults","maxHops","isToken","undefined","tokenOut","error","isInsufficientInputAmountError","sortedInsert","pairsExcludingThisPair","concat","worstExecutionPrice","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","toHex","currencyAmount","toString","ZERO_HEX","Router","swapCallParameters","trade","options","etherIn","isEther","etherOut","ttl","to","validateAndParseAddress","recipient","allowedSlippage","map","deadline","Math","floor","Date","getTime","useFeeOnTransfer","Boolean","feeOnTransfer","methodName","args","value"],"mappings":";;;;;;;;;IAEaA,eAAe,GAAG;IAElBC,cAAc,GAAG;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;AACD,SALM,MAKA;AACLsB,UAAAA,UAAU,GAAG,0BAAb,CADK;;AAGLC,UAAAA,IAAI,GAAG,CAAC1D,SAAD,EAAYF,QAAZ,EAAsBnC,IAAtB,EAA4BiF,EAA5B,EAAgCK,QAAhC,CAAP;AACAU,UAAAA,KAAK,GAAGxB,QAAR;AACD;;AACD;AAvCJ;;AAyCA,WAAO;AACLsB,MAAAA,UAAU,EAAVA,UADK;AAELC,MAAAA,IAAI,EAAJA,IAFK;AAGLC,MAAAA,KAAK,EAALA;AAHK,KAAP;AAKD,GAhFH;;AAAA;AAAA;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/v2-sdk/package.json b/uniswap-packages-forks/v2-sdk/package.json new file mode 100644 index 00000000000..7400fda6b04 --- /dev/null +++ b/uniswap-packages-forks/v2-sdk/package.json @@ -0,0 +1,45 @@ +{ + "name": "@uniswap/v2-sdk", + "license": "MIT", + "version": "3.0.0-alpha.0", + "description": "🛠 An SDK for building applications on top of Uniswap V2", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "files": [ + "dist" + ], + "repository": "https://github.com/Uniswap/uniswap-v2-sdk.git", + "keywords": [ + "uniswap", + "ethereum" + ], + "module": "dist/v2-sdk.esm.js", + "scripts": { + "lint": "tsdx lint src test", + "build": "tsdx build", + "start": "tsdx watch", + "test": "tsdx test", + "prepublishOnly": "tsdx build" + }, + "dependencies": { + "@ethersproject/address": "^5.0.0", + "@ethersproject/solidity": "^5.0.0", + "@uniswap/sdk-core": "file:../sdk-core", + "tiny-invariant": "^1.1.0", + "tiny-warning": "^1.0.3" + }, + "devDependencies": { + "@types/big.js": "^4.0.5", + "@types/jest": "^24.0.25", + "@uniswap/v2-core": "^1.0.1", + "tsdx": "^0.14.1" + }, + "engines": { + "node": ">=10" + }, + "prettier": { + "printWidth": 120, + "semi": false, + "singleQuote": true + } +} diff --git a/uniswap-packages-forks/v3-sdk b/uniswap-packages-forks/v3-sdk deleted file mode 160000 index a15f43fd118..00000000000 --- a/uniswap-packages-forks/v3-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a15f43fd1185813612dc2eb15fcdb7fe987543f2 diff --git a/uniswap-packages-forks/v3-sdk/LICENSE b/uniswap-packages-forks/v3-sdk/LICENSE new file mode 100644 index 00000000000..b2517ee60b6 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Uniswap Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/uniswap-packages-forks/v3-sdk/README.md b/uniswap-packages-forks/v3-sdk/README.md new file mode 100644 index 00000000000..e86146cefd0 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/README.md @@ -0,0 +1,15 @@ +# Alpha software + +The latest version of the SDK is used in production in the Uniswap Interface, +but it is considered Alpha software and may contain bugs or change significantly between patch versions. +If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel of the Discord. +Pull requests welcome! + +# Uniswap V3 SDK + +[![Unit Tests](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3A%22Unit+Tests%22) +[![Lint](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3ALint) +[![npm version](https://img.shields.io/npm/v/@uniswap/v3-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v3-sdk/v/latest) +[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v3-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v3-sdk@latest) + +In-depth documentation on this SDK is available at [uniswap.org](https://docs.uniswap.org/). diff --git a/uniswap-packages-forks/v3-sdk/dist/constants.d.ts b/uniswap-packages-forks/v3-sdk/dist/constants.d.ts new file mode 100644 index 00000000000..06efe5739fd --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/constants.d.ts @@ -0,0 +1,17 @@ +export declare const FACTORY_ADDRESS = "0x1F98431c8aD98523631AE4a59f267346ea31F984"; +export declare const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000"; +export declare const POOL_INIT_CODE_HASH = "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54"; +/** + * The default factory enabled fee amounts, denominated in hundredths of bips. + */ +export declare enum FeeAmount { + LOW = 500, + MEDIUM = 3000, + HIGH = 10000 +} +/** + * The default factory tick spacings by fee amount. + */ +export declare const TICK_SPACINGS: { + [amount in FeeAmount]: number; +}; diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/index.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/index.d.ts new file mode 100644 index 00000000000..c4f1b2fa08d --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/entities/index.d.ts @@ -0,0 +1,7 @@ +export * from './pool'; +export * from './position'; +export * from './route'; +export * from './tick'; +export * from './trade'; +export * from './tickDataProvider'; +export * from './tickListDataProvider'; diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/pool.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/pool.d.ts new file mode 100644 index 00000000000..4f180cfe1a6 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/entities/pool.d.ts @@ -0,0 +1,65 @@ +import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'; +import JSBI from 'jsbi'; +import { FeeAmount } from '../constants'; +import { Tick, TickConstructorArgs } from './tick'; +import { TickDataProvider } from './tickDataProvider'; +/** + * Represents a V3 pool + */ +export declare class Pool { + readonly token0: Token; + readonly token1: Token; + readonly fee: FeeAmount; + readonly sqrtRatioX96: JSBI; + readonly liquidity: JSBI; + readonly tickCurrent: number; + readonly tickDataProvider: TickDataProvider; + private _token0Price?; + private _token1Price?; + static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount): string; + /** + * Construct a pool + * @param tokenA one of the tokens in the pool + * @param tokenB the other token in the pool + * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool + * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0 + * @param liquidity the current value of in range liquidity + * @param tickCurrent the current tick of the pool + * @param ticks the current state of the pool ticks or a data provider that can return tick data + */ + constructor(tokenA: Token, tokenB: Token, fee: FeeAmount, sqrtRatioX96: BigintIsh, liquidity: BigintIsh, tickCurrent: number, ticks?: TickDataProvider | (Tick | TickConstructorArgs)[]); + /** + * Returns true if the token is either token0 or token1 + * @param token to check + */ + involvesToken(token: Token): boolean; + /** + * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0 + */ + get token0Price(): Price; + /** + * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1 + */ + get token1Price(): Price; + /** + * Return the price of the given token in terms of the other token in the pool. + * @param token token to return price of + */ + priceOf(token: Token): Price; + /** + * Returns the chain ID of the tokens in the pool. + */ + get chainId(): ChainId | number; + /** + * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade + * @param inputAmount the input amount for which to quote the output amount + */ + getOutputAmount(inputAmount: CurrencyAmount, sqrtPriceLimitX96?: JSBI): Promise<[CurrencyAmount, Pool]>; + /** + * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade + * @param outputAmount the output amount for which to quote the input amount + */ + getInputAmount(outputAmount: CurrencyAmount, sqrtPriceLimitX96?: JSBI): Promise<[CurrencyAmount, Pool]>; + private swap; + get tickSpacing(): number; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/position.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/position.d.ts new file mode 100644 index 00000000000..fb662b55111 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/entities/position.d.ts @@ -0,0 +1,126 @@ +import { BigintIsh, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'; +import JSBI from 'jsbi'; +import { Pool } from './pool'; +interface PositionConstructorArgs { + pool: Pool; + tickLower: number; + tickUpper: number; + liquidity: BigintIsh; +} +/** + * Represents a position on a Uniswap V3 Pool + */ +export declare class Position { + readonly pool: Pool; + readonly tickLower: number; + readonly tickUpper: number; + readonly liquidity: JSBI; + private _token0Amount; + private _token1Amount; + private _mintAmounts; + /** + * Constructs a position for a given pool with the given liquidity + * @param pool for which pool the liquidity is assigned + * @param liquidity the amount of liquidity that is in the position + * @param tickLower the lower tick of the position + * @param tickUpper the upper tick of the position + */ + constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs); + /** + * Returns the price of token0 at the lower tick + */ + get token0PriceLower(): Price; + /** + * Returns the price of token0 at the upper tick + */ + get token0PriceUpper(): Price; + /** + * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price + */ + get amount0(): CurrencyAmount; + /** + * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price + */ + get amount1(): CurrencyAmount; + /** + * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage + * @param slippageTolerance amount by which the price can 'slip' + * @private + */ + private ratiosAfterSlippage; + /** + * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position + * with the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the current price + */ + mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ + amount0: JSBI; + amount1: JSBI; + }>; + /** + * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the + * position with the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the current price + */ + burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ + amount0: JSBI; + amount1: JSBI; + }>; + /** + * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at + * the current price for the pool + */ + get mintAmounts(): Readonly<{ + amount0: JSBI; + amount1: JSBI; + }>; + /** + * Computes the maximum amount of liquidity received for a given amount of token0, token1, + * and the prices at the tick boundaries. + * @param pool the pool for which the position should be created + * @param tickLower the lower tick of the position + * @param tickUpper the upper tick of the position + * @param amount0 token0 amount + * @param amount1 token1 amount + * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ + static fromAmounts({ pool, tickLower, tickUpper, amount0, amount1, useFullPrecision }: { + pool: Pool; + tickLower: number; + tickUpper: number; + amount0: BigintIsh; + amount1: BigintIsh; + useFullPrecision: boolean; + }): Position; + /** + * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1 + * @param pool the pool for which the position is created + * @param tickLower the lower tick + * @param tickUpper the upper tick + * @param amount0 the desired amount of token0 + * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ + static fromAmount0({ pool, tickLower, tickUpper, amount0, useFullPrecision }: { + pool: Pool; + tickLower: number; + tickUpper: number; + amount0: BigintIsh; + useFullPrecision: boolean; + }): Position; + /** + * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0 + * @param pool the pool for which the position is created + * @param tickLower the lower tick + * @param tickUpper the upper tick + * @param amount1 the desired amount of token1 + */ + static fromAmount1({ pool, tickLower, tickUpper, amount1 }: { + pool: Pool; + tickLower: number; + tickUpper: number; + amount1: BigintIsh; + }): Position; +} +export {}; diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/route.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/route.d.ts new file mode 100644 index 00000000000..6b669a1424e --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/entities/route.d.ts @@ -0,0 +1,26 @@ +import { ChainId, Currency, Price, Token } from '@uniswap/sdk-core'; +import { Pool } from './pool'; +/** + * Represents a list of pools through which a swap can occur + */ +export declare class Route { + readonly pools: Pool[]; + readonly tokenPath: Token[]; + readonly input: TInput; + readonly output: TOutput; + private _midPrice; + constructor(pools: Pool[], input: TInput, output: TOutput); + get chainId(): ChainId | number; + /** + * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token. + */ + get inputToken(): Token; + /** + * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token. + */ + get outputToken(): Token; + /** + * Returns the mid price of the route + */ + get midPrice(): Price; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/tick.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/tick.d.ts new file mode 100644 index 00000000000..09111bde211 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/entities/tick.d.ts @@ -0,0 +1,13 @@ +import JSBI from 'jsbi'; +import { BigintIsh } from '@uniswap/sdk-core'; +export interface TickConstructorArgs { + index: number; + liquidityGross: BigintIsh; + liquidityNet: BigintIsh; +} +export declare class Tick { + readonly index: number; + readonly liquidityGross: JSBI; + readonly liquidityNet: JSBI; + constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs); +} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/tickDataProvider.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/tickDataProvider.d.ts new file mode 100644 index 00000000000..e4fe45d4f27 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/entities/tickDataProvider.d.ts @@ -0,0 +1,31 @@ +import { BigintIsh } from '@uniswap/sdk-core'; +/** + * Provides information about ticks + */ +export interface TickDataProvider { + /** + * Return information corresponding to a specific tick + * @param tick the tick to load + */ + getTick(tick: number): Promise<{ + liquidityNet: BigintIsh; + }>; + /** + * Return the next tick that is initialized within a single word + * @param tick the current tick + * @param lte whether the next tick should be lte the current tick + * @param tickSpacing the tick spacing of the pool + */ + nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>; +} +/** + * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you + * do not need to load tick data for your use case. + */ +export declare class NoTickDataProvider implements TickDataProvider { + private static ERROR_MESSAGE; + getTick(_tick: number): Promise<{ + liquidityNet: BigintIsh; + }>; + nextInitializedTickWithinOneWord(_tick: number, _lte: boolean, _tickSpacing: number): Promise<[number, boolean]>; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/tickListDataProvider.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/tickListDataProvider.d.ts new file mode 100644 index 00000000000..5da766691cb --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/entities/tickListDataProvider.d.ts @@ -0,0 +1,15 @@ +import { BigintIsh } from '@uniswap/sdk-core'; +import { Tick, TickConstructorArgs } from './tick'; +import { TickDataProvider } from './tickDataProvider'; +/** + * A data provider for ticks that is backed by an in-memory array of ticks. + */ +export declare class TickListDataProvider implements TickDataProvider { + private ticks; + constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number); + getTick(tick: number): Promise<{ + liquidityNet: BigintIsh; + liquidityGross: BigintIsh; + }>; + nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/trade.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/trade.d.ts new file mode 100644 index 00000000000..eba5b5b5f82 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/entities/trade.d.ts @@ -0,0 +1,132 @@ +import { Currency, Percent, Price, CurrencyAmount, TradeType } from '@uniswap/sdk-core'; +import { Pool } from './pool'; +import { Route } from './route'; +export declare function tradeComparator(a: Trade, b: Trade): number; +export interface BestTradeOptions { + maxNumResults?: number; + maxHops?: number; +} +/** + * Represents a trade executed against a list of pools. + * Does not account for slippage, i.e. trades that front run this trade and move the price. + */ +export declare class Trade { + /** + * The route of the trade, i.e. which pools the trade goes through. + */ + readonly route: Route; + /** + * The type of the trade, either exact in or exact out. + */ + readonly tradeType: TTradeType; + /** + * The input amount for the trade assuming no slippage. + */ + readonly inputAmount: CurrencyAmount; + /** + * The output amount for the trade assuming no slippage. + */ + readonly outputAmount: CurrencyAmount; + /** + * The cached result of the computed execution price + * @private + */ + private _executionPrice; + /** + * The price expressed in terms of output amount/input amount. + */ + get executionPrice(): Price; + /** + * The cached result of the price impact computation + * @private + */ + private _priceImpact; + /** + * Returns the percent difference between the route's mid price and the price impact + */ + get priceImpact(): Percent; + /** + * Constructs an exact in trade with the given amount in and route + * @param route route of the exact in trade + * @param amountIn the amount being passed in + */ + static exactIn(route: Route, amountIn: CurrencyAmount): Promise>; + /** + * Constructs an exact out trade with the given amount out and route + * @param route route of the exact out trade + * @param amountOut the amount returned by the trade + */ + static exactOut(route: Route, amountOut: CurrencyAmount): Promise>; + /** + * Constructs a trade by simulating swaps through the given route + * @param route route to swap through + * @param amount the amount specified, either input or output, depending on tradeType + * @param tradeType whether the trade is an exact input or exact output swap + */ + static fromRoute(route: Route, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount, tradeType: TTradeType): Promise>; + /** + * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade + * elsewhere and do not have any tick data + * @param constructorArguments the arguments passed to the trade constructor + */ + static createUncheckedTrade(constructorArguments: { + route: Route; + inputAmount: CurrencyAmount; + outputAmount: CurrencyAmount; + tradeType: TTradeType; + }): Trade; + /** + * Construct a trade by passing in the pre-computed property values + * @param route the route through which the trade occurs + * @param inputAmount the amount of input paid in the trade + * @param outputAmount the amount of output received in the trade + * @param tradeType the type of trade, exact input or exact output + */ + private constructor(); + /** + * Get the minimum amount that must be received from this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + minimumAmountOut(slippageTolerance: Percent): CurrencyAmount; + /** + * Get the maximum amount in that can be spent via this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + maximumAmountIn(slippageTolerance: Percent): CurrencyAmount; + /** + * Return the execution price after accounting for slippage tolerance + * @param slippageTolerance the allowed tolerated slippage + */ + worstExecutionPrice(slippageTolerance: Percent): Price; + /** + * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token + * amount to an output token, making at most `maxHops` hops. + * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pools the pools to consider in finding the best trade + * @param nextAmountIn exact amount of input currency to spend + * @param currencyOut the desired currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool + * @param currentPools used in recursion; the current list of pools + * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter + * @param bestTrades used in recursion; the current list of best trades + */ + static bestTradeExactIn(pools: Pool[], currencyAmountIn: CurrencyAmount, currencyOut: TOutput, { maxNumResults, maxHops }?: BestTradeOptions, currentPools?: Pool[], nextAmountIn?: CurrencyAmount, bestTrades?: Trade[]): Promise[]>; + /** + * similar to the above method but instead targets a fixed output amount + * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token + * to an output token amount, making at most `maxHops` hops + * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pools the pools to consider in finding the best trade + * @param currencyIn the currency to spend + * @param currencyAmountOut the desired currency amount out + * @param nextAmountOut the exact amount of currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool + * @param currentPools used in recursion; the current list of pools + * @param bestTrades used in recursion; the current list of best trades + */ + static bestTradeExactOut(pools: Pool[], currencyIn: Currency, currencyAmountOut: CurrencyAmount, { maxNumResults, maxHops }?: BestTradeOptions, currentPools?: Pool[], nextAmountOut?: CurrencyAmount, bestTrades?: Trade[]): Promise[]>; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/index.d.ts b/uniswap-packages-forks/v3-sdk/dist/index.d.ts new file mode 100644 index 00000000000..d15c4ceb3c8 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/index.d.ts @@ -0,0 +1,5 @@ +export * from './entities'; +export * from './utils'; +export * from './constants'; +export * from './nonfungiblePositionManager'; +export * from './swapRouter'; diff --git a/uniswap-packages-forks/v3-sdk/dist/index.js b/uniswap-packages-forks/v3-sdk/dist/index.js new file mode 100644 index 00000000000..75a03f96f26 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/index.js @@ -0,0 +1,8 @@ + +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./v3-sdk.cjs.production.min.js') +} else { + module.exports = require('./v3-sdk.cjs.development.js') +} diff --git a/uniswap-packages-forks/v3-sdk/dist/internalConstants.d.ts b/uniswap-packages-forks/v3-sdk/dist/internalConstants.d.ts new file mode 100644 index 00000000000..7d0080c93e1 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/internalConstants.d.ts @@ -0,0 +1,6 @@ +import JSBI from 'jsbi'; +export declare const NEGATIVE_ONE: JSBI; +export declare const ZERO: JSBI; +export declare const ONE: JSBI; +export declare const Q96: JSBI; +export declare const Q192: JSBI; diff --git a/uniswap-packages-forks/v3-sdk/dist/nonfungiblePositionManager.d.ts b/uniswap-packages-forks/v3-sdk/dist/nonfungiblePositionManager.d.ts new file mode 100644 index 00000000000..b8b442050b2 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/nonfungiblePositionManager.d.ts @@ -0,0 +1,123 @@ +import { BigintIsh, Percent, CurrencyAmount, Currency } from '@uniswap/sdk-core'; +import { Position } from './entities/position'; +import { MethodParameters } from './utils/calldata'; +import { Interface } from '@ethersproject/abi'; +import { PermitOptions, SelfPermit } from './selfPermit'; +export interface MintSpecificOptions { + /** + * The account that should receive the minted NFT. + */ + recipient: string; + /** + * Creates pool if not initialized before mint. + */ + createPool?: boolean; +} +export interface IncreaseSpecificOptions { + /** + * Indicates the ID of the position to increase liquidity for. + */ + tokenId: BigintIsh; +} +/** + * Options for producing the calldata to add liquidity. + */ +export interface CommonAddLiquidityOptions { + /** + * How much the pool price is allowed to move. + */ + slippageTolerance: Percent; + /** + * When the transaction expires, in epoch seconds. + */ + deadline: BigintIsh; + /** + * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false + */ + useEther?: boolean; + /** + * The optional permit parameters for spending token0 + */ + token0Permit?: PermitOptions; + /** + * The optional permit parameters for spending token1 + */ + token1Permit?: PermitOptions; +} +export declare type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions; +export declare type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions; +export declare type AddLiquidityOptions = MintOptions | IncreaseOptions; +export interface CollectOptions { + /** + * Indicates the ID of the position to collect for. + */ + tokenId: BigintIsh; + /** + * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned + */ + expectedCurrencyOwed0: CurrencyAmount; + /** + * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned + */ + expectedCurrencyOwed1: CurrencyAmount; + /** + * The account that should receive the tokens. + */ + recipient: string; +} +export interface NFTPermitOptions { + v: 0 | 1 | 27 | 28; + r: string; + s: string; + deadline: BigintIsh; + spender: string; +} +/** + * Options for producing the calldata to exit a position. + */ +export interface RemoveLiquidityOptions { + /** + * The ID of the token to exit + */ + tokenId: BigintIsh; + /** + * The percentage of position liquidity to exit. + */ + liquidityPercentage: Percent; + /** + * How much the pool price is allowed to move. + */ + slippageTolerance: Percent; + /** + * When the transaction expires, in epoch seconds. + */ + deadline: BigintIsh; + /** + * Whether the NFT should be burned if the entire position is being exited, by default false. + */ + burnToken?: boolean; + /** + * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT + */ + permit?: NFTPermitOptions; + /** + * Parameters to be passed on to collect + */ + collectOptions: Omit; +} +export declare abstract class NonfungiblePositionManager extends SelfPermit { + static INTERFACE: Interface; + /** + * Cannot be constructed. + */ + private constructor(); + static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters; + private static encodeCollect; + static collectCallParameters(options: CollectOptions): MethodParameters; + /** + * Produces the calldata for completely or partially exiting a position + * @param position the position to exit + * @param options additional information necessary for generating the calldata + */ + static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/selfPermit.d.ts b/uniswap-packages-forks/v3-sdk/dist/selfPermit.d.ts new file mode 100644 index 00000000000..e4ea1fd8f6b --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/selfPermit.d.ts @@ -0,0 +1,22 @@ +import { BigintIsh, Token } from '@uniswap/sdk-core'; +import { Interface } from '@ethersproject/abi'; +export interface StandardPermitArguments { + v: 0 | 1 | 27 | 28; + r: string; + s: string; + amount: BigintIsh; + deadline: BigintIsh; +} +export interface AllowedPermitArguments { + v: 0 | 1 | 27 | 28; + r: string; + s: string; + nonce: BigintIsh; + expiry: BigintIsh; +} +export declare type PermitOptions = StandardPermitArguments | AllowedPermitArguments; +export declare abstract class SelfPermit { + static INTERFACE: Interface; + protected constructor(); + protected static encodePermit(token: Token, options: PermitOptions): string; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/swapRouter.d.ts b/uniswap-packages-forks/v3-sdk/dist/swapRouter.d.ts new file mode 100644 index 00000000000..e7887de28af --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/swapRouter.d.ts @@ -0,0 +1,60 @@ +import { Interface } from '@ethersproject/abi'; +import { BigintIsh, Currency, Percent, TradeType } from '@uniswap/sdk-core'; +import { Trade } from './entities/trade'; +import { PermitOptions, SelfPermit } from './selfPermit'; +import { MethodParameters } from './utils/calldata'; +export interface FeeOptions { + /** + * The percent of the output that will be taken as a fee. + */ + fee: Percent; + /** + * The recipient of the fee. + */ + recipient: string; +} +/** + * Options for producing the arguments to send calls to the router. + */ +export interface SwapOptions { + /** + * How much the execution price is allowed to move unfavorably from the trade execution price. + */ + slippageTolerance: Percent; + /** + * The account that should receive the output. + */ + recipient: string; + /** + * When the transaction expires, in epoch seconds. + */ + deadline: BigintIsh; + /** + * The optional permit parameters for spending the input. + */ + inputTokenPermit?: PermitOptions; + /** + * The optional price limit for the trade. + */ + sqrtPriceLimitX96?: BigintIsh; + /** + * Optional information for taking a fee on output. + */ + fee?: FeeOptions; +} +/** + * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades. + */ +export declare abstract class SwapRouter extends SelfPermit { + static INTERFACE: Interface; + /** + * Cannot be constructed. + */ + private constructor(); + /** + * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. + * @param trade to produce call parameters for + * @param options options for the call parameters + */ + static swapCallParameters(trade: Trade, options: SwapOptions): MethodParameters; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/calldata.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/calldata.d.ts new file mode 100644 index 00000000000..809c60841e9 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/calldata.d.ts @@ -0,0 +1,15 @@ +import { BigintIsh } from '@uniswap/sdk-core'; +/** + * Generated method parameters for executing a call. + */ +export interface MethodParameters { + /** + * The hex encoded calldata to perform the given operation + */ + calldata: string; + /** + * The amount of ether (wei) to send in hex. + */ + value: string; +} +export declare function toHex(bigintIsh: BigintIsh): string; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/computePoolAddress.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/computePoolAddress.d.ts new file mode 100644 index 00000000000..8e089714c0c --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/computePoolAddress.d.ts @@ -0,0 +1,8 @@ +import { Token } from '@uniswap/sdk-core'; +import { FeeAmount } from '../constants'; +export declare function computePoolAddress({ factoryAddress, tokenA, tokenB, fee }: { + factoryAddress: string; + tokenA: Token; + tokenB: Token; + fee: FeeAmount; +}): string; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/encodeRouteToPath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/encodeRouteToPath.d.ts new file mode 100644 index 00000000000..4a8180268fd --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/encodeRouteToPath.d.ts @@ -0,0 +1,8 @@ +import { Currency } from '@uniswap/sdk-core'; +import { Route } from '../entities/route'; +/** + * Converts a route to a hex encoded path + * @param route the v3 path to convert to an encoded path + * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps + */ +export declare function encodeRouteToPath(route: Route, exactOutput: boolean): string; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts new file mode 100644 index 00000000000..e51a815ccfb --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts @@ -0,0 +1,8 @@ +import JSBI from 'jsbi'; +import { BigintIsh } from '@uniswap/sdk-core'; +/** + * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0 + * @param amount1 the numerator amount, i.e. amount of token1 + * @param amount0 the denominator amount, i.en amount of token0 + */ +export declare function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/fullMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/fullMath.d.ts new file mode 100644 index 00000000000..7dc3f165793 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/fullMath.d.ts @@ -0,0 +1,8 @@ +import JSBI from 'jsbi'; +export declare abstract class FullMath { + /** + * Cannot be constructed. + */ + private constructor(); + static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/index.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/index.d.ts new file mode 100644 index 00000000000..fbac3347e55 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/index.d.ts @@ -0,0 +1,14 @@ +export * from './calldata'; +export * from './computePoolAddress'; +export * from './encodeRouteToPath'; +export * from './encodeSqrtRatioX96'; +export * from './fullMath'; +export * from './isSorted'; +export * from './liquidityMath'; +export * from './maxLiquidityForAmounts'; +export * from './mostSignificantBit'; +export * from './nearestUsableTick'; +export * from './priceTickConversions'; +export * from './sqrtPriceMath'; +export * from './tickMath'; +export * from './tickList'; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/isSorted.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/isSorted.d.ts new file mode 100644 index 00000000000..6e7de016178 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/isSorted.d.ts @@ -0,0 +1 @@ +export declare function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/liquidityMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/liquidityMath.d.ts new file mode 100644 index 00000000000..d30a468476d --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/liquidityMath.d.ts @@ -0,0 +1,8 @@ +import JSBI from 'jsbi'; +export declare abstract class LiquidityMath { + /** + * Cannot be constructed. + */ + private constructor(); + static addDelta(x: JSBI, y: JSBI): JSBI; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/maxLiquidityForAmounts.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/maxLiquidityForAmounts.d.ts new file mode 100644 index 00000000000..126477ce35a --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/maxLiquidityForAmounts.d.ts @@ -0,0 +1,14 @@ +import { BigintIsh } from '@uniswap/sdk-core'; +import JSBI from 'jsbi'; +/** + * Computes the maximum amount of liquidity received for a given amount of token0, token1, + * and the prices at the tick boundaries. + * @param sqrtRatioCurrentX96 the current price + * @param sqrtRatioAX96 price at lower boundary + * @param sqrtRatioBX96 price at upper boundary + * @param amount0 token0 amount + * @param amount1 token1 amount + * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ +export declare function maxLiquidityForAmounts(sqrtRatioCurrentX96: JSBI, sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh, amount1: BigintIsh, useFullPrecision: boolean): JSBI; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/mostSignificantBit.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/mostSignificantBit.d.ts new file mode 100644 index 00000000000..151cce9e8ae --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/mostSignificantBit.d.ts @@ -0,0 +1,2 @@ +import JSBI from 'jsbi'; +export declare function mostSignificantBit(x: JSBI): number; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/nearestUsableTick.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/nearestUsableTick.d.ts new file mode 100644 index 00000000000..eeb1c51d2da --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/nearestUsableTick.d.ts @@ -0,0 +1,6 @@ +/** + * Returns the closest tick that is nearest a given tick and usable for the given tick spacing + * @param tick the target tick + * @param tickSpacing the spacing of the pool + */ +export declare function nearestUsableTick(tick: number, tickSpacing: number): number; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/priceTickConversions.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/priceTickConversions.d.ts new file mode 100644 index 00000000000..e9179b296e9 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/priceTickConversions.d.ts @@ -0,0 +1,15 @@ +import { Price, Token } from '@uniswap/sdk-core'; +/** + * Returns a price object corresponding to the input tick and the base/quote token + * Inputs must be tokens because the address order is used to interpret the price represented by the tick + * @param baseToken the base token of the price + * @param quoteToken the quote token of the price + * @param tick the tick for which to return the price + */ +export declare function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price; +/** + * Returns the first tick for which the given price is greater than or equal to the tick price + * @param price for which to return the closest tick that represents a price less than or equal to the input price, + * i.e. the price of the returned tick is less than or equal to the input price + */ +export declare function priceToClosestTick(price: Price): number; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/sqrtPriceMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/sqrtPriceMath.d.ts new file mode 100644 index 00000000000..da01c181216 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/sqrtPriceMath.d.ts @@ -0,0 +1,13 @@ +import JSBI from 'jsbi'; +export declare abstract class SqrtPriceMath { + /** + * Cannot be constructed. + */ + private constructor(); + static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI; + static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI; + static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI; + static getNextSqrtPriceFromOutput(sqrtPX96: JSBI, liquidity: JSBI, amountOut: JSBI, zeroForOne: boolean): JSBI; + private static getNextSqrtPriceFromAmount0RoundingUp; + private static getNextSqrtPriceFromAmount1RoundingDown; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/swapMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/swapMath.d.ts new file mode 100644 index 00000000000..ec6f962043e --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/swapMath.d.ts @@ -0,0 +1,9 @@ +import JSBI from 'jsbi'; +import { FeeAmount } from '../constants'; +export declare abstract class SwapMath { + /** + * Cannot be constructed. + */ + private constructor(); + static computeSwapStep(sqrtRatioCurrentX96: JSBI, sqrtRatioTargetX96: JSBI, liquidity: JSBI, amountRemaining: JSBI, feePips: FeeAmount): [JSBI, JSBI, JSBI, JSBI]; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/tickList.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/tickList.d.ts new file mode 100644 index 00000000000..b022f92dc3c --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/tickList.d.ts @@ -0,0 +1,23 @@ +import { Tick } from '../entities/tick'; +/** + * Utility methods for interacting with sorted lists of ticks + */ +export declare abstract class TickList { + /** + * Cannot be constructed + */ + private constructor(); + static validateList(ticks: Tick[], tickSpacing: number): void; + static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean; + static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean; + static getTick(ticks: readonly Tick[], index: number): Tick; + /** + * Finds the largest tick in the list of ticks that is less than or equal to tick + * @param ticks list of ticks + * @param tick tick to find the largest tick that is less than or equal to tick + * @private + */ + private static binarySearch; + static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick; + static nextInitializedTickWithinOneWord(ticks: readonly Tick[], tick: number, lte: boolean, tickSpacing: number): [number, boolean]; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/tickMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/tickMath.d.ts new file mode 100644 index 00000000000..fb7e763a622 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/utils/tickMath.d.ts @@ -0,0 +1,34 @@ +import JSBI from 'jsbi'; +export declare abstract class TickMath { + /** + * Cannot be constructed. + */ + private constructor(); + /** + * The minimum tick that can be used on any pool. + */ + static MIN_TICK: number; + /** + * The maximum tick that can be used on any pool. + */ + static MAX_TICK: number; + /** + * The sqrt ratio corresponding to the minimum tick that could be used on any pool. + */ + static MIN_SQRT_RATIO: JSBI; + /** + * The sqrt ratio corresponding to the maximum tick that could be used on any pool. + */ + static MAX_SQRT_RATIO: JSBI; + /** + * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick + * @param tick the tick for which to compute the sqrt ratio + */ + static getSqrtRatioAtTick(tick: number): JSBI; + /** + * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96 + * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96 + * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick + */ + static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number; +} diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js new file mode 100644 index 00000000000..ab463a7b1b8 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js @@ -0,0 +1,3389 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var sdkCore = require('@uniswap/sdk-core'); +var JSBI = _interopDefault(require('jsbi')); +var invariant = _interopDefault(require('tiny-invariant')); +var abi = require('@ethersproject/abi'); +var address = require('@ethersproject/address'); +var solidity = require('@ethersproject/solidity'); +var NonfungiblePositionManager_json = require('@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'); +var ISelfPermit_json = require('@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'); +var SwapRouter_json = require('@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'); + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} + +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + + _next(undefined); + }); + }; +} + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +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) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; +} + +function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it; + + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + it = o[Symbol.iterator](); + return it.next.bind(it); +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var runtime_1 = createCommonjsModule(function (module) { +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +var runtime = (function (exports) { + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined$1; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + function define(obj, key, value) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + return obj[key]; + } + try { + // IE 8 has a broken Object.defineProperty that only works on DOM objects. + define({}, ""); + } catch (err) { + define = function(obj, key, value) { + return obj[key] = value; + }; + } + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + exports.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = define( + GeneratorFunctionPrototype, + toStringTagSymbol, + "GeneratorFunction" + ); + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + define(prototype, method, function(arg) { + return this._invoke(method, arg); + }); + }); + } + + exports.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + exports.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + define(genFun, toStringTagSymbol, "GeneratorFunction"); + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return PromiseImpl.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return PromiseImpl.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function(error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + exports.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { + if (PromiseImpl === void 0) PromiseImpl = Promise; + + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList), + PromiseImpl + ); + + return exports.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined$1) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + // Note: ["return"] must be used for ES3 parsing compatibility. + if (delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined$1; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined$1; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + define(Gp, toStringTagSymbol, "Generator"); + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + exports.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined$1; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + exports.values = values; + + function doneResult() { + return { value: undefined$1, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined$1; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined$1; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined$1; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined$1; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined$1; + } + + return ContinueSentinel; + } + }; + + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + +}( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + module.exports +)); + +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + Function("r", "regeneratorRuntime = r")(runtime); +} +}); + +var _TICK_SPACINGS; + +var FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'; +var ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'; +var POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'; + +(function (FeeAmount) { + FeeAmount[FeeAmount["LOW"] = 500] = "LOW"; + FeeAmount[FeeAmount["MEDIUM"] = 3000] = "MEDIUM"; + FeeAmount[FeeAmount["HIGH"] = 10000] = "HIGH"; +})(exports.FeeAmount || (exports.FeeAmount = {})); +/** + * The default factory tick spacings by fee amount. + */ + + +var TICK_SPACINGS = (_TICK_SPACINGS = {}, _TICK_SPACINGS[exports.FeeAmount.LOW] = 10, _TICK_SPACINGS[exports.FeeAmount.MEDIUM] = 60, _TICK_SPACINGS[exports.FeeAmount.HIGH] = 200, _TICK_SPACINGS); + +var NEGATIVE_ONE = /*#__PURE__*/JSBI.BigInt(-1); +var ZERO = /*#__PURE__*/JSBI.BigInt(0); +var ONE = /*#__PURE__*/JSBI.BigInt(1); // used in liquidity amount math + +var Q96 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(96)); +var Q192 = /*#__PURE__*/JSBI.exponentiate(Q96, /*#__PURE__*/JSBI.BigInt(2)); + +function computePoolAddress(_ref) { + var factoryAddress = _ref.factoryAddress, + tokenA = _ref.tokenA, + tokenB = _ref.tokenB, + fee = _ref.fee; + + var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], + token0 = _ref2[0], + token1 = _ref2[1]; // does safety checks + + + return address.getCreate2Address(factoryAddress, solidity.keccak256(['bytes'], [abi.defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]), POOL_INIT_CODE_HASH); +} + +var LiquidityMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function LiquidityMath() {} + + LiquidityMath.addDelta = function addDelta(x, y) { + if (JSBI.lessThan(y, ZERO)) { + return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE)); + } else { + return JSBI.add(x, y); + } + }; + + return LiquidityMath; +}(); + +var FullMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function FullMath() {} + + FullMath.mulDivRoundingUp = function mulDivRoundingUp(a, b, denominator) { + var product = JSBI.multiply(a, b); + var result = JSBI.divide(product, denominator); + if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE); + return result; + }; + + return FullMath; +}(); + +var MaxUint160 = /*#__PURE__*/JSBI.subtract( /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(160)), ONE); + +function multiplyIn256(x, y) { + var product = JSBI.multiply(x, y); + return JSBI.bitwiseAnd(product, sdkCore.MaxUint256); +} + +function addIn256(x, y) { + var sum = JSBI.add(x, y); + return JSBI.bitwiseAnd(sum, sdkCore.MaxUint256); +} + +var SqrtPriceMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function SqrtPriceMath() {} + + SqrtPriceMath.getAmount0Delta = function getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, liquidity, roundUp) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref[0]; + sqrtRatioBX96 = _ref[1]; + } + + var numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96)); + var numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96); + return roundUp ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96) : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96); + }; + + SqrtPriceMath.getAmount1Delta = function getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, liquidity, roundUp) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref2 = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref2[0]; + sqrtRatioBX96 = _ref2[1]; + } + + return roundUp ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96) : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96); + }; + + SqrtPriceMath.getNextSqrtPriceFromInput = function getNextSqrtPriceFromInput(sqrtPX96, liquidity, amountIn, zeroForOne) { + !JSBI.greaterThan(sqrtPX96, ZERO) ? invariant(false) : void 0; + !JSBI.greaterThan(liquidity, ZERO) ? invariant(false) : void 0; + return zeroForOne ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true) : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true); + }; + + SqrtPriceMath.getNextSqrtPriceFromOutput = function getNextSqrtPriceFromOutput(sqrtPX96, liquidity, amountOut, zeroForOne) { + !JSBI.greaterThan(sqrtPX96, ZERO) ? invariant(false) : void 0; + !JSBI.greaterThan(liquidity, ZERO) ? invariant(false) : void 0; + return zeroForOne ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false) : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false); + }; + + SqrtPriceMath.getNextSqrtPriceFromAmount0RoundingUp = function getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amount, add) { + if (JSBI.equal(amount, ZERO)) return sqrtPX96; + var numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96)); + + if (add) { + var product = multiplyIn256(amount, sqrtPX96); + + if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) { + var denominator = addIn256(numerator1, product); + + if (JSBI.greaterThanOrEqual(denominator, numerator1)) { + return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator); + } + } + + return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount)); + } else { + var _product = multiplyIn256(amount, sqrtPX96); + + !JSBI.equal(JSBI.divide(_product, amount), sqrtPX96) ? invariant(false) : void 0; + !JSBI.greaterThan(numerator1, _product) ? invariant(false) : void 0; + + var _denominator = JSBI.subtract(numerator1, _product); + + return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, _denominator); + } + }; + + SqrtPriceMath.getNextSqrtPriceFromAmount1RoundingDown = function getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amount, add) { + if (add) { + var quotient = JSBI.lessThanOrEqual(amount, MaxUint160) ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity) : JSBI.divide(JSBI.multiply(amount, Q96), liquidity); + return JSBI.add(sqrtPX96, quotient); + } else { + var _quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity); + + !JSBI.greaterThan(sqrtPX96, _quotient) ? invariant(false) : void 0; + return JSBI.subtract(sqrtPX96, _quotient); + } + }; + + return SqrtPriceMath; +}(); + +var MAX_FEE = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(10), /*#__PURE__*/JSBI.BigInt(6)); +var SwapMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function SwapMath() {} + + SwapMath.computeSwapStep = function computeSwapStep(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, amountRemaining, feePips) { + var returnValues = {}; + var zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96); + var exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO); + + if (exactIn) { + var amountRemainingLessFee = JSBI.divide(JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))), MAX_FEE); + returnValues.amountIn = zeroForOne ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true) : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true); + + if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn)) { + returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96; + } else { + returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(sqrtRatioCurrentX96, liquidity, amountRemainingLessFee, zeroForOne); + } + } else { + returnValues.amountOut = zeroForOne ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false) : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false); + + if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) { + returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96; + } else { + returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtRatioCurrentX96, liquidity, JSBI.multiply(amountRemaining, NEGATIVE_ONE), zeroForOne); + } + } + + var max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96); + + if (zeroForOne) { + returnValues.amountIn = max && exactIn ? returnValues.amountIn : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true); + returnValues.amountOut = max && !exactIn ? returnValues.amountOut : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false); + } else { + returnValues.amountIn = max && exactIn ? returnValues.amountIn : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true); + returnValues.amountOut = max && !exactIn ? returnValues.amountOut : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false); + } + + if (!exactIn && JSBI.greaterThan(returnValues.amountOut, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) { + returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE); + } + + if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) { + // we didn't reach the target, so take the remainder of the maximum input as fee + returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn); + } else { + returnValues.feeAmount = FullMath.mulDivRoundingUp(returnValues.amountIn, JSBI.BigInt(feePips), JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))); + } + + return [returnValues.sqrtRatioNextX96, returnValues.amountIn, returnValues.amountOut, returnValues.feeAmount]; + }; + + return SwapMath; +}(); + +var TWO = /*#__PURE__*/JSBI.BigInt(2); +var POWERS_OF_2 = /*#__PURE__*/[128, 64, 32, 16, 8, 4, 2, 1].map(function (pow) { + return [pow, JSBI.exponentiate(TWO, JSBI.BigInt(pow))]; +}); +function mostSignificantBit(x) { + !JSBI.greaterThan(x, ZERO) ? invariant(false, 'ZERO') : void 0; + !JSBI.lessThanOrEqual(x, sdkCore.MaxUint256) ? invariant(false, 'MAX') : void 0; + var msb = 0; + + for (var _iterator = _createForOfIteratorHelperLoose(POWERS_OF_2), _step; !(_step = _iterator()).done;) { + var _step$value = _step.value, + power = _step$value[0], + min = _step$value[1]; + + if (JSBI.greaterThanOrEqual(x, min)) { + x = JSBI.signedRightShift(x, JSBI.BigInt(power)); + msb += power; + } + } + + return msb; +} + +function mulShift(val, mulBy) { + return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128)); +} + +var Q32 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(32)); +var TickMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function TickMath() {} + /** + * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick + * @param tick the tick for which to compute the sqrt ratio + */ + + + TickMath.getSqrtRatioAtTick = function getSqrtRatioAtTick(tick) { + !(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick)) ? invariant(false, 'TICK') : void 0; + var absTick = tick < 0 ? tick * -1 : tick; + var ratio = (absTick & 0x1) != 0 ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001') : JSBI.BigInt('0x100000000000000000000000000000000'); + if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a'); + if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc'); + if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0'); + if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644'); + if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0'); + if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861'); + if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053'); + if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4'); + if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54'); + if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3'); + if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9'); + if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825'); + if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5'); + if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7'); + if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6'); + if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9'); + if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604'); + if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98'); + if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2'); + if (tick > 0) ratio = JSBI.divide(sdkCore.MaxUint256, ratio); // back to Q96 + + return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO) ? JSBI.add(JSBI.divide(ratio, Q32), ONE) : JSBI.divide(ratio, Q32); + } + /** + * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96 + * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96 + * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick + */ + ; + + TickMath.getTickAtSqrtRatio = function getTickAtSqrtRatio(sqrtRatioX96) { + !(JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) && JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO)) ? invariant(false, 'SQRT_RATIO') : void 0; + var sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32)); + var msb = mostSignificantBit(sqrtRatioX128); + var r; + + if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) { + r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127)); + } else { + r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb)); + } + + var log_2 = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64)); + + for (var i = 0; i < 14; i++) { + r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127)); + var f = JSBI.signedRightShift(r, JSBI.BigInt(128)); + log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i))); + r = JSBI.signedRightShift(r, f); + } + + var log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141')); + var tickLow = JSBI.toNumber(JSBI.signedRightShift(JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')), JSBI.BigInt(128))); + var tickHigh = JSBI.toNumber(JSBI.signedRightShift(JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')), JSBI.BigInt(128))); + return tickLow === tickHigh ? tickLow : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96) ? tickHigh : tickLow; + }; + + return TickMath; +}(); +/** + * The minimum tick that can be used on any pool. + */ + +TickMath.MIN_TICK = -887272; +/** + * The maximum tick that can be used on any pool. + */ + +TickMath.MAX_TICK = -TickMath.MIN_TICK; +/** + * The sqrt ratio corresponding to the minimum tick that could be used on any pool. + */ + +TickMath.MIN_SQRT_RATIO = /*#__PURE__*/JSBI.BigInt('4295128739'); +/** + * The sqrt ratio corresponding to the maximum tick that could be used on any pool. + */ + +TickMath.MAX_SQRT_RATIO = /*#__PURE__*/JSBI.BigInt('1461446703485210103287273052203988822378723970342'); + +/** + * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you + * do not need to load tick data for your use case. + */ +var NoTickDataProvider = /*#__PURE__*/function () { + function NoTickDataProvider() {} + + var _proto = NoTickDataProvider.prototype; + + _proto.getTick = /*#__PURE__*/function () { + var _getTick = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_tick) { + return runtime_1.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + throw new Error(NoTickDataProvider.ERROR_MESSAGE); + + case 1: + case "end": + return _context.stop(); + } + } + }, _callee); + })); + + function getTick(_x) { + return _getTick.apply(this, arguments); + } + + return getTick; + }(); + + _proto.nextInitializedTickWithinOneWord = /*#__PURE__*/function () { + var _nextInitializedTickWithinOneWord = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(_tick, _lte, _tickSpacing) { + return runtime_1.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + throw new Error(NoTickDataProvider.ERROR_MESSAGE); + + case 1: + case "end": + return _context2.stop(); + } + } + }, _callee2); + })); + + function nextInitializedTickWithinOneWord(_x2, _x3, _x4) { + return _nextInitializedTickWithinOneWord.apply(this, arguments); + } + + return nextInitializedTickWithinOneWord; + }(); + + return NoTickDataProvider; +}(); +NoTickDataProvider.ERROR_MESSAGE = 'No tick data provider was given'; + +function isSorted(list, comparator) { + for (var i = 0; i < list.length - 1; i++) { + if (comparator(list[i], list[i + 1]) > 0) { + return false; + } + } + + return true; +} + +function tickComparator(a, b) { + return a.index - b.index; +} +/** + * Utility methods for interacting with sorted lists of ticks + */ + + +var TickList = /*#__PURE__*/function () { + /** + * Cannot be constructed + */ + function TickList() {} + + TickList.validateList = function validateList(ticks, tickSpacing) { + !(tickSpacing > 0) ? invariant(false, 'TICK_SPACING_NONZERO') : void 0; // ensure ticks are spaced appropriately + + !ticks.every(function (_ref) { + var index = _ref.index; + return index % tickSpacing === 0; + }) ? invariant(false, 'TICK_SPACING') : void 0; // ensure tick liquidity deltas sum to 0 + + !JSBI.equal(ticks.reduce(function (accumulator, _ref2) { + var liquidityNet = _ref2.liquidityNet; + return JSBI.add(accumulator, liquidityNet); + }, ZERO), ZERO) ? invariant(false, 'ZERO_NET') : void 0; + !isSorted(ticks, tickComparator) ? invariant(false, 'SORTED') : void 0; + }; + + TickList.isBelowSmallest = function isBelowSmallest(ticks, tick) { + !(ticks.length > 0) ? invariant(false, 'LENGTH') : void 0; + return tick < ticks[0].index; + }; + + TickList.isAtOrAboveLargest = function isAtOrAboveLargest(ticks, tick) { + !(ticks.length > 0) ? invariant(false, 'LENGTH') : void 0; + return tick >= ticks[ticks.length - 1].index; + }; + + TickList.getTick = function getTick(ticks, index) { + var tick = ticks[this.binarySearch(ticks, index)]; + !(tick.index === index) ? invariant(false, 'NOT_CONTAINED') : void 0; + return tick; + } + /** + * Finds the largest tick in the list of ticks that is less than or equal to tick + * @param ticks list of ticks + * @param tick tick to find the largest tick that is less than or equal to tick + * @private + */ + ; + + TickList.binarySearch = function binarySearch(ticks, tick) { + !!this.isBelowSmallest(ticks, tick) ? invariant(false, 'BELOW_SMALLEST') : void 0; + var l = 0; + var r = ticks.length - 1; + var i; + + while (true) { + i = Math.floor((l + r) / 2); + + if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) { + return i; + } + + if (ticks[i].index < tick) { + l = i + 1; + } else { + r = i - 1; + } + } + }; + + TickList.nextInitializedTick = function nextInitializedTick(ticks, tick, lte) { + if (lte) { + !!TickList.isBelowSmallest(ticks, tick) ? invariant(false, 'BELOW_SMALLEST') : void 0; + + if (TickList.isAtOrAboveLargest(ticks, tick)) { + return ticks[ticks.length - 1]; + } + + var index = this.binarySearch(ticks, tick); + return ticks[index]; + } else { + !!this.isAtOrAboveLargest(ticks, tick) ? invariant(false, 'AT_OR_ABOVE_LARGEST') : void 0; + + if (this.isBelowSmallest(ticks, tick)) { + return ticks[0]; + } + + var _index = this.binarySearch(ticks, tick); + + return ticks[_index + 1]; + } + }; + + TickList.nextInitializedTickWithinOneWord = function nextInitializedTickWithinOneWord(ticks, tick, lte, tickSpacing) { + var compressed = Math.floor(tick / tickSpacing); // matches rounding in the code + + if (lte) { + var wordPos = compressed >> 8; + var minimum = (wordPos << 8) * tickSpacing; + + if (TickList.isBelowSmallest(ticks, tick)) { + return [minimum, false]; + } + + var index = TickList.nextInitializedTick(ticks, tick, lte).index; + var nextInitializedTick = Math.max(minimum, index); + return [nextInitializedTick, nextInitializedTick === index]; + } else { + var _wordPos = compressed + 1 >> 8; + + var maximum = (_wordPos + 1 << 8) * tickSpacing - 1; + + if (this.isAtOrAboveLargest(ticks, tick)) { + return [maximum, false]; + } + + var _index2 = this.nextInitializedTick(ticks, tick, lte).index; + + var _nextInitializedTick = Math.min(maximum, _index2); + + return [_nextInitializedTick, _nextInitializedTick === _index2]; + } + }; + + return TickList; +}(); + +function toHex(bigintIsh) { + var bigInt = JSBI.BigInt(bigintIsh); + var hex = bigInt.toString(16); + + if (hex.length % 2 !== 0) { + hex = "0" + hex; + } + + return "0x" + hex; +} + +/** + * Converts a route to a hex encoded path + * @param route the v3 path to convert to an encoded path + * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps + */ + +function encodeRouteToPath(route, exactOutput) { + var firstInputToken = sdkCore.wrappedCurrency(route.input, route.chainId); + + var _route$pools$reduce = route.pools.reduce(function (_ref, pool, index) { + var inputToken = _ref.inputToken, + path = _ref.path, + types = _ref.types; + var outputToken = pool.token0.equals(inputToken) ? pool.token1 : pool.token0; + + if (index === 0) { + return { + inputToken: outputToken, + types: ['address', 'uint24', 'address'], + path: [inputToken.address, pool.fee, outputToken.address] + }; + } else { + return { + inputToken: outputToken, + types: [].concat(types, ['uint24', 'address']), + path: [].concat(path, [pool.fee, outputToken.address]) + }; + } + }, { + inputToken: firstInputToken, + path: [], + types: [] + }), + path = _route$pools$reduce.path, + types = _route$pools$reduce.types; + + return exactOutput ? solidity.pack(types.reverse(), path.reverse()) : solidity.pack(types, path); +} + +/** + * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0 + * @param amount1 the numerator amount, i.e. amount of token1 + * @param amount0 the denominator amount, i.en amount of token0 + */ + +function encodeSqrtRatioX96(amount1, amount0) { + var numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192)); + var denominator = JSBI.BigInt(amount0); + var ratioX192 = JSBI.divide(numerator, denominator); + return sdkCore.sqrt(ratioX192); +} + +function maxLiquidityForAmount0Imprecise(sqrtRatioAX96, sqrtRatioBX96, amount0) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref[0]; + sqrtRatioBX96 = _ref[1]; + } + + var intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96); + return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); +} + +function maxLiquidityForAmount0Precise(sqrtRatioAX96, sqrtRatioBX96, amount0) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref2 = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref2[0]; + sqrtRatioBX96 = _ref2[1]; + } + + var numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96); + var denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); + return JSBI.divide(numerator, denominator); +} + +function maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref3 = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref3[0]; + sqrtRatioBX96 = _ref3[1]; + } + + return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); +} +/** + * Computes the maximum amount of liquidity received for a given amount of token0, token1, + * and the prices at the tick boundaries. + * @param sqrtRatioCurrentX96 the current price + * @param sqrtRatioAX96 price at lower boundary + * @param sqrtRatioBX96 price at upper boundary + * @param amount0 token0 amount + * @param amount1 token1 amount + * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ + + +function maxLiquidityForAmounts(sqrtRatioCurrentX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1, useFullPrecision) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref4 = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref4[0]; + sqrtRatioBX96 = _ref4[1]; + } + + var maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise; + + if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) { + return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0); + } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) { + var liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0); + var liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1); + return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1; + } else { + return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1); + } +} + +/** + * Returns the closest tick that is nearest a given tick and usable for the given tick spacing + * @param tick the target tick + * @param tickSpacing the spacing of the pool + */ + +function nearestUsableTick(tick, tickSpacing) { + !(Number.isInteger(tick) && Number.isInteger(tickSpacing)) ? invariant(false, 'INTEGERS') : void 0; + !(tickSpacing > 0) ? invariant(false, 'TICK_SPACING') : void 0; + !(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK) ? invariant(false, 'TICK_BOUND') : void 0; + var rounded = Math.round(tick / tickSpacing) * tickSpacing; + if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing;else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing;else return rounded; +} + +/** + * Returns a price object corresponding to the input tick and the base/quote token + * Inputs must be tokens because the address order is used to interpret the price represented by the tick + * @param baseToken the base token of the price + * @param quoteToken the quote token of the price + * @param tick the tick for which to return the price + */ + +function tickToPrice(baseToken, quoteToken, tick) { + var sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick); + var ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96); + return baseToken.sortsBefore(quoteToken) ? new sdkCore.Price(baseToken, quoteToken, Q192, ratioX192) : new sdkCore.Price(baseToken, quoteToken, ratioX192, Q192); +} +/** + * Returns the first tick for which the given price is greater than or equal to the tick price + * @param price for which to return the closest tick that represents a price less than or equal to the input price, + * i.e. the price of the returned tick is less than or equal to the input price + */ + +function priceToClosestTick(price) { + var sorted = price.baseCurrency.sortsBefore(price.quoteCurrency); + var sqrtRatioX96 = sorted ? encodeSqrtRatioX96(price.numerator, price.denominator) : encodeSqrtRatioX96(price.denominator, price.numerator); + var tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96); + var nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1); + + if (sorted) { + if (!price.lessThan(nextTickPrice)) { + tick++; + } + } else { + if (!price.greaterThan(nextTickPrice)) { + tick++; + } + } + + return tick; +} + +var Tick = function Tick(_ref) { + var index = _ref.index, + liquidityGross = _ref.liquidityGross, + liquidityNet = _ref.liquidityNet; + !(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK) ? invariant(false, 'TICK') : void 0; + this.index = index; + this.liquidityGross = JSBI.BigInt(liquidityGross); + this.liquidityNet = JSBI.BigInt(liquidityNet); +}; + +/** + * A data provider for ticks that is backed by an in-memory array of ticks. + */ + +var TickListDataProvider = /*#__PURE__*/function () { + function TickListDataProvider(ticks, tickSpacing) { + var ticksMapped = ticks.map(function (t) { + return t instanceof Tick ? t : new Tick(t); + }); + TickList.validateList(ticksMapped, tickSpacing); + this.ticks = ticksMapped; + } + + var _proto = TickListDataProvider.prototype; + + _proto.getTick = /*#__PURE__*/function () { + var _getTick = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(tick) { + return runtime_1.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", TickList.getTick(this.ticks, tick)); + + case 1: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getTick(_x) { + return _getTick.apply(this, arguments); + } + + return getTick; + }(); + + _proto.nextInitializedTickWithinOneWord = /*#__PURE__*/function () { + var _nextInitializedTickWithinOneWord = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(tick, lte, tickSpacing) { + return runtime_1.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function nextInitializedTickWithinOneWord(_x2, _x3, _x4) { + return _nextInitializedTickWithinOneWord.apply(this, arguments); + } + + return nextInitializedTickWithinOneWord; + }(); + + return TickListDataProvider; +}(); + +/** + * By default, pools will not allow operations that require ticks. + */ + +var NO_TICK_DATA_PROVIDER_DEFAULT = /*#__PURE__*/new NoTickDataProvider(); +/** + * Represents a V3 pool + */ + +var Pool = /*#__PURE__*/function () { + /** + * Construct a pool + * @param tokenA one of the tokens in the pool + * @param tokenB the other token in the pool + * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool + * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0 + * @param liquidity the current value of in range liquidity + * @param tickCurrent the current tick of the pool + * @param ticks the current state of the pool ticks or a data provider that can return tick data + */ + function Pool(tokenA, tokenB, fee, sqrtRatioX96, liquidity, tickCurrent, ticks) { + if (ticks === void 0) { + ticks = NO_TICK_DATA_PROVIDER_DEFAULT; + } + + !(Number.isInteger(fee) && fee < 1000000) ? invariant(false, 'FEE') : void 0; + var tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent); + var nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1); + !(JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) && JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96)) ? invariant(false, 'PRICE_BOUNDS') : void 0; + + var _ref = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]; + + this.token0 = _ref[0]; + this.token1 = _ref[1]; + this.fee = fee; + this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96); + this.liquidity = JSBI.BigInt(liquidity); + this.tickCurrent = tickCurrent; + this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks; + } + + Pool.getAddress = function getAddress(tokenA, tokenB, fee) { + return computePoolAddress({ + factoryAddress: FACTORY_ADDRESS, + fee: fee, + tokenA: tokenA, + tokenB: tokenB + }); + } + /** + * Returns true if the token is either token0 or token1 + * @param token to check + */ + ; + + var _proto = Pool.prototype; + + _proto.involvesToken = function involvesToken(token) { + return token.equals(this.token0) || token.equals(this.token1); + } + /** + * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0 + */ + ; + + /** + * Return the price of the given token in terms of the other token in the pool. + * @param token token to return price of + */ + _proto.priceOf = function priceOf(token) { + !this.involvesToken(token) ? invariant(false, 'TOKEN') : void 0; + return token.equals(this.token0) ? this.token0Price : this.token1Price; + } + /** + * Returns the chain ID of the tokens in the pool. + */ + ; + + /** + * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade + * @param inputAmount the input amount for which to quote the output amount + */ + _proto.getOutputAmount = + /*#__PURE__*/ + function () { + var _getOutputAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(inputAmount, sqrtPriceLimitX96) { + var zeroForOne, _yield$this$swap, outputAmount, sqrtRatioX96, liquidity, tickCurrent, outputToken; + + return runtime_1.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + !this.involvesToken(inputAmount.currency) ? invariant(false, 'TOKEN') : void 0; + zeroForOne = inputAmount.currency.equals(this.token0); + _context.next = 4; + return this.swap(zeroForOne, inputAmount.quotient, sqrtPriceLimitX96); + + case 4: + _yield$this$swap = _context.sent; + outputAmount = _yield$this$swap.amountCalculated; + sqrtRatioX96 = _yield$this$swap.sqrtRatioX96; + liquidity = _yield$this$swap.liquidity; + tickCurrent = _yield$this$swap.tickCurrent; + outputToken = zeroForOne ? this.token1 : this.token0; + return _context.abrupt("return", [sdkCore.CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)), new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)]); + + case 11: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getOutputAmount(_x, _x2) { + return _getOutputAmount.apply(this, arguments); + } + + return getOutputAmount; + }() + /** + * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade + * @param outputAmount the output amount for which to quote the input amount + */ + ; + + _proto.getInputAmount = + /*#__PURE__*/ + function () { + var _getInputAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(outputAmount, sqrtPriceLimitX96) { + var zeroForOne, _yield$this$swap2, inputAmount, sqrtRatioX96, liquidity, tickCurrent, inputToken; + + return runtime_1.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + !(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency)) ? invariant(false, 'TOKEN') : void 0; + zeroForOne = outputAmount.currency.equals(this.token1); + _context2.next = 4; + return this.swap(zeroForOne, JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE), sqrtPriceLimitX96); + + case 4: + _yield$this$swap2 = _context2.sent; + inputAmount = _yield$this$swap2.amountCalculated; + sqrtRatioX96 = _yield$this$swap2.sqrtRatioX96; + liquidity = _yield$this$swap2.liquidity; + tickCurrent = _yield$this$swap2.tickCurrent; + inputToken = zeroForOne ? this.token0 : this.token1; + return _context2.abrupt("return", [sdkCore.CurrencyAmount.fromRawAmount(inputToken, inputAmount), new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)]); + + case 11: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function getInputAmount(_x3, _x4) { + return _getInputAmount.apply(this, arguments); + } + + return getInputAmount; + }(); + + _proto.swap = /*#__PURE__*/function () { + var _swap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(zeroForOne, amountSpecified, sqrtPriceLimitX96) { + var exactInput, state, step, _yield$this$tickDataP, _SwapMath$computeSwap, liquidityNet; + + return runtime_1.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!sqrtPriceLimitX96) sqrtPriceLimitX96 = zeroForOne ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE) : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE); + + if (zeroForOne) { + !JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO) ? invariant(false, 'RATIO_MIN') : void 0; + !JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96) ? invariant(false, 'RATIO_CURRENT') : void 0; + } else { + !JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO) ? invariant(false, 'RATIO_MAX') : void 0; + !JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96) ? invariant(false, 'RATIO_CURRENT') : void 0; + } + + exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO); // keep track of swap state + + state = { + amountSpecifiedRemaining: amountSpecified, + amountCalculated: ZERO, + sqrtPriceX96: this.sqrtRatioX96, + tick: this.tickCurrent, + liquidity: this.liquidity + }; // start swap while loop + + case 4: + if (!(JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96)) { + _context3.next = 35; + break; + } + + step = {}; + step.sqrtPriceStartX96 = state.sqrtPriceX96; + _context3.next = 9; + return this.tickDataProvider.nextInitializedTickWithinOneWord(state.tick, zeroForOne, this.tickSpacing); + + case 9: + _yield$this$tickDataP = _context3.sent; + step.tickNext = _yield$this$tickDataP[0]; + step.initialized = _yield$this$tickDataP[1]; + + if (step.tickNext < TickMath.MIN_TICK) { + step.tickNext = TickMath.MIN_TICK; + } else if (step.tickNext > TickMath.MAX_TICK) { + step.tickNext = TickMath.MAX_TICK; + } + + step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); + _SwapMath$computeSwap = SwapMath.computeSwapStep(state.sqrtPriceX96, (zeroForOne ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96) : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)) ? sqrtPriceLimitX96 : step.sqrtPriceNextX96, state.liquidity, state.amountSpecifiedRemaining, this.fee); + state.sqrtPriceX96 = _SwapMath$computeSwap[0]; + step.amountIn = _SwapMath$computeSwap[1]; + step.amountOut = _SwapMath$computeSwap[2]; + step.feeAmount = _SwapMath$computeSwap[3]; + + if (exactInput) { + state.amountSpecifiedRemaining = JSBI.subtract(state.amountSpecifiedRemaining, JSBI.add(step.amountIn, step.feeAmount)); + state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut); + } else { + state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut); + state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount)); + } // TODO + + + if (!JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) { + _context3.next = 32; + break; + } + + if (!step.initialized) { + _context3.next = 29; + break; + } + + _context3.t0 = JSBI; + _context3.next = 25; + return this.tickDataProvider.getTick(step.tickNext); + + case 25: + _context3.t1 = _context3.sent.liquidityNet; + liquidityNet = _context3.t0.BigInt.call(_context3.t0, _context3.t1); + // if we're moving leftward, we interpret liquidityNet as the opposite sign + // safe because liquidityNet cannot be type(int128).min + if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE); + state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet); + + case 29: + state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; + _context3.next = 33; + break; + + case 32: + if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { + // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved + state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); + } + + case 33: + _context3.next = 4; + break; + + case 35: + return _context3.abrupt("return", { + amountCalculated: state.amountCalculated, + sqrtRatioX96: state.sqrtPriceX96, + liquidity: state.liquidity, + tickCurrent: state.tick + }); + + case 36: + case "end": + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function swap(_x5, _x6, _x7) { + return _swap.apply(this, arguments); + } + + return swap; + }(); + + _createClass(Pool, [{ + key: "token0Price", + get: function get() { + var _this$_token0Price; + + return (_this$_token0Price = this._token0Price) != null ? _this$_token0Price : this._token0Price = new sdkCore.Price(this.token0, this.token1, Q192, JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)); + } + /** + * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1 + */ + + }, { + key: "token1Price", + get: function get() { + var _this$_token1Price; + + return (_this$_token1Price = this._token1Price) != null ? _this$_token1Price : this._token1Price = new sdkCore.Price(this.token1, this.token0, JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96), Q192); + } + }, { + key: "chainId", + get: function get() { + return this.token0.chainId; + } + }, { + key: "tickSpacing", + get: function get() { + return TICK_SPACINGS[this.fee]; + } + }]); + + return Pool; +}(); + +/** + * Represents a position on a Uniswap V3 Pool + */ + +var Position = /*#__PURE__*/function () { + /** + * Constructs a position for a given pool with the given liquidity + * @param pool for which pool the liquidity is assigned + * @param liquidity the amount of liquidity that is in the position + * @param tickLower the lower tick of the position + * @param tickUpper the upper tick of the position + */ + function Position(_ref) { + var pool = _ref.pool, + liquidity = _ref.liquidity, + tickLower = _ref.tickLower, + tickUpper = _ref.tickUpper; + // cached resuts for the getters + this._token0Amount = null; + this._token1Amount = null; + this._mintAmounts = null; + !(tickLower < tickUpper) ? invariant(false, 'TICK_ORDER') : void 0; + !(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0) ? invariant(false, 'TICK_LOWER') : void 0; + !(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0) ? invariant(false, 'TICK_UPPER') : void 0; + this.pool = pool; + this.tickLower = tickLower; + this.tickUpper = tickUpper; + this.liquidity = JSBI.BigInt(liquidity); + } + /** + * Returns the price of token0 at the lower tick + */ + + + var _proto = Position.prototype; + + /** + * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage + * @param slippageTolerance amount by which the price can 'slip' + * @private + */ + _proto.ratiosAfterSlippage = function ratiosAfterSlippage(slippageTolerance) { + var priceLower = this.pool.token0Price.asFraction.multiply(new sdkCore.Percent(1).subtract(slippageTolerance)); + var priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1)); + var sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator); + + if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) { + sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1)); + } + + var sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator); + + if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) { + sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1)); + } + + return { + sqrtRatioX96Lower: sqrtRatioX96Lower, + sqrtRatioX96Upper: sqrtRatioX96Upper + }; + } + /** + * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position + * with the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the current price + */ + ; + + _proto.mintAmountsWithSlippage = function mintAmountsWithSlippage(slippageTolerance) { + // get lower/upper prices + var _this$ratiosAfterSlip = this.ratiosAfterSlippage(slippageTolerance), + sqrtRatioX96Upper = _this$ratiosAfterSlip.sqrtRatioX96Upper, + sqrtRatioX96Lower = _this$ratiosAfterSlip.sqrtRatioX96Lower; // construct counterfactual pools + + + var poolLower = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Lower, 0 + /* liquidity doesn't matter */ + , TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)); + var poolUpper = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Upper, 0 + /* liquidity doesn't matter */ + , TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)); // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage) + + var positionThatWillBeCreated = Position.fromAmounts(_extends({ + pool: this.pool, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }, this.mintAmounts, { + useFullPrecision: false + })); // we want the smaller amounts... + // ...which occurs at the upper price for amount0... + + var amount0 = new Position({ + pool: poolUpper, + liquidity: positionThatWillBeCreated.liquidity, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }).mintAmounts.amount0; // ...and the lower for amount1 + + var amount1 = new Position({ + pool: poolLower, + liquidity: positionThatWillBeCreated.liquidity, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }).mintAmounts.amount1; + return { + amount0: amount0, + amount1: amount1 + }; + } + /** + * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the + * position with the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the current price + */ + ; + + _proto.burnAmountsWithSlippage = function burnAmountsWithSlippage(slippageTolerance) { + // get lower/upper prices + var _this$ratiosAfterSlip2 = this.ratiosAfterSlippage(slippageTolerance), + sqrtRatioX96Upper = _this$ratiosAfterSlip2.sqrtRatioX96Upper, + sqrtRatioX96Lower = _this$ratiosAfterSlip2.sqrtRatioX96Lower; // construct counterfactual pools + + + var poolLower = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Lower, 0 + /* liquidity doesn't matter */ + , TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)); + var poolUpper = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Upper, 0 + /* liquidity doesn't matter */ + , TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)); // we want the smaller amounts... + // ...which occurs at the upper price for amount0... + + var amount0 = new Position({ + pool: poolUpper, + liquidity: this.liquidity, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }).amount0; // ...and the lower for amount1 + + var amount1 = new Position({ + pool: poolLower, + liquidity: this.liquidity, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }).amount1; + return { + amount0: amount0.quotient, + amount1: amount1.quotient + }; + } + /** + * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at + * the current price for the pool + */ + ; + + /** + * Computes the maximum amount of liquidity received for a given amount of token0, token1, + * and the prices at the tick boundaries. + * @param pool the pool for which the position should be created + * @param tickLower the lower tick of the position + * @param tickUpper the upper tick of the position + * @param amount0 token0 amount + * @param amount1 token1 amount + * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ + Position.fromAmounts = function fromAmounts(_ref2) { + var pool = _ref2.pool, + tickLower = _ref2.tickLower, + tickUpper = _ref2.tickUpper, + amount0 = _ref2.amount0, + amount1 = _ref2.amount1, + useFullPrecision = _ref2.useFullPrecision; + var sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower); + var sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper); + return new Position({ + pool: pool, + tickLower: tickLower, + tickUpper: tickUpper, + liquidity: maxLiquidityForAmounts(pool.sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1, useFullPrecision) + }); + } + /** + * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1 + * @param pool the pool for which the position is created + * @param tickLower the lower tick + * @param tickUpper the upper tick + * @param amount0 the desired amount of token0 + * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ + ; + + Position.fromAmount0 = function fromAmount0(_ref3) { + var pool = _ref3.pool, + tickLower = _ref3.tickLower, + tickUpper = _ref3.tickUpper, + amount0 = _ref3.amount0, + useFullPrecision = _ref3.useFullPrecision; + return Position.fromAmounts({ + pool: pool, + tickLower: tickLower, + tickUpper: tickUpper, + amount0: amount0, + amount1: sdkCore.MaxUint256, + useFullPrecision: useFullPrecision + }); + } + /** + * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0 + * @param pool the pool for which the position is created + * @param tickLower the lower tick + * @param tickUpper the upper tick + * @param amount1 the desired amount of token1 + */ + ; + + Position.fromAmount1 = function fromAmount1(_ref4) { + var pool = _ref4.pool, + tickLower = _ref4.tickLower, + tickUpper = _ref4.tickUpper, + amount1 = _ref4.amount1; + // this function always uses full precision, + return Position.fromAmounts({ + pool: pool, + tickLower: tickLower, + tickUpper: tickUpper, + amount0: sdkCore.MaxUint256, + amount1: amount1, + useFullPrecision: true + }); + }; + + _createClass(Position, [{ + key: "token0PriceLower", + get: function get() { + return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower); + } + /** + * Returns the price of token0 at the upper tick + */ + + }, { + key: "token0PriceUpper", + get: function get() { + return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper); + } + /** + * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price + */ + + }, { + key: "amount0", + get: function get() { + if (this._token0Amount === null) { + if (this.pool.tickCurrent < this.tickLower) { + this._token0Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token0, SqrtPriceMath.getAmount0Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); + } else if (this.pool.tickCurrent < this.tickUpper) { + this._token0Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token0, SqrtPriceMath.getAmount0Delta(this.pool.sqrtRatioX96, TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); + } else { + this._token0Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token0, ZERO); + } + } + + return this._token0Amount; + } + /** + * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price + */ + + }, { + key: "amount1", + get: function get() { + if (this._token1Amount === null) { + if (this.pool.tickCurrent < this.tickLower) { + this._token1Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token1, ZERO); + } else if (this.pool.tickCurrent < this.tickUpper) { + this._token1Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token1, SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), this.pool.sqrtRatioX96, this.liquidity, false)); + } else { + this._token1Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token1, SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); + } + } + + return this._token1Amount; + } + }, { + key: "mintAmounts", + get: function get() { + if (this._mintAmounts === null) { + if (this.pool.tickCurrent < this.tickLower) { + return { + amount0: SqrtPriceMath.getAmount0Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true), + amount1: ZERO + }; + } else if (this.pool.tickCurrent < this.tickUpper) { + return { + amount0: SqrtPriceMath.getAmount0Delta(this.pool.sqrtRatioX96, TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true), + amount1: SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), this.pool.sqrtRatioX96, this.liquidity, true) + }; + } else { + return { + amount0: ZERO, + amount1: SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true) + }; + } + } + + return this._mintAmounts; + } + }]); + + return Position; +}(); + +/** + * Represents a list of pools through which a swap can occur + */ + +var Route = /*#__PURE__*/function () { + function Route(pools, input, output) { + this._midPrice = null; + !(pools.length > 0) ? invariant(false, 'POOLS') : void 0; + var chainId = pools[0].chainId; + var allOnSameChain = pools.every(function (pool) { + return pool.chainId === chainId; + }); + !allOnSameChain ? invariant(false, 'CHAIN_IDS') : void 0; + var wrappedInput = sdkCore.wrappedCurrency(input, chainId); + !pools[0].involvesToken(wrappedInput) ? invariant(false, 'INPUT') : void 0; + !pools[pools.length - 1].involvesToken(sdkCore.wrappedCurrency(output, chainId)) ? invariant(false, 'OUTPUT') : void 0; + /** + * Normalizes token0-token1 order and selects the next token/fee step to add to the path + * */ + + var tokenPath = [wrappedInput]; + + for (var _iterator = _createForOfIteratorHelperLoose(pools.entries()), _step; !(_step = _iterator()).done;) { + var _step$value = _step.value, + i = _step$value[0], + pool = _step$value[1]; + var currentInputToken = tokenPath[i]; + !(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1)) ? invariant(false, 'PATH') : void 0; + var nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0; + tokenPath.push(nextToken); + } + + this.pools = pools; + this.tokenPath = tokenPath; + this.input = input; + this.output = output != null ? output : tokenPath[tokenPath.length - 1]; + } + + _createClass(Route, [{ + key: "chainId", + get: function get() { + return this.pools[0].chainId; + } + /** + * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token. + */ + + }, { + key: "inputToken", + get: function get() { + return sdkCore.wrappedCurrency(this.input, this.chainId); + } + /** + * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token. + */ + + }, { + key: "outputToken", + get: function get() { + return sdkCore.wrappedCurrency(this.output, this.chainId); + } + /** + * Returns the mid price of the route + */ + + }, { + key: "midPrice", + get: function get() { + if (this._midPrice !== null) return this._midPrice; + var price = this.pools.slice(1).reduce(function (_ref, pool) { + var nextInput = _ref.nextInput, + price = _ref.price; + return nextInput.equals(pool.token0) ? { + nextInput: pool.token1, + price: price.multiply(pool.token0Price) + } : { + nextInput: pool.token0, + price: price.multiply(pool.token1Price) + }; + }, this.pools[0].token0.equals(this.inputToken) ? { + nextInput: this.pools[0].token1, + price: this.pools[0].token0Price + } : { + nextInput: this.pools[0].token0, + price: this.pools[0].token1Price + }).price; + return this._midPrice = new sdkCore.Price(this.input, this.output, price.denominator, price.numerator); + } + }]); + + return Route; +}(); + +function tradeComparator(a, b) { + // must have same input and output token for comparison + !sdkCore.currencyEquals(a.inputAmount.currency, b.inputAmount.currency) ? invariant(false, 'INPUT_CURRENCY') : void 0; + !sdkCore.currencyEquals(a.outputAmount.currency, b.outputAmount.currency) ? invariant(false, 'OUTPUT_CURRENCY') : void 0; + + if (a.outputAmount.equalTo(b.outputAmount)) { + if (a.inputAmount.equalTo(b.inputAmount)) { + // consider the number of hops since each hop costs gas + return a.route.tokenPath.length - b.route.tokenPath.length; + } // trade A requires less input than trade B, so A should come first + + + if (a.inputAmount.lessThan(b.inputAmount)) { + return -1; + } else { + return 1; + } + } else { + // tradeA has less output than trade B, so should come second + if (a.outputAmount.lessThan(b.outputAmount)) { + return 1; + } else { + return -1; + } + } +} +/** + * Represents a trade executed against a list of pools. + * Does not account for slippage, i.e. trades that front run this trade and move the price. + */ + +var Trade = /*#__PURE__*/function () { + /** + * Construct a trade by passing in the pre-computed property values + * @param route the route through which the trade occurs + * @param inputAmount the amount of input paid in the trade + * @param outputAmount the amount of output received in the trade + * @param tradeType the type of trade, exact input or exact output + */ + function Trade(_ref) { + var route = _ref.route, + inputAmount = _ref.inputAmount, + outputAmount = _ref.outputAmount, + tradeType = _ref.tradeType; + !sdkCore.currencyEquals(inputAmount.currency, route.input) ? invariant(false, 'INPUT_CURRENCY_MATCH') : void 0; + !sdkCore.currencyEquals(outputAmount.currency, route.output) ? invariant(false, 'OUTPUT_CURRENCY_MATCH') : void 0; + this.route = route; + this.inputAmount = inputAmount; + this.outputAmount = outputAmount; + this.tradeType = tradeType; + } + /** + * The price expressed in terms of output amount/input amount. + */ + + + /** + * Constructs an exact in trade with the given amount in and route + * @param route route of the exact in trade + * @param amountIn the amount being passed in + */ + Trade.exactIn = + /*#__PURE__*/ + function () { + var _exactIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(route, amountIn) { + return runtime_1.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", Trade.fromRoute(route, amountIn, sdkCore.TradeType.EXACT_INPUT)); + + case 1: + case "end": + return _context.stop(); + } + } + }, _callee); + })); + + function exactIn(_x, _x2) { + return _exactIn.apply(this, arguments); + } + + return exactIn; + }() + /** + * Constructs an exact out trade with the given amount out and route + * @param route route of the exact out trade + * @param amountOut the amount returned by the trade + */ + ; + + Trade.exactOut = + /*#__PURE__*/ + function () { + var _exactOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(route, amountOut) { + return runtime_1.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", Trade.fromRoute(route, amountOut, sdkCore.TradeType.EXACT_OUTPUT)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, _callee2); + })); + + function exactOut(_x3, _x4) { + return _exactOut.apply(this, arguments); + } + + return exactOut; + }() + /** + * Constructs a trade by simulating swaps through the given route + * @param route route to swap through + * @param amount the amount specified, either input or output, depending on tradeType + * @param tradeType whether the trade is an exact input or exact output swap + */ + ; + + Trade.fromRoute = + /*#__PURE__*/ + function () { + var _fromRoute = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(route, amount, tradeType) { + var amounts, inputAmount, outputAmount, i, pool, _yield$pool$getOutput, _outputAmount, _i, _pool, _yield$_pool$getInput, _inputAmount; + + return runtime_1.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + amounts = new Array(route.tokenPath.length); + + if (!(tradeType === sdkCore.TradeType.EXACT_INPUT)) { + _context3.next = 19; + break; + } + + !sdkCore.currencyEquals(amount.currency, route.input) ? invariant(false, 'INPUT') : void 0; + amounts[0] = sdkCore.wrappedCurrencyAmount(amount, route.chainId); + i = 0; + + case 5: + if (!(i < route.tokenPath.length - 1)) { + _context3.next = 15; + break; + } + + pool = route.pools[i]; + _context3.next = 9; + return pool.getOutputAmount(amounts[i]); + + case 9: + _yield$pool$getOutput = _context3.sent; + _outputAmount = _yield$pool$getOutput[0]; + amounts[i + 1] = _outputAmount; + + case 12: + i++; + _context3.next = 5; + break; + + case 15: + inputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator); + outputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.output, amounts[amounts.length - 1].numerator, amounts[amounts.length - 1].denominator); + _context3.next = 34; + break; + + case 19: + !sdkCore.currencyEquals(amount.currency, route.output) ? invariant(false, 'OUTPUT') : void 0; + amounts[amounts.length - 1] = sdkCore.wrappedCurrencyAmount(amount, route.chainId); + _i = route.tokenPath.length - 1; + + case 22: + if (!(_i > 0)) { + _context3.next = 32; + break; + } + + _pool = route.pools[_i - 1]; + _context3.next = 26; + return _pool.getInputAmount(amounts[_i]); + + case 26: + _yield$_pool$getInput = _context3.sent; + _inputAmount = _yield$_pool$getInput[0]; + amounts[_i - 1] = _inputAmount; + + case 29: + _i--; + _context3.next = 22; + break; + + case 32: + inputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator); + outputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator); + + case 34: + return _context3.abrupt("return", new Trade({ + route: route, + tradeType: tradeType, + inputAmount: inputAmount, + outputAmount: outputAmount + })); + + case 35: + case "end": + return _context3.stop(); + } + } + }, _callee3); + })); + + function fromRoute(_x5, _x6, _x7) { + return _fromRoute.apply(this, arguments); + } + + return fromRoute; + }() + /** + * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade + * elsewhere and do not have any tick data + * @param constructorArguments the arguments passed to the trade constructor + */ + ; + + Trade.createUncheckedTrade = function createUncheckedTrade(constructorArguments) { + return new Trade(constructorArguments); + } + /** + * Get the minimum amount that must be received from this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + ; + + var _proto = Trade.prototype; + + _proto.minimumAmountOut = function minimumAmountOut(slippageTolerance) { + !!slippageTolerance.lessThan(ZERO) ? invariant(false, 'SLIPPAGE_TOLERANCE') : void 0; + + if (this.tradeType === sdkCore.TradeType.EXACT_OUTPUT) { + return this.outputAmount; + } else { + var slippageAdjustedAmountOut = new sdkCore.Fraction(ONE).add(slippageTolerance).invert().multiply(this.outputAmount.quotient).quotient; + return sdkCore.CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut); + } + } + /** + * Get the maximum amount in that can be spent via this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + ; + + _proto.maximumAmountIn = function maximumAmountIn(slippageTolerance) { + !!slippageTolerance.lessThan(ZERO) ? invariant(false, 'SLIPPAGE_TOLERANCE') : void 0; + + if (this.tradeType === sdkCore.TradeType.EXACT_INPUT) { + return this.inputAmount; + } else { + var slippageAdjustedAmountIn = new sdkCore.Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient).quotient; + return sdkCore.CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn); + } + } + /** + * Return the execution price after accounting for slippage tolerance + * @param slippageTolerance the allowed tolerated slippage + */ + ; + + _proto.worstExecutionPrice = function worstExecutionPrice(slippageTolerance) { + return new sdkCore.Price(this.inputAmount.currency, this.outputAmount.currency, this.maximumAmountIn(slippageTolerance).quotient, this.minimumAmountOut(slippageTolerance).quotient); + } + /** + * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token + * amount to an output token, making at most `maxHops` hops. + * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pools the pools to consider in finding the best trade + * @param nextAmountIn exact amount of input currency to spend + * @param currencyOut the desired currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool + * @param currentPools used in recursion; the current list of pools + * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter + * @param bestTrades used in recursion; the current list of best trades + */ + ; + + Trade.bestTradeExactIn = + /*#__PURE__*/ + function () { + var _bestTradeExactIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pools, currencyAmountIn, currencyOut, _temp, // used in recursion. + currentPools, nextAmountIn, bestTrades) { + var _ref2, _ref2$maxNumResults, maxNumResults, _ref2$maxHops, maxHops, chainId, amountIn, tokenOut, i, pool, amountOut, _yield$pool$getOutput2, poolsExcludingThisPool; + + return runtime_1.wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + _ref2 = _temp === void 0 ? {} : _temp, _ref2$maxNumResults = _ref2.maxNumResults, maxNumResults = _ref2$maxNumResults === void 0 ? 3 : _ref2$maxNumResults, _ref2$maxHops = _ref2.maxHops, maxHops = _ref2$maxHops === void 0 ? 3 : _ref2$maxHops; + + if (currentPools === void 0) { + currentPools = []; + } + + if (nextAmountIn === void 0) { + nextAmountIn = currencyAmountIn; + } + + if (bestTrades === void 0) { + bestTrades = []; + } + + !(pools.length > 0) ? invariant(false, 'POOLS') : void 0; + !(maxHops > 0) ? invariant(false, 'MAX_HOPS') : void 0; + !(currencyAmountIn === nextAmountIn || currentPools.length > 0) ? invariant(false, 'INVALID_RECURSION') : void 0; + chainId = nextAmountIn.currency.isToken ? nextAmountIn.currency.chainId : currencyOut.isToken ? currencyOut.chainId : undefined; + !(chainId !== undefined) ? invariant(false, 'CHAIN_ID') : void 0; + amountIn = sdkCore.wrappedCurrencyAmount(nextAmountIn, chainId); + tokenOut = sdkCore.wrappedCurrency(currencyOut, chainId); + i = 0; + + case 12: + if (!(i < pools.length)) { + _context4.next = 48; + break; + } + + pool = pools[i]; // pool irrelevant + + if (!(!sdkCore.currencyEquals(pool.token0, amountIn.currency) && !sdkCore.currencyEquals(pool.token1, amountIn.currency))) { + _context4.next = 16; + break; + } + + return _context4.abrupt("continue", 45); + + case 16: + amountOut = void 0; + _context4.prev = 17; + _context4.next = 21; + return pool.getOutputAmount(amountIn); + + case 21: + _yield$pool$getOutput2 = _context4.sent; + amountOut = _yield$pool$getOutput2[0]; + _context4.next = 30; + break; + + case 25: + _context4.prev = 25; + _context4.t0 = _context4["catch"](17); + + if (!_context4.t0.isInsufficientInputAmountError) { + _context4.next = 29; + break; + } + + return _context4.abrupt("continue", 45); + + case 29: + throw _context4.t0; + + case 30: + if (!(amountOut.currency.isToken && amountOut.currency.equals(tokenOut))) { + _context4.next = 41; + break; + } + + _context4.t1 = sdkCore.sortedInsert; + _context4.t2 = bestTrades; + _context4.next = 35; + return Trade.fromRoute(new Route([].concat(currentPools, [pool]), currencyAmountIn.currency, currencyOut), currencyAmountIn, sdkCore.TradeType.EXACT_INPUT); + + case 35: + _context4.t3 = _context4.sent; + _context4.t4 = maxNumResults; + _context4.t5 = tradeComparator; + (0, _context4.t1)(_context4.t2, _context4.t3, _context4.t4, _context4.t5); + _context4.next = 45; + break; + + case 41: + if (!(maxHops > 1 && pools.length > 1)) { + _context4.next = 45; + break; + } + + poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length)); // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops + + _context4.next = 45; + return Trade.bestTradeExactIn(poolsExcludingThisPool, currencyAmountIn, currencyOut, { + maxNumResults: maxNumResults, + maxHops: maxHops - 1 + }, [].concat(currentPools, [pool]), amountOut, bestTrades); + + case 45: + i++; + _context4.next = 12; + break; + + case 48: + return _context4.abrupt("return", bestTrades); + + case 49: + case "end": + return _context4.stop(); + } + } + }, _callee4, null, [[17, 25]]); + })); + + function bestTradeExactIn(_x8, _x9, _x10, _x11, _x12, _x13, _x14) { + return _bestTradeExactIn.apply(this, arguments); + } + + return bestTradeExactIn; + }() + /** + * similar to the above method but instead targets a fixed output amount + * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token + * to an output token amount, making at most `maxHops` hops + * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pools the pools to consider in finding the best trade + * @param currencyIn the currency to spend + * @param currencyAmountOut the desired currency amount out + * @param nextAmountOut the exact amount of currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool + * @param currentPools used in recursion; the current list of pools + * @param bestTrades used in recursion; the current list of best trades + */ + ; + + Trade.bestTradeExactOut = + /*#__PURE__*/ + function () { + var _bestTradeExactOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pools, currencyIn, currencyAmountOut, _temp2, // used in recursion. + currentPools, nextAmountOut, bestTrades) { + var _ref3, _ref3$maxNumResults, maxNumResults, _ref3$maxHops, maxHops, chainId, amountOut, tokenIn, i, pool, amountIn, _yield$pool$getInputA, poolsExcludingThisPool; + + return runtime_1.wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _ref3 = _temp2 === void 0 ? {} : _temp2, _ref3$maxNumResults = _ref3.maxNumResults, maxNumResults = _ref3$maxNumResults === void 0 ? 3 : _ref3$maxNumResults, _ref3$maxHops = _ref3.maxHops, maxHops = _ref3$maxHops === void 0 ? 3 : _ref3$maxHops; + + if (currentPools === void 0) { + currentPools = []; + } + + if (nextAmountOut === void 0) { + nextAmountOut = currencyAmountOut; + } + + if (bestTrades === void 0) { + bestTrades = []; + } + + !(pools.length > 0) ? invariant(false, 'POOLS') : void 0; + !(maxHops > 0) ? invariant(false, 'MAX_HOPS') : void 0; + !(currencyAmountOut === nextAmountOut || currentPools.length > 0) ? invariant(false, 'INVALID_RECURSION') : void 0; + chainId = nextAmountOut.currency.isToken ? nextAmountOut.currency.chainId : currencyIn.isToken ? currencyIn.chainId : undefined; + !(chainId !== undefined) ? invariant(false, 'CHAIN_ID') : void 0; + amountOut = sdkCore.wrappedCurrencyAmount(nextAmountOut, chainId); + tokenIn = sdkCore.wrappedCurrency(currencyIn, chainId); + i = 0; + + case 12: + if (!(i < pools.length)) { + _context5.next = 48; + break; + } + + pool = pools[i]; // pool irrelevant + + if (!(!sdkCore.currencyEquals(pool.token0, amountOut.currency) && !sdkCore.currencyEquals(pool.token1, amountOut.currency))) { + _context5.next = 16; + break; + } + + return _context5.abrupt("continue", 45); + + case 16: + amountIn = void 0; + _context5.prev = 17; + _context5.next = 21; + return pool.getInputAmount(amountOut); + + case 21: + _yield$pool$getInputA = _context5.sent; + amountIn = _yield$pool$getInputA[0]; + _context5.next = 30; + break; + + case 25: + _context5.prev = 25; + _context5.t0 = _context5["catch"](17); + + if (!_context5.t0.isInsufficientReservesError) { + _context5.next = 29; + break; + } + + return _context5.abrupt("continue", 45); + + case 29: + throw _context5.t0; + + case 30: + if (!sdkCore.currencyEquals(amountIn.currency, tokenIn)) { + _context5.next = 41; + break; + } + + _context5.t1 = sdkCore.sortedInsert; + _context5.t2 = bestTrades; + _context5.next = 35; + return Trade.fromRoute(new Route([pool].concat(currentPools), currencyIn, currencyAmountOut.currency), currencyAmountOut, sdkCore.TradeType.EXACT_OUTPUT); + + case 35: + _context5.t3 = _context5.sent; + _context5.t4 = maxNumResults; + _context5.t5 = tradeComparator; + (0, _context5.t1)(_context5.t2, _context5.t3, _context5.t4, _context5.t5); + _context5.next = 45; + break; + + case 41: + if (!(maxHops > 1 && pools.length > 1)) { + _context5.next = 45; + break; + } + + poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length)); // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops + + _context5.next = 45; + return Trade.bestTradeExactOut(poolsExcludingThisPool, currencyIn, currencyAmountOut, { + maxNumResults: maxNumResults, + maxHops: maxHops - 1 + }, [pool].concat(currentPools), amountIn, bestTrades); + + case 45: + i++; + _context5.next = 12; + break; + + case 48: + return _context5.abrupt("return", bestTrades); + + case 49: + case "end": + return _context5.stop(); + } + } + }, _callee5, null, [[17, 25]]); + })); + + function bestTradeExactOut(_x15, _x16, _x17, _x18, _x19, _x20, _x21) { + return _bestTradeExactOut.apply(this, arguments); + } + + return bestTradeExactOut; + }(); + + _createClass(Trade, [{ + key: "executionPrice", + get: function get() { + var _this$_executionPrice; + + return (_this$_executionPrice = this._executionPrice) != null ? _this$_executionPrice : this._executionPrice = new sdkCore.Price(this.inputAmount.currency, this.outputAmount.currency, this.inputAmount.quotient, this.outputAmount.quotient); + } + /** + * Returns the percent difference between the route's mid price and the price impact + */ + + }, { + key: "priceImpact", + get: function get() { + var _this$_priceImpact; + + return (_this$_priceImpact = this._priceImpact) != null ? _this$_priceImpact : this._priceImpact = sdkCore.computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount); + } + }]); + + return Trade; +}(); + +function isAllowedPermit(permitOptions) { + return 'nonce' in permitOptions; +} + +var SelfPermit = /*#__PURE__*/function () { + function SelfPermit() {} + + SelfPermit.encodePermit = function encodePermit(token, options) { + return isAllowedPermit(options) ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [token.address, toHex(options.nonce), toHex(options.expiry), options.v, options.r, options.s]) : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [token.address, toHex(options.amount), toHex(options.deadline), options.v, options.r, options.s]); + }; + + return SelfPermit; +}(); +SelfPermit.INTERFACE = /*#__PURE__*/new abi.Interface(ISelfPermit_json.abi); + +var MaxUint128 = /*#__PURE__*/toHex( /*#__PURE__*/JSBI.subtract( /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(128)), /*#__PURE__*/JSBI.BigInt(1))); // type guard + +function isMint(options) { + return Object.keys(options).some(function (k) { + return k === 'recipient'; + }); +} + +var NonfungiblePositionManager = /*#__PURE__*/function (_SelfPermit) { + _inheritsLoose(NonfungiblePositionManager, _SelfPermit); + + /** + * Cannot be constructed. + */ + function NonfungiblePositionManager() { + return _SelfPermit.call(this) || this; + } + + NonfungiblePositionManager.addCallParameters = function addCallParameters(position, options) { + !JSBI.greaterThan(position.liquidity, ZERO) ? invariant(false, 'ZERO_LIQUIDITY') : void 0; + var calldatas = []; // get amounts + + var _position$mintAmounts = position.mintAmounts, + amount0Desired = _position$mintAmounts.amount0, + amount1Desired = _position$mintAmounts.amount1; // adjust for slippage + + var minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance); + var amount0Min = toHex(minimumAmounts.amount0); + var amount1Min = toHex(minimumAmounts.amount1); + var deadline = toHex(options.deadline); // create pool if needed + + if (isMint(options) && options.createPool) { + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [position.pool.token0.address, position.pool.token1.address, position.pool.fee, toHex(position.pool.sqrtRatioX96)])); + } // permits if necessary + + + if (options.token0Permit) { + calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit)); + } + + if (options.token1Permit) { + calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit)); + } // mint + + + if (isMint(options)) { + var recipient = sdkCore.validateAndParseAddress(options.recipient); + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [{ + token0: position.pool.token0.address, + token1: position.pool.token1.address, + fee: position.pool.fee, + tickLower: position.tickLower, + tickUpper: position.tickUpper, + amount0Desired: toHex(amount0Desired), + amount1Desired: toHex(amount1Desired), + amount0Min: amount0Min, + amount1Min: amount1Min, + recipient: recipient, + deadline: deadline + }])); + } else { + // increase + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [{ + tokenId: toHex(options.tokenId), + amount0Desired: toHex(amount0Desired), + amount1Desired: toHex(amount1Desired), + amount0Min: amount0Min, + amount1Min: amount1Min, + deadline: deadline + }])); + } + + var value = toHex(0); + + if (options.useEther) { + var weth = sdkCore.WETH9[position.pool.chainId]; + !(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth))) ? invariant(false, 'NO_WETH') : void 0; + var wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired; // we only need to refund if we're actually sending ETH + + if (JSBI.greaterThan(wethValue, ZERO)) { + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH')); + } + + value = toHex(wethValue); + } + + return { + calldata: calldatas.length === 1 ? calldatas[0] : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), + value: value + }; + }; + + NonfungiblePositionManager.encodeCollect = function encodeCollect(options) { + var calldatas = []; + var tokenId = toHex(options.tokenId); + var involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther; + var recipient = sdkCore.validateAndParseAddress(options.recipient); // collect + + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [{ + tokenId: tokenId, + recipient: involvesETH ? ADDRESS_ZERO : recipient, + amount0Max: MaxUint128, + amount1Max: MaxUint128 + }])); + + if (involvesETH) { + var ethAmount = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed0.quotient : options.expectedCurrencyOwed1.quotient; + var token = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed1.currency : options.expectedCurrencyOwed0.currency; + var tokenAmount = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed1.quotient : options.expectedCurrencyOwed0.quotient; + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])); + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [token.address, toHex(tokenAmount), recipient])); + } + + return calldatas; + }; + + NonfungiblePositionManager.collectCallParameters = function collectCallParameters(options) { + var calldatas = NonfungiblePositionManager.encodeCollect(options); + return { + calldata: calldatas.length === 1 ? calldatas[0] : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), + value: toHex(0) + }; + } + /** + * Produces the calldata for completely or partially exiting a position + * @param position the position to exit + * @param options additional information necessary for generating the calldata + */ + ; + + NonfungiblePositionManager.removeCallParameters = function removeCallParameters(position, options) { + var calldatas = []; + var deadline = toHex(options.deadline); + var tokenId = toHex(options.tokenId); // construct a partial position with a percentage of liquidity + + var partialPosition = new Position({ + pool: position.pool, + liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient, + tickLower: position.tickLower, + tickUpper: position.tickUpper + }); + !JSBI.greaterThan(partialPosition.liquidity, ZERO) ? invariant(false, 'ZERO_LIQUIDITY') : void 0; // slippage-adjusted underlying amounts + + var _partialPosition$burn = partialPosition.burnAmountsWithSlippage(options.slippageTolerance), + amount0Min = _partialPosition$burn.amount0, + amount1Min = _partialPosition$burn.amount1; + + if (options.permit) { + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [sdkCore.validateAndParseAddress(options.permit.spender), tokenId, toHex(options.permit.deadline), options.permit.v, options.permit.r, options.permit.s])); + } // remove liquidity + + + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [{ + tokenId: tokenId, + liquidity: toHex(partialPosition.liquidity), + amount0Min: toHex(amount0Min), + amount1Min: toHex(amount1Min), + deadline: deadline + }])); + + var _options$collectOptio = options.collectOptions, + expectedCurrencyOwed0 = _options$collectOptio.expectedCurrencyOwed0, + expectedCurrencyOwed1 = _options$collectOptio.expectedCurrencyOwed1, + rest = _objectWithoutPropertiesLoose(_options$collectOptio, ["expectedCurrencyOwed0", "expectedCurrencyOwed1"]); + + calldatas.push.apply(calldatas, NonfungiblePositionManager.encodeCollect(_extends({ + tokenId: options.tokenId, + // add the underlying value to the expected currency already owed + expectedCurrencyOwed0: expectedCurrencyOwed0.add(expectedCurrencyOwed0.currency.isEther ? sdkCore.CurrencyAmount.ether(amount0Min) : sdkCore.CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency, amount0Min)), + expectedCurrencyOwed1: expectedCurrencyOwed1.add(expectedCurrencyOwed1.currency.isEther ? sdkCore.CurrencyAmount.ether(amount1Min) : sdkCore.CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency, amount1Min)) + }, rest))); + + if (options.liquidityPercentage.equalTo(ONE)) { + if (options.burnToken) { + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId])); + } + } else { + !(options.burnToken !== true) ? invariant(false, 'CANNOT_BURN') : void 0; + } + + return { + calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), + value: toHex(0) + }; + }; + + return NonfungiblePositionManager; +}(SelfPermit); +NonfungiblePositionManager.INTERFACE = /*#__PURE__*/new abi.Interface(NonfungiblePositionManager_json.abi); + +/** + * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades. + */ + +var SwapRouter = /*#__PURE__*/function (_SelfPermit) { + _inheritsLoose(SwapRouter, _SelfPermit); + + /** + * Cannot be constructed. + */ + function SwapRouter() { + return _SelfPermit.call(this) || this; + } + /** + * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. + * @param trade to produce call parameters for + * @param options options for the call parameters + */ + + + SwapRouter.swapCallParameters = function swapCallParameters(trade, options) { + var calldatas = []; // encode permit if necessary + + if (options.inputTokenPermit) { + !trade.inputAmount.currency.isToken ? invariant(false, 'NON_TOKEN_PERMIT') : void 0; + calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit)); + } + + var recipient = sdkCore.validateAndParseAddress(options.recipient); + var deadline = toHex(options.deadline); + var amountIn = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient); + var amountOut = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient); + var value = trade.inputAmount.currency.isEther ? amountIn : toHex(0); // flag for whether the trade is single hop or not + + var singleHop = trade.route.pools.length === 1; // flag for whether a refund needs to happen + + var mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === sdkCore.TradeType.EXACT_OUTPUT; // flags for whether funds should be send first to the router + + var outputIsEther = trade.outputAmount.currency.isEther; + var routerMustCustody = outputIsEther || !!options.fee; + + if (singleHop) { + if (trade.tradeType === sdkCore.TradeType.EXACT_INPUT) { + var _options$sqrtPriceLim; + + var exactInputSingleParams = { + tokenIn: trade.route.tokenPath[0].address, + tokenOut: trade.route.tokenPath[1].address, + fee: trade.route.pools[0].fee, + recipient: routerMustCustody ? ADDRESS_ZERO : recipient, + deadline: deadline, + amountIn: amountIn, + amountOutMinimum: amountOut, + sqrtPriceLimitX96: toHex((_options$sqrtPriceLim = options.sqrtPriceLimitX96) != null ? _options$sqrtPriceLim : 0) + }; + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams])); + } else { + var _options$sqrtPriceLim2; + + var exactOutputSingleParams = { + tokenIn: trade.route.tokenPath[0].address, + tokenOut: trade.route.tokenPath[1].address, + fee: trade.route.pools[0].fee, + recipient: routerMustCustody ? ADDRESS_ZERO : recipient, + deadline: deadline, + amountOut: amountOut, + amountInMaximum: amountIn, + sqrtPriceLimitX96: toHex((_options$sqrtPriceLim2 = options.sqrtPriceLimitX96) != null ? _options$sqrtPriceLim2 : 0) + }; + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams])); + } + } else { + !(options.sqrtPriceLimitX96 === undefined) ? invariant(false, 'MULTIHOP_PRICE_LIMIT') : void 0; + var path = encodeRouteToPath(trade.route, trade.tradeType === sdkCore.TradeType.EXACT_OUTPUT); + + if (trade.tradeType === sdkCore.TradeType.EXACT_INPUT) { + var exactInputParams = { + path: path, + recipient: routerMustCustody ? ADDRESS_ZERO : recipient, + deadline: deadline, + amountIn: amountIn, + amountOutMinimum: amountOut + }; + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams])); + } else { + var exactOutputParams = { + path: path, + recipient: routerMustCustody ? ADDRESS_ZERO : recipient, + deadline: deadline, + amountOut: amountOut, + amountInMaximum: amountIn + }; + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams])); + } + } // refund + + + if (mustRefund) { + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH')); + } // unwrap + + + if (routerMustCustody) { + if (!!options.fee) { + var feeRecipient = sdkCore.validateAndParseAddress(options.fee.recipient); + var fee = toHex(options.fee.fee.multiply(10000).quotient); + + if (outputIsEther) { + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])); + } else { + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [trade.route.tokenPath[trade.route.tokenPath.length - 1].address, amountOut, recipient, fee, feeRecipient])); + } + } else { + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient])); + } + } + + return { + calldata: calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]), + value: value + }; + }; + + return SwapRouter; +}(SelfPermit); +SwapRouter.INTERFACE = /*#__PURE__*/new abi.Interface(SwapRouter_json.abi); + +exports.ADDRESS_ZERO = ADDRESS_ZERO; +exports.FACTORY_ADDRESS = FACTORY_ADDRESS; +exports.FullMath = FullMath; +exports.LiquidityMath = LiquidityMath; +exports.NoTickDataProvider = NoTickDataProvider; +exports.NonfungiblePositionManager = NonfungiblePositionManager; +exports.POOL_INIT_CODE_HASH = POOL_INIT_CODE_HASH; +exports.Pool = Pool; +exports.Position = Position; +exports.Route = Route; +exports.SqrtPriceMath = SqrtPriceMath; +exports.SwapRouter = SwapRouter; +exports.TICK_SPACINGS = TICK_SPACINGS; +exports.Tick = Tick; +exports.TickList = TickList; +exports.TickListDataProvider = TickListDataProvider; +exports.TickMath = TickMath; +exports.Trade = Trade; +exports.computePoolAddress = computePoolAddress; +exports.encodeRouteToPath = encodeRouteToPath; +exports.encodeSqrtRatioX96 = encodeSqrtRatioX96; +exports.isSorted = isSorted; +exports.maxLiquidityForAmounts = maxLiquidityForAmounts; +exports.mostSignificantBit = mostSignificantBit; +exports.nearestUsableTick = nearestUsableTick; +exports.priceToClosestTick = priceToClosestTick; +exports.tickToPrice = tickToPrice; +exports.toHex = toHex; +exports.tradeComparator = tradeComparator; +//# sourceMappingURL=v3-sdk.cjs.development.js.map diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js.map b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js.map new file mode 100644 index 00000000000..3fb73ecb319 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v3-sdk.cjs.development.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/constants.ts","../src/internalConstants.ts","../src/utils/computePoolAddress.ts","../src/utils/liquidityMath.ts","../src/utils/fullMath.ts","../src/utils/sqrtPriceMath.ts","../src/utils/swapMath.ts","../src/utils/mostSignificantBit.ts","../src/utils/tickMath.ts","../src/entities/tickDataProvider.ts","../src/utils/isSorted.ts","../src/utils/tickList.ts","../src/utils/calldata.ts","../src/utils/encodeRouteToPath.ts","../src/utils/encodeSqrtRatioX96.ts","../src/utils/maxLiquidityForAmounts.ts","../src/utils/nearestUsableTick.ts","../src/utils/priceTickConversions.ts","../src/entities/tick.ts","../src/entities/tickListDataProvider.ts","../src/entities/pool.ts","../src/entities/position.ts","../src/entities/route.ts","../src/entities/trade.ts","../src/selfPermit.ts","../src/nonfungiblePositionManager.ts","../src/swapRouter.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","export const FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'\n\nexport const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'\n\nexport const POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'\n\n/**\n * The default factory enabled fee amounts, denominated in hundredths of bips.\n */\nexport enum FeeAmount {\n LOW = 500,\n MEDIUM = 3000,\n HIGH = 10000\n}\n\n/**\n * The default factory tick spacings by fee amount.\n */\nexport const TICK_SPACINGS: { [amount in FeeAmount]: number } = {\n [FeeAmount.LOW]: 10,\n [FeeAmount.MEDIUM]: 60,\n [FeeAmount.HIGH]: 200\n}\n","import JSBI from 'jsbi'\n\n// constants used internally but not expected to be used externally\nexport const NEGATIVE_ONE = JSBI.BigInt(-1)\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\n\n// used in liquidity amount math\nexport const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96))\nexport const Q192 = JSBI.exponentiate(Q96, JSBI.BigInt(2))\n","import { defaultAbiCoder } from '@ethersproject/abi'\nimport { getCreate2Address } from '@ethersproject/address'\nimport { keccak256 } from '@ethersproject/solidity'\nimport { Token } from '@uniswap/sdk-core'\nimport { FeeAmount, POOL_INIT_CODE_HASH } from '../constants'\n\nexport function computePoolAddress({\n factoryAddress,\n tokenA,\n tokenB,\n fee\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n fee: FeeAmount\n}): string {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(\n ['bytes'],\n [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]\n ),\n POOL_INIT_CODE_HASH\n )\n}\n","import JSBI from 'jsbi'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\n\nexport abstract class LiquidityMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static addDelta(x: JSBI, y: JSBI): JSBI {\n if (JSBI.lessThan(y, ZERO)) {\n return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE))\n } else {\n return JSBI.add(x, y)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { ONE, ZERO } from '../internalConstants'\n\nexport abstract class FullMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI {\n const product = JSBI.multiply(a, b)\n let result = JSBI.divide(product, denominator)\n if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE)\n return result\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO, Q96 } from '../internalConstants'\nimport { FullMath } from './fullMath'\n\nconst MaxUint160 = JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(160)), ONE)\n\nfunction multiplyIn256(x: JSBI, y: JSBI): JSBI {\n const product = JSBI.multiply(x, y)\n return JSBI.bitwiseAnd(product, MaxUint256)\n}\n\nfunction addIn256(x: JSBI, y: JSBI): JSBI {\n const sum = JSBI.add(x, y)\n return JSBI.bitwiseAnd(sum, MaxUint256)\n}\n\nexport abstract class SqrtPriceMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n const numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)\n\n return roundUp\n ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96)\n : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96)\n }\n\n public static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n return roundUp\n ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96)\n : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96)\n }\n\n public static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)\n : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true)\n }\n\n public static getNextSqrtPriceFromOutput(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amountOut: JSBI,\n zeroForOne: boolean\n ): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)\n : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false)\n }\n\n private static getNextSqrtPriceFromAmount0RoundingUp(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (JSBI.equal(amount, ZERO)) return sqrtPX96\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n\n if (add) {\n let product = multiplyIn256(amount, sqrtPX96)\n if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) {\n const denominator = addIn256(numerator1, product)\n if (JSBI.greaterThanOrEqual(denominator, numerator1)) {\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount))\n } else {\n let product = multiplyIn256(amount, sqrtPX96)\n\n invariant(JSBI.equal(JSBI.divide(product, amount), sqrtPX96))\n invariant(JSBI.greaterThan(numerator1, product))\n const denominator = JSBI.subtract(numerator1, product)\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n private static getNextSqrtPriceFromAmount1RoundingDown(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (add) {\n const quotient = JSBI.lessThanOrEqual(amount, MaxUint160)\n ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity)\n : JSBI.divide(JSBI.multiply(amount, Q96), liquidity)\n\n return JSBI.add(sqrtPX96, quotient)\n } else {\n const quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity)\n\n invariant(JSBI.greaterThan(sqrtPX96, quotient))\n return JSBI.subtract(sqrtPX96, quotient)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { FeeAmount } from '../constants'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\nimport { FullMath } from './fullMath'\nimport { SqrtPriceMath } from './sqrtPriceMath'\n\nconst MAX_FEE = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(6))\n\nexport abstract class SwapMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static computeSwapStep(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioTargetX96: JSBI,\n liquidity: JSBI,\n amountRemaining: JSBI,\n feePips: FeeAmount\n ): [JSBI, JSBI, JSBI, JSBI] {\n const returnValues: Partial<{\n sqrtRatioNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n }> = {}\n\n const zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96)\n const exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO)\n\n if (exactIn) {\n const amountRemainingLessFee = JSBI.divide(\n JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))),\n MAX_FEE\n )\n returnValues.amountIn = zeroForOne\n ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true)\n if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn!)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(\n sqrtRatioCurrentX96,\n liquidity,\n amountRemainingLessFee,\n zeroForOne\n )\n }\n } else {\n returnValues.amountOut = zeroForOne\n ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false)\n if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(\n sqrtRatioCurrentX96,\n liquidity,\n JSBI.multiply(amountRemaining, NEGATIVE_ONE),\n zeroForOne\n )\n }\n }\n\n const max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96)\n\n if (zeroForOne) {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false)\n } else {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false)\n }\n\n if (!exactIn && JSBI.greaterThan(returnValues.amountOut!, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) {\n returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE)\n }\n\n if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) {\n // we didn't reach the target, so take the remainder of the maximum input as fee\n returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn!)\n } else {\n returnValues.feeAmount = FullMath.mulDivRoundingUp(\n returnValues.amountIn!,\n JSBI.BigInt(feePips),\n JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))\n )\n }\n\n return [returnValues.sqrtRatioNextX96!, returnValues.amountIn!, returnValues.amountOut!, returnValues.feeAmount!]\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\n\nconst TWO = JSBI.BigInt(2)\nconst POWERS_OF_2 = [128, 64, 32, 16, 8, 4, 2, 1].map((pow: number): [number, JSBI] => [\n pow,\n JSBI.exponentiate(TWO, JSBI.BigInt(pow))\n])\n\nexport function mostSignificantBit(x: JSBI): number {\n invariant(JSBI.greaterThan(x, ZERO), 'ZERO')\n invariant(JSBI.lessThanOrEqual(x, MaxUint256), 'MAX')\n\n let msb: number = 0\n for (const [power, min] of POWERS_OF_2) {\n if (JSBI.greaterThanOrEqual(x, min)) {\n x = JSBI.signedRightShift(x, JSBI.BigInt(power))\n msb += power\n }\n }\n return msb\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { mostSignificantBit } from './mostSignificantBit'\n\nfunction mulShift(val: JSBI, mulBy: string): JSBI {\n return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128))\n}\n\nconst Q32 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(32))\n\nexport abstract class TickMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n /**\n * The minimum tick that can be used on any pool.\n */\n public static MIN_TICK: number = -887272\n /**\n * The maximum tick that can be used on any pool.\n */\n public static MAX_TICK: number = -TickMath.MIN_TICK\n\n /**\n * The sqrt ratio corresponding to the minimum tick that could be used on any pool.\n */\n public static MIN_SQRT_RATIO: JSBI = JSBI.BigInt('4295128739')\n /**\n * The sqrt ratio corresponding to the maximum tick that could be used on any pool.\n */\n public static MAX_SQRT_RATIO: JSBI = JSBI.BigInt('1461446703485210103287273052203988822378723970342')\n\n /**\n * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick\n * @param tick the tick for which to compute the sqrt ratio\n */\n public static getSqrtRatioAtTick(tick: number): JSBI {\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick), 'TICK')\n const absTick: number = tick < 0 ? tick * -1 : tick\n\n let ratio: JSBI =\n (absTick & 0x1) != 0\n ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001')\n : JSBI.BigInt('0x100000000000000000000000000000000')\n if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a')\n if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc')\n if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0')\n if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644')\n if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0')\n if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861')\n if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053')\n if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4')\n if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54')\n if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3')\n if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9')\n if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825')\n if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5')\n if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7')\n if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6')\n if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9')\n if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604')\n if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98')\n if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2')\n\n if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio)\n\n // back to Q96\n return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO)\n ? JSBI.add(JSBI.divide(ratio, Q32), ONE)\n : JSBI.divide(ratio, Q32)\n }\n\n /**\n * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96\n * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96\n * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick\n */\n public static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number {\n invariant(\n JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) &&\n JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO),\n 'SQRT_RATIO'\n )\n\n const sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32))\n\n const msb = mostSignificantBit(sqrtRatioX128)\n\n let r: JSBI\n if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) {\n r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127))\n } else {\n r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb))\n }\n\n let log_2: JSBI = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64))\n\n for (let i = 0; i < 14; i++) {\n r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127))\n const f = JSBI.signedRightShift(r, JSBI.BigInt(128))\n log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i)))\n r = JSBI.signedRightShift(r, f)\n }\n\n const log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141'))\n\n const tickLow = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')),\n JSBI.BigInt(128)\n )\n )\n const tickHigh = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')),\n JSBI.BigInt(128)\n )\n )\n\n return tickLow === tickHigh\n ? tickLow\n : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96)\n ? tickHigh\n : tickLow\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\n\n/**\n * Provides information about ticks\n */\nexport interface TickDataProvider {\n /**\n * Return information corresponding to a specific tick\n * @param tick the tick to load\n */\n getTick(tick: number): Promise<{ liquidityNet: BigintIsh }>\n\n /**\n * Return the next tick that is initialized within a single word\n * @param tick the current tick\n * @param lte whether the next tick should be lte the current tick\n * @param tickSpacing the tick spacing of the pool\n */\n nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>\n}\n\n/**\n * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you\n * do not need to load tick data for your use case.\n */\nexport class NoTickDataProvider implements TickDataProvider {\n private static ERROR_MESSAGE = 'No tick data provider was given'\n async getTick(_tick: number): Promise<{ liquidityNet: BigintIsh }> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n\n async nextInitializedTickWithinOneWord(\n _tick: number,\n _lte: boolean,\n _tickSpacing: number\n ): Promise<[number, boolean]> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n}\n","export function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean {\n for (let i = 0; i < list.length - 1; i++) {\n if (comparator(list[i], list[i + 1]) > 0) {\n return false\n }\n }\n return true\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { isSorted } from './isSorted'\nimport { Tick } from '../entities/tick'\n\nfunction tickComparator(a: Tick, b: Tick) {\n return a.index - b.index\n}\n\n/**\n * Utility methods for interacting with sorted lists of ticks\n */\nexport abstract class TickList {\n /**\n * Cannot be constructed\n */\n private constructor() {}\n\n public static validateList(ticks: Tick[], tickSpacing: number) {\n invariant(tickSpacing > 0, 'TICK_SPACING_NONZERO')\n // ensure ticks are spaced appropriately\n invariant(\n ticks.every(({ index }) => index % tickSpacing === 0),\n 'TICK_SPACING'\n )\n\n // ensure tick liquidity deltas sum to 0\n invariant(\n JSBI.equal(\n ticks.reduce((accumulator, { liquidityNet }) => JSBI.add(accumulator, liquidityNet), ZERO),\n ZERO\n ),\n 'ZERO_NET'\n )\n\n invariant(isSorted(ticks, tickComparator), 'SORTED')\n }\n\n public static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick < ticks[0].index\n }\n\n public static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick >= ticks[ticks.length - 1].index\n }\n\n public static getTick(ticks: readonly Tick[], index: number): Tick {\n const tick = ticks[this.binarySearch(ticks, index)]\n invariant(tick.index === index, 'NOT_CONTAINED')\n return tick\n }\n\n /**\n * Finds the largest tick in the list of ticks that is less than or equal to tick\n * @param ticks list of ticks\n * @param tick tick to find the largest tick that is less than or equal to tick\n * @private\n */\n private static binarySearch(ticks: readonly Tick[], tick: number): number {\n invariant(!this.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n\n let l = 0\n let r = ticks.length - 1\n let i\n while (true) {\n i = Math.floor((l + r) / 2)\n\n if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) {\n return i\n }\n\n if (ticks[i].index < tick) {\n l = i + 1\n } else {\n r = i - 1\n }\n }\n }\n\n public static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick {\n if (lte) {\n invariant(!TickList.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n if (TickList.isAtOrAboveLargest(ticks, tick)) {\n return ticks[ticks.length - 1]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index]\n } else {\n invariant(!this.isAtOrAboveLargest(ticks, tick), 'AT_OR_ABOVE_LARGEST')\n if (this.isBelowSmallest(ticks, tick)) {\n return ticks[0]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index + 1]\n }\n }\n\n public static nextInitializedTickWithinOneWord(\n ticks: readonly Tick[],\n tick: number,\n lte: boolean,\n tickSpacing: number\n ): [number, boolean] {\n const compressed = Math.floor(tick / tickSpacing) // matches rounding in the code\n\n if (lte) {\n const wordPos = compressed >> 8\n const minimum = (wordPos << 8) * tickSpacing\n\n if (TickList.isBelowSmallest(ticks, tick)) {\n return [minimum, false]\n }\n\n const index = TickList.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.max(minimum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n } else {\n const wordPos = (compressed + 1) >> 8\n const maximum = ((wordPos + 1) << 8) * tickSpacing - 1\n\n if (this.isAtOrAboveLargest(ticks, tick)) {\n return [maximum, false]\n }\n\n const index = this.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.min(maximum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n }\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\n\n/**\n * Generated method parameters for executing a call.\n */\nexport interface MethodParameters {\n /**\n * The hex encoded calldata to perform the given operation\n */\n calldata: string\n /**\n * The amount of ether (wei) to send in hex.\n */\n value: string\n}\n\nexport function toHex(bigintIsh: BigintIsh) {\n const bigInt = JSBI.BigInt(bigintIsh)\n let hex = bigInt.toString(16)\n if (hex.length % 2 !== 0) {\n hex = `0${hex}`\n }\n return `0x${hex}`\n}\n","import { pack } from '@ethersproject/solidity'\nimport { Currency, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from '../entities/pool'\nimport { Route } from '../entities/route'\n\n/**\n * Converts a route to a hex encoded path\n * @param route the v3 path to convert to an encoded path\n * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps\n */\nexport function encodeRouteToPath(route: Route, exactOutput: boolean): string {\n const firstInputToken: Token = wrappedCurrency(route.input, route.chainId)\n\n const { path, types } = route.pools.reduce(\n (\n { inputToken, path, types }: { inputToken: Token; path: (string | number)[]; types: string[] },\n pool: Pool,\n index\n ): { inputToken: Token; path: (string | number)[]; types: string[] } => {\n const outputToken: Token = pool.token0.equals(inputToken) ? pool.token1 : pool.token0\n if (index === 0) {\n return {\n inputToken: outputToken,\n types: ['address', 'uint24', 'address'],\n path: [inputToken.address, pool.fee, outputToken.address]\n }\n } else {\n return {\n inputToken: outputToken,\n types: [...types, 'uint24', 'address'],\n path: [...path, pool.fee, outputToken.address]\n }\n }\n },\n { inputToken: firstInputToken, path: [], types: [] }\n )\n\n return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path)\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, sqrt } from '@uniswap/sdk-core'\n\n/**\n * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0\n * @param amount1 the numerator amount, i.e. amount of token1\n * @param amount0 the denominator amount, i.en amount of token0\n */\nexport function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI {\n const numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192))\n const denominator = JSBI.BigInt(amount0)\n const ratioX192 = JSBI.divide(numerator, denominator)\n return sqrt(ratioX192)\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q96 } from '../internalConstants'\n\nfunction maxLiquidityForAmount0Imprecise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n const intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96)\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\nfunction maxLiquidityForAmount0Precise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96)\n const denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n\n return JSBI.divide(numerator, denominator)\n}\n\nfunction maxLiquidityForAmount1(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount1: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\n/**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param sqrtRatioCurrentX96 the current price\n * @param sqrtRatioAX96 price at lower boundary\n * @param sqrtRatioBX96 price at upper boundary\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\nexport function maxLiquidityForAmounts(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioAX96: JSBI,\n sqrtRatioBX96: JSBI,\n amount0: BigintIsh,\n amount1: BigintIsh,\n useFullPrecision: boolean\n): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise\n\n if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) {\n return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0)\n } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) {\n const liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0)\n const liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1)\n return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1\n } else {\n return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns the closest tick that is nearest a given tick and usable for the given tick spacing\n * @param tick the target tick\n * @param tickSpacing the spacing of the pool\n */\nexport function nearestUsableTick(tick: number, tickSpacing: number) {\n invariant(Number.isInteger(tick) && Number.isInteger(tickSpacing), 'INTEGERS')\n invariant(tickSpacing > 0, 'TICK_SPACING')\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, 'TICK_BOUND')\n const rounded = Math.round(tick / tickSpacing) * tickSpacing\n if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing\n else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing\n else return rounded\n}\n","import { Price, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q192 } from '../internalConstants'\nimport { encodeSqrtRatioX96 } from './encodeSqrtRatioX96'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns a price object corresponding to the input tick and the base/quote token\n * Inputs must be tokens because the address order is used to interpret the price represented by the tick\n * @param baseToken the base token of the price\n * @param quoteToken the quote token of the price\n * @param tick the tick for which to return the price\n */\nexport function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price {\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick)\n\n const ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96)\n\n return baseToken.sortsBefore(quoteToken)\n ? new Price(baseToken, quoteToken, Q192, ratioX192)\n : new Price(baseToken, quoteToken, ratioX192, Q192)\n}\n\n/**\n * Returns the first tick for which the given price is greater than or equal to the tick price\n * @param price for which to return the closest tick that represents a price less than or equal to the input price,\n * i.e. the price of the returned tick is less than or equal to the input price\n */\nexport function priceToClosestTick(price: Price): number {\n const sorted = price.baseCurrency.sortsBefore(price.quoteCurrency)\n\n const sqrtRatioX96 = sorted\n ? encodeSqrtRatioX96(price.numerator, price.denominator)\n : encodeSqrtRatioX96(price.denominator, price.numerator)\n\n let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96)\n const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1)\n if (sorted) {\n if (!price.lessThan(nextTickPrice)) {\n tick++\n }\n } else {\n if (!price.greaterThan(nextTickPrice)) {\n tick++\n }\n }\n return tick\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { BigintIsh } from '@uniswap/sdk-core'\nimport { TickMath } from '../utils'\n\nexport interface TickConstructorArgs {\n index: number\n liquidityGross: BigintIsh\n liquidityNet: BigintIsh\n}\n\nexport class Tick {\n public readonly index: number\n public readonly liquidityGross: JSBI\n public readonly liquidityNet: JSBI\n\n constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs) {\n invariant(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK, 'TICK')\n this.index = index\n this.liquidityGross = JSBI.BigInt(liquidityGross)\n this.liquidityNet = JSBI.BigInt(liquidityNet)\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport { TickList } from '../utils/tickList'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { TickDataProvider } from './tickDataProvider'\n\n/**\n * A data provider for ticks that is backed by an in-memory array of ticks.\n */\nexport class TickListDataProvider implements TickDataProvider {\n private ticks: readonly Tick[]\n\n constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number) {\n const ticksMapped: Tick[] = ticks.map(t => (t instanceof Tick ? t : new Tick(t)))\n TickList.validateList(ticksMapped, tickSpacing)\n this.ticks = ticksMapped\n }\n\n async getTick(tick: number): Promise<{ liquidityNet: BigintIsh; liquidityGross: BigintIsh }> {\n return TickList.getTick(this.ticks, tick)\n }\n\n async nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]> {\n return TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)\n }\n}\n","import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { FACTORY_ADDRESS, FeeAmount, TICK_SPACINGS } from '../constants'\nimport { NEGATIVE_ONE, ONE, Q192, ZERO } from '../internalConstants'\nimport { computePoolAddress } from '../utils/computePoolAddress'\nimport { LiquidityMath } from '../utils/liquidityMath'\nimport { SwapMath } from '../utils/swapMath'\nimport { TickMath } from '../utils/tickMath'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { NoTickDataProvider, TickDataProvider } from './tickDataProvider'\nimport { TickListDataProvider } from './tickListDataProvider'\n\ninterface StepComputations {\n sqrtPriceStartX96: JSBI\n tickNext: number\n initialized: boolean\n sqrtPriceNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n}\n\n/**\n * By default, pools will not allow operations that require ticks.\n */\nconst NO_TICK_DATA_PROVIDER_DEFAULT = new NoTickDataProvider()\n\n/**\n * Represents a V3 pool\n */\nexport class Pool {\n public readonly token0: Token\n public readonly token1: Token\n public readonly fee: FeeAmount\n public readonly sqrtRatioX96: JSBI\n public readonly liquidity: JSBI\n public readonly tickCurrent: number\n public readonly tickDataProvider: TickDataProvider\n\n private _token0Price?: Price\n private _token1Price?: Price\n\n public static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount): string {\n return computePoolAddress({ factoryAddress: FACTORY_ADDRESS, fee, tokenA, tokenB })\n }\n\n /**\n * Construct a pool\n * @param tokenA one of the tokens in the pool\n * @param tokenB the other token in the pool\n * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool\n * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0\n * @param liquidity the current value of in range liquidity\n * @param tickCurrent the current tick of the pool\n * @param ticks the current state of the pool ticks or a data provider that can return tick data\n */\n public constructor(\n tokenA: Token,\n tokenB: Token,\n fee: FeeAmount,\n sqrtRatioX96: BigintIsh,\n liquidity: BigintIsh,\n tickCurrent: number,\n ticks: TickDataProvider | (Tick | TickConstructorArgs)[] = NO_TICK_DATA_PROVIDER_DEFAULT\n ) {\n invariant(Number.isInteger(fee) && fee < 1_000_000, 'FEE')\n\n const tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent)\n const nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1)\n invariant(\n JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) &&\n JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96),\n 'PRICE_BOUNDS'\n )\n // always create a copy of the list since we want the pool's tick list to be immutable\n ;[this.token0, this.token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n this.fee = fee\n this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96)\n this.liquidity = JSBI.BigInt(liquidity)\n this.tickCurrent = tickCurrent\n this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0\n */\n public get token0Price(): Price {\n return (\n this._token0Price ??\n (this._token0Price = new Price(\n this.token0,\n this.token1,\n Q192,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)\n ))\n )\n }\n\n /**\n * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1\n */\n public get token1Price(): Price {\n return (\n this._token1Price ??\n (this._token1Price = new Price(\n this.token1,\n this.token0,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96),\n Q192\n ))\n )\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pool.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pool.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n /**\n * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade\n * @param inputAmount the input amount for which to quote the output amount\n */\n public async getOutputAmount(\n inputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n\n const zeroForOne = inputAmount.currency.equals(this.token0)\n\n const { amountCalculated: outputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n inputAmount.quotient,\n sqrtPriceLimitX96\n )\n const outputToken = zeroForOne ? this.token1 : this.token0\n return [\n CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n /**\n * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade\n * @param outputAmount the output amount for which to quote the input amount\n */\n public async getInputAmount(\n outputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency), 'TOKEN')\n\n const zeroForOne = outputAmount.currency.equals(this.token1)\n\n const { amountCalculated: inputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE),\n sqrtPriceLimitX96\n )\n const inputToken = zeroForOne ? this.token0 : this.token1\n return [\n CurrencyAmount.fromRawAmount(inputToken, inputAmount),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n private async swap(\n zeroForOne: boolean,\n amountSpecified: JSBI,\n sqrtPriceLimitX96?: JSBI\n ): Promise<{ amountCalculated: JSBI; sqrtRatioX96: JSBI; liquidity: JSBI; tickCurrent: number }> {\n if (!sqrtPriceLimitX96)\n sqrtPriceLimitX96 = zeroForOne\n ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE)\n : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE)\n\n if (zeroForOne) {\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO), 'RATIO_MIN')\n invariant(JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n } else {\n invariant(JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO), 'RATIO_MAX')\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n }\n\n const exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO)\n\n // keep track of swap state\n const state = {\n amountSpecifiedRemaining: amountSpecified,\n amountCalculated: ZERO,\n sqrtPriceX96: this.sqrtRatioX96,\n tick: this.tickCurrent,\n liquidity: this.liquidity\n }\n\n // start swap while loop\n while (JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96) {\n let step: Partial = {}\n step.sqrtPriceStartX96 = state.sqrtPriceX96\n\n // because each iteration of the while loop rounds, we can't optimize this code (relative to the smart contract)\n // by simply traversing to the next available tick, we instead need to exactly replicate\n // tickBitmap.nextInitializedTickWithinOneWord\n ;[step.tickNext, step.initialized] = await this.tickDataProvider.nextInitializedTickWithinOneWord(\n state.tick,\n zeroForOne,\n this.tickSpacing\n )\n\n if (step.tickNext < TickMath.MIN_TICK) {\n step.tickNext = TickMath.MIN_TICK\n } else if (step.tickNext > TickMath.MAX_TICK) {\n step.tickNext = TickMath.MAX_TICK\n }\n\n step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext)\n ;[state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount] = SwapMath.computeSwapStep(\n state.sqrtPriceX96,\n (zeroForOne\n ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)\n : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96))\n ? sqrtPriceLimitX96\n : step.sqrtPriceNextX96,\n state.liquidity,\n state.amountSpecifiedRemaining,\n this.fee\n )\n\n if (exactInput) {\n state.amountSpecifiedRemaining = JSBI.subtract(\n state.amountSpecifiedRemaining,\n JSBI.add(step.amountIn, step.feeAmount)\n )\n state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut)\n } else {\n state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut)\n state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount))\n }\n\n // TODO\n if (JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) {\n // if the tick is initialized, run the tick transition\n if (step.initialized) {\n let liquidityNet = JSBI.BigInt((await this.tickDataProvider.getTick(step.tickNext)).liquidityNet)\n // if we're moving leftward, we interpret liquidityNet as the opposite sign\n // safe because liquidityNet cannot be type(int128).min\n if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE)\n\n state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet)\n }\n\n state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext\n } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {\n // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved\n state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96)\n }\n }\n\n return {\n amountCalculated: state.amountCalculated,\n sqrtRatioX96: state.sqrtPriceX96,\n liquidity: state.liquidity,\n tickCurrent: state.tick\n }\n }\n\n public get tickSpacing(): number {\n return TICK_SPACINGS[this.fee]\n }\n}\n","import { BigintIsh, MaxUint256, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { maxLiquidityForAmounts } from '../utils/maxLiquidityForAmounts'\nimport { tickToPrice } from '../utils/priceTickConversions'\nimport { SqrtPriceMath } from '../utils/sqrtPriceMath'\nimport { TickMath } from '../utils/tickMath'\nimport { encodeSqrtRatioX96 } from '../utils/encodeSqrtRatioX96'\nimport { Pool } from './pool'\n\ninterface PositionConstructorArgs {\n pool: Pool\n tickLower: number\n tickUpper: number\n liquidity: BigintIsh\n}\n\n/**\n * Represents a position on a Uniswap V3 Pool\n */\nexport class Position {\n public readonly pool: Pool\n public readonly tickLower: number\n public readonly tickUpper: number\n public readonly liquidity: JSBI\n\n // cached resuts for the getters\n private _token0Amount: CurrencyAmount | null = null\n private _token1Amount: CurrencyAmount | null = null\n private _mintAmounts: Readonly<{ amount0: JSBI; amount1: JSBI }> | null = null\n\n /**\n * Constructs a position for a given pool with the given liquidity\n * @param pool for which pool the liquidity is assigned\n * @param liquidity the amount of liquidity that is in the position\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n */\n public constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs) {\n invariant(tickLower < tickUpper, 'TICK_ORDER')\n invariant(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0, 'TICK_LOWER')\n invariant(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0, 'TICK_UPPER')\n\n this.pool = pool\n this.tickLower = tickLower\n this.tickUpper = tickUpper\n this.liquidity = JSBI.BigInt(liquidity)\n }\n\n /**\n * Returns the price of token0 at the lower tick\n */\n public get token0PriceLower(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower)\n }\n\n /**\n * Returns the price of token0 at the upper tick\n */\n public get token0PriceUpper(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper)\n }\n\n /**\n * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price\n */\n public get amount0(): CurrencyAmount {\n if (this._token0Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else {\n this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO)\n }\n }\n return this._token0Amount\n }\n\n /**\n * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price\n */\n public get amount1(): CurrencyAmount {\n if (this._token1Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO)\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n false\n )\n )\n } else {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n }\n }\n return this._token1Amount\n }\n\n /**\n * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage\n * @param slippageTolerance amount by which the price can 'slip'\n * @private\n */\n private ratiosAfterSlippage(slippageTolerance: Percent): { sqrtRatioX96Lower: JSBI; sqrtRatioX96Upper: JSBI } {\n const priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance))\n const priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1))\n let sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator)\n if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) {\n sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1))\n }\n let sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator)\n if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) {\n sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1))\n }\n return {\n sqrtRatioX96Lower,\n sqrtRatioX96Upper\n }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position\n * with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage)\n const positionThatWillBeCreated = Position.fromAmounts({\n pool: this.pool,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper,\n ...this.mintAmounts, // the mint amounts are what will be passed as calldata\n useFullPrecision: false\n })\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const { amount0 } = new Position({\n pool: poolUpper,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n // ...and the lower for amount1\n const { amount1 } = new Position({\n pool: poolLower,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n\n return { amount0, amount1 }\n }\n\n /**\n * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the\n * position with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const amount0 = new Position({\n pool: poolUpper,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount0\n // ...and the lower for amount1\n const amount1 = new Position({\n pool: poolLower,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount1\n\n return { amount0: amount0.quotient, amount1: amount1.quotient }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at\n * the current price for the pool\n */\n public get mintAmounts(): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n if (this._mintAmounts === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: ZERO\n }\n } else if (this.pool.tickCurrent < this.tickUpper) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n true\n )\n }\n } else {\n return {\n amount0: ZERO,\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n )\n }\n }\n }\n return this._mintAmounts\n }\n\n /**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param pool the pool for which the position should be created\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmounts({\n pool,\n tickLower,\n tickUpper,\n amount0,\n amount1,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n amount1: BigintIsh\n useFullPrecision: boolean\n }) {\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower)\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper)\n return new Position({\n pool,\n tickLower,\n tickUpper,\n liquidity: maxLiquidityForAmounts(\n pool.sqrtRatioX96,\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0,\n amount1,\n useFullPrecision\n )\n })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount0 the desired amount of token0\n * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmount0({\n pool,\n tickLower,\n tickUpper,\n amount0,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n useFullPrecision: boolean\n }) {\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0, amount1: MaxUint256, useFullPrecision })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount1 the desired amount of token1\n */\n public static fromAmount1({\n pool,\n tickLower,\n tickUpper,\n amount1\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount1: BigintIsh\n }) {\n // this function always uses full precision,\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0: MaxUint256, amount1, useFullPrecision: true })\n }\n}\n","import invariant from 'tiny-invariant'\n\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from './pool'\n\n/**\n * Represents a list of pools through which a swap can occur\n */\nexport class Route {\n public readonly pools: Pool[]\n public readonly tokenPath: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n private _midPrice: Price | null = null\n\n public constructor(pools: Pool[], input: TInput, output: TOutput) {\n invariant(pools.length > 0, 'POOLS')\n\n const chainId = pools[0].chainId\n const allOnSameChain = pools.every(pool => pool.chainId === chainId)\n invariant(allOnSameChain, 'CHAIN_IDS')\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pools[0].involvesToken(wrappedInput), 'INPUT')\n\n invariant(pools[pools.length - 1].involvesToken(wrappedCurrency(output, chainId)), 'OUTPUT')\n\n /**\n * Normalizes token0-token1 order and selects the next token/fee step to add to the path\n * */\n const tokenPath: Token[] = [wrappedInput]\n for (const [i, pool] of pools.entries()) {\n const currentInputToken = tokenPath[i]\n invariant(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1), 'PATH')\n const nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0\n tokenPath.push(nextToken)\n }\n\n this.pools = pools\n this.tokenPath = tokenPath\n this.input = input\n this.output = output ?? tokenPath[tokenPath.length - 1]\n }\n\n public get chainId(): ChainId | number {\n return this.pools[0].chainId\n }\n\n /**\n * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token.\n */\n public get inputToken(): Token {\n return wrappedCurrency(this.input, this.chainId)\n }\n\n /**\n * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token.\n */\n public get outputToken(): Token {\n return wrappedCurrency(this.output, this.chainId)\n }\n\n /**\n * Returns the mid price of the route\n */\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n\n const price = this.pools.slice(1).reduce(\n ({ nextInput, price }, pool) => {\n return nextInput.equals(pool.token0)\n ? {\n nextInput: pool.token1,\n price: price.multiply(pool.token0Price)\n }\n : {\n nextInput: pool.token0,\n price: price.multiply(pool.token1Price)\n }\n },\n this.pools[0].token0.equals(this.inputToken)\n ? {\n nextInput: this.pools[0].token1,\n price: this.pools[0].token0Price\n }\n : {\n nextInput: this.pools[0].token0,\n price: this.pools[0].token1Price\n }\n ).price\n\n return (this._midPrice = new Price(this.input, this.output, price.denominator, price.numerator))\n }\n}\n","import {\n ChainId,\n Currency,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n CurrencyAmount,\n TradeType,\n wrappedCurrency,\n wrappedCurrencyAmount,\n Token,\n computePriceImpact\n} from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { Pool } from './pool'\nimport { Route } from './route'\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n // consider the number of hops since each hop costs gas\n return a.route.tokenPath.length - b.route.tokenPath.length\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pools.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pools the trade goes through.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n\n /**\n * The cached result of the computed execution price\n * @private\n */\n private _executionPrice: Price | undefined\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public get executionPrice(): Price {\n return (\n this._executionPrice ??\n (this._executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n ))\n )\n }\n\n /**\n * The cached result of the price impact computation\n * @private\n */\n private _priceImpact: Percent | undefined\n\n /**\n * Returns the percent difference between the route's mid price and the price impact\n */\n public get priceImpact(): Percent {\n return (\n this._priceImpact ??\n (this._priceImpact = computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount))\n )\n }\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static async exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static async exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n /**\n * Constructs a trade by simulating swaps through the given route\n * @param route route to swap through\n * @param amount the amount specified, either input or output, depending on tradeType\n * @param tradeType whether the trade is an exact input or exact output swap\n */\n public static async fromRoute(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ): Promise> {\n const amounts: CurrencyAmount[] = new Array(route.tokenPath.length)\n let inputAmount: CurrencyAmount\n let outputAmount: CurrencyAmount\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n amounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.tokenPath.length - 1; i++) {\n const pool = route.pools[i]\n const [outputAmount] = await pool.getOutputAmount(amounts[i])\n amounts[i + 1] = outputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n amounts[amounts.length - 1].numerator,\n amounts[amounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n amounts[amounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.tokenPath.length - 1; i > 0; i--) {\n const pool = route.pools[i - 1]\n const [inputAmount] = await pool.getInputAmount(amounts[i])\n amounts[i - 1] = inputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n\n return new Trade({\n route,\n tradeType,\n inputAmount,\n outputAmount\n })\n }\n\n /**\n * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade\n * elsewhere and do not have any tick data\n * @param constructorArguments the arguments passed to the trade constructor\n */\n public static createUncheckedTrade<\n TInput extends Currency,\n TOutput extends Currency,\n TTradeType extends TradeType\n >(constructorArguments: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }): Trade {\n return new Trade(constructorArguments)\n }\n\n /**\n * Construct a trade by passing in the pre-computed property values\n * @param route the route through which the trade occurs\n * @param inputAmount the amount of input paid in the trade\n * @param outputAmount the amount of output received in the trade\n * @param tradeType the type of trade, exact input or exact output\n */\n private constructor({\n route,\n inputAmount,\n outputAmount,\n tradeType\n }: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }) {\n invariant(currencyEquals(inputAmount.currency, route.input), 'INPUT_CURRENCY_MATCH')\n invariant(currencyEquals(outputAmount.currency, route.output), 'OUTPUT_CURRENCY_MATCH')\n this.route = route\n this.inputAmount = inputAmount\n this.outputAmount = outputAmount\n this.tradeType = tradeType\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactIn(\n pools: Pool[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountIn.currency) && !currencyEquals(pool.token1, amountIn.currency)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = await pool.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (amountOut.currency.isToken && amountOut.currency.equals(tokenOut)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([...currentPools, pool], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactIn(\n poolsExcludingThisPool,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPools, pool],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param currencyAmountOut the desired currency amount out\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactOut(\n pools: Pool[],\n currencyIn: Currency,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? currencyIn.chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountOut.currency) && !currencyEquals(pool.token1, amountOut.currency)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = await pool.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pool\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([pool, ...currentPools], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactOut(\n poolsExcludingThisPool,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pool, ...currentPools],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { BigintIsh, Token } from '@uniswap/sdk-core'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'\nimport { toHex } from './utils'\n\nexport interface StandardPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n amount: BigintIsh\n deadline: BigintIsh\n}\n\nexport interface AllowedPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n nonce: BigintIsh\n expiry: BigintIsh\n}\n\nexport type PermitOptions = StandardPermitArguments | AllowedPermitArguments\n\n// type guard\nfunction isAllowedPermit(permitOptions: PermitOptions): permitOptions is AllowedPermitArguments {\n return 'nonce' in permitOptions\n}\n\nexport abstract class SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n protected constructor() {}\n\n protected static encodePermit(token: Token, options: PermitOptions) {\n return isAllowedPermit(options)\n ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [\n token.address,\n toHex(options.nonce),\n toHex(options.expiry),\n options.v,\n options.r,\n options.s\n ])\n : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [\n token.address,\n toHex(options.amount),\n toHex(options.deadline),\n options.v,\n options.r,\n options.s\n ])\n }\n}\n","import {\n BigintIsh,\n ChainId,\n Percent,\n Token,\n CurrencyAmount,\n validateAndParseAddress,\n WETH9,\n Currency\n} from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { Position } from './entities/position'\nimport { ONE, ZERO } from './internalConstants'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { ADDRESS_ZERO } from './constants'\n\nconst MaxUint128 = toHex(JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(128)), JSBI.BigInt(1)))\n\nexport interface MintSpecificOptions {\n /**\n * The account that should receive the minted NFT.\n */\n recipient: string\n\n /**\n * Creates pool if not initialized before mint.\n */\n createPool?: boolean\n}\n\nexport interface IncreaseSpecificOptions {\n /**\n * Indicates the ID of the position to increase liquidity for.\n */\n tokenId: BigintIsh\n}\n\n/**\n * Options for producing the calldata to add liquidity.\n */\nexport interface CommonAddLiquidityOptions {\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false\n */\n useEther?: boolean\n\n /**\n * The optional permit parameters for spending token0\n */\n token0Permit?: PermitOptions\n\n /**\n * The optional permit parameters for spending token1\n */\n token1Permit?: PermitOptions\n}\n\nexport type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions\nexport type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions\n\nexport type AddLiquidityOptions = MintOptions | IncreaseOptions\n\n// type guard\nfunction isMint(options: AddLiquidityOptions): options is MintOptions {\n return Object.keys(options).some(k => k === 'recipient')\n}\n\nexport interface CollectOptions {\n /**\n * Indicates the ID of the position to collect for.\n */\n tokenId: BigintIsh\n\n /**\n * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed0: CurrencyAmount\n\n /**\n * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed1: CurrencyAmount\n\n /**\n * The account that should receive the tokens.\n */\n recipient: string\n}\n\nexport interface NFTPermitOptions {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n deadline: BigintIsh\n spender: string\n}\n\n/**\n * Options for producing the calldata to exit a position.\n */\nexport interface RemoveLiquidityOptions {\n /**\n * The ID of the token to exit\n */\n tokenId: BigintIsh\n\n /**\n * The percentage of position liquidity to exit.\n */\n liquidityPercentage: Percent\n\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether the NFT should be burned if the entire position is being exited, by default false.\n */\n burnToken?: boolean\n\n /**\n * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT\n */\n permit?: NFTPermitOptions\n\n /**\n * Parameters to be passed on to collect\n */\n collectOptions: Omit\n}\n\nexport abstract class NonfungiblePositionManager extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n public static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters {\n invariant(JSBI.greaterThan(position.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n const calldatas: string[] = []\n\n // get amounts\n const { amount0: amount0Desired, amount1: amount1Desired } = position.mintAmounts\n\n // adjust for slippage\n const minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance)\n const amount0Min = toHex(minimumAmounts.amount0)\n const amount1Min = toHex(minimumAmounts.amount1)\n\n const deadline = toHex(options.deadline)\n\n // create pool if needed\n if (isMint(options) && options.createPool) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [\n position.pool.token0.address,\n position.pool.token1.address,\n position.pool.fee,\n toHex(position.pool.sqrtRatioX96)\n ])\n )\n }\n\n // permits if necessary\n if (options.token0Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit))\n }\n if (options.token1Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit))\n }\n\n // mint\n if (isMint(options)) {\n const recipient: string = validateAndParseAddress(options.recipient)\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [\n {\n token0: position.pool.token0.address,\n token1: position.pool.token1.address,\n fee: position.pool.fee,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper,\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n recipient,\n deadline\n }\n ])\n )\n } else {\n // increase\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [\n {\n tokenId: toHex(options.tokenId),\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n deadline\n }\n ])\n )\n }\n\n let value: string = toHex(0)\n\n if (options.useEther) {\n const weth = WETH9[position.pool.chainId as ChainId]\n invariant(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth)), 'NO_WETH')\n\n const wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired\n\n // we only need to refund if we're actually sending ETH\n if (JSBI.greaterThan(wethValue, ZERO)) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n value = toHex(wethValue)\n }\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n\n private static encodeCollect(options: CollectOptions): string[] {\n const calldatas: string[] = []\n\n const tokenId = toHex(options.tokenId)\n\n const involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther\n\n const recipient = validateAndParseAddress(options.recipient)\n\n // collect\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [\n {\n tokenId,\n recipient: involvesETH ? ADDRESS_ZERO : recipient,\n amount0Max: MaxUint128,\n amount1Max: MaxUint128\n }\n ])\n )\n\n if (involvesETH) {\n const ethAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed0.quotient\n : options.expectedCurrencyOwed1.quotient\n const token = options.expectedCurrencyOwed0.currency.isEther\n ? (options.expectedCurrencyOwed1.currency as Token)\n : (options.expectedCurrencyOwed0.currency as Token)\n const tokenAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed1.quotient\n : options.expectedCurrencyOwed0.quotient\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])\n )\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [\n token.address,\n toHex(tokenAmount),\n recipient\n ])\n )\n }\n\n return calldatas\n }\n\n public static collectCallParameters(options: CollectOptions): MethodParameters {\n const calldatas: string[] = NonfungiblePositionManager.encodeCollect(options)\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n\n /**\n * Produces the calldata for completely or partially exiting a position\n * @param position the position to exit\n * @param options additional information necessary for generating the calldata\n */\n public static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters {\n const calldatas: string[] = []\n\n const deadline = toHex(options.deadline)\n const tokenId = toHex(options.tokenId)\n\n // construct a partial position with a percentage of liquidity\n const partialPosition = new Position({\n pool: position.pool,\n liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper\n })\n invariant(JSBI.greaterThan(partialPosition.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n // slippage-adjusted underlying amounts\n const { amount0: amount0Min, amount1: amount1Min } = partialPosition.burnAmountsWithSlippage(\n options.slippageTolerance\n )\n\n if (options.permit) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [\n validateAndParseAddress(options.permit.spender),\n tokenId,\n toHex(options.permit.deadline),\n options.permit.v,\n options.permit.r,\n options.permit.s\n ])\n )\n }\n\n // remove liquidity\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [\n {\n tokenId,\n liquidity: toHex(partialPosition.liquidity),\n amount0Min: toHex(amount0Min),\n amount1Min: toHex(amount1Min),\n deadline\n }\n ])\n )\n\n const { expectedCurrencyOwed0, expectedCurrencyOwed1, ...rest } = options.collectOptions\n calldatas.push(\n ...NonfungiblePositionManager.encodeCollect({\n tokenId: options.tokenId,\n // add the underlying value to the expected currency already owed\n expectedCurrencyOwed0: expectedCurrencyOwed0.add(\n expectedCurrencyOwed0.currency.isEther\n ? CurrencyAmount.ether(amount0Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency as Token, amount0Min)\n ),\n expectedCurrencyOwed1: expectedCurrencyOwed1.add(\n expectedCurrencyOwed1.currency.isEther\n ? CurrencyAmount.ether(amount1Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency as Token, amount1Min)\n ),\n ...rest\n })\n )\n\n if (options.liquidityPercentage.equalTo(ONE)) {\n if (options.burnToken) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId]))\n }\n } else {\n invariant(options.burnToken !== true, 'CANNOT_BURN')\n }\n\n return {\n calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { BigintIsh, Currency, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { Trade } from './entities/trade'\nimport { ADDRESS_ZERO } from './constants'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { encodeRouteToPath } from './utils'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'\n\nexport interface FeeOptions {\n /**\n * The percent of the output that will be taken as a fee.\n */\n fee: Percent\n\n /**\n * The recipient of the fee.\n */\n recipient: string\n}\n\n/**\n * Options for producing the arguments to send calls to the router.\n */\nexport interface SwapOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n slippageTolerance: Percent\n\n /**\n * The account that should receive the output.\n */\n recipient: string\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * The optional permit parameters for spending the input.\n */\n inputTokenPermit?: PermitOptions\n\n /**\n * The optional price limit for the trade.\n */\n sqrtPriceLimitX96?: BigintIsh\n\n /**\n * Optional information for taking a fee on output.\n */\n fee?: FeeOptions\n}\n\n/**\n * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades.\n */\nexport abstract class SwapRouter extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: SwapOptions\n ): MethodParameters {\n const calldatas: string[] = []\n\n // encode permit if necessary\n if (options.inputTokenPermit) {\n invariant(trade.inputAmount.currency.isToken, 'NON_TOKEN_PERMIT')\n calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit))\n }\n\n const recipient: string = validateAndParseAddress(options.recipient)\n\n const deadline = toHex(options.deadline)\n\n const amountIn: string = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient)\n const amountOut: string = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient)\n const value: string = trade.inputAmount.currency.isEther ? amountIn : toHex(0)\n\n // flag for whether the trade is single hop or not\n const singleHop = trade.route.pools.length === 1\n\n // flag for whether a refund needs to happen\n const mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === TradeType.EXACT_OUTPUT\n\n // flags for whether funds should be send first to the router\n const outputIsEther = trade.outputAmount.currency.isEther\n const routerMustCustody = outputIsEther || !!options.fee\n\n if (singleHop) {\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams]))\n } else {\n const exactOutputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams]))\n }\n } else {\n invariant(options.sqrtPriceLimitX96 === undefined, 'MULTIHOP_PRICE_LIMIT')\n\n const path: string = encodeRouteToPath(trade.route, trade.tradeType === TradeType.EXACT_OUTPUT)\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams]))\n } else {\n const exactOutputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams]))\n }\n }\n\n // refund\n if (mustRefund) {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n // unwrap\n if (routerMustCustody) {\n if (!!options.fee) {\n const feeRecipient: string = validateAndParseAddress(options.fee.recipient)\n const fee = toHex(options.fee.fee.multiply(10_000).quotient)\n\n if (outputIsEther) {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])\n )\n } else {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [\n trade.route.tokenPath[trade.route.tokenPath.length - 1].address,\n amountOut,\n recipient,\n fee,\n feeRecipient\n ])\n )\n }\n } else {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient]))\n }\n }\n\n return {\n calldata:\n calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n}\n"],"names":["undefined","FACTORY_ADDRESS","ADDRESS_ZERO","POOL_INIT_CODE_HASH","FeeAmount","TICK_SPACINGS","LOW","MEDIUM","HIGH","NEGATIVE_ONE","JSBI","BigInt","ZERO","ONE","Q96","exponentiate","Q192","computePoolAddress","factoryAddress","tokenA","tokenB","fee","sortsBefore","token0","token1","getCreate2Address","keccak256","defaultAbiCoder","encode","address","LiquidityMath","addDelta","x","y","lessThan","subtract","multiply","add","FullMath","mulDivRoundingUp","a","b","denominator","product","result","divide","notEqual","remainder","MaxUint160","multiplyIn256","bitwiseAnd","MaxUint256","addIn256","sum","SqrtPriceMath","getAmount0Delta","sqrtRatioAX96","sqrtRatioBX96","liquidity","roundUp","greaterThan","numerator1","leftShift","numerator2","getAmount1Delta","getNextSqrtPriceFromInput","sqrtPX96","amountIn","zeroForOne","invariant","getNextSqrtPriceFromAmount0RoundingUp","getNextSqrtPriceFromAmount1RoundingDown","getNextSqrtPriceFromOutput","amountOut","amount","equal","greaterThanOrEqual","quotient","lessThanOrEqual","MAX_FEE","SwapMath","computeSwapStep","sqrtRatioCurrentX96","sqrtRatioTargetX96","amountRemaining","feePips","returnValues","exactIn","amountRemainingLessFee","sqrtRatioNextX96","max","feeAmount","TWO","POWERS_OF_2","map","pow","mostSignificantBit","msb","power","min","signedRightShift","mulShift","val","mulBy","Q32","TickMath","getSqrtRatioAtTick","tick","MIN_TICK","MAX_TICK","Number","isInteger","absTick","ratio","getTickAtSqrtRatio","sqrtRatioX96","MIN_SQRT_RATIO","MAX_SQRT_RATIO","sqrtRatioX128","r","log_2","i","f","bitwiseOr","log_sqrt10001","tickLow","toNumber","tickHigh","NoTickDataProvider","getTick","_tick","Error","ERROR_MESSAGE","nextInitializedTickWithinOneWord","_lte","_tickSpacing","isSorted","list","comparator","length","tickComparator","index","TickList","validateList","ticks","tickSpacing","every","reduce","accumulator","liquidityNet","isBelowSmallest","isAtOrAboveLargest","binarySearch","l","Math","floor","nextInitializedTick","lte","compressed","wordPos","minimum","maximum","toHex","bigintIsh","bigInt","hex","toString","encodeRouteToPath","route","exactOutput","firstInputToken","wrappedCurrency","input","chainId","pools","pool","inputToken","path","types","outputToken","equals","pack","reverse","encodeSqrtRatioX96","amount1","amount0","numerator","ratioX192","sqrt","maxLiquidityForAmount0Imprecise","intermediate","maxLiquidityForAmount0Precise","maxLiquidityForAmount1","maxLiquidityForAmounts","useFullPrecision","maxLiquidityForAmount0","liquidity0","liquidity1","nearestUsableTick","rounded","round","tickToPrice","baseToken","quoteToken","Price","priceToClosestTick","price","sorted","baseCurrency","quoteCurrency","nextTickPrice","Tick","liquidityGross","TickListDataProvider","ticksMapped","t","NO_TICK_DATA_PROVIDER_DEFAULT","Pool","tickCurrent","tickCurrentSqrtRatioX96","nextTickSqrtRatioX96","tickDataProvider","Array","isArray","getAddress","involvesToken","token","priceOf","token0Price","token1Price","getOutputAmount","inputAmount","sqrtPriceLimitX96","currency","swap","outputAmount","amountCalculated","CurrencyAmount","fromRawAmount","getInputAmount","isToken","amountSpecified","exactInput","state","amountSpecifiedRemaining","sqrtPriceX96","step","sqrtPriceStartX96","tickNext","initialized","sqrtPriceNextX96","_token0Price","_token1Price","Position","tickLower","tickUpper","ratiosAfterSlippage","slippageTolerance","priceLower","asFraction","Percent","priceUpper","sqrtRatioX96Lower","sqrtRatioX96Upper","mintAmountsWithSlippage","poolLower","poolUpper","positionThatWillBeCreated","fromAmounts","mintAmounts","burnAmountsWithSlippage","fromAmount0","fromAmount1","_token0Amount","_token1Amount","_mintAmounts","Route","output","allOnSameChain","wrappedInput","tokenPath","entries","currentInputToken","nextToken","push","_midPrice","slice","nextInput","tradeComparator","currencyEquals","equalTo","Trade","tradeType","fromRoute","TradeType","EXACT_INPUT","exactOut","EXACT_OUTPUT","amounts","wrappedCurrencyAmount","fromFractionalAmount","createUncheckedTrade","constructorArguments","minimumAmountOut","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","worstExecutionPrice","bestTradeExactIn","currencyAmountIn","currencyOut","currentPools","nextAmountIn","bestTrades","maxNumResults","maxHops","tokenOut","isInsufficientInputAmountError","sortedInsert","poolsExcludingThisPool","concat","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","_executionPrice","_priceImpact","computePriceImpact","midPrice","isAllowedPermit","permitOptions","SelfPermit","encodePermit","options","INTERFACE","encodeFunctionData","nonce","expiry","v","s","deadline","Interface","abi","MaxUint128","isMint","Object","keys","some","k","NonfungiblePositionManager","addCallParameters","position","calldatas","amount0Desired","amount1Desired","minimumAmounts","amount0Min","amount1Min","createPool","token0Permit","token1Permit","recipient","validateAndParseAddress","tokenId","value","useEther","weth","WETH9","wethValue","calldata","encodeCollect","involvesETH","expectedCurrencyOwed0","isEther","expectedCurrencyOwed1","amount0Max","amount1Max","ethAmount","tokenAmount","collectCallParameters","removeCallParameters","partialPosition","liquidityPercentage","permit","spender","collectOptions","rest","ether","burnToken","SwapRouter","swapCallParameters","trade","inputTokenPermit","singleHop","mustRefund","outputIsEther","routerMustCustody","exactInputSingleParams","amountOutMinimum","exactOutputSingleParams","amountInMaximum","exactInputParams","exactOutputParams","feeRecipient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,UAAU,OAAO,EAAE;AAElC;AACA,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,EAAE,IAAI,MAAM,GAA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AAvD,CAAf;AACD;AACF;;AAED,WAAO;AACLQ,MAAAA,QAAQ,EACNjB,SAAS,CAACzN,MAAV,KAAqB,CAArB,GAAyByN,SAAS,CAAC,CAAD,CAAlC,GAAwCqC,UAAU,CAACvD,SAAX,CAAqBC,kBAArB,CAAwC,WAAxC,EAAqD,CAACiB,SAAD,CAArD,CAFrC;AAGLY,MAAAA,KAAK,EAALA;AAHK,KAAP;AAKD,GAzIH;;AAAA;AAAA,EAAyCjC,UAAzC;AACgB0D,oBAAA,gBAAuB,IAAIhD,aAAJ,CAAcC,mBAAd,CAAvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js new file mode 100644 index 00000000000..c3a564e17c8 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js @@ -0,0 +1,2 @@ +"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@uniswap/sdk-core"),n=t(require("jsbi")),r=t(require("tiny-invariant")),i=require("@ethersproject/abi"),o=require("@ethersproject/address"),u=require("@ethersproject/solidity"),a=require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"),c=require("@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json"),s=require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json");function p(t,e,n,r,i,o,u){try{var a=t[o](u),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function u(t){p(o,r,i,u,a,"next",t)}function a(t){p(o,r,i,u,a,"throw",t)}u(void 0)}))}}function d(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}var g,v,A,T=(function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=Object.create((e&&e.prototype instanceof l?e:l).prototype),o=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var u=n.delegate;if(u){var a=A(u,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,o),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var p={};function l(){}function d(){}function h(){}var f={};f[i]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(q([])));y&&y!==e&&n.call(y,i)&&(f=y);var k=h.prototype=l.prototype=Object.create(f);function g(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var r;this._invoke=function(i,o){function u(){return new e((function(r,u){!function r(i,o,u,a){var c=s(t[i],t,o);if("throw"!==c.type){var p=c.arg,l=p.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,u,a)}),(function(t){r("throw",t,u,a)})):e.resolve(l).then((function(t){p.value=t,u(p)}),(function(t){return r("throw",t,u,a)}))}a(c.arg)}(i,o,r,u)}))}return r=r?r.then(u,u):u()}}function A(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function q(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--i){var o=this.tryEntries[i],u=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(a&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:q(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(A={exports:{}}),A.exports),x="0x0000000000000000000000000000000000000000",I="0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54";(v=exports.FeeAmount||(exports.FeeAmount={}))[v.LOW=500]="LOW",v[v.MEDIUM=3e3]="MEDIUM",v[v.HIGH=1e4]="HIGH";var q=((g={})[exports.FeeAmount.LOW]=10,g[exports.FeeAmount.MEDIUM]=60,g[exports.FeeAmount.HIGH]=200,g),w=n.BigInt(-1),b=n.BigInt(0),R=n.BigInt(1),E=n.exponentiate(n.BigInt(2),n.BigInt(96)),P=n.exponentiate(E,n.BigInt(2));function C(t){var e=t.factoryAddress,n=t.tokenA,r=t.tokenB,a=t.fee,c=n.sortsBefore(r)?[n,r]:[r,n];return o.getCreate2Address(e,u.keccak256(["bytes"],[i.defaultAbiCoder.encode(["address","address","uint24"],[c[0].address,c[1].address,a])]),I)}var S=function(){function t(){}return t.addDelta=function(t,e){return n.lessThan(e,b)?n.subtract(t,n.multiply(e,w)):n.add(t,e)},t}(),O=function(){function t(){}return t.mulDivRoundingUp=function(t,e,r){var i=n.multiply(t,e),o=n.divide(i,r);return n.notEqual(n.remainder(i,r),b)&&(o=n.add(o,R)),o},t}(),N=n.subtract(n.exponentiate(n.BigInt(2),n.BigInt(160)),R);function _(t,r){var i=n.multiply(t,r);return n.bitwiseAnd(i,e.MaxUint256)}var F=function(){function t(){}return t.getAmount0Delta=function(t,e,r,i){if(n.greaterThan(t,e)){var o=[e,t];t=o[0],e=o[1]}var u=n.leftShift(r,n.BigInt(96)),a=n.subtract(e,t);return i?O.mulDivRoundingUp(O.mulDivRoundingUp(u,a,e),R,t):n.divide(n.divide(n.multiply(u,a),e),t)},t.getAmount1Delta=function(t,e,r,i){if(n.greaterThan(t,e)){var o=[e,t];t=o[0],e=o[1]}return i?O.mulDivRoundingUp(r,n.subtract(e,t),E):n.divide(n.multiply(r,n.subtract(e,t)),E)},t.getNextSqrtPriceFromInput=function(t,e,i,o){return n.greaterThan(t,b)||r(!1),n.greaterThan(e,b)||r(!1),o?this.getNextSqrtPriceFromAmount0RoundingUp(t,e,i,!0):this.getNextSqrtPriceFromAmount1RoundingDown(t,e,i,!0)},t.getNextSqrtPriceFromOutput=function(t,e,i,o){return n.greaterThan(t,b)||r(!1),n.greaterThan(e,b)||r(!1),o?this.getNextSqrtPriceFromAmount1RoundingDown(t,e,i,!1):this.getNextSqrtPriceFromAmount0RoundingUp(t,e,i,!1)},t.getNextSqrtPriceFromAmount0RoundingUp=function(t,i,o,u){if(n.equal(o,b))return t;var a=n.leftShift(i,n.BigInt(96));if(u){var c=_(o,t);if(n.equal(n.divide(c,o),t)){var s=(l=n.add(a,c),n.bitwiseAnd(l,e.MaxUint256));if(n.greaterThanOrEqual(s,a))return O.mulDivRoundingUp(a,t,s)}return O.mulDivRoundingUp(a,R,n.add(n.divide(a,t),o))}var p=_(o,t);n.equal(n.divide(p,o),t)||r(!1),n.greaterThan(a,p)||r(!1);var l,d=n.subtract(a,p);return O.mulDivRoundingUp(a,t,d)},t.getNextSqrtPriceFromAmount1RoundingDown=function(t,e,i,o){if(o){var u=n.lessThanOrEqual(i,N)?n.divide(n.leftShift(i,n.BigInt(96)),e):n.divide(n.multiply(i,E),e);return n.add(t,u)}var a=O.mulDivRoundingUp(i,E,e);return n.greaterThan(t,a)||r(!1),n.subtract(t,a)},t}(),L=n.exponentiate(n.BigInt(10),n.BigInt(6)),X=function(){function t(){}return t.computeSwapStep=function(t,e,r,i,o){var u={},a=n.greaterThanOrEqual(t,e),c=n.greaterThanOrEqual(i,b);if(c){var s=n.divide(n.multiply(i,n.subtract(L,n.BigInt(o))),L);u.amountIn=a?F.getAmount0Delta(e,t,r,!0):F.getAmount1Delta(t,e,r,!0),u.sqrtRatioNextX96=n.greaterThanOrEqual(s,u.amountIn)?e:F.getNextSqrtPriceFromInput(t,r,s,a)}else u.amountOut=a?F.getAmount1Delta(e,t,r,!1):F.getAmount0Delta(t,e,r,!1),u.sqrtRatioNextX96=n.greaterThanOrEqual(n.multiply(i,w),u.amountOut)?e:F.getNextSqrtPriceFromOutput(t,r,n.multiply(i,w),a);var p=n.equal(e,u.sqrtRatioNextX96);return a?(u.amountIn=p&&c?u.amountIn:F.getAmount0Delta(u.sqrtRatioNextX96,t,r,!0),u.amountOut=p&&!c?u.amountOut:F.getAmount1Delta(u.sqrtRatioNextX96,t,r,!1)):(u.amountIn=p&&c?u.amountIn:F.getAmount1Delta(t,u.sqrtRatioNextX96,r,!0),u.amountOut=p&&!c?u.amountOut:F.getAmount0Delta(t,u.sqrtRatioNextX96,r,!1)),!c&&n.greaterThan(u.amountOut,n.multiply(i,w))&&(u.amountOut=n.multiply(i,w)),u.feeAmount=c&&n.notEqual(u.sqrtRatioNextX96,e)?n.subtract(i,u.amountIn):O.mulDivRoundingUp(u.amountIn,n.BigInt(o),n.subtract(L,n.BigInt(o))),[u.sqrtRatioNextX96,u.amountIn,u.amountOut,u.feeAmount]},t}(),D=n.BigInt(2),U=[128,64,32,16,8,4,2,1].map((function(t){return[t,n.exponentiate(D,n.BigInt(t))]}));function B(t){n.greaterThan(t,b)||r(!1),n.lessThanOrEqual(t,e.MaxUint256)||r(!1);for(var i,o=0,u=k(U);!(i=u()).done;){var a=i.value,c=a[0];n.greaterThanOrEqual(t,a[1])&&(t=n.signedRightShift(t,n.BigInt(c)),o+=c)}return o}function M(t,e){return n.signedRightShift(n.multiply(t,n.BigInt(e)),n.BigInt(128))}var j=n.exponentiate(n.BigInt(2),n.BigInt(32)),W=function(){function t(){}return t.getSqrtRatioAtTick=function(i){i>=t.MIN_TICK&&i<=t.MAX_TICK&&Number.isInteger(i)||r(!1);var o=i<0?-1*i:i,u=n.BigInt(0!=(1&o)?"0xfffcb933bd6fad37aa2d162d1a594001":"0x100000000000000000000000000000000");return 0!=(2&o)&&(u=M(u,"0xfff97272373d413259a46990580e213a")),0!=(4&o)&&(u=M(u,"0xfff2e50f5f656932ef12357cf3c7fdcc")),0!=(8&o)&&(u=M(u,"0xffe5caca7e10e4e61c3624eaa0941cd0")),0!=(16&o)&&(u=M(u,"0xffcb9843d60f6159c9db58835c926644")),0!=(32&o)&&(u=M(u,"0xff973b41fa98c081472e6896dfb254c0")),0!=(64&o)&&(u=M(u,"0xff2ea16466c96a3843ec78b326b52861")),0!=(128&o)&&(u=M(u,"0xfe5dee046a99a2a811c461f1969c3053")),0!=(256&o)&&(u=M(u,"0xfcbe86c7900a88aedcffc83b479aa3a4")),0!=(512&o)&&(u=M(u,"0xf987a7253ac413176f2b074cf7815e54")),0!=(1024&o)&&(u=M(u,"0xf3392b0822b70005940c7a398e4b70f3")),0!=(2048&o)&&(u=M(u,"0xe7159475a2c29b7443b29c7fa6e889d9")),0!=(4096&o)&&(u=M(u,"0xd097f3bdfd2022b8845ad8f792aa5825")),0!=(8192&o)&&(u=M(u,"0xa9f746462d870fdf8a65dc1f90e061e5")),0!=(16384&o)&&(u=M(u,"0x70d869a156d2a1b890bb3df62baf32f7")),0!=(32768&o)&&(u=M(u,"0x31be135f97d08fd981231505542fcfa6")),0!=(65536&o)&&(u=M(u,"0x9aa508b5b7a84e1c677de54f3e99bc9")),0!=(131072&o)&&(u=M(u,"0x5d6af8dedb81196699c329225ee604")),0!=(262144&o)&&(u=M(u,"0x2216e584f5fa1ea926041bedfe98")),0!=(524288&o)&&(u=M(u,"0x48a170391f7dc42444e8fa2")),i>0&&(u=n.divide(e.MaxUint256,u)),n.greaterThan(n.remainder(u,j),b)?n.add(n.divide(u,j),R):n.divide(u,j)},t.getTickAtSqrtRatio=function(e){n.greaterThanOrEqual(e,t.MIN_SQRT_RATIO)&&n.lessThan(e,t.MAX_SQRT_RATIO)||r(!1);var i,o=n.leftShift(e,n.BigInt(32)),u=B(o);i=n.greaterThanOrEqual(n.BigInt(u),n.BigInt(128))?n.signedRightShift(o,n.BigInt(u-127)):n.leftShift(o,n.BigInt(127-u));for(var a=n.leftShift(n.subtract(n.BigInt(u),n.BigInt(128)),n.BigInt(64)),c=0;c<14;c++){i=n.signedRightShift(n.multiply(i,i),n.BigInt(127));var s=n.signedRightShift(i,n.BigInt(128));a=n.bitwiseOr(a,n.leftShift(s,n.BigInt(63-c))),i=n.signedRightShift(i,s)}var p=n.multiply(a,n.BigInt("255738958999603826347141")),l=n.toNumber(n.signedRightShift(n.subtract(p,n.BigInt("3402992956809132418596140100660247210")),n.BigInt(128))),d=n.toNumber(n.signedRightShift(n.add(p,n.BigInt("291339464771989622907027621153398088495")),n.BigInt(128)));return l===d?l:n.lessThanOrEqual(t.getSqrtRatioAtTick(d),e)?d:l},t}();W.MIN_TICK=-887272,W.MAX_TICK=-W.MIN_TICK,W.MIN_SQRT_RATIO=n.BigInt("4295128739"),W.MAX_SQRT_RATIO=n.BigInt("1461446703485210103287273052203988822378723970342");var H=function(){function t(){}var e=t.prototype;return e.getTick=function(){var e=l(T.mark((function e(n){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error(t.ERROR_MESSAGE);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.nextInitializedTickWithinOneWord=function(){var e=l(T.mark((function e(n,r,i){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error(t.ERROR_MESSAGE);case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),t}();function K(t,e){for(var n=0;n0)return!1;return!0}function G(t,e){return t.index-e.index}H.ERROR_MESSAGE="No tick data provider was given";var Q=function(){function t(){}return t.validateList=function(t,e){e>0||r(!1),t.every((function(t){return t.index%e==0}))||r(!1),n.equal(t.reduce((function(t,e){return n.add(t,e.liquidityNet)}),b),b)||r(!1),K(t,G)||r(!1)},t.isBelowSmallest=function(t,e){return t.length>0||r(!1),e0||r(!1),e>=t[t.length-1].index},t.getTick=function(t,e){var n=t[this.binarySearch(t,e)];return n.index!==e&&r(!1),n},t.binarySearch=function(t,e){this.isBelowSmallest(t,e)&&r(!1);for(var n,i=0,o=t.length-1;;){if(t[n=Math.floor((i+o)/2)].index<=e&&(n===t.length-1||t[n+1].index>e))return n;t[n].index>8<<8)*i;if(t.isBelowSmallest(e,n))return[u,!1];var a=t.nextInitializedTick(e,n,r).index,c=Math.max(u,a);return[c,c===a]}var s=(1+(o+1>>8)<<8)*i-1;if(this.isAtOrAboveLargest(e,n))return[s,!1];var p=this.nextInitializedTick(e,n,r).index,l=Math.min(s,p);return[l,l===p]},t}();function z(t){var e=n.BigInt(t).toString(16);return e.length%2!=0&&(e="0"+e),"0x"+e}function Y(t,n){var r=e.wrappedCurrency(t.input,t.chainId),i=t.pools.reduce((function(t,e,n){var r=t.inputToken,i=t.path,o=t.types,u=e.token0.equals(r)?e.token1:e.token0;return 0===n?{inputToken:u,types:["address","uint24","address"],path:[r.address,e.fee,u.address]}:{inputToken:u,types:[].concat(o,["uint24","address"]),path:[].concat(i,[e.fee,u.address])}}),{inputToken:r,path:[],types:[]}),o=i.path,a=i.types;return n?u.pack(a.reverse(),o.reverse()):u.pack(a,o)}function Z(t,r){var i=n.leftShift(n.BigInt(t),n.BigInt(192)),o=n.BigInt(r),u=n.divide(i,o);return e.sqrt(u)}function $(t,e,r){if(n.greaterThan(t,e)){var i=[e,t];t=i[0],e=i[1]}var o=n.divide(n.multiply(t,e),E);return n.divide(n.multiply(n.BigInt(r),o),n.subtract(e,t))}function J(t,e,r){if(n.greaterThan(t,e)){var i=[e,t];t=i[0],e=i[1]}var o=n.multiply(n.multiply(n.BigInt(r),t),e),u=n.multiply(E,n.subtract(e,t));return n.divide(o,u)}function V(t,e,r){if(n.greaterThan(t,e)){var i=[e,t];t=i[0],e=i[1]}return n.divide(n.multiply(n.BigInt(r),E),n.subtract(e,t))}function tt(t,e,r,i,o,u){if(n.greaterThan(e,r)){var a=[r,e];e=a[0],r=a[1]}var c=u?J:$;if(n.lessThanOrEqual(t,e))return c(e,r,i);if(n.lessThan(t,r)){var s=c(t,r,i),p=V(e,t,o);return n.lessThan(s,p)?s:p}return V(e,r,o)}function et(t,r,i){var o=W.getSqrtRatioAtTick(i),u=n.multiply(o,o);return t.sortsBefore(r)?new e.Price(t,r,P,u):new e.Price(t,r,u,P)}var nt=function(t){var e=t.index,i=t.liquidityGross,o=t.liquidityNet;e>=W.MIN_TICK&&e<=W.MAX_TICK||r(!1),this.index=e,this.liquidityGross=n.BigInt(i),this.liquidityNet=n.BigInt(o)},rt=function(){function t(t,e){var n=t.map((function(t){return t instanceof nt?t:new nt(t)}));Q.validateList(n,e),this.ticks=n}var e=t.prototype;return e.getTick=function(){var t=l(T.mark((function t(e){return T.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Q.getTick(this.ticks,e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.nextInitializedTickWithinOneWord=function(){var t=l(T.mark((function t(e,n,r){return T.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Q.nextInitializedTickWithinOneWord(this.ticks,e,n,r));case 1:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),t}(),it=new H,ot=function(){function t(t,e,i,o,u,a,c){void 0===c&&(c=it),Number.isInteger(i)&&i<1e6||r(!1);var s=W.getSqrtRatioAtTick(a),p=W.getSqrtRatioAtTick(a+1);n.greaterThanOrEqual(n.BigInt(o),s)&&n.lessThanOrEqual(n.BigInt(o),p)||r(!1);var l=t.sortsBefore(e)?[t,e]:[e,t];this.token0=l[0],this.token1=l[1],this.fee=i,this.sqrtRatioX96=n.BigInt(o),this.liquidity=n.BigInt(u),this.tickCurrent=a,this.tickDataProvider=Array.isArray(c)?new rt(c,q[i]):c}t.getAddress=function(t,e,n){return C({factoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",fee:n,tokenA:t,tokenB:e})};var i=t.prototype;return i.involvesToken=function(t){return t.equals(this.token0)||t.equals(this.token1)},i.priceOf=function(t){return this.involvesToken(t)||r(!1),t.equals(this.token0)?this.token0Price:this.token1Price},i.getOutputAmount=function(){var i=l(T.mark((function i(o,u){var a,c,s,p,l;return T.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.involvesToken(o.currency)||r(!1),a=o.currency.equals(this.token0),i.next=4,this.swap(a,o.quotient,u);case 4:return s=(c=i.sent).sqrtRatioX96,p=c.liquidity,l=c.tickCurrent,i.abrupt("return",[e.CurrencyAmount.fromRawAmount(a?this.token1:this.token0,n.multiply(c.amountCalculated,w)),new t(this.token0,this.token1,this.fee,s,p,l,this.tickDataProvider)]);case 11:case"end":return i.stop()}}),i,this)})));return function(t,e){return i.apply(this,arguments)}}(),i.getInputAmount=function(){var i=l(T.mark((function i(o,u){var a,c,s,p,l;return T.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o.currency.isToken&&this.involvesToken(o.currency)||r(!1),a=o.currency.equals(this.token1),i.next=4,this.swap(a,n.multiply(o.quotient,w),u);case 4:return s=(c=i.sent).sqrtRatioX96,p=c.liquidity,l=c.tickCurrent,i.abrupt("return",[e.CurrencyAmount.fromRawAmount(a?this.token0:this.token1,c.amountCalculated),new t(this.token0,this.token1,this.fee,s,p,l,this.tickDataProvider)]);case 11:case"end":return i.stop()}}),i,this)})));return function(t,e){return i.apply(this,arguments)}}(),i.swap=function(){var t=l(T.mark((function t(e,i,o){var u,a,c,s,p,l;return T.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o||(o=e?n.add(W.MIN_SQRT_RATIO,R):n.subtract(W.MAX_SQRT_RATIO,R)),e?(n.greaterThan(o,W.MIN_SQRT_RATIO)||r(!1),n.lessThan(o,this.sqrtRatioX96)||r(!1)):(n.lessThan(o,W.MAX_SQRT_RATIO)||r(!1),n.greaterThan(o,this.sqrtRatioX96)||r(!1)),u=n.greaterThanOrEqual(i,b),a={amountSpecifiedRemaining:i,amountCalculated:b,sqrtPriceX96:this.sqrtRatioX96,tick:this.tickCurrent,liquidity:this.liquidity};case 4:if(!n.notEqual(a.amountSpecifiedRemaining,b)||a.sqrtPriceX96==o){t.next=35;break}return(c={}).sqrtPriceStartX96=a.sqrtPriceX96,t.next=9,this.tickDataProvider.nextInitializedTickWithinOneWord(a.tick,e,this.tickSpacing);case 9:if(c.tickNext=(s=t.sent)[0],c.initialized=s[1],c.tickNextW.MAX_TICK&&(c.tickNext=W.MAX_TICK),c.sqrtPriceNextX96=W.getSqrtRatioAtTick(c.tickNext),p=X.computeSwapStep(a.sqrtPriceX96,(e?n.lessThan(c.sqrtPriceNextX96,o):n.greaterThan(c.sqrtPriceNextX96,o))?o:c.sqrtPriceNextX96,a.liquidity,a.amountSpecifiedRemaining,this.fee),a.sqrtPriceX96=p[0],c.amountIn=p[1],c.amountOut=p[2],c.feeAmount=p[3],u?(a.amountSpecifiedRemaining=n.subtract(a.amountSpecifiedRemaining,n.add(c.amountIn,c.feeAmount)),a.amountCalculated=n.subtract(a.amountCalculated,c.amountOut)):(a.amountSpecifiedRemaining=n.add(a.amountSpecifiedRemaining,c.amountOut),a.amountCalculated=n.add(a.amountCalculated,n.add(c.amountIn,c.feeAmount))),!n.equal(a.sqrtPriceX96,c.sqrtPriceNextX96)){t.next=32;break}if(!c.initialized){t.next=29;break}return t.t0=n,t.next=25,this.tickDataProvider.getTick(c.tickNext);case 25:t.t1=t.sent.liquidityNet,l=t.t0.BigInt.call(t.t0,t.t1),e&&(l=n.multiply(l,w)),a.liquidity=S.addDelta(a.liquidity,l);case 29:a.tick=e?c.tickNext-1:c.tickNext,t.next=33;break;case 32:a.sqrtPriceX96!=c.sqrtPriceStartX96&&(a.tick=W.getTickAtSqrtRatio(a.sqrtPriceX96));case 33:t.next=4;break;case 35:return t.abrupt("return",{amountCalculated:a.amountCalculated,sqrtRatioX96:a.sqrtPriceX96,liquidity:a.liquidity,tickCurrent:a.tick});case 36:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),h(t,[{key:"token0Price",get:function(){var t;return null!=(t=this._token0Price)?t:this._token0Price=new e.Price(this.token0,this.token1,P,n.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}},{key:"token1Price",get:function(){var t;return null!=(t=this._token1Price)?t:this._token1Price=new e.Price(this.token1,this.token0,n.multiply(this.sqrtRatioX96,this.sqrtRatioX96),P)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"tickSpacing",get:function(){return q[this.fee]}}]),t}(),ut=function(){function t(t){var e=t.pool,i=t.liquidity,o=t.tickLower,u=t.tickUpper;this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,o=W.MIN_TICK&&o%e.tickSpacing==0||r(!1),u<=W.MAX_TICK&&u%e.tickSpacing==0||r(!1),this.pool=e,this.tickLower=o,this.tickUpper=u,this.liquidity=n.BigInt(i)}var i=t.prototype;return i.ratiosAfterSlippage=function(t){var r=this.pool.token0Price.asFraction.multiply(new e.Percent(1).subtract(t)),i=this.pool.token0Price.asFraction.multiply(t.add(1)),o=Z(r.numerator,r.denominator);n.lessThanOrEqual(o,W.MIN_SQRT_RATIO)&&(o=n.add(W.MIN_SQRT_RATIO,n.BigInt(1)));var u=Z(i.numerator,i.denominator);return n.greaterThanOrEqual(u,W.MAX_SQRT_RATIO)&&(u=n.subtract(W.MAX_SQRT_RATIO,n.BigInt(1))),{sqrtRatioX96Lower:o,sqrtRatioX96Upper:u}},i.mintAmountsWithSlippage=function(e){var n=this.ratiosAfterSlippage(e),r=n.sqrtRatioX96Upper,i=n.sqrtRatioX96Lower,o=new ot(this.pool.token0,this.pool.token1,this.pool.fee,i,0,W.getTickAtSqrtRatio(i)),u=new ot(this.pool.token0,this.pool.token1,this.pool.fee,r,0,W.getTickAtSqrtRatio(r)),a=t.fromAmounts(f({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts,{useFullPrecision:!1}));return{amount0:new t({pool:u,liquidity:a.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount0,amount1:new t({pool:o,liquidity:a.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount1}},i.burnAmountsWithSlippage=function(e){var n=this.ratiosAfterSlippage(e),r=n.sqrtRatioX96Upper,i=n.sqrtRatioX96Lower,o=new ot(this.pool.token0,this.pool.token1,this.pool.fee,i,0,W.getTickAtSqrtRatio(i)),u=new t({pool:new ot(this.pool.token0,this.pool.token1,this.pool.fee,r,0,W.getTickAtSqrtRatio(r)),liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,a=new t({pool:o,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount1;return{amount0:u.quotient,amount1:a.quotient}},t.fromAmounts=function(e){var n=e.pool,r=e.tickLower,i=e.tickUpper,o=e.amount0,u=e.amount1,a=e.useFullPrecision,c=W.getSqrtRatioAtTick(r),s=W.getSqrtRatioAtTick(i);return new t({pool:n,tickLower:r,tickUpper:i,liquidity:tt(n.sqrtRatioX96,c,s,o,u,a)})},t.fromAmount0=function(n){return t.fromAmounts({pool:n.pool,tickLower:n.tickLower,tickUpper:n.tickUpper,amount0:n.amount0,amount1:e.MaxUint256,useFullPrecision:n.useFullPrecision})},t.fromAmount1=function(n){return t.fromAmounts({pool:n.pool,tickLower:n.tickLower,tickUpper:n.tickUpper,amount0:e.MaxUint256,amount1:n.amount1,useFullPrecision:!0})},h(t,[{key:"token0PriceLower",get:function(){return et(this.pool.token0,this.pool.token1,this.tickLower)}},{key:"token0PriceUpper",get:function(){return et(this.pool.token0,this.pool.token1,this.tickUpper)}},{key:"amount0",get:function(){return null===this._token0Amount&&(this._token0Amount=e.CurrencyAmount.fromRawAmount(this.pool.token0,this.pool.tickCurrent0||r(!1);var o=t[0].chainId;t.every((function(t){return t.chainId===o}))||r(!1);var u=e.wrappedCurrency(n,o);t[0].involvesToken(u)||r(!1),t[t.length-1].involvesToken(e.wrappedCurrency(i,o))||r(!1);for(var a,c=[u],s=k(t.entries());!(a=s()).done;){var p=a.value,l=p[1],d=c[p[0]];d.equals(l.token0)||d.equals(l.token1)||r(!1);var h=d.equals(l.token0)?l.token1:l.token0;c.push(h)}this.pools=t,this.tokenPath=c,this.input=n,this.output=null!=i?i:c[c.length-1]}return h(t,[{key:"chainId",get:function(){return this.pools[0].chainId}},{key:"inputToken",get:function(){return e.wrappedCurrency(this.input,this.chainId)}},{key:"outputToken",get:function(){return e.wrappedCurrency(this.output,this.chainId)}},{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;var t=this.pools.slice(1).reduce((function(t,e){var n=t.price;return t.nextInput.equals(e.token0)?{nextInput:e.token1,price:n.multiply(e.token0Price)}:{nextInput:e.token0,price:n.multiply(e.token1Price)}}),this.pools[0].token0.equals(this.inputToken)?{nextInput:this.pools[0].token1,price:this.pools[0].token0Price}:{nextInput:this.pools[0].token0,price:this.pools[0].token1Price}).price;return this._midPrice=new e.Price(this.input,this.output,t.denominator,t.numerator)}}]),t}();function ct(t,n){return e.currencyEquals(t.inputAmount.currency,n.inputAmount.currency)||r(!1),e.currencyEquals(t.outputAmount.currency,n.outputAmount.currency)||r(!1),t.outputAmount.equalTo(n.outputAmount)?t.inputAmount.equalTo(n.inputAmount)?t.route.tokenPath.length-n.route.tokenPath.length:t.inputAmount.lessThan(n.inputAmount)?-1:1:t.outputAmount.lessThan(n.outputAmount)?1:-1}var st=function(){function t(t){var n=t.route,i=t.inputAmount,o=t.outputAmount,u=t.tradeType;e.currencyEquals(i.currency,n.input)||r(!1),e.currencyEquals(o.currency,n.output)||r(!1),this.route=n,this.inputAmount=i,this.outputAmount=o,this.tradeType=u}t.exactIn=function(){var n=l(T.mark((function n(r,i){return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",t.fromRoute(r,i,e.TradeType.EXACT_INPUT));case 1:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}(),t.exactOut=function(){var n=l(T.mark((function n(r,i){return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",t.fromRoute(r,i,e.TradeType.EXACT_OUTPUT));case 1:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}(),t.fromRoute=function(){var n=l(T.mark((function n(i,o,u){var a,c,s,p,l,d,h;return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=new Array(i.tokenPath.length),u!==e.TradeType.EXACT_INPUT){n.next=19;break}e.currencyEquals(o.currency,i.input)||r(!1),a[0]=e.wrappedCurrencyAmount(o,i.chainId),p=0;case 5:if(!(p0)){n.next=32;break}return h=i.pools[d-1],n.next=26,h.getInputAmount(a[d]);case 26:a[d-1]=n.sent[0];case 29:d--,n.next=22;break;case 32:c=e.CurrencyAmount.fromFractionalAmount(i.input,a[0].numerator,a[0].denominator),s=e.CurrencyAmount.fromFractionalAmount(i.output,o.numerator,o.denominator);case 34:return n.abrupt("return",new t({route:i,tradeType:u,inputAmount:c,outputAmount:s}));case 35:case"end":return n.stop()}}),n)})));return function(t,e,r){return n.apply(this,arguments)}}(),t.createUncheckedTrade=function(e){return new t(e)};var n=t.prototype;return n.minimumAmountOut=function(t){if(t.lessThan(b)&&r(!1),this.tradeType===e.TradeType.EXACT_OUTPUT)return this.outputAmount;var n=new e.Fraction(R).add(t).invert().multiply(this.outputAmount.quotient).quotient;return e.CurrencyAmount.fromRawAmount(this.outputAmount.currency,n)},n.maximumAmountIn=function(t){if(t.lessThan(b)&&r(!1),this.tradeType===e.TradeType.EXACT_INPUT)return this.inputAmount;var n=new e.Fraction(R).add(t).multiply(this.inputAmount.quotient).quotient;return e.CurrencyAmount.fromRawAmount(this.inputAmount.currency,n)},n.worstExecutionPrice=function(t){return new e.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(t).quotient,this.minimumAmountOut(t).quotient)},t.bestTradeExactIn=function(){var n=l(T.mark((function n(i,o,u,a,c,s,p){var l,d,h,f,m,y,k,g,v,A,x,I;return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:h=void 0===(d=(l=void 0===a?{}:a).maxNumResults)?3:d,m=void 0===(f=l.maxHops)?3:f,void 0===c&&(c=[]),void 0===s&&(s=o),void 0===p&&(p=[]),i.length>0||r(!1),m>0||r(!1),o===s||c.length>0||r(!1),void 0===(y=s.currency.isToken?s.currency.chainId:u.isToken?u.chainId:void 0)&&r(!1),k=e.wrappedCurrencyAmount(s,y),g=e.wrappedCurrency(u,y),v=0;case 12:if(!(v1&&i.length>1)){n.next=45;break}return I=i.slice(0,v).concat(i.slice(v+1,i.length)),n.next=45,t.bestTradeExactIn(I,o,u,{maxNumResults:h,maxHops:m-1},[].concat(c,[A]),x,p);case 45:v++,n.next=12;break;case 48:return n.abrupt("return",p);case 49:case"end":return n.stop()}}),n,null,[[17,25]])})));return function(t,e,r,i,o,u,a){return n.apply(this,arguments)}}(),t.bestTradeExactOut=function(){var n=l(T.mark((function n(i,o,u,a,c,s,p){var l,d,h,f,m,y,k,g,v,A,x,I;return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:h=void 0===(d=(l=void 0===a?{}:a).maxNumResults)?3:d,m=void 0===(f=l.maxHops)?3:f,void 0===c&&(c=[]),void 0===s&&(s=u),void 0===p&&(p=[]),i.length>0||r(!1),m>0||r(!1),u===s||c.length>0||r(!1),void 0===(y=s.currency.isToken?s.currency.chainId:o.isToken?o.chainId:void 0)&&r(!1),k=e.wrappedCurrencyAmount(s,y),g=e.wrappedCurrency(o,y),v=0;case 12:if(!(v1&&i.length>1)){n.next=45;break}return I=i.slice(0,v).concat(i.slice(v+1,i.length)),n.next=45,t.bestTradeExactOut(I,o,u,{maxNumResults:h,maxHops:m-1},[A].concat(c),x,p);case 45:v++,n.next=12;break;case 48:return n.abrupt("return",p);case 49:case"end":return n.stop()}}),n,null,[[17,25]])})));return function(t,e,r,i,o,u,a){return n.apply(this,arguments)}}(),h(t,[{key:"executionPrice",get:function(){var t;return null!=(t=this._executionPrice)?t:this._executionPrice=new e.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function(){var t;return null!=(t=this._priceImpact)?t:this._priceImpact=e.computePriceImpact(this.route.midPrice,this.inputAmount,this.outputAmount)}}]),t}(),pt=function(){function t(){}return t.encodePermit=function(e,n){return"nonce"in n?t.INTERFACE.encodeFunctionData("selfPermitAllowed",[e.address,z(n.nonce),z(n.expiry),n.v,n.r,n.s]):t.INTERFACE.encodeFunctionData("selfPermit",[e.address,z(n.amount),z(n.deadline),n.v,n.r,n.s])},t}();pt.INTERFACE=new i.Interface(c.abi);var lt=z(n.subtract(n.exponentiate(n.BigInt(2),n.BigInt(128)),n.BigInt(1)));function dt(t){return Object.keys(t).some((function(t){return"recipient"===t}))}var ht=function(t){function i(){return t.call(this)||this}return m(i,t),i.addCallParameters=function(t,o){n.greaterThan(t.liquidity,b)||r(!1);var u=[],a=t.mintAmounts,c=a.amount0,s=a.amount1,p=t.mintAmountsWithSlippage(o.slippageTolerance),l=z(p.amount0),d=z(p.amount1),h=z(o.deadline);if(dt(o)&&o.createPool&&u.push(i.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[t.pool.token0.address,t.pool.token1.address,t.pool.fee,z(t.pool.sqrtRatioX96)])),o.token0Permit&&u.push(i.encodePermit(t.pool.token0,o.token0Permit)),o.token1Permit&&u.push(i.encodePermit(t.pool.token1,o.token1Permit)),dt(o)){var f=e.validateAndParseAddress(o.recipient);u.push(i.INTERFACE.encodeFunctionData("mint",[{token0:t.pool.token0.address,token1:t.pool.token1.address,fee:t.pool.fee,tickLower:t.tickLower,tickUpper:t.tickUpper,amount0Desired:z(c),amount1Desired:z(s),amount0Min:l,amount1Min:d,recipient:f,deadline:h}]))}else u.push(i.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:z(o.tokenId),amount0Desired:z(c),amount1Desired:z(s),amount0Min:l,amount1Min:d,deadline:h}]));var m=z(0);if(o.useEther){var y=e.WETH9[t.pool.chainId];y&&(t.pool.token0.equals(y)||t.pool.token1.equals(y))||r(!1);var k=t.pool.token0.equals(y)?c:s;n.greaterThan(k,b)&&u.push(i.INTERFACE.encodeFunctionData("refundETH")),m=z(k)}return{calldata:1===u.length?u[0]:i.INTERFACE.encodeFunctionData("multicall",[u]),value:m}},i.encodeCollect=function(t){var n=[],r=z(t.tokenId),o=t.expectedCurrencyOwed0.currency.isEther||t.expectedCurrencyOwed1.currency.isEther,u=e.validateAndParseAddress(t.recipient);if(n.push(i.INTERFACE.encodeFunctionData("collect",[{tokenId:r,recipient:o?x:u,amount0Max:lt,amount1Max:lt}])),o){var a=t.expectedCurrencyOwed0.currency.isEther?t.expectedCurrencyOwed1.currency:t.expectedCurrencyOwed0.currency,c=t.expectedCurrencyOwed0.currency.isEther?t.expectedCurrencyOwed1.quotient:t.expectedCurrencyOwed0.quotient;n.push(i.INTERFACE.encodeFunctionData("unwrapWETH9",[z(t.expectedCurrencyOwed0.currency.isEther?t.expectedCurrencyOwed0.quotient:t.expectedCurrencyOwed1.quotient),u])),n.push(i.INTERFACE.encodeFunctionData("sweepToken",[a.address,z(c),u]))}return n},i.collectCallParameters=function(t){var e=i.encodeCollect(t);return{calldata:1===e.length?e[0]:i.INTERFACE.encodeFunctionData("multicall",[e]),value:z(0)}},i.removeCallParameters=function(t,o){var u=[],a=z(o.deadline),c=z(o.tokenId),s=new ut({pool:t.pool,liquidity:o.liquidityPercentage.multiply(t.liquidity).quotient,tickLower:t.tickLower,tickUpper:t.tickUpper});n.greaterThan(s.liquidity,b)||r(!1);var p=s.burnAmountsWithSlippage(o.slippageTolerance),l=p.amount0,d=p.amount1;o.permit&&u.push(i.INTERFACE.encodeFunctionData("permit",[e.validateAndParseAddress(o.permit.spender),c,z(o.permit.deadline),o.permit.v,o.permit.r,o.permit.s])),u.push(i.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:c,liquidity:z(s.liquidity),amount0Min:z(l),amount1Min:z(d),deadline:a}]));var h=o.collectOptions,m=h.expectedCurrencyOwed0,y=h.expectedCurrencyOwed1,k=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(h,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return u.push.apply(u,i.encodeCollect(f({tokenId:o.tokenId,expectedCurrencyOwed0:m.add(m.currency.isEther?e.CurrencyAmount.ether(l):e.CurrencyAmount.fromRawAmount(m.currency,l)),expectedCurrencyOwed1:y.add(y.currency.isEther?e.CurrencyAmount.ether(d):e.CurrencyAmount.fromRawAmount(y.currency,d))},k))),o.liquidityPercentage.equalTo(R)?o.burnToken&&u.push(i.INTERFACE.encodeFunctionData("burn",[c])):!0===o.burnToken&&r(!1),{calldata:i.INTERFACE.encodeFunctionData("multicall",[u]),value:z(0)}},i}(pt);ht.INTERFACE=new i.Interface(a.abi);var ft=function(t){function n(){return t.call(this)||this}return m(n,t),n.swapCallParameters=function(t,i){var o=[];i.inputTokenPermit&&(t.inputAmount.currency.isToken||r(!1),o.push(n.encodePermit(t.inputAmount.currency,i.inputTokenPermit)));var u=e.validateAndParseAddress(i.recipient),a=z(i.deadline),c=z(t.maximumAmountIn(i.slippageTolerance).quotient),s=z(t.minimumAmountOut(i.slippageTolerance).quotient),p=t.inputAmount.currency.isEther?c:z(0),l=t.inputAmount.currency.isEther&&t.tradeType===e.TradeType.EXACT_OUTPUT,d=t.outputAmount.currency.isEther,h=d||!!i.fee;if(1===t.route.pools.length)if(t.tradeType===e.TradeType.EXACT_INPUT){var f,m={tokenIn:t.route.tokenPath[0].address,tokenOut:t.route.tokenPath[1].address,fee:t.route.pools[0].fee,recipient:h?x:u,deadline:a,amountIn:c,amountOutMinimum:s,sqrtPriceLimitX96:z(null!=(f=i.sqrtPriceLimitX96)?f:0)};o.push(n.INTERFACE.encodeFunctionData("exactInputSingle",[m]))}else{var y,k={tokenIn:t.route.tokenPath[0].address,tokenOut:t.route.tokenPath[1].address,fee:t.route.pools[0].fee,recipient:h?x:u,deadline:a,amountOut:s,amountInMaximum:c,sqrtPriceLimitX96:z(null!=(y=i.sqrtPriceLimitX96)?y:0)};o.push(n.INTERFACE.encodeFunctionData("exactOutputSingle",[k]))}else{void 0!==i.sqrtPriceLimitX96&&r(!1);var g=Y(t.route,t.tradeType===e.TradeType.EXACT_OUTPUT);o.push(t.tradeType===e.TradeType.EXACT_INPUT?n.INTERFACE.encodeFunctionData("exactInput",[{path:g,recipient:h?x:u,deadline:a,amountIn:c,amountOutMinimum:s}]):n.INTERFACE.encodeFunctionData("exactOutput",[{path:g,recipient:h?x:u,deadline:a,amountOut:s,amountInMaximum:c}]))}if(l&&o.push(n.INTERFACE.encodeFunctionData("refundETH")),h)if(i.fee){var v=e.validateAndParseAddress(i.fee.recipient),A=z(i.fee.fee.multiply(1e4).quotient);o.push(d?n.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[s,u,A,v]):n.INTERFACE.encodeFunctionData("sweepTokenWithFee",[t.route.tokenPath[t.route.tokenPath.length-1].address,s,u,A,v]))}else o.push(n.INTERFACE.encodeFunctionData("unwrapWETH9",[s,u]));return{calldata:1===o.length?o[0]:n.INTERFACE.encodeFunctionData("multicall",[o]),value:p}},n}(pt);ft.INTERFACE=new i.Interface(s.abi),exports.ADDRESS_ZERO=x,exports.FACTORY_ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.FullMath=O,exports.LiquidityMath=S,exports.NoTickDataProvider=H,exports.NonfungiblePositionManager=ht,exports.POOL_INIT_CODE_HASH=I,exports.Pool=ot,exports.Position=ut,exports.Route=at,exports.SqrtPriceMath=F,exports.SwapRouter=ft,exports.TICK_SPACINGS=q,exports.Tick=nt,exports.TickList=Q,exports.TickListDataProvider=rt,exports.TickMath=W,exports.Trade=st,exports.computePoolAddress=C,exports.encodeRouteToPath=Y,exports.encodeSqrtRatioX96=Z,exports.isSorted=K,exports.maxLiquidityForAmounts=tt,exports.mostSignificantBit=B,exports.nearestUsableTick=function(t,e){Number.isInteger(t)&&Number.isInteger(e)||r(!1),e>0||r(!1),t>=W.MIN_TICK&&t<=W.MAX_TICK||r(!1);var n=Math.round(t/e)*e;return nW.MAX_TICK?n-e:n},exports.priceToClosestTick=function(t){var e=t.baseCurrency.sortsBefore(t.quoteCurrency),n=e?Z(t.numerator,t.denominator):Z(t.denominator,t.numerator),r=W.getTickAtSqrtRatio(n),i=et(t.baseCurrency,t.quoteCurrency,r+1);return e?t.lessThan(i)||r++:t.greaterThan(i)||r++,r},exports.tickToPrice=et,exports.toHex=z,exports.tradeComparator=ct; +//# sourceMappingURL=v3-sdk.cjs.production.min.js.map diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js.map b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js.map new file mode 100644 index 00000000000..966b1fda1f1 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v3-sdk.cjs.production.min.js","sources":["../src/constants.ts","../node_modules/regenerator-runtime/runtime.js","../src/internalConstants.ts","../src/utils/computePoolAddress.ts","../src/utils/liquidityMath.ts","../src/utils/fullMath.ts","../src/utils/sqrtPriceMath.ts","../src/utils/swapMath.ts","../src/utils/mostSignificantBit.ts","../src/utils/tickMath.ts","../src/entities/tickDataProvider.ts","../src/utils/isSorted.ts","../src/utils/tickList.ts","../src/utils/calldata.ts","../src/utils/encodeRouteToPath.ts","../src/utils/encodeSqrtRatioX96.ts","../src/utils/maxLiquidityForAmounts.ts","../src/utils/priceTickConversions.ts","../src/entities/tick.ts","../src/entities/tickListDataProvider.ts","../src/entities/pool.ts","../src/entities/position.ts","../src/entities/route.ts","../src/entities/trade.ts","../src/selfPermit.ts","../src/nonfungiblePositionManager.ts","../src/swapRouter.ts","../src/utils/nearestUsableTick.ts"],"sourcesContent":["export const FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'\n\nexport const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'\n\nexport const POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'\n\n/**\n * The default factory enabled fee amounts, denominated in hundredths of bips.\n */\nexport enum FeeAmount {\n LOW = 500,\n MEDIUM = 3000,\n HIGH = 10000\n}\n\n/**\n * The default factory tick spacings by fee amount.\n */\nexport const TICK_SPACINGS: { [amount in FeeAmount]: number } = {\n [FeeAmount.LOW]: 10,\n [FeeAmount.MEDIUM]: 60,\n [FeeAmount.HIGH]: 200\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import JSBI from 'jsbi'\n\n// constants used internally but not expected to be used externally\nexport const NEGATIVE_ONE = JSBI.BigInt(-1)\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\n\n// used in liquidity amount math\nexport const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96))\nexport const Q192 = JSBI.exponentiate(Q96, JSBI.BigInt(2))\n","import { defaultAbiCoder } from '@ethersproject/abi'\nimport { getCreate2Address } from '@ethersproject/address'\nimport { keccak256 } from '@ethersproject/solidity'\nimport { Token } from '@uniswap/sdk-core'\nimport { FeeAmount, POOL_INIT_CODE_HASH } from '../constants'\n\nexport function computePoolAddress({\n factoryAddress,\n tokenA,\n tokenB,\n fee\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n fee: FeeAmount\n}): string {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(\n ['bytes'],\n [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]\n ),\n POOL_INIT_CODE_HASH\n )\n}\n","import JSBI from 'jsbi'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\n\nexport abstract class LiquidityMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static addDelta(x: JSBI, y: JSBI): JSBI {\n if (JSBI.lessThan(y, ZERO)) {\n return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE))\n } else {\n return JSBI.add(x, y)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { ONE, ZERO } from '../internalConstants'\n\nexport abstract class FullMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI {\n const product = JSBI.multiply(a, b)\n let result = JSBI.divide(product, denominator)\n if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE)\n return result\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO, Q96 } from '../internalConstants'\nimport { FullMath } from './fullMath'\n\nconst MaxUint160 = JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(160)), ONE)\n\nfunction multiplyIn256(x: JSBI, y: JSBI): JSBI {\n const product = JSBI.multiply(x, y)\n return JSBI.bitwiseAnd(product, MaxUint256)\n}\n\nfunction addIn256(x: JSBI, y: JSBI): JSBI {\n const sum = JSBI.add(x, y)\n return JSBI.bitwiseAnd(sum, MaxUint256)\n}\n\nexport abstract class SqrtPriceMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n const numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)\n\n return roundUp\n ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96)\n : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96)\n }\n\n public static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n return roundUp\n ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96)\n : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96)\n }\n\n public static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)\n : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true)\n }\n\n public static getNextSqrtPriceFromOutput(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amountOut: JSBI,\n zeroForOne: boolean\n ): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)\n : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false)\n }\n\n private static getNextSqrtPriceFromAmount0RoundingUp(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (JSBI.equal(amount, ZERO)) return sqrtPX96\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n\n if (add) {\n let product = multiplyIn256(amount, sqrtPX96)\n if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) {\n const denominator = addIn256(numerator1, product)\n if (JSBI.greaterThanOrEqual(denominator, numerator1)) {\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount))\n } else {\n let product = multiplyIn256(amount, sqrtPX96)\n\n invariant(JSBI.equal(JSBI.divide(product, amount), sqrtPX96))\n invariant(JSBI.greaterThan(numerator1, product))\n const denominator = JSBI.subtract(numerator1, product)\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n private static getNextSqrtPriceFromAmount1RoundingDown(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (add) {\n const quotient = JSBI.lessThanOrEqual(amount, MaxUint160)\n ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity)\n : JSBI.divide(JSBI.multiply(amount, Q96), liquidity)\n\n return JSBI.add(sqrtPX96, quotient)\n } else {\n const quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity)\n\n invariant(JSBI.greaterThan(sqrtPX96, quotient))\n return JSBI.subtract(sqrtPX96, quotient)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { FeeAmount } from '../constants'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\nimport { FullMath } from './fullMath'\nimport { SqrtPriceMath } from './sqrtPriceMath'\n\nconst MAX_FEE = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(6))\n\nexport abstract class SwapMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static computeSwapStep(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioTargetX96: JSBI,\n liquidity: JSBI,\n amountRemaining: JSBI,\n feePips: FeeAmount\n ): [JSBI, JSBI, JSBI, JSBI] {\n const returnValues: Partial<{\n sqrtRatioNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n }> = {}\n\n const zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96)\n const exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO)\n\n if (exactIn) {\n const amountRemainingLessFee = JSBI.divide(\n JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))),\n MAX_FEE\n )\n returnValues.amountIn = zeroForOne\n ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true)\n if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn!)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(\n sqrtRatioCurrentX96,\n liquidity,\n amountRemainingLessFee,\n zeroForOne\n )\n }\n } else {\n returnValues.amountOut = zeroForOne\n ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false)\n if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(\n sqrtRatioCurrentX96,\n liquidity,\n JSBI.multiply(amountRemaining, NEGATIVE_ONE),\n zeroForOne\n )\n }\n }\n\n const max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96)\n\n if (zeroForOne) {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false)\n } else {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false)\n }\n\n if (!exactIn && JSBI.greaterThan(returnValues.amountOut!, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) {\n returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE)\n }\n\n if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) {\n // we didn't reach the target, so take the remainder of the maximum input as fee\n returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn!)\n } else {\n returnValues.feeAmount = FullMath.mulDivRoundingUp(\n returnValues.amountIn!,\n JSBI.BigInt(feePips),\n JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))\n )\n }\n\n return [returnValues.sqrtRatioNextX96!, returnValues.amountIn!, returnValues.amountOut!, returnValues.feeAmount!]\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\n\nconst TWO = JSBI.BigInt(2)\nconst POWERS_OF_2 = [128, 64, 32, 16, 8, 4, 2, 1].map((pow: number): [number, JSBI] => [\n pow,\n JSBI.exponentiate(TWO, JSBI.BigInt(pow))\n])\n\nexport function mostSignificantBit(x: JSBI): number {\n invariant(JSBI.greaterThan(x, ZERO), 'ZERO')\n invariant(JSBI.lessThanOrEqual(x, MaxUint256), 'MAX')\n\n let msb: number = 0\n for (const [power, min] of POWERS_OF_2) {\n if (JSBI.greaterThanOrEqual(x, min)) {\n x = JSBI.signedRightShift(x, JSBI.BigInt(power))\n msb += power\n }\n }\n return msb\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { mostSignificantBit } from './mostSignificantBit'\n\nfunction mulShift(val: JSBI, mulBy: string): JSBI {\n return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128))\n}\n\nconst Q32 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(32))\n\nexport abstract class TickMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n /**\n * The minimum tick that can be used on any pool.\n */\n public static MIN_TICK: number = -887272\n /**\n * The maximum tick that can be used on any pool.\n */\n public static MAX_TICK: number = -TickMath.MIN_TICK\n\n /**\n * The sqrt ratio corresponding to the minimum tick that could be used on any pool.\n */\n public static MIN_SQRT_RATIO: JSBI = JSBI.BigInt('4295128739')\n /**\n * The sqrt ratio corresponding to the maximum tick that could be used on any pool.\n */\n public static MAX_SQRT_RATIO: JSBI = JSBI.BigInt('1461446703485210103287273052203988822378723970342')\n\n /**\n * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick\n * @param tick the tick for which to compute the sqrt ratio\n */\n public static getSqrtRatioAtTick(tick: number): JSBI {\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick), 'TICK')\n const absTick: number = tick < 0 ? tick * -1 : tick\n\n let ratio: JSBI =\n (absTick & 0x1) != 0\n ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001')\n : JSBI.BigInt('0x100000000000000000000000000000000')\n if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a')\n if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc')\n if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0')\n if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644')\n if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0')\n if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861')\n if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053')\n if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4')\n if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54')\n if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3')\n if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9')\n if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825')\n if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5')\n if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7')\n if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6')\n if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9')\n if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604')\n if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98')\n if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2')\n\n if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio)\n\n // back to Q96\n return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO)\n ? JSBI.add(JSBI.divide(ratio, Q32), ONE)\n : JSBI.divide(ratio, Q32)\n }\n\n /**\n * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96\n * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96\n * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick\n */\n public static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number {\n invariant(\n JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) &&\n JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO),\n 'SQRT_RATIO'\n )\n\n const sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32))\n\n const msb = mostSignificantBit(sqrtRatioX128)\n\n let r: JSBI\n if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) {\n r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127))\n } else {\n r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb))\n }\n\n let log_2: JSBI = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64))\n\n for (let i = 0; i < 14; i++) {\n r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127))\n const f = JSBI.signedRightShift(r, JSBI.BigInt(128))\n log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i)))\n r = JSBI.signedRightShift(r, f)\n }\n\n const log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141'))\n\n const tickLow = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')),\n JSBI.BigInt(128)\n )\n )\n const tickHigh = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')),\n JSBI.BigInt(128)\n )\n )\n\n return tickLow === tickHigh\n ? tickLow\n : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96)\n ? tickHigh\n : tickLow\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\n\n/**\n * Provides information about ticks\n */\nexport interface TickDataProvider {\n /**\n * Return information corresponding to a specific tick\n * @param tick the tick to load\n */\n getTick(tick: number): Promise<{ liquidityNet: BigintIsh }>\n\n /**\n * Return the next tick that is initialized within a single word\n * @param tick the current tick\n * @param lte whether the next tick should be lte the current tick\n * @param tickSpacing the tick spacing of the pool\n */\n nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>\n}\n\n/**\n * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you\n * do not need to load tick data for your use case.\n */\nexport class NoTickDataProvider implements TickDataProvider {\n private static ERROR_MESSAGE = 'No tick data provider was given'\n async getTick(_tick: number): Promise<{ liquidityNet: BigintIsh }> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n\n async nextInitializedTickWithinOneWord(\n _tick: number,\n _lte: boolean,\n _tickSpacing: number\n ): Promise<[number, boolean]> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n}\n","export function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean {\n for (let i = 0; i < list.length - 1; i++) {\n if (comparator(list[i], list[i + 1]) > 0) {\n return false\n }\n }\n return true\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { isSorted } from './isSorted'\nimport { Tick } from '../entities/tick'\n\nfunction tickComparator(a: Tick, b: Tick) {\n return a.index - b.index\n}\n\n/**\n * Utility methods for interacting with sorted lists of ticks\n */\nexport abstract class TickList {\n /**\n * Cannot be constructed\n */\n private constructor() {}\n\n public static validateList(ticks: Tick[], tickSpacing: number) {\n invariant(tickSpacing > 0, 'TICK_SPACING_NONZERO')\n // ensure ticks are spaced appropriately\n invariant(\n ticks.every(({ index }) => index % tickSpacing === 0),\n 'TICK_SPACING'\n )\n\n // ensure tick liquidity deltas sum to 0\n invariant(\n JSBI.equal(\n ticks.reduce((accumulator, { liquidityNet }) => JSBI.add(accumulator, liquidityNet), ZERO),\n ZERO\n ),\n 'ZERO_NET'\n )\n\n invariant(isSorted(ticks, tickComparator), 'SORTED')\n }\n\n public static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick < ticks[0].index\n }\n\n public static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick >= ticks[ticks.length - 1].index\n }\n\n public static getTick(ticks: readonly Tick[], index: number): Tick {\n const tick = ticks[this.binarySearch(ticks, index)]\n invariant(tick.index === index, 'NOT_CONTAINED')\n return tick\n }\n\n /**\n * Finds the largest tick in the list of ticks that is less than or equal to tick\n * @param ticks list of ticks\n * @param tick tick to find the largest tick that is less than or equal to tick\n * @private\n */\n private static binarySearch(ticks: readonly Tick[], tick: number): number {\n invariant(!this.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n\n let l = 0\n let r = ticks.length - 1\n let i\n while (true) {\n i = Math.floor((l + r) / 2)\n\n if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) {\n return i\n }\n\n if (ticks[i].index < tick) {\n l = i + 1\n } else {\n r = i - 1\n }\n }\n }\n\n public static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick {\n if (lte) {\n invariant(!TickList.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n if (TickList.isAtOrAboveLargest(ticks, tick)) {\n return ticks[ticks.length - 1]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index]\n } else {\n invariant(!this.isAtOrAboveLargest(ticks, tick), 'AT_OR_ABOVE_LARGEST')\n if (this.isBelowSmallest(ticks, tick)) {\n return ticks[0]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index + 1]\n }\n }\n\n public static nextInitializedTickWithinOneWord(\n ticks: readonly Tick[],\n tick: number,\n lte: boolean,\n tickSpacing: number\n ): [number, boolean] {\n const compressed = Math.floor(tick / tickSpacing) // matches rounding in the code\n\n if (lte) {\n const wordPos = compressed >> 8\n const minimum = (wordPos << 8) * tickSpacing\n\n if (TickList.isBelowSmallest(ticks, tick)) {\n return [minimum, false]\n }\n\n const index = TickList.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.max(minimum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n } else {\n const wordPos = (compressed + 1) >> 8\n const maximum = ((wordPos + 1) << 8) * tickSpacing - 1\n\n if (this.isAtOrAboveLargest(ticks, tick)) {\n return [maximum, false]\n }\n\n const index = this.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.min(maximum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n }\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\n\n/**\n * Generated method parameters for executing a call.\n */\nexport interface MethodParameters {\n /**\n * The hex encoded calldata to perform the given operation\n */\n calldata: string\n /**\n * The amount of ether (wei) to send in hex.\n */\n value: string\n}\n\nexport function toHex(bigintIsh: BigintIsh) {\n const bigInt = JSBI.BigInt(bigintIsh)\n let hex = bigInt.toString(16)\n if (hex.length % 2 !== 0) {\n hex = `0${hex}`\n }\n return `0x${hex}`\n}\n","import { pack } from '@ethersproject/solidity'\nimport { Currency, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from '../entities/pool'\nimport { Route } from '../entities/route'\n\n/**\n * Converts a route to a hex encoded path\n * @param route the v3 path to convert to an encoded path\n * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps\n */\nexport function encodeRouteToPath(route: Route, exactOutput: boolean): string {\n const firstInputToken: Token = wrappedCurrency(route.input, route.chainId)\n\n const { path, types } = route.pools.reduce(\n (\n { inputToken, path, types }: { inputToken: Token; path: (string | number)[]; types: string[] },\n pool: Pool,\n index\n ): { inputToken: Token; path: (string | number)[]; types: string[] } => {\n const outputToken: Token = pool.token0.equals(inputToken) ? pool.token1 : pool.token0\n if (index === 0) {\n return {\n inputToken: outputToken,\n types: ['address', 'uint24', 'address'],\n path: [inputToken.address, pool.fee, outputToken.address]\n }\n } else {\n return {\n inputToken: outputToken,\n types: [...types, 'uint24', 'address'],\n path: [...path, pool.fee, outputToken.address]\n }\n }\n },\n { inputToken: firstInputToken, path: [], types: [] }\n )\n\n return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path)\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, sqrt } from '@uniswap/sdk-core'\n\n/**\n * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0\n * @param amount1 the numerator amount, i.e. amount of token1\n * @param amount0 the denominator amount, i.en amount of token0\n */\nexport function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI {\n const numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192))\n const denominator = JSBI.BigInt(amount0)\n const ratioX192 = JSBI.divide(numerator, denominator)\n return sqrt(ratioX192)\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q96 } from '../internalConstants'\n\nfunction maxLiquidityForAmount0Imprecise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n const intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96)\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\nfunction maxLiquidityForAmount0Precise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96)\n const denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n\n return JSBI.divide(numerator, denominator)\n}\n\nfunction maxLiquidityForAmount1(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount1: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\n/**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param sqrtRatioCurrentX96 the current price\n * @param sqrtRatioAX96 price at lower boundary\n * @param sqrtRatioBX96 price at upper boundary\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\nexport function maxLiquidityForAmounts(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioAX96: JSBI,\n sqrtRatioBX96: JSBI,\n amount0: BigintIsh,\n amount1: BigintIsh,\n useFullPrecision: boolean\n): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise\n\n if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) {\n return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0)\n } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) {\n const liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0)\n const liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1)\n return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1\n } else {\n return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1)\n }\n}\n","import { Price, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q192 } from '../internalConstants'\nimport { encodeSqrtRatioX96 } from './encodeSqrtRatioX96'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns a price object corresponding to the input tick and the base/quote token\n * Inputs must be tokens because the address order is used to interpret the price represented by the tick\n * @param baseToken the base token of the price\n * @param quoteToken the quote token of the price\n * @param tick the tick for which to return the price\n */\nexport function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price {\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick)\n\n const ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96)\n\n return baseToken.sortsBefore(quoteToken)\n ? new Price(baseToken, quoteToken, Q192, ratioX192)\n : new Price(baseToken, quoteToken, ratioX192, Q192)\n}\n\n/**\n * Returns the first tick for which the given price is greater than or equal to the tick price\n * @param price for which to return the closest tick that represents a price less than or equal to the input price,\n * i.e. the price of the returned tick is less than or equal to the input price\n */\nexport function priceToClosestTick(price: Price): number {\n const sorted = price.baseCurrency.sortsBefore(price.quoteCurrency)\n\n const sqrtRatioX96 = sorted\n ? encodeSqrtRatioX96(price.numerator, price.denominator)\n : encodeSqrtRatioX96(price.denominator, price.numerator)\n\n let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96)\n const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1)\n if (sorted) {\n if (!price.lessThan(nextTickPrice)) {\n tick++\n }\n } else {\n if (!price.greaterThan(nextTickPrice)) {\n tick++\n }\n }\n return tick\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { BigintIsh } from '@uniswap/sdk-core'\nimport { TickMath } from '../utils'\n\nexport interface TickConstructorArgs {\n index: number\n liquidityGross: BigintIsh\n liquidityNet: BigintIsh\n}\n\nexport class Tick {\n public readonly index: number\n public readonly liquidityGross: JSBI\n public readonly liquidityNet: JSBI\n\n constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs) {\n invariant(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK, 'TICK')\n this.index = index\n this.liquidityGross = JSBI.BigInt(liquidityGross)\n this.liquidityNet = JSBI.BigInt(liquidityNet)\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport { TickList } from '../utils/tickList'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { TickDataProvider } from './tickDataProvider'\n\n/**\n * A data provider for ticks that is backed by an in-memory array of ticks.\n */\nexport class TickListDataProvider implements TickDataProvider {\n private ticks: readonly Tick[]\n\n constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number) {\n const ticksMapped: Tick[] = ticks.map(t => (t instanceof Tick ? t : new Tick(t)))\n TickList.validateList(ticksMapped, tickSpacing)\n this.ticks = ticksMapped\n }\n\n async getTick(tick: number): Promise<{ liquidityNet: BigintIsh; liquidityGross: BigintIsh }> {\n return TickList.getTick(this.ticks, tick)\n }\n\n async nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]> {\n return TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)\n }\n}\n","import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { FACTORY_ADDRESS, FeeAmount, TICK_SPACINGS } from '../constants'\nimport { NEGATIVE_ONE, ONE, Q192, ZERO } from '../internalConstants'\nimport { computePoolAddress } from '../utils/computePoolAddress'\nimport { LiquidityMath } from '../utils/liquidityMath'\nimport { SwapMath } from '../utils/swapMath'\nimport { TickMath } from '../utils/tickMath'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { NoTickDataProvider, TickDataProvider } from './tickDataProvider'\nimport { TickListDataProvider } from './tickListDataProvider'\n\ninterface StepComputations {\n sqrtPriceStartX96: JSBI\n tickNext: number\n initialized: boolean\n sqrtPriceNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n}\n\n/**\n * By default, pools will not allow operations that require ticks.\n */\nconst NO_TICK_DATA_PROVIDER_DEFAULT = new NoTickDataProvider()\n\n/**\n * Represents a V3 pool\n */\nexport class Pool {\n public readonly token0: Token\n public readonly token1: Token\n public readonly fee: FeeAmount\n public readonly sqrtRatioX96: JSBI\n public readonly liquidity: JSBI\n public readonly tickCurrent: number\n public readonly tickDataProvider: TickDataProvider\n\n private _token0Price?: Price\n private _token1Price?: Price\n\n public static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount): string {\n return computePoolAddress({ factoryAddress: FACTORY_ADDRESS, fee, tokenA, tokenB })\n }\n\n /**\n * Construct a pool\n * @param tokenA one of the tokens in the pool\n * @param tokenB the other token in the pool\n * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool\n * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0\n * @param liquidity the current value of in range liquidity\n * @param tickCurrent the current tick of the pool\n * @param ticks the current state of the pool ticks or a data provider that can return tick data\n */\n public constructor(\n tokenA: Token,\n tokenB: Token,\n fee: FeeAmount,\n sqrtRatioX96: BigintIsh,\n liquidity: BigintIsh,\n tickCurrent: number,\n ticks: TickDataProvider | (Tick | TickConstructorArgs)[] = NO_TICK_DATA_PROVIDER_DEFAULT\n ) {\n invariant(Number.isInteger(fee) && fee < 1_000_000, 'FEE')\n\n const tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent)\n const nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1)\n invariant(\n JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) &&\n JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96),\n 'PRICE_BOUNDS'\n )\n // always create a copy of the list since we want the pool's tick list to be immutable\n ;[this.token0, this.token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n this.fee = fee\n this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96)\n this.liquidity = JSBI.BigInt(liquidity)\n this.tickCurrent = tickCurrent\n this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0\n */\n public get token0Price(): Price {\n return (\n this._token0Price ??\n (this._token0Price = new Price(\n this.token0,\n this.token1,\n Q192,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)\n ))\n )\n }\n\n /**\n * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1\n */\n public get token1Price(): Price {\n return (\n this._token1Price ??\n (this._token1Price = new Price(\n this.token1,\n this.token0,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96),\n Q192\n ))\n )\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pool.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pool.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n /**\n * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade\n * @param inputAmount the input amount for which to quote the output amount\n */\n public async getOutputAmount(\n inputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n\n const zeroForOne = inputAmount.currency.equals(this.token0)\n\n const { amountCalculated: outputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n inputAmount.quotient,\n sqrtPriceLimitX96\n )\n const outputToken = zeroForOne ? this.token1 : this.token0\n return [\n CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n /**\n * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade\n * @param outputAmount the output amount for which to quote the input amount\n */\n public async getInputAmount(\n outputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency), 'TOKEN')\n\n const zeroForOne = outputAmount.currency.equals(this.token1)\n\n const { amountCalculated: inputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE),\n sqrtPriceLimitX96\n )\n const inputToken = zeroForOne ? this.token0 : this.token1\n return [\n CurrencyAmount.fromRawAmount(inputToken, inputAmount),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n private async swap(\n zeroForOne: boolean,\n amountSpecified: JSBI,\n sqrtPriceLimitX96?: JSBI\n ): Promise<{ amountCalculated: JSBI; sqrtRatioX96: JSBI; liquidity: JSBI; tickCurrent: number }> {\n if (!sqrtPriceLimitX96)\n sqrtPriceLimitX96 = zeroForOne\n ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE)\n : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE)\n\n if (zeroForOne) {\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO), 'RATIO_MIN')\n invariant(JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n } else {\n invariant(JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO), 'RATIO_MAX')\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n }\n\n const exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO)\n\n // keep track of swap state\n const state = {\n amountSpecifiedRemaining: amountSpecified,\n amountCalculated: ZERO,\n sqrtPriceX96: this.sqrtRatioX96,\n tick: this.tickCurrent,\n liquidity: this.liquidity\n }\n\n // start swap while loop\n while (JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96) {\n let step: Partial = {}\n step.sqrtPriceStartX96 = state.sqrtPriceX96\n\n // because each iteration of the while loop rounds, we can't optimize this code (relative to the smart contract)\n // by simply traversing to the next available tick, we instead need to exactly replicate\n // tickBitmap.nextInitializedTickWithinOneWord\n ;[step.tickNext, step.initialized] = await this.tickDataProvider.nextInitializedTickWithinOneWord(\n state.tick,\n zeroForOne,\n this.tickSpacing\n )\n\n if (step.tickNext < TickMath.MIN_TICK) {\n step.tickNext = TickMath.MIN_TICK\n } else if (step.tickNext > TickMath.MAX_TICK) {\n step.tickNext = TickMath.MAX_TICK\n }\n\n step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext)\n ;[state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount] = SwapMath.computeSwapStep(\n state.sqrtPriceX96,\n (zeroForOne\n ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)\n : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96))\n ? sqrtPriceLimitX96\n : step.sqrtPriceNextX96,\n state.liquidity,\n state.amountSpecifiedRemaining,\n this.fee\n )\n\n if (exactInput) {\n state.amountSpecifiedRemaining = JSBI.subtract(\n state.amountSpecifiedRemaining,\n JSBI.add(step.amountIn, step.feeAmount)\n )\n state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut)\n } else {\n state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut)\n state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount))\n }\n\n // TODO\n if (JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) {\n // if the tick is initialized, run the tick transition\n if (step.initialized) {\n let liquidityNet = JSBI.BigInt((await this.tickDataProvider.getTick(step.tickNext)).liquidityNet)\n // if we're moving leftward, we interpret liquidityNet as the opposite sign\n // safe because liquidityNet cannot be type(int128).min\n if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE)\n\n state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet)\n }\n\n state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext\n } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {\n // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved\n state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96)\n }\n }\n\n return {\n amountCalculated: state.amountCalculated,\n sqrtRatioX96: state.sqrtPriceX96,\n liquidity: state.liquidity,\n tickCurrent: state.tick\n }\n }\n\n public get tickSpacing(): number {\n return TICK_SPACINGS[this.fee]\n }\n}\n","import { BigintIsh, MaxUint256, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { maxLiquidityForAmounts } from '../utils/maxLiquidityForAmounts'\nimport { tickToPrice } from '../utils/priceTickConversions'\nimport { SqrtPriceMath } from '../utils/sqrtPriceMath'\nimport { TickMath } from '../utils/tickMath'\nimport { encodeSqrtRatioX96 } from '../utils/encodeSqrtRatioX96'\nimport { Pool } from './pool'\n\ninterface PositionConstructorArgs {\n pool: Pool\n tickLower: number\n tickUpper: number\n liquidity: BigintIsh\n}\n\n/**\n * Represents a position on a Uniswap V3 Pool\n */\nexport class Position {\n public readonly pool: Pool\n public readonly tickLower: number\n public readonly tickUpper: number\n public readonly liquidity: JSBI\n\n // cached resuts for the getters\n private _token0Amount: CurrencyAmount | null = null\n private _token1Amount: CurrencyAmount | null = null\n private _mintAmounts: Readonly<{ amount0: JSBI; amount1: JSBI }> | null = null\n\n /**\n * Constructs a position for a given pool with the given liquidity\n * @param pool for which pool the liquidity is assigned\n * @param liquidity the amount of liquidity that is in the position\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n */\n public constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs) {\n invariant(tickLower < tickUpper, 'TICK_ORDER')\n invariant(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0, 'TICK_LOWER')\n invariant(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0, 'TICK_UPPER')\n\n this.pool = pool\n this.tickLower = tickLower\n this.tickUpper = tickUpper\n this.liquidity = JSBI.BigInt(liquidity)\n }\n\n /**\n * Returns the price of token0 at the lower tick\n */\n public get token0PriceLower(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower)\n }\n\n /**\n * Returns the price of token0 at the upper tick\n */\n public get token0PriceUpper(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper)\n }\n\n /**\n * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price\n */\n public get amount0(): CurrencyAmount {\n if (this._token0Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else {\n this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO)\n }\n }\n return this._token0Amount\n }\n\n /**\n * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price\n */\n public get amount1(): CurrencyAmount {\n if (this._token1Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO)\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n false\n )\n )\n } else {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n }\n }\n return this._token1Amount\n }\n\n /**\n * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage\n * @param slippageTolerance amount by which the price can 'slip'\n * @private\n */\n private ratiosAfterSlippage(slippageTolerance: Percent): { sqrtRatioX96Lower: JSBI; sqrtRatioX96Upper: JSBI } {\n const priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance))\n const priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1))\n let sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator)\n if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) {\n sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1))\n }\n let sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator)\n if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) {\n sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1))\n }\n return {\n sqrtRatioX96Lower,\n sqrtRatioX96Upper\n }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position\n * with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage)\n const positionThatWillBeCreated = Position.fromAmounts({\n pool: this.pool,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper,\n ...this.mintAmounts, // the mint amounts are what will be passed as calldata\n useFullPrecision: false\n })\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const { amount0 } = new Position({\n pool: poolUpper,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n // ...and the lower for amount1\n const { amount1 } = new Position({\n pool: poolLower,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n\n return { amount0, amount1 }\n }\n\n /**\n * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the\n * position with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const amount0 = new Position({\n pool: poolUpper,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount0\n // ...and the lower for amount1\n const amount1 = new Position({\n pool: poolLower,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount1\n\n return { amount0: amount0.quotient, amount1: amount1.quotient }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at\n * the current price for the pool\n */\n public get mintAmounts(): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n if (this._mintAmounts === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: ZERO\n }\n } else if (this.pool.tickCurrent < this.tickUpper) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n true\n )\n }\n } else {\n return {\n amount0: ZERO,\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n )\n }\n }\n }\n return this._mintAmounts\n }\n\n /**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param pool the pool for which the position should be created\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmounts({\n pool,\n tickLower,\n tickUpper,\n amount0,\n amount1,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n amount1: BigintIsh\n useFullPrecision: boolean\n }) {\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower)\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper)\n return new Position({\n pool,\n tickLower,\n tickUpper,\n liquidity: maxLiquidityForAmounts(\n pool.sqrtRatioX96,\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0,\n amount1,\n useFullPrecision\n )\n })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount0 the desired amount of token0\n * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmount0({\n pool,\n tickLower,\n tickUpper,\n amount0,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n useFullPrecision: boolean\n }) {\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0, amount1: MaxUint256, useFullPrecision })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount1 the desired amount of token1\n */\n public static fromAmount1({\n pool,\n tickLower,\n tickUpper,\n amount1\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount1: BigintIsh\n }) {\n // this function always uses full precision,\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0: MaxUint256, amount1, useFullPrecision: true })\n }\n}\n","import invariant from 'tiny-invariant'\n\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from './pool'\n\n/**\n * Represents a list of pools through which a swap can occur\n */\nexport class Route {\n public readonly pools: Pool[]\n public readonly tokenPath: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n private _midPrice: Price | null = null\n\n public constructor(pools: Pool[], input: TInput, output: TOutput) {\n invariant(pools.length > 0, 'POOLS')\n\n const chainId = pools[0].chainId\n const allOnSameChain = pools.every(pool => pool.chainId === chainId)\n invariant(allOnSameChain, 'CHAIN_IDS')\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pools[0].involvesToken(wrappedInput), 'INPUT')\n\n invariant(pools[pools.length - 1].involvesToken(wrappedCurrency(output, chainId)), 'OUTPUT')\n\n /**\n * Normalizes token0-token1 order and selects the next token/fee step to add to the path\n * */\n const tokenPath: Token[] = [wrappedInput]\n for (const [i, pool] of pools.entries()) {\n const currentInputToken = tokenPath[i]\n invariant(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1), 'PATH')\n const nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0\n tokenPath.push(nextToken)\n }\n\n this.pools = pools\n this.tokenPath = tokenPath\n this.input = input\n this.output = output ?? tokenPath[tokenPath.length - 1]\n }\n\n public get chainId(): ChainId | number {\n return this.pools[0].chainId\n }\n\n /**\n * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token.\n */\n public get inputToken(): Token {\n return wrappedCurrency(this.input, this.chainId)\n }\n\n /**\n * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token.\n */\n public get outputToken(): Token {\n return wrappedCurrency(this.output, this.chainId)\n }\n\n /**\n * Returns the mid price of the route\n */\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n\n const price = this.pools.slice(1).reduce(\n ({ nextInput, price }, pool) => {\n return nextInput.equals(pool.token0)\n ? {\n nextInput: pool.token1,\n price: price.multiply(pool.token0Price)\n }\n : {\n nextInput: pool.token0,\n price: price.multiply(pool.token1Price)\n }\n },\n this.pools[0].token0.equals(this.inputToken)\n ? {\n nextInput: this.pools[0].token1,\n price: this.pools[0].token0Price\n }\n : {\n nextInput: this.pools[0].token0,\n price: this.pools[0].token1Price\n }\n ).price\n\n return (this._midPrice = new Price(this.input, this.output, price.denominator, price.numerator))\n }\n}\n","import {\n ChainId,\n Currency,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n CurrencyAmount,\n TradeType,\n wrappedCurrency,\n wrappedCurrencyAmount,\n Token,\n computePriceImpact\n} from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { Pool } from './pool'\nimport { Route } from './route'\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n // consider the number of hops since each hop costs gas\n return a.route.tokenPath.length - b.route.tokenPath.length\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pools.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pools the trade goes through.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n\n /**\n * The cached result of the computed execution price\n * @private\n */\n private _executionPrice: Price | undefined\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public get executionPrice(): Price {\n return (\n this._executionPrice ??\n (this._executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n ))\n )\n }\n\n /**\n * The cached result of the price impact computation\n * @private\n */\n private _priceImpact: Percent | undefined\n\n /**\n * Returns the percent difference between the route's mid price and the price impact\n */\n public get priceImpact(): Percent {\n return (\n this._priceImpact ??\n (this._priceImpact = computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount))\n )\n }\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static async exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static async exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n /**\n * Constructs a trade by simulating swaps through the given route\n * @param route route to swap through\n * @param amount the amount specified, either input or output, depending on tradeType\n * @param tradeType whether the trade is an exact input or exact output swap\n */\n public static async fromRoute(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ): Promise> {\n const amounts: CurrencyAmount[] = new Array(route.tokenPath.length)\n let inputAmount: CurrencyAmount\n let outputAmount: CurrencyAmount\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n amounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.tokenPath.length - 1; i++) {\n const pool = route.pools[i]\n const [outputAmount] = await pool.getOutputAmount(amounts[i])\n amounts[i + 1] = outputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n amounts[amounts.length - 1].numerator,\n amounts[amounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n amounts[amounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.tokenPath.length - 1; i > 0; i--) {\n const pool = route.pools[i - 1]\n const [inputAmount] = await pool.getInputAmount(amounts[i])\n amounts[i - 1] = inputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n\n return new Trade({\n route,\n tradeType,\n inputAmount,\n outputAmount\n })\n }\n\n /**\n * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade\n * elsewhere and do not have any tick data\n * @param constructorArguments the arguments passed to the trade constructor\n */\n public static createUncheckedTrade<\n TInput extends Currency,\n TOutput extends Currency,\n TTradeType extends TradeType\n >(constructorArguments: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }): Trade {\n return new Trade(constructorArguments)\n }\n\n /**\n * Construct a trade by passing in the pre-computed property values\n * @param route the route through which the trade occurs\n * @param inputAmount the amount of input paid in the trade\n * @param outputAmount the amount of output received in the trade\n * @param tradeType the type of trade, exact input or exact output\n */\n private constructor({\n route,\n inputAmount,\n outputAmount,\n tradeType\n }: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }) {\n invariant(currencyEquals(inputAmount.currency, route.input), 'INPUT_CURRENCY_MATCH')\n invariant(currencyEquals(outputAmount.currency, route.output), 'OUTPUT_CURRENCY_MATCH')\n this.route = route\n this.inputAmount = inputAmount\n this.outputAmount = outputAmount\n this.tradeType = tradeType\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactIn(\n pools: Pool[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountIn.currency) && !currencyEquals(pool.token1, amountIn.currency)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = await pool.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (amountOut.currency.isToken && amountOut.currency.equals(tokenOut)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([...currentPools, pool], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactIn(\n poolsExcludingThisPool,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPools, pool],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param currencyAmountOut the desired currency amount out\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactOut(\n pools: Pool[],\n currencyIn: Currency,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? currencyIn.chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountOut.currency) && !currencyEquals(pool.token1, amountOut.currency)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = await pool.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pool\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([pool, ...currentPools], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactOut(\n poolsExcludingThisPool,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pool, ...currentPools],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { BigintIsh, Token } from '@uniswap/sdk-core'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'\nimport { toHex } from './utils'\n\nexport interface StandardPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n amount: BigintIsh\n deadline: BigintIsh\n}\n\nexport interface AllowedPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n nonce: BigintIsh\n expiry: BigintIsh\n}\n\nexport type PermitOptions = StandardPermitArguments | AllowedPermitArguments\n\n// type guard\nfunction isAllowedPermit(permitOptions: PermitOptions): permitOptions is AllowedPermitArguments {\n return 'nonce' in permitOptions\n}\n\nexport abstract class SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n protected constructor() {}\n\n protected static encodePermit(token: Token, options: PermitOptions) {\n return isAllowedPermit(options)\n ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [\n token.address,\n toHex(options.nonce),\n toHex(options.expiry),\n options.v,\n options.r,\n options.s\n ])\n : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [\n token.address,\n toHex(options.amount),\n toHex(options.deadline),\n options.v,\n options.r,\n options.s\n ])\n }\n}\n","import {\n BigintIsh,\n ChainId,\n Percent,\n Token,\n CurrencyAmount,\n validateAndParseAddress,\n WETH9,\n Currency\n} from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { Position } from './entities/position'\nimport { ONE, ZERO } from './internalConstants'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { ADDRESS_ZERO } from './constants'\n\nconst MaxUint128 = toHex(JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(128)), JSBI.BigInt(1)))\n\nexport interface MintSpecificOptions {\n /**\n * The account that should receive the minted NFT.\n */\n recipient: string\n\n /**\n * Creates pool if not initialized before mint.\n */\n createPool?: boolean\n}\n\nexport interface IncreaseSpecificOptions {\n /**\n * Indicates the ID of the position to increase liquidity for.\n */\n tokenId: BigintIsh\n}\n\n/**\n * Options for producing the calldata to add liquidity.\n */\nexport interface CommonAddLiquidityOptions {\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false\n */\n useEther?: boolean\n\n /**\n * The optional permit parameters for spending token0\n */\n token0Permit?: PermitOptions\n\n /**\n * The optional permit parameters for spending token1\n */\n token1Permit?: PermitOptions\n}\n\nexport type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions\nexport type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions\n\nexport type AddLiquidityOptions = MintOptions | IncreaseOptions\n\n// type guard\nfunction isMint(options: AddLiquidityOptions): options is MintOptions {\n return Object.keys(options).some(k => k === 'recipient')\n}\n\nexport interface CollectOptions {\n /**\n * Indicates the ID of the position to collect for.\n */\n tokenId: BigintIsh\n\n /**\n * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed0: CurrencyAmount\n\n /**\n * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed1: CurrencyAmount\n\n /**\n * The account that should receive the tokens.\n */\n recipient: string\n}\n\nexport interface NFTPermitOptions {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n deadline: BigintIsh\n spender: string\n}\n\n/**\n * Options for producing the calldata to exit a position.\n */\nexport interface RemoveLiquidityOptions {\n /**\n * The ID of the token to exit\n */\n tokenId: BigintIsh\n\n /**\n * The percentage of position liquidity to exit.\n */\n liquidityPercentage: Percent\n\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether the NFT should be burned if the entire position is being exited, by default false.\n */\n burnToken?: boolean\n\n /**\n * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT\n */\n permit?: NFTPermitOptions\n\n /**\n * Parameters to be passed on to collect\n */\n collectOptions: Omit\n}\n\nexport abstract class NonfungiblePositionManager extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n public static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters {\n invariant(JSBI.greaterThan(position.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n const calldatas: string[] = []\n\n // get amounts\n const { amount0: amount0Desired, amount1: amount1Desired } = position.mintAmounts\n\n // adjust for slippage\n const minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance)\n const amount0Min = toHex(minimumAmounts.amount0)\n const amount1Min = toHex(minimumAmounts.amount1)\n\n const deadline = toHex(options.deadline)\n\n // create pool if needed\n if (isMint(options) && options.createPool) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [\n position.pool.token0.address,\n position.pool.token1.address,\n position.pool.fee,\n toHex(position.pool.sqrtRatioX96)\n ])\n )\n }\n\n // permits if necessary\n if (options.token0Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit))\n }\n if (options.token1Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit))\n }\n\n // mint\n if (isMint(options)) {\n const recipient: string = validateAndParseAddress(options.recipient)\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [\n {\n token0: position.pool.token0.address,\n token1: position.pool.token1.address,\n fee: position.pool.fee,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper,\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n recipient,\n deadline\n }\n ])\n )\n } else {\n // increase\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [\n {\n tokenId: toHex(options.tokenId),\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n deadline\n }\n ])\n )\n }\n\n let value: string = toHex(0)\n\n if (options.useEther) {\n const weth = WETH9[position.pool.chainId as ChainId]\n invariant(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth)), 'NO_WETH')\n\n const wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired\n\n // we only need to refund if we're actually sending ETH\n if (JSBI.greaterThan(wethValue, ZERO)) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n value = toHex(wethValue)\n }\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n\n private static encodeCollect(options: CollectOptions): string[] {\n const calldatas: string[] = []\n\n const tokenId = toHex(options.tokenId)\n\n const involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther\n\n const recipient = validateAndParseAddress(options.recipient)\n\n // collect\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [\n {\n tokenId,\n recipient: involvesETH ? ADDRESS_ZERO : recipient,\n amount0Max: MaxUint128,\n amount1Max: MaxUint128\n }\n ])\n )\n\n if (involvesETH) {\n const ethAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed0.quotient\n : options.expectedCurrencyOwed1.quotient\n const token = options.expectedCurrencyOwed0.currency.isEther\n ? (options.expectedCurrencyOwed1.currency as Token)\n : (options.expectedCurrencyOwed0.currency as Token)\n const tokenAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed1.quotient\n : options.expectedCurrencyOwed0.quotient\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])\n )\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [\n token.address,\n toHex(tokenAmount),\n recipient\n ])\n )\n }\n\n return calldatas\n }\n\n public static collectCallParameters(options: CollectOptions): MethodParameters {\n const calldatas: string[] = NonfungiblePositionManager.encodeCollect(options)\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n\n /**\n * Produces the calldata for completely or partially exiting a position\n * @param position the position to exit\n * @param options additional information necessary for generating the calldata\n */\n public static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters {\n const calldatas: string[] = []\n\n const deadline = toHex(options.deadline)\n const tokenId = toHex(options.tokenId)\n\n // construct a partial position with a percentage of liquidity\n const partialPosition = new Position({\n pool: position.pool,\n liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper\n })\n invariant(JSBI.greaterThan(partialPosition.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n // slippage-adjusted underlying amounts\n const { amount0: amount0Min, amount1: amount1Min } = partialPosition.burnAmountsWithSlippage(\n options.slippageTolerance\n )\n\n if (options.permit) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [\n validateAndParseAddress(options.permit.spender),\n tokenId,\n toHex(options.permit.deadline),\n options.permit.v,\n options.permit.r,\n options.permit.s\n ])\n )\n }\n\n // remove liquidity\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [\n {\n tokenId,\n liquidity: toHex(partialPosition.liquidity),\n amount0Min: toHex(amount0Min),\n amount1Min: toHex(amount1Min),\n deadline\n }\n ])\n )\n\n const { expectedCurrencyOwed0, expectedCurrencyOwed1, ...rest } = options.collectOptions\n calldatas.push(\n ...NonfungiblePositionManager.encodeCollect({\n tokenId: options.tokenId,\n // add the underlying value to the expected currency already owed\n expectedCurrencyOwed0: expectedCurrencyOwed0.add(\n expectedCurrencyOwed0.currency.isEther\n ? CurrencyAmount.ether(amount0Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency as Token, amount0Min)\n ),\n expectedCurrencyOwed1: expectedCurrencyOwed1.add(\n expectedCurrencyOwed1.currency.isEther\n ? CurrencyAmount.ether(amount1Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency as Token, amount1Min)\n ),\n ...rest\n })\n )\n\n if (options.liquidityPercentage.equalTo(ONE)) {\n if (options.burnToken) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId]))\n }\n } else {\n invariant(options.burnToken !== true, 'CANNOT_BURN')\n }\n\n return {\n calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { BigintIsh, Currency, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { Trade } from './entities/trade'\nimport { ADDRESS_ZERO } from './constants'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { encodeRouteToPath } from './utils'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'\n\nexport interface FeeOptions {\n /**\n * The percent of the output that will be taken as a fee.\n */\n fee: Percent\n\n /**\n * The recipient of the fee.\n */\n recipient: string\n}\n\n/**\n * Options for producing the arguments to send calls to the router.\n */\nexport interface SwapOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n slippageTolerance: Percent\n\n /**\n * The account that should receive the output.\n */\n recipient: string\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * The optional permit parameters for spending the input.\n */\n inputTokenPermit?: PermitOptions\n\n /**\n * The optional price limit for the trade.\n */\n sqrtPriceLimitX96?: BigintIsh\n\n /**\n * Optional information for taking a fee on output.\n */\n fee?: FeeOptions\n}\n\n/**\n * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades.\n */\nexport abstract class SwapRouter extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: SwapOptions\n ): MethodParameters {\n const calldatas: string[] = []\n\n // encode permit if necessary\n if (options.inputTokenPermit) {\n invariant(trade.inputAmount.currency.isToken, 'NON_TOKEN_PERMIT')\n calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit))\n }\n\n const recipient: string = validateAndParseAddress(options.recipient)\n\n const deadline = toHex(options.deadline)\n\n const amountIn: string = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient)\n const amountOut: string = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient)\n const value: string = trade.inputAmount.currency.isEther ? amountIn : toHex(0)\n\n // flag for whether the trade is single hop or not\n const singleHop = trade.route.pools.length === 1\n\n // flag for whether a refund needs to happen\n const mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === TradeType.EXACT_OUTPUT\n\n // flags for whether funds should be send first to the router\n const outputIsEther = trade.outputAmount.currency.isEther\n const routerMustCustody = outputIsEther || !!options.fee\n\n if (singleHop) {\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams]))\n } else {\n const exactOutputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams]))\n }\n } else {\n invariant(options.sqrtPriceLimitX96 === undefined, 'MULTIHOP_PRICE_LIMIT')\n\n const path: string = encodeRouteToPath(trade.route, trade.tradeType === TradeType.EXACT_OUTPUT)\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams]))\n } else {\n const exactOutputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams]))\n }\n }\n\n // refund\n if (mustRefund) {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n // unwrap\n if (routerMustCustody) {\n if (!!options.fee) {\n const feeRecipient: string = validateAndParseAddress(options.fee.recipient)\n const fee = toHex(options.fee.fee.multiply(10_000).quotient)\n\n if (outputIsEther) {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])\n )\n } else {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [\n trade.route.tokenPath[trade.route.tokenPath.length - 1].address,\n amountOut,\n recipient,\n fee,\n feeRecipient\n ])\n )\n }\n } else {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient]))\n }\n }\n\n return {\n calldata:\n calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n}\n","import invariant from 'tiny-invariant'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns the closest tick that is nearest a given tick and usable for the given tick spacing\n * @param tick the target tick\n * @param tickSpacing the spacing of the pool\n */\nexport function nearestUsableTick(tick: number, tickSpacing: number) {\n invariant(Number.isInteger(tick) && Number.isInteger(tickSpacing), 'INTEGERS')\n invariant(tickSpacing > 0, 'TICK_SPACING')\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, 'TICK_BOUND')\n const rounded = Math.round(tick / tickSpacing) * tickSpacing\n if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing\n else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing\n else return rounded\n}\n"],"names":["FeeAmount","runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","Function","ADDRESS_ZERO","POOL_INIT_CODE_HASH","TICK_SPACINGS","LOW","MEDIUM","HIGH","NEGATIVE_ONE","JSBI","BigInt","ZERO","ONE","Q96","exponentiate","Q192","computePoolAddress","factoryAddress","tokenA","tokenB","fee","sortsBefore","getCreate2Address","keccak256","defaultAbiCoder","encode","address","LiquidityMath","addDelta","x","y","lessThan","subtract","multiply","add","FullMath","mulDivRoundingUp","a","b","denominator","product","divide","notEqual","remainder","MaxUint160","multiplyIn256","bitwiseAnd","MaxUint256","SqrtPriceMath","getAmount0Delta","sqrtRatioAX96","sqrtRatioBX96","liquidity","roundUp","greaterThan","numerator1","leftShift","numerator2","getAmount1Delta","getNextSqrtPriceFromInput","sqrtPX96","amountIn","zeroForOne","invariant","getNextSqrtPriceFromAmount0RoundingUp","getNextSqrtPriceFromAmount1RoundingDown","getNextSqrtPriceFromOutput","amountOut","amount","equal","sum","greaterThanOrEqual","quotient","lessThanOrEqual","MAX_FEE","SwapMath","computeSwapStep","sqrtRatioCurrentX96","sqrtRatioTargetX96","amountRemaining","feePips","returnValues","exactIn","amountRemainingLessFee","sqrtRatioNextX96","max","feeAmount","TWO","POWERS_OF_2","map","pow","mostSignificantBit","msb","power","signedRightShift","mulShift","val","mulBy","Q32","TickMath","getSqrtRatioAtTick","tick","MIN_TICK","MAX_TICK","Number","isInteger","absTick","ratio","getTickAtSqrtRatio","sqrtRatioX96","MIN_SQRT_RATIO","MAX_SQRT_RATIO","r","sqrtRatioX128","log_2","f","bitwiseOr","log_sqrt10001","tickLow","toNumber","tickHigh","NoTickDataProvider","getTick","_tick","ERROR_MESSAGE","nextInitializedTickWithinOneWord","_lte","_tickSpacing","isSorted","list","comparator","tickComparator","index","TickList","validateList","ticks","tickSpacing","every","reduce","accumulator","liquidityNet","isBelowSmallest","isAtOrAboveLargest","binarySearch","l","Math","floor","nextInitializedTick","lte","compressed","minimum","maximum","min","toHex","bigintIsh","hex","encodeRouteToPath","route","exactOutput","firstInputToken","wrappedCurrency","input","chainId","pools","pool","inputToken","path","types","outputToken","token0","equals","token1","pack","encodeSqrtRatioX96","amount1","amount0","numerator","ratioX192","sqrt","maxLiquidityForAmount0Imprecise","intermediate","maxLiquidityForAmount0Precise","maxLiquidityForAmount1","maxLiquidityForAmounts","useFullPrecision","maxLiquidityForAmount0","liquidity0","liquidity1","tickToPrice","baseToken","quoteToken","Price","Tick","liquidityGross","TickListDataProvider","ticksMapped","t","NO_TICK_DATA_PROVIDER_DEFAULT","Pool","tickCurrent","tickCurrentSqrtRatioX96","nextTickSqrtRatioX96","tickDataProvider","Array","isArray","getAddress","involvesToken","token","priceOf","token0Price","token1Price","getOutputAmount","inputAmount","sqrtPriceLimitX96","currency","swap","CurrencyAmount","fromRawAmount","amountCalculated","getInputAmount","outputAmount","isToken","amountSpecified","exactInput","amountSpecifiedRemaining","sqrtPriceX96","step","sqrtPriceStartX96","tickNext","initialized","sqrtPriceNextX96","_token0Price","_token1Price","Position","tickLower","tickUpper","ratiosAfterSlippage","slippageTolerance","priceLower","asFraction","Percent","priceUpper","sqrtRatioX96Lower","sqrtRatioX96Upper","mintAmountsWithSlippage","poolLower","poolUpper","positionThatWillBeCreated","fromAmounts","mintAmounts","burnAmountsWithSlippage","fromAmount0","fromAmount1","_token0Amount","_token1Amount","_mintAmounts","Route","output","wrappedInput","tokenPath","entries","currentInputToken","nextToken","_midPrice","price","nextInput","tradeComparator","currencyEquals","equalTo","Trade","tradeType","fromRoute","TradeType","EXACT_INPUT","exactOut","EXACT_OUTPUT","amounts","wrappedCurrencyAmount","fromFractionalAmount","createUncheckedTrade","constructorArguments","minimumAmountOut","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","worstExecutionPrice","bestTradeExactIn","currencyAmountIn","currencyOut","currentPools","nextAmountIn","bestTrades","maxNumResults","maxHops","tokenOut","_context4","isInsufficientInputAmountError","sortedInsert","poolsExcludingThisPool","concat","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","_context5","isInsufficientReservesError","_executionPrice","_priceImpact","computePriceImpact","midPrice","SelfPermit","encodePermit","options","INTERFACE","encodeFunctionData","nonce","expiry","v","s","deadline","Interface","abi","MaxUint128","isMint","some","k","NonfungiblePositionManager","_SelfPermit","addCallParameters","position","calldatas","amount0Desired","amount1Desired","minimumAmounts","amount0Min","amount1Min","createPool","token0Permit","token1Permit","recipient","validateAndParseAddress","tokenId","useEther","weth","WETH9","wethValue","calldata","encodeCollect","involvesETH","expectedCurrencyOwed0","isEther","expectedCurrencyOwed1","amount0Max","amount1Max","tokenAmount","collectCallParameters","removeCallParameters","partialPosition","liquidityPercentage","permit","spender","collectOptions","rest","ether","burnToken","SwapRouter","swapCallParameters","trade","inputTokenPermit","mustRefund","outputIsEther","routerMustCustody","exactInputSingleParams","amountOutMinimum","exactOutputSingleParams","amountInMaximum","feeRecipient","rounded","round","sorted","baseCurrency","quoteCurrency","nextTickPrice"],"mappings":"uwEASYA,mBCFZ,IAAIC,EAAW,SAAUC,GAGvB,IAAIC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,gBAE/C,SAASC,EAAOC,EAAKC,EAAKC,GAOxB,OANAf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,GAEb,IAEEF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,GAC1B,OAAOF,EAAIC,GAAOC,GAItB,SAASM,EAAKC,EAASC,EAASC,EAAMC,GAEpC,IACIC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,IAMzC,OAFAC,EAAUK,QAsMZ,SAA0BT,EAASE,EAAMK,GACvC,IAAIG,EA/KuB,iBAiL3B,OAAO,SAAgBC,EAAQC,GAC7B,GAhLoB,cAgLhBF,EACF,MAAM,IAAIG,M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,EAAU9X,KADRsa,EAEAL,EAAWpD,UAAUC,mBAAmB,qBAAsB,CAAC1P,EAAWmR,EAAWlU,EAAKuW,IAI1FX,EAAWpD,UAAUC,mBAAmB,oBAAqB,CAC3DqD,EAAMrN,MAAMsG,UAAU+G,EAAMrN,MAAMsG,UAAU7S,OAAS,GAAGoE,QACxDyC,EACAmR,EACAlU,EACAuW,UAKN9C,EAAU9X,KAAKia,EAAWpD,UAAUC,mBAAmB,cAAe,CAAC1P,EAAWmR,WAI/E,CACLO,SACuB,IAArBhB,EAAUvX,OAAeuX,EAAU,GAAKmC,EAAWpD,UAAUC,mBAAmB,YAAa,CAACgB,IAChGvc,MAAAA,OAvImCmb,IACzBuD,aAAuB,IAAI7C,YAAUC,sD1B7DtB,smB2BQG/N,EAAcmC,GACpChC,OAAOC,UAAUJ,IAASG,OAAOC,UAAU+B,IAArDzE,MACUyE,EAAc,GAAxBzE,MACUsC,GAAQF,EAASG,UAAYD,GAAQF,EAASI,UAAxDxC,UACM6T,EAAU3O,KAAK4O,MAAMxR,EAAOmC,GAAeA,SAC7CoP,EAAUzR,EAASG,SAAiBsR,EAAUpP,EACzCoP,EAAUzR,EAASI,SAAiBqR,EAAUpP,EAC3CoP,uCVaqBpH,OAC3BsH,EAAStH,EAAMuH,aAAa1W,YAAYmP,EAAMwH,eAE9CnR,EAAeiR,EACjBjN,EAAmB2F,EAAMxF,UAAWwF,EAAMjO,aAC1CsI,EAAmB2F,EAAMjO,YAAaiO,EAAMxF,WAE5C3E,EAAOF,EAASS,mBAAmBC,GACjCoR,EAAgBrM,GAAY4E,EAAMuH,aAAcvH,EAAMwH,cAAe3R,EAAO,UAC9EyR,EACGtH,EAAMzO,SAASkW,IAClB5R,IAGGmK,EAAMlN,YAAY2U,IACrB5R,IAGGA"} \ No newline at end of file diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js new file mode 100644 index 00000000000..c5deb04a0ad --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js @@ -0,0 +1,3360 @@ +import { MaxUint256, wrappedCurrency, sqrt, Price, CurrencyAmount, Percent, currencyEquals, TradeType, Fraction, computePriceImpact, wrappedCurrencyAmount, sortedInsert, validateAndParseAddress, WETH9 } from '@uniswap/sdk-core'; +import JSBI from 'jsbi'; +import invariant from 'tiny-invariant'; +import { defaultAbiCoder, Interface } from '@ethersproject/abi'; +import { getCreate2Address } from '@ethersproject/address'; +import { keccak256, pack } from '@ethersproject/solidity'; +import { abi as abi$1 } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'; +import { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'; +import { abi as abi$2 } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'; + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} + +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + + _next(undefined); + }); + }; +} + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +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) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; +} + +function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it; + + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + it = o[Symbol.iterator](); + return it.next.bind(it); +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var runtime_1 = createCommonjsModule(function (module) { +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +var runtime = (function (exports) { + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined$1; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + function define(obj, key, value) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + return obj[key]; + } + try { + // IE 8 has a broken Object.defineProperty that only works on DOM objects. + define({}, ""); + } catch (err) { + define = function(obj, key, value) { + return obj[key] = value; + }; + } + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + exports.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = define( + GeneratorFunctionPrototype, + toStringTagSymbol, + "GeneratorFunction" + ); + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + define(prototype, method, function(arg) { + return this._invoke(method, arg); + }); + }); + } + + exports.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + exports.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + define(genFun, toStringTagSymbol, "GeneratorFunction"); + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return PromiseImpl.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return PromiseImpl.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function(error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + exports.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { + if (PromiseImpl === void 0) PromiseImpl = Promise; + + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList), + PromiseImpl + ); + + return exports.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined$1) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + // Note: ["return"] must be used for ES3 parsing compatibility. + if (delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined$1; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined$1; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + define(Gp, toStringTagSymbol, "Generator"); + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + exports.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined$1; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + exports.values = values; + + function doneResult() { + return { value: undefined$1, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined$1; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined$1; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined$1; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined$1; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined$1; + } + + return ContinueSentinel; + } + }; + + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + +}( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + module.exports +)); + +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + Function("r", "regeneratorRuntime = r")(runtime); +} +}); + +var _TICK_SPACINGS; + +var FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'; +var ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'; +var POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'; +/** + * The default factory enabled fee amounts, denominated in hundredths of bips. + */ + +var FeeAmount; + +(function (FeeAmount) { + FeeAmount[FeeAmount["LOW"] = 500] = "LOW"; + FeeAmount[FeeAmount["MEDIUM"] = 3000] = "MEDIUM"; + FeeAmount[FeeAmount["HIGH"] = 10000] = "HIGH"; +})(FeeAmount || (FeeAmount = {})); +/** + * The default factory tick spacings by fee amount. + */ + + +var TICK_SPACINGS = (_TICK_SPACINGS = {}, _TICK_SPACINGS[FeeAmount.LOW] = 10, _TICK_SPACINGS[FeeAmount.MEDIUM] = 60, _TICK_SPACINGS[FeeAmount.HIGH] = 200, _TICK_SPACINGS); + +var NEGATIVE_ONE = /*#__PURE__*/JSBI.BigInt(-1); +var ZERO = /*#__PURE__*/JSBI.BigInt(0); +var ONE = /*#__PURE__*/JSBI.BigInt(1); // used in liquidity amount math + +var Q96 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(96)); +var Q192 = /*#__PURE__*/JSBI.exponentiate(Q96, /*#__PURE__*/JSBI.BigInt(2)); + +function computePoolAddress(_ref) { + var factoryAddress = _ref.factoryAddress, + tokenA = _ref.tokenA, + tokenB = _ref.tokenB, + fee = _ref.fee; + + var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], + token0 = _ref2[0], + token1 = _ref2[1]; // does safety checks + + + return getCreate2Address(factoryAddress, keccak256(['bytes'], [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]), POOL_INIT_CODE_HASH); +} + +var LiquidityMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function LiquidityMath() {} + + LiquidityMath.addDelta = function addDelta(x, y) { + if (JSBI.lessThan(y, ZERO)) { + return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE)); + } else { + return JSBI.add(x, y); + } + }; + + return LiquidityMath; +}(); + +var FullMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function FullMath() {} + + FullMath.mulDivRoundingUp = function mulDivRoundingUp(a, b, denominator) { + var product = JSBI.multiply(a, b); + var result = JSBI.divide(product, denominator); + if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE); + return result; + }; + + return FullMath; +}(); + +var MaxUint160 = /*#__PURE__*/JSBI.subtract( /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(160)), ONE); + +function multiplyIn256(x, y) { + var product = JSBI.multiply(x, y); + return JSBI.bitwiseAnd(product, MaxUint256); +} + +function addIn256(x, y) { + var sum = JSBI.add(x, y); + return JSBI.bitwiseAnd(sum, MaxUint256); +} + +var SqrtPriceMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function SqrtPriceMath() {} + + SqrtPriceMath.getAmount0Delta = function getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, liquidity, roundUp) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref[0]; + sqrtRatioBX96 = _ref[1]; + } + + var numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96)); + var numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96); + return roundUp ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96) : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96); + }; + + SqrtPriceMath.getAmount1Delta = function getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, liquidity, roundUp) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref2 = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref2[0]; + sqrtRatioBX96 = _ref2[1]; + } + + return roundUp ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96) : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96); + }; + + SqrtPriceMath.getNextSqrtPriceFromInput = function getNextSqrtPriceFromInput(sqrtPX96, liquidity, amountIn, zeroForOne) { + !JSBI.greaterThan(sqrtPX96, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + !JSBI.greaterThan(liquidity, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + return zeroForOne ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true) : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true); + }; + + SqrtPriceMath.getNextSqrtPriceFromOutput = function getNextSqrtPriceFromOutput(sqrtPX96, liquidity, amountOut, zeroForOne) { + !JSBI.greaterThan(sqrtPX96, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + !JSBI.greaterThan(liquidity, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + return zeroForOne ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false) : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false); + }; + + SqrtPriceMath.getNextSqrtPriceFromAmount0RoundingUp = function getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amount, add) { + if (JSBI.equal(amount, ZERO)) return sqrtPX96; + var numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96)); + + if (add) { + var product = multiplyIn256(amount, sqrtPX96); + + if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) { + var denominator = addIn256(numerator1, product); + + if (JSBI.greaterThanOrEqual(denominator, numerator1)) { + return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator); + } + } + + return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount)); + } else { + var _product = multiplyIn256(amount, sqrtPX96); + + !JSBI.equal(JSBI.divide(_product, amount), sqrtPX96) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + !JSBI.greaterThan(numerator1, _product) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + + var _denominator = JSBI.subtract(numerator1, _product); + + return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, _denominator); + } + }; + + SqrtPriceMath.getNextSqrtPriceFromAmount1RoundingDown = function getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amount, add) { + if (add) { + var quotient = JSBI.lessThanOrEqual(amount, MaxUint160) ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity) : JSBI.divide(JSBI.multiply(amount, Q96), liquidity); + return JSBI.add(sqrtPX96, quotient); + } else { + var _quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity); + + !JSBI.greaterThan(sqrtPX96, _quotient) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; + return JSBI.subtract(sqrtPX96, _quotient); + } + }; + + return SqrtPriceMath; +}(); + +var MAX_FEE = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(10), /*#__PURE__*/JSBI.BigInt(6)); +var SwapMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function SwapMath() {} + + SwapMath.computeSwapStep = function computeSwapStep(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, amountRemaining, feePips) { + var returnValues = {}; + var zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96); + var exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO); + + if (exactIn) { + var amountRemainingLessFee = JSBI.divide(JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))), MAX_FEE); + returnValues.amountIn = zeroForOne ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true) : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true); + + if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn)) { + returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96; + } else { + returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(sqrtRatioCurrentX96, liquidity, amountRemainingLessFee, zeroForOne); + } + } else { + returnValues.amountOut = zeroForOne ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false) : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false); + + if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) { + returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96; + } else { + returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtRatioCurrentX96, liquidity, JSBI.multiply(amountRemaining, NEGATIVE_ONE), zeroForOne); + } + } + + var max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96); + + if (zeroForOne) { + returnValues.amountIn = max && exactIn ? returnValues.amountIn : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true); + returnValues.amountOut = max && !exactIn ? returnValues.amountOut : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false); + } else { + returnValues.amountIn = max && exactIn ? returnValues.amountIn : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true); + returnValues.amountOut = max && !exactIn ? returnValues.amountOut : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false); + } + + if (!exactIn && JSBI.greaterThan(returnValues.amountOut, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) { + returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE); + } + + if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) { + // we didn't reach the target, so take the remainder of the maximum input as fee + returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn); + } else { + returnValues.feeAmount = FullMath.mulDivRoundingUp(returnValues.amountIn, JSBI.BigInt(feePips), JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))); + } + + return [returnValues.sqrtRatioNextX96, returnValues.amountIn, returnValues.amountOut, returnValues.feeAmount]; + }; + + return SwapMath; +}(); + +var TWO = /*#__PURE__*/JSBI.BigInt(2); +var POWERS_OF_2 = /*#__PURE__*/[128, 64, 32, 16, 8, 4, 2, 1].map(function (pow) { + return [pow, JSBI.exponentiate(TWO, JSBI.BigInt(pow))]; +}); +function mostSignificantBit(x) { + !JSBI.greaterThan(x, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO') : invariant(false) : void 0; + !JSBI.lessThanOrEqual(x, MaxUint256) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX') : invariant(false) : void 0; + var msb = 0; + + for (var _iterator = _createForOfIteratorHelperLoose(POWERS_OF_2), _step; !(_step = _iterator()).done;) { + var _step$value = _step.value, + power = _step$value[0], + min = _step$value[1]; + + if (JSBI.greaterThanOrEqual(x, min)) { + x = JSBI.signedRightShift(x, JSBI.BigInt(power)); + msb += power; + } + } + + return msb; +} + +function mulShift(val, mulBy) { + return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128)); +} + +var Q32 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(32)); +var TickMath = /*#__PURE__*/function () { + /** + * Cannot be constructed. + */ + function TickMath() {} + /** + * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick + * @param tick the tick for which to compute the sqrt ratio + */ + + + TickMath.getSqrtRatioAtTick = function getSqrtRatioAtTick(tick) { + !(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK') : invariant(false) : void 0; + var absTick = tick < 0 ? tick * -1 : tick; + var ratio = (absTick & 0x1) != 0 ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001') : JSBI.BigInt('0x100000000000000000000000000000000'); + if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a'); + if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc'); + if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0'); + if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644'); + if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0'); + if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861'); + if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053'); + if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4'); + if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54'); + if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3'); + if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9'); + if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825'); + if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5'); + if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7'); + if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6'); + if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9'); + if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604'); + if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98'); + if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2'); + if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio); // back to Q96 + + return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO) ? JSBI.add(JSBI.divide(ratio, Q32), ONE) : JSBI.divide(ratio, Q32); + } + /** + * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96 + * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96 + * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick + */ + ; + + TickMath.getTickAtSqrtRatio = function getTickAtSqrtRatio(sqrtRatioX96) { + !(JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) && JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SQRT_RATIO') : invariant(false) : void 0; + var sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32)); + var msb = mostSignificantBit(sqrtRatioX128); + var r; + + if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) { + r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127)); + } else { + r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb)); + } + + var log_2 = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64)); + + for (var i = 0; i < 14; i++) { + r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127)); + var f = JSBI.signedRightShift(r, JSBI.BigInt(128)); + log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i))); + r = JSBI.signedRightShift(r, f); + } + + var log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141')); + var tickLow = JSBI.toNumber(JSBI.signedRightShift(JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')), JSBI.BigInt(128))); + var tickHigh = JSBI.toNumber(JSBI.signedRightShift(JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')), JSBI.BigInt(128))); + return tickLow === tickHigh ? tickLow : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96) ? tickHigh : tickLow; + }; + + return TickMath; +}(); +/** + * The minimum tick that can be used on any pool. + */ + +TickMath.MIN_TICK = -887272; +/** + * The maximum tick that can be used on any pool. + */ + +TickMath.MAX_TICK = -TickMath.MIN_TICK; +/** + * The sqrt ratio corresponding to the minimum tick that could be used on any pool. + */ + +TickMath.MIN_SQRT_RATIO = /*#__PURE__*/JSBI.BigInt('4295128739'); +/** + * The sqrt ratio corresponding to the maximum tick that could be used on any pool. + */ + +TickMath.MAX_SQRT_RATIO = /*#__PURE__*/JSBI.BigInt('1461446703485210103287273052203988822378723970342'); + +/** + * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you + * do not need to load tick data for your use case. + */ +var NoTickDataProvider = /*#__PURE__*/function () { + function NoTickDataProvider() {} + + var _proto = NoTickDataProvider.prototype; + + _proto.getTick = /*#__PURE__*/function () { + var _getTick = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_tick) { + return runtime_1.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + throw new Error(NoTickDataProvider.ERROR_MESSAGE); + + case 1: + case "end": + return _context.stop(); + } + } + }, _callee); + })); + + function getTick(_x) { + return _getTick.apply(this, arguments); + } + + return getTick; + }(); + + _proto.nextInitializedTickWithinOneWord = /*#__PURE__*/function () { + var _nextInitializedTickWithinOneWord = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(_tick, _lte, _tickSpacing) { + return runtime_1.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + throw new Error(NoTickDataProvider.ERROR_MESSAGE); + + case 1: + case "end": + return _context2.stop(); + } + } + }, _callee2); + })); + + function nextInitializedTickWithinOneWord(_x2, _x3, _x4) { + return _nextInitializedTickWithinOneWord.apply(this, arguments); + } + + return nextInitializedTickWithinOneWord; + }(); + + return NoTickDataProvider; +}(); +NoTickDataProvider.ERROR_MESSAGE = 'No tick data provider was given'; + +function isSorted(list, comparator) { + for (var i = 0; i < list.length - 1; i++) { + if (comparator(list[i], list[i + 1]) > 0) { + return false; + } + } + + return true; +} + +function tickComparator(a, b) { + return a.index - b.index; +} +/** + * Utility methods for interacting with sorted lists of ticks + */ + + +var TickList = /*#__PURE__*/function () { + /** + * Cannot be constructed + */ + function TickList() {} + + TickList.validateList = function validateList(ticks, tickSpacing) { + !(tickSpacing > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_SPACING_NONZERO') : invariant(false) : void 0; // ensure ticks are spaced appropriately + + !ticks.every(function (_ref) { + var index = _ref.index; + return index % tickSpacing === 0; + }) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_SPACING') : invariant(false) : void 0; // ensure tick liquidity deltas sum to 0 + + !JSBI.equal(ticks.reduce(function (accumulator, _ref2) { + var liquidityNet = _ref2.liquidityNet; + return JSBI.add(accumulator, liquidityNet); + }, ZERO), ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO_NET') : invariant(false) : void 0; + !isSorted(ticks, tickComparator) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SORTED') : invariant(false) : void 0; + }; + + TickList.isBelowSmallest = function isBelowSmallest(ticks, tick) { + !(ticks.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LENGTH') : invariant(false) : void 0; + return tick < ticks[0].index; + }; + + TickList.isAtOrAboveLargest = function isAtOrAboveLargest(ticks, tick) { + !(ticks.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LENGTH') : invariant(false) : void 0; + return tick >= ticks[ticks.length - 1].index; + }; + + TickList.getTick = function getTick(ticks, index) { + var tick = ticks[this.binarySearch(ticks, index)]; + !(tick.index === index) ? process.env.NODE_ENV !== "production" ? invariant(false, 'NOT_CONTAINED') : invariant(false) : void 0; + return tick; + } + /** + * Finds the largest tick in the list of ticks that is less than or equal to tick + * @param ticks list of ticks + * @param tick tick to find the largest tick that is less than or equal to tick + * @private + */ + ; + + TickList.binarySearch = function binarySearch(ticks, tick) { + !!this.isBelowSmallest(ticks, tick) ? process.env.NODE_ENV !== "production" ? invariant(false, 'BELOW_SMALLEST') : invariant(false) : void 0; + var l = 0; + var r = ticks.length - 1; + var i; + + while (true) { + i = Math.floor((l + r) / 2); + + if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) { + return i; + } + + if (ticks[i].index < tick) { + l = i + 1; + } else { + r = i - 1; + } + } + }; + + TickList.nextInitializedTick = function nextInitializedTick(ticks, tick, lte) { + if (lte) { + !!TickList.isBelowSmallest(ticks, tick) ? process.env.NODE_ENV !== "production" ? invariant(false, 'BELOW_SMALLEST') : invariant(false) : void 0; + + if (TickList.isAtOrAboveLargest(ticks, tick)) { + return ticks[ticks.length - 1]; + } + + var index = this.binarySearch(ticks, tick); + return ticks[index]; + } else { + !!this.isAtOrAboveLargest(ticks, tick) ? process.env.NODE_ENV !== "production" ? invariant(false, 'AT_OR_ABOVE_LARGEST') : invariant(false) : void 0; + + if (this.isBelowSmallest(ticks, tick)) { + return ticks[0]; + } + + var _index = this.binarySearch(ticks, tick); + + return ticks[_index + 1]; + } + }; + + TickList.nextInitializedTickWithinOneWord = function nextInitializedTickWithinOneWord(ticks, tick, lte, tickSpacing) { + var compressed = Math.floor(tick / tickSpacing); // matches rounding in the code + + if (lte) { + var wordPos = compressed >> 8; + var minimum = (wordPos << 8) * tickSpacing; + + if (TickList.isBelowSmallest(ticks, tick)) { + return [minimum, false]; + } + + var index = TickList.nextInitializedTick(ticks, tick, lte).index; + var nextInitializedTick = Math.max(minimum, index); + return [nextInitializedTick, nextInitializedTick === index]; + } else { + var _wordPos = compressed + 1 >> 8; + + var maximum = (_wordPos + 1 << 8) * tickSpacing - 1; + + if (this.isAtOrAboveLargest(ticks, tick)) { + return [maximum, false]; + } + + var _index2 = this.nextInitializedTick(ticks, tick, lte).index; + + var _nextInitializedTick = Math.min(maximum, _index2); + + return [_nextInitializedTick, _nextInitializedTick === _index2]; + } + }; + + return TickList; +}(); + +function toHex(bigintIsh) { + var bigInt = JSBI.BigInt(bigintIsh); + var hex = bigInt.toString(16); + + if (hex.length % 2 !== 0) { + hex = "0" + hex; + } + + return "0x" + hex; +} + +/** + * Converts a route to a hex encoded path + * @param route the v3 path to convert to an encoded path + * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps + */ + +function encodeRouteToPath(route, exactOutput) { + var firstInputToken = wrappedCurrency(route.input, route.chainId); + + var _route$pools$reduce = route.pools.reduce(function (_ref, pool, index) { + var inputToken = _ref.inputToken, + path = _ref.path, + types = _ref.types; + var outputToken = pool.token0.equals(inputToken) ? pool.token1 : pool.token0; + + if (index === 0) { + return { + inputToken: outputToken, + types: ['address', 'uint24', 'address'], + path: [inputToken.address, pool.fee, outputToken.address] + }; + } else { + return { + inputToken: outputToken, + types: [].concat(types, ['uint24', 'address']), + path: [].concat(path, [pool.fee, outputToken.address]) + }; + } + }, { + inputToken: firstInputToken, + path: [], + types: [] + }), + path = _route$pools$reduce.path, + types = _route$pools$reduce.types; + + return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path); +} + +/** + * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0 + * @param amount1 the numerator amount, i.e. amount of token1 + * @param amount0 the denominator amount, i.en amount of token0 + */ + +function encodeSqrtRatioX96(amount1, amount0) { + var numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192)); + var denominator = JSBI.BigInt(amount0); + var ratioX192 = JSBI.divide(numerator, denominator); + return sqrt(ratioX192); +} + +function maxLiquidityForAmount0Imprecise(sqrtRatioAX96, sqrtRatioBX96, amount0) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref[0]; + sqrtRatioBX96 = _ref[1]; + } + + var intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96); + return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); +} + +function maxLiquidityForAmount0Precise(sqrtRatioAX96, sqrtRatioBX96, amount0) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref2 = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref2[0]; + sqrtRatioBX96 = _ref2[1]; + } + + var numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96); + var denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); + return JSBI.divide(numerator, denominator); +} + +function maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref3 = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref3[0]; + sqrtRatioBX96 = _ref3[1]; + } + + return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); +} +/** + * Computes the maximum amount of liquidity received for a given amount of token0, token1, + * and the prices at the tick boundaries. + * @param sqrtRatioCurrentX96 the current price + * @param sqrtRatioAX96 price at lower boundary + * @param sqrtRatioBX96 price at upper boundary + * @param amount0 token0 amount + * @param amount1 token1 amount + * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ + + +function maxLiquidityForAmounts(sqrtRatioCurrentX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1, useFullPrecision) { + if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { + var _ref4 = [sqrtRatioBX96, sqrtRatioAX96]; + sqrtRatioAX96 = _ref4[0]; + sqrtRatioBX96 = _ref4[1]; + } + + var maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise; + + if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) { + return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0); + } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) { + var liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0); + var liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1); + return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1; + } else { + return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1); + } +} + +/** + * Returns the closest tick that is nearest a given tick and usable for the given tick spacing + * @param tick the target tick + * @param tickSpacing the spacing of the pool + */ + +function nearestUsableTick(tick, tickSpacing) { + !(Number.isInteger(tick) && Number.isInteger(tickSpacing)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INTEGERS') : invariant(false) : void 0; + !(tickSpacing > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_SPACING') : invariant(false) : void 0; + !(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_BOUND') : invariant(false) : void 0; + var rounded = Math.round(tick / tickSpacing) * tickSpacing; + if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing;else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing;else return rounded; +} + +/** + * Returns a price object corresponding to the input tick and the base/quote token + * Inputs must be tokens because the address order is used to interpret the price represented by the tick + * @param baseToken the base token of the price + * @param quoteToken the quote token of the price + * @param tick the tick for which to return the price + */ + +function tickToPrice(baseToken, quoteToken, tick) { + var sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick); + var ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96); + return baseToken.sortsBefore(quoteToken) ? new Price(baseToken, quoteToken, Q192, ratioX192) : new Price(baseToken, quoteToken, ratioX192, Q192); +} +/** + * Returns the first tick for which the given price is greater than or equal to the tick price + * @param price for which to return the closest tick that represents a price less than or equal to the input price, + * i.e. the price of the returned tick is less than or equal to the input price + */ + +function priceToClosestTick(price) { + var sorted = price.baseCurrency.sortsBefore(price.quoteCurrency); + var sqrtRatioX96 = sorted ? encodeSqrtRatioX96(price.numerator, price.denominator) : encodeSqrtRatioX96(price.denominator, price.numerator); + var tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96); + var nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1); + + if (sorted) { + if (!price.lessThan(nextTickPrice)) { + tick++; + } + } else { + if (!price.greaterThan(nextTickPrice)) { + tick++; + } + } + + return tick; +} + +var Tick = function Tick(_ref) { + var index = _ref.index, + liquidityGross = _ref.liquidityGross, + liquidityNet = _ref.liquidityNet; + !(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK') : invariant(false) : void 0; + this.index = index; + this.liquidityGross = JSBI.BigInt(liquidityGross); + this.liquidityNet = JSBI.BigInt(liquidityNet); +}; + +/** + * A data provider for ticks that is backed by an in-memory array of ticks. + */ + +var TickListDataProvider = /*#__PURE__*/function () { + function TickListDataProvider(ticks, tickSpacing) { + var ticksMapped = ticks.map(function (t) { + return t instanceof Tick ? t : new Tick(t); + }); + TickList.validateList(ticksMapped, tickSpacing); + this.ticks = ticksMapped; + } + + var _proto = TickListDataProvider.prototype; + + _proto.getTick = /*#__PURE__*/function () { + var _getTick = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(tick) { + return runtime_1.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", TickList.getTick(this.ticks, tick)); + + case 1: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getTick(_x) { + return _getTick.apply(this, arguments); + } + + return getTick; + }(); + + _proto.nextInitializedTickWithinOneWord = /*#__PURE__*/function () { + var _nextInitializedTickWithinOneWord = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(tick, lte, tickSpacing) { + return runtime_1.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function nextInitializedTickWithinOneWord(_x2, _x3, _x4) { + return _nextInitializedTickWithinOneWord.apply(this, arguments); + } + + return nextInitializedTickWithinOneWord; + }(); + + return TickListDataProvider; +}(); + +/** + * By default, pools will not allow operations that require ticks. + */ + +var NO_TICK_DATA_PROVIDER_DEFAULT = /*#__PURE__*/new NoTickDataProvider(); +/** + * Represents a V3 pool + */ + +var Pool = /*#__PURE__*/function () { + /** + * Construct a pool + * @param tokenA one of the tokens in the pool + * @param tokenB the other token in the pool + * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool + * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0 + * @param liquidity the current value of in range liquidity + * @param tickCurrent the current tick of the pool + * @param ticks the current state of the pool ticks or a data provider that can return tick data + */ + function Pool(tokenA, tokenB, fee, sqrtRatioX96, liquidity, tickCurrent, ticks) { + if (ticks === void 0) { + ticks = NO_TICK_DATA_PROVIDER_DEFAULT; + } + + !(Number.isInteger(fee) && fee < 1000000) ? process.env.NODE_ENV !== "production" ? invariant(false, 'FEE') : invariant(false) : void 0; + var tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent); + var nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1); + !(JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) && JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PRICE_BOUNDS') : invariant(false) : void 0; + + var _ref = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]; + + this.token0 = _ref[0]; + this.token1 = _ref[1]; + this.fee = fee; + this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96); + this.liquidity = JSBI.BigInt(liquidity); + this.tickCurrent = tickCurrent; + this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks; + } + + Pool.getAddress = function getAddress(tokenA, tokenB, fee) { + return computePoolAddress({ + factoryAddress: FACTORY_ADDRESS, + fee: fee, + tokenA: tokenA, + tokenB: tokenB + }); + } + /** + * Returns true if the token is either token0 or token1 + * @param token to check + */ + ; + + var _proto = Pool.prototype; + + _proto.involvesToken = function involvesToken(token) { + return token.equals(this.token0) || token.equals(this.token1); + } + /** + * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0 + */ + ; + + /** + * Return the price of the given token in terms of the other token in the pool. + * @param token token to return price of + */ + _proto.priceOf = function priceOf(token) { + !this.involvesToken(token) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + return token.equals(this.token0) ? this.token0Price : this.token1Price; + } + /** + * Returns the chain ID of the tokens in the pool. + */ + ; + + /** + * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade + * @param inputAmount the input amount for which to quote the output amount + */ + _proto.getOutputAmount = + /*#__PURE__*/ + function () { + var _getOutputAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(inputAmount, sqrtPriceLimitX96) { + var zeroForOne, _yield$this$swap, outputAmount, sqrtRatioX96, liquidity, tickCurrent, outputToken; + + return runtime_1.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + !this.involvesToken(inputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + zeroForOne = inputAmount.currency.equals(this.token0); + _context.next = 4; + return this.swap(zeroForOne, inputAmount.quotient, sqrtPriceLimitX96); + + case 4: + _yield$this$swap = _context.sent; + outputAmount = _yield$this$swap.amountCalculated; + sqrtRatioX96 = _yield$this$swap.sqrtRatioX96; + liquidity = _yield$this$swap.liquidity; + tickCurrent = _yield$this$swap.tickCurrent; + outputToken = zeroForOne ? this.token1 : this.token0; + return _context.abrupt("return", [CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)), new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)]); + + case 11: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getOutputAmount(_x, _x2) { + return _getOutputAmount.apply(this, arguments); + } + + return getOutputAmount; + }() + /** + * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade + * @param outputAmount the output amount for which to quote the input amount + */ + ; + + _proto.getInputAmount = + /*#__PURE__*/ + function () { + var _getInputAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(outputAmount, sqrtPriceLimitX96) { + var zeroForOne, _yield$this$swap2, inputAmount, sqrtRatioX96, liquidity, tickCurrent, inputToken; + + return runtime_1.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + !(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; + zeroForOne = outputAmount.currency.equals(this.token1); + _context2.next = 4; + return this.swap(zeroForOne, JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE), sqrtPriceLimitX96); + + case 4: + _yield$this$swap2 = _context2.sent; + inputAmount = _yield$this$swap2.amountCalculated; + sqrtRatioX96 = _yield$this$swap2.sqrtRatioX96; + liquidity = _yield$this$swap2.liquidity; + tickCurrent = _yield$this$swap2.tickCurrent; + inputToken = zeroForOne ? this.token0 : this.token1; + return _context2.abrupt("return", [CurrencyAmount.fromRawAmount(inputToken, inputAmount), new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)]); + + case 11: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function getInputAmount(_x3, _x4) { + return _getInputAmount.apply(this, arguments); + } + + return getInputAmount; + }(); + + _proto.swap = /*#__PURE__*/function () { + var _swap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(zeroForOne, amountSpecified, sqrtPriceLimitX96) { + var exactInput, state, step, _yield$this$tickDataP, _SwapMath$computeSwap, liquidityNet; + + return runtime_1.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!sqrtPriceLimitX96) sqrtPriceLimitX96 = zeroForOne ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE) : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE); + + if (zeroForOne) { + !JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RATIO_MIN') : invariant(false) : void 0; + !JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RATIO_CURRENT') : invariant(false) : void 0; + } else { + !JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RATIO_MAX') : invariant(false) : void 0; + !JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RATIO_CURRENT') : invariant(false) : void 0; + } + + exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO); // keep track of swap state + + state = { + amountSpecifiedRemaining: amountSpecified, + amountCalculated: ZERO, + sqrtPriceX96: this.sqrtRatioX96, + tick: this.tickCurrent, + liquidity: this.liquidity + }; // start swap while loop + + case 4: + if (!(JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96)) { + _context3.next = 35; + break; + } + + step = {}; + step.sqrtPriceStartX96 = state.sqrtPriceX96; + _context3.next = 9; + return this.tickDataProvider.nextInitializedTickWithinOneWord(state.tick, zeroForOne, this.tickSpacing); + + case 9: + _yield$this$tickDataP = _context3.sent; + step.tickNext = _yield$this$tickDataP[0]; + step.initialized = _yield$this$tickDataP[1]; + + if (step.tickNext < TickMath.MIN_TICK) { + step.tickNext = TickMath.MIN_TICK; + } else if (step.tickNext > TickMath.MAX_TICK) { + step.tickNext = TickMath.MAX_TICK; + } + + step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); + _SwapMath$computeSwap = SwapMath.computeSwapStep(state.sqrtPriceX96, (zeroForOne ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96) : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)) ? sqrtPriceLimitX96 : step.sqrtPriceNextX96, state.liquidity, state.amountSpecifiedRemaining, this.fee); + state.sqrtPriceX96 = _SwapMath$computeSwap[0]; + step.amountIn = _SwapMath$computeSwap[1]; + step.amountOut = _SwapMath$computeSwap[2]; + step.feeAmount = _SwapMath$computeSwap[3]; + + if (exactInput) { + state.amountSpecifiedRemaining = JSBI.subtract(state.amountSpecifiedRemaining, JSBI.add(step.amountIn, step.feeAmount)); + state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut); + } else { + state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut); + state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount)); + } // TODO + + + if (!JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) { + _context3.next = 32; + break; + } + + if (!step.initialized) { + _context3.next = 29; + break; + } + + _context3.t0 = JSBI; + _context3.next = 25; + return this.tickDataProvider.getTick(step.tickNext); + + case 25: + _context3.t1 = _context3.sent.liquidityNet; + liquidityNet = _context3.t0.BigInt.call(_context3.t0, _context3.t1); + // if we're moving leftward, we interpret liquidityNet as the opposite sign + // safe because liquidityNet cannot be type(int128).min + if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE); + state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet); + + case 29: + state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; + _context3.next = 33; + break; + + case 32: + if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { + // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved + state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); + } + + case 33: + _context3.next = 4; + break; + + case 35: + return _context3.abrupt("return", { + amountCalculated: state.amountCalculated, + sqrtRatioX96: state.sqrtPriceX96, + liquidity: state.liquidity, + tickCurrent: state.tick + }); + + case 36: + case "end": + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function swap(_x5, _x6, _x7) { + return _swap.apply(this, arguments); + } + + return swap; + }(); + + _createClass(Pool, [{ + key: "token0Price", + get: function get() { + var _this$_token0Price; + + return (_this$_token0Price = this._token0Price) != null ? _this$_token0Price : this._token0Price = new Price(this.token0, this.token1, Q192, JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)); + } + /** + * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1 + */ + + }, { + key: "token1Price", + get: function get() { + var _this$_token1Price; + + return (_this$_token1Price = this._token1Price) != null ? _this$_token1Price : this._token1Price = new Price(this.token1, this.token0, JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96), Q192); + } + }, { + key: "chainId", + get: function get() { + return this.token0.chainId; + } + }, { + key: "tickSpacing", + get: function get() { + return TICK_SPACINGS[this.fee]; + } + }]); + + return Pool; +}(); + +/** + * Represents a position on a Uniswap V3 Pool + */ + +var Position = /*#__PURE__*/function () { + /** + * Constructs a position for a given pool with the given liquidity + * @param pool for which pool the liquidity is assigned + * @param liquidity the amount of liquidity that is in the position + * @param tickLower the lower tick of the position + * @param tickUpper the upper tick of the position + */ + function Position(_ref) { + var pool = _ref.pool, + liquidity = _ref.liquidity, + tickLower = _ref.tickLower, + tickUpper = _ref.tickUpper; + // cached resuts for the getters + this._token0Amount = null; + this._token1Amount = null; + this._mintAmounts = null; + !(tickLower < tickUpper) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_ORDER') : invariant(false) : void 0; + !(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_LOWER') : invariant(false) : void 0; + !(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_UPPER') : invariant(false) : void 0; + this.pool = pool; + this.tickLower = tickLower; + this.tickUpper = tickUpper; + this.liquidity = JSBI.BigInt(liquidity); + } + /** + * Returns the price of token0 at the lower tick + */ + + + var _proto = Position.prototype; + + /** + * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage + * @param slippageTolerance amount by which the price can 'slip' + * @private + */ + _proto.ratiosAfterSlippage = function ratiosAfterSlippage(slippageTolerance) { + var priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance)); + var priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1)); + var sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator); + + if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) { + sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1)); + } + + var sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator); + + if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) { + sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1)); + } + + return { + sqrtRatioX96Lower: sqrtRatioX96Lower, + sqrtRatioX96Upper: sqrtRatioX96Upper + }; + } + /** + * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position + * with the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the current price + */ + ; + + _proto.mintAmountsWithSlippage = function mintAmountsWithSlippage(slippageTolerance) { + // get lower/upper prices + var _this$ratiosAfterSlip = this.ratiosAfterSlippage(slippageTolerance), + sqrtRatioX96Upper = _this$ratiosAfterSlip.sqrtRatioX96Upper, + sqrtRatioX96Lower = _this$ratiosAfterSlip.sqrtRatioX96Lower; // construct counterfactual pools + + + var poolLower = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Lower, 0 + /* liquidity doesn't matter */ + , TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)); + var poolUpper = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Upper, 0 + /* liquidity doesn't matter */ + , TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)); // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage) + + var positionThatWillBeCreated = Position.fromAmounts(_extends({ + pool: this.pool, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }, this.mintAmounts, { + useFullPrecision: false + })); // we want the smaller amounts... + // ...which occurs at the upper price for amount0... + + var amount0 = new Position({ + pool: poolUpper, + liquidity: positionThatWillBeCreated.liquidity, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }).mintAmounts.amount0; // ...and the lower for amount1 + + var amount1 = new Position({ + pool: poolLower, + liquidity: positionThatWillBeCreated.liquidity, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }).mintAmounts.amount1; + return { + amount0: amount0, + amount1: amount1 + }; + } + /** + * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the + * position with the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the current price + */ + ; + + _proto.burnAmountsWithSlippage = function burnAmountsWithSlippage(slippageTolerance) { + // get lower/upper prices + var _this$ratiosAfterSlip2 = this.ratiosAfterSlippage(slippageTolerance), + sqrtRatioX96Upper = _this$ratiosAfterSlip2.sqrtRatioX96Upper, + sqrtRatioX96Lower = _this$ratiosAfterSlip2.sqrtRatioX96Lower; // construct counterfactual pools + + + var poolLower = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Lower, 0 + /* liquidity doesn't matter */ + , TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)); + var poolUpper = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Upper, 0 + /* liquidity doesn't matter */ + , TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)); // we want the smaller amounts... + // ...which occurs at the upper price for amount0... + + var amount0 = new Position({ + pool: poolUpper, + liquidity: this.liquidity, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }).amount0; // ...and the lower for amount1 + + var amount1 = new Position({ + pool: poolLower, + liquidity: this.liquidity, + tickLower: this.tickLower, + tickUpper: this.tickUpper + }).amount1; + return { + amount0: amount0.quotient, + amount1: amount1.quotient + }; + } + /** + * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at + * the current price for the pool + */ + ; + + /** + * Computes the maximum amount of liquidity received for a given amount of token0, token1, + * and the prices at the tick boundaries. + * @param pool the pool for which the position should be created + * @param tickLower the lower tick of the position + * @param tickUpper the upper tick of the position + * @param amount0 token0 amount + * @param amount1 token1 amount + * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ + Position.fromAmounts = function fromAmounts(_ref2) { + var pool = _ref2.pool, + tickLower = _ref2.tickLower, + tickUpper = _ref2.tickUpper, + amount0 = _ref2.amount0, + amount1 = _ref2.amount1, + useFullPrecision = _ref2.useFullPrecision; + var sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower); + var sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper); + return new Position({ + pool: pool, + tickLower: tickLower, + tickUpper: tickUpper, + liquidity: maxLiquidityForAmounts(pool.sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1, useFullPrecision) + }); + } + /** + * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1 + * @param pool the pool for which the position is created + * @param tickLower the lower tick + * @param tickUpper the upper tick + * @param amount0 the desired amount of token0 + * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate, + * not what core can theoretically support + */ + ; + + Position.fromAmount0 = function fromAmount0(_ref3) { + var pool = _ref3.pool, + tickLower = _ref3.tickLower, + tickUpper = _ref3.tickUpper, + amount0 = _ref3.amount0, + useFullPrecision = _ref3.useFullPrecision; + return Position.fromAmounts({ + pool: pool, + tickLower: tickLower, + tickUpper: tickUpper, + amount0: amount0, + amount1: MaxUint256, + useFullPrecision: useFullPrecision + }); + } + /** + * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0 + * @param pool the pool for which the position is created + * @param tickLower the lower tick + * @param tickUpper the upper tick + * @param amount1 the desired amount of token1 + */ + ; + + Position.fromAmount1 = function fromAmount1(_ref4) { + var pool = _ref4.pool, + tickLower = _ref4.tickLower, + tickUpper = _ref4.tickUpper, + amount1 = _ref4.amount1; + // this function always uses full precision, + return Position.fromAmounts({ + pool: pool, + tickLower: tickLower, + tickUpper: tickUpper, + amount0: MaxUint256, + amount1: amount1, + useFullPrecision: true + }); + }; + + _createClass(Position, [{ + key: "token0PriceLower", + get: function get() { + return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower); + } + /** + * Returns the price of token0 at the upper tick + */ + + }, { + key: "token0PriceUpper", + get: function get() { + return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper); + } + /** + * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price + */ + + }, { + key: "amount0", + get: function get() { + if (this._token0Amount === null) { + if (this.pool.tickCurrent < this.tickLower) { + this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, SqrtPriceMath.getAmount0Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); + } else if (this.pool.tickCurrent < this.tickUpper) { + this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, SqrtPriceMath.getAmount0Delta(this.pool.sqrtRatioX96, TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); + } else { + this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO); + } + } + + return this._token0Amount; + } + /** + * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price + */ + + }, { + key: "amount1", + get: function get() { + if (this._token1Amount === null) { + if (this.pool.tickCurrent < this.tickLower) { + this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO); + } else if (this.pool.tickCurrent < this.tickUpper) { + this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), this.pool.sqrtRatioX96, this.liquidity, false)); + } else { + this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); + } + } + + return this._token1Amount; + } + }, { + key: "mintAmounts", + get: function get() { + if (this._mintAmounts === null) { + if (this.pool.tickCurrent < this.tickLower) { + return { + amount0: SqrtPriceMath.getAmount0Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true), + amount1: ZERO + }; + } else if (this.pool.tickCurrent < this.tickUpper) { + return { + amount0: SqrtPriceMath.getAmount0Delta(this.pool.sqrtRatioX96, TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true), + amount1: SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), this.pool.sqrtRatioX96, this.liquidity, true) + }; + } else { + return { + amount0: ZERO, + amount1: SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true) + }; + } + } + + return this._mintAmounts; + } + }]); + + return Position; +}(); + +/** + * Represents a list of pools through which a swap can occur + */ + +var Route = /*#__PURE__*/function () { + function Route(pools, input, output) { + this._midPrice = null; + !(pools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'POOLS') : invariant(false) : void 0; + var chainId = pools[0].chainId; + var allOnSameChain = pools.every(function (pool) { + return pool.chainId === chainId; + }); + !allOnSameChain ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_IDS') : invariant(false) : void 0; + var wrappedInput = wrappedCurrency(input, chainId); + !pools[0].involvesToken(wrappedInput) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT') : invariant(false) : void 0; + !pools[pools.length - 1].involvesToken(wrappedCurrency(output, chainId)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT') : invariant(false) : void 0; + /** + * Normalizes token0-token1 order and selects the next token/fee step to add to the path + * */ + + var tokenPath = [wrappedInput]; + + for (var _iterator = _createForOfIteratorHelperLoose(pools.entries()), _step; !(_step = _iterator()).done;) { + var _step$value = _step.value, + i = _step$value[0], + pool = _step$value[1]; + var currentInputToken = tokenPath[i]; + !(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PATH') : invariant(false) : void 0; + var nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0; + tokenPath.push(nextToken); + } + + this.pools = pools; + this.tokenPath = tokenPath; + this.input = input; + this.output = output != null ? output : tokenPath[tokenPath.length - 1]; + } + + _createClass(Route, [{ + key: "chainId", + get: function get() { + return this.pools[0].chainId; + } + /** + * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token. + */ + + }, { + key: "inputToken", + get: function get() { + return wrappedCurrency(this.input, this.chainId); + } + /** + * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token. + */ + + }, { + key: "outputToken", + get: function get() { + return wrappedCurrency(this.output, this.chainId); + } + /** + * Returns the mid price of the route + */ + + }, { + key: "midPrice", + get: function get() { + if (this._midPrice !== null) return this._midPrice; + var price = this.pools.slice(1).reduce(function (_ref, pool) { + var nextInput = _ref.nextInput, + price = _ref.price; + return nextInput.equals(pool.token0) ? { + nextInput: pool.token1, + price: price.multiply(pool.token0Price) + } : { + nextInput: pool.token0, + price: price.multiply(pool.token1Price) + }; + }, this.pools[0].token0.equals(this.inputToken) ? { + nextInput: this.pools[0].token1, + price: this.pools[0].token0Price + } : { + nextInput: this.pools[0].token0, + price: this.pools[0].token1Price + }).price; + return this._midPrice = new Price(this.input, this.output, price.denominator, price.numerator); + } + }]); + + return Route; +}(); + +function tradeComparator(a, b) { + // must have same input and output token for comparison + !currencyEquals(a.inputAmount.currency, b.inputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT_CURRENCY') : invariant(false) : void 0; + !currencyEquals(a.outputAmount.currency, b.outputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT_CURRENCY') : invariant(false) : void 0; + + if (a.outputAmount.equalTo(b.outputAmount)) { + if (a.inputAmount.equalTo(b.inputAmount)) { + // consider the number of hops since each hop costs gas + return a.route.tokenPath.length - b.route.tokenPath.length; + } // trade A requires less input than trade B, so A should come first + + + if (a.inputAmount.lessThan(b.inputAmount)) { + return -1; + } else { + return 1; + } + } else { + // tradeA has less output than trade B, so should come second + if (a.outputAmount.lessThan(b.outputAmount)) { + return 1; + } else { + return -1; + } + } +} +/** + * Represents a trade executed against a list of pools. + * Does not account for slippage, i.e. trades that front run this trade and move the price. + */ + +var Trade = /*#__PURE__*/function () { + /** + * Construct a trade by passing in the pre-computed property values + * @param route the route through which the trade occurs + * @param inputAmount the amount of input paid in the trade + * @param outputAmount the amount of output received in the trade + * @param tradeType the type of trade, exact input or exact output + */ + function Trade(_ref) { + var route = _ref.route, + inputAmount = _ref.inputAmount, + outputAmount = _ref.outputAmount, + tradeType = _ref.tradeType; + !currencyEquals(inputAmount.currency, route.input) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT_CURRENCY_MATCH') : invariant(false) : void 0; + !currencyEquals(outputAmount.currency, route.output) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT_CURRENCY_MATCH') : invariant(false) : void 0; + this.route = route; + this.inputAmount = inputAmount; + this.outputAmount = outputAmount; + this.tradeType = tradeType; + } + /** + * The price expressed in terms of output amount/input amount. + */ + + + /** + * Constructs an exact in trade with the given amount in and route + * @param route route of the exact in trade + * @param amountIn the amount being passed in + */ + Trade.exactIn = + /*#__PURE__*/ + function () { + var _exactIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(route, amountIn) { + return runtime_1.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", Trade.fromRoute(route, amountIn, TradeType.EXACT_INPUT)); + + case 1: + case "end": + return _context.stop(); + } + } + }, _callee); + })); + + function exactIn(_x, _x2) { + return _exactIn.apply(this, arguments); + } + + return exactIn; + }() + /** + * Constructs an exact out trade with the given amount out and route + * @param route route of the exact out trade + * @param amountOut the amount returned by the trade + */ + ; + + Trade.exactOut = + /*#__PURE__*/ + function () { + var _exactOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(route, amountOut) { + return runtime_1.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", Trade.fromRoute(route, amountOut, TradeType.EXACT_OUTPUT)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, _callee2); + })); + + function exactOut(_x3, _x4) { + return _exactOut.apply(this, arguments); + } + + return exactOut; + }() + /** + * Constructs a trade by simulating swaps through the given route + * @param route route to swap through + * @param amount the amount specified, either input or output, depending on tradeType + * @param tradeType whether the trade is an exact input or exact output swap + */ + ; + + Trade.fromRoute = + /*#__PURE__*/ + function () { + var _fromRoute = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(route, amount, tradeType) { + var amounts, inputAmount, outputAmount, i, pool, _yield$pool$getOutput, _outputAmount, _i, _pool, _yield$_pool$getInput, _inputAmount; + + return runtime_1.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + amounts = new Array(route.tokenPath.length); + + if (!(tradeType === TradeType.EXACT_INPUT)) { + _context3.next = 19; + break; + } + + !currencyEquals(amount.currency, route.input) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT') : invariant(false) : void 0; + amounts[0] = wrappedCurrencyAmount(amount, route.chainId); + i = 0; + + case 5: + if (!(i < route.tokenPath.length - 1)) { + _context3.next = 15; + break; + } + + pool = route.pools[i]; + _context3.next = 9; + return pool.getOutputAmount(amounts[i]); + + case 9: + _yield$pool$getOutput = _context3.sent; + _outputAmount = _yield$pool$getOutput[0]; + amounts[i + 1] = _outputAmount; + + case 12: + i++; + _context3.next = 5; + break; + + case 15: + inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator); + outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amounts[amounts.length - 1].numerator, amounts[amounts.length - 1].denominator); + _context3.next = 34; + break; + + case 19: + !currencyEquals(amount.currency, route.output) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT') : invariant(false) : void 0; + amounts[amounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId); + _i = route.tokenPath.length - 1; + + case 22: + if (!(_i > 0)) { + _context3.next = 32; + break; + } + + _pool = route.pools[_i - 1]; + _context3.next = 26; + return _pool.getInputAmount(amounts[_i]); + + case 26: + _yield$_pool$getInput = _context3.sent; + _inputAmount = _yield$_pool$getInput[0]; + amounts[_i - 1] = _inputAmount; + + case 29: + _i--; + _context3.next = 22; + break; + + case 32: + inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator); + outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator); + + case 34: + return _context3.abrupt("return", new Trade({ + route: route, + tradeType: tradeType, + inputAmount: inputAmount, + outputAmount: outputAmount + })); + + case 35: + case "end": + return _context3.stop(); + } + } + }, _callee3); + })); + + function fromRoute(_x5, _x6, _x7) { + return _fromRoute.apply(this, arguments); + } + + return fromRoute; + }() + /** + * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade + * elsewhere and do not have any tick data + * @param constructorArguments the arguments passed to the trade constructor + */ + ; + + Trade.createUncheckedTrade = function createUncheckedTrade(constructorArguments) { + return new Trade(constructorArguments); + } + /** + * Get the minimum amount that must be received from this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + ; + + var _proto = Trade.prototype; + + _proto.minimumAmountOut = function minimumAmountOut(slippageTolerance) { + !!slippageTolerance.lessThan(ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SLIPPAGE_TOLERANCE') : invariant(false) : void 0; + + if (this.tradeType === TradeType.EXACT_OUTPUT) { + return this.outputAmount; + } else { + var slippageAdjustedAmountOut = new Fraction(ONE).add(slippageTolerance).invert().multiply(this.outputAmount.quotient).quotient; + return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut); + } + } + /** + * Get the maximum amount in that can be spent via this trade for the given slippage tolerance + * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade + */ + ; + + _proto.maximumAmountIn = function maximumAmountIn(slippageTolerance) { + !!slippageTolerance.lessThan(ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SLIPPAGE_TOLERANCE') : invariant(false) : void 0; + + if (this.tradeType === TradeType.EXACT_INPUT) { + return this.inputAmount; + } else { + var slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient).quotient; + return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn); + } + } + /** + * Return the execution price after accounting for slippage tolerance + * @param slippageTolerance the allowed tolerated slippage + */ + ; + + _proto.worstExecutionPrice = function worstExecutionPrice(slippageTolerance) { + return new Price(this.inputAmount.currency, this.outputAmount.currency, this.maximumAmountIn(slippageTolerance).quotient, this.minimumAmountOut(slippageTolerance).quotient); + } + /** + * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token + * amount to an output token, making at most `maxHops` hops. + * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pools the pools to consider in finding the best trade + * @param nextAmountIn exact amount of input currency to spend + * @param currencyOut the desired currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool + * @param currentPools used in recursion; the current list of pools + * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter + * @param bestTrades used in recursion; the current list of best trades + */ + ; + + Trade.bestTradeExactIn = + /*#__PURE__*/ + function () { + var _bestTradeExactIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pools, currencyAmountIn, currencyOut, _temp, // used in recursion. + currentPools, nextAmountIn, bestTrades) { + var _ref2, _ref2$maxNumResults, maxNumResults, _ref2$maxHops, maxHops, chainId, amountIn, tokenOut, i, pool, amountOut, _yield$pool$getOutput2, poolsExcludingThisPool; + + return runtime_1.wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + _ref2 = _temp === void 0 ? {} : _temp, _ref2$maxNumResults = _ref2.maxNumResults, maxNumResults = _ref2$maxNumResults === void 0 ? 3 : _ref2$maxNumResults, _ref2$maxHops = _ref2.maxHops, maxHops = _ref2$maxHops === void 0 ? 3 : _ref2$maxHops; + + if (currentPools === void 0) { + currentPools = []; + } + + if (nextAmountIn === void 0) { + nextAmountIn = currencyAmountIn; + } + + if (bestTrades === void 0) { + bestTrades = []; + } + + !(pools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'POOLS') : invariant(false) : void 0; + !(maxHops > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_HOPS') : invariant(false) : void 0; + !(currencyAmountIn === nextAmountIn || currentPools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INVALID_RECURSION') : invariant(false) : void 0; + chainId = nextAmountIn.currency.isToken ? nextAmountIn.currency.chainId : currencyOut.isToken ? currencyOut.chainId : undefined; + !(chainId !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; + amountIn = wrappedCurrencyAmount(nextAmountIn, chainId); + tokenOut = wrappedCurrency(currencyOut, chainId); + i = 0; + + case 12: + if (!(i < pools.length)) { + _context4.next = 48; + break; + } + + pool = pools[i]; // pool irrelevant + + if (!(!currencyEquals(pool.token0, amountIn.currency) && !currencyEquals(pool.token1, amountIn.currency))) { + _context4.next = 16; + break; + } + + return _context4.abrupt("continue", 45); + + case 16: + amountOut = void 0; + _context4.prev = 17; + _context4.next = 21; + return pool.getOutputAmount(amountIn); + + case 21: + _yield$pool$getOutput2 = _context4.sent; + amountOut = _yield$pool$getOutput2[0]; + _context4.next = 30; + break; + + case 25: + _context4.prev = 25; + _context4.t0 = _context4["catch"](17); + + if (!_context4.t0.isInsufficientInputAmountError) { + _context4.next = 29; + break; + } + + return _context4.abrupt("continue", 45); + + case 29: + throw _context4.t0; + + case 30: + if (!(amountOut.currency.isToken && amountOut.currency.equals(tokenOut))) { + _context4.next = 41; + break; + } + + _context4.t1 = sortedInsert; + _context4.t2 = bestTrades; + _context4.next = 35; + return Trade.fromRoute(new Route([].concat(currentPools, [pool]), currencyAmountIn.currency, currencyOut), currencyAmountIn, TradeType.EXACT_INPUT); + + case 35: + _context4.t3 = _context4.sent; + _context4.t4 = maxNumResults; + _context4.t5 = tradeComparator; + (0, _context4.t1)(_context4.t2, _context4.t3, _context4.t4, _context4.t5); + _context4.next = 45; + break; + + case 41: + if (!(maxHops > 1 && pools.length > 1)) { + _context4.next = 45; + break; + } + + poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length)); // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops + + _context4.next = 45; + return Trade.bestTradeExactIn(poolsExcludingThisPool, currencyAmountIn, currencyOut, { + maxNumResults: maxNumResults, + maxHops: maxHops - 1 + }, [].concat(currentPools, [pool]), amountOut, bestTrades); + + case 45: + i++; + _context4.next = 12; + break; + + case 48: + return _context4.abrupt("return", bestTrades); + + case 49: + case "end": + return _context4.stop(); + } + } + }, _callee4, null, [[17, 25]]); + })); + + function bestTradeExactIn(_x8, _x9, _x10, _x11, _x12, _x13, _x14) { + return _bestTradeExactIn.apply(this, arguments); + } + + return bestTradeExactIn; + }() + /** + * similar to the above method but instead targets a fixed output amount + * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token + * to an output token amount, making at most `maxHops` hops + * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting + * the amount in among multiple routes. + * @param pools the pools to consider in finding the best trade + * @param currencyIn the currency to spend + * @param currencyAmountOut the desired currency amount out + * @param nextAmountOut the exact amount of currency out + * @param maxNumResults maximum number of results to return + * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool + * @param currentPools used in recursion; the current list of pools + * @param bestTrades used in recursion; the current list of best trades + */ + ; + + Trade.bestTradeExactOut = + /*#__PURE__*/ + function () { + var _bestTradeExactOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pools, currencyIn, currencyAmountOut, _temp2, // used in recursion. + currentPools, nextAmountOut, bestTrades) { + var _ref3, _ref3$maxNumResults, maxNumResults, _ref3$maxHops, maxHops, chainId, amountOut, tokenIn, i, pool, amountIn, _yield$pool$getInputA, poolsExcludingThisPool; + + return runtime_1.wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _ref3 = _temp2 === void 0 ? {} : _temp2, _ref3$maxNumResults = _ref3.maxNumResults, maxNumResults = _ref3$maxNumResults === void 0 ? 3 : _ref3$maxNumResults, _ref3$maxHops = _ref3.maxHops, maxHops = _ref3$maxHops === void 0 ? 3 : _ref3$maxHops; + + if (currentPools === void 0) { + currentPools = []; + } + + if (nextAmountOut === void 0) { + nextAmountOut = currencyAmountOut; + } + + if (bestTrades === void 0) { + bestTrades = []; + } + + !(pools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'POOLS') : invariant(false) : void 0; + !(maxHops > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_HOPS') : invariant(false) : void 0; + !(currencyAmountOut === nextAmountOut || currentPools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INVALID_RECURSION') : invariant(false) : void 0; + chainId = nextAmountOut.currency.isToken ? nextAmountOut.currency.chainId : currencyIn.isToken ? currencyIn.chainId : undefined; + !(chainId !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; + amountOut = wrappedCurrencyAmount(nextAmountOut, chainId); + tokenIn = wrappedCurrency(currencyIn, chainId); + i = 0; + + case 12: + if (!(i < pools.length)) { + _context5.next = 48; + break; + } + + pool = pools[i]; // pool irrelevant + + if (!(!currencyEquals(pool.token0, amountOut.currency) && !currencyEquals(pool.token1, amountOut.currency))) { + _context5.next = 16; + break; + } + + return _context5.abrupt("continue", 45); + + case 16: + amountIn = void 0; + _context5.prev = 17; + _context5.next = 21; + return pool.getInputAmount(amountOut); + + case 21: + _yield$pool$getInputA = _context5.sent; + amountIn = _yield$pool$getInputA[0]; + _context5.next = 30; + break; + + case 25: + _context5.prev = 25; + _context5.t0 = _context5["catch"](17); + + if (!_context5.t0.isInsufficientReservesError) { + _context5.next = 29; + break; + } + + return _context5.abrupt("continue", 45); + + case 29: + throw _context5.t0; + + case 30: + if (!currencyEquals(amountIn.currency, tokenIn)) { + _context5.next = 41; + break; + } + + _context5.t1 = sortedInsert; + _context5.t2 = bestTrades; + _context5.next = 35; + return Trade.fromRoute(new Route([pool].concat(currentPools), currencyIn, currencyAmountOut.currency), currencyAmountOut, TradeType.EXACT_OUTPUT); + + case 35: + _context5.t3 = _context5.sent; + _context5.t4 = maxNumResults; + _context5.t5 = tradeComparator; + (0, _context5.t1)(_context5.t2, _context5.t3, _context5.t4, _context5.t5); + _context5.next = 45; + break; + + case 41: + if (!(maxHops > 1 && pools.length > 1)) { + _context5.next = 45; + break; + } + + poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length)); // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops + + _context5.next = 45; + return Trade.bestTradeExactOut(poolsExcludingThisPool, currencyIn, currencyAmountOut, { + maxNumResults: maxNumResults, + maxHops: maxHops - 1 + }, [pool].concat(currentPools), amountIn, bestTrades); + + case 45: + i++; + _context5.next = 12; + break; + + case 48: + return _context5.abrupt("return", bestTrades); + + case 49: + case "end": + return _context5.stop(); + } + } + }, _callee5, null, [[17, 25]]); + })); + + function bestTradeExactOut(_x15, _x16, _x17, _x18, _x19, _x20, _x21) { + return _bestTradeExactOut.apply(this, arguments); + } + + return bestTradeExactOut; + }(); + + _createClass(Trade, [{ + key: "executionPrice", + get: function get() { + var _this$_executionPrice; + + return (_this$_executionPrice = this._executionPrice) != null ? _this$_executionPrice : this._executionPrice = new Price(this.inputAmount.currency, this.outputAmount.currency, this.inputAmount.quotient, this.outputAmount.quotient); + } + /** + * Returns the percent difference between the route's mid price and the price impact + */ + + }, { + key: "priceImpact", + get: function get() { + var _this$_priceImpact; + + return (_this$_priceImpact = this._priceImpact) != null ? _this$_priceImpact : this._priceImpact = computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount); + } + }]); + + return Trade; +}(); + +function isAllowedPermit(permitOptions) { + return 'nonce' in permitOptions; +} + +var SelfPermit = /*#__PURE__*/function () { + function SelfPermit() {} + + SelfPermit.encodePermit = function encodePermit(token, options) { + return isAllowedPermit(options) ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [token.address, toHex(options.nonce), toHex(options.expiry), options.v, options.r, options.s]) : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [token.address, toHex(options.amount), toHex(options.deadline), options.v, options.r, options.s]); + }; + + return SelfPermit; +}(); +SelfPermit.INTERFACE = /*#__PURE__*/new Interface(abi); + +var MaxUint128 = /*#__PURE__*/toHex( /*#__PURE__*/JSBI.subtract( /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(128)), /*#__PURE__*/JSBI.BigInt(1))); // type guard + +function isMint(options) { + return Object.keys(options).some(function (k) { + return k === 'recipient'; + }); +} + +var NonfungiblePositionManager = /*#__PURE__*/function (_SelfPermit) { + _inheritsLoose(NonfungiblePositionManager, _SelfPermit); + + /** + * Cannot be constructed. + */ + function NonfungiblePositionManager() { + return _SelfPermit.call(this) || this; + } + + NonfungiblePositionManager.addCallParameters = function addCallParameters(position, options) { + !JSBI.greaterThan(position.liquidity, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO_LIQUIDITY') : invariant(false) : void 0; + var calldatas = []; // get amounts + + var _position$mintAmounts = position.mintAmounts, + amount0Desired = _position$mintAmounts.amount0, + amount1Desired = _position$mintAmounts.amount1; // adjust for slippage + + var minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance); + var amount0Min = toHex(minimumAmounts.amount0); + var amount1Min = toHex(minimumAmounts.amount1); + var deadline = toHex(options.deadline); // create pool if needed + + if (isMint(options) && options.createPool) { + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [position.pool.token0.address, position.pool.token1.address, position.pool.fee, toHex(position.pool.sqrtRatioX96)])); + } // permits if necessary + + + if (options.token0Permit) { + calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit)); + } + + if (options.token1Permit) { + calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit)); + } // mint + + + if (isMint(options)) { + var recipient = validateAndParseAddress(options.recipient); + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [{ + token0: position.pool.token0.address, + token1: position.pool.token1.address, + fee: position.pool.fee, + tickLower: position.tickLower, + tickUpper: position.tickUpper, + amount0Desired: toHex(amount0Desired), + amount1Desired: toHex(amount1Desired), + amount0Min: amount0Min, + amount1Min: amount1Min, + recipient: recipient, + deadline: deadline + }])); + } else { + // increase + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [{ + tokenId: toHex(options.tokenId), + amount0Desired: toHex(amount0Desired), + amount1Desired: toHex(amount1Desired), + amount0Min: amount0Min, + amount1Min: amount1Min, + deadline: deadline + }])); + } + + var value = toHex(0); + + if (options.useEther) { + var weth = WETH9[position.pool.chainId]; + !(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth))) ? process.env.NODE_ENV !== "production" ? invariant(false, 'NO_WETH') : invariant(false) : void 0; + var wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired; // we only need to refund if we're actually sending ETH + + if (JSBI.greaterThan(wethValue, ZERO)) { + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH')); + } + + value = toHex(wethValue); + } + + return { + calldata: calldatas.length === 1 ? calldatas[0] : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), + value: value + }; + }; + + NonfungiblePositionManager.encodeCollect = function encodeCollect(options) { + var calldatas = []; + var tokenId = toHex(options.tokenId); + var involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther; + var recipient = validateAndParseAddress(options.recipient); // collect + + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [{ + tokenId: tokenId, + recipient: involvesETH ? ADDRESS_ZERO : recipient, + amount0Max: MaxUint128, + amount1Max: MaxUint128 + }])); + + if (involvesETH) { + var ethAmount = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed0.quotient : options.expectedCurrencyOwed1.quotient; + var token = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed1.currency : options.expectedCurrencyOwed0.currency; + var tokenAmount = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed1.quotient : options.expectedCurrencyOwed0.quotient; + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])); + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [token.address, toHex(tokenAmount), recipient])); + } + + return calldatas; + }; + + NonfungiblePositionManager.collectCallParameters = function collectCallParameters(options) { + var calldatas = NonfungiblePositionManager.encodeCollect(options); + return { + calldata: calldatas.length === 1 ? calldatas[0] : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), + value: toHex(0) + }; + } + /** + * Produces the calldata for completely or partially exiting a position + * @param position the position to exit + * @param options additional information necessary for generating the calldata + */ + ; + + NonfungiblePositionManager.removeCallParameters = function removeCallParameters(position, options) { + var calldatas = []; + var deadline = toHex(options.deadline); + var tokenId = toHex(options.tokenId); // construct a partial position with a percentage of liquidity + + var partialPosition = new Position({ + pool: position.pool, + liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient, + tickLower: position.tickLower, + tickUpper: position.tickUpper + }); + !JSBI.greaterThan(partialPosition.liquidity, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO_LIQUIDITY') : invariant(false) : void 0; // slippage-adjusted underlying amounts + + var _partialPosition$burn = partialPosition.burnAmountsWithSlippage(options.slippageTolerance), + amount0Min = _partialPosition$burn.amount0, + amount1Min = _partialPosition$burn.amount1; + + if (options.permit) { + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [validateAndParseAddress(options.permit.spender), tokenId, toHex(options.permit.deadline), options.permit.v, options.permit.r, options.permit.s])); + } // remove liquidity + + + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [{ + tokenId: tokenId, + liquidity: toHex(partialPosition.liquidity), + amount0Min: toHex(amount0Min), + amount1Min: toHex(amount1Min), + deadline: deadline + }])); + + var _options$collectOptio = options.collectOptions, + expectedCurrencyOwed0 = _options$collectOptio.expectedCurrencyOwed0, + expectedCurrencyOwed1 = _options$collectOptio.expectedCurrencyOwed1, + rest = _objectWithoutPropertiesLoose(_options$collectOptio, ["expectedCurrencyOwed0", "expectedCurrencyOwed1"]); + + calldatas.push.apply(calldatas, NonfungiblePositionManager.encodeCollect(_extends({ + tokenId: options.tokenId, + // add the underlying value to the expected currency already owed + expectedCurrencyOwed0: expectedCurrencyOwed0.add(expectedCurrencyOwed0.currency.isEther ? CurrencyAmount.ether(amount0Min) : CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency, amount0Min)), + expectedCurrencyOwed1: expectedCurrencyOwed1.add(expectedCurrencyOwed1.currency.isEther ? CurrencyAmount.ether(amount1Min) : CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency, amount1Min)) + }, rest))); + + if (options.liquidityPercentage.equalTo(ONE)) { + if (options.burnToken) { + calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId])); + } + } else { + !(options.burnToken !== true) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CANNOT_BURN') : invariant(false) : void 0; + } + + return { + calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), + value: toHex(0) + }; + }; + + return NonfungiblePositionManager; +}(SelfPermit); +NonfungiblePositionManager.INTERFACE = /*#__PURE__*/new Interface(abi$1); + +/** + * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades. + */ + +var SwapRouter = /*#__PURE__*/function (_SelfPermit) { + _inheritsLoose(SwapRouter, _SelfPermit); + + /** + * Cannot be constructed. + */ + function SwapRouter() { + return _SelfPermit.call(this) || this; + } + /** + * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. + * @param trade to produce call parameters for + * @param options options for the call parameters + */ + + + SwapRouter.swapCallParameters = function swapCallParameters(trade, options) { + var calldatas = []; // encode permit if necessary + + if (options.inputTokenPermit) { + !trade.inputAmount.currency.isToken ? process.env.NODE_ENV !== "production" ? invariant(false, 'NON_TOKEN_PERMIT') : invariant(false) : void 0; + calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit)); + } + + var recipient = validateAndParseAddress(options.recipient); + var deadline = toHex(options.deadline); + var amountIn = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient); + var amountOut = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient); + var value = trade.inputAmount.currency.isEther ? amountIn : toHex(0); // flag for whether the trade is single hop or not + + var singleHop = trade.route.pools.length === 1; // flag for whether a refund needs to happen + + var mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === TradeType.EXACT_OUTPUT; // flags for whether funds should be send first to the router + + var outputIsEther = trade.outputAmount.currency.isEther; + var routerMustCustody = outputIsEther || !!options.fee; + + if (singleHop) { + if (trade.tradeType === TradeType.EXACT_INPUT) { + var _options$sqrtPriceLim; + + var exactInputSingleParams = { + tokenIn: trade.route.tokenPath[0].address, + tokenOut: trade.route.tokenPath[1].address, + fee: trade.route.pools[0].fee, + recipient: routerMustCustody ? ADDRESS_ZERO : recipient, + deadline: deadline, + amountIn: amountIn, + amountOutMinimum: amountOut, + sqrtPriceLimitX96: toHex((_options$sqrtPriceLim = options.sqrtPriceLimitX96) != null ? _options$sqrtPriceLim : 0) + }; + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams])); + } else { + var _options$sqrtPriceLim2; + + var exactOutputSingleParams = { + tokenIn: trade.route.tokenPath[0].address, + tokenOut: trade.route.tokenPath[1].address, + fee: trade.route.pools[0].fee, + recipient: routerMustCustody ? ADDRESS_ZERO : recipient, + deadline: deadline, + amountOut: amountOut, + amountInMaximum: amountIn, + sqrtPriceLimitX96: toHex((_options$sqrtPriceLim2 = options.sqrtPriceLimitX96) != null ? _options$sqrtPriceLim2 : 0) + }; + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams])); + } + } else { + !(options.sqrtPriceLimitX96 === undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MULTIHOP_PRICE_LIMIT') : invariant(false) : void 0; + var path = encodeRouteToPath(trade.route, trade.tradeType === TradeType.EXACT_OUTPUT); + + if (trade.tradeType === TradeType.EXACT_INPUT) { + var exactInputParams = { + path: path, + recipient: routerMustCustody ? ADDRESS_ZERO : recipient, + deadline: deadline, + amountIn: amountIn, + amountOutMinimum: amountOut + }; + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams])); + } else { + var exactOutputParams = { + path: path, + recipient: routerMustCustody ? ADDRESS_ZERO : recipient, + deadline: deadline, + amountOut: amountOut, + amountInMaximum: amountIn + }; + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams])); + } + } // refund + + + if (mustRefund) { + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH')); + } // unwrap + + + if (routerMustCustody) { + if (!!options.fee) { + var feeRecipient = validateAndParseAddress(options.fee.recipient); + var fee = toHex(options.fee.fee.multiply(10000).quotient); + + if (outputIsEther) { + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])); + } else { + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [trade.route.tokenPath[trade.route.tokenPath.length - 1].address, amountOut, recipient, fee, feeRecipient])); + } + } else { + calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient])); + } + } + + return { + calldata: calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]), + value: value + }; + }; + + return SwapRouter; +}(SelfPermit); +SwapRouter.INTERFACE = /*#__PURE__*/new Interface(abi$2); + +export { ADDRESS_ZERO, FACTORY_ADDRESS, FeeAmount, FullMath, LiquidityMath, NoTickDataProvider, NonfungiblePositionManager, POOL_INIT_CODE_HASH, Pool, Position, Route, SqrtPriceMath, SwapRouter, TICK_SPACINGS, Tick, TickList, TickListDataProvider, TickMath, Trade, computePoolAddress, encodeRouteToPath, encodeSqrtRatioX96, isSorted, maxLiquidityForAmounts, mostSignificantBit, nearestUsableTick, priceToClosestTick, tickToPrice, toHex, tradeComparator }; +//# sourceMappingURL=v3-sdk.esm.js.map diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js.map b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js.map new file mode 100644 index 00000000000..5025579bdc8 --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v3-sdk.esm.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/constants.ts","../src/internalConstants.ts","../src/utils/computePoolAddress.ts","../src/utils/liquidityMath.ts","../src/utils/fullMath.ts","../src/utils/sqrtPriceMath.ts","../src/utils/swapMath.ts","../src/utils/mostSignificantBit.ts","../src/utils/tickMath.ts","../src/entities/tickDataProvider.ts","../src/utils/isSorted.ts","../src/utils/tickList.ts","../src/utils/calldata.ts","../src/utils/encodeRouteToPath.ts","../src/utils/encodeSqrtRatioX96.ts","../src/utils/maxLiquidityForAmounts.ts","../src/utils/nearestUsableTick.ts","../src/utils/priceTickConversions.ts","../src/entities/tick.ts","../src/entities/tickListDataProvider.ts","../src/entities/pool.ts","../src/entities/position.ts","../src/entities/route.ts","../src/entities/trade.ts","../src/selfPermit.ts","../src/nonfungiblePositionManager.ts","../src/swapRouter.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","export const FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'\n\nexport const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'\n\nexport const POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'\n\n/**\n * The default factory enabled fee amounts, denominated in hundredths of bips.\n */\nexport enum FeeAmount {\n LOW = 500,\n MEDIUM = 3000,\n HIGH = 10000\n}\n\n/**\n * The default factory tick spacings by fee amount.\n */\nexport const TICK_SPACINGS: { [amount in FeeAmount]: number } = {\n [FeeAmount.LOW]: 10,\n [FeeAmount.MEDIUM]: 60,\n [FeeAmount.HIGH]: 200\n}\n","import JSBI from 'jsbi'\n\n// constants used internally but not expected to be used externally\nexport const NEGATIVE_ONE = JSBI.BigInt(-1)\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\n\n// used in liquidity amount math\nexport const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96))\nexport const Q192 = JSBI.exponentiate(Q96, JSBI.BigInt(2))\n","import { defaultAbiCoder } from '@ethersproject/abi'\nimport { getCreate2Address } from '@ethersproject/address'\nimport { keccak256 } from '@ethersproject/solidity'\nimport { Token } from '@uniswap/sdk-core'\nimport { FeeAmount, POOL_INIT_CODE_HASH } from '../constants'\n\nexport function computePoolAddress({\n factoryAddress,\n tokenA,\n tokenB,\n fee\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n fee: FeeAmount\n}): string {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(\n ['bytes'],\n [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]\n ),\n POOL_INIT_CODE_HASH\n )\n}\n","import JSBI from 'jsbi'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\n\nexport abstract class LiquidityMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static addDelta(x: JSBI, y: JSBI): JSBI {\n if (JSBI.lessThan(y, ZERO)) {\n return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE))\n } else {\n return JSBI.add(x, y)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { ONE, ZERO } from '../internalConstants'\n\nexport abstract class FullMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI {\n const product = JSBI.multiply(a, b)\n let result = JSBI.divide(product, denominator)\n if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE)\n return result\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO, Q96 } from '../internalConstants'\nimport { FullMath } from './fullMath'\n\nconst MaxUint160 = JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(160)), ONE)\n\nfunction multiplyIn256(x: JSBI, y: JSBI): JSBI {\n const product = JSBI.multiply(x, y)\n return JSBI.bitwiseAnd(product, MaxUint256)\n}\n\nfunction addIn256(x: JSBI, y: JSBI): JSBI {\n const sum = JSBI.add(x, y)\n return JSBI.bitwiseAnd(sum, MaxUint256)\n}\n\nexport abstract class SqrtPriceMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n const numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)\n\n return roundUp\n ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96)\n : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96)\n }\n\n public static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n return roundUp\n ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96)\n : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96)\n }\n\n public static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)\n : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true)\n }\n\n public static getNextSqrtPriceFromOutput(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amountOut: JSBI,\n zeroForOne: boolean\n ): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)\n : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false)\n }\n\n private static getNextSqrtPriceFromAmount0RoundingUp(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (JSBI.equal(amount, ZERO)) return sqrtPX96\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n\n if (add) {\n let product = multiplyIn256(amount, sqrtPX96)\n if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) {\n const denominator = addIn256(numerator1, product)\n if (JSBI.greaterThanOrEqual(denominator, numerator1)) {\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount))\n } else {\n let product = multiplyIn256(amount, sqrtPX96)\n\n invariant(JSBI.equal(JSBI.divide(product, amount), sqrtPX96))\n invariant(JSBI.greaterThan(numerator1, product))\n const denominator = JSBI.subtract(numerator1, product)\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n private static getNextSqrtPriceFromAmount1RoundingDown(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (add) {\n const quotient = JSBI.lessThanOrEqual(amount, MaxUint160)\n ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity)\n : JSBI.divide(JSBI.multiply(amount, Q96), liquidity)\n\n return JSBI.add(sqrtPX96, quotient)\n } else {\n const quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity)\n\n invariant(JSBI.greaterThan(sqrtPX96, quotient))\n return JSBI.subtract(sqrtPX96, quotient)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { FeeAmount } from '../constants'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\nimport { FullMath } from './fullMath'\nimport { SqrtPriceMath } from './sqrtPriceMath'\n\nconst MAX_FEE = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(6))\n\nexport abstract class SwapMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static computeSwapStep(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioTargetX96: JSBI,\n liquidity: JSBI,\n amountRemaining: JSBI,\n feePips: FeeAmount\n ): [JSBI, JSBI, JSBI, JSBI] {\n const returnValues: Partial<{\n sqrtRatioNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n }> = {}\n\n const zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96)\n const exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO)\n\n if (exactIn) {\n const amountRemainingLessFee = JSBI.divide(\n JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))),\n MAX_FEE\n )\n returnValues.amountIn = zeroForOne\n ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true)\n if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn!)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(\n sqrtRatioCurrentX96,\n liquidity,\n amountRemainingLessFee,\n zeroForOne\n )\n }\n } else {\n returnValues.amountOut = zeroForOne\n ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false)\n if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(\n sqrtRatioCurrentX96,\n liquidity,\n JSBI.multiply(amountRemaining, NEGATIVE_ONE),\n zeroForOne\n )\n }\n }\n\n const max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96)\n\n if (zeroForOne) {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false)\n } else {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false)\n }\n\n if (!exactIn && JSBI.greaterThan(returnValues.amountOut!, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) {\n returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE)\n }\n\n if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) {\n // we didn't reach the target, so take the remainder of the maximum input as fee\n returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn!)\n } else {\n returnValues.feeAmount = FullMath.mulDivRoundingUp(\n returnValues.amountIn!,\n JSBI.BigInt(feePips),\n JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))\n )\n }\n\n return [returnValues.sqrtRatioNextX96!, returnValues.amountIn!, returnValues.amountOut!, returnValues.feeAmount!]\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\n\nconst TWO = JSBI.BigInt(2)\nconst POWERS_OF_2 = [128, 64, 32, 16, 8, 4, 2, 1].map((pow: number): [number, JSBI] => [\n pow,\n JSBI.exponentiate(TWO, JSBI.BigInt(pow))\n])\n\nexport function mostSignificantBit(x: JSBI): number {\n invariant(JSBI.greaterThan(x, ZERO), 'ZERO')\n invariant(JSBI.lessThanOrEqual(x, MaxUint256), 'MAX')\n\n let msb: number = 0\n for (const [power, min] of POWERS_OF_2) {\n if (JSBI.greaterThanOrEqual(x, min)) {\n x = JSBI.signedRightShift(x, JSBI.BigInt(power))\n msb += power\n }\n }\n return msb\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { mostSignificantBit } from './mostSignificantBit'\n\nfunction mulShift(val: JSBI, mulBy: string): JSBI {\n return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128))\n}\n\nconst Q32 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(32))\n\nexport abstract class TickMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n /**\n * The minimum tick that can be used on any pool.\n */\n public static MIN_TICK: number = -887272\n /**\n * The maximum tick that can be used on any pool.\n */\n public static MAX_TICK: number = -TickMath.MIN_TICK\n\n /**\n * The sqrt ratio corresponding to the minimum tick that could be used on any pool.\n */\n public static MIN_SQRT_RATIO: JSBI = JSBI.BigInt('4295128739')\n /**\n * The sqrt ratio corresponding to the maximum tick that could be used on any pool.\n */\n public static MAX_SQRT_RATIO: JSBI = JSBI.BigInt('1461446703485210103287273052203988822378723970342')\n\n /**\n * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick\n * @param tick the tick for which to compute the sqrt ratio\n */\n public static getSqrtRatioAtTick(tick: number): JSBI {\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick), 'TICK')\n const absTick: number = tick < 0 ? tick * -1 : tick\n\n let ratio: JSBI =\n (absTick & 0x1) != 0\n ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001')\n : JSBI.BigInt('0x100000000000000000000000000000000')\n if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a')\n if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc')\n if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0')\n if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644')\n if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0')\n if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861')\n if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053')\n if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4')\n if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54')\n if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3')\n if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9')\n if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825')\n if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5')\n if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7')\n if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6')\n if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9')\n if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604')\n if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98')\n if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2')\n\n if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio)\n\n // back to Q96\n return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO)\n ? JSBI.add(JSBI.divide(ratio, Q32), ONE)\n : JSBI.divide(ratio, Q32)\n }\n\n /**\n * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96\n * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96\n * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick\n */\n public static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number {\n invariant(\n JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) &&\n JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO),\n 'SQRT_RATIO'\n )\n\n const sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32))\n\n const msb = mostSignificantBit(sqrtRatioX128)\n\n let r: JSBI\n if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) {\n r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127))\n } else {\n r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb))\n }\n\n let log_2: JSBI = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64))\n\n for (let i = 0; i < 14; i++) {\n r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127))\n const f = JSBI.signedRightShift(r, JSBI.BigInt(128))\n log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i)))\n r = JSBI.signedRightShift(r, f)\n }\n\n const log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141'))\n\n const tickLow = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')),\n JSBI.BigInt(128)\n )\n )\n const tickHigh = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')),\n JSBI.BigInt(128)\n )\n )\n\n return tickLow === tickHigh\n ? tickLow\n : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96)\n ? tickHigh\n : tickLow\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\n\n/**\n * Provides information about ticks\n */\nexport interface TickDataProvider {\n /**\n * Return information corresponding to a specific tick\n * @param tick the tick to load\n */\n getTick(tick: number): Promise<{ liquidityNet: BigintIsh }>\n\n /**\n * Return the next tick that is initialized within a single word\n * @param tick the current tick\n * @param lte whether the next tick should be lte the current tick\n * @param tickSpacing the tick spacing of the pool\n */\n nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>\n}\n\n/**\n * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you\n * do not need to load tick data for your use case.\n */\nexport class NoTickDataProvider implements TickDataProvider {\n private static ERROR_MESSAGE = 'No tick data provider was given'\n async getTick(_tick: number): Promise<{ liquidityNet: BigintIsh }> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n\n async nextInitializedTickWithinOneWord(\n _tick: number,\n _lte: boolean,\n _tickSpacing: number\n ): Promise<[number, boolean]> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n}\n","export function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean {\n for (let i = 0; i < list.length - 1; i++) {\n if (comparator(list[i], list[i + 1]) > 0) {\n return false\n }\n }\n return true\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { isSorted } from './isSorted'\nimport { Tick } from '../entities/tick'\n\nfunction tickComparator(a: Tick, b: Tick) {\n return a.index - b.index\n}\n\n/**\n * Utility methods for interacting with sorted lists of ticks\n */\nexport abstract class TickList {\n /**\n * Cannot be constructed\n */\n private constructor() {}\n\n public static validateList(ticks: Tick[], tickSpacing: number) {\n invariant(tickSpacing > 0, 'TICK_SPACING_NONZERO')\n // ensure ticks are spaced appropriately\n invariant(\n ticks.every(({ index }) => index % tickSpacing === 0),\n 'TICK_SPACING'\n )\n\n // ensure tick liquidity deltas sum to 0\n invariant(\n JSBI.equal(\n ticks.reduce((accumulator, { liquidityNet }) => JSBI.add(accumulator, liquidityNet), ZERO),\n ZERO\n ),\n 'ZERO_NET'\n )\n\n invariant(isSorted(ticks, tickComparator), 'SORTED')\n }\n\n public static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick < ticks[0].index\n }\n\n public static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick >= ticks[ticks.length - 1].index\n }\n\n public static getTick(ticks: readonly Tick[], index: number): Tick {\n const tick = ticks[this.binarySearch(ticks, index)]\n invariant(tick.index === index, 'NOT_CONTAINED')\n return tick\n }\n\n /**\n * Finds the largest tick in the list of ticks that is less than or equal to tick\n * @param ticks list of ticks\n * @param tick tick to find the largest tick that is less than or equal to tick\n * @private\n */\n private static binarySearch(ticks: readonly Tick[], tick: number): number {\n invariant(!this.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n\n let l = 0\n let r = ticks.length - 1\n let i\n while (true) {\n i = Math.floor((l + r) / 2)\n\n if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) {\n return i\n }\n\n if (ticks[i].index < tick) {\n l = i + 1\n } else {\n r = i - 1\n }\n }\n }\n\n public static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick {\n if (lte) {\n invariant(!TickList.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n if (TickList.isAtOrAboveLargest(ticks, tick)) {\n return ticks[ticks.length - 1]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index]\n } else {\n invariant(!this.isAtOrAboveLargest(ticks, tick), 'AT_OR_ABOVE_LARGEST')\n if (this.isBelowSmallest(ticks, tick)) {\n return ticks[0]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index + 1]\n }\n }\n\n public static nextInitializedTickWithinOneWord(\n ticks: readonly Tick[],\n tick: number,\n lte: boolean,\n tickSpacing: number\n ): [number, boolean] {\n const compressed = Math.floor(tick / tickSpacing) // matches rounding in the code\n\n if (lte) {\n const wordPos = compressed >> 8\n const minimum = (wordPos << 8) * tickSpacing\n\n if (TickList.isBelowSmallest(ticks, tick)) {\n return [minimum, false]\n }\n\n const index = TickList.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.max(minimum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n } else {\n const wordPos = (compressed + 1) >> 8\n const maximum = ((wordPos + 1) << 8) * tickSpacing - 1\n\n if (this.isAtOrAboveLargest(ticks, tick)) {\n return [maximum, false]\n }\n\n const index = this.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.min(maximum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n }\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\n\n/**\n * Generated method parameters for executing a call.\n */\nexport interface MethodParameters {\n /**\n * The hex encoded calldata to perform the given operation\n */\n calldata: string\n /**\n * The amount of ether (wei) to send in hex.\n */\n value: string\n}\n\nexport function toHex(bigintIsh: BigintIsh) {\n const bigInt = JSBI.BigInt(bigintIsh)\n let hex = bigInt.toString(16)\n if (hex.length % 2 !== 0) {\n hex = `0${hex}`\n }\n return `0x${hex}`\n}\n","import { pack } from '@ethersproject/solidity'\nimport { Currency, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from '../entities/pool'\nimport { Route } from '../entities/route'\n\n/**\n * Converts a route to a hex encoded path\n * @param route the v3 path to convert to an encoded path\n * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps\n */\nexport function encodeRouteToPath(route: Route, exactOutput: boolean): string {\n const firstInputToken: Token = wrappedCurrency(route.input, route.chainId)\n\n const { path, types } = route.pools.reduce(\n (\n { inputToken, path, types }: { inputToken: Token; path: (string | number)[]; types: string[] },\n pool: Pool,\n index\n ): { inputToken: Token; path: (string | number)[]; types: string[] } => {\n const outputToken: Token = pool.token0.equals(inputToken) ? pool.token1 : pool.token0\n if (index === 0) {\n return {\n inputToken: outputToken,\n types: ['address', 'uint24', 'address'],\n path: [inputToken.address, pool.fee, outputToken.address]\n }\n } else {\n return {\n inputToken: outputToken,\n types: [...types, 'uint24', 'address'],\n path: [...path, pool.fee, outputToken.address]\n }\n }\n },\n { inputToken: firstInputToken, path: [], types: [] }\n )\n\n return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path)\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, sqrt } from '@uniswap/sdk-core'\n\n/**\n * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0\n * @param amount1 the numerator amount, i.e. amount of token1\n * @param amount0 the denominator amount, i.en amount of token0\n */\nexport function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI {\n const numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192))\n const denominator = JSBI.BigInt(amount0)\n const ratioX192 = JSBI.divide(numerator, denominator)\n return sqrt(ratioX192)\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q96 } from '../internalConstants'\n\nfunction maxLiquidityForAmount0Imprecise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n const intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96)\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\nfunction maxLiquidityForAmount0Precise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96)\n const denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n\n return JSBI.divide(numerator, denominator)\n}\n\nfunction maxLiquidityForAmount1(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount1: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\n/**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param sqrtRatioCurrentX96 the current price\n * @param sqrtRatioAX96 price at lower boundary\n * @param sqrtRatioBX96 price at upper boundary\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\nexport function maxLiquidityForAmounts(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioAX96: JSBI,\n sqrtRatioBX96: JSBI,\n amount0: BigintIsh,\n amount1: BigintIsh,\n useFullPrecision: boolean\n): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise\n\n if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) {\n return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0)\n } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) {\n const liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0)\n const liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1)\n return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1\n } else {\n return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns the closest tick that is nearest a given tick and usable for the given tick spacing\n * @param tick the target tick\n * @param tickSpacing the spacing of the pool\n */\nexport function nearestUsableTick(tick: number, tickSpacing: number) {\n invariant(Number.isInteger(tick) && Number.isInteger(tickSpacing), 'INTEGERS')\n invariant(tickSpacing > 0, 'TICK_SPACING')\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, 'TICK_BOUND')\n const rounded = Math.round(tick / tickSpacing) * tickSpacing\n if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing\n else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing\n else return rounded\n}\n","import { Price, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q192 } from '../internalConstants'\nimport { encodeSqrtRatioX96 } from './encodeSqrtRatioX96'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns a price object corresponding to the input tick and the base/quote token\n * Inputs must be tokens because the address order is used to interpret the price represented by the tick\n * @param baseToken the base token of the price\n * @param quoteToken the quote token of the price\n * @param tick the tick for which to return the price\n */\nexport function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price {\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick)\n\n const ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96)\n\n return baseToken.sortsBefore(quoteToken)\n ? new Price(baseToken, quoteToken, Q192, ratioX192)\n : new Price(baseToken, quoteToken, ratioX192, Q192)\n}\n\n/**\n * Returns the first tick for which the given price is greater than or equal to the tick price\n * @param price for which to return the closest tick that represents a price less than or equal to the input price,\n * i.e. the price of the returned tick is less than or equal to the input price\n */\nexport function priceToClosestTick(price: Price): number {\n const sorted = price.baseCurrency.sortsBefore(price.quoteCurrency)\n\n const sqrtRatioX96 = sorted\n ? encodeSqrtRatioX96(price.numerator, price.denominator)\n : encodeSqrtRatioX96(price.denominator, price.numerator)\n\n let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96)\n const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1)\n if (sorted) {\n if (!price.lessThan(nextTickPrice)) {\n tick++\n }\n } else {\n if (!price.greaterThan(nextTickPrice)) {\n tick++\n }\n }\n return tick\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { BigintIsh } from '@uniswap/sdk-core'\nimport { TickMath } from '../utils'\n\nexport interface TickConstructorArgs {\n index: number\n liquidityGross: BigintIsh\n liquidityNet: BigintIsh\n}\n\nexport class Tick {\n public readonly index: number\n public readonly liquidityGross: JSBI\n public readonly liquidityNet: JSBI\n\n constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs) {\n invariant(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK, 'TICK')\n this.index = index\n this.liquidityGross = JSBI.BigInt(liquidityGross)\n this.liquidityNet = JSBI.BigInt(liquidityNet)\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport { TickList } from '../utils/tickList'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { TickDataProvider } from './tickDataProvider'\n\n/**\n * A data provider for ticks that is backed by an in-memory array of ticks.\n */\nexport class TickListDataProvider implements TickDataProvider {\n private ticks: readonly Tick[]\n\n constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number) {\n const ticksMapped: Tick[] = ticks.map(t => (t instanceof Tick ? t : new Tick(t)))\n TickList.validateList(ticksMapped, tickSpacing)\n this.ticks = ticksMapped\n }\n\n async getTick(tick: number): Promise<{ liquidityNet: BigintIsh; liquidityGross: BigintIsh }> {\n return TickList.getTick(this.ticks, tick)\n }\n\n async nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]> {\n return TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)\n }\n}\n","import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { FACTORY_ADDRESS, FeeAmount, TICK_SPACINGS } from '../constants'\nimport { NEGATIVE_ONE, ONE, Q192, ZERO } from '../internalConstants'\nimport { computePoolAddress } from '../utils/computePoolAddress'\nimport { LiquidityMath } from '../utils/liquidityMath'\nimport { SwapMath } from '../utils/swapMath'\nimport { TickMath } from '../utils/tickMath'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { NoTickDataProvider, TickDataProvider } from './tickDataProvider'\nimport { TickListDataProvider } from './tickListDataProvider'\n\ninterface StepComputations {\n sqrtPriceStartX96: JSBI\n tickNext: number\n initialized: boolean\n sqrtPriceNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n}\n\n/**\n * By default, pools will not allow operations that require ticks.\n */\nconst NO_TICK_DATA_PROVIDER_DEFAULT = new NoTickDataProvider()\n\n/**\n * Represents a V3 pool\n */\nexport class Pool {\n public readonly token0: Token\n public readonly token1: Token\n public readonly fee: FeeAmount\n public readonly sqrtRatioX96: JSBI\n public readonly liquidity: JSBI\n public readonly tickCurrent: number\n public readonly tickDataProvider: TickDataProvider\n\n private _token0Price?: Price\n private _token1Price?: Price\n\n public static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount): string {\n return computePoolAddress({ factoryAddress: FACTORY_ADDRESS, fee, tokenA, tokenB })\n }\n\n /**\n * Construct a pool\n * @param tokenA one of the tokens in the pool\n * @param tokenB the other token in the pool\n * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool\n * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0\n * @param liquidity the current value of in range liquidity\n * @param tickCurrent the current tick of the pool\n * @param ticks the current state of the pool ticks or a data provider that can return tick data\n */\n public constructor(\n tokenA: Token,\n tokenB: Token,\n fee: FeeAmount,\n sqrtRatioX96: BigintIsh,\n liquidity: BigintIsh,\n tickCurrent: number,\n ticks: TickDataProvider | (Tick | TickConstructorArgs)[] = NO_TICK_DATA_PROVIDER_DEFAULT\n ) {\n invariant(Number.isInteger(fee) && fee < 1_000_000, 'FEE')\n\n const tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent)\n const nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1)\n invariant(\n JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) &&\n JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96),\n 'PRICE_BOUNDS'\n )\n // always create a copy of the list since we want the pool's tick list to be immutable\n ;[this.token0, this.token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n this.fee = fee\n this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96)\n this.liquidity = JSBI.BigInt(liquidity)\n this.tickCurrent = tickCurrent\n this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0\n */\n public get token0Price(): Price {\n return (\n this._token0Price ??\n (this._token0Price = new Price(\n this.token0,\n this.token1,\n Q192,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)\n ))\n )\n }\n\n /**\n * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1\n */\n public get token1Price(): Price {\n return (\n this._token1Price ??\n (this._token1Price = new Price(\n this.token1,\n this.token0,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96),\n Q192\n ))\n )\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pool.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pool.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n /**\n * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade\n * @param inputAmount the input amount for which to quote the output amount\n */\n public async getOutputAmount(\n inputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n\n const zeroForOne = inputAmount.currency.equals(this.token0)\n\n const { amountCalculated: outputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n inputAmount.quotient,\n sqrtPriceLimitX96\n )\n const outputToken = zeroForOne ? this.token1 : this.token0\n return [\n CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n /**\n * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade\n * @param outputAmount the output amount for which to quote the input amount\n */\n public async getInputAmount(\n outputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency), 'TOKEN')\n\n const zeroForOne = outputAmount.currency.equals(this.token1)\n\n const { amountCalculated: inputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE),\n sqrtPriceLimitX96\n )\n const inputToken = zeroForOne ? this.token0 : this.token1\n return [\n CurrencyAmount.fromRawAmount(inputToken, inputAmount),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n private async swap(\n zeroForOne: boolean,\n amountSpecified: JSBI,\n sqrtPriceLimitX96?: JSBI\n ): Promise<{ amountCalculated: JSBI; sqrtRatioX96: JSBI; liquidity: JSBI; tickCurrent: number }> {\n if (!sqrtPriceLimitX96)\n sqrtPriceLimitX96 = zeroForOne\n ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE)\n : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE)\n\n if (zeroForOne) {\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO), 'RATIO_MIN')\n invariant(JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n } else {\n invariant(JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO), 'RATIO_MAX')\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n }\n\n const exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO)\n\n // keep track of swap state\n const state = {\n amountSpecifiedRemaining: amountSpecified,\n amountCalculated: ZERO,\n sqrtPriceX96: this.sqrtRatioX96,\n tick: this.tickCurrent,\n liquidity: this.liquidity\n }\n\n // start swap while loop\n while (JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96) {\n let step: Partial = {}\n step.sqrtPriceStartX96 = state.sqrtPriceX96\n\n // because each iteration of the while loop rounds, we can't optimize this code (relative to the smart contract)\n // by simply traversing to the next available tick, we instead need to exactly replicate\n // tickBitmap.nextInitializedTickWithinOneWord\n ;[step.tickNext, step.initialized] = await this.tickDataProvider.nextInitializedTickWithinOneWord(\n state.tick,\n zeroForOne,\n this.tickSpacing\n )\n\n if (step.tickNext < TickMath.MIN_TICK) {\n step.tickNext = TickMath.MIN_TICK\n } else if (step.tickNext > TickMath.MAX_TICK) {\n step.tickNext = TickMath.MAX_TICK\n }\n\n step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext)\n ;[state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount] = SwapMath.computeSwapStep(\n state.sqrtPriceX96,\n (zeroForOne\n ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)\n : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96))\n ? sqrtPriceLimitX96\n : step.sqrtPriceNextX96,\n state.liquidity,\n state.amountSpecifiedRemaining,\n this.fee\n )\n\n if (exactInput) {\n state.amountSpecifiedRemaining = JSBI.subtract(\n state.amountSpecifiedRemaining,\n JSBI.add(step.amountIn, step.feeAmount)\n )\n state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut)\n } else {\n state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut)\n state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount))\n }\n\n // TODO\n if (JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) {\n // if the tick is initialized, run the tick transition\n if (step.initialized) {\n let liquidityNet = JSBI.BigInt((await this.tickDataProvider.getTick(step.tickNext)).liquidityNet)\n // if we're moving leftward, we interpret liquidityNet as the opposite sign\n // safe because liquidityNet cannot be type(int128).min\n if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE)\n\n state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet)\n }\n\n state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext\n } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {\n // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved\n state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96)\n }\n }\n\n return {\n amountCalculated: state.amountCalculated,\n sqrtRatioX96: state.sqrtPriceX96,\n liquidity: state.liquidity,\n tickCurrent: state.tick\n }\n }\n\n public get tickSpacing(): number {\n return TICK_SPACINGS[this.fee]\n }\n}\n","import { BigintIsh, MaxUint256, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { maxLiquidityForAmounts } from '../utils/maxLiquidityForAmounts'\nimport { tickToPrice } from '../utils/priceTickConversions'\nimport { SqrtPriceMath } from '../utils/sqrtPriceMath'\nimport { TickMath } from '../utils/tickMath'\nimport { encodeSqrtRatioX96 } from '../utils/encodeSqrtRatioX96'\nimport { Pool } from './pool'\n\ninterface PositionConstructorArgs {\n pool: Pool\n tickLower: number\n tickUpper: number\n liquidity: BigintIsh\n}\n\n/**\n * Represents a position on a Uniswap V3 Pool\n */\nexport class Position {\n public readonly pool: Pool\n public readonly tickLower: number\n public readonly tickUpper: number\n public readonly liquidity: JSBI\n\n // cached resuts for the getters\n private _token0Amount: CurrencyAmount | null = null\n private _token1Amount: CurrencyAmount | null = null\n private _mintAmounts: Readonly<{ amount0: JSBI; amount1: JSBI }> | null = null\n\n /**\n * Constructs a position for a given pool with the given liquidity\n * @param pool for which pool the liquidity is assigned\n * @param liquidity the amount of liquidity that is in the position\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n */\n public constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs) {\n invariant(tickLower < tickUpper, 'TICK_ORDER')\n invariant(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0, 'TICK_LOWER')\n invariant(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0, 'TICK_UPPER')\n\n this.pool = pool\n this.tickLower = tickLower\n this.tickUpper = tickUpper\n this.liquidity = JSBI.BigInt(liquidity)\n }\n\n /**\n * Returns the price of token0 at the lower tick\n */\n public get token0PriceLower(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower)\n }\n\n /**\n * Returns the price of token0 at the upper tick\n */\n public get token0PriceUpper(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper)\n }\n\n /**\n * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price\n */\n public get amount0(): CurrencyAmount {\n if (this._token0Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else {\n this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO)\n }\n }\n return this._token0Amount\n }\n\n /**\n * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price\n */\n public get amount1(): CurrencyAmount {\n if (this._token1Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO)\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n false\n )\n )\n } else {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n }\n }\n return this._token1Amount\n }\n\n /**\n * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage\n * @param slippageTolerance amount by which the price can 'slip'\n * @private\n */\n private ratiosAfterSlippage(slippageTolerance: Percent): { sqrtRatioX96Lower: JSBI; sqrtRatioX96Upper: JSBI } {\n const priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance))\n const priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1))\n let sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator)\n if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) {\n sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1))\n }\n let sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator)\n if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) {\n sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1))\n }\n return {\n sqrtRatioX96Lower,\n sqrtRatioX96Upper\n }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position\n * with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage)\n const positionThatWillBeCreated = Position.fromAmounts({\n pool: this.pool,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper,\n ...this.mintAmounts, // the mint amounts are what will be passed as calldata\n useFullPrecision: false\n })\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const { amount0 } = new Position({\n pool: poolUpper,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n // ...and the lower for amount1\n const { amount1 } = new Position({\n pool: poolLower,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n\n return { amount0, amount1 }\n }\n\n /**\n * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the\n * position with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const amount0 = new Position({\n pool: poolUpper,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount0\n // ...and the lower for amount1\n const amount1 = new Position({\n pool: poolLower,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount1\n\n return { amount0: amount0.quotient, amount1: amount1.quotient }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at\n * the current price for the pool\n */\n public get mintAmounts(): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n if (this._mintAmounts === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: ZERO\n }\n } else if (this.pool.tickCurrent < this.tickUpper) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n true\n )\n }\n } else {\n return {\n amount0: ZERO,\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n )\n }\n }\n }\n return this._mintAmounts\n }\n\n /**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param pool the pool for which the position should be created\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmounts({\n pool,\n tickLower,\n tickUpper,\n amount0,\n amount1,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n amount1: BigintIsh\n useFullPrecision: boolean\n }) {\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower)\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper)\n return new Position({\n pool,\n tickLower,\n tickUpper,\n liquidity: maxLiquidityForAmounts(\n pool.sqrtRatioX96,\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0,\n amount1,\n useFullPrecision\n )\n })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount0 the desired amount of token0\n * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmount0({\n pool,\n tickLower,\n tickUpper,\n amount0,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n useFullPrecision: boolean\n }) {\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0, amount1: MaxUint256, useFullPrecision })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount1 the desired amount of token1\n */\n public static fromAmount1({\n pool,\n tickLower,\n tickUpper,\n amount1\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount1: BigintIsh\n }) {\n // this function always uses full precision,\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0: MaxUint256, amount1, useFullPrecision: true })\n }\n}\n","import invariant from 'tiny-invariant'\n\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from './pool'\n\n/**\n * Represents a list of pools through which a swap can occur\n */\nexport class Route {\n public readonly pools: Pool[]\n public readonly tokenPath: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n private _midPrice: Price | null = null\n\n public constructor(pools: Pool[], input: TInput, output: TOutput) {\n invariant(pools.length > 0, 'POOLS')\n\n const chainId = pools[0].chainId\n const allOnSameChain = pools.every(pool => pool.chainId === chainId)\n invariant(allOnSameChain, 'CHAIN_IDS')\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pools[0].involvesToken(wrappedInput), 'INPUT')\n\n invariant(pools[pools.length - 1].involvesToken(wrappedCurrency(output, chainId)), 'OUTPUT')\n\n /**\n * Normalizes token0-token1 order and selects the next token/fee step to add to the path\n * */\n const tokenPath: Token[] = [wrappedInput]\n for (const [i, pool] of pools.entries()) {\n const currentInputToken = tokenPath[i]\n invariant(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1), 'PATH')\n const nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0\n tokenPath.push(nextToken)\n }\n\n this.pools = pools\n this.tokenPath = tokenPath\n this.input = input\n this.output = output ?? tokenPath[tokenPath.length - 1]\n }\n\n public get chainId(): ChainId | number {\n return this.pools[0].chainId\n }\n\n /**\n * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token.\n */\n public get inputToken(): Token {\n return wrappedCurrency(this.input, this.chainId)\n }\n\n /**\n * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token.\n */\n public get outputToken(): Token {\n return wrappedCurrency(this.output, this.chainId)\n }\n\n /**\n * Returns the mid price of the route\n */\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n\n const price = this.pools.slice(1).reduce(\n ({ nextInput, price }, pool) => {\n return nextInput.equals(pool.token0)\n ? {\n nextInput: pool.token1,\n price: price.multiply(pool.token0Price)\n }\n : {\n nextInput: pool.token0,\n price: price.multiply(pool.token1Price)\n }\n },\n this.pools[0].token0.equals(this.inputToken)\n ? {\n nextInput: this.pools[0].token1,\n price: this.pools[0].token0Price\n }\n : {\n nextInput: this.pools[0].token0,\n price: this.pools[0].token1Price\n }\n ).price\n\n return (this._midPrice = new Price(this.input, this.output, price.denominator, price.numerator))\n }\n}\n","import {\n ChainId,\n Currency,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n CurrencyAmount,\n TradeType,\n wrappedCurrency,\n wrappedCurrencyAmount,\n Token,\n computePriceImpact\n} from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { Pool } from './pool'\nimport { Route } from './route'\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n // consider the number of hops since each hop costs gas\n return a.route.tokenPath.length - b.route.tokenPath.length\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pools.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pools the trade goes through.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n\n /**\n * The cached result of the computed execution price\n * @private\n */\n private _executionPrice: Price | undefined\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public get executionPrice(): Price {\n return (\n this._executionPrice ??\n (this._executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n ))\n )\n }\n\n /**\n * The cached result of the price impact computation\n * @private\n */\n private _priceImpact: Percent | undefined\n\n /**\n * Returns the percent difference between the route's mid price and the price impact\n */\n public get priceImpact(): Percent {\n return (\n this._priceImpact ??\n (this._priceImpact = computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount))\n )\n }\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static async exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static async exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n /**\n * Constructs a trade by simulating swaps through the given route\n * @param route route to swap through\n * @param amount the amount specified, either input or output, depending on tradeType\n * @param tradeType whether the trade is an exact input or exact output swap\n */\n public static async fromRoute(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ): Promise> {\n const amounts: CurrencyAmount[] = new Array(route.tokenPath.length)\n let inputAmount: CurrencyAmount\n let outputAmount: CurrencyAmount\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n amounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.tokenPath.length - 1; i++) {\n const pool = route.pools[i]\n const [outputAmount] = await pool.getOutputAmount(amounts[i])\n amounts[i + 1] = outputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n amounts[amounts.length - 1].numerator,\n amounts[amounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n amounts[amounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.tokenPath.length - 1; i > 0; i--) {\n const pool = route.pools[i - 1]\n const [inputAmount] = await pool.getInputAmount(amounts[i])\n amounts[i - 1] = inputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n\n return new Trade({\n route,\n tradeType,\n inputAmount,\n outputAmount\n })\n }\n\n /**\n * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade\n * elsewhere and do not have any tick data\n * @param constructorArguments the arguments passed to the trade constructor\n */\n public static createUncheckedTrade<\n TInput extends Currency,\n TOutput extends Currency,\n TTradeType extends TradeType\n >(constructorArguments: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }): Trade {\n return new Trade(constructorArguments)\n }\n\n /**\n * Construct a trade by passing in the pre-computed property values\n * @param route the route through which the trade occurs\n * @param inputAmount the amount of input paid in the trade\n * @param outputAmount the amount of output received in the trade\n * @param tradeType the type of trade, exact input or exact output\n */\n private constructor({\n route,\n inputAmount,\n outputAmount,\n tradeType\n }: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }) {\n invariant(currencyEquals(inputAmount.currency, route.input), 'INPUT_CURRENCY_MATCH')\n invariant(currencyEquals(outputAmount.currency, route.output), 'OUTPUT_CURRENCY_MATCH')\n this.route = route\n this.inputAmount = inputAmount\n this.outputAmount = outputAmount\n this.tradeType = tradeType\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactIn(\n pools: Pool[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountIn.currency) && !currencyEquals(pool.token1, amountIn.currency)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = await pool.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (amountOut.currency.isToken && amountOut.currency.equals(tokenOut)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([...currentPools, pool], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactIn(\n poolsExcludingThisPool,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPools, pool],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param currencyAmountOut the desired currency amount out\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactOut(\n pools: Pool[],\n currencyIn: Currency,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? currencyIn.chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountOut.currency) && !currencyEquals(pool.token1, amountOut.currency)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = await pool.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pool\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([pool, ...currentPools], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactOut(\n poolsExcludingThisPool,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pool, ...currentPools],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { BigintIsh, Token } from '@uniswap/sdk-core'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'\nimport { toHex } from './utils'\n\nexport interface StandardPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n amount: BigintIsh\n deadline: BigintIsh\n}\n\nexport interface AllowedPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n nonce: BigintIsh\n expiry: BigintIsh\n}\n\nexport type PermitOptions = StandardPermitArguments | AllowedPermitArguments\n\n// type guard\nfunction isAllowedPermit(permitOptions: PermitOptions): permitOptions is AllowedPermitArguments {\n return 'nonce' in permitOptions\n}\n\nexport abstract class SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n protected constructor() {}\n\n protected static encodePermit(token: Token, options: PermitOptions) {\n return isAllowedPermit(options)\n ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [\n token.address,\n toHex(options.nonce),\n toHex(options.expiry),\n options.v,\n options.r,\n options.s\n ])\n : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [\n token.address,\n toHex(options.amount),\n toHex(options.deadline),\n options.v,\n options.r,\n options.s\n ])\n }\n}\n","import {\n BigintIsh,\n ChainId,\n Percent,\n Token,\n CurrencyAmount,\n validateAndParseAddress,\n WETH9,\n Currency\n} from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { Position } from './entities/position'\nimport { ONE, ZERO } from './internalConstants'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { ADDRESS_ZERO } from './constants'\n\nconst MaxUint128 = toHex(JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(128)), JSBI.BigInt(1)))\n\nexport interface MintSpecificOptions {\n /**\n * The account that should receive the minted NFT.\n */\n recipient: string\n\n /**\n * Creates pool if not initialized before mint.\n */\n createPool?: boolean\n}\n\nexport interface IncreaseSpecificOptions {\n /**\n * Indicates the ID of the position to increase liquidity for.\n */\n tokenId: BigintIsh\n}\n\n/**\n * Options for producing the calldata to add liquidity.\n */\nexport interface CommonAddLiquidityOptions {\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false\n */\n useEther?: boolean\n\n /**\n * The optional permit parameters for spending token0\n */\n token0Permit?: PermitOptions\n\n /**\n * The optional permit parameters for spending token1\n */\n token1Permit?: PermitOptions\n}\n\nexport type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions\nexport type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions\n\nexport type AddLiquidityOptions = MintOptions | IncreaseOptions\n\n// type guard\nfunction isMint(options: AddLiquidityOptions): options is MintOptions {\n return Object.keys(options).some(k => k === 'recipient')\n}\n\nexport interface CollectOptions {\n /**\n * Indicates the ID of the position to collect for.\n */\n tokenId: BigintIsh\n\n /**\n * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed0: CurrencyAmount\n\n /**\n * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed1: CurrencyAmount\n\n /**\n * The account that should receive the tokens.\n */\n recipient: string\n}\n\nexport interface NFTPermitOptions {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n deadline: BigintIsh\n spender: string\n}\n\n/**\n * Options for producing the calldata to exit a position.\n */\nexport interface RemoveLiquidityOptions {\n /**\n * The ID of the token to exit\n */\n tokenId: BigintIsh\n\n /**\n * The percentage of position liquidity to exit.\n */\n liquidityPercentage: Percent\n\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether the NFT should be burned if the entire position is being exited, by default false.\n */\n burnToken?: boolean\n\n /**\n * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT\n */\n permit?: NFTPermitOptions\n\n /**\n * Parameters to be passed on to collect\n */\n collectOptions: Omit\n}\n\nexport abstract class NonfungiblePositionManager extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n public static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters {\n invariant(JSBI.greaterThan(position.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n const calldatas: string[] = []\n\n // get amounts\n const { amount0: amount0Desired, amount1: amount1Desired } = position.mintAmounts\n\n // adjust for slippage\n const minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance)\n const amount0Min = toHex(minimumAmounts.amount0)\n const amount1Min = toHex(minimumAmounts.amount1)\n\n const deadline = toHex(options.deadline)\n\n // create pool if needed\n if (isMint(options) && options.createPool) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [\n position.pool.token0.address,\n position.pool.token1.address,\n position.pool.fee,\n toHex(position.pool.sqrtRatioX96)\n ])\n )\n }\n\n // permits if necessary\n if (options.token0Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit))\n }\n if (options.token1Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit))\n }\n\n // mint\n if (isMint(options)) {\n const recipient: string = validateAndParseAddress(options.recipient)\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [\n {\n token0: position.pool.token0.address,\n token1: position.pool.token1.address,\n fee: position.pool.fee,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper,\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n recipient,\n deadline\n }\n ])\n )\n } else {\n // increase\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [\n {\n tokenId: toHex(options.tokenId),\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n deadline\n }\n ])\n )\n }\n\n let value: string = toHex(0)\n\n if (options.useEther) {\n const weth = WETH9[position.pool.chainId as ChainId]\n invariant(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth)), 'NO_WETH')\n\n const wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired\n\n // we only need to refund if we're actually sending ETH\n if (JSBI.greaterThan(wethValue, ZERO)) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n value = toHex(wethValue)\n }\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n\n private static encodeCollect(options: CollectOptions): string[] {\n const calldatas: string[] = []\n\n const tokenId = toHex(options.tokenId)\n\n const involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther\n\n const recipient = validateAndParseAddress(options.recipient)\n\n // collect\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [\n {\n tokenId,\n recipient: involvesETH ? ADDRESS_ZERO : recipient,\n amount0Max: MaxUint128,\n amount1Max: MaxUint128\n }\n ])\n )\n\n if (involvesETH) {\n const ethAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed0.quotient\n : options.expectedCurrencyOwed1.quotient\n const token = options.expectedCurrencyOwed0.currency.isEther\n ? (options.expectedCurrencyOwed1.currency as Token)\n : (options.expectedCurrencyOwed0.currency as Token)\n const tokenAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed1.quotient\n : options.expectedCurrencyOwed0.quotient\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])\n )\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [\n token.address,\n toHex(tokenAmount),\n recipient\n ])\n )\n }\n\n return calldatas\n }\n\n public static collectCallParameters(options: CollectOptions): MethodParameters {\n const calldatas: string[] = NonfungiblePositionManager.encodeCollect(options)\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n\n /**\n * Produces the calldata for completely or partially exiting a position\n * @param position the position to exit\n * @param options additional information necessary for generating the calldata\n */\n public static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters {\n const calldatas: string[] = []\n\n const deadline = toHex(options.deadline)\n const tokenId = toHex(options.tokenId)\n\n // construct a partial position with a percentage of liquidity\n const partialPosition = new Position({\n pool: position.pool,\n liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper\n })\n invariant(JSBI.greaterThan(partialPosition.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n // slippage-adjusted underlying amounts\n const { amount0: amount0Min, amount1: amount1Min } = partialPosition.burnAmountsWithSlippage(\n options.slippageTolerance\n )\n\n if (options.permit) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [\n validateAndParseAddress(options.permit.spender),\n tokenId,\n toHex(options.permit.deadline),\n options.permit.v,\n options.permit.r,\n options.permit.s\n ])\n )\n }\n\n // remove liquidity\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [\n {\n tokenId,\n liquidity: toHex(partialPosition.liquidity),\n amount0Min: toHex(amount0Min),\n amount1Min: toHex(amount1Min),\n deadline\n }\n ])\n )\n\n const { expectedCurrencyOwed0, expectedCurrencyOwed1, ...rest } = options.collectOptions\n calldatas.push(\n ...NonfungiblePositionManager.encodeCollect({\n tokenId: options.tokenId,\n // add the underlying value to the expected currency already owed\n expectedCurrencyOwed0: expectedCurrencyOwed0.add(\n expectedCurrencyOwed0.currency.isEther\n ? CurrencyAmount.ether(amount0Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency as Token, amount0Min)\n ),\n expectedCurrencyOwed1: expectedCurrencyOwed1.add(\n expectedCurrencyOwed1.currency.isEther\n ? CurrencyAmount.ether(amount1Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency as Token, amount1Min)\n ),\n ...rest\n })\n )\n\n if (options.liquidityPercentage.equalTo(ONE)) {\n if (options.burnToken) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId]))\n }\n } else {\n invariant(options.burnToken !== true, 'CANNOT_BURN')\n }\n\n return {\n calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { BigintIsh, Currency, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { Trade } from './entities/trade'\nimport { ADDRESS_ZERO } from './constants'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { encodeRouteToPath } from './utils'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'\n\nexport interface FeeOptions {\n /**\n * The percent of the output that will be taken as a fee.\n */\n fee: Percent\n\n /**\n * The recipient of the fee.\n */\n recipient: string\n}\n\n/**\n * Options for producing the arguments to send calls to the router.\n */\nexport interface SwapOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n slippageTolerance: Percent\n\n /**\n * The account that should receive the output.\n */\n recipient: string\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * The optional permit parameters for spending the input.\n */\n inputTokenPermit?: PermitOptions\n\n /**\n * The optional price limit for the trade.\n */\n sqrtPriceLimitX96?: BigintIsh\n\n /**\n * Optional information for taking a fee on output.\n */\n fee?: FeeOptions\n}\n\n/**\n * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades.\n */\nexport abstract class SwapRouter extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: SwapOptions\n ): MethodParameters {\n const calldatas: string[] = []\n\n // encode permit if necessary\n if (options.inputTokenPermit) {\n invariant(trade.inputAmount.currency.isToken, 'NON_TOKEN_PERMIT')\n calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit))\n }\n\n const recipient: string = validateAndParseAddress(options.recipient)\n\n const deadline = toHex(options.deadline)\n\n const amountIn: string = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient)\n const amountOut: string = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient)\n const value: string = trade.inputAmount.currency.isEther ? amountIn : toHex(0)\n\n // flag for whether the trade is single hop or not\n const singleHop = trade.route.pools.length === 1\n\n // flag for whether a refund needs to happen\n const mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === TradeType.EXACT_OUTPUT\n\n // flags for whether funds should be send first to the router\n const outputIsEther = trade.outputAmount.currency.isEther\n const routerMustCustody = outputIsEther || !!options.fee\n\n if (singleHop) {\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams]))\n } else {\n const exactOutputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams]))\n }\n } else {\n invariant(options.sqrtPriceLimitX96 === undefined, 'MULTIHOP_PRICE_LIMIT')\n\n const path: string = encodeRouteToPath(trade.route, trade.tradeType === TradeType.EXACT_OUTPUT)\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams]))\n } else {\n const exactOutputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams]))\n }\n }\n\n // refund\n if (mustRefund) {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n // unwrap\n if (routerMustCustody) {\n if (!!options.fee) {\n const feeRecipient: string = validateAndParseAddress(options.fee.recipient)\n const fee = toHex(options.fee.fee.multiply(10_000).quotient)\n\n if (outputIsEther) {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])\n )\n } else {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [\n trade.route.tokenPath[trade.route.tokenPath.length - 1].address,\n amountOut,\n recipient,\n fee,\n feeRecipient\n ])\n )\n }\n } else {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient]))\n }\n }\n\n return {\n calldata:\n calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n}\n"],"names":["undefined","FACTORY_ADDRESS","ADDRESS_ZERO","POOL_INIT_CODE_HASH","FeeAmount","TICK_SPACINGS","LOW","MEDIUM","HIGH","NEGATIVE_ONE","JSBI","BigInt","ZERO","ONE","Q96","exponentiate","Q192","computePoolAddress","factoryAddress","tokenA","tokenB","fee","sortsBefore","token0","token1","getCreate2Address","keccak256","defaultAbiCoder","encode","address","LiquidityMath","addDelta","x","y","lessThan","subtract","multiply","add","FullMath","mulDivRoundingUp","a","b","denominator","product","result","divide","notEqual","remainder","MaxUint160","multiplyIn256","bitwiseAnd","MaxUint256","addIn256","sum","SqrtPriceMath","getAmount0Delta","sqrtRatioAX96","sqrtRatioBX96","liquidity","roundUp","greaterThan","numerator1","leftShift","numerator2","getAmount1Delta","getNextSqrtPriceFromInput","sqrtPX96","amountIn","zeroForOne","invariant","getNextSqrtPriceFromAmount0RoundingUp","getNextSqrtPriceFromAmount1RoundingDown","getNextSqrtPriceFromOutput","amountOut","amount","equal","greaterThanOrEqual","quotient","lessThanOrEqual","MAX_FEE","SwapMath","computeSwapStep","sqrtRatioCurrentX96","sqrtRatioTargetX96","amountRemaining","feePips","returnValues","exactIn","amountRemainingLessFee","sqrtRatioNextX96","max","feeAmount","TWO","POWERS_OF_2","map","pow","mostSignificantBit","msb","power","min","signedRightShift","mulShift","val","mulBy","Q32","TickMath","getSqrtRatioAtTick","tick","MIN_TICK","MAX_TICK","Number","isInteger","absTick","ratio","getTickAtSqrtRatio","sqrtRatioX96","MIN_SQRT_RATIO","MAX_SQRT_RATIO","sqrtRatioX128","r","log_2","i","f","bitwiseOr","log_sqrt10001","tickLow","toNumber","tickHigh","NoTickDataProvider","getTick","_tick","Error","ERROR_MESSAGE","nextInitializedTickWithinOneWord","_lte","_tickSpacing","isSorted","list","comparator","length","tickComparator","index","TickList","validateList","ticks","tickSpacing","every","reduce","accumulator","liquidityNet","isBelowSmallest","isAtOrAboveLargest","binarySearch","l","Math","floor","nextInitializedTick","lte","compressed","wordPos","minimum","maximum","toHex","bigintIsh","bigInt","hex","toString","encodeRouteToPath","route","exactOutput","firstInputToken","wrappedCurrency","input","chainId","pools","pool","inputToken","path","types","outputToken","equals","pack","reverse","encodeSqrtRatioX96","amount1","amount0","numerator","ratioX192","sqrt","maxLiquidityForAmount0Imprecise","intermediate","maxLiquidityForAmount0Precise","maxLiquidityForAmount1","maxLiquidityForAmounts","useFullPrecision","maxLiquidityForAmount0","liquidity0","liquidity1","nearestUsableTick","rounded","round","tickToPrice","baseToken","quoteToken","Price","priceToClosestTick","price","sorted","baseCurrency","quoteCurrency","nextTickPrice","Tick","liquidityGross","TickListDataProvider","ticksMapped","t","NO_TICK_DATA_PROVIDER_DEFAULT","Pool","tickCurrent","tickCurrentSqrtRatioX96","nextTickSqrtRatioX96","tickDataProvider","Array","isArray","getAddress","involvesToken","token","priceOf","token0Price","token1Price","getOutputAmount","inputAmount","sqrtPriceLimitX96","currency","swap","outputAmount","amountCalculated","CurrencyAmount","fromRawAmount","getInputAmount","isToken","amountSpecified","exactInput","state","amountSpecifiedRemaining","sqrtPriceX96","step","sqrtPriceStartX96","tickNext","initialized","sqrtPriceNextX96","_token0Price","_token1Price","Position","tickLower","tickUpper","ratiosAfterSlippage","slippageTolerance","priceLower","asFraction","Percent","priceUpper","sqrtRatioX96Lower","sqrtRatioX96Upper","mintAmountsWithSlippage","poolLower","poolUpper","positionThatWillBeCreated","fromAmounts","mintAmounts","burnAmountsWithSlippage","fromAmount0","fromAmount1","_token0Amount","_token1Amount","_mintAmounts","Route","output","allOnSameChain","wrappedInput","tokenPath","entries","currentInputToken","nextToken","push","_midPrice","slice","nextInput","tradeComparator","currencyEquals","equalTo","Trade","tradeType","fromRoute","TradeType","EXACT_INPUT","exactOut","EXACT_OUTPUT","amounts","wrappedCurrencyAmount","fromFractionalAmount","createUncheckedTrade","constructorArguments","minimumAmountOut","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","worstExecutionPrice","bestTradeExactIn","currencyAmountIn","currencyOut","currentPools","nextAmountIn","bestTrades","maxNumResults","maxHops","tokenOut","isInsufficientInputAmountError","sortedInsert","poolsExcludingThisPool","concat","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","_executionPrice","_priceImpact","computePriceImpact","midPrice","isAllowedPermit","permitOptions","SelfPermit","encodePermit","options","INTERFACE","encodeFunctionData","nonce","expiry","v","s","deadline","Interface","abi","MaxUint128","isMint","Object","keys","some","k","NonfungiblePositionManager","addCallParameters","position","calldatas","amount0Desired","amount1Desired","minimumAmounts","amount0Min","amount1Min","createPool","token0Permit","token1Permit","recipient","validateAndParseAddress","tokenId","value","useEther","weth","WETH9","wethValue","calldata","encodeCollect","involvesETH","expectedCurrencyOwed0","isEther","expectedCurrencyOwed1","amount0Max","amount1Max","ethAmount","tokenAmount","collectCallParameters","removeCallParameters","partialPosition","liquidityPercentage","permit","spender","collectOptions","rest","ether","burnToken","SwapRouter","swapCallParameters","trade","inputTokenPermit","singleHop","mustRefund","outputIsEther","routerMustCustody","exactInputSingleParams","amountOutMinimum","exactOutputSingleParams","amountInMaximum","exactInputParams","exactOutputParams","feeRecipient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,UAAU,OAAO,EAAE;AAElC;AACA,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AACjC,EAAE,IAAIA,WAAS,CAAC;AAChB,EAAE,IAAI,OAAO,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,GAAG,EAAE,CAAC;AAC3D,EAAE,IAAI,cAAc,GAAG,OAAO,CAAC,QAAQ,IAAI,YAAY,CAAC;AACxD,EAAE,IAAI,mBAAmB,GAAG,OAAO,CAAC,aAAa,IAAI,iBAAiB,CAAC;AACvE,EAAE,IAAI,iBAAiB,GAAG,OAAO,CAAC,WAAW,IAAI,eAAe,CAAC;AACjE;AACA,EAAE,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE;AACnC,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE;AACpC,MAAM,KAAK,EAAE,KAAK;AAClB,MAAM,UAAU,EAAE,IAAI;AACtB,MAAM,YAAY,EAAE,IAAI;AACxB,MAAM,QAAQ,EAAE,IAAI;AACpB,KAAK,CAAC,CAAC;AACP,IAAI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E3D4C,SAF2D,EAG3DoS,SAH2D,EAI3DxV,GAJ2D,EAK3DkY,YAL2D,CAA7D,CADF;AASD;AACF,OAnBD,MAmBO;AACLnD,QAAAA,SAAS,CAACxE,IAAV,CAAe6G,UAAU,CAACvD,SAAX,CAAqBC,kBAArB,CAAwC,aAAxC,EAAuD,CAAC1Q,SAAD,EAAYoS,SAAZ,CAAvD,CAAf;AACD;AACF;;AAED,WAAO;AACLQ,MAAAA,QAAQ,EACNjB,SAAS,CAACzN,MAAV,KAAqB,CAArB,GAAyByN,SAAS,CAAC,CAAD,CAAlC,GAAwCqC,UAAU,CAACvD,SAAX,CAAqBC,kBAArB,CAAwC,WAAxC,EAAqD,CAACiB,SAAD,CAArD,CAFrC;AAGLY,MAAAA,KAAK,EAALA;AAHK,KAAP;AAKD,GAzIH;;AAAA;AAAA,EAAyCjC,UAAzC;AACgB0D,oBAAA,gBAAuB,IAAIhD,SAAJ,CAAcC,KAAd,CAAvB;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/v3-sdk/package.json b/uniswap-packages-forks/v3-sdk/package.json new file mode 100644 index 00000000000..2fc227d078a --- /dev/null +++ b/uniswap-packages-forks/v3-sdk/package.json @@ -0,0 +1,47 @@ +{ + "name": "@uniswap/v3-sdk", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "version": "3.0.0-alpha.6", + "description": "⚒️ An SDK for building applications on top of Uniswap V3", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "files": [ + "dist" + ], + "repository": "https://github.com/Uniswap/uniswap-v3-sdk.git", + "keywords": [ + "uniswap", + "ethereum" + ], + "module": "dist/v3-sdk.esm.js", + "scripts": { + "build": "tsdx build", + "start": "tsdx watch", + "test": "tsdx test", + "prepublishOnly": "tsdx build" + }, + "dependencies": { + "@ethersproject/abi": "^5.0.12", + "@ethersproject/solidity": "^5.0.9", + "@uniswap/sdk-core": "file:../sdk-core", + "@uniswap/v3-periphery": "1.0.0", + "tiny-invariant": "^1.1.0", + "tiny-warning": "^1.0.3" + }, + "devDependencies": { + "@types/jest": "^24.0.25", + "@uniswap/v3-core": "1.0.0", + "tsdx": "^0.14.1" + }, + "engines": { + "node": ">=10" + }, + "prettier": { + "printWidth": 120, + "semi": false, + "singleQuote": true + } +} From 65b823ca83feeab6cd339a2c92ade2d68bd2d7ea Mon Sep 17 00:00:00 2001 From: alagunoff Date: Fri, 27 Dec 2024 20:43:31 +0300 Subject: [PATCH 23/30] feat: add ignoring forked packages' folder byt linters; use ether or pol dynamically in some places --- .eslintrc.json | 12 ++++----- .prettierignore | 1 + src/components/SearchModal/CommonBases.tsx | 12 +++++---- src/components/SearchModal/CurrencyList.tsx | 23 +++++++++------- src/components/SearchModal/CurrencySearch.tsx | 27 ++++++++++++------- src/constants/tokens.ts | 10 +++---- 6 files changed, 49 insertions(+), 36 deletions(-) create mode 100644 .prettierignore diff --git a/.eslintrc.json b/.eslintrc.json index 386c89a9ac7..ea6aaf2ac9e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,7 +8,7 @@ "jsx": true } }, - "ignorePatterns": ["node_modules/**/*"], + "ignorePatterns": ["node_modules/**/*", "uniswap-packages-forks/**/*"], "settings": { "react": { "version": "detect" @@ -24,11 +24,11 @@ "rules": { "@typescript-eslint/explicit-function-return-type": "off", "prettier/prettier": [ - "error", - { - "endOfLine": "auto" - } - ], + "error", + { + "endOfLine": "auto" + } + ], "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/ban-ts-ignore": "off", diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000000..454bfa152d1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +/uniswap-packages-forks \ No newline at end of file diff --git a/src/components/SearchModal/CommonBases.tsx b/src/components/SearchModal/CommonBases.tsx index 8f466373598..6dcb10116f8 100644 --- a/src/components/SearchModal/CommonBases.tsx +++ b/src/components/SearchModal/CommonBases.tsx @@ -1,6 +1,6 @@ import React from 'react' import { Text } from 'rebass' -import { ChainId, Currency, currencyEquals, Token, ETHER } from '@uniswap/sdk-core' +import { ChainId, Currency, currencyEquals, Token, ETHER, POL } from '@uniswap/sdk-core' import styled from 'styled-components/macro' import { SUGGESTED_BASES } from '../../constants/routing' @@ -34,6 +34,8 @@ export default function CommonBases({ selectedCurrency?: Currency | null onSelect: (currency: Currency) => void }) { + const firstCurrency = chainId === 80002 ? POL : ETHER + return ( @@ -45,15 +47,15 @@ export default function CommonBases({ { - if (!selectedCurrency || !currencyEquals(selectedCurrency, ETHER)) { - onSelect(ETHER) + if (!selectedCurrency || !currencyEquals(selectedCurrency, firstCurrency)) { + onSelect(firstCurrency) } }} disable={selectedCurrency?.isEther} > - + - {chainId === 80002 ? 'POL' : 'ETH'} + {firstCurrency.symbol} {(typeof chainId === 'number' ? SUGGESTED_BASES[chainId] ?? [] : []).map((token: Token) => { diff --git a/src/components/SearchModal/CurrencyList.tsx b/src/components/SearchModal/CurrencyList.tsx index ffc10f0363f..ab9a74c457b 100644 --- a/src/components/SearchModal/CurrencyList.tsx +++ b/src/components/SearchModal/CurrencyList.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, currencyEquals, Token } from '@uniswap/sdk-core' +import { ChainId, Currency, CurrencyAmount, currencyEquals, Token } from '@uniswap/sdk-core' import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react' import { FixedSizeList } from 'react-window' import { Text } from 'rebass' @@ -23,8 +23,8 @@ import TokenListLogo from '../../assets/svg/tokenlist.svg' import QuestionHelper from 'components/QuestionHelper' import useTheme from 'hooks/useTheme' -function currencyKey(currency: Currency): string { - return currency.isToken ? currency.address : 'ETHER' +function currencyKey(currency: Currency, chainId: ChainId | undefined): string { + return currency.isToken ? currency.address : chainId === 80002 ? 'POL' : 'ETHER' } const StyledBalanceText = styled(Text)` @@ -111,8 +111,8 @@ function CurrencyRow({ otherSelected: boolean style: CSSProperties }) { - const { account } = useActiveWeb3React() - const key = currencyKey(currency) + const { account, chainId } = useActiveWeb3React() + const key = currencyKey(currency, chainId) const selectedTokenList = useCombinedActiveList() const isOnSelectedList = isTokenOnList(selectedTokenList, currency.isToken ? currency : undefined) const customAdded = useIsUserAddedToken(currency) @@ -238,11 +238,14 @@ export default function CurrencyList({ [chainId, currencies.length, onCurrencySelect, otherCurrency, selectedCurrency, setImportToken, showImportView] ) - const itemKey = useCallback((index: number, data: typeof itemData) => { - const currency = data[index] - if (isBreakLine(currency)) return BREAK_LINE - return currencyKey(currency) - }, []) + const itemKey = useCallback( + (index: number, data: typeof itemData) => { + const currency = data[index] + if (isBreakLine(currency)) return BREAK_LINE + return currencyKey(currency, chainId) + }, + [chainId] + ) return ( { + const filteredSortedTokensWithETHOrPOL: Currency[] = useMemo(() => { const s = debouncedQuery.toLowerCase().trim() + if (chainId === 80002 && (s === '' || s === 'p' || s === 'po' || s === 'pol')) { + return [POL, ...filteredSortedTokens] + } + if (s === '' || s === 'e' || s === 'et' || s === 'eth') { return [ETHER, ...filteredSortedTokens] } + return filteredSortedTokens - }, [debouncedQuery, filteredSortedTokens]) + }, [debouncedQuery, filteredSortedTokens, chainId]) const handleCurrencySelect = useCallback( (currency: Currency) => { @@ -140,19 +145,21 @@ export function CurrencySearch({ (e: KeyboardEvent) => { if (e.key === 'Enter') { const s = debouncedQuery.toLowerCase().trim() - if (s === 'eth') { + if (chainId === 80002 && s === 'pol') { + handleCurrencySelect(POL) + } else if (s === 'eth') { handleCurrencySelect(ETHER) - } else if (filteredSortedTokensWithETH.length > 0) { + } else if (filteredSortedTokensWithETHOrPOL.length > 0) { if ( - filteredSortedTokensWithETH[0].symbol?.toLowerCase() === debouncedQuery.trim().toLowerCase() || - filteredSortedTokensWithETH.length === 1 + filteredSortedTokensWithETHOrPOL[0].symbol?.toLowerCase() === debouncedQuery.trim().toLowerCase() || + filteredSortedTokensWithETHOrPOL.length === 1 ) { - handleCurrencySelect(filteredSortedTokensWithETH[0]) + handleCurrencySelect(filteredSortedTokensWithETHOrPOL[0]) } } } }, - [filteredSortedTokensWithETH, handleCurrencySelect, debouncedQuery] + [filteredSortedTokensWithETHOrPOL, handleCurrencySelect, debouncedQuery, chainId] ) // menu ui @@ -201,7 +208,7 @@ export function CurrencySearch({ {({ height }) => ( Date: Sat, 28 Dec 2024 10:14:39 +0300 Subject: [PATCH 24/30] feat: change addresses to new ones --- src/constants/addresses.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index ada515983c4..7f68ba860f9 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -34,7 +34,7 @@ export const QUOTER_ADDRESSES = { [ChainId.RINKEBY]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', [ChainId.GÖRLI]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', [ChainId.KOVAN]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', - [ChainId.POLYGON_AMOY]: '0x81f1D9f16D42eF8009d14217cD3C0BE1B73494C0', + [ChainId.POLYGON_AMOY]: '0xCf097B2507F346B0a23C001A51a21841FA74d402', } export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = { [ChainId.MAINNET]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', @@ -42,15 +42,9 @@ export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = { [ChainId.RINKEBY]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', [ChainId.GÖRLI]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', [ChainId.KOVAN]: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88', - [ChainId.POLYGON_AMOY]: '0xeE925437D6b4be09883dA245050268Ac2AEE752b', -} -export const ENS_REGISTRAR_ADDRESSES = { - [ChainId.MAINNET]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', - [ChainId.GÖRLI]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', - [ChainId.RINKEBY]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', - [ChainId.ROPSTEN]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', - [ChainId.POLYGON_AMOY]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', + [ChainId.POLYGON_AMOY]: '0xAAd8A51266fD8F51325E8f1e8B8170dF35f8C540', } +export const ENS_REGISTRAR_ADDRESSES = constructSameAddressMap('0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e') export const SOCKS_CONTROLLER_ADDRESSES = { [ChainId.MAINNET]: '0x65770b5283117639760beA3F867b69b3697a91dd', } From 0808d0eed2e9044ebc0a410f75390346a8e0a4d7 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Sat, 28 Dec 2024 11:44:23 +0300 Subject: [PATCH 25/30] feat: remove forked dependencies from local ones and use custom from npm --- package.json | 6 +- uniswap-packages-forks/sdk-core/LICENSE | 21 - uniswap-packages-forks/sdk-core/README.md | 8 - .../sdk-core/dist/constants.d.ts | 20 - .../sdk-core/dist/entities/baseCurrency.d.ts | 19 - .../sdk-core/dist/entities/currency.d.ts | 4 - .../sdk-core/dist/entities/ether.d.ts | 18 - .../entities/fractions/currencyAmount.d.ts | 41 - .../dist/entities/fractions/fraction.d.ts | 24 - .../dist/entities/fractions/index.d.ts | 4 - .../dist/entities/fractions/percent.d.ts | 14 - .../dist/entities/fractions/price.d.ts | 31 - .../sdk-core/dist/entities/index.d.ts | 5 - .../sdk-core/dist/entities/pol.d.ts | 18 - .../sdk-core/dist/entities/token.d.ts | 27 - .../sdk-core/dist/index.d.ts | 3 - uniswap-packages-forks/sdk-core/dist/index.js | 8 - .../sdk-core/dist/sdk-core.cjs.development.js | 740 ---- .../dist/sdk-core.cjs.development.js.map | 1 - .../dist/sdk-core.cjs.production.min.js | 2 - .../dist/sdk-core.cjs.production.min.js.map | 1 - .../sdk-core/dist/sdk-core.esm.js | 723 ---- .../sdk-core/dist/sdk-core.esm.js.map | 1 - .../dist/utils/computePriceImpact.d.ts | 8 - .../sdk-core/dist/utils/currencyEquals.d.ts | 5 - .../sdk-core/dist/utils/index.d.ts | 7 - .../sdk-core/dist/utils/sortedInsert.d.ts | 1 - .../sdk-core/dist/utils/sqrt.d.ts | 7 - .../dist/utils/validateAndParseAddress.d.ts | 5 - .../sdk-core/dist/utils/wrappedCurrency.d.ts | 8 - .../dist/utils/wrappedCurrencyAmount.d.ts | 8 - uniswap-packages-forks/sdk-core/package.json | 44 - uniswap-packages-forks/v2-sdk/LICENSE | 21 - uniswap-packages-forks/v2-sdk/README.md | 9 - .../v2-sdk/dist/constants.d.ts | 9 - .../v2-sdk/dist/entities/index.d.ts | 3 - .../v2-sdk/dist/entities/pair.d.ts | 43 - .../v2-sdk/dist/entities/route.d.ts | 12 - .../v2-sdk/dist/entities/trade.d.ts | 103 - .../v2-sdk/dist/errors.d.ts | 16 - uniswap-packages-forks/v2-sdk/dist/index.d.ts | 4 - uniswap-packages-forks/v2-sdk/dist/index.js | 8 - .../v2-sdk/dist/router.d.ts | 64 - .../v2-sdk/dist/v2-sdk.cjs.development.js | 1260 ------ .../v2-sdk/dist/v2-sdk.cjs.development.js.map | 1 - .../v2-sdk/dist/v2-sdk.cjs.production.min.js | 2 - .../dist/v2-sdk.cjs.production.min.js.map | 1 - .../v2-sdk/dist/v2-sdk.esm.js | 1243 ------ .../v2-sdk/dist/v2-sdk.esm.js.map | 1 - uniswap-packages-forks/v2-sdk/package.json | 45 - uniswap-packages-forks/v3-sdk/LICENSE | 21 - uniswap-packages-forks/v3-sdk/README.md | 15 - .../v3-sdk/dist/constants.d.ts | 17 - .../v3-sdk/dist/entities/index.d.ts | 7 - .../v3-sdk/dist/entities/pool.d.ts | 65 - .../v3-sdk/dist/entities/position.d.ts | 126 - .../v3-sdk/dist/entities/route.d.ts | 26 - .../v3-sdk/dist/entities/tick.d.ts | 13 - .../dist/entities/tickDataProvider.d.ts | 31 - .../dist/entities/tickListDataProvider.d.ts | 15 - .../v3-sdk/dist/entities/trade.d.ts | 132 - uniswap-packages-forks/v3-sdk/dist/index.d.ts | 5 - uniswap-packages-forks/v3-sdk/dist/index.js | 8 - .../v3-sdk/dist/internalConstants.d.ts | 6 - .../dist/nonfungiblePositionManager.d.ts | 123 - .../v3-sdk/dist/selfPermit.d.ts | 22 - .../v3-sdk/dist/swapRouter.d.ts | 60 - .../v3-sdk/dist/utils/calldata.d.ts | 15 - .../v3-sdk/dist/utils/computePoolAddress.d.ts | 8 - .../v3-sdk/dist/utils/encodeRouteToPath.d.ts | 8 - .../v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts | 8 - .../v3-sdk/dist/utils/fullMath.d.ts | 8 - .../v3-sdk/dist/utils/index.d.ts | 14 - .../v3-sdk/dist/utils/isSorted.d.ts | 1 - .../v3-sdk/dist/utils/liquidityMath.d.ts | 8 - .../dist/utils/maxLiquidityForAmounts.d.ts | 14 - .../v3-sdk/dist/utils/mostSignificantBit.d.ts | 2 - .../v3-sdk/dist/utils/nearestUsableTick.d.ts | 6 - .../dist/utils/priceTickConversions.d.ts | 15 - .../v3-sdk/dist/utils/sqrtPriceMath.d.ts | 13 - .../v3-sdk/dist/utils/swapMath.d.ts | 9 - .../v3-sdk/dist/utils/tickList.d.ts | 23 - .../v3-sdk/dist/utils/tickMath.d.ts | 34 - .../v3-sdk/dist/v3-sdk.cjs.development.js | 3389 ----------------- .../v3-sdk/dist/v3-sdk.cjs.development.js.map | 1 - .../v3-sdk/dist/v3-sdk.cjs.production.min.js | 2 - .../dist/v3-sdk.cjs.production.min.js.map | 1 - .../v3-sdk/dist/v3-sdk.esm.js | 3360 ---------------- .../v3-sdk/dist/v3-sdk.esm.js.map | 1 - uniswap-packages-forks/v3-sdk/package.json | 47 - yarn.lock | 284 +- 91 files changed, 266 insertions(+), 12374 deletions(-) delete mode 100644 uniswap-packages-forks/sdk-core/LICENSE delete mode 100644 uniswap-packages-forks/sdk-core/README.md delete mode 100644 uniswap-packages-forks/sdk-core/dist/constants.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/baseCurrency.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/currency.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/ether.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/currencyAmount.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/fraction.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/index.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/percent.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/fractions/price.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/index.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/pol.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/entities/token.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/index.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/index.js delete mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js delete mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js.map delete mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js delete mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js.map delete mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js delete mode 100644 uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js.map delete mode 100644 uniswap-packages-forks/sdk-core/dist/utils/computePriceImpact.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/utils/currencyEquals.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/utils/index.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/utils/sortedInsert.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/utils/sqrt.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/utils/validateAndParseAddress.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrency.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts delete mode 100644 uniswap-packages-forks/sdk-core/package.json delete mode 100644 uniswap-packages-forks/v2-sdk/LICENSE delete mode 100644 uniswap-packages-forks/v2-sdk/README.md delete mode 100644 uniswap-packages-forks/v2-sdk/dist/constants.d.ts delete mode 100644 uniswap-packages-forks/v2-sdk/dist/entities/index.d.ts delete mode 100644 uniswap-packages-forks/v2-sdk/dist/entities/pair.d.ts delete mode 100644 uniswap-packages-forks/v2-sdk/dist/entities/route.d.ts delete mode 100644 uniswap-packages-forks/v2-sdk/dist/entities/trade.d.ts delete mode 100644 uniswap-packages-forks/v2-sdk/dist/errors.d.ts delete mode 100644 uniswap-packages-forks/v2-sdk/dist/index.d.ts delete mode 100644 uniswap-packages-forks/v2-sdk/dist/index.js delete mode 100644 uniswap-packages-forks/v2-sdk/dist/router.d.ts delete mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js delete mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js.map delete mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js delete mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js.map delete mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js delete mode 100644 uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js.map delete mode 100644 uniswap-packages-forks/v2-sdk/package.json delete mode 100644 uniswap-packages-forks/v3-sdk/LICENSE delete mode 100644 uniswap-packages-forks/v3-sdk/README.md delete mode 100644 uniswap-packages-forks/v3-sdk/dist/constants.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/index.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/pool.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/position.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/route.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/tick.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/tickDataProvider.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/tickListDataProvider.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/entities/trade.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/index.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/index.js delete mode 100644 uniswap-packages-forks/v3-sdk/dist/internalConstants.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/nonfungiblePositionManager.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/selfPermit.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/swapRouter.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/calldata.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/computePoolAddress.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/encodeRouteToPath.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/fullMath.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/index.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/isSorted.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/liquidityMath.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/maxLiquidityForAmounts.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/mostSignificantBit.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/nearestUsableTick.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/priceTickConversions.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/sqrtPriceMath.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/swapMath.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/tickList.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/utils/tickMath.d.ts delete mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js delete mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js.map delete mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js delete mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js.map delete mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js delete mode 100644 uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js.map delete mode 100644 uniswap-packages-forks/v3-sdk/package.json diff --git a/package.json b/package.json index 98133ee5454..310c6e28e31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@uniswap/interface", - "description": "Uniswap Interface", + "description": "MetaLamp Swap Interface", "homepage": ".", "private": true, "devDependencies": { @@ -37,10 +37,10 @@ "@uniswap/token-lists": "^1.0.0-beta.19", "@uniswap/v2-core": "1.0.0", "@uniswap/v2-periphery": "^1.1.0-beta.0", - "@uniswap/v2-sdk": "file:./uniswap-packages-forks/v2-sdk", + "@uniswap/v2-sdk": "3.0.0-alpha.0", "@uniswap/v3-core": "1.0.0", "@uniswap/v3-periphery": "1.0.0", - "@uniswap/v3-sdk": "file:./uniswap-packages-forks/v3-sdk", + "@alagunoff/uniswap-v3-sdk": "3.0.0", "@web3-react/core": "^6.0.9", "@web3-react/fortmatic-connector": "^6.0.9", "@web3-react/injected-connector": "^6.0.7", diff --git a/uniswap-packages-forks/sdk-core/LICENSE b/uniswap-packages-forks/sdk-core/LICENSE deleted file mode 100644 index 0c6c24ca9dd..00000000000 --- a/uniswap-packages-forks/sdk-core/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Uniswap Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/uniswap-packages-forks/sdk-core/README.md b/uniswap-packages-forks/sdk-core/README.md deleted file mode 100644 index 86f69f1dbd3..00000000000 --- a/uniswap-packages-forks/sdk-core/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Uniswap SDK Core - -[![Unit Tests](https://github.com/Uniswap/uniswap-sdk-core/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3A%22Unit+Tests%22) -[![Lint](https://github.com/Uniswap/uniswap-sdk-core/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-sdk-core/actions?query=workflow%3ALint) -[![npm version](https://img.shields.io/npm/v/@uniswap/sdk-core/latest.svg)](https://www.npmjs.com/package/@uniswap/sdk-core/v/latest) -[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/sdk-core/latest.svg)](https://bundlephobia.com/result?p=@uniswap/sdk-core@latest) - -This code is shared across Uniswap TypeScript SDKs. diff --git a/uniswap-packages-forks/sdk-core/dist/constants.d.ts b/uniswap-packages-forks/sdk-core/dist/constants.d.ts deleted file mode 100644 index 1bd20cab92f..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/constants.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import JSBI from 'jsbi'; -export declare type BigintIsh = JSBI | string | number; -export declare enum ChainId { - MAINNET = 1, - ROPSTEN = 3, - RINKEBY = 4, - GÖRLI = 5, - KOVAN = 42, - POLYGON_AMOY = 80002 -} -export declare enum TradeType { - EXACT_INPUT = 0, - EXACT_OUTPUT = 1 -} -export declare enum Rounding { - ROUND_DOWN = 0, - ROUND_HALF_UP = 1, - ROUND_UP = 2 -} -export declare const MaxUint256: JSBI; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/baseCurrency.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/baseCurrency.d.ts deleted file mode 100644 index c56bf6b49a8..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/baseCurrency.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. - * - * The only instance of the base class `Currency` is Ether. - */ -export declare abstract class BaseCurrency { - abstract readonly isEther: boolean; - abstract readonly isToken: boolean; - readonly decimals: number; - readonly symbol?: string; - readonly name?: string; - /** - * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. - * @param decimals decimals of the currency - * @param symbol symbol of the currency - * @param name of the currency - */ - protected constructor(decimals: number, symbol?: string, name?: string); -} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/currency.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/currency.d.ts deleted file mode 100644 index 2b02f15ab6e..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/currency.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Ether } from './ether'; -import { Pol } from './pol'; -import { Token } from './token'; -export declare type Currency = Ether | Pol | Token; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/ether.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/ether.d.ts deleted file mode 100644 index 78ded1b62b6..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/ether.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { BaseCurrency } from './baseCurrency'; -/** - * Represents the currency Ether - */ -export declare class Ether extends BaseCurrency { - readonly isEther: true; - readonly isToken: false; - /** - * Only called once by this class - * @protected - */ - protected constructor(); - /** - * The only instance of the class `Ether`. - */ - static readonly ETHER: Ether; -} -export declare const ETHER: Ether; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/currencyAmount.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/currencyAmount.d.ts deleted file mode 100644 index e53ce44741e..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/fractions/currencyAmount.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import JSBI from 'jsbi'; -import { Currency } from '../currency'; -import { Ether } from '../ether'; -import { Pol } from '../pol'; -import { Fraction } from './fraction'; -import { BigintIsh, Rounding } from '../../constants'; -export declare class CurrencyAmount extends Fraction { - readonly currency: T; - readonly decimalScale: JSBI; - /** - * Returns a new currency amount instance from the - * @param currency the currency in the amount - * @param rawAmount the raw token or ether amount - */ - static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount; - /** - * Construct a currency amount with a denominator that is not equal to 1 - * @param currency the currency - * @param numerator the numerator of the fractional token amount - * @param denominator the denominator of the fractional token amount - */ - static fromFractionalAmount(currency: T, numerator: BigintIsh, denominator: BigintIsh): CurrencyAmount; - /** - * Helper that calls the constructor with the ETHER currency - * @param rawAmount ether amount in wei - */ - static ether(rawAmount: BigintIsh): CurrencyAmount; - /** - * Helper that calls the constructor with the POL currency - * @param rawAmount pol amount in wei - */ - static pol(rawAmount: BigintIsh): CurrencyAmount; - protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh); - add(other: CurrencyAmount): CurrencyAmount; - subtract(other: CurrencyAmount): CurrencyAmount; - multiply(other: Fraction | BigintIsh): CurrencyAmount; - divide(other: Fraction | BigintIsh): CurrencyAmount; - toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; - toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; - toExact(format?: object): string; -} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/fraction.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/fraction.d.ts deleted file mode 100644 index 414770af5e3..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/fractions/fraction.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import JSBI from 'jsbi'; -import { BigintIsh, Rounding } from '../../constants'; -export declare class Fraction { - readonly numerator: JSBI; - readonly denominator: JSBI; - constructor(numerator: BigintIsh, denominator?: BigintIsh); - private static tryParseFraction; - get quotient(): JSBI; - get remainder(): Fraction; - invert(): Fraction; - add(other: Fraction | BigintIsh): Fraction; - subtract(other: Fraction | BigintIsh): Fraction; - lessThan(other: Fraction | BigintIsh): boolean; - equalTo(other: Fraction | BigintIsh): boolean; - greaterThan(other: Fraction | BigintIsh): boolean; - multiply(other: Fraction | BigintIsh): Fraction; - divide(other: Fraction | BigintIsh): Fraction; - toSignificant(significantDigits: number, format?: object, rounding?: Rounding): string; - toFixed(decimalPlaces: number, format?: object, rounding?: Rounding): string; - /** - * Helper method for converting any super class back to a fraction - */ - get asFraction(): Fraction; -} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/index.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/index.d.ts deleted file mode 100644 index 616c23384e2..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/fractions/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { CurrencyAmount } from './currencyAmount'; -export { Fraction } from './fraction'; -export { Percent } from './percent'; -export { Price } from './price'; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/percent.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/percent.d.ts deleted file mode 100644 index 6f373cf3282..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/fractions/percent.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BigintIsh, Rounding } from '../../constants'; -import { Fraction } from './fraction'; -export declare class Percent extends Fraction { - /** - * This boolean prevents a fraction from being interpreted as a Percent - */ - readonly isPercent: true; - add(other: Fraction | BigintIsh): Percent; - subtract(other: Fraction | BigintIsh): Percent; - multiply(other: Fraction | BigintIsh): Percent; - divide(other: Fraction | BigintIsh): Percent; - toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; - toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; -} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/fractions/price.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/fractions/price.d.ts deleted file mode 100644 index b04db496080..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/fractions/price.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BigintIsh, Rounding } from '../../constants'; -import { Currency } from '../currency'; -import { Fraction } from './fraction'; -import { CurrencyAmount } from './currencyAmount'; -export declare class Price extends Fraction { - readonly baseCurrency: TBase; - readonly quoteCurrency: TQuote; - readonly scalar: Fraction; - constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh); - /** - * Flip the price, switching the base and quote currency - */ - invert(): Price; - /** - * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency - * @param other the other price - */ - multiply(other: Price): Price; - /** - * Return the amount of quote currency corresponding to a given amount of the base currency - * @param currencyAmount the amount of base currency to quote against the price - */ - quote(currencyAmount: CurrencyAmount): CurrencyAmount; - /** - * Get the value scaled by decimals for formatting - * @private - */ - private get adjustedForDecimals(); - toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; - toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; -} diff --git a/uniswap-packages-forks/sdk-core/dist/entities/index.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/index.d.ts deleted file mode 100644 index 2cbfd261cab..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './fractions'; -export * from './currency'; -export * from './ether'; -export * from './pol'; -export * from './token'; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/pol.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/pol.d.ts deleted file mode 100644 index ffd1cbb267a..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/pol.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { BaseCurrency } from './baseCurrency'; -/** - * Represents the currency Pol - */ -export declare class Pol extends BaseCurrency { - readonly isEther: true; - readonly isToken: false; - /** - * Only called once by this class - * @protected - */ - protected constructor(); - /** - * The only instance of the class `Pol`. - */ - static readonly POL: Pol; -} -export declare const POL: Pol; diff --git a/uniswap-packages-forks/sdk-core/dist/entities/token.d.ts b/uniswap-packages-forks/sdk-core/dist/entities/token.d.ts deleted file mode 100644 index 65c8f126ca5..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/entities/token.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ChainId } from '../constants'; -import { BaseCurrency } from './baseCurrency'; -/** - * Represents an ERC20 token with a unique address and some metadata. - */ -export declare class Token extends BaseCurrency { - readonly isEther: false; - readonly isToken: true; - readonly chainId: ChainId | number; - readonly address: string; - constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string); - /** - * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. - * @param other other token to compare - */ - equals(other: Token): boolean; - /** - * Returns true if the address of this token sorts before the address of the other token - * @param other other token to compare - * @throws if the tokens have the same address - * @throws if the tokens are on different chains - */ - sortsBefore(other: Token): boolean; -} -export declare const WETH9: { - [chainId in ChainId]: Token; -}; diff --git a/uniswap-packages-forks/sdk-core/dist/index.d.ts b/uniswap-packages-forks/sdk-core/dist/index.d.ts deleted file mode 100644 index 0e9ce96a650..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './constants'; -export * from './entities'; -export * from './utils'; diff --git a/uniswap-packages-forks/sdk-core/dist/index.js b/uniswap-packages-forks/sdk-core/dist/index.js deleted file mode 100644 index c3473ea9bf6..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/index.js +++ /dev/null @@ -1,8 +0,0 @@ - -'use strict' - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./sdk-core.cjs.production.min.js') -} else { - module.exports = require('./sdk-core.cjs.development.js') -} diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js deleted file mode 100644 index 07585205128..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js +++ /dev/null @@ -1,740 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var JSBI = _interopDefault(require('jsbi')); -var invariant = _interopDefault(require('tiny-invariant')); -var _Decimal = _interopDefault(require('decimal.js-light')); -var _Big = _interopDefault(require('big.js')); -var toFormat = _interopDefault(require('toformat')); -var address = require('@ethersproject/address'); - -(function (ChainId) { - ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; - ChainId[ChainId["ROPSTEN"] = 3] = "ROPSTEN"; - ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY"; - ChainId[ChainId["G\xD6RLI"] = 5] = "G\xD6RLI"; - ChainId[ChainId["KOVAN"] = 42] = "KOVAN"; - ChainId[ChainId["POLYGON_AMOY"] = 80002] = "POLYGON_AMOY"; -})(exports.ChainId || (exports.ChainId = {})); - -(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) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -/** - * Compares two currencies for equality - */ -function currencyEquals(currencyA, currencyB) { - if (currencyA.isToken && currencyB.isToken) { - return currencyA.equals(currencyB); - } else if (currencyA.isToken) { - return false; - } else if (currencyB.isToken) { - return false; - } else { - return currencyA.isEther === currencyB.isEther; - } -} - -/** - * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. - * - * The only instance of the base class `Currency` is Ether. - */ - -var BaseCurrency = -/** - * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. - * @param decimals decimals of the currency - * @param symbol symbol of the currency - * @param name of the currency - */ -function BaseCurrency(decimals, symbol, name) { - !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? invariant(false, 'DECIMALS') : void 0; - this.decimals = decimals; - this.symbol = symbol; - this.name = name; -}; - -/** - * Represents the currency Ether - */ - -var Ether = /*#__PURE__*/function (_BaseCurrency) { - _inheritsLoose(Ether, _BaseCurrency); - - /** - * Only called once by this class - * @protected - */ - function Ether() { - var _this; - - _this = _BaseCurrency.call(this, 18, 'ETH', 'Ether') || this; - _this.isEther = true; - _this.isToken = false; - return _this; - } - - return Ether; -}(BaseCurrency); -/** - * The only instance of the class `Ether`. - */ - -Ether.ETHER = /*#__PURE__*/new Ether(); -var ETHER = Ether.ETHER; - -/** - * Represents the currency Pol - */ - -var Pol = /*#__PURE__*/function (_BaseCurrency) { - _inheritsLoose(Pol, _BaseCurrency); - - /** - * Only called once by this class - * @protected - */ - function Pol() { - var _this; - - _this = _BaseCurrency.call(this, 18, 'POL', 'Pol') || this; - _this.isEther = true; - _this.isToken = false; - return _this; - } - - return Pol; -}(BaseCurrency); -/** - * The only instance of the class `Pol`. - */ - -Pol.POL = /*#__PURE__*/new Pol(); -var POL = Pol.POL; - -var _toSignificantRoundin, _toFixedRounding; -var Decimal = /*#__PURE__*/toFormat(_Decimal); -var Big = /*#__PURE__*/toFormat(_Big); -var toSignificantRounding = (_toSignificantRoundin = {}, _toSignificantRoundin[exports.Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN, _toSignificantRoundin[exports.Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP, _toSignificantRoundin[exports.Rounding.ROUND_UP] = Decimal.ROUND_UP, _toSignificantRoundin); -var toFixedRounding = (_toFixedRounding = {}, _toFixedRounding[exports.Rounding.ROUND_DOWN] = 0, _toFixedRounding[exports.Rounding.ROUND_HALF_UP] = 1, _toFixedRounding[exports.Rounding.ROUND_UP] = 3, _toFixedRounding); -var Fraction = /*#__PURE__*/function () { - function Fraction(numerator, denominator) { - if (denominator === void 0) { - denominator = JSBI.BigInt(1); - } - - this.numerator = JSBI.BigInt(numerator); - this.denominator = JSBI.BigInt(denominator); - } - - Fraction.tryParseFraction = function tryParseFraction(fractionish) { - if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') return new Fraction(fractionish); - if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish; - throw new Error('Could not parse fraction'); - } // performs floor division - ; - - var _proto = Fraction.prototype; - - _proto.invert = function invert() { - return new Fraction(this.denominator, this.numerator); - }; - - _proto.add = function add(other) { - var otherParsed = Fraction.tryParseFraction(other); - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator); - } - - return new Fraction(JSBI.add(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.subtract = function subtract(other) { - var otherParsed = Fraction.tryParseFraction(other); - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator); - } - - return new Fraction(JSBI.subtract(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.lessThan = function lessThan(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.lessThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.equalTo = function equalTo(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.equal(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.greaterThan = function greaterThan(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.greaterThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.multiply = function multiply(other) { - var otherParsed = Fraction.tryParseFraction(other); - return new Fraction(JSBI.multiply(this.numerator, otherParsed.numerator), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.divide = function divide(other) { - var otherParsed = Fraction.tryParseFraction(other); - return new Fraction(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(this.denominator, otherParsed.numerator)); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - if (rounding === void 0) { - rounding = exports.Rounding.ROUND_HALF_UP; - } - - !Number.isInteger(significantDigits) ? invariant(false, significantDigits + " is not an integer.") : void 0; - !(significantDigits > 0) ? invariant(false, significantDigits + " is not positive.") : void 0; - Decimal.set({ - precision: significantDigits + 1, - rounding: toSignificantRounding[rounding] - }); - var quotient = new Decimal(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(significantDigits); - return quotient.toFormat(quotient.decimalPlaces(), format); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - if (rounding === void 0) { - rounding = exports.Rounding.ROUND_HALF_UP; - } - - !Number.isInteger(decimalPlaces) ? invariant(false, decimalPlaces + " is not an integer.") : void 0; - !(decimalPlaces >= 0) ? invariant(false, decimalPlaces + " is negative.") : void 0; - Big.DP = decimalPlaces; - Big.RM = toFixedRounding[rounding]; - return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format); - } - /** - * Helper method for converting any super class back to a fraction - */ - ; - - _createClass(Fraction, [{ - key: "quotient", - get: function get() { - return JSBI.divide(this.numerator, this.denominator); - } // remainder after floor division - - }, { - key: "remainder", - get: function get() { - return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator); - } - }, { - key: "asFraction", - get: function get() { - return new Fraction(this.numerator, this.denominator); - } - }]); - - return Fraction; -}(); - -var Big$1 = /*#__PURE__*/toFormat(_Big); -var CurrencyAmount = /*#__PURE__*/function (_Fraction) { - _inheritsLoose(CurrencyAmount, _Fraction); - - function CurrencyAmount(currency, numerator, denominator) { - var _this; - - _this = _Fraction.call(this, numerator, denominator) || this; - !JSBI.lessThanOrEqual(_this.quotient, MaxUint256) ? invariant(false, 'AMOUNT') : void 0; - _this.currency = currency; - _this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals)); - return _this; - } - /** - * Returns a new currency amount instance from the - * @param currency the currency in the amount - * @param rawAmount the raw token or ether amount - */ - - - CurrencyAmount.fromRawAmount = function fromRawAmount(currency, rawAmount) { - return new CurrencyAmount(currency, rawAmount); - } - /** - * Construct a currency amount with a denominator that is not equal to 1 - * @param currency the currency - * @param numerator the numerator of the fractional token amount - * @param denominator the denominator of the fractional token amount - */ - ; - - CurrencyAmount.fromFractionalAmount = function fromFractionalAmount(currency, numerator, denominator) { - return new CurrencyAmount(currency, numerator, denominator); - } - /** - * Helper that calls the constructor with the ETHER currency - * @param rawAmount ether amount in wei - */ - ; - - CurrencyAmount.ether = function ether(rawAmount) { - return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount); - } - /** - * Helper that calls the constructor with the POL currency - * @param rawAmount pol amount in wei - */ - ; - - CurrencyAmount.pol = function pol(rawAmount) { - return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount); - }; - - var _proto = CurrencyAmount.prototype; - - _proto.add = function add(other) { - !currencyEquals(this.currency, other.currency) ? invariant(false, 'CURRENCY') : void 0; - - var added = _Fraction.prototype.add.call(this, other); - - return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator); - }; - - _proto.subtract = function subtract(other) { - !currencyEquals(this.currency, other.currency) ? invariant(false, 'CURRENCY') : void 0; - - var subtracted = _Fraction.prototype.subtract.call(this, other); - - return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator); - }; - - _proto.multiply = function multiply(other) { - var multiplied = _Fraction.prototype.multiply.call(this, other); - - return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator); - }; - - _proto.divide = function divide(other) { - var divided = _Fraction.prototype.divide.call(this, other); - - return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 6; - } - - if (rounding === void 0) { - rounding = exports.Rounding.ROUND_DOWN; - } - - return _Fraction.prototype.divide.call(this, this.decimalScale).toSignificant(significantDigits, format, rounding); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = this.currency.decimals; - } - - if (rounding === void 0) { - rounding = exports.Rounding.ROUND_DOWN; - } - - !(decimalPlaces <= this.currency.decimals) ? invariant(false, 'DECIMALS') : void 0; - return _Fraction.prototype.divide.call(this, this.decimalScale).toFixed(decimalPlaces, format, rounding); - }; - - _proto.toExact = function toExact(format) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - Big$1.DP = this.currency.decimals; - return new Big$1(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format); - }; - - return CurrencyAmount; -}(Fraction); - -var ONE_HUNDRED = /*#__PURE__*/new Fraction( /*#__PURE__*/JSBI.BigInt(100)); -/** - * Converts a fraction to a percent - * @param fraction the fraction to convert - */ - -function toPercent(fraction) { - return new Percent(fraction.numerator, fraction.denominator); -} - -var Percent = /*#__PURE__*/function (_Fraction) { - _inheritsLoose(Percent, _Fraction); - - function Percent() { - var _this; - - _this = _Fraction.apply(this, arguments) || this; - /** - * This boolean prevents a fraction from being interpreted as a Percent - */ - - _this.isPercent = true; - return _this; - } - - var _proto = Percent.prototype; - - _proto.add = function add(other) { - return toPercent(_Fraction.prototype.add.call(this, other)); - }; - - _proto.subtract = function subtract(other) { - return toPercent(_Fraction.prototype.subtract.call(this, other)); - }; - - _proto.multiply = function multiply(other) { - return toPercent(_Fraction.prototype.multiply.call(this, other)); - }; - - _proto.divide = function divide(other) { - return toPercent(_Fraction.prototype.divide.call(this, other)); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 5; - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 2; - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding); - }; - - return Percent; -}(Fraction); - -var Price = /*#__PURE__*/function (_Fraction) { - _inheritsLoose(Price, _Fraction); - - // denominator and numerator _must_ be raw, i.e. in the native representation - function Price(baseCurrency, quoteCurrency, denominator, numerator) { - var _this; - - _this = _Fraction.call(this, numerator, denominator) || this; - _this.baseCurrency = baseCurrency; - _this.quoteCurrency = quoteCurrency; - _this.scalar = new Fraction(JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)), JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))); - return _this; - } - /** - * Flip the price, switching the base and quote currency - */ - - - var _proto = Price.prototype; - - _proto.invert = function invert() { - return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator); - } - /** - * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency - * @param other the other price - */ - ; - - _proto.multiply = function multiply(other) { - !currencyEquals(this.quoteCurrency, other.baseCurrency) ? invariant(false, 'TOKEN') : void 0; - - var fraction = _Fraction.prototype.multiply.call(this, other); - - return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator); - } - /** - * Return the amount of quote currency corresponding to a given amount of the base currency - * @param currencyAmount the amount of base currency to quote against the price - */ - ; - - _proto.quote = function quote(currencyAmount) { - !currencyEquals(currencyAmount.currency, this.baseCurrency) ? invariant(false, 'TOKEN') : void 0; - - var result = _Fraction.prototype.multiply.call(this, currencyAmount); - - return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator); - } - /** - * Get the value scaled by decimals for formatting - * @private - */ - ; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 6; - } - - return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 4; - } - - return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding); - }; - - _createClass(Price, [{ - key: "adjustedForDecimals", - get: function get() { - return _Fraction.prototype.multiply.call(this, this.scalar); - } - }]); - - return Price; -}(Fraction); - -/** - * Validates an address and returns the parsed (checksummed) version of that address - * @param address the unchecksummed hex address - */ - -function validateAndParseAddress(address$1) { - try { - return address.getAddress(address$1); - } catch (error) { - throw new Error(address$1 + " is not a valid address."); - } -} - -var _WETH; -/** - * Represents an ERC20 token with a unique address and some metadata. - */ - -var Token = /*#__PURE__*/function (_BaseCurrency) { - _inheritsLoose(Token, _BaseCurrency); - - function Token(chainId, address, decimals, symbol, name) { - var _this; - - _this = _BaseCurrency.call(this, decimals, symbol, name) || this; - _this.isEther = false; - _this.isToken = true; - _this.chainId = chainId; - _this.address = validateAndParseAddress(address); - return _this; - } - /** - * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. - * @param other other token to compare - */ - - - var _proto = Token.prototype; - - _proto.equals = function equals(other) { - // short circuit on reference equality - if (this === other) { - return true; - } - - return this.chainId === other.chainId && this.address === other.address; - } - /** - * Returns true if the address of this token sorts before the address of the other token - * @param other other token to compare - * @throws if the tokens have the same address - * @throws if the tokens are on different chains - */ - ; - - _proto.sortsBefore = function sortsBefore(other) { - !(this.chainId === other.chainId) ? invariant(false, 'CHAIN_IDS') : void 0; - !(this.address !== other.address) ? invariant(false, 'ADDRESSES') : void 0; - return this.address.toLowerCase() < other.address.toLowerCase(); - }; - - return Token; -}(BaseCurrency); -var WETH9 = (_WETH = {}, _WETH[exports.ChainId.MAINNET] = /*#__PURE__*/new Token(exports.ChainId.MAINNET, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.ROPSTEN] = /*#__PURE__*/new Token(exports.ChainId.ROPSTEN, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.RINKEBY] = /*#__PURE__*/new Token(exports.ChainId.RINKEBY, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.GÖRLI] = /*#__PURE__*/new Token(exports.ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.KOVAN] = /*#__PURE__*/new Token(exports.ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'), _WETH[exports.ChainId.POLYGON_AMOY] = /*#__PURE__*/new Token(exports.ChainId.POLYGON_AMOY, '0xd7a19e388c52D3580B6428F29494883A5d40C330', 18, 'WETH9', 'Wrapped Ether'), _WETH); - -/** - * Returns the percent difference between the mid price and the execution price, i.e. price impact. - * @param midPrice mid price before the trade - * @param inputAmount the input amount of the trade - * @param outputAmount the output amount of the trade - */ - -function computePriceImpact(midPrice, inputAmount, outputAmount) { - var quotedOutputAmount = midPrice.quote(inputAmount); // calculate price impact := (exactQuote - outputAmount) / exactQuote - - var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount); - return new Percent(priceImpact.numerator, priceImpact.denominator); -} - -// `maxSize` by removing the last item - -function sortedInsert(items, add, maxSize, comparator) { - !(maxSize > 0) ? invariant(false, 'MAX_SIZE_ZERO') : void 0; // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize - - !(items.length <= maxSize) ? invariant(false, 'ITEMS_SIZE') : void 0; // short circuit first item add - - if (items.length === 0) { - items.push(add); - return null; - } else { - var isFull = items.length === maxSize; // short circuit if full and the additional item does not come before the last item - - if (isFull && comparator(items[items.length - 1], add) <= 0) { - return add; - } - - var lo = 0, - hi = items.length; - - while (lo < hi) { - var mid = lo + hi >>> 1; - - if (comparator(items[mid], add) <= 0) { - lo = mid + 1; - } else { - hi = mid; - } - } - - items.splice(lo, 0, add); - return isFull ? items.pop() : null; - } -} - -var MAX_SAFE_INTEGER = /*#__PURE__*/JSBI.BigInt(Number.MAX_SAFE_INTEGER); -var ZERO = /*#__PURE__*/JSBI.BigInt(0); -var ONE = /*#__PURE__*/JSBI.BigInt(1); -var TWO = /*#__PURE__*/JSBI.BigInt(2); -/** - * Computes floor(sqrt(value)) - * @param value the value for which to compute the square root, rounded down - */ - -function sqrt(value) { - !JSBI.greaterThanOrEqual(value, ZERO) ? invariant(false, 'NEGATIVE') : void 0; // rely on built in sqrt if possible - - if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) { - return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value)))); - } - - var z; - var x; - z = value; - x = JSBI.add(JSBI.divide(value, TWO), ONE); - - while (JSBI.lessThan(x, z)) { - z = x; - x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO); - } - - return z; -} - -/** - * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token - * @param currency the currency to wrap, if necessary - * @param chainId the ID of the chain for wrapping - */ - -function wrappedCurrency(currency, chainId) { - if (currency.isToken) { - !(currency.chainId === chainId) ? invariant(false, 'CHAIN_ID') : void 0; - return currency; - } - - if (currency.isEther) return WETH9[chainId]; - throw new Error('CURRENCY'); -} - -/** - * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. - * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns - * the input currency amount. - */ - -function wrappedCurrencyAmount(currencyAmount, chainId) { - return CurrencyAmount.fromFractionalAmount(wrappedCurrency(currencyAmount.currency, chainId), currencyAmount.numerator, currencyAmount.denominator); -} - -exports.CurrencyAmount = CurrencyAmount; -exports.ETHER = ETHER; -exports.Ether = Ether; -exports.Fraction = Fraction; -exports.MaxUint256 = MaxUint256; -exports.POL = POL; -exports.Percent = Percent; -exports.Pol = Pol; -exports.Price = Price; -exports.Token = Token; -exports.WETH9 = WETH9; -exports.computePriceImpact = computePriceImpact; -exports.currencyEquals = currencyEquals; -exports.sortedInsert = sortedInsert; -exports.sqrt = sqrt; -exports.validateAndParseAddress = validateAndParseAddress; -exports.wrappedCurrency = wrappedCurrency; -exports.wrappedCurrencyAmount = wrappedCurrencyAmount; -//# sourceMappingURL=sdk-core.cjs.development.js.map diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js.map b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js.map deleted file mode 100644 index e70f1e4aa00..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.development.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sdk-core.cjs.development.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/pol.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\r\n\r\n// exports for external consumption\r\nexport type BigintIsh = JSBI | string | number\r\n\r\nexport enum ChainId {\r\n MAINNET = 1,\r\n ROPSTEN = 3,\r\n RINKEBY = 4,\r\n GÖRLI = 5,\r\n KOVAN = 42,\r\n POLYGON_AMOY = 80002,\r\n}\r\n\r\nexport enum TradeType {\r\n EXACT_INPUT,\r\n EXACT_OUTPUT\r\n}\r\n\r\nexport enum Rounding {\r\n ROUND_DOWN,\r\n ROUND_HALF_UP,\r\n ROUND_UP\r\n}\r\n\r\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\r\n","import { Currency } from '../entities/currency'\r\n\r\n/**\r\n * Compares two currencies for equality\r\n */\r\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\r\n if (currencyA.isToken && currencyB.isToken) {\r\n return currencyA.equals(currencyB)\r\n } else if (currencyA.isToken) {\r\n return false\r\n } else if (currencyB.isToken) {\r\n return false\r\n } else {\r\n return currencyA.isEther === currencyB.isEther\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n/**\r\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\r\n *\r\n * The only instance of the base class `Currency` is Ether.\r\n */\r\nexport abstract class BaseCurrency {\r\n public abstract readonly isEther: boolean\r\n public abstract readonly isToken: boolean\r\n\r\n public readonly decimals: number\r\n public readonly symbol?: string\r\n public readonly name?: string\r\n\r\n /**\r\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\r\n * @param decimals decimals of the currency\r\n * @param symbol symbol of the currency\r\n * @param name of the currency\r\n */\r\n protected constructor(decimals: number, symbol?: string, name?: string) {\r\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\r\n\r\n this.decimals = decimals\r\n this.symbol = symbol\r\n this.name = name\r\n }\r\n}\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Ether\r\n */\r\nexport class Ether extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'ETH', 'Ether')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Ether`.\r\n */\r\n public static readonly ETHER: Ether = new Ether()\r\n}\r\n\r\nexport const ETHER = Ether.ETHER\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Pol\r\n */\r\nexport class Pol extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'POL', 'Pol')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Pol`.\r\n */\r\n public static readonly POL: Pol = new Pol()\r\n}\r\n\r\nexport const POL = Pol.POL\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\nimport _Decimal from 'decimal.js-light'\r\nimport _Big, { RoundingMode } from 'big.js'\r\nimport toFormat from 'toformat'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\n\r\nconst Decimal = toFormat(_Decimal)\r\nconst Big = toFormat(_Big)\r\n\r\nconst toSignificantRounding = {\r\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\r\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\r\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\r\n}\r\n\r\nconst toFixedRounding = {\r\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\r\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\r\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\r\n}\r\n\r\nexport class Fraction {\r\n public readonly numerator: JSBI\r\n public readonly denominator: JSBI\r\n\r\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\r\n this.numerator = JSBI.BigInt(numerator)\r\n this.denominator = JSBI.BigInt(denominator)\r\n }\r\n\r\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\r\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\r\n return new Fraction(fractionish)\r\n\r\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\r\n throw new Error('Could not parse fraction')\r\n }\r\n\r\n // performs floor division\r\n public get quotient(): JSBI {\r\n return JSBI.divide(this.numerator, this.denominator)\r\n }\r\n\r\n // remainder after floor division\r\n public get remainder(): Fraction {\r\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\r\n }\r\n\r\n public invert(): Fraction {\r\n return new Fraction(this.denominator, this.numerator)\r\n }\r\n\r\n public add(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.add(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public subtract(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.subtract(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public lessThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.lessThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public equalTo(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.equal(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public greaterThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.greaterThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.numerator),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(this.denominator, otherParsed.numerator)\r\n )\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\r\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\r\n\r\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\r\n const quotient = new Decimal(this.numerator.toString())\r\n .div(this.denominator.toString())\r\n .toSignificantDigits(significantDigits)\r\n return quotient.toFormat(quotient.decimalPlaces(), format)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\r\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\r\n\r\n Big.DP = decimalPlaces\r\n Big.RM = toFixedRounding[rounding]\r\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\r\n }\r\n\r\n /**\r\n * Helper method for converting any super class back to a fraction\r\n */\r\n public get asFraction(): Fraction {\r\n return new Fraction(this.numerator, this.denominator)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport { Currency } from '../currency'\r\nimport { Ether } from '../ether'\r\nimport { Pol } from '../pol'\r\nimport { Fraction } from './fraction'\r\nimport _Big from 'big.js'\r\n\r\nimport toFormat from 'toformat'\r\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\r\n\r\nconst Big = toFormat(_Big)\r\n\r\nexport class CurrencyAmount extends Fraction {\r\n public readonly currency: T\r\n public readonly decimalScale: JSBI\r\n\r\n /**\r\n * Returns a new currency amount instance from the\r\n * @param currency the currency in the amount\r\n * @param rawAmount the raw token or ether amount\r\n */\r\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\r\n return new CurrencyAmount(currency, rawAmount)\r\n }\r\n\r\n /**\r\n * Construct a currency amount with a denominator that is not equal to 1\r\n * @param currency the currency\r\n * @param numerator the numerator of the fractional token amount\r\n * @param denominator the denominator of the fractional token amount\r\n */\r\n public static fromFractionalAmount(\r\n currency: T,\r\n numerator: BigintIsh,\r\n denominator: BigintIsh\r\n ): CurrencyAmount {\r\n return new CurrencyAmount(currency, numerator, denominator)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the ETHER currency\r\n * @param rawAmount ether amount in wei\r\n */\r\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the POL currency\r\n * @param rawAmount pol amount in wei\r\n */\r\n public static pol(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount)\r\n }\r\n\r\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\r\n super(numerator, denominator)\r\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\r\n this.currency = currency\r\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\r\n }\r\n\r\n public add(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const added = super.add(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\r\n }\r\n\r\n public subtract(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const subtracted = super.subtract(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\r\n const multiplied = super.multiply(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\r\n const divided = super.divide(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number = 6,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number = this.currency.decimals,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\r\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\r\n }\r\n\r\n public toExact(format: object = { groupSeparator: '' }): string {\r\n Big.DP = this.currency.decimals\r\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Fraction } from './fraction'\r\n\r\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\r\n\r\n/**\r\n * Converts a fraction to a percent\r\n * @param fraction the fraction to convert\r\n */\r\nfunction toPercent(fraction: Fraction): Percent {\r\n return new Percent(fraction.numerator, fraction.denominator)\r\n}\r\n\r\nexport class Percent extends Fraction {\r\n /**\r\n * This boolean prevents a fraction from being interpreted as a Percent\r\n */\r\n public readonly isPercent: true = true\r\n\r\n add(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.add(other))\r\n }\r\n\r\n subtract(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.subtract(other))\r\n }\r\n\r\n multiply(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.multiply(other))\r\n }\r\n\r\n divide(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.divide(other))\r\n }\r\n\r\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport invariant from 'tiny-invariant'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Currency } from '../currency'\r\nimport { Fraction } from './fraction'\r\nimport { CurrencyAmount } from './currencyAmount'\r\n\r\nexport class Price extends Fraction {\r\n public readonly baseCurrency: TBase // input i.e. denominator\r\n public readonly quoteCurrency: TQuote // output i.e. numerator\r\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\r\n\r\n // denominator and numerator _must_ be raw, i.e. in the native representation\r\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\r\n super(numerator, denominator)\r\n\r\n this.baseCurrency = baseCurrency\r\n this.quoteCurrency = quoteCurrency\r\n this.scalar = new Fraction(\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\r\n )\r\n }\r\n\r\n /**\r\n * Flip the price, switching the base and quote currency\r\n */\r\n public invert(): Price {\r\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\r\n }\r\n\r\n /**\r\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\r\n * @param other the other price\r\n */\r\n public multiply(other: Price): Price {\r\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\r\n const fraction = super.multiply(other)\r\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\r\n }\r\n\r\n /**\r\n * Return the amount of quote currency corresponding to a given amount of the base currency\r\n * @param currencyAmount the amount of base currency to quote against the price\r\n */\r\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\r\n const result = super.multiply(currencyAmount)\r\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\r\n }\r\n\r\n /**\r\n * Get the value scaled by decimals for formatting\r\n * @private\r\n */\r\n private get adjustedForDecimals(): Fraction {\r\n return super.multiply(this.scalar)\r\n }\r\n\r\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import { getAddress } from '@ethersproject/address'\r\n\r\n/**\r\n * Validates an address and returns the parsed (checksummed) version of that address\r\n * @param address the unchecksummed hex address\r\n */\r\nexport function validateAndParseAddress(address: string): string {\r\n try {\r\n return getAddress(address)\r\n } catch (error) {\r\n throw new Error(`${address} is not a valid address.`)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\r\nimport { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents an ERC20 token with a unique address and some metadata.\r\n */\r\nexport class Token extends BaseCurrency {\r\n public readonly isEther: false = false\r\n public readonly isToken: true = true\r\n\r\n public readonly chainId: ChainId | number\r\n public readonly address: string\r\n\r\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\r\n super(decimals, symbol, name)\r\n this.chainId = chainId\r\n this.address = validateAndParseAddress(address)\r\n }\r\n\r\n /**\r\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\r\n * @param other other token to compare\r\n */\r\n public equals(other: Token): boolean {\r\n // short circuit on reference equality\r\n if (this === other) {\r\n return true\r\n }\r\n return this.chainId === other.chainId && this.address === other.address\r\n }\r\n\r\n /**\r\n * Returns true if the address of this token sorts before the address of the other token\r\n * @param other other token to compare\r\n * @throws if the tokens have the same address\r\n * @throws if the tokens are on different chains\r\n */\r\n public sortsBefore(other: Token): boolean {\r\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\r\n invariant(this.address !== other.address, 'ADDRESSES')\r\n return this.address.toLowerCase() < other.address.toLowerCase()\r\n }\r\n}\r\n\r\nexport const WETH9: { [chainId in ChainId]: Token } = {\r\n [ChainId.MAINNET]: new Token(\r\n ChainId.MAINNET,\r\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.ROPSTEN]: new Token(\r\n ChainId.ROPSTEN,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.RINKEBY]: new Token(\r\n ChainId.RINKEBY,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.POLYGON_AMOY]: new Token(\r\n ChainId.POLYGON_AMOY,\r\n '0xd7a19e388c52D3580B6428F29494883A5d40C330',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n )\r\n}\r\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\r\n\r\n/**\r\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\r\n * @param midPrice mid price before the trade\r\n * @param inputAmount the input amount of the trade\r\n * @param outputAmount the output amount of the trade\r\n */\r\nexport function computePriceImpact(\r\n midPrice: Price,\r\n inputAmount: CurrencyAmount,\r\n outputAmount: CurrencyAmount\r\n): Percent {\r\n const quotedOutputAmount = midPrice.quote(inputAmount)\r\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\r\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\r\n return new Percent(priceImpact.numerator, priceImpact.denominator)\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\r\n// `maxSize` by removing the last item\r\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\r\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\r\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\r\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\r\n\r\n // short circuit first item add\r\n if (items.length === 0) {\r\n items.push(add)\r\n return null\r\n } else {\r\n const isFull = items.length === maxSize\r\n // short circuit if full and the additional item does not come before the last item\r\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\r\n return add\r\n }\r\n\r\n let lo = 0,\r\n hi = items.length\r\n\r\n while (lo < hi) {\r\n const mid = (lo + hi) >>> 1\r\n if (comparator(items[mid], add) <= 0) {\r\n lo = mid + 1\r\n } else {\r\n hi = mid\r\n }\r\n }\r\n items.splice(lo, 0, add)\r\n return isFull ? items.pop()! : null\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\n\r\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\r\n\r\nconst ZERO = JSBI.BigInt(0)\r\nconst ONE = JSBI.BigInt(1)\r\nconst TWO = JSBI.BigInt(2)\r\n\r\n/**\r\n * Computes floor(sqrt(value))\r\n * @param value the value for which to compute the square root, rounded down\r\n */\r\nexport function sqrt(value: JSBI): JSBI {\r\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\r\n\r\n // rely on built in sqrt if possible\r\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\r\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\r\n }\r\n\r\n let z: JSBI\r\n let x: JSBI\r\n z = value\r\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\r\n while (JSBI.lessThan(x, z)) {\r\n z = x\r\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\r\n }\r\n return z\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { Currency, Token, WETH9 } from '../entities'\r\n\r\n/**\r\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\r\n * @param currency the currency to wrap, if necessary\r\n * @param chainId the ID of the chain for wrapping\r\n */\r\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\r\n if (currency.isToken) {\r\n invariant(currency.chainId === chainId, 'CHAIN_ID')\r\n return currency\r\n }\r\n if (currency.isEther) return WETH9[chainId]\r\n throw new Error('CURRENCY')\r\n}\r\n","import { ChainId } from '../constants'\r\nimport { Currency, CurrencyAmount, Token } from '../entities'\r\nimport { wrappedCurrency } from './wrappedCurrency'\r\n\r\n/**\r\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\r\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\r\n * the input currency amount.\r\n */\r\nexport function wrappedCurrencyAmount(\r\n currencyAmount: CurrencyAmount,\r\n chainId: ChainId\r\n): CurrencyAmount {\r\n return CurrencyAmount.fromFractionalAmount(\r\n wrappedCurrency(currencyAmount.currency, chainId),\r\n currencyAmount.numerator,\r\n currencyAmount.denominator\r\n )\r\n}\r\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Pol","POL","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","pol","added","subtracted","multiplied","divided","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","POLYGON_AMOY","computePriceImpact","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","sortedInsert","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","MAX_SAFE_INTEGER","ZERO","ONE","TWO","sqrt","value","greaterThanOrEqual","Math","floor","toNumber","z","x","wrappedCurrency","wrappedCurrencyAmount"],"mappings":";;;;;;;;;;;;;AAKA,WAAYA;AACVA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,gCAAA,aAAA;AACAA,EAAAA,8BAAA,UAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAPD,EAAYA,eAAO,KAAPA,eAAO,KAAA,CAAnB;;AASA,WAAYC;AACVA,EAAAA,uCAAA,gBAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAHD,EAAYA,iBAAS,KAATA,iBAAS,KAAA,CAArB;;AAKA,WAAYC;AACVA,EAAAA,oCAAA,eAAA;AACAA,EAAAA,uCAAA,kBAAA;AACAA,EAAAA,kCAAA,aAAA;AACD,CAJD,EAAYA,gBAAQ,KAARA,gBAAQ,KAAA,CAApB;;IAMaC,UAAU,gBAAGC,IAAI,CAACC,MAAL,CAAY,oEAAZ;;;;;;;;;;;;;;;;;;;;;;;;AC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BM,CAAnB,CAAT,EAAgCA,CAAhC,CAAZ,EAAgDR,GAAhD,CAAJ;AACD;;AACD,SAAOO,CAAP;AACD;;AC1BD;;;;;;AAKA,SAAgBE,gBAAgBvE,UAAoB+B;AAClD,MAAI/B,QAAQ,CAAC1D,OAAb,EAAsB;AACpB,MAAU0D,QAAQ,CAAC+B,OAAT,KAAqBA,OAA/B,KAAAhF,SAAS,QAA+B,UAA/B,CAAT,CAAA;AACA,WAAOiD,QAAP;AACD;;AACD,MAAIA,QAAQ,CAACxD,OAAb,EAAsB,OAAO0F,KAAK,CAACH,OAAD,CAAZ;AACtB,QAAM,IAAI5D,KAAJ,CAAU,UAAV,CAAN;AACD;;ACZD;;;;;;AAKA,SAAgBqG,sBACdjD,gBACAQ;AAEA,SAAOhC,cAAc,CAACO,oBAAf,CACLiE,eAAe,CAAChD,cAAc,CAACvB,QAAhB,EAA0B+B,OAA1B,CADV,EAELR,cAAc,CAACxD,SAFV,EAGLwD,cAAc,CAACvD,WAHV,CAAP;AAKD;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js deleted file mode 100644 index 08f0aa10e57..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js +++ /dev/null @@ -1,2 +0,0 @@ -"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.ChainId||(exports.ChainId={}))[r.MAINNET=1]="MAINNET",r[r.ROPSTEN=3]="ROPSTEN",r[r.RINKEBY=4]="RINKEBY",r[r["GÖRLI"]=5]="GÖRLI",r[r.KOVAN=42]="KOVAN",r[r.POLYGON_AMOY=80002]="POLYGON_AMOY",(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=i.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function f(t,r){for(var n=0;n=0&&t<255&&Number.isInteger(t)||o(!1),this.decimals=t,this.symbol=r,this.name=n},y=function(t){function r(){var r;return(r=t.call(this,18,"ETH","Ether")||this).isEther=!0,r.isToken=!1,r}return p(r,t),r}(h);y.ETHER=new y;var v=y.ETHER,g=function(t){function r(){var r;return(r=t.call(this,18,"POL","Pol")||this).isEther=!0,r.isToken=!1,r}return p(r,t),r}(h);g.POL=new g;var x,E,N=g.POL,O=s(a),I=s(u),R=((x={})[exports.Rounding.ROUND_DOWN]=O.ROUND_DOWN,x[exports.Rounding.ROUND_HALF_UP]=O.ROUND_HALF_UP,x[exports.Rounding.ROUND_UP]=O.ROUND_UP,x),T=((E={})[exports.Rounding.ROUND_DOWN]=0,E[exports.Rounding.ROUND_HALF_UP]=1,E[exports.Rounding.ROUND_UP]=3,E),A=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),O.set({precision:t+1,rounding:R[n]});var e=new O(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),I.DP=t,I.RM=T[n],new I(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,r)},l(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}(),P=s(u),F=function(t){function r(r,n,e){var a;return a=t.call(this,n,e)||this,i.lessThanOrEqual(a.quotient,d)||o(!1),a.currency=r,a.decimalScale=i.exponentiate(i.BigInt(10),i.BigInt(r.decimals)),a}p(r,t),r.fromRawAmount=function(t,n){return new r(t,n)},r.fromFractionalAmount=function(t,n,e){return new r(t,n,e)},r.ether=function(t){return r.fromRawAmount(y.ETHER,t)},r.pol=function(t){return r.fromRawAmount(g.POL,t)};var n=r.prototype;return n.add=function(n){m(this.currency,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){m(this.currency,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:""}),P.DP=this.currency.decimals,new P(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(t)},r}(A),C=new A(i.BigInt(100));function w(t){return new U(t.numerator,t.denominator)}var _,U=function(t){function r(){var r;return(r=t.apply(this,arguments)||this).isPercent=!0,r}p(r,t);var n=r.prototype;return n.add=function(r){return w(t.prototype.add.call(this,r))},n.subtract=function(r){return w(t.prototype.subtract.call(this,r))},n.multiply=function(r){return w(t.prototype.multiply.call(this,r))},n.divide=function(r){return w(t.prototype.divide.call(this,r))},n.toSignificant=function(r,n,e){return void 0===r&&(r=5),t.prototype.multiply.call(this,C).toSignificant(r,n,e)},n.toFixed=function(r,n,e){return void 0===r&&(r=2),t.prototype.multiply.call(this,C).toFixed(r,n,e)},r}(A),D=function(t){function r(r,n,e,o){var a;return(a=t.call(this,o,e)||this).baseCurrency=r,a.quoteCurrency=n,a.scalar=new A(i.exponentiate(i.BigInt(10),i.BigInt(r.decimals)),i.exponentiate(i.BigInt(10),i.BigInt(n.decimals))),a}p(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){m(this.quoteCurrency,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){m(r.currency,this.baseCurrency)||o(!1);var n=t.prototype.multiply.call(this,r);return F.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)},l(r,[{key:"adjustedForDecimals",get:function(){return t.prototype.multiply.call(this,this.scalar)}}]),r}(A);function b(t){try{return c.getAddress(t)}catch(r){throw new Error(t+" is not a valid address.")}}var q=function(t){function r(r,n,e,i,o){var a;return(a=t.call(this,e,i,o)||this).isEther=!1,a.isToken=!0,a.chainId=r,a.address=b(n),a}p(r,t);var n=r.prototype;return n.equals=function(t){return this===t||this.chainId===t.chainId&&this.address===t.address},n.sortsBefore=function(t){return this.chainId!==t.chainId&&o(!1),this.address===t.address&&o(!1),this.address.toLowerCase()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>>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,L)||o(!1),i.lessThan(t,S))return i.BigInt(Math.floor(Math.sqrt(i.toNumber(t))));var r,n;for(r=t,n=i.add(i.divide(t,H),W);i.lessThan(n,r);)r=n,n=i.divide(i.add(i.divide(t,n),n),H);return r},exports.validateAndParseAddress=b,exports.wrappedCurrency=k,exports.wrappedCurrencyAmount=function(t,r){return F.fromFractionalAmount(k(t.currency,r),t.numerator,t.denominator)}; -//# sourceMappingURL=sdk-core.cjs.production.min.js.map diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js.map b/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js.map deleted file mode 100644 index 969e396b880..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/sdk-core.cjs.production.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sdk-core.cjs.production.min.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/pol.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\r\n\r\n// exports for external consumption\r\nexport type BigintIsh = JSBI | string | number\r\n\r\nexport enum ChainId {\r\n MAINNET = 1,\r\n ROPSTEN = 3,\r\n RINKEBY = 4,\r\n GÖRLI = 5,\r\n KOVAN = 42,\r\n POLYGON_AMOY = 80002,\r\n}\r\n\r\nexport enum TradeType {\r\n EXACT_INPUT,\r\n EXACT_OUTPUT\r\n}\r\n\r\nexport enum Rounding {\r\n ROUND_DOWN,\r\n ROUND_HALF_UP,\r\n ROUND_UP\r\n}\r\n\r\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\r\n","import { Currency } from '../entities/currency'\r\n\r\n/**\r\n * Compares two currencies for equality\r\n */\r\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\r\n if (currencyA.isToken && currencyB.isToken) {\r\n return currencyA.equals(currencyB)\r\n } else if (currencyA.isToken) {\r\n return false\r\n } else if (currencyB.isToken) {\r\n return false\r\n } else {\r\n return currencyA.isEther === currencyB.isEther\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n/**\r\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\r\n *\r\n * The only instance of the base class `Currency` is Ether.\r\n */\r\nexport abstract class BaseCurrency {\r\n public abstract readonly isEther: boolean\r\n public abstract readonly isToken: boolean\r\n\r\n public readonly decimals: number\r\n public readonly symbol?: string\r\n public readonly name?: string\r\n\r\n /**\r\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\r\n * @param decimals decimals of the currency\r\n * @param symbol symbol of the currency\r\n * @param name of the currency\r\n */\r\n protected constructor(decimals: number, symbol?: string, name?: string) {\r\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\r\n\r\n this.decimals = decimals\r\n this.symbol = symbol\r\n this.name = name\r\n }\r\n}\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Ether\r\n */\r\nexport class Ether extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'ETH', 'Ether')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Ether`.\r\n */\r\n public static readonly ETHER: Ether = new Ether()\r\n}\r\n\r\nexport const ETHER = Ether.ETHER\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Pol\r\n */\r\nexport class Pol extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'POL', 'Pol')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Pol`.\r\n */\r\n public static readonly POL: Pol = new Pol()\r\n}\r\n\r\nexport const POL = Pol.POL\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\nimport _Decimal from 'decimal.js-light'\r\nimport _Big, { RoundingMode } from 'big.js'\r\nimport toFormat from 'toformat'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\n\r\nconst Decimal = toFormat(_Decimal)\r\nconst Big = toFormat(_Big)\r\n\r\nconst toSignificantRounding = {\r\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\r\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\r\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\r\n}\r\n\r\nconst toFixedRounding = {\r\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\r\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\r\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\r\n}\r\n\r\nexport class Fraction {\r\n public readonly numerator: JSBI\r\n public readonly denominator: JSBI\r\n\r\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\r\n this.numerator = JSBI.BigInt(numerator)\r\n this.denominator = JSBI.BigInt(denominator)\r\n }\r\n\r\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\r\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\r\n return new Fraction(fractionish)\r\n\r\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\r\n throw new Error('Could not parse fraction')\r\n }\r\n\r\n // performs floor division\r\n public get quotient(): JSBI {\r\n return JSBI.divide(this.numerator, this.denominator)\r\n }\r\n\r\n // remainder after floor division\r\n public get remainder(): Fraction {\r\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\r\n }\r\n\r\n public invert(): Fraction {\r\n return new Fraction(this.denominator, this.numerator)\r\n }\r\n\r\n public add(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.add(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public subtract(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.subtract(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public lessThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.lessThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public equalTo(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.equal(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public greaterThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.greaterThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.numerator),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(this.denominator, otherParsed.numerator)\r\n )\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\r\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\r\n\r\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\r\n const quotient = new Decimal(this.numerator.toString())\r\n .div(this.denominator.toString())\r\n .toSignificantDigits(significantDigits)\r\n return quotient.toFormat(quotient.decimalPlaces(), format)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\r\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\r\n\r\n Big.DP = decimalPlaces\r\n Big.RM = toFixedRounding[rounding]\r\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\r\n }\r\n\r\n /**\r\n * Helper method for converting any super class back to a fraction\r\n */\r\n public get asFraction(): Fraction {\r\n return new Fraction(this.numerator, this.denominator)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport { Currency } from '../currency'\r\nimport { Ether } from '../ether'\r\nimport { Pol } from '../pol'\r\nimport { Fraction } from './fraction'\r\nimport _Big from 'big.js'\r\n\r\nimport toFormat from 'toformat'\r\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\r\n\r\nconst Big = toFormat(_Big)\r\n\r\nexport class CurrencyAmount extends Fraction {\r\n public readonly currency: T\r\n public readonly decimalScale: JSBI\r\n\r\n /**\r\n * Returns a new currency amount instance from the\r\n * @param currency the currency in the amount\r\n * @param rawAmount the raw token or ether amount\r\n */\r\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\r\n return new CurrencyAmount(currency, rawAmount)\r\n }\r\n\r\n /**\r\n * Construct a currency amount with a denominator that is not equal to 1\r\n * @param currency the currency\r\n * @param numerator the numerator of the fractional token amount\r\n * @param denominator the denominator of the fractional token amount\r\n */\r\n public static fromFractionalAmount(\r\n currency: T,\r\n numerator: BigintIsh,\r\n denominator: BigintIsh\r\n ): CurrencyAmount {\r\n return new CurrencyAmount(currency, numerator, denominator)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the ETHER currency\r\n * @param rawAmount ether amount in wei\r\n */\r\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the POL currency\r\n * @param rawAmount pol amount in wei\r\n */\r\n public static pol(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount)\r\n }\r\n\r\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\r\n super(numerator, denominator)\r\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\r\n this.currency = currency\r\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\r\n }\r\n\r\n public add(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const added = super.add(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\r\n }\r\n\r\n public subtract(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const subtracted = super.subtract(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\r\n const multiplied = super.multiply(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\r\n const divided = super.divide(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number = 6,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number = this.currency.decimals,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\r\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\r\n }\r\n\r\n public toExact(format: object = { groupSeparator: '' }): string {\r\n Big.DP = this.currency.decimals\r\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Fraction } from './fraction'\r\n\r\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\r\n\r\n/**\r\n * Converts a fraction to a percent\r\n * @param fraction the fraction to convert\r\n */\r\nfunction toPercent(fraction: Fraction): Percent {\r\n return new Percent(fraction.numerator, fraction.denominator)\r\n}\r\n\r\nexport class Percent extends Fraction {\r\n /**\r\n * This boolean prevents a fraction from being interpreted as a Percent\r\n */\r\n public readonly isPercent: true = true\r\n\r\n add(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.add(other))\r\n }\r\n\r\n subtract(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.subtract(other))\r\n }\r\n\r\n multiply(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.multiply(other))\r\n }\r\n\r\n divide(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.divide(other))\r\n }\r\n\r\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport invariant from 'tiny-invariant'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Currency } from '../currency'\r\nimport { Fraction } from './fraction'\r\nimport { CurrencyAmount } from './currencyAmount'\r\n\r\nexport class Price extends Fraction {\r\n public readonly baseCurrency: TBase // input i.e. denominator\r\n public readonly quoteCurrency: TQuote // output i.e. numerator\r\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\r\n\r\n // denominator and numerator _must_ be raw, i.e. in the native representation\r\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\r\n super(numerator, denominator)\r\n\r\n this.baseCurrency = baseCurrency\r\n this.quoteCurrency = quoteCurrency\r\n this.scalar = new Fraction(\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\r\n )\r\n }\r\n\r\n /**\r\n * Flip the price, switching the base and quote currency\r\n */\r\n public invert(): Price {\r\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\r\n }\r\n\r\n /**\r\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\r\n * @param other the other price\r\n */\r\n public multiply(other: Price): Price {\r\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\r\n const fraction = super.multiply(other)\r\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\r\n }\r\n\r\n /**\r\n * Return the amount of quote currency corresponding to a given amount of the base currency\r\n * @param currencyAmount the amount of base currency to quote against the price\r\n */\r\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\r\n const result = super.multiply(currencyAmount)\r\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\r\n }\r\n\r\n /**\r\n * Get the value scaled by decimals for formatting\r\n * @private\r\n */\r\n private get adjustedForDecimals(): Fraction {\r\n return super.multiply(this.scalar)\r\n }\r\n\r\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import { getAddress } from '@ethersproject/address'\r\n\r\n/**\r\n * Validates an address and returns the parsed (checksummed) version of that address\r\n * @param address the unchecksummed hex address\r\n */\r\nexport function validateAndParseAddress(address: string): string {\r\n try {\r\n return getAddress(address)\r\n } catch (error) {\r\n throw new Error(`${address} is not a valid address.`)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\r\nimport { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents an ERC20 token with a unique address and some metadata.\r\n */\r\nexport class Token extends BaseCurrency {\r\n public readonly isEther: false = false\r\n public readonly isToken: true = true\r\n\r\n public readonly chainId: ChainId | number\r\n public readonly address: string\r\n\r\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\r\n super(decimals, symbol, name)\r\n this.chainId = chainId\r\n this.address = validateAndParseAddress(address)\r\n }\r\n\r\n /**\r\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\r\n * @param other other token to compare\r\n */\r\n public equals(other: Token): boolean {\r\n // short circuit on reference equality\r\n if (this === other) {\r\n return true\r\n }\r\n return this.chainId === other.chainId && this.address === other.address\r\n }\r\n\r\n /**\r\n * Returns true if the address of this token sorts before the address of the other token\r\n * @param other other token to compare\r\n * @throws if the tokens have the same address\r\n * @throws if the tokens are on different chains\r\n */\r\n public sortsBefore(other: Token): boolean {\r\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\r\n invariant(this.address !== other.address, 'ADDRESSES')\r\n return this.address.toLowerCase() < other.address.toLowerCase()\r\n }\r\n}\r\n\r\nexport const WETH9: { [chainId in ChainId]: Token } = {\r\n [ChainId.MAINNET]: new Token(\r\n ChainId.MAINNET,\r\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.ROPSTEN]: new Token(\r\n ChainId.ROPSTEN,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.RINKEBY]: new Token(\r\n ChainId.RINKEBY,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.POLYGON_AMOY]: new Token(\r\n ChainId.POLYGON_AMOY,\r\n '0xd7a19e388c52D3580B6428F29494883A5d40C330',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n )\r\n}\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\n\r\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\r\n\r\nconst ZERO = JSBI.BigInt(0)\r\nconst ONE = JSBI.BigInt(1)\r\nconst TWO = JSBI.BigInt(2)\r\n\r\n/**\r\n * Computes floor(sqrt(value))\r\n * @param value the value for which to compute the square root, rounded down\r\n */\r\nexport function sqrt(value: JSBI): JSBI {\r\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\r\n\r\n // rely on built in sqrt if possible\r\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\r\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\r\n }\r\n\r\n let z: JSBI\r\n let x: JSBI\r\n z = value\r\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\r\n while (JSBI.lessThan(x, z)) {\r\n z = x\r\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\r\n }\r\n return z\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { Currency, Token, WETH9 } from '../entities'\r\n\r\n/**\r\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\r\n * @param currency the currency to wrap, if necessary\r\n * @param chainId the ID of the chain for wrapping\r\n */\r\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\r\n if (currency.isToken) {\r\n invariant(currency.chainId === chainId, 'CHAIN_ID')\r\n return currency\r\n }\r\n if (currency.isEther) return WETH9[chainId]\r\n throw new Error('CURRENCY')\r\n}\r\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\r\n\r\n/**\r\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\r\n * @param midPrice mid price before the trade\r\n * @param inputAmount the input amount of the trade\r\n * @param outputAmount the output amount of the trade\r\n */\r\nexport function computePriceImpact(\r\n midPrice: Price,\r\n inputAmount: CurrencyAmount,\r\n outputAmount: CurrencyAmount\r\n): Percent {\r\n const quotedOutputAmount = midPrice.quote(inputAmount)\r\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\r\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\r\n return new Percent(priceImpact.numerator, priceImpact.denominator)\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\r\n// `maxSize` by removing the last item\r\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\r\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\r\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\r\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\r\n\r\n // short circuit first item add\r\n if (items.length === 0) {\r\n items.push(add)\r\n return null\r\n } else {\r\n const isFull = items.length === maxSize\r\n // short circuit if full and the additional item does not come before the last item\r\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\r\n return add\r\n }\r\n\r\n let lo = 0,\r\n hi = items.length\r\n\r\n while (lo < hi) {\r\n const mid = (lo + hi) >>> 1\r\n if (comparator(items[mid], add) <= 0) {\r\n lo = mid + 1\r\n } else {\r\n hi = mid\r\n }\r\n }\r\n items.splice(lo, 0, add)\r\n return isFull ? items.pop()! : null\r\n }\r\n}\r\n","import { ChainId } from '../constants'\r\nimport { Currency, CurrencyAmount, Token } from '../entities'\r\nimport { wrappedCurrency } from './wrappedCurrency'\r\n\r\n/**\r\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\r\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\r\n * the input currency amount.\r\n */\r\nexport function wrappedCurrencyAmount(\r\n currencyAmount: CurrencyAmount,\r\n chainId: ChainId\r\n): CurrencyAmount {\r\n return CurrencyAmount.fromFractionalAmount(\r\n wrappedCurrency(currencyAmount.currency, chainId),\r\n currencyAmount.numerator,\r\n currencyAmount.denominator\r\n )\r\n}\r\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Pol","POL","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","this","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","_this","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","pol","added","subtracted","multiplied","divided","_Fraction","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","POLYGON_AMOY","MAX_SAFE_INTEGER","ZERO","ONE","TWO","wrappedCurrency","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","value","greaterThanOrEqual","Math","floor","sqrt","toNumber","z","x"],"mappings":"8IAKYA,EASAC,EAKAC,4KAdAF,EAAAA,kBAAAA,4CAEVA,yBACAA,yBACAA,wBACAA,sBACAA,wCAGUC,EAAAA,oBAAAA,sDAEVA,oCAGUC,EAAAA,mBAAAA,mDAEVA,qCACAA,+BAGWC,EAAaC,EAAKC,OAAO,6YCpBtBC,EAAeC,EAAqBC,UAC9CD,EAAUE,SAAWD,EAAUC,QAC1BF,EAAUG,OAAOF,IACfD,EAAUE,UAEVD,EAAUC,SAGZF,EAAUI,UAAYH,EAAUG,YCNrBC,EAcpB,SAAsBC,EAAkBC,EAAiBC,GAC7CF,GAAY,GAAKA,EAAW,KAAOG,OAAOC,UAAUJ,IAA9DK,WAEKL,SAAWA,OACXC,OAASA,OACT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,MAAMyB,GAEpCG,EAAcD,EAAmBzE,SAASwE,GAAcpE,OAAOqE,UAC9D,IAAIhC,EAAQiC,EAAYtF,UAAWsF,EAAYrF,4DCZxD,SAAgCsF,EAAYhF,EAAQiF,EAAiBC,MACzDD,EAAU,GAApBxG,MAEUuG,EAAMG,QAAUF,GAA1BxG,MAGqB,IAAjBuG,EAAMG,cACRH,EAAMI,KAAKpF,GACJ,SAEDqF,EAASL,EAAMG,SAAWF,KAE5BI,GAAUH,EAAWF,EAAMA,EAAMG,OAAS,GAAInF,IAAQ,SACjDA,UAGLsF,EAAK,EACPC,EAAKP,EAAMG,OAENG,EAAKC,GAAI,KACRC,EAAOF,EAAKC,IAAQ,EACtBL,EAAWF,EAAMQ,GAAMxF,IAAQ,EACjCsF,EAAKE,EAAM,EAEXD,EAAKC,SAGTR,EAAMS,OAAOH,EAAI,EAAGtF,GACbqF,EAASL,EAAMU,MAAS,4BHnBdC,MACThI,EAAKiI,mBAAmBD,EAAOpB,IAAzC9F,MAGId,EAAK2C,SAASqF,EAAOrB,UAChB3G,EAAKC,OAAOiI,KAAKC,MAAMD,KAAKE,KAAKpI,EAAKqI,SAASL,UAGpDM,EACAC,MACJD,EAAIN,EACJO,EAAIvI,EAAKqC,IAAIrC,EAAK8C,OAAOkF,EAAOlB,GAAMD,GAC/B7G,EAAK2C,SAAS4F,EAAGD,IACtBA,EAAIC,EACJA,EAAIvI,EAAK8C,OAAO9C,EAAKqC,IAAIrC,EAAK8C,OAAOkF,EAAOO,GAAIA,GAAIzB,UAE/CwB,sGInBP7C,EACAQ,UAEOlC,EAAeQ,qBACpBwC,EAAgBtB,EAAezB,SAAUiC,GACzCR,EAAe3D,UACf2D,EAAe1D"} \ No newline at end of file diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js b/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js deleted file mode 100644 index 86ca202ba97..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js +++ /dev/null @@ -1,723 +0,0 @@ -import JSBI from 'jsbi'; -import invariant from 'tiny-invariant'; -import _Decimal from 'decimal.js-light'; -import _Big from 'big.js'; -import toFormat from 'toformat'; -import { getAddress } from '@ethersproject/address'; - -var ChainId; - -(function (ChainId) { - ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; - ChainId[ChainId["ROPSTEN"] = 3] = "ROPSTEN"; - ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY"; - ChainId[ChainId["G\xD6RLI"] = 5] = "G\xD6RLI"; - ChainId[ChainId["KOVAN"] = 42] = "KOVAN"; - ChainId[ChainId["POLYGON_AMOY"] = 80002] = "POLYGON_AMOY"; -})(ChainId || (ChainId = {})); - -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) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -/** - * Compares two currencies for equality - */ -function currencyEquals(currencyA, currencyB) { - if (currencyA.isToken && currencyB.isToken) { - return currencyA.equals(currencyB); - } else if (currencyA.isToken) { - return false; - } else if (currencyB.isToken) { - return false; - } else { - return currencyA.isEther === currencyB.isEther; - } -} - -/** - * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. - * - * The only instance of the base class `Currency` is Ether. - */ - -var BaseCurrency = -/** - * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. - * @param decimals decimals of the currency - * @param symbol symbol of the currency - * @param name of the currency - */ -function BaseCurrency(decimals, symbol, name) { - !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'DECIMALS') : invariant(false) : void 0; - this.decimals = decimals; - this.symbol = symbol; - this.name = name; -}; - -/** - * Represents the currency Ether - */ - -var Ether = /*#__PURE__*/function (_BaseCurrency) { - _inheritsLoose(Ether, _BaseCurrency); - - /** - * Only called once by this class - * @protected - */ - function Ether() { - var _this; - - _this = _BaseCurrency.call(this, 18, 'ETH', 'Ether') || this; - _this.isEther = true; - _this.isToken = false; - return _this; - } - - return Ether; -}(BaseCurrency); -/** - * The only instance of the class `Ether`. - */ - -Ether.ETHER = /*#__PURE__*/new Ether(); -var ETHER = Ether.ETHER; - -/** - * Represents the currency Pol - */ - -var Pol = /*#__PURE__*/function (_BaseCurrency) { - _inheritsLoose(Pol, _BaseCurrency); - - /** - * Only called once by this class - * @protected - */ - function Pol() { - var _this; - - _this = _BaseCurrency.call(this, 18, 'POL', 'Pol') || this; - _this.isEther = true; - _this.isToken = false; - return _this; - } - - return Pol; -}(BaseCurrency); -/** - * The only instance of the class `Pol`. - */ - -Pol.POL = /*#__PURE__*/new Pol(); -var POL = Pol.POL; - -var _toSignificantRoundin, _toFixedRounding; -var Decimal = /*#__PURE__*/toFormat(_Decimal); -var Big = /*#__PURE__*/toFormat(_Big); -var toSignificantRounding = (_toSignificantRoundin = {}, _toSignificantRoundin[Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN, _toSignificantRoundin[Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP, _toSignificantRoundin[Rounding.ROUND_UP] = Decimal.ROUND_UP, _toSignificantRoundin); -var toFixedRounding = (_toFixedRounding = {}, _toFixedRounding[Rounding.ROUND_DOWN] = 0, _toFixedRounding[Rounding.ROUND_HALF_UP] = 1, _toFixedRounding[Rounding.ROUND_UP] = 3, _toFixedRounding); -var Fraction = /*#__PURE__*/function () { - function Fraction(numerator, denominator) { - if (denominator === void 0) { - denominator = JSBI.BigInt(1); - } - - this.numerator = JSBI.BigInt(numerator); - this.denominator = JSBI.BigInt(denominator); - } - - Fraction.tryParseFraction = function tryParseFraction(fractionish) { - if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') return new Fraction(fractionish); - if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish; - throw new Error('Could not parse fraction'); - } // performs floor division - ; - - var _proto = Fraction.prototype; - - _proto.invert = function invert() { - return new Fraction(this.denominator, this.numerator); - }; - - _proto.add = function add(other) { - var otherParsed = Fraction.tryParseFraction(other); - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator); - } - - return new Fraction(JSBI.add(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.subtract = function subtract(other) { - var otherParsed = Fraction.tryParseFraction(other); - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator); - } - - return new Fraction(JSBI.subtract(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.lessThan = function lessThan(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.lessThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.equalTo = function equalTo(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.equal(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.greaterThan = function greaterThan(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.greaterThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.multiply = function multiply(other) { - var otherParsed = Fraction.tryParseFraction(other); - return new Fraction(JSBI.multiply(this.numerator, otherParsed.numerator), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.divide = function divide(other) { - var otherParsed = Fraction.tryParseFraction(other); - return new Fraction(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(this.denominator, otherParsed.numerator)); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_HALF_UP; - } - - !Number.isInteger(significantDigits) ? process.env.NODE_ENV !== "production" ? invariant(false, significantDigits + " is not an integer.") : invariant(false) : void 0; - !(significantDigits > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, significantDigits + " is not positive.") : invariant(false) : void 0; - Decimal.set({ - precision: significantDigits + 1, - rounding: toSignificantRounding[rounding] - }); - var quotient = new Decimal(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(significantDigits); - return quotient.toFormat(quotient.decimalPlaces(), format); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_HALF_UP; - } - - !Number.isInteger(decimalPlaces) ? process.env.NODE_ENV !== "production" ? invariant(false, decimalPlaces + " is not an integer.") : invariant(false) : void 0; - !(decimalPlaces >= 0) ? process.env.NODE_ENV !== "production" ? invariant(false, decimalPlaces + " is negative.") : invariant(false) : void 0; - Big.DP = decimalPlaces; - Big.RM = toFixedRounding[rounding]; - return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format); - } - /** - * Helper method for converting any super class back to a fraction - */ - ; - - _createClass(Fraction, [{ - key: "quotient", - get: function get() { - return JSBI.divide(this.numerator, this.denominator); - } // remainder after floor division - - }, { - key: "remainder", - get: function get() { - return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator); - } - }, { - key: "asFraction", - get: function get() { - return new Fraction(this.numerator, this.denominator); - } - }]); - - return Fraction; -}(); - -var Big$1 = /*#__PURE__*/toFormat(_Big); -var CurrencyAmount = /*#__PURE__*/function (_Fraction) { - _inheritsLoose(CurrencyAmount, _Fraction); - - function CurrencyAmount(currency, numerator, denominator) { - var _this; - - _this = _Fraction.call(this, numerator, denominator) || this; - !JSBI.lessThanOrEqual(_this.quotient, MaxUint256) ? process.env.NODE_ENV !== "production" ? invariant(false, 'AMOUNT') : invariant(false) : void 0; - _this.currency = currency; - _this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals)); - return _this; - } - /** - * Returns a new currency amount instance from the - * @param currency the currency in the amount - * @param rawAmount the raw token or ether amount - */ - - - CurrencyAmount.fromRawAmount = function fromRawAmount(currency, rawAmount) { - return new CurrencyAmount(currency, rawAmount); - } - /** - * Construct a currency amount with a denominator that is not equal to 1 - * @param currency the currency - * @param numerator the numerator of the fractional token amount - * @param denominator the denominator of the fractional token amount - */ - ; - - CurrencyAmount.fromFractionalAmount = function fromFractionalAmount(currency, numerator, denominator) { - return new CurrencyAmount(currency, numerator, denominator); - } - /** - * Helper that calls the constructor with the ETHER currency - * @param rawAmount ether amount in wei - */ - ; - - CurrencyAmount.ether = function ether(rawAmount) { - return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount); - } - /** - * Helper that calls the constructor with the POL currency - * @param rawAmount pol amount in wei - */ - ; - - CurrencyAmount.pol = function pol(rawAmount) { - return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount); - }; - - var _proto = CurrencyAmount.prototype; - - _proto.add = function add(other) { - !currencyEquals(this.currency, other.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CURRENCY') : invariant(false) : void 0; - - var added = _Fraction.prototype.add.call(this, other); - - return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator); - }; - - _proto.subtract = function subtract(other) { - !currencyEquals(this.currency, other.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CURRENCY') : invariant(false) : void 0; - - var subtracted = _Fraction.prototype.subtract.call(this, other); - - return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator); - }; - - _proto.multiply = function multiply(other) { - var multiplied = _Fraction.prototype.multiply.call(this, other); - - return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator); - }; - - _proto.divide = function divide(other) { - var divided = _Fraction.prototype.divide.call(this, other); - - return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 6; - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_DOWN; - } - - return _Fraction.prototype.divide.call(this, this.decimalScale).toSignificant(significantDigits, format, rounding); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = this.currency.decimals; - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_DOWN; - } - - !(decimalPlaces <= this.currency.decimals) ? process.env.NODE_ENV !== "production" ? invariant(false, 'DECIMALS') : invariant(false) : void 0; - return _Fraction.prototype.divide.call(this, this.decimalScale).toFixed(decimalPlaces, format, rounding); - }; - - _proto.toExact = function toExact(format) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - Big$1.DP = this.currency.decimals; - return new Big$1(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format); - }; - - return CurrencyAmount; -}(Fraction); - -var ONE_HUNDRED = /*#__PURE__*/new Fraction( /*#__PURE__*/JSBI.BigInt(100)); -/** - * Converts a fraction to a percent - * @param fraction the fraction to convert - */ - -function toPercent(fraction) { - return new Percent(fraction.numerator, fraction.denominator); -} - -var Percent = /*#__PURE__*/function (_Fraction) { - _inheritsLoose(Percent, _Fraction); - - function Percent() { - var _this; - - _this = _Fraction.apply(this, arguments) || this; - /** - * This boolean prevents a fraction from being interpreted as a Percent - */ - - _this.isPercent = true; - return _this; - } - - var _proto = Percent.prototype; - - _proto.add = function add(other) { - return toPercent(_Fraction.prototype.add.call(this, other)); - }; - - _proto.subtract = function subtract(other) { - return toPercent(_Fraction.prototype.subtract.call(this, other)); - }; - - _proto.multiply = function multiply(other) { - return toPercent(_Fraction.prototype.multiply.call(this, other)); - }; - - _proto.divide = function divide(other) { - return toPercent(_Fraction.prototype.divide.call(this, other)); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 5; - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 2; - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding); - }; - - return Percent; -}(Fraction); - -var Price = /*#__PURE__*/function (_Fraction) { - _inheritsLoose(Price, _Fraction); - - // denominator and numerator _must_ be raw, i.e. in the native representation - function Price(baseCurrency, quoteCurrency, denominator, numerator) { - var _this; - - _this = _Fraction.call(this, numerator, denominator) || this; - _this.baseCurrency = baseCurrency; - _this.quoteCurrency = quoteCurrency; - _this.scalar = new Fraction(JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)), JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))); - return _this; - } - /** - * Flip the price, switching the base and quote currency - */ - - - var _proto = Price.prototype; - - _proto.invert = function invert() { - return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator); - } - /** - * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency - * @param other the other price - */ - ; - - _proto.multiply = function multiply(other) { - !currencyEquals(this.quoteCurrency, other.baseCurrency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - - var fraction = _Fraction.prototype.multiply.call(this, other); - - return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator); - } - /** - * Return the amount of quote currency corresponding to a given amount of the base currency - * @param currencyAmount the amount of base currency to quote against the price - */ - ; - - _proto.quote = function quote(currencyAmount) { - !currencyEquals(currencyAmount.currency, this.baseCurrency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - - var result = _Fraction.prototype.multiply.call(this, currencyAmount); - - return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator); - } - /** - * Get the value scaled by decimals for formatting - * @private - */ - ; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 6; - } - - return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 4; - } - - return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding); - }; - - _createClass(Price, [{ - key: "adjustedForDecimals", - get: function get() { - return _Fraction.prototype.multiply.call(this, this.scalar); - } - }]); - - return Price; -}(Fraction); - -/** - * Validates an address and returns the parsed (checksummed) version of that address - * @param address the unchecksummed hex address - */ - -function validateAndParseAddress(address) { - try { - return getAddress(address); - } catch (error) { - throw new Error(address + " is not a valid address."); - } -} - -var _WETH; -/** - * Represents an ERC20 token with a unique address and some metadata. - */ - -var Token = /*#__PURE__*/function (_BaseCurrency) { - _inheritsLoose(Token, _BaseCurrency); - - function Token(chainId, address, decimals, symbol, name) { - var _this; - - _this = _BaseCurrency.call(this, decimals, symbol, name) || this; - _this.isEther = false; - _this.isToken = true; - _this.chainId = chainId; - _this.address = validateAndParseAddress(address); - return _this; - } - /** - * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. - * @param other other token to compare - */ - - - var _proto = Token.prototype; - - _proto.equals = function equals(other) { - // short circuit on reference equality - if (this === other) { - return true; - } - - return this.chainId === other.chainId && this.address === other.address; - } - /** - * Returns true if the address of this token sorts before the address of the other token - * @param other other token to compare - * @throws if the tokens have the same address - * @throws if the tokens are on different chains - */ - ; - - _proto.sortsBefore = function sortsBefore(other) { - !(this.chainId === other.chainId) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_IDS') : invariant(false) : void 0; - !(this.address !== other.address) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ADDRESSES') : invariant(false) : void 0; - return this.address.toLowerCase() < other.address.toLowerCase(); - }; - - return Token; -}(BaseCurrency); -var WETH9 = (_WETH = {}, _WETH[ChainId.MAINNET] = /*#__PURE__*/new Token(ChainId.MAINNET, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.ROPSTEN] = /*#__PURE__*/new Token(ChainId.ROPSTEN, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.RINKEBY] = /*#__PURE__*/new Token(ChainId.RINKEBY, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.GÖRLI] = /*#__PURE__*/new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.KOVAN] = /*#__PURE__*/new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.POLYGON_AMOY] = /*#__PURE__*/new Token(ChainId.POLYGON_AMOY, '0xd7a19e388c52D3580B6428F29494883A5d40C330', 18, 'WETH9', 'Wrapped Ether'), _WETH); - -/** - * Returns the percent difference between the mid price and the execution price, i.e. price impact. - * @param midPrice mid price before the trade - * @param inputAmount the input amount of the trade - * @param outputAmount the output amount of the trade - */ - -function computePriceImpact(midPrice, inputAmount, outputAmount) { - var quotedOutputAmount = midPrice.quote(inputAmount); // calculate price impact := (exactQuote - outputAmount) / exactQuote - - var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount); - return new Percent(priceImpact.numerator, priceImpact.denominator); -} - -// `maxSize` by removing the last item - -function sortedInsert(items, add, maxSize, comparator) { - !(maxSize > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_SIZE_ZERO') : invariant(false) : void 0; // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize - - !(items.length <= maxSize) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ITEMS_SIZE') : invariant(false) : void 0; // short circuit first item add - - if (items.length === 0) { - items.push(add); - return null; - } else { - var isFull = items.length === maxSize; // short circuit if full and the additional item does not come before the last item - - if (isFull && comparator(items[items.length - 1], add) <= 0) { - return add; - } - - var lo = 0, - hi = items.length; - - while (lo < hi) { - var mid = lo + hi >>> 1; - - if (comparator(items[mid], add) <= 0) { - lo = mid + 1; - } else { - hi = mid; - } - } - - items.splice(lo, 0, add); - return isFull ? items.pop() : null; - } -} - -var MAX_SAFE_INTEGER = /*#__PURE__*/JSBI.BigInt(Number.MAX_SAFE_INTEGER); -var ZERO = /*#__PURE__*/JSBI.BigInt(0); -var ONE = /*#__PURE__*/JSBI.BigInt(1); -var TWO = /*#__PURE__*/JSBI.BigInt(2); -/** - * Computes floor(sqrt(value)) - * @param value the value for which to compute the square root, rounded down - */ - -function sqrt(value) { - !JSBI.greaterThanOrEqual(value, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'NEGATIVE') : invariant(false) : void 0; // rely on built in sqrt if possible - - if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) { - return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value)))); - } - - var z; - var x; - z = value; - x = JSBI.add(JSBI.divide(value, TWO), ONE); - - while (JSBI.lessThan(x, z)) { - z = x; - x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO); - } - - return z; -} - -/** - * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token - * @param currency the currency to wrap, if necessary - * @param chainId the ID of the chain for wrapping - */ - -function wrappedCurrency(currency, chainId) { - if (currency.isToken) { - !(currency.chainId === chainId) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; - return currency; - } - - if (currency.isEther) return WETH9[chainId]; - throw new Error('CURRENCY'); -} - -/** - * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. - * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns - * the input currency amount. - */ - -function wrappedCurrencyAmount(currencyAmount, chainId) { - return CurrencyAmount.fromFractionalAmount(wrappedCurrency(currencyAmount.currency, chainId), currencyAmount.numerator, currencyAmount.denominator); -} - -export { ChainId, CurrencyAmount, ETHER, Ether, Fraction, MaxUint256, POL, Percent, Pol, Price, Rounding, Token, TradeType, WETH9, computePriceImpact, currencyEquals, sortedInsert, sqrt, validateAndParseAddress, wrappedCurrency, wrappedCurrencyAmount }; -//# sourceMappingURL=sdk-core.esm.js.map diff --git a/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js.map b/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js.map deleted file mode 100644 index a55eb1a5f52..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/sdk-core.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sdk-core.esm.js","sources":["../src/constants.ts","../src/utils/currencyEquals.ts","../src/entities/baseCurrency.ts","../src/entities/ether.ts","../src/entities/pol.ts","../src/entities/fractions/fraction.ts","../src/entities/fractions/currencyAmount.ts","../src/entities/fractions/percent.ts","../src/entities/fractions/price.ts","../src/utils/validateAndParseAddress.ts","../src/entities/token.ts","../src/utils/computePriceImpact.ts","../src/utils/sortedInsert.ts","../src/utils/sqrt.ts","../src/utils/wrappedCurrency.ts","../src/utils/wrappedCurrencyAmount.ts"],"sourcesContent":["import JSBI from 'jsbi'\r\n\r\n// exports for external consumption\r\nexport type BigintIsh = JSBI | string | number\r\n\r\nexport enum ChainId {\r\n MAINNET = 1,\r\n ROPSTEN = 3,\r\n RINKEBY = 4,\r\n GÖRLI = 5,\r\n KOVAN = 42,\r\n POLYGON_AMOY = 80002,\r\n}\r\n\r\nexport enum TradeType {\r\n EXACT_INPUT,\r\n EXACT_OUTPUT\r\n}\r\n\r\nexport enum Rounding {\r\n ROUND_DOWN,\r\n ROUND_HALF_UP,\r\n ROUND_UP\r\n}\r\n\r\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\r\n","import { Currency } from '../entities/currency'\r\n\r\n/**\r\n * Compares two currencies for equality\r\n */\r\nexport function currencyEquals(currencyA: Currency, currencyB: Currency): boolean {\r\n if (currencyA.isToken && currencyB.isToken) {\r\n return currencyA.equals(currencyB)\r\n } else if (currencyA.isToken) {\r\n return false\r\n } else if (currencyB.isToken) {\r\n return false\r\n } else {\r\n return currencyA.isEther === currencyB.isEther\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n/**\r\n * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.\r\n *\r\n * The only instance of the base class `Currency` is Ether.\r\n */\r\nexport abstract class BaseCurrency {\r\n public abstract readonly isEther: boolean\r\n public abstract readonly isToken: boolean\r\n\r\n public readonly decimals: number\r\n public readonly symbol?: string\r\n public readonly name?: string\r\n\r\n /**\r\n * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`.\r\n * @param decimals decimals of the currency\r\n * @param symbol symbol of the currency\r\n * @param name of the currency\r\n */\r\n protected constructor(decimals: number, symbol?: string, name?: string) {\r\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\r\n\r\n this.decimals = decimals\r\n this.symbol = symbol\r\n this.name = name\r\n }\r\n}\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Ether\r\n */\r\nexport class Ether extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'ETH', 'Ether')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Ether`.\r\n */\r\n public static readonly ETHER: Ether = new Ether()\r\n}\r\n\r\nexport const ETHER = Ether.ETHER\r\n","import { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents the currency Pol\r\n */\r\nexport class Pol extends BaseCurrency {\r\n public readonly isEther: true = true\r\n public readonly isToken: false = false\r\n\r\n /**\r\n * Only called once by this class\r\n * @protected\r\n */\r\n protected constructor() {\r\n super(18, 'POL', 'Pol')\r\n }\r\n\r\n /**\r\n * The only instance of the class `Pol`.\r\n */\r\n public static readonly POL: Pol = new Pol()\r\n}\r\n\r\nexport const POL = Pol.POL\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\nimport _Decimal from 'decimal.js-light'\r\nimport _Big, { RoundingMode } from 'big.js'\r\nimport toFormat from 'toformat'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\n\r\nconst Decimal = toFormat(_Decimal)\r\nconst Big = toFormat(_Big)\r\n\r\nconst toSignificantRounding = {\r\n [Rounding.ROUND_DOWN]: Decimal.ROUND_DOWN,\r\n [Rounding.ROUND_HALF_UP]: Decimal.ROUND_HALF_UP,\r\n [Rounding.ROUND_UP]: Decimal.ROUND_UP\r\n}\r\n\r\nconst toFixedRounding = {\r\n [Rounding.ROUND_DOWN]: RoundingMode.RoundDown,\r\n [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp,\r\n [Rounding.ROUND_UP]: RoundingMode.RoundUp\r\n}\r\n\r\nexport class Fraction {\r\n public readonly numerator: JSBI\r\n public readonly denominator: JSBI\r\n\r\n public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {\r\n this.numerator = JSBI.BigInt(numerator)\r\n this.denominator = JSBI.BigInt(denominator)\r\n }\r\n\r\n private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {\r\n if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')\r\n return new Fraction(fractionish)\r\n\r\n if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish\r\n throw new Error('Could not parse fraction')\r\n }\r\n\r\n // performs floor division\r\n public get quotient(): JSBI {\r\n return JSBI.divide(this.numerator, this.denominator)\r\n }\r\n\r\n // remainder after floor division\r\n public get remainder(): Fraction {\r\n return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator)\r\n }\r\n\r\n public invert(): Fraction {\r\n return new Fraction(this.denominator, this.numerator)\r\n }\r\n\r\n public add(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.add(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public subtract(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n if (JSBI.equal(this.denominator, otherParsed.denominator)) {\r\n return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator)\r\n }\r\n return new Fraction(\r\n JSBI.subtract(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n ),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public lessThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.lessThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public equalTo(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.equal(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public greaterThan(other: Fraction | BigintIsh): boolean {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return JSBI.greaterThan(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(otherParsed.numerator, this.denominator)\r\n )\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.numerator),\r\n JSBI.multiply(this.denominator, otherParsed.denominator)\r\n )\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): Fraction {\r\n const otherParsed = Fraction.tryParseFraction(other)\r\n return new Fraction(\r\n JSBI.multiply(this.numerator, otherParsed.denominator),\r\n JSBI.multiply(this.denominator, otherParsed.numerator)\r\n )\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(significantDigits), `${significantDigits} is not an integer.`)\r\n invariant(significantDigits > 0, `${significantDigits} is not positive.`)\r\n\r\n Decimal.set({ precision: significantDigits + 1, rounding: toSignificantRounding[rounding] })\r\n const quotient = new Decimal(this.numerator.toString())\r\n .div(this.denominator.toString())\r\n .toSignificantDigits(significantDigits)\r\n return quotient.toFormat(quotient.decimalPlaces(), format)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number,\r\n format: object = { groupSeparator: '' },\r\n rounding: Rounding = Rounding.ROUND_HALF_UP\r\n ): string {\r\n invariant(Number.isInteger(decimalPlaces), `${decimalPlaces} is not an integer.`)\r\n invariant(decimalPlaces >= 0, `${decimalPlaces} is negative.`)\r\n\r\n Big.DP = decimalPlaces\r\n Big.RM = toFixedRounding[rounding]\r\n return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format)\r\n }\r\n\r\n /**\r\n * Helper method for converting any super class back to a fraction\r\n */\r\n public get asFraction(): Fraction {\r\n return new Fraction(this.numerator, this.denominator)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport { Currency } from '../currency'\r\nimport { Ether } from '../ether'\r\nimport { Pol } from '../pol'\r\nimport { Fraction } from './fraction'\r\nimport _Big from 'big.js'\r\n\r\nimport toFormat from 'toformat'\r\nimport { BigintIsh, Rounding, MaxUint256 } from '../../constants'\r\n\r\nconst Big = toFormat(_Big)\r\n\r\nexport class CurrencyAmount extends Fraction {\r\n public readonly currency: T\r\n public readonly decimalScale: JSBI\r\n\r\n /**\r\n * Returns a new currency amount instance from the\r\n * @param currency the currency in the amount\r\n * @param rawAmount the raw token or ether amount\r\n */\r\n public static fromRawAmount(currency: T, rawAmount: BigintIsh): CurrencyAmount {\r\n return new CurrencyAmount(currency, rawAmount)\r\n }\r\n\r\n /**\r\n * Construct a currency amount with a denominator that is not equal to 1\r\n * @param currency the currency\r\n * @param numerator the numerator of the fractional token amount\r\n * @param denominator the denominator of the fractional token amount\r\n */\r\n public static fromFractionalAmount(\r\n currency: T,\r\n numerator: BigintIsh,\r\n denominator: BigintIsh\r\n ): CurrencyAmount {\r\n return new CurrencyAmount(currency, numerator, denominator)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the ETHER currency\r\n * @param rawAmount ether amount in wei\r\n */\r\n public static ether(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Ether.ETHER, rawAmount)\r\n }\r\n\r\n /**\r\n * Helper that calls the constructor with the POL currency\r\n * @param rawAmount pol amount in wei\r\n */\r\n public static pol(rawAmount: BigintIsh): CurrencyAmount {\r\n return CurrencyAmount.fromRawAmount(Pol.POL, rawAmount)\r\n }\r\n\r\n protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {\r\n super(numerator, denominator)\r\n invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')\r\n this.currency = currency\r\n this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))\r\n }\r\n\r\n public add(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const added = super.add(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, added.numerator, added.denominator)\r\n }\r\n\r\n public subtract(other: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(this.currency, other.currency), 'CURRENCY')\r\n const subtracted = super.subtract(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, subtracted.numerator, subtracted.denominator)\r\n }\r\n\r\n public multiply(other: Fraction | BigintIsh): CurrencyAmount {\r\n const multiplied = super.multiply(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, multiplied.numerator, multiplied.denominator)\r\n }\r\n\r\n public divide(other: Fraction | BigintIsh): CurrencyAmount {\r\n const divided = super.divide(other)\r\n return CurrencyAmount.fromFractionalAmount(this.currency, divided.numerator, divided.denominator)\r\n }\r\n\r\n public toSignificant(\r\n significantDigits: number = 6,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n return super.divide(this.decimalScale).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(\r\n decimalPlaces: number = this.currency.decimals,\r\n format?: object,\r\n rounding: Rounding = Rounding.ROUND_DOWN\r\n ): string {\r\n invariant(decimalPlaces <= this.currency.decimals, 'DECIMALS')\r\n return super.divide(this.decimalScale).toFixed(decimalPlaces, format, rounding)\r\n }\r\n\r\n public toExact(format: object = { groupSeparator: '' }): string {\r\n Big.DP = this.currency.decimals\r\n return new Big(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(format)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Fraction } from './fraction'\r\n\r\nconst ONE_HUNDRED = new Fraction(JSBI.BigInt(100))\r\n\r\n/**\r\n * Converts a fraction to a percent\r\n * @param fraction the fraction to convert\r\n */\r\nfunction toPercent(fraction: Fraction): Percent {\r\n return new Percent(fraction.numerator, fraction.denominator)\r\n}\r\n\r\nexport class Percent extends Fraction {\r\n /**\r\n * This boolean prevents a fraction from being interpreted as a Percent\r\n */\r\n public readonly isPercent: true = true\r\n\r\n add(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.add(other))\r\n }\r\n\r\n subtract(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.subtract(other))\r\n }\r\n\r\n multiply(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.multiply(other))\r\n }\r\n\r\n divide(other: Fraction | BigintIsh): Percent {\r\n return toPercent(super.divide(other))\r\n }\r\n\r\n public toSignificant(significantDigits: number = 5, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 2, format?: object, rounding?: Rounding): string {\r\n return super.multiply(ONE_HUNDRED).toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport { currencyEquals } from '../../utils/currencyEquals'\r\nimport invariant from 'tiny-invariant'\r\n\r\nimport { BigintIsh, Rounding } from '../../constants'\r\nimport { Currency } from '../currency'\r\nimport { Fraction } from './fraction'\r\nimport { CurrencyAmount } from './currencyAmount'\r\n\r\nexport class Price extends Fraction {\r\n public readonly baseCurrency: TBase // input i.e. denominator\r\n public readonly quoteCurrency: TQuote // output i.e. numerator\r\n public readonly scalar: Fraction // used to adjust the raw fraction w/r/t the decimals of the {base,quote}Token\r\n\r\n // denominator and numerator _must_ be raw, i.e. in the native representation\r\n public constructor(baseCurrency: TBase, quoteCurrency: TQuote, denominator: BigintIsh, numerator: BigintIsh) {\r\n super(numerator, denominator)\r\n\r\n this.baseCurrency = baseCurrency\r\n this.quoteCurrency = quoteCurrency\r\n this.scalar = new Fraction(\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(baseCurrency.decimals)),\r\n JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(quoteCurrency.decimals))\r\n )\r\n }\r\n\r\n /**\r\n * Flip the price, switching the base and quote currency\r\n */\r\n public invert(): Price {\r\n return new Price(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)\r\n }\r\n\r\n /**\r\n * Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency\r\n * @param other the other price\r\n */\r\n public multiply(other: Price): Price {\r\n invariant(currencyEquals(this.quoteCurrency, other.baseCurrency), 'TOKEN')\r\n const fraction = super.multiply(other)\r\n return new Price(this.baseCurrency, other.quoteCurrency, fraction.denominator, fraction.numerator)\r\n }\r\n\r\n /**\r\n * Return the amount of quote currency corresponding to a given amount of the base currency\r\n * @param currencyAmount the amount of base currency to quote against the price\r\n */\r\n public quote(currencyAmount: CurrencyAmount): CurrencyAmount {\r\n invariant(currencyEquals(currencyAmount.currency, this.baseCurrency), 'TOKEN')\r\n const result = super.multiply(currencyAmount)\r\n return CurrencyAmount.fromFractionalAmount(this.quoteCurrency, result.numerator, result.denominator)\r\n }\r\n\r\n /**\r\n * Get the value scaled by decimals for formatting\r\n * @private\r\n */\r\n private get adjustedForDecimals(): Fraction {\r\n return super.multiply(this.scalar)\r\n }\r\n\r\n public toSignificant(significantDigits: number = 6, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toSignificant(significantDigits, format, rounding)\r\n }\r\n\r\n public toFixed(decimalPlaces: number = 4, format?: object, rounding?: Rounding): string {\r\n return this.adjustedForDecimals.toFixed(decimalPlaces, format, rounding)\r\n }\r\n}\r\n","import { getAddress } from '@ethersproject/address'\r\n\r\n/**\r\n * Validates an address and returns the parsed (checksummed) version of that address\r\n * @param address the unchecksummed hex address\r\n */\r\nexport function validateAndParseAddress(address: string): string {\r\n try {\r\n return getAddress(address)\r\n } catch (error) {\r\n throw new Error(`${address} is not a valid address.`)\r\n }\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { validateAndParseAddress } from '../utils/validateAndParseAddress'\r\nimport { BaseCurrency } from './baseCurrency'\r\n\r\n/**\r\n * Represents an ERC20 token with a unique address and some metadata.\r\n */\r\nexport class Token extends BaseCurrency {\r\n public readonly isEther: false = false\r\n public readonly isToken: true = true\r\n\r\n public readonly chainId: ChainId | number\r\n public readonly address: string\r\n\r\n public constructor(chainId: ChainId | number, address: string, decimals: number, symbol?: string, name?: string) {\r\n super(decimals, symbol, name)\r\n this.chainId = chainId\r\n this.address = validateAndParseAddress(address)\r\n }\r\n\r\n /**\r\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\r\n * @param other other token to compare\r\n */\r\n public equals(other: Token): boolean {\r\n // short circuit on reference equality\r\n if (this === other) {\r\n return true\r\n }\r\n return this.chainId === other.chainId && this.address === other.address\r\n }\r\n\r\n /**\r\n * Returns true if the address of this token sorts before the address of the other token\r\n * @param other other token to compare\r\n * @throws if the tokens have the same address\r\n * @throws if the tokens are on different chains\r\n */\r\n public sortsBefore(other: Token): boolean {\r\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\r\n invariant(this.address !== other.address, 'ADDRESSES')\r\n return this.address.toLowerCase() < other.address.toLowerCase()\r\n }\r\n}\r\n\r\nexport const WETH9: { [chainId in ChainId]: Token } = {\r\n [ChainId.MAINNET]: new Token(\r\n ChainId.MAINNET,\r\n '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.ROPSTEN]: new Token(\r\n ChainId.ROPSTEN,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.RINKEBY]: new Token(\r\n ChainId.RINKEBY,\r\n '0xc778417E063141139Fce010982780140Aa0cD5Ab',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n ),\r\n [ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'),\r\n [ChainId.POLYGON_AMOY]: new Token(\r\n ChainId.POLYGON_AMOY,\r\n '0xd7a19e388c52D3580B6428F29494883A5d40C330',\r\n 18,\r\n 'WETH9',\r\n 'Wrapped Ether'\r\n )\r\n}\r\n","import { Currency, CurrencyAmount, Percent, Price } from '../entities'\r\n\r\n/**\r\n * Returns the percent difference between the mid price and the execution price, i.e. price impact.\r\n * @param midPrice mid price before the trade\r\n * @param inputAmount the input amount of the trade\r\n * @param outputAmount the output amount of the trade\r\n */\r\nexport function computePriceImpact(\r\n midPrice: Price,\r\n inputAmount: CurrencyAmount,\r\n outputAmount: CurrencyAmount\r\n): Percent {\r\n const quotedOutputAmount = midPrice.quote(inputAmount)\r\n // calculate price impact := (exactQuote - outputAmount) / exactQuote\r\n const priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount)\r\n return new Percent(priceImpact.numerator, priceImpact.denominator)\r\n}\r\n","import invariant from 'tiny-invariant'\r\n\r\n// given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to\r\n// `maxSize` by removing the last item\r\nexport function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null {\r\n invariant(maxSize > 0, 'MAX_SIZE_ZERO')\r\n // this is an invariant because the interface cannot return multiple removed items if items.length exceeds maxSize\r\n invariant(items.length <= maxSize, 'ITEMS_SIZE')\r\n\r\n // short circuit first item add\r\n if (items.length === 0) {\r\n items.push(add)\r\n return null\r\n } else {\r\n const isFull = items.length === maxSize\r\n // short circuit if full and the additional item does not come before the last item\r\n if (isFull && comparator(items[items.length - 1], add) <= 0) {\r\n return add\r\n }\r\n\r\n let lo = 0,\r\n hi = items.length\r\n\r\n while (lo < hi) {\r\n const mid = (lo + hi) >>> 1\r\n if (comparator(items[mid], add) <= 0) {\r\n lo = mid + 1\r\n } else {\r\n hi = mid\r\n }\r\n }\r\n items.splice(lo, 0, add)\r\n return isFull ? items.pop()! : null\r\n }\r\n}\r\n","import JSBI from 'jsbi'\r\nimport invariant from 'tiny-invariant'\r\n\r\nexport const MAX_SAFE_INTEGER = JSBI.BigInt(Number.MAX_SAFE_INTEGER)\r\n\r\nconst ZERO = JSBI.BigInt(0)\r\nconst ONE = JSBI.BigInt(1)\r\nconst TWO = JSBI.BigInt(2)\r\n\r\n/**\r\n * Computes floor(sqrt(value))\r\n * @param value the value for which to compute the square root, rounded down\r\n */\r\nexport function sqrt(value: JSBI): JSBI {\r\n invariant(JSBI.greaterThanOrEqual(value, ZERO), 'NEGATIVE')\r\n\r\n // rely on built in sqrt if possible\r\n if (JSBI.lessThan(value, MAX_SAFE_INTEGER)) {\r\n return JSBI.BigInt(Math.floor(Math.sqrt(JSBI.toNumber(value))))\r\n }\r\n\r\n let z: JSBI\r\n let x: JSBI\r\n z = value\r\n x = JSBI.add(JSBI.divide(value, TWO), ONE)\r\n while (JSBI.lessThan(x, z)) {\r\n z = x\r\n x = JSBI.divide(JSBI.add(JSBI.divide(value, x), x), TWO)\r\n }\r\n return z\r\n}\r\n","import invariant from 'tiny-invariant'\r\nimport { ChainId } from '../constants'\r\nimport { Currency, Token, WETH9 } from '../entities'\r\n\r\n/**\r\n * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token\r\n * @param currency the currency to wrap, if necessary\r\n * @param chainId the ID of the chain for wrapping\r\n */\r\nexport function wrappedCurrency(currency: Currency, chainId: ChainId): Token {\r\n if (currency.isToken) {\r\n invariant(currency.chainId === chainId, 'CHAIN_ID')\r\n return currency\r\n }\r\n if (currency.isEther) return WETH9[chainId]\r\n throw new Error('CURRENCY')\r\n}\r\n","import { ChainId } from '../constants'\r\nimport { Currency, CurrencyAmount, Token } from '../entities'\r\nimport { wrappedCurrency } from './wrappedCurrency'\r\n\r\n/**\r\n * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount.\r\n * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns\r\n * the input currency amount.\r\n */\r\nexport function wrappedCurrencyAmount(\r\n currencyAmount: CurrencyAmount,\r\n chainId: ChainId\r\n): CurrencyAmount {\r\n return CurrencyAmount.fromFractionalAmount(\r\n wrappedCurrency(currencyAmount.currency, chainId),\r\n currencyAmount.numerator,\r\n currencyAmount.denominator\r\n )\r\n}\r\n"],"names":["ChainId","TradeType","Rounding","MaxUint256","JSBI","BigInt","currencyEquals","currencyA","currencyB","isToken","equals","isEther","BaseCurrency","decimals","symbol","name","Number","isInteger","invariant","Ether","ETHER","Pol","POL","Decimal","toFormat","_Decimal","Big","_Big","toSignificantRounding","ROUND_DOWN","ROUND_HALF_UP","ROUND_UP","toFixedRounding","Fraction","numerator","denominator","tryParseFraction","fractionish","Error","invert","add","other","otherParsed","equal","multiply","subtract","lessThan","equalTo","greaterThan","divide","toSignificant","significantDigits","format","rounding","groupSeparator","set","precision","quotient","toString","div","toSignificantDigits","decimalPlaces","toFixed","DP","RM","remainder","CurrencyAmount","currency","lessThanOrEqual","decimalScale","exponentiate","fromRawAmount","rawAmount","fromFractionalAmount","ether","pol","added","subtracted","multiplied","divided","toExact","ONE_HUNDRED","toPercent","fraction","Percent","Price","baseCurrency","quoteCurrency","scalar","quote","currencyAmount","result","adjustedForDecimals","validateAndParseAddress","address","getAddress","error","Token","chainId","sortsBefore","toLowerCase","WETH9","MAINNET","ROPSTEN","RINKEBY","GÖRLI","KOVAN","POLYGON_AMOY","computePriceImpact","midPrice","inputAmount","outputAmount","quotedOutputAmount","priceImpact","sortedInsert","items","maxSize","comparator","length","push","isFull","lo","hi","mid","splice","pop","MAX_SAFE_INTEGER","ZERO","ONE","TWO","sqrt","value","greaterThanOrEqual","Math","floor","toNumber","z","x","wrappedCurrency","wrappedCurrencyAmount"],"mappings":";;;;;;;IAKYA;;AAAZ,WAAYA;AACVA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,gCAAA,aAAA;AACAA,EAAAA,8BAAA,UAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAPD,EAAYA,OAAO,KAAPA,OAAO,KAAA,CAAnB;;IASYC;;AAAZ,WAAYA;AACVA,EAAAA,uCAAA,gBAAA;AACAA,EAAAA,wCAAA,iBAAA;AACD,CAHD,EAAYA,SAAS,KAATA,SAAS,KAAA,CAArB;;IAKYC;;AAAZ,WAAYA;AACVA,EAAAA,oCAAA,eAAA;AACAA,EAAAA,uCAAA,kBAAA;AACAA,EAAAA,kCAAA,aAAA;AACD,CAJD,EAAYA,QAAQ,KAARA,QAAQ,KAAA,CAApB;;IAMaC,UAAU,gBAAGC,IAAI,CAACC,MAAL,CAAY,oEAAZ;;;;;;;;;;;;;;;;;;;;;;;;ACvB1B;;;AAGA,SAAgBC,eAAeC,WAAqBC;AAClD,MAAID,SAAS,CAACE,OAAV,IAAqBD,SAAS,CAACC,OAAnC,EAA4C;AAC1C,WAAOF,SAAS,CAACG,MAAV,CAAiBF,SAAjB,CAAP;AACD,GAFD,MAEO,IAAID,SAAS,CAACE,OAAd,EAAuB;AAC5B,WAAO,KAAP;AACD,GAFM,MAEA,IAAID,SAAS,CAACC,OAAd,EAAuB;AAC5B,WA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J;AACD;;AACD,SAAOO,CAAP;AACD;;AC1BD;;;;;;AAKA,SAAgBE,gBAAgBvE,UAAoB+B;AAClD,MAAI/B,QAAQ,CAAC1D,OAAb,EAAsB;AACpB,MAAU0D,QAAQ,CAAC+B,OAAT,KAAqBA,OAA/B,4CAAAhF,SAAS,QAA+B,UAA/B,CAAT,GAAAA,SAAS,OAAT;AACA,WAAOiD,QAAP;AACD;;AACD,MAAIA,QAAQ,CAACxD,OAAb,EAAsB,OAAO0F,KAAK,CAACH,OAAD,CAAZ;AACtB,QAAM,IAAI5D,KAAJ,CAAU,UAAV,CAAN;AACD;;ACZD;;;;;;AAKA,SAAgBqG,sBACdjD,gBACAQ;AAEA,SAAOhC,cAAc,CAACO,oBAAf,CACLiE,eAAe,CAAChD,cAAc,CAACvB,QAAhB,EAA0B+B,OAA1B,CADV,EAELR,cAAc,CAACxD,SAFV,EAGLwD,cAAc,CAACvD,WAHV,CAAP;AAKD;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/sdk-core/dist/utils/computePriceImpact.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/computePriceImpact.d.ts deleted file mode 100644 index 0161f44e74b..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/utils/computePriceImpact.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Currency, CurrencyAmount, Percent, Price } from '../entities'; -/** - * Returns the percent difference between the mid price and the execution price, i.e. price impact. - * @param midPrice mid price before the trade - * @param inputAmount the input amount of the trade - * @param outputAmount the output amount of the trade - */ -export declare function computePriceImpact(midPrice: Price, inputAmount: CurrencyAmount, outputAmount: CurrencyAmount): Percent; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/currencyEquals.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/currencyEquals.d.ts deleted file mode 100644 index f434dc5bba9..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/utils/currencyEquals.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Currency } from '../entities/currency'; -/** - * Compares two currencies for equality - */ -export declare function currencyEquals(currencyA: Currency, currencyB: Currency): boolean; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/index.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/index.d.ts deleted file mode 100644 index 6440331c9e6..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/utils/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { computePriceImpact } from './computePriceImpact'; -export { currencyEquals } from './currencyEquals'; -export { validateAndParseAddress } from './validateAndParseAddress'; -export { sortedInsert } from './sortedInsert'; -export { sqrt } from './sqrt'; -export { wrappedCurrency } from './wrappedCurrency'; -export { wrappedCurrencyAmount } from './wrappedCurrencyAmount'; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/sortedInsert.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/sortedInsert.d.ts deleted file mode 100644 index 562be26f112..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/utils/sortedInsert.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function sortedInsert(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/sqrt.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/sqrt.d.ts deleted file mode 100644 index f1adc876d72..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/utils/sqrt.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import JSBI from 'jsbi'; -export declare const MAX_SAFE_INTEGER: JSBI; -/** - * Computes floor(sqrt(value)) - * @param value the value for which to compute the square root, rounded down - */ -export declare function sqrt(value: JSBI): JSBI; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/validateAndParseAddress.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/validateAndParseAddress.d.ts deleted file mode 100644 index 98f35a8beb2..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/utils/validateAndParseAddress.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Validates an address and returns the parsed (checksummed) version of that address - * @param address the unchecksummed hex address - */ -export declare function validateAndParseAddress(address: string): string; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrency.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrency.d.ts deleted file mode 100644 index f49dfde0de1..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrency.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ChainId } from '../constants'; -import { Currency, Token } from '../entities'; -/** - * Given a currency which can be Ether or a token, return wrapped ether for ether and the token for the token - * @param currency the currency to wrap, if necessary - * @param chainId the ID of the chain for wrapping - */ -export declare function wrappedCurrency(currency: Currency, chainId: ChainId): Token; diff --git a/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts b/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts deleted file mode 100644 index 4815b4560af..00000000000 --- a/uniswap-packages-forks/sdk-core/dist/utils/wrappedCurrencyAmount.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ChainId } from '../constants'; -import { Currency, CurrencyAmount, Token } from '../entities'; -/** - * Given a currency amount and a chain ID, returns the equivalent representation as a wrapped token amount. - * In other words, if the currency is ETHER, returns the WETH9 token amount for the given chain. Otherwise, returns - * the input currency amount. - */ -export declare function wrappedCurrencyAmount(currencyAmount: CurrencyAmount, chainId: ChainId): CurrencyAmount; diff --git a/uniswap-packages-forks/sdk-core/package.json b/uniswap-packages-forks/sdk-core/package.json deleted file mode 100644 index b6cee43afba..00000000000 --- a/uniswap-packages-forks/sdk-core/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@uniswap/sdk-core", - "license": "MIT", - "version": "3.0.0-alpha.1", - "description": "⚒️ An SDK for building applications on top of Uniswap V3", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "files": [ - "dist" - ], - "repository": "https://github.com/Uniswap/uniswap-sdk-core.git", - "keywords": [ - "uniswap", - "ethereum" - ], - "module": "dist/sdk-core.esm.js", - "scripts": { - "build": "tsdx build", - "start": "tsdx watch", - "test": "tsdx test", - "prepublishOnly": "tsdx build" - }, - "dependencies": { - "@ethersproject/address": "^5.0.2", - "big.js": "^5.2.2", - "decimal.js-light": "^2.5.0", - "jsbi": "^3.1.4", - "tiny-invariant": "^1.1.0", - "toformat": "^2.0.0" - }, - "devDependencies": { - "@types/big.js": "^4.0.5", - "@types/jest": "^24.0.25", - "tsdx": "^0.14.1" - }, - "engines": { - "node": ">=10" - }, - "prettier": { - "printWidth": 120, - "semi": false, - "singleQuote": true - } -} diff --git a/uniswap-packages-forks/v2-sdk/LICENSE b/uniswap-packages-forks/v2-sdk/LICENSE deleted file mode 100644 index 0c6c24ca9dd..00000000000 --- a/uniswap-packages-forks/v2-sdk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Uniswap Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/uniswap-packages-forks/v2-sdk/README.md b/uniswap-packages-forks/v2-sdk/README.md deleted file mode 100644 index fec6b24779d..00000000000 --- a/uniswap-packages-forks/v2-sdk/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Uniswap V2 SDK - -[![Unit Tests](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3A%22Unit+Tests%22) -[![Lint](https://github.com/Uniswap/uniswap-v2-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v2-sdk/actions?query=workflow%3ALint) -[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) -[![npm version](https://img.shields.io/npm/v/@uniswap/v2-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v2-sdk/v/latest) -[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v2-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v2-sdk@latest) - -In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/). diff --git a/uniswap-packages-forks/v2-sdk/dist/constants.d.ts b/uniswap-packages-forks/v2-sdk/dist/constants.d.ts deleted file mode 100644 index e56173452df..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/constants.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import JSBI from 'jsbi'; -export declare const FACTORY_ADDRESS = "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"; -export declare const INIT_CODE_HASH = "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f"; -export declare const MINIMUM_LIQUIDITY: JSBI; -export declare const ZERO: JSBI; -export declare const ONE: JSBI; -export declare const FIVE: JSBI; -export declare const _997: JSBI; -export declare const _1000: JSBI; diff --git a/uniswap-packages-forks/v2-sdk/dist/entities/index.d.ts b/uniswap-packages-forks/v2-sdk/dist/entities/index.d.ts deleted file mode 100644 index 6a0392c912f..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/entities/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './pair'; -export * from './route'; -export * from './trade'; diff --git a/uniswap-packages-forks/v2-sdk/dist/entities/pair.d.ts b/uniswap-packages-forks/v2-sdk/dist/entities/pair.d.ts deleted file mode 100644 index 47862b80075..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/entities/pair.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'; -export declare const computePairAddress: ({ factoryAddress, tokenA, tokenB }: { - factoryAddress: string; - tokenA: Token; - tokenB: Token; -}) => string; -export declare class Pair { - readonly liquidityToken: Token; - private readonly tokenAmounts; - static getAddress(tokenA: Token, tokenB: Token): string; - constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount); - /** - * Returns true if the token is either token0 or token1 - * @param token to check - */ - involvesToken(token: Token): boolean; - /** - * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0 - */ - get token0Price(): Price; - /** - * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1 - */ - get token1Price(): Price; - /** - * Return the price of the given token in terms of the other token in the pair. - * @param token token to return price of - */ - priceOf(token: Token): Price; - /** - * Returns the chain ID of the tokens in the pair. - */ - get chainId(): ChainId | number; - get token0(): Token; - get token1(): Token; - get reserve0(): CurrencyAmount; - get reserve1(): CurrencyAmount; - reserveOf(token: Token): CurrencyAmount; - getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair]; - getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair]; - getLiquidityMinted(totalSupply: CurrencyAmount, tokenAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount): CurrencyAmount; - getLiquidityValue(token: Token, totalSupply: CurrencyAmount, liquidity: CurrencyAmount, feeOn?: boolean, kLast?: BigintIsh): CurrencyAmount; -} diff --git a/uniswap-packages-forks/v2-sdk/dist/entities/route.d.ts b/uniswap-packages-forks/v2-sdk/dist/entities/route.d.ts deleted file mode 100644 index 8dec7204919..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/entities/route.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ChainId, Currency, Price, Token } from '@uniswap/sdk-core'; -import { Pair } from './pair'; -export declare class Route { - readonly pairs: Pair[]; - readonly path: Token[]; - readonly input: TInput; - readonly output: TOutput; - constructor(pairs: Pair[], input: TInput, output: TOutput); - private _midPrice; - get midPrice(): Price; - get chainId(): ChainId | number; -} diff --git a/uniswap-packages-forks/v2-sdk/dist/entities/trade.d.ts b/uniswap-packages-forks/v2-sdk/dist/entities/trade.d.ts deleted file mode 100644 index b2ea6997667..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/entities/trade.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { Currency, CurrencyAmount, Percent, Price, TradeType } from '@uniswap/sdk-core'; -import { Pair } from './pair'; -import { Route } from './route'; -interface InputOutput { - readonly inputAmount: CurrencyAmount; - readonly outputAmount: CurrencyAmount; -} -export declare function inputOutputComparator(a: InputOutput, b: InputOutput): number; -export declare function tradeComparator(a: Trade, b: Trade): number; -export interface BestTradeOptions { - maxNumResults?: number; - maxHops?: number; -} -/** - * Represents a trade executed against a list of pairs. - * Does not account for slippage, i.e. trades that front run this trade and move the price. - */ -export declare class Trade { - /** - * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies. - */ - readonly route: Route; - /** - * The type of the trade, either exact in or exact out. - */ - readonly tradeType: TTradeType; - /** - * The input amount for the trade assuming no slippage. - */ - readonly inputAmount: CurrencyAmount; - /** - * The output amount for the trade assuming no slippage. - */ - readonly outputAmount: CurrencyAmount; - /** - * The price expressed in terms of output amount/input amount. - */ - readonly executionPrice: Price; - /** - * The percent difference between the mid price before the trade and the trade execution price. - */ - readonly priceImpact: Percent; - /** - * Constructs an exact in trade with the given amount in and route - * @param route route of the exact in trade - * @param amountIn the amount being passed in - */ - static exactIn(route: Route, amountIn: CurrencyAmount): Trade; - /** - * Constructs an exact out trade with the given amount out and route - * @param route route of the exact out trade - * @param amountOut the amount returned by the trade - */ - static exactOut(route: Route, amountOut: CurrencyAmount): Trade; - constructor(route: Route, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount, tradeType: TTradeType); - /** - * Get the minimum amount that must be received from this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - minimumAmountOut(slippageTolerance: Percent): CurrencyAmount; - /** - * Get the maximum amount in that can be spent via this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - maximumAmountIn(slippageTolerance: Percent): CurrencyAmount; - /** - * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token - * amount to an output token, making at most `maxHops` hops. - * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pairs the pairs to consider in finding the best trade - * @param nextAmountIn exact amount of input currency to spend - * @param currencyOut the desired currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair - * @param currentPairs used in recursion; the current list of pairs - * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter - * @param bestTrades used in recursion; the current list of best trades - */ - static bestTradeExactIn(pairs: Pair[], currencyAmountIn: CurrencyAmount, currencyOut: TOutput, { maxNumResults, maxHops }?: BestTradeOptions, currentPairs?: Pair[], nextAmountIn?: CurrencyAmount, bestTrades?: Trade[]): Trade[]; - /** - * Return the execution price after accounting for slippage tolerance - * @param slippageTolerance the allowed tolerated slippage - */ - worstExecutionPrice(slippageTolerance: Percent): Price; - /** - * similar to the above method but instead targets a fixed output amount - * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token - * to an output token amount, making at most `maxHops` hops - * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pairs the pairs to consider in finding the best trade - * @param currencyIn the currency to spend - * @param nextAmountOut the exact amount of currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair - * @param currentPairs used in recursion; the current list of pairs - * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter - * @param bestTrades used in recursion; the current list of best trades - */ - static bestTradeExactOut(pairs: Pair[], currencyIn: TInput, currencyAmountOut: CurrencyAmount, { maxNumResults, maxHops }?: BestTradeOptions, currentPairs?: Pair[], nextAmountOut?: CurrencyAmount, bestTrades?: Trade[]): Trade[]; -} -export {}; diff --git a/uniswap-packages-forks/v2-sdk/dist/errors.d.ts b/uniswap-packages-forks/v2-sdk/dist/errors.d.ts deleted file mode 100644 index e08d20c800f..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/errors.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be - * obtained by sending any amount of input. - */ -export declare class InsufficientReservesError extends Error { - readonly isInsufficientReservesError: true; - constructor(); -} -/** - * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less - * than the price of a single unit of output after fees. - */ -export declare class InsufficientInputAmountError extends Error { - readonly isInsufficientInputAmountError: true; - constructor(); -} diff --git a/uniswap-packages-forks/v2-sdk/dist/index.d.ts b/uniswap-packages-forks/v2-sdk/dist/index.d.ts deleted file mode 100644 index d9c3baf2f8a..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY } from './constants'; -export * from './errors'; -export * from './entities'; -export * from './router'; diff --git a/uniswap-packages-forks/v2-sdk/dist/index.js b/uniswap-packages-forks/v2-sdk/dist/index.js deleted file mode 100644 index b9df67ce78c..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/index.js +++ /dev/null @@ -1,8 +0,0 @@ - -'use strict' - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./v2-sdk.cjs.production.min.js') -} else { - module.exports = require('./v2-sdk.cjs.development.js') -} diff --git a/uniswap-packages-forks/v2-sdk/dist/router.d.ts b/uniswap-packages-forks/v2-sdk/dist/router.d.ts deleted file mode 100644 index bdd3058661a..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/router.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { Currency, Percent, TradeType } from '@uniswap/sdk-core'; -import { Trade } from 'entities'; -/** - * Options for producing the arguments to send call to the router. - */ -export interface TradeOptions { - /** - * How much the execution price is allowed to move unfavorably from the trade execution price. - */ - allowedSlippage: Percent; - /** - * How long the swap is valid until it expires, in seconds. - * This will be used to produce a `deadline` parameter which is computed from when the swap call parameters - * are generated. - */ - ttl: number; - /** - * The account that should receive the output of the swap. - */ - recipient: string; - /** - * Whether any of the tokens in the path are fee on transfer tokens, which should be handled with special methods - */ - feeOnTransfer?: boolean; -} -export interface TradeOptionsDeadline extends Omit { - /** - * When the transaction expires. - * This is an atlernate to specifying the ttl, for when you do not want to use local time. - */ - deadline: number; -} -/** - * The parameters to use in the call to the Uniswap V2 Router to execute a trade. - */ -export interface SwapParameters { - /** - * The method to call on the Uniswap V2 Router. - */ - methodName: string; - /** - * The arguments to pass to the method, all hex encoded. - */ - args: (string | string[])[]; - /** - * The amount of wei to send in hex. - */ - value: string; -} -/** - * Represents the Uniswap V2 Router, and has static methods for helping execute trades. - */ -export declare abstract class Router { - /** - * Cannot be constructed. - */ - private constructor(); - /** - * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. - * @param trade to produce call parameters for - * @param options options for the call parameters - */ - static swapCallParameters(trade: Trade, options: TradeOptions | TradeOptionsDeadline): SwapParameters; -} diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js deleted file mode 100644 index b4b836ace2f..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js +++ /dev/null @@ -1,1260 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var JSBI = _interopDefault(require('jsbi')); -var sdkCore = require('@uniswap/sdk-core'); -var invariant = _interopDefault(require('tiny-invariant')); -var solidity = require('@ethersproject/solidity'); -var address = require('@ethersproject/address'); -var _Decimal = _interopDefault(require('decimal.js-light')); -var _Big = _interopDefault(require('big.js')); -var toFormat = _interopDefault(require('toformat')); - -var FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'; -var INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'; -var MINIMUM_LIQUIDITY = /*#__PURE__*/JSBI.BigInt(1000); // exports for internal consumption - -var ZERO = /*#__PURE__*/JSBI.BigInt(0); -var ONE = /*#__PURE__*/JSBI.BigInt(1); -var FIVE = /*#__PURE__*/JSBI.BigInt(5); -var _997 = /*#__PURE__*/JSBI.BigInt(997); -var _1000 = /*#__PURE__*/JSBI.BigInt(1000); - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); -} - -function _isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } -} - -function _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} - -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -// see https://stackoverflow.com/a/41102306 -var CAN_SET_PROTOTYPE = ('setPrototypeOf' in Object); -/** - * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be - * obtained by sending any amount of input. - */ - -var InsufficientReservesError = /*#__PURE__*/function (_Error) { - _inheritsLoose(InsufficientReservesError, _Error); - - function InsufficientReservesError() { - var _this; - - _this = _Error.call(this) || this; - _this.isInsufficientReservesError = true; - _this.name = _this.constructor.name; - if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(_assertThisInitialized(_this), (this instanceof InsufficientReservesError ? this.constructor : void 0).prototype); - return _this; - } - - return InsufficientReservesError; -}( /*#__PURE__*/_wrapNativeSuper(Error)); -/** - * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less - * than the price of a single unit of output after fees. - */ - -var InsufficientInputAmountError = /*#__PURE__*/function (_Error2) { - _inheritsLoose(InsufficientInputAmountError, _Error2); - - function InsufficientInputAmountError() { - var _this2; - - _this2 = _Error2.call(this) || this; - _this2.isInsufficientInputAmountError = true; - _this2.name = _this2.constructor.name; - if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(_assertThisInitialized(_this2), (this instanceof InsufficientInputAmountError ? this.constructor : void 0).prototype); - return _this2; - } - - return InsufficientInputAmountError; -}( /*#__PURE__*/_wrapNativeSuper(Error)); - -var computePairAddress = function computePairAddress(_ref) { - var factoryAddress = _ref.factoryAddress, - tokenA = _ref.tokenA, - tokenB = _ref.tokenB; - - var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], - token0 = _ref2[0], - token1 = _ref2[1]; // does safety checks - - - return address.getCreate2Address(factoryAddress, solidity.keccak256(['bytes'], [solidity.pack(['address', 'address'], [token0.address, token1.address])]), INIT_CODE_HASH); -}; -var Pair = /*#__PURE__*/function () { - function Pair(currencyAmountA, tokenAmountB) { - var tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks - ? [currencyAmountA, tokenAmountB] : [tokenAmountB, currencyAmountA]; - this.liquidityToken = new sdkCore.Token(tokenAmounts[0].currency.chainId, Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency), 18, 'UNI-V2', 'Uniswap V2'); - this.tokenAmounts = tokenAmounts; - } - - Pair.getAddress = function getAddress(tokenA, tokenB) { - return computePairAddress({ - factoryAddress: FACTORY_ADDRESS, - tokenA: tokenA, - tokenB: tokenB - }); - } - /** - * Returns true if the token is either token0 or token1 - * @param token to check - */ - ; - - var _proto = Pair.prototype; - - _proto.involvesToken = function involvesToken(token) { - return token.equals(this.token0) || token.equals(this.token1); - } - /** - * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0 - */ - ; - - /** - * Return the price of the given token in terms of the other token in the pair. - * @param token token to return price of - */ - _proto.priceOf = function priceOf(token) { - !this.involvesToken(token) ? invariant(false, 'TOKEN') : void 0; - return token.equals(this.token0) ? this.token0Price : this.token1Price; - } - /** - * Returns the chain ID of the tokens in the pair. - */ - ; - - _proto.reserveOf = function reserveOf(token) { - !this.involvesToken(token) ? invariant(false, 'TOKEN') : void 0; - return token.equals(this.token0) ? this.reserve0 : this.reserve1; - }; - - _proto.getOutputAmount = function getOutputAmount(inputAmount) { - !this.involvesToken(inputAmount.currency) ? invariant(false, 'TOKEN') : void 0; - - if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) { - throw new InsufficientReservesError(); - } - - var inputReserve = this.reserveOf(inputAmount.currency); - var outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0); - var inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997); - var numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient); - var denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee); - var outputAmount = sdkCore.CurrencyAmount.fromRawAmount(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0, JSBI.divide(numerator, denominator)); - - if (JSBI.equal(outputAmount.quotient, ZERO)) { - throw new InsufficientInputAmountError(); - } - - return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]; - }; - - _proto.getInputAmount = function getInputAmount(outputAmount) { - !this.involvesToken(outputAmount.currency) ? invariant(false, 'TOKEN') : void 0; - - if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO) || JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)) { - throw new InsufficientReservesError(); - } - - var outputReserve = this.reserveOf(outputAmount.currency); - var inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0); - var numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000); - var denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997); - var inputAmount = sdkCore.CurrencyAmount.fromRawAmount(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0, JSBI.add(JSBI.divide(numerator, denominator), ONE)); - return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]; - }; - - _proto.getLiquidityMinted = function getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB) { - !totalSupply.currency.equals(this.liquidityToken) ? invariant(false, 'LIQUIDITY') : void 0; - var tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks - ? [tokenAmountA, tokenAmountB] : [tokenAmountB, tokenAmountA]; - !(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1)) ? invariant(false, 'TOKEN') : void 0; - var liquidity; - - if (JSBI.equal(totalSupply.quotient, ZERO)) { - liquidity = JSBI.subtract(sdkCore.sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)), MINIMUM_LIQUIDITY); - } else { - var amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient); - var amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient); - liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1; - } - - if (!JSBI.greaterThan(liquidity, ZERO)) { - throw new InsufficientInputAmountError(); - } - - return sdkCore.CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity); - }; - - _proto.getLiquidityValue = function getLiquidityValue(token, totalSupply, liquidity, feeOn, kLast) { - if (feeOn === void 0) { - feeOn = false; - } - - !this.involvesToken(token) ? invariant(false, 'TOKEN') : void 0; - !totalSupply.currency.equals(this.liquidityToken) ? invariant(false, 'TOTAL_SUPPLY') : void 0; - !liquidity.currency.equals(this.liquidityToken) ? invariant(false, 'LIQUIDITY') : void 0; - !JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient) ? invariant(false, 'LIQUIDITY') : void 0; - var totalSupplyAdjusted; - - if (!feeOn) { - totalSupplyAdjusted = totalSupply; - } else { - !!!kLast ? invariant(false, 'K_LAST') : void 0; - var kLastParsed = JSBI.BigInt(kLast); - - if (!JSBI.equal(kLastParsed, ZERO)) { - var rootK = sdkCore.sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient)); - var rootKLast = sdkCore.sqrt(kLastParsed); - - if (JSBI.greaterThan(rootK, rootKLast)) { - var numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast)); - var denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast); - var feeLiquidity = JSBI.divide(numerator, denominator); - totalSupplyAdjusted = totalSupply.add(sdkCore.CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity)); - } else { - totalSupplyAdjusted = totalSupply; - } - } else { - totalSupplyAdjusted = totalSupply; - } - } - - return sdkCore.CurrencyAmount.fromRawAmount(token, JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)); - }; - - _createClass(Pair, [{ - key: "token0Price", - get: function get() { - var result = this.tokenAmounts[1].divide(this.tokenAmounts[0]); - return new sdkCore.Price(this.token0, this.token1, result.denominator, result.numerator); - } - /** - * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1 - */ - - }, { - key: "token1Price", - get: function get() { - var result = this.tokenAmounts[0].divide(this.tokenAmounts[1]); - return new sdkCore.Price(this.token1, this.token0, result.denominator, result.numerator); - } - }, { - key: "chainId", - get: function get() { - return this.token0.chainId; - } - }, { - key: "token0", - get: function get() { - return this.tokenAmounts[0].currency; - } - }, { - key: "token1", - get: function get() { - return this.tokenAmounts[1].currency; - } - }, { - key: "reserve0", - get: function get() { - return this.tokenAmounts[0]; - } - }, { - key: "reserve1", - get: function get() { - return this.tokenAmounts[1]; - } - }]); - - return Pair; -}(); - -var Route = /*#__PURE__*/function () { - function Route(pairs, input, output) { - this._midPrice = null; - !(pairs.length > 0) ? invariant(false, 'PAIRS') : void 0; - var chainId = pairs[0].chainId; - !pairs.every(function (pair) { - return pair.chainId === chainId; - }) ? invariant(false, 'CHAIN_IDS') : void 0; - var wrappedInput = sdkCore.wrappedCurrency(input, chainId); - !pairs[0].involvesToken(wrappedInput) ? invariant(false, 'INPUT') : void 0; - !(typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(sdkCore.wrappedCurrency(output, chainId))) ? invariant(false, 'OUTPUT') : void 0; - var path = [wrappedInput]; - - for (var _iterator = _createForOfIteratorHelperLoose(pairs.entries()), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - i = _step$value[0], - pair = _step$value[1]; - var currentInput = path[i]; - !(currentInput.equals(pair.token0) || currentInput.equals(pair.token1)) ? invariant(false, 'PATH') : void 0; - - var _output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0; - - path.push(_output); - } - - this.pairs = pairs; - this.path = path; - this.input = input; - this.output = output; - } - - _createClass(Route, [{ - key: "midPrice", - get: function get() { - if (this._midPrice !== null) return this._midPrice; - var prices = []; - - for (var _iterator2 = _createForOfIteratorHelperLoose(this.pairs.entries()), _step2; !(_step2 = _iterator2()).done;) { - var _step2$value = _step2.value, - i = _step2$value[0], - pair = _step2$value[1]; - prices.push(this.path[i].equals(pair.token0) ? new sdkCore.Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient) : new sdkCore.Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)); - } - - var reduced = prices.slice(1).reduce(function (accumulator, currentValue) { - return accumulator.multiply(currentValue); - }, prices[0]); - return this._midPrice = new sdkCore.Price(this.input, this.output, reduced.denominator, reduced.numerator); - } - }, { - key: "chainId", - get: function get() { - return this.pairs[0].chainId; - } - }]); - - return Route; -}(); - -var ChainId; - -(function (ChainId) { - ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; - ChainId[ChainId["ROPSTEN"] = 3] = "ROPSTEN"; - ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY"; - ChainId[ChainId["G\xD6RLI"] = 5] = "G\xD6RLI"; - ChainId[ChainId["KOVAN"] = 42] = "KOVAN"; -})(ChainId || (ChainId = {})); - -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 = {})); - -function _defineProperties$1(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass$1(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$1(Constructor, staticProps); - return Constructor; -} - -function _inheritsLoose$1(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} -/** - * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. - * - * The only instance of the base class `Currency` is Ether. - */ - - -var BaseCurrency = -/** - * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. - * @param decimals decimals of the currency - * @param symbol symbol of the currency - * @param name of the currency - */ -function BaseCurrency(decimals, symbol, name) { - !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? invariant(false, 'DECIMALS') : void 0; - this.decimals = decimals; - this.symbol = symbol; - this.name = name; -}; - -var _toSignificantRoundin, _toFixedRounding; - -var Decimal = /*#__PURE__*/toFormat(_Decimal); -var Big = /*#__PURE__*/toFormat(_Big); -var toSignificantRounding = (_toSignificantRoundin = {}, _toSignificantRoundin[Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN, _toSignificantRoundin[Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP, _toSignificantRoundin[Rounding.ROUND_UP] = Decimal.ROUND_UP, _toSignificantRoundin); -var toFixedRounding = (_toFixedRounding = {}, _toFixedRounding[Rounding.ROUND_DOWN] = 0, _toFixedRounding[Rounding.ROUND_HALF_UP] = 1, _toFixedRounding[Rounding.ROUND_UP] = 3, _toFixedRounding); - -var Fraction = /*#__PURE__*/function () { - function Fraction(numerator, denominator) { - if (denominator === void 0) { - denominator = JSBI.BigInt(1); - } - - this.numerator = JSBI.BigInt(numerator); - this.denominator = JSBI.BigInt(denominator); - } - - Fraction.tryParseFraction = function tryParseFraction(fractionish) { - if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') return new Fraction(fractionish); - if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish; - throw new Error('Could not parse fraction'); - } // performs floor division - ; - - var _proto = Fraction.prototype; - - _proto.invert = function invert() { - return new Fraction(this.denominator, this.numerator); - }; - - _proto.add = function add(other) { - var otherParsed = Fraction.tryParseFraction(other); - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator); - } - - return new Fraction(JSBI.add(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.subtract = function subtract(other) { - var otherParsed = Fraction.tryParseFraction(other); - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator); - } - - return new Fraction(JSBI.subtract(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.lessThan = function lessThan(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.lessThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.equalTo = function equalTo(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.equal(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.greaterThan = function greaterThan(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.greaterThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.multiply = function multiply(other) { - var otherParsed = Fraction.tryParseFraction(other); - return new Fraction(JSBI.multiply(this.numerator, otherParsed.numerator), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.divide = function divide(other) { - var otherParsed = Fraction.tryParseFraction(other); - return new Fraction(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(this.denominator, otherParsed.numerator)); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_HALF_UP; - } - - !Number.isInteger(significantDigits) ? invariant(false, significantDigits + " is not an integer.") : void 0; - !(significantDigits > 0) ? invariant(false, significantDigits + " is not positive.") : void 0; - Decimal.set({ - precision: significantDigits + 1, - rounding: toSignificantRounding[rounding] - }); - var quotient = new Decimal(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(significantDigits); - return quotient.toFormat(quotient.decimalPlaces(), format); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_HALF_UP; - } - - !Number.isInteger(decimalPlaces) ? invariant(false, decimalPlaces + " is not an integer.") : void 0; - !(decimalPlaces >= 0) ? invariant(false, decimalPlaces + " is negative.") : void 0; - Big.DP = decimalPlaces; - Big.RM = toFixedRounding[rounding]; - return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format); - } - /** - * Helper method for converting any super class back to a fraction - */ - ; - - _createClass$1(Fraction, [{ - key: "quotient", - get: function get() { - return JSBI.divide(this.numerator, this.denominator); - } // remainder after floor division - - }, { - key: "remainder", - get: function get() { - return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator); - } - }, { - key: "asFraction", - get: function get() { - return new Fraction(this.numerator, this.denominator); - } - }]); - - return Fraction; -}(); - -var ONE_HUNDRED = /*#__PURE__*/new Fraction( /*#__PURE__*/JSBI.BigInt(100)); -/** - * Converts a fraction to a percent - * @param fraction the fraction to convert - */ - -function toPercent(fraction) { - return new Percent(fraction.numerator, fraction.denominator); -} - -var Percent = /*#__PURE__*/function (_Fraction) { - _inheritsLoose$1(Percent, _Fraction); - - function Percent() { - var _this; - - _this = _Fraction.apply(this, arguments) || this; - /** - * This boolean prevents a fraction from being interpreted as a Percent - */ - - _this.isPercent = true; - return _this; - } - - var _proto = Percent.prototype; - - _proto.add = function add(other) { - return toPercent(_Fraction.prototype.add.call(this, other)); - }; - - _proto.subtract = function subtract(other) { - return toPercent(_Fraction.prototype.subtract.call(this, other)); - }; - - _proto.multiply = function multiply(other) { - return toPercent(_Fraction.prototype.multiply.call(this, other)); - }; - - _proto.divide = function divide(other) { - return toPercent(_Fraction.prototype.divide.call(this, other)); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 5; - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 2; - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding); - }; - - return Percent; -}(Fraction); -/** - * Validates an address and returns the parsed (checksummed) version of that address - * @param address the unchecksummed hex address - */ - - -function validateAndParseAddress(address$1) { - try { - return address.getAddress(address$1); - } catch (error) { - throw new Error(address$1 + " is not a valid address."); - } -} - -var _WETH; -/** - * Represents an ERC20 token with a unique address and some metadata. - */ - - -var Token = /*#__PURE__*/function (_BaseCurrency) { - _inheritsLoose$1(Token, _BaseCurrency); - - function Token(chainId, address, decimals, symbol, name) { - var _this; - - _this = _BaseCurrency.call(this, decimals, symbol, name) || this; - _this.isEther = false; - _this.isToken = true; - _this.chainId = chainId; - _this.address = validateAndParseAddress(address); - return _this; - } - /** - * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. - * @param other other token to compare - */ - - - var _proto = Token.prototype; - - _proto.equals = function equals(other) { - // short circuit on reference equality - if (this === other) { - return true; - } - - return this.chainId === other.chainId && this.address === other.address; - } - /** - * Returns true if the address of this token sorts before the address of the other token - * @param other other token to compare - * @throws if the tokens have the same address - * @throws if the tokens are on different chains - */ - ; - - _proto.sortsBefore = function sortsBefore(other) { - !(this.chainId === other.chainId) ? invariant(false, 'CHAIN_IDS') : void 0; - !(this.address !== other.address) ? invariant(false, 'ADDRESSES') : void 0; - return this.address.toLowerCase() < other.address.toLowerCase(); - }; - - return Token; -}(BaseCurrency); - -var WETH9 = (_WETH = {}, _WETH[ChainId.MAINNET] = /*#__PURE__*/new Token(ChainId.MAINNET, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.ROPSTEN] = /*#__PURE__*/new Token(ChainId.ROPSTEN, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.RINKEBY] = /*#__PURE__*/new Token(ChainId.RINKEBY, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.GÖRLI] = /*#__PURE__*/new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.KOVAN] = /*#__PURE__*/new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'), _WETH); -/** - * Returns the percent difference between the mid price and the execution price, i.e. price impact. - * @param midPrice mid price before the trade - * @param inputAmount the input amount of the trade - * @param outputAmount the output amount of the trade - */ - -function computePriceImpact(midPrice, inputAmount, outputAmount) { - var quotedOutputAmount = midPrice.quote(inputAmount); // calculate price impact := (exactQuote - outputAmount) / exactQuote - - var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount); - return new Percent(priceImpact.numerator, priceImpact.denominator); -} // `maxSize` by removing the last item - -// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first - -function inputOutputComparator(a, b) { - // must have same input and output token for comparison - !sdkCore.currencyEquals(a.inputAmount.currency, b.inputAmount.currency) ? invariant(false, 'INPUT_CURRENCY') : void 0; - !sdkCore.currencyEquals(a.outputAmount.currency, b.outputAmount.currency) ? invariant(false, 'OUTPUT_CURRENCY') : void 0; - - if (a.outputAmount.equalTo(b.outputAmount)) { - if (a.inputAmount.equalTo(b.inputAmount)) { - return 0; - } // trade A requires less input than trade B, so A should come first - - - if (a.inputAmount.lessThan(b.inputAmount)) { - return -1; - } else { - return 1; - } - } else { - // tradeA has less output than trade B, so should come second - if (a.outputAmount.lessThan(b.outputAmount)) { - return 1; - } else { - return -1; - } - } -} // extension of the input output comparator that also considers other dimensions of the trade in ranking them - -function tradeComparator(a, b) { - var ioComp = inputOutputComparator(a, b); - - if (ioComp !== 0) { - return ioComp; - } // consider lowest slippage next, since these are less likely to fail - - - if (a.priceImpact.lessThan(b.priceImpact)) { - return -1; - } else if (a.priceImpact.greaterThan(b.priceImpact)) { - return 1; - } // finally consider the number of hops since each hop costs gas - - - return a.route.path.length - b.route.path.length; -} -/** - * Represents a trade executed against a list of pairs. - * Does not account for slippage, i.e. trades that front run this trade and move the price. - */ - -var Trade = /*#__PURE__*/function () { - function Trade(route, amount, tradeType) { - this.route = route; - this.tradeType = tradeType; - var tokenAmounts = new Array(route.path.length); - - if (tradeType === sdkCore.TradeType.EXACT_INPUT) { - !sdkCore.currencyEquals(amount.currency, route.input) ? invariant(false, 'INPUT') : void 0; - tokenAmounts[0] = sdkCore.wrappedCurrencyAmount(amount, route.chainId); - - for (var i = 0; i < route.path.length - 1; i++) { - var pair = route.pairs[i]; - - var _pair$getOutputAmount = pair.getOutputAmount(tokenAmounts[i]), - outputAmount = _pair$getOutputAmount[0]; - - tokenAmounts[i + 1] = outputAmount; - } - - this.inputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator); - this.outputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.output, tokenAmounts[tokenAmounts.length - 1].numerator, tokenAmounts[tokenAmounts.length - 1].denominator); - } else { - !sdkCore.currencyEquals(amount.currency, route.output) ? invariant(false, 'OUTPUT') : void 0; - tokenAmounts[tokenAmounts.length - 1] = sdkCore.wrappedCurrencyAmount(amount, route.chainId); - - for (var _i = route.path.length - 1; _i > 0; _i--) { - var _pair = route.pairs[_i - 1]; - - var _pair$getInputAmount = _pair.getInputAmount(tokenAmounts[_i]), - inputAmount = _pair$getInputAmount[0]; - - tokenAmounts[_i - 1] = inputAmount; - } - - this.inputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.input, tokenAmounts[0].numerator, tokenAmounts[0].denominator); - this.outputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator); - } - - this.executionPrice = new sdkCore.Price(this.inputAmount.currency, this.outputAmount.currency, this.inputAmount.quotient, this.outputAmount.quotient); - this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount); - } - /** - * Constructs an exact in trade with the given amount in and route - * @param route route of the exact in trade - * @param amountIn the amount being passed in - */ - - - Trade.exactIn = function exactIn(route, amountIn) { - return new Trade(route, amountIn, sdkCore.TradeType.EXACT_INPUT); - } - /** - * Constructs an exact out trade with the given amount out and route - * @param route route of the exact out trade - * @param amountOut the amount returned by the trade - */ - ; - - Trade.exactOut = function exactOut(route, amountOut) { - return new Trade(route, amountOut, sdkCore.TradeType.EXACT_OUTPUT); - } - /** - * Get the minimum amount that must be received from this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - ; - - var _proto = Trade.prototype; - - _proto.minimumAmountOut = function minimumAmountOut(slippageTolerance) { - !!slippageTolerance.lessThan(ZERO) ? invariant(false, 'SLIPPAGE_TOLERANCE') : void 0; - - if (this.tradeType === sdkCore.TradeType.EXACT_OUTPUT) { - return this.outputAmount; - } else { - var slippageAdjustedAmountOut = new sdkCore.Fraction(ONE).add(slippageTolerance).invert().multiply(this.outputAmount.quotient).quotient; - return sdkCore.CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut); - } - } - /** - * Get the maximum amount in that can be spent via this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - ; - - _proto.maximumAmountIn = function maximumAmountIn(slippageTolerance) { - !!slippageTolerance.lessThan(ZERO) ? invariant(false, 'SLIPPAGE_TOLERANCE') : void 0; - - if (this.tradeType === sdkCore.TradeType.EXACT_INPUT) { - return this.inputAmount; - } else { - var slippageAdjustedAmountIn = new sdkCore.Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient).quotient; - return sdkCore.CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn); - } - } - /** - * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token - * amount to an output token, making at most `maxHops` hops. - * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pairs the pairs to consider in finding the best trade - * @param nextAmountIn exact amount of input currency to spend - * @param currencyOut the desired currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair - * @param currentPairs used in recursion; the current list of pairs - * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter - * @param bestTrades used in recursion; the current list of best trades - */ - ; - - Trade.bestTradeExactIn = function bestTradeExactIn(pairs, currencyAmountIn, currencyOut, _temp, // used in recursion. - currentPairs, nextAmountIn, bestTrades) { - var _ref = _temp === void 0 ? {} : _temp, - _ref$maxNumResults = _ref.maxNumResults, - maxNumResults = _ref$maxNumResults === void 0 ? 3 : _ref$maxNumResults, - _ref$maxHops = _ref.maxHops, - maxHops = _ref$maxHops === void 0 ? 3 : _ref$maxHops; - - if (currentPairs === void 0) { - currentPairs = []; - } - - if (nextAmountIn === void 0) { - nextAmountIn = currencyAmountIn; - } - - if (bestTrades === void 0) { - bestTrades = []; - } - - !(pairs.length > 0) ? invariant(false, 'PAIRS') : void 0; - !(maxHops > 0) ? invariant(false, 'MAX_HOPS') : void 0; - !(currencyAmountIn === nextAmountIn || currentPairs.length > 0) ? invariant(false, 'INVALID_RECURSION') : void 0; - var chainId = nextAmountIn.currency.isToken ? nextAmountIn.currency.chainId : currencyOut.isToken ? currencyOut.chainId : undefined; - !(chainId !== undefined) ? invariant(false, 'CHAIN_ID') : void 0; - var amountIn = sdkCore.wrappedCurrencyAmount(nextAmountIn, chainId); - var tokenOut = sdkCore.wrappedCurrency(currencyOut, chainId); - - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i]; // pair irrelevant - - if (!sdkCore.currencyEquals(pair.token0, amountIn.currency) && !sdkCore.currencyEquals(pair.token1, amountIn.currency)) continue; - if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue; - var amountOut = void 0; - - try { - ; - - var _pair$getOutputAmount2 = pair.getOutputAmount(amountIn); - - amountOut = _pair$getOutputAmount2[0]; - } catch (error) { - // input too low - if (error.isInsufficientInputAmountError) { - continue; - } - - throw error; - } // we have arrived at the output token, so this is the final trade of one of the paths - - - if (sdkCore.currencyEquals(amountOut.currency, tokenOut)) { - sdkCore.sortedInsert(bestTrades, new Trade(new Route([].concat(currentPairs, [pair]), currencyAmountIn.currency, currencyOut), currencyAmountIn, sdkCore.TradeType.EXACT_INPUT), maxNumResults, tradeComparator); - } else if (maxHops > 1 && pairs.length > 1) { - var pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length)); // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops - - Trade.bestTradeExactIn(pairsExcludingThisPair, currencyAmountIn, currencyOut, { - maxNumResults: maxNumResults, - maxHops: maxHops - 1 - }, [].concat(currentPairs, [pair]), amountOut, bestTrades); - } - } - - return bestTrades; - } - /** - * Return the execution price after accounting for slippage tolerance - * @param slippageTolerance the allowed tolerated slippage - */ - ; - - _proto.worstExecutionPrice = function worstExecutionPrice(slippageTolerance) { - return new sdkCore.Price(this.inputAmount.currency, this.outputAmount.currency, this.maximumAmountIn(slippageTolerance).quotient, this.minimumAmountOut(slippageTolerance).quotient); - } - /** - * similar to the above method but instead targets a fixed output amount - * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token - * to an output token amount, making at most `maxHops` hops - * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pairs the pairs to consider in finding the best trade - * @param currencyIn the currency to spend - * @param nextAmountOut the exact amount of currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair - * @param currentPairs used in recursion; the current list of pairs - * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter - * @param bestTrades used in recursion; the current list of best trades - */ - ; - - Trade.bestTradeExactOut = function bestTradeExactOut(pairs, currencyIn, currencyAmountOut, _temp2, // used in recursion. - currentPairs, nextAmountOut, bestTrades) { - var _ref2 = _temp2 === void 0 ? {} : _temp2, - _ref2$maxNumResults = _ref2.maxNumResults, - maxNumResults = _ref2$maxNumResults === void 0 ? 3 : _ref2$maxNumResults, - _ref2$maxHops = _ref2.maxHops, - maxHops = _ref2$maxHops === void 0 ? 3 : _ref2$maxHops; - - if (currentPairs === void 0) { - currentPairs = []; - } - - if (nextAmountOut === void 0) { - nextAmountOut = currencyAmountOut; - } - - if (bestTrades === void 0) { - bestTrades = []; - } - - !(pairs.length > 0) ? invariant(false, 'PAIRS') : void 0; - !(maxHops > 0) ? invariant(false, 'MAX_HOPS') : void 0; - !(currencyAmountOut === nextAmountOut || currentPairs.length > 0) ? invariant(false, 'INVALID_RECURSION') : void 0; - var chainId = nextAmountOut.currency.isToken ? nextAmountOut.currency.chainId : currencyIn.isToken ? currencyIn.chainId : undefined; - !(chainId !== undefined) ? invariant(false, 'CHAIN_ID') : void 0; - var amountOut = sdkCore.wrappedCurrencyAmount(nextAmountOut, chainId); - var tokenIn = sdkCore.wrappedCurrency(currencyIn, chainId); - - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i]; // pair irrelevant - - if (!sdkCore.currencyEquals(pair.token0, amountOut.currency) && !sdkCore.currencyEquals(pair.token1, amountOut.currency)) continue; - if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue; - var amountIn = void 0; - - try { - ; - - var _pair$getInputAmount2 = pair.getInputAmount(amountOut); - - amountIn = _pair$getInputAmount2[0]; - } catch (error) { - // not enough liquidity in this pair - if (error.isInsufficientReservesError) { - continue; - } - - throw error; - } // we have arrived at the input token, so this is the first trade of one of the paths - - - if (sdkCore.currencyEquals(amountIn.currency, tokenIn)) { - sdkCore.sortedInsert(bestTrades, new Trade(new Route([pair].concat(currentPairs), currencyIn, currencyAmountOut.currency), currencyAmountOut, sdkCore.TradeType.EXACT_OUTPUT), maxNumResults, tradeComparator); - } else if (maxHops > 1 && pairs.length > 1) { - var pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length)); // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops - - Trade.bestTradeExactOut(pairsExcludingThisPair, currencyIn, currencyAmountOut, { - maxNumResults: maxNumResults, - maxHops: maxHops - 1 - }, [pair].concat(currentPairs), amountIn, bestTrades); - } - } - - return bestTrades; - }; - - return Trade; -}(); - -function toHex(currencyAmount) { - return "0x" + currencyAmount.quotient.toString(16); -} - -var ZERO_HEX = '0x0'; -/** - * Represents the Uniswap V2 Router, and has static methods for helping execute trades. - */ - -var Router = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function Router() {} - /** - * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. - * @param trade to produce call parameters for - * @param options options for the call parameters - */ - - - Router.swapCallParameters = function swapCallParameters(trade, options) { - var etherIn = trade.inputAmount.currency.isEther; - var etherOut = trade.outputAmount.currency.isEther; // the router does not support both ether in and out - - !!(etherIn && etherOut) ? invariant(false, 'ETHER_IN_OUT') : void 0; - !(!('ttl' in options) || options.ttl > 0) ? invariant(false, 'TTL') : void 0; - var to = sdkCore.validateAndParseAddress(options.recipient); - var amountIn = toHex(trade.maximumAmountIn(options.allowedSlippage)); - var amountOut = toHex(trade.minimumAmountOut(options.allowedSlippage)); - var path = trade.route.path.map(function (token) { - return token.address; - }); - var deadline = 'ttl' in options ? "0x" + (Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16) : "0x" + options.deadline.toString(16); - var useFeeOnTransfer = Boolean(options.feeOnTransfer); - var methodName; - var args; - var value; - - switch (trade.tradeType) { - case sdkCore.TradeType.EXACT_INPUT: - if (etherIn) { - methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'; // (uint amountOutMin, address[] calldata path, address to, uint deadline) - - args = [amountOut, path, to, deadline]; - value = amountIn; - } else if (etherOut) { - methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'; // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - - args = [amountIn, amountOut, path, to, deadline]; - value = ZERO_HEX; - } else { - methodName = useFeeOnTransfer ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens' : 'swapExactTokensForTokens'; // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - - args = [amountIn, amountOut, path, to, deadline]; - value = ZERO_HEX; - } - - break; - - case sdkCore.TradeType.EXACT_OUTPUT: - !!useFeeOnTransfer ? invariant(false, 'EXACT_OUT_FOT') : void 0; - - if (etherIn) { - methodName = 'swapETHForExactTokens'; // (uint amountOut, address[] calldata path, address to, uint deadline) - - args = [amountOut, path, to, deadline]; - value = amountIn; - } else if (etherOut) { - methodName = 'swapTokensForExactETH'; // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - - args = [amountOut, amountIn, path, to, deadline]; - value = ZERO_HEX; - } else { - methodName = 'swapTokensForExactTokens'; // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - - args = [amountOut, amountIn, path, to, deadline]; - value = ZERO_HEX; - } - - break; - } - - return { - methodName: methodName, - args: args, - value: value - }; - }; - - return Router; -}(); - -exports.FACTORY_ADDRESS = FACTORY_ADDRESS; -exports.INIT_CODE_HASH = INIT_CODE_HASH; -exports.InsufficientInputAmountError = InsufficientInputAmountError; -exports.InsufficientReservesError = InsufficientReservesError; -exports.MINIMUM_LIQUIDITY = MINIMUM_LIQUIDITY; -exports.Pair = Pair; -exports.Route = Route; -exports.Router = Router; -exports.Trade = Trade; -exports.computePairAddress = computePairAddress; -exports.inputOutputComparator = inputOutputComparator; -exports.tradeComparator = tradeComparator; -//# sourceMappingURL=v2-sdk.cjs.development.js.map diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js.map b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js.map deleted file mode 100644 index 06e6bb8f6eb..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.development.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"v2-sdk.cjs.development.js","sources":["../src/constants.ts","../src/errors.ts","../src/entities/pair.ts","../src/entities/route.ts","../../../sdk-core/src/constants.ts","../src/entities/trade.ts","../src/router.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\nexport const FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'\n\nexport const INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'\n\nexport const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)\n\n// exports for internal consumption\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\nexport const FIVE = JSBI.BigInt(5)\nexport const _997 = JSBI.BigInt(997)\nexport const _1000 = JSBI.BigInt(1000)\n","// see https://stackoverflow.com/a/41102306\nconst CAN_SET_PROTOTYPE = 'setPrototypeOf' in Object\n\n/**\n * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be\n * obtained by sending any amount of input.\n */\nexport class InsufficientReservesError extends Error {\n public readonly isInsufficientReservesError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\n/**\n * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less\n * than the price of a single unit of output after fees.\n */\nexport class InsufficientInputAmountError extends Error {\n public readonly isInsufficientInputAmountError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n","import { BigintIsh, ChainId, Price, sqrt, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { pack, keccak256 } from '@ethersproject/solidity'\nimport { getCreate2Address } from '@ethersproject/address'\n\nimport { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY, FIVE, _997, _1000, ONE, ZERO } from '../constants'\nimport { InsufficientReservesError, InsufficientInputAmountError } from '../errors'\n\nexport const computePairAddress = ({\n factoryAddress,\n tokenA,\n tokenB\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n}): string => {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]),\n INIT_CODE_HASH\n )\n}\nexport class Pair {\n public readonly liquidityToken: Token\n private readonly tokenAmounts: [CurrencyAmount, CurrencyAmount]\n\n public static getAddress(tokenA: Token, tokenB: Token): string {\n return computePairAddress({ factoryAddress: FACTORY_ADDRESS, tokenA, tokenB })\n }\n\n public constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount) {\n const tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [currencyAmountA, tokenAmountB]\n : [tokenAmountB, currencyAmountA]\n this.liquidityToken = new Token(\n tokenAmounts[0].currency.chainId,\n Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency),\n 18,\n 'UNI-V2',\n 'Uniswap V2'\n )\n this.tokenAmounts = tokenAmounts as [CurrencyAmount, CurrencyAmount]\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0\n */\n public get token0Price(): Price {\n const result = this.tokenAmounts[1].divide(this.tokenAmounts[0])\n return new Price(this.token0, this.token1, result.denominator, result.numerator)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1\n */\n public get token1Price(): Price {\n const result = this.tokenAmounts[0].divide(this.tokenAmounts[1])\n return new Price(this.token1, this.token0, result.denominator, result.numerator)\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pair.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pair.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n public get token0(): Token {\n return this.tokenAmounts[0].currency\n }\n\n public get token1(): Token {\n return this.tokenAmounts[1].currency\n }\n\n public get reserve0(): CurrencyAmount {\n return this.tokenAmounts[0]\n }\n\n public get reserve1(): CurrencyAmount {\n return this.tokenAmounts[1]\n }\n\n public reserveOf(token: Token): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.reserve0 : this.reserve1\n }\n\n public getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) {\n throw new InsufficientReservesError()\n }\n const inputReserve = this.reserveOf(inputAmount.currency)\n const outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997)\n const numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient)\n const denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee)\n const outputAmount = CurrencyAmount.fromRawAmount(\n inputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.divide(numerator, denominator)\n )\n if (JSBI.equal(outputAmount.quotient, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(outputAmount.currency), 'TOKEN')\n if (\n JSBI.equal(this.reserve0.quotient, ZERO) ||\n JSBI.equal(this.reserve1.quotient, ZERO) ||\n JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)\n ) {\n throw new InsufficientReservesError()\n }\n\n const outputReserve = this.reserveOf(outputAmount.currency)\n const inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000)\n const denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997)\n const inputAmount = CurrencyAmount.fromRawAmount(\n outputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.add(JSBI.divide(numerator, denominator), ONE)\n )\n return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getLiquidityMinted(\n totalSupply: CurrencyAmount,\n tokenAmountA: CurrencyAmount,\n tokenAmountB: CurrencyAmount\n ): CurrencyAmount {\n invariant(totalSupply.currency.equals(this.liquidityToken), 'LIQUIDITY')\n const tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [tokenAmountA, tokenAmountB]\n : [tokenAmountB, tokenAmountA]\n invariant(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1), 'TOKEN')\n\n let liquidity: JSBI\n if (JSBI.equal(totalSupply.quotient, ZERO)) {\n liquidity = JSBI.subtract(\n sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)),\n MINIMUM_LIQUIDITY\n )\n } else {\n const amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient)\n const amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient)\n liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1\n }\n if (!JSBI.greaterThan(liquidity, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity)\n }\n\n public getLiquidityValue(\n token: Token,\n totalSupply: CurrencyAmount,\n liquidity: CurrencyAmount,\n feeOn: boolean = false,\n kLast?: BigintIsh\n ): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n invariant(totalSupply.currency.equals(this.liquidityToken), 'TOTAL_SUPPLY')\n invariant(liquidity.currency.equals(this.liquidityToken), 'LIQUIDITY')\n invariant(JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient), 'LIQUIDITY')\n\n let totalSupplyAdjusted: CurrencyAmount\n if (!feeOn) {\n totalSupplyAdjusted = totalSupply\n } else {\n invariant(!!kLast, 'K_LAST')\n const kLastParsed = JSBI.BigInt(kLast)\n if (!JSBI.equal(kLastParsed, ZERO)) {\n const rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient))\n const rootKLast = sqrt(kLastParsed)\n if (JSBI.greaterThan(rootK, rootKLast)) {\n const numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast))\n const denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast)\n const feeLiquidity = JSBI.divide(numerator, denominator)\n totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity))\n } else {\n totalSupplyAdjusted = totalSupply\n }\n } else {\n totalSupplyAdjusted = totalSupply\n }\n }\n\n return CurrencyAmount.fromRawAmount(\n token,\n JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)\n )\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\n\nimport { Pair } from './pair'\n\nexport class Route {\n public readonly pairs: Pair[]\n public readonly path: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n public constructor(pairs: Pair[], input: TInput, output: TOutput) {\n invariant(pairs.length > 0, 'PAIRS')\n const chainId: ChainId | number = pairs[0].chainId\n invariant(\n pairs.every(pair => pair.chainId === chainId),\n 'CHAIN_IDS'\n )\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pairs[0].involvesToken(wrappedInput), 'INPUT')\n invariant(\n typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(wrappedCurrency(output, chainId)),\n 'OUTPUT'\n )\n\n const path: Token[] = [wrappedInput]\n for (const [i, pair] of pairs.entries()) {\n const currentInput = path[i]\n invariant(currentInput.equals(pair.token0) || currentInput.equals(pair.token1), 'PATH')\n const output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0\n path.push(output)\n }\n\n this.pairs = pairs\n this.path = path\n this.input = input\n this.output = output\n }\n\n private _midPrice: Price | null = null\n\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n const prices: Price[] = []\n for (const [i, pair] of this.pairs.entries()) {\n prices.push(\n this.path[i].equals(pair.token0)\n ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient)\n : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)\n )\n }\n const reduced = prices.slice(1).reduce((accumulator, currentValue) => accumulator.multiply(currentValue), prices[0])\n return (this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator))\n }\n\n public get chainId(): ChainId | number {\n return this.pairs[0].chainId\n }\n}\n","import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import {\n ChainId,\n Currency,\n CurrencyAmount,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n wrappedCurrency,\n TradeType,\n wrappedCurrencyAmount\n} from '@uniswap/sdk-core'\nimport { computePriceImpact, Token } from '../../../../sdk-core'\nimport { ONE, ZERO } from '../constants'\nimport invariant from 'tiny-invariant'\n\nimport { Pair } from './pair'\nimport { Route } from './route'\n\n// minimal interface so the input output comparator may be shared across types\ninterface InputOutput {\n readonly inputAmount: CurrencyAmount\n readonly outputAmount: CurrencyAmount\n}\n\n// comparator function that allows sorting trades by their output amounts, in decreasing order, and then input amounts\n// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first\nexport function inputOutputComparator(\n a: InputOutput,\n b: InputOutput\n): number {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n return 0\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n const ioComp = inputOutputComparator(a, b)\n if (ioComp !== 0) {\n return ioComp\n }\n\n // consider lowest slippage next, since these are less likely to fail\n if (a.priceImpact.lessThan(b.priceImpact)) {\n return -1\n } else if (a.priceImpact.greaterThan(b.priceImpact)) {\n return 1\n }\n\n // finally consider the number of hops since each hop costs gas\n return a.route.path.length - b.route.path.length\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pairs.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public readonly executionPrice: Price\n /**\n * The percent difference between the mid price before the trade and the trade execution price.\n */\n public readonly priceImpact: Percent\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Trade {\n return new Trade(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Trade {\n return new Trade(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n public constructor(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ) {\n this.route = route\n this.tradeType = tradeType\n\n const tokenAmounts: CurrencyAmount[] = new Array(route.path.length)\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n tokenAmounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.path.length - 1; i++) {\n const pair = route.pairs[i]\n const [outputAmount] = pair.getOutputAmount(tokenAmounts[i])\n tokenAmounts[i + 1] = outputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n this.outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n tokenAmounts[tokenAmounts.length - 1].numerator,\n tokenAmounts[tokenAmounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n tokenAmounts[tokenAmounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.path.length - 1; i > 0; i--) {\n const pair = route.pairs[i - 1]\n const [inputAmount] = pair.getInputAmount(tokenAmounts[i])\n tokenAmounts[i - 1] = inputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(\n route.input,\n tokenAmounts[0].numerator,\n tokenAmounts[0].denominator\n )\n this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n this.executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n )\n this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount)\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactIn(\n pairs: Pair[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountIn.currency) && !currencyEquals(pair.token1, amountIn.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = pair.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (currencyEquals(amountOut.currency, tokenOut)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([...currentPairs, pair], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n Trade.bestTradeExactIn(\n pairsExcludingThisPair,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPairs, pair],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactOut(\n pairs: Pair[],\n currencyIn: TInput,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? (currencyIn as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountOut.currency) && !currencyEquals(pair.token1, amountOut.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = pair.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pair\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([pair, ...currentPairs], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n Trade.bestTradeExactOut(\n pairsExcludingThisPair,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pair, ...currentPairs],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { Currency, CurrencyAmount, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport { Trade } from 'entities'\nimport invariant from 'tiny-invariant'\nimport { Token } from '../../../sdk-core'\n\n/**\n * Options for producing the arguments to send call to the router.\n */\nexport interface TradeOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n allowedSlippage: Percent\n /**\n * How long the swap is valid until it expires, in seconds.\n * This will be used to produce a `deadline` parameter which is computed from when the swap call parameters\n * are generated.\n */\n ttl: number\n /**\n * The account that should receive the output of the swap.\n */\n recipient: string\n\n /**\n * Whether any of the tokens in the path are fee on transfer tokens, which should be handled with special methods\n */\n feeOnTransfer?: boolean\n}\n\nexport interface TradeOptionsDeadline extends Omit {\n /**\n * When the transaction expires.\n * This is an atlernate to specifying the ttl, for when you do not want to use local time.\n */\n deadline: number\n}\n\n/**\n * The parameters to use in the call to the Uniswap V2 Router to execute a trade.\n */\nexport interface SwapParameters {\n /**\n * The method to call on the Uniswap V2 Router.\n */\n methodName: string\n /**\n * The arguments to pass to the method, all hex encoded.\n */\n args: (string | string[])[]\n /**\n * The amount of wei to send in hex.\n */\n value: string\n}\n\nfunction toHex(currencyAmount: CurrencyAmount) {\n return `0x${currencyAmount.quotient.toString(16)}`\n}\n\nconst ZERO_HEX = '0x0'\n\n/**\n * Represents the Uniswap V2 Router, and has static methods for helping execute trades.\n */\nexport abstract class Router {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: TradeOptions | TradeOptionsDeadline\n ): SwapParameters {\n const etherIn = trade.inputAmount.currency.isEther\n const etherOut = trade.outputAmount.currency.isEther\n // the router does not support both ether in and out\n invariant(!(etherIn && etherOut), 'ETHER_IN_OUT')\n invariant(!('ttl' in options) || options.ttl > 0, 'TTL')\n\n const to: string = validateAndParseAddress(options.recipient)\n const amountIn: string = toHex(trade.maximumAmountIn(options.allowedSlippage))\n const amountOut: string = toHex(trade.minimumAmountOut(options.allowedSlippage))\n const path: string[] = trade.route.path.map((token: Token) => token.address)\n const deadline =\n 'ttl' in options\n ? `0x${(Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16)}`\n : `0x${options.deadline.toString(16)}`\n\n const useFeeOnTransfer = Boolean(options.feeOnTransfer)\n\n let methodName: string\n let args: (string | string[])[]\n let value: string\n switch (trade.tradeType) {\n case TradeType.EXACT_INPUT:\n if (etherIn) {\n methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'\n // (uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = useFeeOnTransfer\n ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens'\n : 'swapExactTokensForTokens'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n }\n break\n case TradeType.EXACT_OUTPUT:\n invariant(!useFeeOnTransfer, 'EXACT_OUT_FOT')\n if (etherIn) {\n methodName = 'swapETHForExactTokens'\n // (uint amountOut, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = 'swapTokensForExactETH'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = 'swapTokensForExactTokens'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n }\n break\n }\n return {\n methodName,\n args,\n value\n }\n }\n}\n"],"names":["FACTORY_ADDRESS","INIT_CODE_HASH","MINIMUM_LIQUIDITY","JSBI","BigInt","ZERO","ONE","FIVE","_997","_1000","CAN_SET_PROTOTYPE","Object","InsufficientReservesError","name","constructor","setPrototypeOf","prototype","Error","InsufficientInputAmountError","computePairAddress","factoryAddress","tokenA","tokenB","sortsBefore","token0","token1","getCreate2Address","keccak256","pack","address","Pair","currencyAmountA","tokenAmountB","tokenAmounts","currency","liquidityToken","Token","chainId","getAddress","involvesToken","token","equals","priceOf","invariant","token0Price","token1Price","reserveOf","reserve0","reserve1","getOutputAmount","inputAmount","equal","quotient","inputReserve","outputReserve","inputAmountWithFee","multiply","numerator","denominator","add","outputAmount","CurrencyAmount","fromRawAmount","divide","subtract","getInputAmount","greaterThanOrEqual","getLiquidityMinted","totalSupply","tokenAmountA","liquidity","sqrt","amount0","amount1","lessThanOrEqual","greaterThan","getLiquidityValue","feeOn","kLast","totalSupplyAdjusted","kLastParsed","rootK","rootKLast","feeLiquidity","result","Price","Route","pairs","input","output","length","every","pair","wrappedInput","wrappedCurrency","path","entries","i","currentInput","push","_midPrice","prices","reduced","slice","reduce","accumulator","currentValue","ChainId","TradeType","inputOutputComparator","a","b","currencyEquals","equalTo","lessThan","tradeComparator","ioComp","priceImpact","route","Trade","amount","tradeType","Array","EXACT_INPUT","wrappedCurrencyAmount","fromFractionalAmount","executionPrice","computePriceImpact","midPrice","exactIn","amountIn","exactOut","amountOut","EXACT_OUTPUT","minimumAmountOut","slippageTolerance","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","bestTradeExactIn","currencyAmountIn","currencyOut","currentPairs","nextAmountIn","bestTrades","maxNumResults","maxHops","isToken","undefined","tokenOut","error","isInsufficientInputAmountError","sortedInsert","pairsExcludingThisPair","concat","worstExecutionPrice","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","toHex","currencyAmount","toString","ZERO_HEX","Router","swapCallParameters","trade","options","etherIn","isEther","etherOut","ttl","to","validateAndParseAddress","recipient","allowedSlippage","map","deadline","Math","floor","Date","getTime","useFeeOnTransfer","Boolean","feeOnTransfer","methodName","args","value"],"mappings":";;;;;;;;;;;;;;;IAEaA,eAAe,GAAG;IAElBC,cAAc,GAAG;IAEjBC,iBAAiB,gBAAGC,IAAI,CAACC,MAAL,CAAY,IAAZ;;AAG1B,IAAMC,IAAI,gBAAGF,IAAI,CAACC,MAAL,CAAY,CAAZ,CAAb;AACA,IAAME,GAAG,gBAAGH,IAAI,CAACC,MAAL,CAAY,CAAZ,CAAZ;AACA,IAAMG,IAAI,gBAAGJ,IAAI,CAACC,MAAL,CAAY,CAAZ,CAAb;AACA,IAAMI,IAAI,gBAAGL,IAAI,CAACC,MAAL,CAAY,GAAZ,CAAb;AACA,IAAMK,KAAK,gBAAGN,IAAI,CAACC,MAAL,CAAY,IAAZ,CAAd;;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A;;AACA,YAAIiI,OAAJ,EAAa;AACXiB,UAAAA,UAAU,GAAG,uBAAb,CADW;;AAGXC,UAAAA,IAAI,GAAG,CAAC1D,SAAD,EAAYrC,IAAZ,EAAkBiF,EAAlB,EAAsBK,QAAtB,CAAP;AACAU,UAAAA,KAAK,GAAG7D,QAAR;AACD,SALD,MAKO,IAAI4C,QAAJ,EAAc;AACnBe,UAAAA,UAAU,GAAG,uBAAb,CADmB;;AAGnBC,UAAAA,IAAI,GAAG,CAAC1D,SAAD,EAAYF,QAAZ,EAAsBnC,IAAtB,EAA4BiF,EAA5B,EAAgCK,QAAhC,CAAP;AACAU,UAAAA,KAAK,GAAGxB,QAAR;AACD,SALM,MAKA;AACLsB,UAAAA,UAAU,GAAG,0BAAb,CADK;;AAGLC,UAAAA,IAAI,GAAG,CAAC1D,SAAD,EAAYF,QAAZ,EAAsBnC,IAAtB,EAA4BiF,EAA5B,EAAgCK,QAAhC,CAAP;AACAU,UAAAA,KAAK,GAAGxB,QAAR;AACD;;AACD;AAvCJ;;AAyCA,WAAO;AACLsB,MAAAA,UAAU,EAAVA,UADK;AAELC,MAAAA,IAAI,EAAJA,IAFK;AAGLC,MAAAA,KAAK,EAALA;AAHK,KAAP;AAKD,GAhFH;;AAAA;AAAA;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js deleted file mode 100644 index 2412c860d5b..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("jsbi")),r=require("@uniswap/sdk-core"),n=t(require("tiny-invariant")),o=require("@ethersproject/solidity"),i=require("@ethersproject/address"),u=t(require("decimal.js-light")),a=t(require("big.js")),s=t(require("toformat")),c="0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",p=e.BigInt(1e3),l=e.BigInt(0),d=e.BigInt(1),m=e.BigInt(5),h=e.BigInt(997),f=e.BigInt(1e3);function y(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)}var b,P,x,_="setPrototypeOf"in Object,N=function(t){function e(){var r;return(r=t.call(this)||this).isInsufficientReservesError=!0,r.name=r.constructor.name,_&&Object.setPrototypeOf(E(r),(this instanceof e?this.constructor:void 0).prototype),r}return T(e,t),e}(w(Error)),R=function(t){function e(){var r;return(r=t.call(this)||this).isInsufficientInputAmountError=!0,r.name=r.constructor.name,_&&Object.setPrototypeOf(E(r),(this instanceof e?this.constructor:void 0).prototype),r}return T(e,t),e}(w(Error)),C=function(t){var e=t.factoryAddress,r=t.tokenA,n=t.tokenB,u=r.sortsBefore(n)?[r,n]:[n,r];return i.getCreate2Address(e,o.keccak256(["bytes"],[o.pack(["address","address"],[u[0].address,u[1].address])]),c)},U=function(){function t(e,n){var o=e.currency.sortsBefore(n.currency)?[e,n]:[n,e];this.liquidityToken=new r.Token(o[0].currency.chainId,t.getAddress(o[0].currency,o[1].currency),18,"UNI-V2","Uniswap V2"),this.tokenAmounts=o}t.getAddress=function(t,e){return C({factoryAddress:"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",tokenA:t,tokenB:e})};var o=t.prototype;return o.involvesToken=function(t){return t.equals(this.token0)||t.equals(this.token1)},o.priceOf=function(t){return this.involvesToken(t)||n(!1),t.equals(this.token0)?this.token0Price:this.token1Price},o.reserveOf=function(t){return this.involvesToken(t)||n(!1),t.equals(this.token0)?this.reserve0:this.reserve1},o.getOutputAmount=function(o){if(this.involvesToken(o.currency)||n(!1),e.equal(this.reserve0.quotient,l)||e.equal(this.reserve1.quotient,l))throw new N;var i=this.reserveOf(o.currency),u=this.reserveOf(o.currency.equals(this.token0)?this.token1:this.token0),a=e.multiply(o.quotient,h),s=e.multiply(a,u.quotient),c=e.add(e.multiply(i.quotient,f),a),p=r.CurrencyAmount.fromRawAmount(o.currency.equals(this.token0)?this.token1:this.token0,e.divide(s,c));if(e.equal(p.quotient,l))throw new R;return[p,new t(i.add(o),u.subtract(p))]},o.getInputAmount=function(o){if(this.involvesToken(o.currency)||n(!1),e.equal(this.reserve0.quotient,l)||e.equal(this.reserve1.quotient,l)||e.greaterThanOrEqual(o.quotient,this.reserveOf(o.currency).quotient))throw new N;var i=this.reserveOf(o.currency),u=this.reserveOf(o.currency.equals(this.token0)?this.token1:this.token0),a=e.multiply(e.multiply(u.quotient,o.quotient),f),s=e.multiply(e.subtract(i.quotient,o.quotient),h),c=r.CurrencyAmount.fromRawAmount(o.currency.equals(this.token0)?this.token1:this.token0,e.add(e.divide(a,s),d));return[c,new t(u.add(c),i.subtract(o))]},o.getLiquidityMinted=function(t,o,i){t.currency.equals(this.liquidityToken)||n(!1);var u,a=o.currency.sortsBefore(i.currency)?[o,i]:[i,o];if(a[0].currency.equals(this.token0)&&a[1].currency.equals(this.token1)||n(!1),e.equal(t.quotient,l))u=e.subtract(r.sqrt(e.multiply(a[0].quotient,a[1].quotient)),p);else{var s=e.divide(e.multiply(a[0].quotient,t.quotient),this.reserve0.quotient),c=e.divide(e.multiply(a[1].quotient,t.quotient),this.reserve1.quotient);u=e.lessThanOrEqual(s,c)?s:c}if(!e.greaterThan(u,l))throw new R;return r.CurrencyAmount.fromRawAmount(this.liquidityToken,u)},o.getLiquidityValue=function(t,o,i,u,a){var s;if(void 0===u&&(u=!1),this.involvesToken(t)||n(!1),o.currency.equals(this.liquidityToken)||n(!1),i.currency.equals(this.liquidityToken)||n(!1),e.lessThanOrEqual(i.quotient,o.quotient)||n(!1),u){a||n(!1);var c=e.BigInt(a);if(e.equal(c,l))s=o;else{var p=r.sqrt(e.multiply(this.reserve0.quotient,this.reserve1.quotient)),d=r.sqrt(c);if(e.greaterThan(p,d)){var h=e.multiply(o.quotient,e.subtract(p,d)),f=e.add(e.multiply(p,m),d),y=e.divide(h,f);s=o.add(r.CurrencyAmount.fromRawAmount(this.liquidityToken,y))}else s=o}}else s=o;return r.CurrencyAmount.fromRawAmount(t,e.divide(e.multiply(i.quotient,this.reserveOf(t).quotient),s.quotient))},v(t,[{key:"token0Price",get:function(){var t=this.tokenAmounts[1].divide(this.tokenAmounts[0]);return new r.Price(this.token0,this.token1,t.denominator,t.numerator)}},{key:"token1Price",get:function(){var t=this.tokenAmounts[0].divide(this.tokenAmounts[1]);return new r.Price(this.token1,this.token0,t.denominator,t.numerator)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"token0",get:function(){return this.tokenAmounts[0].currency}},{key:"token1",get:function(){return this.tokenAmounts[1].currency}},{key:"reserve0",get:function(){return this.tokenAmounts[0]}},{key:"reserve1",get:function(){return this.tokenAmounts[1]}}]),t}(),F=function(){function t(t,e,o){this._midPrice=null,t.length>0||n(!1);var i=t[0].chainId;t.every((function(t){return t.chainId===i}))||n(!1);var u=r.wrappedCurrency(e,i);t[0].involvesToken(u)||n(!1),void 0===o||t[t.length-1].involvesToken(r.wrappedCurrency(o,i))||n(!1);for(var a,s=[u],c=O(t.entries());!(a=c()).done;){var p=a.value,l=p[1],d=s[p[0]];d.equals(l.token0)||d.equals(l.token1)||n(!1);var m=d.equals(l.token0)?l.token1:l.token0;s.push(m)}this.pairs=t,this.path=s,this.input=e,this.output=o}return v(t,[{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;for(var t,e=[],n=O(this.pairs.entries());!(t=n()).done;){var o=t.value,i=o[1];e.push(this.path[o[0]].equals(i.token0)?new r.Price(i.reserve0.currency,i.reserve1.currency,i.reserve0.quotient,i.reserve1.quotient):new r.Price(i.reserve1.currency,i.reserve0.currency,i.reserve1.quotient,i.reserve0.quotient))}var u=e.slice(1).reduce((function(t,e){return t.multiply(e)}),e[0]);return this._midPrice=new r.Price(this.input,this.output,u.denominator,u.numerator)}},{key:"chainId",get:function(){return this.pairs[0].chainId}}]),t}();function D(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}!function(t){t[t.MAINNET=1]="MAINNET",t[t.ROPSTEN=3]="ROPSTEN",t[t.RINKEBY=4]="RINKEBY",t[t["GÖRLI"]=5]="GÖRLI",t[t.KOVAN=42]="KOVAN"}(b||(b={})),function(t){t[t.EXACT_INPUT=0]="EXACT_INPUT",t[t.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(P||(P={})),function(t){t[t.ROUND_DOWN=0]="ROUND_DOWN",t[t.ROUND_HALF_UP=1]="ROUND_HALF_UP",t[t.ROUND_UP=2]="ROUND_UP"}(x||(x={}));var S,B,H=function(t,e,r){t>=0&&t<255&&Number.isInteger(t)||n(!1),this.decimals=t,this.symbol=e,this.name=r},j=s(u),L=s(a),W=((S={})[x.ROUND_DOWN]=j.ROUND_DOWN,S[x.ROUND_HALF_UP]=j.ROUND_HALF_UP,S[x.ROUND_UP]=j.ROUND_UP,S),M=((B={})[x.ROUND_DOWN]=0,B[x.ROUND_HALF_UP]=1,B[x.ROUND_UP]=3,B),X=function(){function t(t,r){void 0===r&&(r=e.BigInt(1)),this.numerator=e.BigInt(t),this.denominator=e.BigInt(r)}t.tryParseFraction=function(r){if(r instanceof e||"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,o=t.prototype;return o.invert=function(){return new t(this.denominator,this.numerator)},o.add=function(r){var n=t.tryParseFraction(r);return e.equal(this.denominator,n.denominator)?new t(e.add(this.numerator,n.numerator),this.denominator):new t(e.add(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator)),e.multiply(this.denominator,n.denominator))},o.subtract=function(r){var n=t.tryParseFraction(r);return e.equal(this.denominator,n.denominator)?new t(e.subtract(this.numerator,n.numerator),this.denominator):new t(e.subtract(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator)),e.multiply(this.denominator,n.denominator))},o.lessThan=function(r){var n=t.tryParseFraction(r);return e.lessThan(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator))},o.equalTo=function(r){var n=t.tryParseFraction(r);return e.equal(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator))},o.greaterThan=function(r){var n=t.tryParseFraction(r);return e.greaterThan(e.multiply(this.numerator,n.denominator),e.multiply(n.numerator,this.denominator))},o.multiply=function(r){var n=t.tryParseFraction(r);return new t(e.multiply(this.numerator,n.numerator),e.multiply(this.denominator,n.denominator))},o.divide=function(r){var n=t.tryParseFraction(r);return new t(e.multiply(this.numerator,n.denominator),e.multiply(this.denominator,n.numerator))},o.toSignificant=function(t,e,r){void 0===e&&(e={groupSeparator:""}),void 0===r&&(r=x.ROUND_HALF_UP),Number.isInteger(t)||n(!1),t>0||n(!1),j.set({precision:t+1,rounding:W[r]});var o=new j(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return o.toFormat(o.decimalPlaces(),e)},o.toFixed=function(t,e,r){return void 0===e&&(e={groupSeparator:""}),void 0===r&&(r=x.ROUND_HALF_UP),Number.isInteger(t)||n(!1),t>=0||n(!1),L.DP=t,L.RM=M[r],new L(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,e)},(r=[{key:"quotient",get:function(){return e.divide(this.numerator,this.denominator)}},{key:"remainder",get:function(){return new t(e.remainder(this.numerator,this.denominator),this.denominator)}},{key:"asFraction",get:function(){return new t(this.numerator,this.denominator)}}])&&function(t,e){for(var r=0;r0;l--){var d=t.pairs[l-1].getInputAmount(s[l]);s[l-1]=d[0]}this.inputAmount=r.CurrencyAmount.fromFractionalAmount(t.input,s[0].numerator,s[0].denominator),this.outputAmount=r.CurrencyAmount.fromFractionalAmount(t.output,e.numerator,e.denominator)}this.executionPrice=new r.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient),this.priceImpact=(i=this.outputAmount,a=(u=t.midPrice.quote(this.inputAmount)).subtract(i).divide(u),new G(a.numerator,a.denominator))}t.exactIn=function(e,n){return new t(e,n,r.TradeType.EXACT_INPUT)},t.exactOut=function(e,n){return new t(e,n,r.TradeType.EXACT_OUTPUT)};var e=t.prototype;return e.minimumAmountOut=function(t){if(t.lessThan(l)&&n(!1),this.tradeType===r.TradeType.EXACT_OUTPUT)return this.outputAmount;var e=new r.Fraction(d).add(t).invert().multiply(this.outputAmount.quotient).quotient;return r.CurrencyAmount.fromRawAmount(this.outputAmount.currency,e)},e.maximumAmountIn=function(t){if(t.lessThan(l)&&n(!1),this.tradeType===r.TradeType.EXACT_INPUT)return this.inputAmount;var e=new r.Fraction(d).add(t).multiply(this.inputAmount.quotient).quotient;return r.CurrencyAmount.fromRawAmount(this.inputAmount.currency,e)},t.bestTradeExactIn=function(e,o,i,u,a,s,c){var p=void 0===u?{}:u,d=p.maxNumResults,m=void 0===d?3:d,h=p.maxHops,f=void 0===h?3:h;void 0===a&&(a=[]),void 0===s&&(s=o),void 0===c&&(c=[]),e.length>0||n(!1),f>0||n(!1),o===s||a.length>0||n(!1);var y=s.currency.isToken?s.currency.chainId:i.isToken?i.chainId:void 0;void 0===y&&n(!1);for(var v=r.wrappedCurrencyAmount(s,y),T=r.wrappedCurrency(i,y),A=0;A1&&e.length>1){var k=e.slice(0,A).concat(e.slice(A+1,e.length));t.bestTradeExactIn(k,o,i,{maxNumResults:m,maxHops:f-1},[].concat(a,[q]),g,c)}}}return c},e.worstExecutionPrice=function(t){return new r.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(t).quotient,this.minimumAmountOut(t).quotient)},t.bestTradeExactOut=function(e,o,i,u,a,s,c){var p=void 0===u?{}:u,d=p.maxNumResults,m=void 0===d?3:d,h=p.maxHops,f=void 0===h?3:h;void 0===a&&(a=[]),void 0===s&&(s=i),void 0===c&&(c=[]),e.length>0||n(!1),f>0||n(!1),i===s||a.length>0||n(!1);var y=s.currency.isToken?s.currency.chainId:o.isToken?o.chainId:void 0;void 0===y&&n(!1);for(var v=r.wrappedCurrencyAmount(s,y),T=r.wrappedCurrency(o,y),A=0;A1&&e.length>1){var k=e.slice(0,A).concat(e.slice(A+1,e.length));t.bestTradeExactOut(k,o,i,{maxNumResults:m,maxHops:f-1},[q].concat(a),g,c)}}}return c},t}();function tt(t){return"0x"+t.quotient.toString(16)}var et=function(){function t(){}return t.swapCallParameters=function(t,e){var o=t.inputAmount.currency.isEther,i=t.outputAmount.currency.isEther;o&&i&&n(!1),!("ttl"in e)||e.ttl>0||n(!1);var u,a,s,c=r.validateAndParseAddress(e.recipient),p=tt(t.maximumAmountIn(e.allowedSlippage)),l=tt(t.minimumAmountOut(e.allowedSlippage)),d=t.route.path.map((function(t){return t.address})),m="ttl"in e?"0x"+(Math.floor((new Date).getTime()/1e3)+e.ttl).toString(16):"0x"+e.deadline.toString(16),h=Boolean(e.feeOnTransfer);switch(t.tradeType){case r.TradeType.EXACT_INPUT:o?(u=h?"swapExactETHForTokensSupportingFeeOnTransferTokens":"swapExactETHForTokens",a=[l,d,c,m],s=p):i?(u=h?"swapExactTokensForETHSupportingFeeOnTransferTokens":"swapExactTokensForETH",a=[p,l,d,c,m],s="0x0"):(u=h?"swapExactTokensForTokensSupportingFeeOnTransferTokens":"swapExactTokensForTokens",a=[p,l,d,c,m],s="0x0");break;case r.TradeType.EXACT_OUTPUT:h&&n(!1),o?(u="swapETHForExactTokens",a=[l,d,c,m],s=p):i?(u="swapTokensForExactETH",a=[l,p,d,c,m],s="0x0"):(u="swapTokensForExactTokens",a=[l,p,d,c,m],s="0x0")}return{methodName:u,args:a,value:s}},t}();exports.FACTORY_ADDRESS="0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",exports.INIT_CODE_HASH=c,exports.InsufficientInputAmountError=R,exports.InsufficientReservesError=N,exports.MINIMUM_LIQUIDITY=p,exports.Pair=U,exports.Route=F,exports.Router=et,exports.Trade=Z,exports.computePairAddress=C,exports.inputOutputComparator=z,exports.tradeComparator=J; -//# sourceMappingURL=v2-sdk.cjs.production.min.js.map diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js.map b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js.map deleted file mode 100644 index 8746e686ea7..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.cjs.production.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"v2-sdk.cjs.production.min.js","sources":["../src/constants.ts","../src/errors.ts","../src/entities/pair.ts","../src/entities/route.ts","../../../sdk-core/src/constants.ts","../src/entities/trade.ts","../src/router.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\nexport const FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'\n\nexport const INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'\n\nexport const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)\n\n// exports for internal consumption\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\nexport const FIVE = JSBI.BigInt(5)\nexport const _997 = JSBI.BigInt(997)\nexport const _1000 = JSBI.BigInt(1000)\n","// see https://stackoverflow.com/a/41102306\nconst CAN_SET_PROTOTYPE = 'setPrototypeOf' in Object\n\n/**\n * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be\n * obtained by sending any amount of input.\n */\nexport class InsufficientReservesError extends Error {\n public readonly isInsufficientReservesError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\n/**\n * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less\n * than the price of a single unit of output after fees.\n */\nexport class InsufficientInputAmountError extends Error {\n public readonly isInsufficientInputAmountError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n","import { BigintIsh, ChainId, Price, sqrt, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { pack, keccak256 } from '@ethersproject/solidity'\nimport { getCreate2Address } from '@ethersproject/address'\n\nimport { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY, FIVE, _997, _1000, ONE, ZERO } from '../constants'\nimport { InsufficientReservesError, InsufficientInputAmountError } from '../errors'\n\nexport const computePairAddress = ({\n factoryAddress,\n tokenA,\n tokenB\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n}): string => {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]),\n INIT_CODE_HASH\n )\n}\nexport class Pair {\n public readonly liquidityToken: Token\n private readonly tokenAmounts: [CurrencyAmount, CurrencyAmount]\n\n public static getAddress(tokenA: Token, tokenB: Token): string {\n return computePairAddress({ factoryAddress: FACTORY_ADDRESS, tokenA, tokenB })\n }\n\n public constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount) {\n const tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [currencyAmountA, tokenAmountB]\n : [tokenAmountB, currencyAmountA]\n this.liquidityToken = new Token(\n tokenAmounts[0].currency.chainId,\n Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency),\n 18,\n 'UNI-V2',\n 'Uniswap V2'\n )\n this.tokenAmounts = tokenAmounts as [CurrencyAmount, CurrencyAmount]\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0\n */\n public get token0Price(): Price {\n const result = this.tokenAmounts[1].divide(this.tokenAmounts[0])\n return new Price(this.token0, this.token1, result.denominator, result.numerator)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1\n */\n public get token1Price(): Price {\n const result = this.tokenAmounts[0].divide(this.tokenAmounts[1])\n return new Price(this.token1, this.token0, result.denominator, result.numerator)\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pair.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pair.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n public get token0(): Token {\n return this.tokenAmounts[0].currency\n }\n\n public get token1(): Token {\n return this.tokenAmounts[1].currency\n }\n\n public get reserve0(): CurrencyAmount {\n return this.tokenAmounts[0]\n }\n\n public get reserve1(): CurrencyAmount {\n return this.tokenAmounts[1]\n }\n\n public reserveOf(token: Token): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.reserve0 : this.reserve1\n }\n\n public getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) {\n throw new InsufficientReservesError()\n }\n const inputReserve = this.reserveOf(inputAmount.currency)\n const outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997)\n const numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient)\n const denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee)\n const outputAmount = CurrencyAmount.fromRawAmount(\n inputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.divide(numerator, denominator)\n )\n if (JSBI.equal(outputAmount.quotient, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(outputAmount.currency), 'TOKEN')\n if (\n JSBI.equal(this.reserve0.quotient, ZERO) ||\n JSBI.equal(this.reserve1.quotient, ZERO) ||\n JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)\n ) {\n throw new InsufficientReservesError()\n }\n\n const outputReserve = this.reserveOf(outputAmount.currency)\n const inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000)\n const denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997)\n const inputAmount = CurrencyAmount.fromRawAmount(\n outputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.add(JSBI.divide(numerator, denominator), ONE)\n )\n return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getLiquidityMinted(\n totalSupply: CurrencyAmount,\n tokenAmountA: CurrencyAmount,\n tokenAmountB: CurrencyAmount\n ): CurrencyAmount {\n invariant(totalSupply.currency.equals(this.liquidityToken), 'LIQUIDITY')\n const tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [tokenAmountA, tokenAmountB]\n : [tokenAmountB, tokenAmountA]\n invariant(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1), 'TOKEN')\n\n let liquidity: JSBI\n if (JSBI.equal(totalSupply.quotient, ZERO)) {\n liquidity = JSBI.subtract(\n sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)),\n MINIMUM_LIQUIDITY\n )\n } else {\n const amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient)\n const amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient)\n liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1\n }\n if (!JSBI.greaterThan(liquidity, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity)\n }\n\n public getLiquidityValue(\n token: Token,\n totalSupply: CurrencyAmount,\n liquidity: CurrencyAmount,\n feeOn: boolean = false,\n kLast?: BigintIsh\n ): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n invariant(totalSupply.currency.equals(this.liquidityToken), 'TOTAL_SUPPLY')\n invariant(liquidity.currency.equals(this.liquidityToken), 'LIQUIDITY')\n invariant(JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient), 'LIQUIDITY')\n\n let totalSupplyAdjusted: CurrencyAmount\n if (!feeOn) {\n totalSupplyAdjusted = totalSupply\n } else {\n invariant(!!kLast, 'K_LAST')\n const kLastParsed = JSBI.BigInt(kLast)\n if (!JSBI.equal(kLastParsed, ZERO)) {\n const rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient))\n const rootKLast = sqrt(kLastParsed)\n if (JSBI.greaterThan(rootK, rootKLast)) {\n const numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast))\n const denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast)\n const feeLiquidity = JSBI.divide(numerator, denominator)\n totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity))\n } else {\n totalSupplyAdjusted = totalSupply\n }\n } else {\n totalSupplyAdjusted = totalSupply\n }\n }\n\n return CurrencyAmount.fromRawAmount(\n token,\n JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)\n )\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\n\nimport { Pair } from './pair'\n\nexport class Route {\n public readonly pairs: Pair[]\n public readonly path: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n public constructor(pairs: Pair[], input: TInput, output: TOutput) {\n invariant(pairs.length > 0, 'PAIRS')\n const chainId: ChainId | number = pairs[0].chainId\n invariant(\n pairs.every(pair => pair.chainId === chainId),\n 'CHAIN_IDS'\n )\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pairs[0].involvesToken(wrappedInput), 'INPUT')\n invariant(\n typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(wrappedCurrency(output, chainId)),\n 'OUTPUT'\n )\n\n const path: Token[] = [wrappedInput]\n for (const [i, pair] of pairs.entries()) {\n const currentInput = path[i]\n invariant(currentInput.equals(pair.token0) || currentInput.equals(pair.token1), 'PATH')\n const output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0\n path.push(output)\n }\n\n this.pairs = pairs\n this.path = path\n this.input = input\n this.output = output\n }\n\n private _midPrice: Price | null = null\n\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n const prices: Price[] = []\n for (const [i, pair] of this.pairs.entries()) {\n prices.push(\n this.path[i].equals(pair.token0)\n ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient)\n : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)\n )\n }\n const reduced = prices.slice(1).reduce((accumulator, currentValue) => accumulator.multiply(currentValue), prices[0])\n return (this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator))\n }\n\n public get chainId(): ChainId | number {\n return this.pairs[0].chainId\n }\n}\n","import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import {\n ChainId,\n Currency,\n CurrencyAmount,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n wrappedCurrency,\n TradeType,\n wrappedCurrencyAmount\n} from '@uniswap/sdk-core'\nimport { computePriceImpact, Token } from '../../../../sdk-core'\nimport { ONE, ZERO } from '../constants'\nimport invariant from 'tiny-invariant'\n\nimport { Pair } from './pair'\nimport { Route } from './route'\n\n// minimal interface so the input output comparator may be shared across types\ninterface InputOutput {\n readonly inputAmount: CurrencyAmount\n readonly outputAmount: CurrencyAmount\n}\n\n// comparator function that allows sorting trades by their output amounts, in decreasing order, and then input amounts\n// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first\nexport function inputOutputComparator(\n a: InputOutput,\n b: InputOutput\n): number {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n return 0\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n const ioComp = inputOutputComparator(a, b)\n if (ioComp !== 0) {\n return ioComp\n }\n\n // consider lowest slippage next, since these are less likely to fail\n if (a.priceImpact.lessThan(b.priceImpact)) {\n return -1\n } else if (a.priceImpact.greaterThan(b.priceImpact)) {\n return 1\n }\n\n // finally consider the number of hops since each hop costs gas\n return a.route.path.length - b.route.path.length\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pairs.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public readonly executionPrice: Price\n /**\n * The percent difference between the mid price before the trade and the trade execution price.\n */\n public readonly priceImpact: Percent\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Trade {\n return new Trade(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Trade {\n return new Trade(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n public constructor(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ) {\n this.route = route\n this.tradeType = tradeType\n\n const tokenAmounts: CurrencyAmount[] = new Array(route.path.length)\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n tokenAmounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.path.length - 1; i++) {\n const pair = route.pairs[i]\n const [outputAmount] = pair.getOutputAmount(tokenAmounts[i])\n tokenAmounts[i + 1] = outputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n this.outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n tokenAmounts[tokenAmounts.length - 1].numerator,\n tokenAmounts[tokenAmounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n tokenAmounts[tokenAmounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.path.length - 1; i > 0; i--) {\n const pair = route.pairs[i - 1]\n const [inputAmount] = pair.getInputAmount(tokenAmounts[i])\n tokenAmounts[i - 1] = inputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(\n route.input,\n tokenAmounts[0].numerator,\n tokenAmounts[0].denominator\n )\n this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n this.executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n )\n this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount)\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactIn(\n pairs: Pair[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountIn.currency) && !currencyEquals(pair.token1, amountIn.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = pair.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (currencyEquals(amountOut.currency, tokenOut)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([...currentPairs, pair], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n Trade.bestTradeExactIn(\n pairsExcludingThisPair,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPairs, pair],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactOut(\n pairs: Pair[],\n currencyIn: TInput,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? (currencyIn as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountOut.currency) && !currencyEquals(pair.token1, amountOut.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = pair.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pair\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([pair, ...currentPairs], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n Trade.bestTradeExactOut(\n pairsExcludingThisPair,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pair, ...currentPairs],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { Currency, CurrencyAmount, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport { Trade } from 'entities'\nimport invariant from 'tiny-invariant'\nimport { Token } from '../../../sdk-core'\n\n/**\n * Options for producing the arguments to send call to the router.\n */\nexport interface TradeOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n allowedSlippage: Percent\n /**\n * How long the swap is valid until it expires, in seconds.\n * This will be used to produce a `deadline` parameter which is computed from when the swap call parameters\n * are generated.\n */\n ttl: number\n /**\n * The account that should receive the output of the swap.\n */\n recipient: string\n\n /**\n * Whether any of the tokens in the path are fee on transfer tokens, which should be handled with special methods\n */\n feeOnTransfer?: boolean\n}\n\nexport interface TradeOptionsDeadline extends Omit {\n /**\n * When the transaction expires.\n * This is an atlernate to specifying the ttl, for when you do not want to use local time.\n */\n deadline: number\n}\n\n/**\n * The parameters to use in the call to the Uniswap V2 Router to execute a trade.\n */\nexport interface SwapParameters {\n /**\n * The method to call on the Uniswap V2 Router.\n */\n methodName: string\n /**\n * The arguments to pass to the method, all hex encoded.\n */\n args: (string | string[])[]\n /**\n * The amount of wei to send in hex.\n */\n value: string\n}\n\nfunction toHex(currencyAmount: CurrencyAmount) {\n return `0x${currencyAmount.quotient.toString(16)}`\n}\n\nconst ZERO_HEX = '0x0'\n\n/**\n * Represents the Uniswap V2 Router, and has static methods for helping execute trades.\n */\nexport abstract class Router {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: TradeOptions | TradeOptionsDeadline\n ): SwapParameters {\n const etherIn = trade.inputAmount.currency.isEther\n const etherOut = trade.outputAmount.currency.isEther\n // the router does not support both ether in and out\n invariant(!(etherIn && etherOut), 'ETHER_IN_OUT')\n invariant(!('ttl' in options) || options.ttl > 0, 'TTL')\n\n const to: string = validateAndParseAddress(options.recipient)\n const amountIn: string = toHex(trade.maximumAmountIn(options.allowedSlippage))\n const amountOut: string = toHex(trade.minimumAmountOut(options.allowedSlippage))\n const path: string[] = trade.route.path.map((token: Token) => token.address)\n const deadline =\n 'ttl' in options\n ? `0x${(Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16)}`\n : `0x${options.deadline.toString(16)}`\n\n const useFeeOnTransfer = Boolean(options.feeOnTransfer)\n\n let methodName: string\n let args: (string | string[])[]\n let value: string\n switch (trade.tradeType) {\n case TradeType.EXACT_INPUT:\n if (etherIn) {\n methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'\n // (uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = useFeeOnTransfer\n ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens'\n : 'swapExactTokensForTokens'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n }\n break\n case TradeType.EXACT_OUTPUT:\n invariant(!useFeeOnTransfer, 'EXACT_OUT_FOT')\n if (etherIn) {\n methodName = 'swapETHForExactTokens'\n // (uint amountOut, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = 'swapTokensForExactETH'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = 'swapTokensForExactTokens'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n }\n break\n }\n return {\n methodName,\n args,\n value\n }\n }\n}\n"],"names":["INIT_CODE_HASH","MINIMUM_LIQUIDITY","JSBI","BigInt","ZERO","ONE","FIVE","_997","_1000","CAN_SET_PROTOTYPE","Object","InsufficientReservesError","name","_this","constructor","setPrototypeOf","prototype","Error","InsufficientInputAmountError","_this2","computePairAddress","factoryAddress","tokenA","tokenB","sortsBefore","getCreate2Address","keccak256","pack","address","Pair","currencyAmountA","tokenAmountB","tokenAmounts","currency","liquidityToken","Token","chainId","getAddress","involvesToken","token","equals","this","token0","token1","priceOf","invariant","token0Price","token1Price","reserveOf","reserve0","reserve1","getOutputAmount","inputAmount","equal","quotient","inputReserve","outputReserve","inputAmountWithFee","multiply","numerator","denominator","add","outputAmount","CurrencyAmount","fromRawAmount","divide","subtract","getInputAmount","greaterThanOrEqual","getLiquidityMinted","totalSupply","tokenAmountA","liquidity","sqrt","amount0","amount1","lessThanOrEqual","greaterThan","getLiquidityValue","feeOn","kLast","totalSupplyAdjusted","kLastParsed","rootK","rootKLast","feeLiquidity","result","Price","Route","pairs","input","output","length","every","pair","wrappedInput","wrappedCurrency","path","entries","currentInput","push","_midPrice","prices","reduced","slice","reduce","accumulator","currentValue","ChainId","TradeType","inputOutputComparator","a","b","currencyEquals","equalTo","lessThan","tradeComparator","ioComp","priceImpact","route","Trade","amount","tradeType","Array","EXACT_INPUT","wrappedCurrencyAmount","i","fromFractionalAmount","executionPrice","midPrice","exactIn","amountIn","exactOut","amountOut","EXACT_OUTPUT","minimumAmountOut","slippageTolerance","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","bestTradeExactIn","currencyAmountIn","currencyOut","currentPairs","nextAmountIn","bestTrades","maxNumResults","maxHops","isToken","undefined","tokenOut","error","isInsufficientInputAmountError","sortedInsert","pairsExcludingThisPair","concat","worstExecutionPrice","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","toHex","currencyAmount","toString","Router","swapCallParameters","trade","options","etherIn","isEther","etherOut","ttl","methodName","args","value","to","validateAndParseAddress","recipient","allowedSlippage","map","deadline","Math","floor","Date","getTime","useFeeOnTransfer","Boolean","feeOnTransfer"],"mappings":"2XAIaA,EAAiB,qEAEjBC,EAAoBC,EAAKC,OAAO,KAGhCC,EAAOF,EAAKC,OAAO,GACnBE,EAAMH,EAAKC,OAAO,GAClBG,EAAOJ,EAAKC,OAAO,GACnBI,EAAOL,EAAKC,OAAO,KACnBK,EAAQN,EAAKC,OAAO,q3ECZjC,UAAMM,EAAoB,mBAAoBC,OAMjCC,2FACyC,IAI7CC,KAAOC,EAAKC,YAAYF,KACzBH,GAAmBC,OAAOK,gEAAgCC,gCANnBC,QAclCC,8FAC4C,IAIhDN,KAAOO,EAAKL,YAAYF,KACzBH,GAAmBC,OAAOK,gEAAgCC,gCANhBC,QCZrCG,EAAqB,gBAChCC,IAAAA,eACAC,IAAAA,OACAC,IAAAA,SAMyBD,EAAOE,YAAYD,GAAU,CAACD,EAAQC,GAAU,CAACA,EAAQD,UAC3EG,oBACLJ,EACAK,YAAU,CAAC,SAAU,CAACC,OAAK,CAAC,UAAW,WAAY,MAAQC,aAAgBA,YAC3E5B,IAGS6B,wBAQQC,EAAwCC,OACnDC,EAAeF,EAAgBG,SAAST,YAAYO,EAAaE,UACnE,CAACH,EAAiBC,GAClB,CAACA,EAAcD,QACdI,eAAiB,IAAIC,QACxBH,EAAa,GAAGC,SAASG,QACzBP,EAAKQ,WAAWL,EAAa,GAAGC,SAAUD,EAAa,GAAGC,UAC1D,GACA,SACA,mBAEGD,aAAeA,IAfRK,WAAP,SAAkBf,EAAeC,UAC/BH,EAAm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DO,QAoDPF,EAAaa,EACT,wDACA,2BAEJZ,EAAO,CAAC9C,EAAUE,EAAWpC,EAAMkF,EAAIK,GACvCN,EAzDO,kBA4DNrE,YAAUyB,aACFuD,GAAXhJ,MACI+H,GACFI,EAAa,wBAEbC,EAAO,CAAC5C,EAAWpC,EAAMkF,EAAIK,GAC7BN,EAAQ/C,GACC2C,GACTE,EAAa,wBAEbC,EAAO,CAAC5C,EAAWF,EAAUlC,EAAMkF,EAAIK,GACvCN,EAvEO,QAyEPF,EAAa,2BAEbC,EAAO,CAAC5C,EAAWF,EAAUlC,EAAMkF,EAAIK,GACvCN,EA5EO,aAgFN,CACLF,WAAAA,EACAC,KAAAA,EACAC,MAAAA,iCN7IyB"} \ No newline at end of file diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js deleted file mode 100644 index 1a480fd1b8d..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js +++ /dev/null @@ -1,1243 +0,0 @@ -import JSBI from 'jsbi'; -import { CurrencyAmount, sqrt, Token as Token$1, Price, wrappedCurrency, currencyEquals, TradeType as TradeType$1, Fraction as Fraction$1, wrappedCurrencyAmount, sortedInsert, validateAndParseAddress as validateAndParseAddress$1 } from '@uniswap/sdk-core'; -import invariant from 'tiny-invariant'; -import { keccak256, pack } from '@ethersproject/solidity'; -import { getCreate2Address, getAddress } from '@ethersproject/address'; -import _Decimal from 'decimal.js-light'; -import _Big from 'big.js'; -import toFormat from 'toformat'; - -var FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'; -var INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'; -var MINIMUM_LIQUIDITY = /*#__PURE__*/JSBI.BigInt(1000); // exports for internal consumption - -var ZERO = /*#__PURE__*/JSBI.BigInt(0); -var ONE = /*#__PURE__*/JSBI.BigInt(1); -var FIVE = /*#__PURE__*/JSBI.BigInt(5); -var _997 = /*#__PURE__*/JSBI.BigInt(997); -var _1000 = /*#__PURE__*/JSBI.BigInt(1000); - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); -} - -function _isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } -} - -function _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} - -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -// see https://stackoverflow.com/a/41102306 -var CAN_SET_PROTOTYPE = ('setPrototypeOf' in Object); -/** - * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be - * obtained by sending any amount of input. - */ - -var InsufficientReservesError = /*#__PURE__*/function (_Error) { - _inheritsLoose(InsufficientReservesError, _Error); - - function InsufficientReservesError() { - var _this; - - _this = _Error.call(this) || this; - _this.isInsufficientReservesError = true; - _this.name = _this.constructor.name; - if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(_assertThisInitialized(_this), (this instanceof InsufficientReservesError ? this.constructor : void 0).prototype); - return _this; - } - - return InsufficientReservesError; -}( /*#__PURE__*/_wrapNativeSuper(Error)); -/** - * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less - * than the price of a single unit of output after fees. - */ - -var InsufficientInputAmountError = /*#__PURE__*/function (_Error2) { - _inheritsLoose(InsufficientInputAmountError, _Error2); - - function InsufficientInputAmountError() { - var _this2; - - _this2 = _Error2.call(this) || this; - _this2.isInsufficientInputAmountError = true; - _this2.name = _this2.constructor.name; - if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(_assertThisInitialized(_this2), (this instanceof InsufficientInputAmountError ? this.constructor : void 0).prototype); - return _this2; - } - - return InsufficientInputAmountError; -}( /*#__PURE__*/_wrapNativeSuper(Error)); - -var computePairAddress = function computePairAddress(_ref) { - var factoryAddress = _ref.factoryAddress, - tokenA = _ref.tokenA, - tokenB = _ref.tokenB; - - var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], - token0 = _ref2[0], - token1 = _ref2[1]; // does safety checks - - - return getCreate2Address(factoryAddress, keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]), INIT_CODE_HASH); -}; -var Pair = /*#__PURE__*/function () { - function Pair(currencyAmountA, tokenAmountB) { - var tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks - ? [currencyAmountA, tokenAmountB] : [tokenAmountB, currencyAmountA]; - this.liquidityToken = new Token$1(tokenAmounts[0].currency.chainId, Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency), 18, 'UNI-V2', 'Uniswap V2'); - this.tokenAmounts = tokenAmounts; - } - - Pair.getAddress = function getAddress(tokenA, tokenB) { - return computePairAddress({ - factoryAddress: FACTORY_ADDRESS, - tokenA: tokenA, - tokenB: tokenB - }); - } - /** - * Returns true if the token is either token0 or token1 - * @param token to check - */ - ; - - var _proto = Pair.prototype; - - _proto.involvesToken = function involvesToken(token) { - return token.equals(this.token0) || token.equals(this.token1); - } - /** - * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0 - */ - ; - - /** - * Return the price of the given token in terms of the other token in the pair. - * @param token token to return price of - */ - _proto.priceOf = function priceOf(token) { - !this.involvesToken(token) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - return token.equals(this.token0) ? this.token0Price : this.token1Price; - } - /** - * Returns the chain ID of the tokens in the pair. - */ - ; - - _proto.reserveOf = function reserveOf(token) { - !this.involvesToken(token) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - return token.equals(this.token0) ? this.reserve0 : this.reserve1; - }; - - _proto.getOutputAmount = function getOutputAmount(inputAmount) { - !this.involvesToken(inputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - - if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) { - throw new InsufficientReservesError(); - } - - var inputReserve = this.reserveOf(inputAmount.currency); - var outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0); - var inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997); - var numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient); - var denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee); - var outputAmount = CurrencyAmount.fromRawAmount(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0, JSBI.divide(numerator, denominator)); - - if (JSBI.equal(outputAmount.quotient, ZERO)) { - throw new InsufficientInputAmountError(); - } - - return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]; - }; - - _proto.getInputAmount = function getInputAmount(outputAmount) { - !this.involvesToken(outputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - - if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO) || JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)) { - throw new InsufficientReservesError(); - } - - var outputReserve = this.reserveOf(outputAmount.currency); - var inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0); - var numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000); - var denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997); - var inputAmount = CurrencyAmount.fromRawAmount(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0, JSBI.add(JSBI.divide(numerator, denominator), ONE)); - return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]; - }; - - _proto.getLiquidityMinted = function getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB) { - !totalSupply.currency.equals(this.liquidityToken) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LIQUIDITY') : invariant(false) : void 0; - var tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks - ? [tokenAmountA, tokenAmountB] : [tokenAmountB, tokenAmountA]; - !(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - var liquidity; - - if (JSBI.equal(totalSupply.quotient, ZERO)) { - liquidity = JSBI.subtract(sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)), MINIMUM_LIQUIDITY); - } else { - var amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient); - var amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient); - liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1; - } - - if (!JSBI.greaterThan(liquidity, ZERO)) { - throw new InsufficientInputAmountError(); - } - - return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity); - }; - - _proto.getLiquidityValue = function getLiquidityValue(token, totalSupply, liquidity, feeOn, kLast) { - if (feeOn === void 0) { - feeOn = false; - } - - !this.involvesToken(token) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - !totalSupply.currency.equals(this.liquidityToken) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOTAL_SUPPLY') : invariant(false) : void 0; - !liquidity.currency.equals(this.liquidityToken) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LIQUIDITY') : invariant(false) : void 0; - !JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LIQUIDITY') : invariant(false) : void 0; - var totalSupplyAdjusted; - - if (!feeOn) { - totalSupplyAdjusted = totalSupply; - } else { - !!!kLast ? process.env.NODE_ENV !== "production" ? invariant(false, 'K_LAST') : invariant(false) : void 0; - var kLastParsed = JSBI.BigInt(kLast); - - if (!JSBI.equal(kLastParsed, ZERO)) { - var rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient)); - var rootKLast = sqrt(kLastParsed); - - if (JSBI.greaterThan(rootK, rootKLast)) { - var numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast)); - var denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast); - var feeLiquidity = JSBI.divide(numerator, denominator); - totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity)); - } else { - totalSupplyAdjusted = totalSupply; - } - } else { - totalSupplyAdjusted = totalSupply; - } - } - - return CurrencyAmount.fromRawAmount(token, JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)); - }; - - _createClass(Pair, [{ - key: "token0Price", - get: function get() { - var result = this.tokenAmounts[1].divide(this.tokenAmounts[0]); - return new Price(this.token0, this.token1, result.denominator, result.numerator); - } - /** - * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1 - */ - - }, { - key: "token1Price", - get: function get() { - var result = this.tokenAmounts[0].divide(this.tokenAmounts[1]); - return new Price(this.token1, this.token0, result.denominator, result.numerator); - } - }, { - key: "chainId", - get: function get() { - return this.token0.chainId; - } - }, { - key: "token0", - get: function get() { - return this.tokenAmounts[0].currency; - } - }, { - key: "token1", - get: function get() { - return this.tokenAmounts[1].currency; - } - }, { - key: "reserve0", - get: function get() { - return this.tokenAmounts[0]; - } - }, { - key: "reserve1", - get: function get() { - return this.tokenAmounts[1]; - } - }]); - - return Pair; -}(); - -var Route = /*#__PURE__*/function () { - function Route(pairs, input, output) { - this._midPrice = null; - !(pairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PAIRS') : invariant(false) : void 0; - var chainId = pairs[0].chainId; - !pairs.every(function (pair) { - return pair.chainId === chainId; - }) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_IDS') : invariant(false) : void 0; - var wrappedInput = wrappedCurrency(input, chainId); - !pairs[0].involvesToken(wrappedInput) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT') : invariant(false) : void 0; - !(typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(wrappedCurrency(output, chainId))) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT') : invariant(false) : void 0; - var path = [wrappedInput]; - - for (var _iterator = _createForOfIteratorHelperLoose(pairs.entries()), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - i = _step$value[0], - pair = _step$value[1]; - var currentInput = path[i]; - !(currentInput.equals(pair.token0) || currentInput.equals(pair.token1)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PATH') : invariant(false) : void 0; - - var _output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0; - - path.push(_output); - } - - this.pairs = pairs; - this.path = path; - this.input = input; - this.output = output; - } - - _createClass(Route, [{ - key: "midPrice", - get: function get() { - if (this._midPrice !== null) return this._midPrice; - var prices = []; - - for (var _iterator2 = _createForOfIteratorHelperLoose(this.pairs.entries()), _step2; !(_step2 = _iterator2()).done;) { - var _step2$value = _step2.value, - i = _step2$value[0], - pair = _step2$value[1]; - prices.push(this.path[i].equals(pair.token0) ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient) : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)); - } - - var reduced = prices.slice(1).reduce(function (accumulator, currentValue) { - return accumulator.multiply(currentValue); - }, prices[0]); - return this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator); - } - }, { - key: "chainId", - get: function get() { - return this.pairs[0].chainId; - } - }]); - - return Route; -}(); - -var ChainId; - -(function (ChainId) { - ChainId[ChainId["MAINNET"] = 1] = "MAINNET"; - ChainId[ChainId["ROPSTEN"] = 3] = "ROPSTEN"; - ChainId[ChainId["RINKEBY"] = 4] = "RINKEBY"; - ChainId[ChainId["G\xD6RLI"] = 5] = "G\xD6RLI"; - ChainId[ChainId["KOVAN"] = 42] = "KOVAN"; -})(ChainId || (ChainId = {})); - -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 = {})); - -function _defineProperties$1(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass$1(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$1(Constructor, staticProps); - return Constructor; -} - -function _inheritsLoose$1(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} -/** - * A currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens. - * - * The only instance of the base class `Currency` is Ether. - */ - - -var BaseCurrency = -/** - * Constructs an instance of the base class `Currency`. The only instance of the base class `Currency` is `Currency.ETHER`. - * @param decimals decimals of the currency - * @param symbol symbol of the currency - * @param name of the currency - */ -function BaseCurrency(decimals, symbol, name) { - !(decimals >= 0 && decimals < 255 && Number.isInteger(decimals)) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, 'DECIMALS') : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - this.decimals = decimals; - this.symbol = symbol; - this.name = name; -}; - -var _toSignificantRoundin, _toFixedRounding; - -var Decimal = /*#__PURE__*/toFormat(_Decimal); -var Big = /*#__PURE__*/toFormat(_Big); -var toSignificantRounding = (_toSignificantRoundin = {}, _toSignificantRoundin[Rounding.ROUND_DOWN] = Decimal.ROUND_DOWN, _toSignificantRoundin[Rounding.ROUND_HALF_UP] = Decimal.ROUND_HALF_UP, _toSignificantRoundin[Rounding.ROUND_UP] = Decimal.ROUND_UP, _toSignificantRoundin); -var toFixedRounding = (_toFixedRounding = {}, _toFixedRounding[Rounding.ROUND_DOWN] = 0, _toFixedRounding[Rounding.ROUND_HALF_UP] = 1, _toFixedRounding[Rounding.ROUND_UP] = 3, _toFixedRounding); - -var Fraction = /*#__PURE__*/function () { - function Fraction(numerator, denominator) { - if (denominator === void 0) { - denominator = JSBI.BigInt(1); - } - - this.numerator = JSBI.BigInt(numerator); - this.denominator = JSBI.BigInt(denominator); - } - - Fraction.tryParseFraction = function tryParseFraction(fractionish) { - if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string') return new Fraction(fractionish); - if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish; - throw new Error('Could not parse fraction'); - } // performs floor division - ; - - var _proto = Fraction.prototype; - - _proto.invert = function invert() { - return new Fraction(this.denominator, this.numerator); - }; - - _proto.add = function add(other) { - var otherParsed = Fraction.tryParseFraction(other); - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.add(this.numerator, otherParsed.numerator), this.denominator); - } - - return new Fraction(JSBI.add(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.subtract = function subtract(other) { - var otherParsed = Fraction.tryParseFraction(other); - - if (JSBI.equal(this.denominator, otherParsed.denominator)) { - return new Fraction(JSBI.subtract(this.numerator, otherParsed.numerator), this.denominator); - } - - return new Fraction(JSBI.subtract(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.lessThan = function lessThan(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.lessThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.equalTo = function equalTo(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.equal(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.greaterThan = function greaterThan(other) { - var otherParsed = Fraction.tryParseFraction(other); - return JSBI.greaterThan(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(otherParsed.numerator, this.denominator)); - }; - - _proto.multiply = function multiply(other) { - var otherParsed = Fraction.tryParseFraction(other); - return new Fraction(JSBI.multiply(this.numerator, otherParsed.numerator), JSBI.multiply(this.denominator, otherParsed.denominator)); - }; - - _proto.divide = function divide(other) { - var otherParsed = Fraction.tryParseFraction(other); - return new Fraction(JSBI.multiply(this.numerator, otherParsed.denominator), JSBI.multiply(this.denominator, otherParsed.numerator)); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_HALF_UP; - } - - !Number.isInteger(significantDigits) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, significantDigits + " is not an integer.") : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - !(significantDigits > 0) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, significantDigits + " is not positive.") : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - Decimal.set({ - precision: significantDigits + 1, - rounding: toSignificantRounding[rounding] - }); - var quotient = new Decimal(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(significantDigits); - return quotient.toFormat(quotient.decimalPlaces(), format); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (format === void 0) { - format = { - groupSeparator: '' - }; - } - - if (rounding === void 0) { - rounding = Rounding.ROUND_HALF_UP; - } - - !Number.isInteger(decimalPlaces) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, decimalPlaces + " is not an integer.") : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - !(decimalPlaces >= 0) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, decimalPlaces + " is negative.") : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - Big.DP = decimalPlaces; - Big.RM = toFixedRounding[rounding]; - return new Big(this.numerator.toString()).div(this.denominator.toString()).toFormat(decimalPlaces, format); - } - /** - * Helper method for converting any super class back to a fraction - */ - ; - - _createClass$1(Fraction, [{ - key: "quotient", - get: function get() { - return JSBI.divide(this.numerator, this.denominator); - } // remainder after floor division - - }, { - key: "remainder", - get: function get() { - return new Fraction(JSBI.remainder(this.numerator, this.denominator), this.denominator); - } - }, { - key: "asFraction", - get: function get() { - return new Fraction(this.numerator, this.denominator); - } - }]); - - return Fraction; -}(); - -var ONE_HUNDRED = /*#__PURE__*/new Fraction( /*#__PURE__*/JSBI.BigInt(100)); -/** - * Converts a fraction to a percent - * @param fraction the fraction to convert - */ - -function toPercent(fraction) { - return new Percent(fraction.numerator, fraction.denominator); -} - -var Percent = /*#__PURE__*/function (_Fraction) { - _inheritsLoose$1(Percent, _Fraction); - - function Percent() { - var _this; - - _this = _Fraction.apply(this, arguments) || this; - /** - * This boolean prevents a fraction from being interpreted as a Percent - */ - - _this.isPercent = true; - return _this; - } - - var _proto = Percent.prototype; - - _proto.add = function add(other) { - return toPercent(_Fraction.prototype.add.call(this, other)); - }; - - _proto.subtract = function subtract(other) { - return toPercent(_Fraction.prototype.subtract.call(this, other)); - }; - - _proto.multiply = function multiply(other) { - return toPercent(_Fraction.prototype.multiply.call(this, other)); - }; - - _proto.divide = function divide(other) { - return toPercent(_Fraction.prototype.divide.call(this, other)); - }; - - _proto.toSignificant = function toSignificant(significantDigits, format, rounding) { - if (significantDigits === void 0) { - significantDigits = 5; - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toSignificant(significantDigits, format, rounding); - }; - - _proto.toFixed = function toFixed(decimalPlaces, format, rounding) { - if (decimalPlaces === void 0) { - decimalPlaces = 2; - } - - return _Fraction.prototype.multiply.call(this, ONE_HUNDRED).toFixed(decimalPlaces, format, rounding); - }; - - return Percent; -}(Fraction); -/** - * Validates an address and returns the parsed (checksummed) version of that address - * @param address the unchecksummed hex address - */ - - -function validateAndParseAddress(address) { - try { - return getAddress(address); - } catch (error) { - throw new Error(address + " is not a valid address."); - } -} - -var _WETH; -/** - * Represents an ERC20 token with a unique address and some metadata. - */ - - -var Token = /*#__PURE__*/function (_BaseCurrency) { - _inheritsLoose$1(Token, _BaseCurrency); - - function Token(chainId, address, decimals, symbol, name) { - var _this; - - _this = _BaseCurrency.call(this, decimals, symbol, name) || this; - _this.isEther = false; - _this.isToken = true; - _this.chainId = chainId; - _this.address = validateAndParseAddress(address); - return _this; - } - /** - * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. - * @param other other token to compare - */ - - - var _proto = Token.prototype; - - _proto.equals = function equals(other) { - // short circuit on reference equality - if (this === other) { - return true; - } - - return this.chainId === other.chainId && this.address === other.address; - } - /** - * Returns true if the address of this token sorts before the address of the other token - * @param other other token to compare - * @throws if the tokens have the same address - * @throws if the tokens are on different chains - */ - ; - - _proto.sortsBefore = function sortsBefore(other) { - !(this.chainId === other.chainId) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_IDS') : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - !(this.address !== other.address) ? process.env.NODE_ENV !== "production" ? process.env.NODE_ENV !== "production" ? invariant(false, 'ADDRESSES') : invariant(false) : process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - return this.address.toLowerCase() < other.address.toLowerCase(); - }; - - return Token; -}(BaseCurrency); - -var WETH9 = (_WETH = {}, _WETH[ChainId.MAINNET] = /*#__PURE__*/new Token(ChainId.MAINNET, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.ROPSTEN] = /*#__PURE__*/new Token(ChainId.ROPSTEN, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.RINKEBY] = /*#__PURE__*/new Token(ChainId.RINKEBY, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.GÖRLI] = /*#__PURE__*/new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH9', 'Wrapped Ether'), _WETH[ChainId.KOVAN] = /*#__PURE__*/new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH9', 'Wrapped Ether'), _WETH); -/** - * Returns the percent difference between the mid price and the execution price, i.e. price impact. - * @param midPrice mid price before the trade - * @param inputAmount the input amount of the trade - * @param outputAmount the output amount of the trade - */ - -function computePriceImpact(midPrice, inputAmount, outputAmount) { - var quotedOutputAmount = midPrice.quote(inputAmount); // calculate price impact := (exactQuote - outputAmount) / exactQuote - - var priceImpact = quotedOutputAmount.subtract(outputAmount).divide(quotedOutputAmount); - return new Percent(priceImpact.numerator, priceImpact.denominator); -} // `maxSize` by removing the last item - -// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first - -function inputOutputComparator(a, b) { - // must have same input and output token for comparison - !currencyEquals(a.inputAmount.currency, b.inputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT_CURRENCY') : invariant(false) : void 0; - !currencyEquals(a.outputAmount.currency, b.outputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT_CURRENCY') : invariant(false) : void 0; - - if (a.outputAmount.equalTo(b.outputAmount)) { - if (a.inputAmount.equalTo(b.inputAmount)) { - return 0; - } // trade A requires less input than trade B, so A should come first - - - if (a.inputAmount.lessThan(b.inputAmount)) { - return -1; - } else { - return 1; - } - } else { - // tradeA has less output than trade B, so should come second - if (a.outputAmount.lessThan(b.outputAmount)) { - return 1; - } else { - return -1; - } - } -} // extension of the input output comparator that also considers other dimensions of the trade in ranking them - -function tradeComparator(a, b) { - var ioComp = inputOutputComparator(a, b); - - if (ioComp !== 0) { - return ioComp; - } // consider lowest slippage next, since these are less likely to fail - - - if (a.priceImpact.lessThan(b.priceImpact)) { - return -1; - } else if (a.priceImpact.greaterThan(b.priceImpact)) { - return 1; - } // finally consider the number of hops since each hop costs gas - - - return a.route.path.length - b.route.path.length; -} -/** - * Represents a trade executed against a list of pairs. - * Does not account for slippage, i.e. trades that front run this trade and move the price. - */ - -var Trade = /*#__PURE__*/function () { - function Trade(route, amount, tradeType) { - this.route = route; - this.tradeType = tradeType; - var tokenAmounts = new Array(route.path.length); - - if (tradeType === TradeType$1.EXACT_INPUT) { - !currencyEquals(amount.currency, route.input) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT') : invariant(false) : void 0; - tokenAmounts[0] = wrappedCurrencyAmount(amount, route.chainId); - - for (var i = 0; i < route.path.length - 1; i++) { - var pair = route.pairs[i]; - - var _pair$getOutputAmount = pair.getOutputAmount(tokenAmounts[i]), - outputAmount = _pair$getOutputAmount[0]; - - tokenAmounts[i + 1] = outputAmount; - } - - this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator); - this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, tokenAmounts[tokenAmounts.length - 1].numerator, tokenAmounts[tokenAmounts.length - 1].denominator); - } else { - !currencyEquals(amount.currency, route.output) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT') : invariant(false) : void 0; - tokenAmounts[tokenAmounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId); - - for (var _i = route.path.length - 1; _i > 0; _i--) { - var _pair = route.pairs[_i - 1]; - - var _pair$getInputAmount = _pair.getInputAmount(tokenAmounts[_i]), - inputAmount = _pair$getInputAmount[0]; - - tokenAmounts[_i - 1] = inputAmount; - } - - this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, tokenAmounts[0].numerator, tokenAmounts[0].denominator); - this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator); - } - - this.executionPrice = new Price(this.inputAmount.currency, this.outputAmount.currency, this.inputAmount.quotient, this.outputAmount.quotient); - this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount); - } - /** - * Constructs an exact in trade with the given amount in and route - * @param route route of the exact in trade - * @param amountIn the amount being passed in - */ - - - Trade.exactIn = function exactIn(route, amountIn) { - return new Trade(route, amountIn, TradeType$1.EXACT_INPUT); - } - /** - * Constructs an exact out trade with the given amount out and route - * @param route route of the exact out trade - * @param amountOut the amount returned by the trade - */ - ; - - Trade.exactOut = function exactOut(route, amountOut) { - return new Trade(route, amountOut, TradeType$1.EXACT_OUTPUT); - } - /** - * Get the minimum amount that must be received from this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - ; - - var _proto = Trade.prototype; - - _proto.minimumAmountOut = function minimumAmountOut(slippageTolerance) { - !!slippageTolerance.lessThan(ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SLIPPAGE_TOLERANCE') : invariant(false) : void 0; - - if (this.tradeType === TradeType$1.EXACT_OUTPUT) { - return this.outputAmount; - } else { - var slippageAdjustedAmountOut = new Fraction$1(ONE).add(slippageTolerance).invert().multiply(this.outputAmount.quotient).quotient; - return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut); - } - } - /** - * Get the maximum amount in that can be spent via this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - ; - - _proto.maximumAmountIn = function maximumAmountIn(slippageTolerance) { - !!slippageTolerance.lessThan(ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SLIPPAGE_TOLERANCE') : invariant(false) : void 0; - - if (this.tradeType === TradeType$1.EXACT_INPUT) { - return this.inputAmount; - } else { - var slippageAdjustedAmountIn = new Fraction$1(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient).quotient; - return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn); - } - } - /** - * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token - * amount to an output token, making at most `maxHops` hops. - * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pairs the pairs to consider in finding the best trade - * @param nextAmountIn exact amount of input currency to spend - * @param currencyOut the desired currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair - * @param currentPairs used in recursion; the current list of pairs - * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter - * @param bestTrades used in recursion; the current list of best trades - */ - ; - - Trade.bestTradeExactIn = function bestTradeExactIn(pairs, currencyAmountIn, currencyOut, _temp, // used in recursion. - currentPairs, nextAmountIn, bestTrades) { - var _ref = _temp === void 0 ? {} : _temp, - _ref$maxNumResults = _ref.maxNumResults, - maxNumResults = _ref$maxNumResults === void 0 ? 3 : _ref$maxNumResults, - _ref$maxHops = _ref.maxHops, - maxHops = _ref$maxHops === void 0 ? 3 : _ref$maxHops; - - if (currentPairs === void 0) { - currentPairs = []; - } - - if (nextAmountIn === void 0) { - nextAmountIn = currencyAmountIn; - } - - if (bestTrades === void 0) { - bestTrades = []; - } - - !(pairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PAIRS') : invariant(false) : void 0; - !(maxHops > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_HOPS') : invariant(false) : void 0; - !(currencyAmountIn === nextAmountIn || currentPairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INVALID_RECURSION') : invariant(false) : void 0; - var chainId = nextAmountIn.currency.isToken ? nextAmountIn.currency.chainId : currencyOut.isToken ? currencyOut.chainId : undefined; - !(chainId !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; - var amountIn = wrappedCurrencyAmount(nextAmountIn, chainId); - var tokenOut = wrappedCurrency(currencyOut, chainId); - - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i]; // pair irrelevant - - if (!currencyEquals(pair.token0, amountIn.currency) && !currencyEquals(pair.token1, amountIn.currency)) continue; - if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue; - var amountOut = void 0; - - try { - ; - - var _pair$getOutputAmount2 = pair.getOutputAmount(amountIn); - - amountOut = _pair$getOutputAmount2[0]; - } catch (error) { - // input too low - if (error.isInsufficientInputAmountError) { - continue; - } - - throw error; - } // we have arrived at the output token, so this is the final trade of one of the paths - - - if (currencyEquals(amountOut.currency, tokenOut)) { - sortedInsert(bestTrades, new Trade(new Route([].concat(currentPairs, [pair]), currencyAmountIn.currency, currencyOut), currencyAmountIn, TradeType$1.EXACT_INPUT), maxNumResults, tradeComparator); - } else if (maxHops > 1 && pairs.length > 1) { - var pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length)); // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops - - Trade.bestTradeExactIn(pairsExcludingThisPair, currencyAmountIn, currencyOut, { - maxNumResults: maxNumResults, - maxHops: maxHops - 1 - }, [].concat(currentPairs, [pair]), amountOut, bestTrades); - } - } - - return bestTrades; - } - /** - * Return the execution price after accounting for slippage tolerance - * @param slippageTolerance the allowed tolerated slippage - */ - ; - - _proto.worstExecutionPrice = function worstExecutionPrice(slippageTolerance) { - return new Price(this.inputAmount.currency, this.outputAmount.currency, this.maximumAmountIn(slippageTolerance).quotient, this.minimumAmountOut(slippageTolerance).quotient); - } - /** - * similar to the above method but instead targets a fixed output amount - * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token - * to an output token amount, making at most `maxHops` hops - * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pairs the pairs to consider in finding the best trade - * @param currencyIn the currency to spend - * @param nextAmountOut the exact amount of currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair - * @param currentPairs used in recursion; the current list of pairs - * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter - * @param bestTrades used in recursion; the current list of best trades - */ - ; - - Trade.bestTradeExactOut = function bestTradeExactOut(pairs, currencyIn, currencyAmountOut, _temp2, // used in recursion. - currentPairs, nextAmountOut, bestTrades) { - var _ref2 = _temp2 === void 0 ? {} : _temp2, - _ref2$maxNumResults = _ref2.maxNumResults, - maxNumResults = _ref2$maxNumResults === void 0 ? 3 : _ref2$maxNumResults, - _ref2$maxHops = _ref2.maxHops, - maxHops = _ref2$maxHops === void 0 ? 3 : _ref2$maxHops; - - if (currentPairs === void 0) { - currentPairs = []; - } - - if (nextAmountOut === void 0) { - nextAmountOut = currencyAmountOut; - } - - if (bestTrades === void 0) { - bestTrades = []; - } - - !(pairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PAIRS') : invariant(false) : void 0; - !(maxHops > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_HOPS') : invariant(false) : void 0; - !(currencyAmountOut === nextAmountOut || currentPairs.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INVALID_RECURSION') : invariant(false) : void 0; - var chainId = nextAmountOut.currency.isToken ? nextAmountOut.currency.chainId : currencyIn.isToken ? currencyIn.chainId : undefined; - !(chainId !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; - var amountOut = wrappedCurrencyAmount(nextAmountOut, chainId); - var tokenIn = wrappedCurrency(currencyIn, chainId); - - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i]; // pair irrelevant - - if (!currencyEquals(pair.token0, amountOut.currency) && !currencyEquals(pair.token1, amountOut.currency)) continue; - if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue; - var amountIn = void 0; - - try { - ; - - var _pair$getInputAmount2 = pair.getInputAmount(amountOut); - - amountIn = _pair$getInputAmount2[0]; - } catch (error) { - // not enough liquidity in this pair - if (error.isInsufficientReservesError) { - continue; - } - - throw error; - } // we have arrived at the input token, so this is the first trade of one of the paths - - - if (currencyEquals(amountIn.currency, tokenIn)) { - sortedInsert(bestTrades, new Trade(new Route([pair].concat(currentPairs), currencyIn, currencyAmountOut.currency), currencyAmountOut, TradeType$1.EXACT_OUTPUT), maxNumResults, tradeComparator); - } else if (maxHops > 1 && pairs.length > 1) { - var pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length)); // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops - - Trade.bestTradeExactOut(pairsExcludingThisPair, currencyIn, currencyAmountOut, { - maxNumResults: maxNumResults, - maxHops: maxHops - 1 - }, [pair].concat(currentPairs), amountIn, bestTrades); - } - } - - return bestTrades; - }; - - return Trade; -}(); - -function toHex(currencyAmount) { - return "0x" + currencyAmount.quotient.toString(16); -} - -var ZERO_HEX = '0x0'; -/** - * Represents the Uniswap V2 Router, and has static methods for helping execute trades. - */ - -var Router = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function Router() {} - /** - * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. - * @param trade to produce call parameters for - * @param options options for the call parameters - */ - - - Router.swapCallParameters = function swapCallParameters(trade, options) { - var etherIn = trade.inputAmount.currency.isEther; - var etherOut = trade.outputAmount.currency.isEther; // the router does not support both ether in and out - - !!(etherIn && etherOut) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ETHER_IN_OUT') : invariant(false) : void 0; - !(!('ttl' in options) || options.ttl > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TTL') : invariant(false) : void 0; - var to = validateAndParseAddress$1(options.recipient); - var amountIn = toHex(trade.maximumAmountIn(options.allowedSlippage)); - var amountOut = toHex(trade.minimumAmountOut(options.allowedSlippage)); - var path = trade.route.path.map(function (token) { - return token.address; - }); - var deadline = 'ttl' in options ? "0x" + (Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16) : "0x" + options.deadline.toString(16); - var useFeeOnTransfer = Boolean(options.feeOnTransfer); - var methodName; - var args; - var value; - - switch (trade.tradeType) { - case TradeType$1.EXACT_INPUT: - if (etherIn) { - methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'; // (uint amountOutMin, address[] calldata path, address to, uint deadline) - - args = [amountOut, path, to, deadline]; - value = amountIn; - } else if (etherOut) { - methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'; // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - - args = [amountIn, amountOut, path, to, deadline]; - value = ZERO_HEX; - } else { - methodName = useFeeOnTransfer ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens' : 'swapExactTokensForTokens'; // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) - - args = [amountIn, amountOut, path, to, deadline]; - value = ZERO_HEX; - } - - break; - - case TradeType$1.EXACT_OUTPUT: - !!useFeeOnTransfer ? process.env.NODE_ENV !== "production" ? invariant(false, 'EXACT_OUT_FOT') : invariant(false) : void 0; - - if (etherIn) { - methodName = 'swapETHForExactTokens'; // (uint amountOut, address[] calldata path, address to, uint deadline) - - args = [amountOut, path, to, deadline]; - value = amountIn; - } else if (etherOut) { - methodName = 'swapTokensForExactETH'; // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - - args = [amountOut, amountIn, path, to, deadline]; - value = ZERO_HEX; - } else { - methodName = 'swapTokensForExactTokens'; // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) - - args = [amountOut, amountIn, path, to, deadline]; - value = ZERO_HEX; - } - - break; - } - - return { - methodName: methodName, - args: args, - value: value - }; - }; - - return Router; -}(); - -export { FACTORY_ADDRESS, INIT_CODE_HASH, InsufficientInputAmountError, InsufficientReservesError, MINIMUM_LIQUIDITY, Pair, Route, Router, Trade, computePairAddress, inputOutputComparator, tradeComparator }; -//# sourceMappingURL=v2-sdk.esm.js.map diff --git a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js.map b/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js.map deleted file mode 100644 index 9137cf12bdb..00000000000 --- a/uniswap-packages-forks/v2-sdk/dist/v2-sdk.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"v2-sdk.esm.js","sources":["../src/constants.ts","../src/errors.ts","../src/entities/pair.ts","../src/entities/route.ts","../../../sdk-core/src/constants.ts","../src/entities/trade.ts","../src/router.ts"],"sourcesContent":["import JSBI from 'jsbi'\n\nexport const FACTORY_ADDRESS = '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f'\n\nexport const INIT_CODE_HASH = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'\n\nexport const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)\n\n// exports for internal consumption\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\nexport const FIVE = JSBI.BigInt(5)\nexport const _997 = JSBI.BigInt(997)\nexport const _1000 = JSBI.BigInt(1000)\n","// see https://stackoverflow.com/a/41102306\nconst CAN_SET_PROTOTYPE = 'setPrototypeOf' in Object\n\n/**\n * Indicates that the pair has insufficient reserves for a desired output amount. I.e. the amount of output cannot be\n * obtained by sending any amount of input.\n */\nexport class InsufficientReservesError extends Error {\n public readonly isInsufficientReservesError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\n/**\n * Indicates that the input amount is too small to produce any amount of output. I.e. the amount of input sent is less\n * than the price of a single unit of output after fees.\n */\nexport class InsufficientInputAmountError extends Error {\n public readonly isInsufficientInputAmountError: true = true\n\n public constructor() {\n super()\n this.name = this.constructor.name\n if (CAN_SET_PROTOTYPE) Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n","import { BigintIsh, ChainId, Price, sqrt, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport JSBI from 'jsbi'\nimport { pack, keccak256 } from '@ethersproject/solidity'\nimport { getCreate2Address } from '@ethersproject/address'\n\nimport { FACTORY_ADDRESS, INIT_CODE_HASH, MINIMUM_LIQUIDITY, FIVE, _997, _1000, ONE, ZERO } from '../constants'\nimport { InsufficientReservesError, InsufficientInputAmountError } from '../errors'\n\nexport const computePairAddress = ({\n factoryAddress,\n tokenA,\n tokenB\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n}): string => {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(['bytes'], [pack(['address', 'address'], [token0.address, token1.address])]),\n INIT_CODE_HASH\n )\n}\nexport class Pair {\n public readonly liquidityToken: Token\n private readonly tokenAmounts: [CurrencyAmount, CurrencyAmount]\n\n public static getAddress(tokenA: Token, tokenB: Token): string {\n return computePairAddress({ factoryAddress: FACTORY_ADDRESS, tokenA, tokenB })\n }\n\n public constructor(currencyAmountA: CurrencyAmount, tokenAmountB: CurrencyAmount) {\n const tokenAmounts = currencyAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [currencyAmountA, tokenAmountB]\n : [tokenAmountB, currencyAmountA]\n this.liquidityToken = new Token(\n tokenAmounts[0].currency.chainId,\n Pair.getAddress(tokenAmounts[0].currency, tokenAmounts[1].currency),\n 18,\n 'UNI-V2',\n 'Uniswap V2'\n )\n this.tokenAmounts = tokenAmounts as [CurrencyAmount, CurrencyAmount]\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0\n */\n public get token0Price(): Price {\n const result = this.tokenAmounts[1].divide(this.tokenAmounts[0])\n return new Price(this.token0, this.token1, result.denominator, result.numerator)\n }\n\n /**\n * Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1\n */\n public get token1Price(): Price {\n const result = this.tokenAmounts[0].divide(this.tokenAmounts[1])\n return new Price(this.token1, this.token0, result.denominator, result.numerator)\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pair.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pair.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n public get token0(): Token {\n return this.tokenAmounts[0].currency\n }\n\n public get token1(): Token {\n return this.tokenAmounts[1].currency\n }\n\n public get reserve0(): CurrencyAmount {\n return this.tokenAmounts[0]\n }\n\n public get reserve1(): CurrencyAmount {\n return this.tokenAmounts[1]\n }\n\n public reserveOf(token: Token): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.reserve0 : this.reserve1\n }\n\n public getOutputAmount(inputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n if (JSBI.equal(this.reserve0.quotient, ZERO) || JSBI.equal(this.reserve1.quotient, ZERO)) {\n throw new InsufficientReservesError()\n }\n const inputReserve = this.reserveOf(inputAmount.currency)\n const outputReserve = this.reserveOf(inputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const inputAmountWithFee = JSBI.multiply(inputAmount.quotient, _997)\n const numerator = JSBI.multiply(inputAmountWithFee, outputReserve.quotient)\n const denominator = JSBI.add(JSBI.multiply(inputReserve.quotient, _1000), inputAmountWithFee)\n const outputAmount = CurrencyAmount.fromRawAmount(\n inputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.divide(numerator, denominator)\n )\n if (JSBI.equal(outputAmount.quotient, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return [outputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getInputAmount(outputAmount: CurrencyAmount): [CurrencyAmount, Pair] {\n invariant(this.involvesToken(outputAmount.currency), 'TOKEN')\n if (\n JSBI.equal(this.reserve0.quotient, ZERO) ||\n JSBI.equal(this.reserve1.quotient, ZERO) ||\n JSBI.greaterThanOrEqual(outputAmount.quotient, this.reserveOf(outputAmount.currency).quotient)\n ) {\n throw new InsufficientReservesError()\n }\n\n const outputReserve = this.reserveOf(outputAmount.currency)\n const inputReserve = this.reserveOf(outputAmount.currency.equals(this.token0) ? this.token1 : this.token0)\n const numerator = JSBI.multiply(JSBI.multiply(inputReserve.quotient, outputAmount.quotient), _1000)\n const denominator = JSBI.multiply(JSBI.subtract(outputReserve.quotient, outputAmount.quotient), _997)\n const inputAmount = CurrencyAmount.fromRawAmount(\n outputAmount.currency.equals(this.token0) ? this.token1 : this.token0,\n JSBI.add(JSBI.divide(numerator, denominator), ONE)\n )\n return [inputAmount, new Pair(inputReserve.add(inputAmount), outputReserve.subtract(outputAmount))]\n }\n\n public getLiquidityMinted(\n totalSupply: CurrencyAmount,\n tokenAmountA: CurrencyAmount,\n tokenAmountB: CurrencyAmount\n ): CurrencyAmount {\n invariant(totalSupply.currency.equals(this.liquidityToken), 'LIQUIDITY')\n const tokenAmounts = tokenAmountA.currency.sortsBefore(tokenAmountB.currency) // does safety checks\n ? [tokenAmountA, tokenAmountB]\n : [tokenAmountB, tokenAmountA]\n invariant(tokenAmounts[0].currency.equals(this.token0) && tokenAmounts[1].currency.equals(this.token1), 'TOKEN')\n\n let liquidity: JSBI\n if (JSBI.equal(totalSupply.quotient, ZERO)) {\n liquidity = JSBI.subtract(\n sqrt(JSBI.multiply(tokenAmounts[0].quotient, tokenAmounts[1].quotient)),\n MINIMUM_LIQUIDITY\n )\n } else {\n const amount0 = JSBI.divide(JSBI.multiply(tokenAmounts[0].quotient, totalSupply.quotient), this.reserve0.quotient)\n const amount1 = JSBI.divide(JSBI.multiply(tokenAmounts[1].quotient, totalSupply.quotient), this.reserve1.quotient)\n liquidity = JSBI.lessThanOrEqual(amount0, amount1) ? amount0 : amount1\n }\n if (!JSBI.greaterThan(liquidity, ZERO)) {\n throw new InsufficientInputAmountError()\n }\n return CurrencyAmount.fromRawAmount(this.liquidityToken, liquidity)\n }\n\n public getLiquidityValue(\n token: Token,\n totalSupply: CurrencyAmount,\n liquidity: CurrencyAmount,\n feeOn: boolean = false,\n kLast?: BigintIsh\n ): CurrencyAmount {\n invariant(this.involvesToken(token), 'TOKEN')\n invariant(totalSupply.currency.equals(this.liquidityToken), 'TOTAL_SUPPLY')\n invariant(liquidity.currency.equals(this.liquidityToken), 'LIQUIDITY')\n invariant(JSBI.lessThanOrEqual(liquidity.quotient, totalSupply.quotient), 'LIQUIDITY')\n\n let totalSupplyAdjusted: CurrencyAmount\n if (!feeOn) {\n totalSupplyAdjusted = totalSupply\n } else {\n invariant(!!kLast, 'K_LAST')\n const kLastParsed = JSBI.BigInt(kLast)\n if (!JSBI.equal(kLastParsed, ZERO)) {\n const rootK = sqrt(JSBI.multiply(this.reserve0.quotient, this.reserve1.quotient))\n const rootKLast = sqrt(kLastParsed)\n if (JSBI.greaterThan(rootK, rootKLast)) {\n const numerator = JSBI.multiply(totalSupply.quotient, JSBI.subtract(rootK, rootKLast))\n const denominator = JSBI.add(JSBI.multiply(rootK, FIVE), rootKLast)\n const feeLiquidity = JSBI.divide(numerator, denominator)\n totalSupplyAdjusted = totalSupply.add(CurrencyAmount.fromRawAmount(this.liquidityToken, feeLiquidity))\n } else {\n totalSupplyAdjusted = totalSupply\n }\n } else {\n totalSupplyAdjusted = totalSupply\n }\n }\n\n return CurrencyAmount.fromRawAmount(\n token,\n JSBI.divide(JSBI.multiply(liquidity.quotient, this.reserveOf(token).quotient), totalSupplyAdjusted.quotient)\n )\n }\n}\n","import invariant from 'tiny-invariant'\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\n\nimport { Pair } from './pair'\n\nexport class Route {\n public readonly pairs: Pair[]\n public readonly path: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n public constructor(pairs: Pair[], input: TInput, output: TOutput) {\n invariant(pairs.length > 0, 'PAIRS')\n const chainId: ChainId | number = pairs[0].chainId\n invariant(\n pairs.every(pair => pair.chainId === chainId),\n 'CHAIN_IDS'\n )\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pairs[0].involvesToken(wrappedInput), 'INPUT')\n invariant(\n typeof output === 'undefined' || pairs[pairs.length - 1].involvesToken(wrappedCurrency(output, chainId)),\n 'OUTPUT'\n )\n\n const path: Token[] = [wrappedInput]\n for (const [i, pair] of pairs.entries()) {\n const currentInput = path[i]\n invariant(currentInput.equals(pair.token0) || currentInput.equals(pair.token1), 'PATH')\n const output = currentInput.equals(pair.token0) ? pair.token1 : pair.token0\n path.push(output)\n }\n\n this.pairs = pairs\n this.path = path\n this.input = input\n this.output = output\n }\n\n private _midPrice: Price | null = null\n\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n const prices: Price[] = []\n for (const [i, pair] of this.pairs.entries()) {\n prices.push(\n this.path[i].equals(pair.token0)\n ? new Price(pair.reserve0.currency, pair.reserve1.currency, pair.reserve0.quotient, pair.reserve1.quotient)\n : new Price(pair.reserve1.currency, pair.reserve0.currency, pair.reserve1.quotient, pair.reserve0.quotient)\n )\n }\n const reduced = prices.slice(1).reduce((accumulator, currentValue) => accumulator.multiply(currentValue), prices[0])\n return (this._midPrice = new Price(this.input, this.output, reduced.denominator, reduced.numerator))\n }\n\n public get chainId(): ChainId | number {\n return this.pairs[0].chainId\n }\n}\n","import JSBI from 'jsbi'\n\n// exports for external consumption\nexport type BigintIsh = JSBI | string | number\n\nexport enum ChainId {\n MAINNET = 1,\n ROPSTEN = 3,\n RINKEBY = 4,\n GÖRLI = 5,\n KOVAN = 42\n}\n\nexport enum TradeType {\n EXACT_INPUT,\n EXACT_OUTPUT\n}\n\nexport enum Rounding {\n ROUND_DOWN,\n ROUND_HALF_UP,\n ROUND_UP\n}\n\nexport const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')\n","import {\n ChainId,\n Currency,\n CurrencyAmount,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n wrappedCurrency,\n TradeType,\n wrappedCurrencyAmount\n} from '@uniswap/sdk-core'\nimport { computePriceImpact, Token } from '../../../../sdk-core'\nimport { ONE, ZERO } from '../constants'\nimport invariant from 'tiny-invariant'\n\nimport { Pair } from './pair'\nimport { Route } from './route'\n\n// minimal interface so the input output comparator may be shared across types\ninterface InputOutput {\n readonly inputAmount: CurrencyAmount\n readonly outputAmount: CurrencyAmount\n}\n\n// comparator function that allows sorting trades by their output amounts, in decreasing order, and then input amounts\n// in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first\nexport function inputOutputComparator(\n a: InputOutput,\n b: InputOutput\n): number {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n return 0\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n const ioComp = inputOutputComparator(a, b)\n if (ioComp !== 0) {\n return ioComp\n }\n\n // consider lowest slippage next, since these are less likely to fail\n if (a.priceImpact.lessThan(b.priceImpact)) {\n return -1\n } else if (a.priceImpact.greaterThan(b.priceImpact)) {\n return 1\n }\n\n // finally consider the number of hops since each hop costs gas\n return a.route.path.length - b.route.path.length\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pairs.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pairs the trade goes through and the input/output currencies.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public readonly executionPrice: Price\n /**\n * The percent difference between the mid price before the trade and the trade execution price.\n */\n public readonly priceImpact: Percent\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Trade {\n return new Trade(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Trade {\n return new Trade(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n public constructor(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ) {\n this.route = route\n this.tradeType = tradeType\n\n const tokenAmounts: CurrencyAmount[] = new Array(route.path.length)\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n tokenAmounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.path.length - 1; i++) {\n const pair = route.pairs[i]\n const [outputAmount] = pair.getOutputAmount(tokenAmounts[i])\n tokenAmounts[i + 1] = outputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n this.outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n tokenAmounts[tokenAmounts.length - 1].numerator,\n tokenAmounts[tokenAmounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n tokenAmounts[tokenAmounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.path.length - 1; i > 0; i--) {\n const pair = route.pairs[i - 1]\n const [inputAmount] = pair.getInputAmount(tokenAmounts[i])\n tokenAmounts[i - 1] = inputAmount\n }\n this.inputAmount = CurrencyAmount.fromFractionalAmount(\n route.input,\n tokenAmounts[0].numerator,\n tokenAmounts[0].denominator\n )\n this.outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n this.executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n )\n this.priceImpact = computePriceImpact(route.midPrice, this.inputAmount, this.outputAmount)\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Given a list of pairs, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactIn(\n pairs: Pair[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountIn.currency) && !currencyEquals(pair.token1, amountIn.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = pair.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (currencyEquals(amountOut.currency, tokenOut)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([...currentPairs, pair], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n Trade.bestTradeExactIn(\n pairsExcludingThisPair,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPairs, pair],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pairs, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pairs the pairs to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pair\n * @param currentPairs used in recursion; the current list of pairs\n * @param currencyAmountOut used in recursion; the original value of the currencyAmountOut parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static bestTradeExactOut(\n pairs: Pair[],\n currencyIn: TInput,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPairs: Pair[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Trade[] {\n invariant(pairs.length > 0, 'PAIRS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPairs.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? (currencyIn as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i]\n // pair irrelevant\n if (!currencyEquals(pair.token0, amountOut.currency) && !currencyEquals(pair.token1, amountOut.currency)) continue\n if (pair.reserve0.equalTo(ZERO) || pair.reserve1.equalTo(ZERO)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = pair.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pair\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n new Trade(\n new Route([pair, ...currentPairs], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pairs.length > 1) {\n const pairsExcludingThisPair = pairs.slice(0, i).concat(pairs.slice(i + 1, pairs.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n Trade.bestTradeExactOut(\n pairsExcludingThisPair,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pair, ...currentPairs],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { Currency, CurrencyAmount, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport { Trade } from 'entities'\nimport invariant from 'tiny-invariant'\nimport { Token } from '../../../sdk-core'\n\n/**\n * Options for producing the arguments to send call to the router.\n */\nexport interface TradeOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n allowedSlippage: Percent\n /**\n * How long the swap is valid until it expires, in seconds.\n * This will be used to produce a `deadline` parameter which is computed from when the swap call parameters\n * are generated.\n */\n ttl: number\n /**\n * The account that should receive the output of the swap.\n */\n recipient: string\n\n /**\n * Whether any of the tokens in the path are fee on transfer tokens, which should be handled with special methods\n */\n feeOnTransfer?: boolean\n}\n\nexport interface TradeOptionsDeadline extends Omit {\n /**\n * When the transaction expires.\n * This is an atlernate to specifying the ttl, for when you do not want to use local time.\n */\n deadline: number\n}\n\n/**\n * The parameters to use in the call to the Uniswap V2 Router to execute a trade.\n */\nexport interface SwapParameters {\n /**\n * The method to call on the Uniswap V2 Router.\n */\n methodName: string\n /**\n * The arguments to pass to the method, all hex encoded.\n */\n args: (string | string[])[]\n /**\n * The amount of wei to send in hex.\n */\n value: string\n}\n\nfunction toHex(currencyAmount: CurrencyAmount) {\n return `0x${currencyAmount.quotient.toString(16)}`\n}\n\nconst ZERO_HEX = '0x0'\n\n/**\n * Represents the Uniswap V2 Router, and has static methods for helping execute trades.\n */\nexport abstract class Router {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: TradeOptions | TradeOptionsDeadline\n ): SwapParameters {\n const etherIn = trade.inputAmount.currency.isEther\n const etherOut = trade.outputAmount.currency.isEther\n // the router does not support both ether in and out\n invariant(!(etherIn && etherOut), 'ETHER_IN_OUT')\n invariant(!('ttl' in options) || options.ttl > 0, 'TTL')\n\n const to: string = validateAndParseAddress(options.recipient)\n const amountIn: string = toHex(trade.maximumAmountIn(options.allowedSlippage))\n const amountOut: string = toHex(trade.minimumAmountOut(options.allowedSlippage))\n const path: string[] = trade.route.path.map((token: Token) => token.address)\n const deadline =\n 'ttl' in options\n ? `0x${(Math.floor(new Date().getTime() / 1000) + options.ttl).toString(16)}`\n : `0x${options.deadline.toString(16)}`\n\n const useFeeOnTransfer = Boolean(options.feeOnTransfer)\n\n let methodName: string\n let args: (string | string[])[]\n let value: string\n switch (trade.tradeType) {\n case TradeType.EXACT_INPUT:\n if (etherIn) {\n methodName = useFeeOnTransfer ? 'swapExactETHForTokensSupportingFeeOnTransferTokens' : 'swapExactETHForTokens'\n // (uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = useFeeOnTransfer ? 'swapExactTokensForETHSupportingFeeOnTransferTokens' : 'swapExactTokensForETH'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = useFeeOnTransfer\n ? 'swapExactTokensForTokensSupportingFeeOnTransferTokens'\n : 'swapExactTokensForTokens'\n // (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n args = [amountIn, amountOut, path, to, deadline]\n value = ZERO_HEX\n }\n break\n case TradeType.EXACT_OUTPUT:\n invariant(!useFeeOnTransfer, 'EXACT_OUT_FOT')\n if (etherIn) {\n methodName = 'swapETHForExactTokens'\n // (uint amountOut, address[] calldata path, address to, uint deadline)\n args = [amountOut, path, to, deadline]\n value = amountIn\n } else if (etherOut) {\n methodName = 'swapTokensForExactETH'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n } else {\n methodName = 'swapTokensForExactTokens'\n // (uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n args = [amountOut, amountIn, path, to, deadline]\n value = ZERO_HEX\n }\n break\n }\n return {\n methodName,\n args,\n value\n }\n }\n}\n"],"names":["FACTORY_ADDRESS","INIT_CODE_HASH","MINIMUM_LIQUIDITY","JSBI","BigInt","ZERO","ONE","FIVE","_997","_1000","CAN_SET_PROTOTYPE","Object","InsufficientReservesError","name","constructor","setPrototypeOf","prototype","Error","InsufficientInputAmountError","computePairAddress","factoryAddress","tokenA","tokenB","sortsBefore","token0","token1","getCreate2Address","keccak256","pack","address","Pair","currencyAmountA","tokenAmountB","tokenAmounts","currency","liquidityToken","Token","chainId","getAddress","involvesToken","token","equals","priceOf","invariant","token0Price","token1Price","reserveOf","reserve0","reserve1","getOutputAmount","inputAmount","equal","quotient","inputReserve","outputReserve","inputAmountWithFee","multiply","numerator","denominator","add","outputAmount","CurrencyAmount","fromRawAmount","divide","subtract","getInputAmount","greaterThanOrEqual","getLiquidityMinted","totalSupply","tokenAmountA","liquidity","sqrt","amount0","amount1","lessThanOrEqual","greaterThan","getLiquidityValue","feeOn","kLast","totalSupplyAdjusted","kLastParsed","rootK","rootKLast","feeLiquidity","result","Price","Route","pairs","input","output","length","every","pair","wrappedInput","wrappedCurrency","path","entries","i","currentInput","push","_midPrice","prices","reduced","slice","reduce","accumulator","currentValue","ChainId","TradeType","inputOutputComparator","a","b","currencyEquals","equalTo","lessThan","tradeComparator","ioComp","priceImpact","route","Trade","amount","tradeType","Array","EXACT_INPUT","wrappedCurrencyAmount","fromFractionalAmount","executionPrice","computePriceImpact","midPrice","exactIn","amountIn","exactOut","amountOut","EXACT_OUTPUT","minimumAmountOut","slippageTolerance","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","bestTradeExactIn","currencyAmountIn","currencyOut","currentPairs","nextAmountIn","bestTrades","maxNumResults","maxHops","isToken","undefined","tokenOut","error","isInsufficientInputAmountError","sortedInsert","pairsExcludingThisPair","concat","worstExecutionPrice","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","toHex","currencyAmount","toString","ZERO_HEX","Router","swapCallParameters","trade","options","etherIn","isEther","etherOut","ttl","to","validateAndParseAddress","recipient","allowedSlippage","map","deadline","Math","floor","Date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EAAYF,QAAZ,EAAsBnC,IAAtB,EAA4BiF,EAA5B,EAAgCK,QAAhC,CAAP;AACAU,UAAAA,KAAK,GAAGxB,QAAR;AACD,SALM,MAKA;AACLsB,UAAAA,UAAU,GAAG,0BAAb,CADK;;AAGLC,UAAAA,IAAI,GAAG,CAAC1D,SAAD,EAAYF,QAAZ,EAAsBnC,IAAtB,EAA4BiF,EAA5B,EAAgCK,QAAhC,CAAP;AACAU,UAAAA,KAAK,GAAGxB,QAAR;AACD;;AACD;AAvCJ;;AAyCA,WAAO;AACLsB,MAAAA,UAAU,EAAVA,UADK;AAELC,MAAAA,IAAI,EAAJA,IAFK;AAGLC,MAAAA,KAAK,EAALA;AAHK,KAAP;AAKD,GAhFH;;AAAA;AAAA;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/v2-sdk/package.json b/uniswap-packages-forks/v2-sdk/package.json deleted file mode 100644 index 7400fda6b04..00000000000 --- a/uniswap-packages-forks/v2-sdk/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "@uniswap/v2-sdk", - "license": "MIT", - "version": "3.0.0-alpha.0", - "description": "🛠 An SDK for building applications on top of Uniswap V2", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "files": [ - "dist" - ], - "repository": "https://github.com/Uniswap/uniswap-v2-sdk.git", - "keywords": [ - "uniswap", - "ethereum" - ], - "module": "dist/v2-sdk.esm.js", - "scripts": { - "lint": "tsdx lint src test", - "build": "tsdx build", - "start": "tsdx watch", - "test": "tsdx test", - "prepublishOnly": "tsdx build" - }, - "dependencies": { - "@ethersproject/address": "^5.0.0", - "@ethersproject/solidity": "^5.0.0", - "@uniswap/sdk-core": "file:../sdk-core", - "tiny-invariant": "^1.1.0", - "tiny-warning": "^1.0.3" - }, - "devDependencies": { - "@types/big.js": "^4.0.5", - "@types/jest": "^24.0.25", - "@uniswap/v2-core": "^1.0.1", - "tsdx": "^0.14.1" - }, - "engines": { - "node": ">=10" - }, - "prettier": { - "printWidth": 120, - "semi": false, - "singleQuote": true - } -} diff --git a/uniswap-packages-forks/v3-sdk/LICENSE b/uniswap-packages-forks/v3-sdk/LICENSE deleted file mode 100644 index b2517ee60b6..00000000000 --- a/uniswap-packages-forks/v3-sdk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Uniswap Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/uniswap-packages-forks/v3-sdk/README.md b/uniswap-packages-forks/v3-sdk/README.md deleted file mode 100644 index e86146cefd0..00000000000 --- a/uniswap-packages-forks/v3-sdk/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Alpha software - -The latest version of the SDK is used in production in the Uniswap Interface, -but it is considered Alpha software and may contain bugs or change significantly between patch versions. -If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel of the Discord. -Pull requests welcome! - -# Uniswap V3 SDK - -[![Unit Tests](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Unit%20Tests/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3A%22Unit+Tests%22) -[![Lint](https://github.com/Uniswap/uniswap-v3-sdk/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v3-sdk/actions?query=workflow%3ALint) -[![npm version](https://img.shields.io/npm/v/@uniswap/v3-sdk/latest.svg)](https://www.npmjs.com/package/@uniswap/v3-sdk/v/latest) -[![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@uniswap/v3-sdk/latest.svg)](https://bundlephobia.com/result?p=@uniswap/v3-sdk@latest) - -In-depth documentation on this SDK is available at [uniswap.org](https://docs.uniswap.org/). diff --git a/uniswap-packages-forks/v3-sdk/dist/constants.d.ts b/uniswap-packages-forks/v3-sdk/dist/constants.d.ts deleted file mode 100644 index 06efe5739fd..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/constants.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export declare const FACTORY_ADDRESS = "0x1F98431c8aD98523631AE4a59f267346ea31F984"; -export declare const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000"; -export declare const POOL_INIT_CODE_HASH = "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54"; -/** - * The default factory enabled fee amounts, denominated in hundredths of bips. - */ -export declare enum FeeAmount { - LOW = 500, - MEDIUM = 3000, - HIGH = 10000 -} -/** - * The default factory tick spacings by fee amount. - */ -export declare const TICK_SPACINGS: { - [amount in FeeAmount]: number; -}; diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/index.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/index.d.ts deleted file mode 100644 index c4f1b2fa08d..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/entities/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './pool'; -export * from './position'; -export * from './route'; -export * from './tick'; -export * from './trade'; -export * from './tickDataProvider'; -export * from './tickListDataProvider'; diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/pool.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/pool.d.ts deleted file mode 100644 index 4f180cfe1a6..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/entities/pool.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'; -import JSBI from 'jsbi'; -import { FeeAmount } from '../constants'; -import { Tick, TickConstructorArgs } from './tick'; -import { TickDataProvider } from './tickDataProvider'; -/** - * Represents a V3 pool - */ -export declare class Pool { - readonly token0: Token; - readonly token1: Token; - readonly fee: FeeAmount; - readonly sqrtRatioX96: JSBI; - readonly liquidity: JSBI; - readonly tickCurrent: number; - readonly tickDataProvider: TickDataProvider; - private _token0Price?; - private _token1Price?; - static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount): string; - /** - * Construct a pool - * @param tokenA one of the tokens in the pool - * @param tokenB the other token in the pool - * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool - * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0 - * @param liquidity the current value of in range liquidity - * @param tickCurrent the current tick of the pool - * @param ticks the current state of the pool ticks or a data provider that can return tick data - */ - constructor(tokenA: Token, tokenB: Token, fee: FeeAmount, sqrtRatioX96: BigintIsh, liquidity: BigintIsh, tickCurrent: number, ticks?: TickDataProvider | (Tick | TickConstructorArgs)[]); - /** - * Returns true if the token is either token0 or token1 - * @param token to check - */ - involvesToken(token: Token): boolean; - /** - * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0 - */ - get token0Price(): Price; - /** - * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1 - */ - get token1Price(): Price; - /** - * Return the price of the given token in terms of the other token in the pool. - * @param token token to return price of - */ - priceOf(token: Token): Price; - /** - * Returns the chain ID of the tokens in the pool. - */ - get chainId(): ChainId | number; - /** - * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade - * @param inputAmount the input amount for which to quote the output amount - */ - getOutputAmount(inputAmount: CurrencyAmount, sqrtPriceLimitX96?: JSBI): Promise<[CurrencyAmount, Pool]>; - /** - * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade - * @param outputAmount the output amount for which to quote the input amount - */ - getInputAmount(outputAmount: CurrencyAmount, sqrtPriceLimitX96?: JSBI): Promise<[CurrencyAmount, Pool]>; - private swap; - get tickSpacing(): number; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/position.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/position.d.ts deleted file mode 100644 index fb662b55111..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/entities/position.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { BigintIsh, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'; -import JSBI from 'jsbi'; -import { Pool } from './pool'; -interface PositionConstructorArgs { - pool: Pool; - tickLower: number; - tickUpper: number; - liquidity: BigintIsh; -} -/** - * Represents a position on a Uniswap V3 Pool - */ -export declare class Position { - readonly pool: Pool; - readonly tickLower: number; - readonly tickUpper: number; - readonly liquidity: JSBI; - private _token0Amount; - private _token1Amount; - private _mintAmounts; - /** - * Constructs a position for a given pool with the given liquidity - * @param pool for which pool the liquidity is assigned - * @param liquidity the amount of liquidity that is in the position - * @param tickLower the lower tick of the position - * @param tickUpper the upper tick of the position - */ - constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs); - /** - * Returns the price of token0 at the lower tick - */ - get token0PriceLower(): Price; - /** - * Returns the price of token0 at the upper tick - */ - get token0PriceUpper(): Price; - /** - * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price - */ - get amount0(): CurrencyAmount; - /** - * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price - */ - get amount1(): CurrencyAmount; - /** - * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage - * @param slippageTolerance amount by which the price can 'slip' - * @private - */ - private ratiosAfterSlippage; - /** - * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position - * with the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the current price - */ - mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ - amount0: JSBI; - amount1: JSBI; - }>; - /** - * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the - * position with the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the current price - */ - burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ - amount0: JSBI; - amount1: JSBI; - }>; - /** - * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at - * the current price for the pool - */ - get mintAmounts(): Readonly<{ - amount0: JSBI; - amount1: JSBI; - }>; - /** - * Computes the maximum amount of liquidity received for a given amount of token0, token1, - * and the prices at the tick boundaries. - * @param pool the pool for which the position should be created - * @param tickLower the lower tick of the position - * @param tickUpper the upper tick of the position - * @param amount0 token0 amount - * @param amount1 token1 amount - * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ - static fromAmounts({ pool, tickLower, tickUpper, amount0, amount1, useFullPrecision }: { - pool: Pool; - tickLower: number; - tickUpper: number; - amount0: BigintIsh; - amount1: BigintIsh; - useFullPrecision: boolean; - }): Position; - /** - * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1 - * @param pool the pool for which the position is created - * @param tickLower the lower tick - * @param tickUpper the upper tick - * @param amount0 the desired amount of token0 - * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ - static fromAmount0({ pool, tickLower, tickUpper, amount0, useFullPrecision }: { - pool: Pool; - tickLower: number; - tickUpper: number; - amount0: BigintIsh; - useFullPrecision: boolean; - }): Position; - /** - * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0 - * @param pool the pool for which the position is created - * @param tickLower the lower tick - * @param tickUpper the upper tick - * @param amount1 the desired amount of token1 - */ - static fromAmount1({ pool, tickLower, tickUpper, amount1 }: { - pool: Pool; - tickLower: number; - tickUpper: number; - amount1: BigintIsh; - }): Position; -} -export {}; diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/route.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/route.d.ts deleted file mode 100644 index 6b669a1424e..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/entities/route.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ChainId, Currency, Price, Token } from '@uniswap/sdk-core'; -import { Pool } from './pool'; -/** - * Represents a list of pools through which a swap can occur - */ -export declare class Route { - readonly pools: Pool[]; - readonly tokenPath: Token[]; - readonly input: TInput; - readonly output: TOutput; - private _midPrice; - constructor(pools: Pool[], input: TInput, output: TOutput); - get chainId(): ChainId | number; - /** - * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token. - */ - get inputToken(): Token; - /** - * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token. - */ - get outputToken(): Token; - /** - * Returns the mid price of the route - */ - get midPrice(): Price; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/tick.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/tick.d.ts deleted file mode 100644 index 09111bde211..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/entities/tick.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import JSBI from 'jsbi'; -import { BigintIsh } from '@uniswap/sdk-core'; -export interface TickConstructorArgs { - index: number; - liquidityGross: BigintIsh; - liquidityNet: BigintIsh; -} -export declare class Tick { - readonly index: number; - readonly liquidityGross: JSBI; - readonly liquidityNet: JSBI; - constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs); -} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/tickDataProvider.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/tickDataProvider.d.ts deleted file mode 100644 index e4fe45d4f27..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/entities/tickDataProvider.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BigintIsh } from '@uniswap/sdk-core'; -/** - * Provides information about ticks - */ -export interface TickDataProvider { - /** - * Return information corresponding to a specific tick - * @param tick the tick to load - */ - getTick(tick: number): Promise<{ - liquidityNet: BigintIsh; - }>; - /** - * Return the next tick that is initialized within a single word - * @param tick the current tick - * @param lte whether the next tick should be lte the current tick - * @param tickSpacing the tick spacing of the pool - */ - nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>; -} -/** - * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you - * do not need to load tick data for your use case. - */ -export declare class NoTickDataProvider implements TickDataProvider { - private static ERROR_MESSAGE; - getTick(_tick: number): Promise<{ - liquidityNet: BigintIsh; - }>; - nextInitializedTickWithinOneWord(_tick: number, _lte: boolean, _tickSpacing: number): Promise<[number, boolean]>; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/tickListDataProvider.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/tickListDataProvider.d.ts deleted file mode 100644 index 5da766691cb..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/entities/tickListDataProvider.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { BigintIsh } from '@uniswap/sdk-core'; -import { Tick, TickConstructorArgs } from './tick'; -import { TickDataProvider } from './tickDataProvider'; -/** - * A data provider for ticks that is backed by an in-memory array of ticks. - */ -export declare class TickListDataProvider implements TickDataProvider { - private ticks; - constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number); - getTick(tick: number): Promise<{ - liquidityNet: BigintIsh; - liquidityGross: BigintIsh; - }>; - nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/entities/trade.d.ts b/uniswap-packages-forks/v3-sdk/dist/entities/trade.d.ts deleted file mode 100644 index eba5b5b5f82..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/entities/trade.d.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { Currency, Percent, Price, CurrencyAmount, TradeType } from '@uniswap/sdk-core'; -import { Pool } from './pool'; -import { Route } from './route'; -export declare function tradeComparator(a: Trade, b: Trade): number; -export interface BestTradeOptions { - maxNumResults?: number; - maxHops?: number; -} -/** - * Represents a trade executed against a list of pools. - * Does not account for slippage, i.e. trades that front run this trade and move the price. - */ -export declare class Trade { - /** - * The route of the trade, i.e. which pools the trade goes through. - */ - readonly route: Route; - /** - * The type of the trade, either exact in or exact out. - */ - readonly tradeType: TTradeType; - /** - * The input amount for the trade assuming no slippage. - */ - readonly inputAmount: CurrencyAmount; - /** - * The output amount for the trade assuming no slippage. - */ - readonly outputAmount: CurrencyAmount; - /** - * The cached result of the computed execution price - * @private - */ - private _executionPrice; - /** - * The price expressed in terms of output amount/input amount. - */ - get executionPrice(): Price; - /** - * The cached result of the price impact computation - * @private - */ - private _priceImpact; - /** - * Returns the percent difference between the route's mid price and the price impact - */ - get priceImpact(): Percent; - /** - * Constructs an exact in trade with the given amount in and route - * @param route route of the exact in trade - * @param amountIn the amount being passed in - */ - static exactIn(route: Route, amountIn: CurrencyAmount): Promise>; - /** - * Constructs an exact out trade with the given amount out and route - * @param route route of the exact out trade - * @param amountOut the amount returned by the trade - */ - static exactOut(route: Route, amountOut: CurrencyAmount): Promise>; - /** - * Constructs a trade by simulating swaps through the given route - * @param route route to swap through - * @param amount the amount specified, either input or output, depending on tradeType - * @param tradeType whether the trade is an exact input or exact output swap - */ - static fromRoute(route: Route, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount, tradeType: TTradeType): Promise>; - /** - * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade - * elsewhere and do not have any tick data - * @param constructorArguments the arguments passed to the trade constructor - */ - static createUncheckedTrade(constructorArguments: { - route: Route; - inputAmount: CurrencyAmount; - outputAmount: CurrencyAmount; - tradeType: TTradeType; - }): Trade; - /** - * Construct a trade by passing in the pre-computed property values - * @param route the route through which the trade occurs - * @param inputAmount the amount of input paid in the trade - * @param outputAmount the amount of output received in the trade - * @param tradeType the type of trade, exact input or exact output - */ - private constructor(); - /** - * Get the minimum amount that must be received from this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - minimumAmountOut(slippageTolerance: Percent): CurrencyAmount; - /** - * Get the maximum amount in that can be spent via this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - maximumAmountIn(slippageTolerance: Percent): CurrencyAmount; - /** - * Return the execution price after accounting for slippage tolerance - * @param slippageTolerance the allowed tolerated slippage - */ - worstExecutionPrice(slippageTolerance: Percent): Price; - /** - * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token - * amount to an output token, making at most `maxHops` hops. - * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pools the pools to consider in finding the best trade - * @param nextAmountIn exact amount of input currency to spend - * @param currencyOut the desired currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool - * @param currentPools used in recursion; the current list of pools - * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter - * @param bestTrades used in recursion; the current list of best trades - */ - static bestTradeExactIn(pools: Pool[], currencyAmountIn: CurrencyAmount, currencyOut: TOutput, { maxNumResults, maxHops }?: BestTradeOptions, currentPools?: Pool[], nextAmountIn?: CurrencyAmount, bestTrades?: Trade[]): Promise[]>; - /** - * similar to the above method but instead targets a fixed output amount - * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token - * to an output token amount, making at most `maxHops` hops - * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pools the pools to consider in finding the best trade - * @param currencyIn the currency to spend - * @param currencyAmountOut the desired currency amount out - * @param nextAmountOut the exact amount of currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool - * @param currentPools used in recursion; the current list of pools - * @param bestTrades used in recursion; the current list of best trades - */ - static bestTradeExactOut(pools: Pool[], currencyIn: Currency, currencyAmountOut: CurrencyAmount, { maxNumResults, maxHops }?: BestTradeOptions, currentPools?: Pool[], nextAmountOut?: CurrencyAmount, bestTrades?: Trade[]): Promise[]>; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/index.d.ts b/uniswap-packages-forks/v3-sdk/dist/index.d.ts deleted file mode 100644 index d15c4ceb3c8..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './entities'; -export * from './utils'; -export * from './constants'; -export * from './nonfungiblePositionManager'; -export * from './swapRouter'; diff --git a/uniswap-packages-forks/v3-sdk/dist/index.js b/uniswap-packages-forks/v3-sdk/dist/index.js deleted file mode 100644 index 75a03f96f26..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/index.js +++ /dev/null @@ -1,8 +0,0 @@ - -'use strict' - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./v3-sdk.cjs.production.min.js') -} else { - module.exports = require('./v3-sdk.cjs.development.js') -} diff --git a/uniswap-packages-forks/v3-sdk/dist/internalConstants.d.ts b/uniswap-packages-forks/v3-sdk/dist/internalConstants.d.ts deleted file mode 100644 index 7d0080c93e1..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/internalConstants.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import JSBI from 'jsbi'; -export declare const NEGATIVE_ONE: JSBI; -export declare const ZERO: JSBI; -export declare const ONE: JSBI; -export declare const Q96: JSBI; -export declare const Q192: JSBI; diff --git a/uniswap-packages-forks/v3-sdk/dist/nonfungiblePositionManager.d.ts b/uniswap-packages-forks/v3-sdk/dist/nonfungiblePositionManager.d.ts deleted file mode 100644 index b8b442050b2..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/nonfungiblePositionManager.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { BigintIsh, Percent, CurrencyAmount, Currency } from '@uniswap/sdk-core'; -import { Position } from './entities/position'; -import { MethodParameters } from './utils/calldata'; -import { Interface } from '@ethersproject/abi'; -import { PermitOptions, SelfPermit } from './selfPermit'; -export interface MintSpecificOptions { - /** - * The account that should receive the minted NFT. - */ - recipient: string; - /** - * Creates pool if not initialized before mint. - */ - createPool?: boolean; -} -export interface IncreaseSpecificOptions { - /** - * Indicates the ID of the position to increase liquidity for. - */ - tokenId: BigintIsh; -} -/** - * Options for producing the calldata to add liquidity. - */ -export interface CommonAddLiquidityOptions { - /** - * How much the pool price is allowed to move. - */ - slippageTolerance: Percent; - /** - * When the transaction expires, in epoch seconds. - */ - deadline: BigintIsh; - /** - * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false - */ - useEther?: boolean; - /** - * The optional permit parameters for spending token0 - */ - token0Permit?: PermitOptions; - /** - * The optional permit parameters for spending token1 - */ - token1Permit?: PermitOptions; -} -export declare type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions; -export declare type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions; -export declare type AddLiquidityOptions = MintOptions | IncreaseOptions; -export interface CollectOptions { - /** - * Indicates the ID of the position to collect for. - */ - tokenId: BigintIsh; - /** - * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned - */ - expectedCurrencyOwed0: CurrencyAmount; - /** - * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned - */ - expectedCurrencyOwed1: CurrencyAmount; - /** - * The account that should receive the tokens. - */ - recipient: string; -} -export interface NFTPermitOptions { - v: 0 | 1 | 27 | 28; - r: string; - s: string; - deadline: BigintIsh; - spender: string; -} -/** - * Options for producing the calldata to exit a position. - */ -export interface RemoveLiquidityOptions { - /** - * The ID of the token to exit - */ - tokenId: BigintIsh; - /** - * The percentage of position liquidity to exit. - */ - liquidityPercentage: Percent; - /** - * How much the pool price is allowed to move. - */ - slippageTolerance: Percent; - /** - * When the transaction expires, in epoch seconds. - */ - deadline: BigintIsh; - /** - * Whether the NFT should be burned if the entire position is being exited, by default false. - */ - burnToken?: boolean; - /** - * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT - */ - permit?: NFTPermitOptions; - /** - * Parameters to be passed on to collect - */ - collectOptions: Omit; -} -export declare abstract class NonfungiblePositionManager extends SelfPermit { - static INTERFACE: Interface; - /** - * Cannot be constructed. - */ - private constructor(); - static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters; - private static encodeCollect; - static collectCallParameters(options: CollectOptions): MethodParameters; - /** - * Produces the calldata for completely or partially exiting a position - * @param position the position to exit - * @param options additional information necessary for generating the calldata - */ - static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/selfPermit.d.ts b/uniswap-packages-forks/v3-sdk/dist/selfPermit.d.ts deleted file mode 100644 index e4ea1fd8f6b..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/selfPermit.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { BigintIsh, Token } from '@uniswap/sdk-core'; -import { Interface } from '@ethersproject/abi'; -export interface StandardPermitArguments { - v: 0 | 1 | 27 | 28; - r: string; - s: string; - amount: BigintIsh; - deadline: BigintIsh; -} -export interface AllowedPermitArguments { - v: 0 | 1 | 27 | 28; - r: string; - s: string; - nonce: BigintIsh; - expiry: BigintIsh; -} -export declare type PermitOptions = StandardPermitArguments | AllowedPermitArguments; -export declare abstract class SelfPermit { - static INTERFACE: Interface; - protected constructor(); - protected static encodePermit(token: Token, options: PermitOptions): string; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/swapRouter.d.ts b/uniswap-packages-forks/v3-sdk/dist/swapRouter.d.ts deleted file mode 100644 index e7887de28af..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/swapRouter.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Interface } from '@ethersproject/abi'; -import { BigintIsh, Currency, Percent, TradeType } from '@uniswap/sdk-core'; -import { Trade } from './entities/trade'; -import { PermitOptions, SelfPermit } from './selfPermit'; -import { MethodParameters } from './utils/calldata'; -export interface FeeOptions { - /** - * The percent of the output that will be taken as a fee. - */ - fee: Percent; - /** - * The recipient of the fee. - */ - recipient: string; -} -/** - * Options for producing the arguments to send calls to the router. - */ -export interface SwapOptions { - /** - * How much the execution price is allowed to move unfavorably from the trade execution price. - */ - slippageTolerance: Percent; - /** - * The account that should receive the output. - */ - recipient: string; - /** - * When the transaction expires, in epoch seconds. - */ - deadline: BigintIsh; - /** - * The optional permit parameters for spending the input. - */ - inputTokenPermit?: PermitOptions; - /** - * The optional price limit for the trade. - */ - sqrtPriceLimitX96?: BigintIsh; - /** - * Optional information for taking a fee on output. - */ - fee?: FeeOptions; -} -/** - * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades. - */ -export declare abstract class SwapRouter extends SelfPermit { - static INTERFACE: Interface; - /** - * Cannot be constructed. - */ - private constructor(); - /** - * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. - * @param trade to produce call parameters for - * @param options options for the call parameters - */ - static swapCallParameters(trade: Trade, options: SwapOptions): MethodParameters; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/calldata.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/calldata.d.ts deleted file mode 100644 index 809c60841e9..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/calldata.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { BigintIsh } from '@uniswap/sdk-core'; -/** - * Generated method parameters for executing a call. - */ -export interface MethodParameters { - /** - * The hex encoded calldata to perform the given operation - */ - calldata: string; - /** - * The amount of ether (wei) to send in hex. - */ - value: string; -} -export declare function toHex(bigintIsh: BigintIsh): string; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/computePoolAddress.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/computePoolAddress.d.ts deleted file mode 100644 index 8e089714c0c..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/computePoolAddress.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Token } from '@uniswap/sdk-core'; -import { FeeAmount } from '../constants'; -export declare function computePoolAddress({ factoryAddress, tokenA, tokenB, fee }: { - factoryAddress: string; - tokenA: Token; - tokenB: Token; - fee: FeeAmount; -}): string; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/encodeRouteToPath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/encodeRouteToPath.d.ts deleted file mode 100644 index 4a8180268fd..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/encodeRouteToPath.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Currency } from '@uniswap/sdk-core'; -import { Route } from '../entities/route'; -/** - * Converts a route to a hex encoded path - * @param route the v3 path to convert to an encoded path - * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps - */ -export declare function encodeRouteToPath(route: Route, exactOutput: boolean): string; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts deleted file mode 100644 index e51a815ccfb..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/encodeSqrtRatioX96.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import JSBI from 'jsbi'; -import { BigintIsh } from '@uniswap/sdk-core'; -/** - * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0 - * @param amount1 the numerator amount, i.e. amount of token1 - * @param amount0 the denominator amount, i.en amount of token0 - */ -export declare function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/fullMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/fullMath.d.ts deleted file mode 100644 index 7dc3f165793..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/fullMath.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import JSBI from 'jsbi'; -export declare abstract class FullMath { - /** - * Cannot be constructed. - */ - private constructor(); - static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/index.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/index.d.ts deleted file mode 100644 index fbac3347e55..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from './calldata'; -export * from './computePoolAddress'; -export * from './encodeRouteToPath'; -export * from './encodeSqrtRatioX96'; -export * from './fullMath'; -export * from './isSorted'; -export * from './liquidityMath'; -export * from './maxLiquidityForAmounts'; -export * from './mostSignificantBit'; -export * from './nearestUsableTick'; -export * from './priceTickConversions'; -export * from './sqrtPriceMath'; -export * from './tickMath'; -export * from './tickList'; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/isSorted.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/isSorted.d.ts deleted file mode 100644 index 6e7de016178..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/isSorted.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/liquidityMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/liquidityMath.d.ts deleted file mode 100644 index d30a468476d..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/liquidityMath.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import JSBI from 'jsbi'; -export declare abstract class LiquidityMath { - /** - * Cannot be constructed. - */ - private constructor(); - static addDelta(x: JSBI, y: JSBI): JSBI; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/maxLiquidityForAmounts.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/maxLiquidityForAmounts.d.ts deleted file mode 100644 index 126477ce35a..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/maxLiquidityForAmounts.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BigintIsh } from '@uniswap/sdk-core'; -import JSBI from 'jsbi'; -/** - * Computes the maximum amount of liquidity received for a given amount of token0, token1, - * and the prices at the tick boundaries. - * @param sqrtRatioCurrentX96 the current price - * @param sqrtRatioAX96 price at lower boundary - * @param sqrtRatioBX96 price at upper boundary - * @param amount0 token0 amount - * @param amount1 token1 amount - * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ -export declare function maxLiquidityForAmounts(sqrtRatioCurrentX96: JSBI, sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh, amount1: BigintIsh, useFullPrecision: boolean): JSBI; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/mostSignificantBit.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/mostSignificantBit.d.ts deleted file mode 100644 index 151cce9e8ae..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/mostSignificantBit.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import JSBI from 'jsbi'; -export declare function mostSignificantBit(x: JSBI): number; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/nearestUsableTick.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/nearestUsableTick.d.ts deleted file mode 100644 index eeb1c51d2da..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/nearestUsableTick.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Returns the closest tick that is nearest a given tick and usable for the given tick spacing - * @param tick the target tick - * @param tickSpacing the spacing of the pool - */ -export declare function nearestUsableTick(tick: number, tickSpacing: number): number; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/priceTickConversions.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/priceTickConversions.d.ts deleted file mode 100644 index e9179b296e9..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/priceTickConversions.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Price, Token } from '@uniswap/sdk-core'; -/** - * Returns a price object corresponding to the input tick and the base/quote token - * Inputs must be tokens because the address order is used to interpret the price represented by the tick - * @param baseToken the base token of the price - * @param quoteToken the quote token of the price - * @param tick the tick for which to return the price - */ -export declare function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price; -/** - * Returns the first tick for which the given price is greater than or equal to the tick price - * @param price for which to return the closest tick that represents a price less than or equal to the input price, - * i.e. the price of the returned tick is less than or equal to the input price - */ -export declare function priceToClosestTick(price: Price): number; diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/sqrtPriceMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/sqrtPriceMath.d.ts deleted file mode 100644 index da01c181216..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/sqrtPriceMath.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import JSBI from 'jsbi'; -export declare abstract class SqrtPriceMath { - /** - * Cannot be constructed. - */ - private constructor(); - static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI; - static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI; - static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI; - static getNextSqrtPriceFromOutput(sqrtPX96: JSBI, liquidity: JSBI, amountOut: JSBI, zeroForOne: boolean): JSBI; - private static getNextSqrtPriceFromAmount0RoundingUp; - private static getNextSqrtPriceFromAmount1RoundingDown; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/swapMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/swapMath.d.ts deleted file mode 100644 index ec6f962043e..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/swapMath.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import JSBI from 'jsbi'; -import { FeeAmount } from '../constants'; -export declare abstract class SwapMath { - /** - * Cannot be constructed. - */ - private constructor(); - static computeSwapStep(sqrtRatioCurrentX96: JSBI, sqrtRatioTargetX96: JSBI, liquidity: JSBI, amountRemaining: JSBI, feePips: FeeAmount): [JSBI, JSBI, JSBI, JSBI]; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/tickList.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/tickList.d.ts deleted file mode 100644 index b022f92dc3c..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/tickList.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Tick } from '../entities/tick'; -/** - * Utility methods for interacting with sorted lists of ticks - */ -export declare abstract class TickList { - /** - * Cannot be constructed - */ - private constructor(); - static validateList(ticks: Tick[], tickSpacing: number): void; - static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean; - static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean; - static getTick(ticks: readonly Tick[], index: number): Tick; - /** - * Finds the largest tick in the list of ticks that is less than or equal to tick - * @param ticks list of ticks - * @param tick tick to find the largest tick that is less than or equal to tick - * @private - */ - private static binarySearch; - static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick; - static nextInitializedTickWithinOneWord(ticks: readonly Tick[], tick: number, lte: boolean, tickSpacing: number): [number, boolean]; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/utils/tickMath.d.ts b/uniswap-packages-forks/v3-sdk/dist/utils/tickMath.d.ts deleted file mode 100644 index fb7e763a622..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/utils/tickMath.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import JSBI from 'jsbi'; -export declare abstract class TickMath { - /** - * Cannot be constructed. - */ - private constructor(); - /** - * The minimum tick that can be used on any pool. - */ - static MIN_TICK: number; - /** - * The maximum tick that can be used on any pool. - */ - static MAX_TICK: number; - /** - * The sqrt ratio corresponding to the minimum tick that could be used on any pool. - */ - static MIN_SQRT_RATIO: JSBI; - /** - * The sqrt ratio corresponding to the maximum tick that could be used on any pool. - */ - static MAX_SQRT_RATIO: JSBI; - /** - * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick - * @param tick the tick for which to compute the sqrt ratio - */ - static getSqrtRatioAtTick(tick: number): JSBI; - /** - * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96 - * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96 - * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick - */ - static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number; -} diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js deleted file mode 100644 index ab463a7b1b8..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js +++ /dev/null @@ -1,3389 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var sdkCore = require('@uniswap/sdk-core'); -var JSBI = _interopDefault(require('jsbi')); -var invariant = _interopDefault(require('tiny-invariant')); -var abi = require('@ethersproject/abi'); -var address = require('@ethersproject/address'); -var solidity = require('@ethersproject/solidity'); -var NonfungiblePositionManager_json = require('@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'); -var ISelfPermit_json = require('@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'); -var SwapRouter_json = require('@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'); - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -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) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} - -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var runtime_1 = createCommonjsModule(function (module) { -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -var runtime = (function (exports) { - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined$1; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - function define(obj, key, value) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - return obj[key]; - } - try { - // IE 8 has a broken Object.defineProperty that only works on DOM objects. - define({}, ""); - } catch (err) { - define = function(obj, key, value) { - return obj[key] = value; - }; - } - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return generator; - } - exports.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = - Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunction.displayName = define( - GeneratorFunctionPrototype, - toStringTagSymbol, - "GeneratorFunction" - ); - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - define(prototype, method, function(arg) { - return this._invoke(method, arg); - }); - }); - } - - exports.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - exports.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - define(genFun, toStringTagSymbol, "GeneratorFunction"); - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - exports.awrap = function(arg) { - return { __await: arg }; - }; - - function AsyncIterator(generator, PromiseImpl) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && - typeof value === "object" && - hasOwn.call(value, "__await")) { - return PromiseImpl.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - - return PromiseImpl.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, function(error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke("throw", error, resolve, reject); - }); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new PromiseImpl(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - exports.AsyncIterator = AsyncIterator; - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { - if (PromiseImpl === void 0) PromiseImpl = Promise; - - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList), - PromiseImpl - ); - - return exports.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } - - // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined$1) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined$1; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined$1; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - define(Gp, toStringTagSymbol, "Generator"); - - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function() { - return this; - }; - - Gp.toString = function() { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - exports.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined$1; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - // Return an iterator with no values. - return { next: doneResult }; - } - exports.values = values; - - function doneResult() { - return { value: undefined$1, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined$1; - this.done = false; - this.delegate = null; - - this.method = "next"; - this.arg = undefined$1; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined$1; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined$1; - } - - return !! caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined$1; - } - - return ContinueSentinel; - } - }; - - // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; - -}( - // If this script is executing as a CommonJS module, use module.exports - // as the regeneratorRuntime namespace. Otherwise create a new empty - // object. Either way, the resulting object will be used to initialize - // the regeneratorRuntime variable at the top of this file. - module.exports -)); - -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); -} -}); - -var _TICK_SPACINGS; - -var FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'; -var ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'; -var POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'; - -(function (FeeAmount) { - FeeAmount[FeeAmount["LOW"] = 500] = "LOW"; - FeeAmount[FeeAmount["MEDIUM"] = 3000] = "MEDIUM"; - FeeAmount[FeeAmount["HIGH"] = 10000] = "HIGH"; -})(exports.FeeAmount || (exports.FeeAmount = {})); -/** - * The default factory tick spacings by fee amount. - */ - - -var TICK_SPACINGS = (_TICK_SPACINGS = {}, _TICK_SPACINGS[exports.FeeAmount.LOW] = 10, _TICK_SPACINGS[exports.FeeAmount.MEDIUM] = 60, _TICK_SPACINGS[exports.FeeAmount.HIGH] = 200, _TICK_SPACINGS); - -var NEGATIVE_ONE = /*#__PURE__*/JSBI.BigInt(-1); -var ZERO = /*#__PURE__*/JSBI.BigInt(0); -var ONE = /*#__PURE__*/JSBI.BigInt(1); // used in liquidity amount math - -var Q96 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(96)); -var Q192 = /*#__PURE__*/JSBI.exponentiate(Q96, /*#__PURE__*/JSBI.BigInt(2)); - -function computePoolAddress(_ref) { - var factoryAddress = _ref.factoryAddress, - tokenA = _ref.tokenA, - tokenB = _ref.tokenB, - fee = _ref.fee; - - var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], - token0 = _ref2[0], - token1 = _ref2[1]; // does safety checks - - - return address.getCreate2Address(factoryAddress, solidity.keccak256(['bytes'], [abi.defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]), POOL_INIT_CODE_HASH); -} - -var LiquidityMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function LiquidityMath() {} - - LiquidityMath.addDelta = function addDelta(x, y) { - if (JSBI.lessThan(y, ZERO)) { - return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE)); - } else { - return JSBI.add(x, y); - } - }; - - return LiquidityMath; -}(); - -var FullMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function FullMath() {} - - FullMath.mulDivRoundingUp = function mulDivRoundingUp(a, b, denominator) { - var product = JSBI.multiply(a, b); - var result = JSBI.divide(product, denominator); - if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE); - return result; - }; - - return FullMath; -}(); - -var MaxUint160 = /*#__PURE__*/JSBI.subtract( /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(160)), ONE); - -function multiplyIn256(x, y) { - var product = JSBI.multiply(x, y); - return JSBI.bitwiseAnd(product, sdkCore.MaxUint256); -} - -function addIn256(x, y) { - var sum = JSBI.add(x, y); - return JSBI.bitwiseAnd(sum, sdkCore.MaxUint256); -} - -var SqrtPriceMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function SqrtPriceMath() {} - - SqrtPriceMath.getAmount0Delta = function getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, liquidity, roundUp) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref[0]; - sqrtRatioBX96 = _ref[1]; - } - - var numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96)); - var numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96); - return roundUp ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96) : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96); - }; - - SqrtPriceMath.getAmount1Delta = function getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, liquidity, roundUp) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref2 = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref2[0]; - sqrtRatioBX96 = _ref2[1]; - } - - return roundUp ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96) : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96); - }; - - SqrtPriceMath.getNextSqrtPriceFromInput = function getNextSqrtPriceFromInput(sqrtPX96, liquidity, amountIn, zeroForOne) { - !JSBI.greaterThan(sqrtPX96, ZERO) ? invariant(false) : void 0; - !JSBI.greaterThan(liquidity, ZERO) ? invariant(false) : void 0; - return zeroForOne ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true) : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true); - }; - - SqrtPriceMath.getNextSqrtPriceFromOutput = function getNextSqrtPriceFromOutput(sqrtPX96, liquidity, amountOut, zeroForOne) { - !JSBI.greaterThan(sqrtPX96, ZERO) ? invariant(false) : void 0; - !JSBI.greaterThan(liquidity, ZERO) ? invariant(false) : void 0; - return zeroForOne ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false) : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false); - }; - - SqrtPriceMath.getNextSqrtPriceFromAmount0RoundingUp = function getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amount, add) { - if (JSBI.equal(amount, ZERO)) return sqrtPX96; - var numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96)); - - if (add) { - var product = multiplyIn256(amount, sqrtPX96); - - if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) { - var denominator = addIn256(numerator1, product); - - if (JSBI.greaterThanOrEqual(denominator, numerator1)) { - return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator); - } - } - - return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount)); - } else { - var _product = multiplyIn256(amount, sqrtPX96); - - !JSBI.equal(JSBI.divide(_product, amount), sqrtPX96) ? invariant(false) : void 0; - !JSBI.greaterThan(numerator1, _product) ? invariant(false) : void 0; - - var _denominator = JSBI.subtract(numerator1, _product); - - return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, _denominator); - } - }; - - SqrtPriceMath.getNextSqrtPriceFromAmount1RoundingDown = function getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amount, add) { - if (add) { - var quotient = JSBI.lessThanOrEqual(amount, MaxUint160) ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity) : JSBI.divide(JSBI.multiply(amount, Q96), liquidity); - return JSBI.add(sqrtPX96, quotient); - } else { - var _quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity); - - !JSBI.greaterThan(sqrtPX96, _quotient) ? invariant(false) : void 0; - return JSBI.subtract(sqrtPX96, _quotient); - } - }; - - return SqrtPriceMath; -}(); - -var MAX_FEE = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(10), /*#__PURE__*/JSBI.BigInt(6)); -var SwapMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function SwapMath() {} - - SwapMath.computeSwapStep = function computeSwapStep(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, amountRemaining, feePips) { - var returnValues = {}; - var zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96); - var exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO); - - if (exactIn) { - var amountRemainingLessFee = JSBI.divide(JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))), MAX_FEE); - returnValues.amountIn = zeroForOne ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true) : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true); - - if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn)) { - returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96; - } else { - returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(sqrtRatioCurrentX96, liquidity, amountRemainingLessFee, zeroForOne); - } - } else { - returnValues.amountOut = zeroForOne ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false) : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false); - - if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) { - returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96; - } else { - returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtRatioCurrentX96, liquidity, JSBI.multiply(amountRemaining, NEGATIVE_ONE), zeroForOne); - } - } - - var max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96); - - if (zeroForOne) { - returnValues.amountIn = max && exactIn ? returnValues.amountIn : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true); - returnValues.amountOut = max && !exactIn ? returnValues.amountOut : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false); - } else { - returnValues.amountIn = max && exactIn ? returnValues.amountIn : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true); - returnValues.amountOut = max && !exactIn ? returnValues.amountOut : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false); - } - - if (!exactIn && JSBI.greaterThan(returnValues.amountOut, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) { - returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE); - } - - if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) { - // we didn't reach the target, so take the remainder of the maximum input as fee - returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn); - } else { - returnValues.feeAmount = FullMath.mulDivRoundingUp(returnValues.amountIn, JSBI.BigInt(feePips), JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))); - } - - return [returnValues.sqrtRatioNextX96, returnValues.amountIn, returnValues.amountOut, returnValues.feeAmount]; - }; - - return SwapMath; -}(); - -var TWO = /*#__PURE__*/JSBI.BigInt(2); -var POWERS_OF_2 = /*#__PURE__*/[128, 64, 32, 16, 8, 4, 2, 1].map(function (pow) { - return [pow, JSBI.exponentiate(TWO, JSBI.BigInt(pow))]; -}); -function mostSignificantBit(x) { - !JSBI.greaterThan(x, ZERO) ? invariant(false, 'ZERO') : void 0; - !JSBI.lessThanOrEqual(x, sdkCore.MaxUint256) ? invariant(false, 'MAX') : void 0; - var msb = 0; - - for (var _iterator = _createForOfIteratorHelperLoose(POWERS_OF_2), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - power = _step$value[0], - min = _step$value[1]; - - if (JSBI.greaterThanOrEqual(x, min)) { - x = JSBI.signedRightShift(x, JSBI.BigInt(power)); - msb += power; - } - } - - return msb; -} - -function mulShift(val, mulBy) { - return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128)); -} - -var Q32 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(32)); -var TickMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function TickMath() {} - /** - * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick - * @param tick the tick for which to compute the sqrt ratio - */ - - - TickMath.getSqrtRatioAtTick = function getSqrtRatioAtTick(tick) { - !(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick)) ? invariant(false, 'TICK') : void 0; - var absTick = tick < 0 ? tick * -1 : tick; - var ratio = (absTick & 0x1) != 0 ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001') : JSBI.BigInt('0x100000000000000000000000000000000'); - if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a'); - if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc'); - if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0'); - if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644'); - if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0'); - if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861'); - if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053'); - if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4'); - if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54'); - if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3'); - if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9'); - if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825'); - if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5'); - if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7'); - if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6'); - if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9'); - if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604'); - if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98'); - if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2'); - if (tick > 0) ratio = JSBI.divide(sdkCore.MaxUint256, ratio); // back to Q96 - - return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO) ? JSBI.add(JSBI.divide(ratio, Q32), ONE) : JSBI.divide(ratio, Q32); - } - /** - * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96 - * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96 - * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick - */ - ; - - TickMath.getTickAtSqrtRatio = function getTickAtSqrtRatio(sqrtRatioX96) { - !(JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) && JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO)) ? invariant(false, 'SQRT_RATIO') : void 0; - var sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32)); - var msb = mostSignificantBit(sqrtRatioX128); - var r; - - if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) { - r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127)); - } else { - r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb)); - } - - var log_2 = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64)); - - for (var i = 0; i < 14; i++) { - r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127)); - var f = JSBI.signedRightShift(r, JSBI.BigInt(128)); - log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i))); - r = JSBI.signedRightShift(r, f); - } - - var log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141')); - var tickLow = JSBI.toNumber(JSBI.signedRightShift(JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')), JSBI.BigInt(128))); - var tickHigh = JSBI.toNumber(JSBI.signedRightShift(JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')), JSBI.BigInt(128))); - return tickLow === tickHigh ? tickLow : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96) ? tickHigh : tickLow; - }; - - return TickMath; -}(); -/** - * The minimum tick that can be used on any pool. - */ - -TickMath.MIN_TICK = -887272; -/** - * The maximum tick that can be used on any pool. - */ - -TickMath.MAX_TICK = -TickMath.MIN_TICK; -/** - * The sqrt ratio corresponding to the minimum tick that could be used on any pool. - */ - -TickMath.MIN_SQRT_RATIO = /*#__PURE__*/JSBI.BigInt('4295128739'); -/** - * The sqrt ratio corresponding to the maximum tick that could be used on any pool. - */ - -TickMath.MAX_SQRT_RATIO = /*#__PURE__*/JSBI.BigInt('1461446703485210103287273052203988822378723970342'); - -/** - * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you - * do not need to load tick data for your use case. - */ -var NoTickDataProvider = /*#__PURE__*/function () { - function NoTickDataProvider() {} - - var _proto = NoTickDataProvider.prototype; - - _proto.getTick = /*#__PURE__*/function () { - var _getTick = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_tick) { - return runtime_1.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - throw new Error(NoTickDataProvider.ERROR_MESSAGE); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - function getTick(_x) { - return _getTick.apply(this, arguments); - } - - return getTick; - }(); - - _proto.nextInitializedTickWithinOneWord = /*#__PURE__*/function () { - var _nextInitializedTickWithinOneWord = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(_tick, _lte, _tickSpacing) { - return runtime_1.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - throw new Error(NoTickDataProvider.ERROR_MESSAGE); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); - - function nextInitializedTickWithinOneWord(_x2, _x3, _x4) { - return _nextInitializedTickWithinOneWord.apply(this, arguments); - } - - return nextInitializedTickWithinOneWord; - }(); - - return NoTickDataProvider; -}(); -NoTickDataProvider.ERROR_MESSAGE = 'No tick data provider was given'; - -function isSorted(list, comparator) { - for (var i = 0; i < list.length - 1; i++) { - if (comparator(list[i], list[i + 1]) > 0) { - return false; - } - } - - return true; -} - -function tickComparator(a, b) { - return a.index - b.index; -} -/** - * Utility methods for interacting with sorted lists of ticks - */ - - -var TickList = /*#__PURE__*/function () { - /** - * Cannot be constructed - */ - function TickList() {} - - TickList.validateList = function validateList(ticks, tickSpacing) { - !(tickSpacing > 0) ? invariant(false, 'TICK_SPACING_NONZERO') : void 0; // ensure ticks are spaced appropriately - - !ticks.every(function (_ref) { - var index = _ref.index; - return index % tickSpacing === 0; - }) ? invariant(false, 'TICK_SPACING') : void 0; // ensure tick liquidity deltas sum to 0 - - !JSBI.equal(ticks.reduce(function (accumulator, _ref2) { - var liquidityNet = _ref2.liquidityNet; - return JSBI.add(accumulator, liquidityNet); - }, ZERO), ZERO) ? invariant(false, 'ZERO_NET') : void 0; - !isSorted(ticks, tickComparator) ? invariant(false, 'SORTED') : void 0; - }; - - TickList.isBelowSmallest = function isBelowSmallest(ticks, tick) { - !(ticks.length > 0) ? invariant(false, 'LENGTH') : void 0; - return tick < ticks[0].index; - }; - - TickList.isAtOrAboveLargest = function isAtOrAboveLargest(ticks, tick) { - !(ticks.length > 0) ? invariant(false, 'LENGTH') : void 0; - return tick >= ticks[ticks.length - 1].index; - }; - - TickList.getTick = function getTick(ticks, index) { - var tick = ticks[this.binarySearch(ticks, index)]; - !(tick.index === index) ? invariant(false, 'NOT_CONTAINED') : void 0; - return tick; - } - /** - * Finds the largest tick in the list of ticks that is less than or equal to tick - * @param ticks list of ticks - * @param tick tick to find the largest tick that is less than or equal to tick - * @private - */ - ; - - TickList.binarySearch = function binarySearch(ticks, tick) { - !!this.isBelowSmallest(ticks, tick) ? invariant(false, 'BELOW_SMALLEST') : void 0; - var l = 0; - var r = ticks.length - 1; - var i; - - while (true) { - i = Math.floor((l + r) / 2); - - if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) { - return i; - } - - if (ticks[i].index < tick) { - l = i + 1; - } else { - r = i - 1; - } - } - }; - - TickList.nextInitializedTick = function nextInitializedTick(ticks, tick, lte) { - if (lte) { - !!TickList.isBelowSmallest(ticks, tick) ? invariant(false, 'BELOW_SMALLEST') : void 0; - - if (TickList.isAtOrAboveLargest(ticks, tick)) { - return ticks[ticks.length - 1]; - } - - var index = this.binarySearch(ticks, tick); - return ticks[index]; - } else { - !!this.isAtOrAboveLargest(ticks, tick) ? invariant(false, 'AT_OR_ABOVE_LARGEST') : void 0; - - if (this.isBelowSmallest(ticks, tick)) { - return ticks[0]; - } - - var _index = this.binarySearch(ticks, tick); - - return ticks[_index + 1]; - } - }; - - TickList.nextInitializedTickWithinOneWord = function nextInitializedTickWithinOneWord(ticks, tick, lte, tickSpacing) { - var compressed = Math.floor(tick / tickSpacing); // matches rounding in the code - - if (lte) { - var wordPos = compressed >> 8; - var minimum = (wordPos << 8) * tickSpacing; - - if (TickList.isBelowSmallest(ticks, tick)) { - return [minimum, false]; - } - - var index = TickList.nextInitializedTick(ticks, tick, lte).index; - var nextInitializedTick = Math.max(minimum, index); - return [nextInitializedTick, nextInitializedTick === index]; - } else { - var _wordPos = compressed + 1 >> 8; - - var maximum = (_wordPos + 1 << 8) * tickSpacing - 1; - - if (this.isAtOrAboveLargest(ticks, tick)) { - return [maximum, false]; - } - - var _index2 = this.nextInitializedTick(ticks, tick, lte).index; - - var _nextInitializedTick = Math.min(maximum, _index2); - - return [_nextInitializedTick, _nextInitializedTick === _index2]; - } - }; - - return TickList; -}(); - -function toHex(bigintIsh) { - var bigInt = JSBI.BigInt(bigintIsh); - var hex = bigInt.toString(16); - - if (hex.length % 2 !== 0) { - hex = "0" + hex; - } - - return "0x" + hex; -} - -/** - * Converts a route to a hex encoded path - * @param route the v3 path to convert to an encoded path - * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps - */ - -function encodeRouteToPath(route, exactOutput) { - var firstInputToken = sdkCore.wrappedCurrency(route.input, route.chainId); - - var _route$pools$reduce = route.pools.reduce(function (_ref, pool, index) { - var inputToken = _ref.inputToken, - path = _ref.path, - types = _ref.types; - var outputToken = pool.token0.equals(inputToken) ? pool.token1 : pool.token0; - - if (index === 0) { - return { - inputToken: outputToken, - types: ['address', 'uint24', 'address'], - path: [inputToken.address, pool.fee, outputToken.address] - }; - } else { - return { - inputToken: outputToken, - types: [].concat(types, ['uint24', 'address']), - path: [].concat(path, [pool.fee, outputToken.address]) - }; - } - }, { - inputToken: firstInputToken, - path: [], - types: [] - }), - path = _route$pools$reduce.path, - types = _route$pools$reduce.types; - - return exactOutput ? solidity.pack(types.reverse(), path.reverse()) : solidity.pack(types, path); -} - -/** - * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0 - * @param amount1 the numerator amount, i.e. amount of token1 - * @param amount0 the denominator amount, i.en amount of token0 - */ - -function encodeSqrtRatioX96(amount1, amount0) { - var numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192)); - var denominator = JSBI.BigInt(amount0); - var ratioX192 = JSBI.divide(numerator, denominator); - return sdkCore.sqrt(ratioX192); -} - -function maxLiquidityForAmount0Imprecise(sqrtRatioAX96, sqrtRatioBX96, amount0) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref[0]; - sqrtRatioBX96 = _ref[1]; - } - - var intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96); - return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); -} - -function maxLiquidityForAmount0Precise(sqrtRatioAX96, sqrtRatioBX96, amount0) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref2 = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref2[0]; - sqrtRatioBX96 = _ref2[1]; - } - - var numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96); - var denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); - return JSBI.divide(numerator, denominator); -} - -function maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref3 = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref3[0]; - sqrtRatioBX96 = _ref3[1]; - } - - return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); -} -/** - * Computes the maximum amount of liquidity received for a given amount of token0, token1, - * and the prices at the tick boundaries. - * @param sqrtRatioCurrentX96 the current price - * @param sqrtRatioAX96 price at lower boundary - * @param sqrtRatioBX96 price at upper boundary - * @param amount0 token0 amount - * @param amount1 token1 amount - * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ - - -function maxLiquidityForAmounts(sqrtRatioCurrentX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1, useFullPrecision) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref4 = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref4[0]; - sqrtRatioBX96 = _ref4[1]; - } - - var maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise; - - if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) { - return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0); - } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) { - var liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0); - var liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1); - return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1; - } else { - return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1); - } -} - -/** - * Returns the closest tick that is nearest a given tick and usable for the given tick spacing - * @param tick the target tick - * @param tickSpacing the spacing of the pool - */ - -function nearestUsableTick(tick, tickSpacing) { - !(Number.isInteger(tick) && Number.isInteger(tickSpacing)) ? invariant(false, 'INTEGERS') : void 0; - !(tickSpacing > 0) ? invariant(false, 'TICK_SPACING') : void 0; - !(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK) ? invariant(false, 'TICK_BOUND') : void 0; - var rounded = Math.round(tick / tickSpacing) * tickSpacing; - if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing;else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing;else return rounded; -} - -/** - * Returns a price object corresponding to the input tick and the base/quote token - * Inputs must be tokens because the address order is used to interpret the price represented by the tick - * @param baseToken the base token of the price - * @param quoteToken the quote token of the price - * @param tick the tick for which to return the price - */ - -function tickToPrice(baseToken, quoteToken, tick) { - var sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick); - var ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96); - return baseToken.sortsBefore(quoteToken) ? new sdkCore.Price(baseToken, quoteToken, Q192, ratioX192) : new sdkCore.Price(baseToken, quoteToken, ratioX192, Q192); -} -/** - * Returns the first tick for which the given price is greater than or equal to the tick price - * @param price for which to return the closest tick that represents a price less than or equal to the input price, - * i.e. the price of the returned tick is less than or equal to the input price - */ - -function priceToClosestTick(price) { - var sorted = price.baseCurrency.sortsBefore(price.quoteCurrency); - var sqrtRatioX96 = sorted ? encodeSqrtRatioX96(price.numerator, price.denominator) : encodeSqrtRatioX96(price.denominator, price.numerator); - var tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96); - var nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1); - - if (sorted) { - if (!price.lessThan(nextTickPrice)) { - tick++; - } - } else { - if (!price.greaterThan(nextTickPrice)) { - tick++; - } - } - - return tick; -} - -var Tick = function Tick(_ref) { - var index = _ref.index, - liquidityGross = _ref.liquidityGross, - liquidityNet = _ref.liquidityNet; - !(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK) ? invariant(false, 'TICK') : void 0; - this.index = index; - this.liquidityGross = JSBI.BigInt(liquidityGross); - this.liquidityNet = JSBI.BigInt(liquidityNet); -}; - -/** - * A data provider for ticks that is backed by an in-memory array of ticks. - */ - -var TickListDataProvider = /*#__PURE__*/function () { - function TickListDataProvider(ticks, tickSpacing) { - var ticksMapped = ticks.map(function (t) { - return t instanceof Tick ? t : new Tick(t); - }); - TickList.validateList(ticksMapped, tickSpacing); - this.ticks = ticksMapped; - } - - var _proto = TickListDataProvider.prototype; - - _proto.getTick = /*#__PURE__*/function () { - var _getTick = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(tick) { - return runtime_1.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - return _context.abrupt("return", TickList.getTick(this.ticks, tick)); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function getTick(_x) { - return _getTick.apply(this, arguments); - } - - return getTick; - }(); - - _proto.nextInitializedTickWithinOneWord = /*#__PURE__*/function () { - var _nextInitializedTickWithinOneWord = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(tick, lte, tickSpacing) { - return runtime_1.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - return _context2.abrupt("return", TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function nextInitializedTickWithinOneWord(_x2, _x3, _x4) { - return _nextInitializedTickWithinOneWord.apply(this, arguments); - } - - return nextInitializedTickWithinOneWord; - }(); - - return TickListDataProvider; -}(); - -/** - * By default, pools will not allow operations that require ticks. - */ - -var NO_TICK_DATA_PROVIDER_DEFAULT = /*#__PURE__*/new NoTickDataProvider(); -/** - * Represents a V3 pool - */ - -var Pool = /*#__PURE__*/function () { - /** - * Construct a pool - * @param tokenA one of the tokens in the pool - * @param tokenB the other token in the pool - * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool - * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0 - * @param liquidity the current value of in range liquidity - * @param tickCurrent the current tick of the pool - * @param ticks the current state of the pool ticks or a data provider that can return tick data - */ - function Pool(tokenA, tokenB, fee, sqrtRatioX96, liquidity, tickCurrent, ticks) { - if (ticks === void 0) { - ticks = NO_TICK_DATA_PROVIDER_DEFAULT; - } - - !(Number.isInteger(fee) && fee < 1000000) ? invariant(false, 'FEE') : void 0; - var tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent); - var nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1); - !(JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) && JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96)) ? invariant(false, 'PRICE_BOUNDS') : void 0; - - var _ref = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]; - - this.token0 = _ref[0]; - this.token1 = _ref[1]; - this.fee = fee; - this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96); - this.liquidity = JSBI.BigInt(liquidity); - this.tickCurrent = tickCurrent; - this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks; - } - - Pool.getAddress = function getAddress(tokenA, tokenB, fee) { - return computePoolAddress({ - factoryAddress: FACTORY_ADDRESS, - fee: fee, - tokenA: tokenA, - tokenB: tokenB - }); - } - /** - * Returns true if the token is either token0 or token1 - * @param token to check - */ - ; - - var _proto = Pool.prototype; - - _proto.involvesToken = function involvesToken(token) { - return token.equals(this.token0) || token.equals(this.token1); - } - /** - * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0 - */ - ; - - /** - * Return the price of the given token in terms of the other token in the pool. - * @param token token to return price of - */ - _proto.priceOf = function priceOf(token) { - !this.involvesToken(token) ? invariant(false, 'TOKEN') : void 0; - return token.equals(this.token0) ? this.token0Price : this.token1Price; - } - /** - * Returns the chain ID of the tokens in the pool. - */ - ; - - /** - * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade - * @param inputAmount the input amount for which to quote the output amount - */ - _proto.getOutputAmount = - /*#__PURE__*/ - function () { - var _getOutputAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(inputAmount, sqrtPriceLimitX96) { - var zeroForOne, _yield$this$swap, outputAmount, sqrtRatioX96, liquidity, tickCurrent, outputToken; - - return runtime_1.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - !this.involvesToken(inputAmount.currency) ? invariant(false, 'TOKEN') : void 0; - zeroForOne = inputAmount.currency.equals(this.token0); - _context.next = 4; - return this.swap(zeroForOne, inputAmount.quotient, sqrtPriceLimitX96); - - case 4: - _yield$this$swap = _context.sent; - outputAmount = _yield$this$swap.amountCalculated; - sqrtRatioX96 = _yield$this$swap.sqrtRatioX96; - liquidity = _yield$this$swap.liquidity; - tickCurrent = _yield$this$swap.tickCurrent; - outputToken = zeroForOne ? this.token1 : this.token0; - return _context.abrupt("return", [sdkCore.CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)), new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)]); - - case 11: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function getOutputAmount(_x, _x2) { - return _getOutputAmount.apply(this, arguments); - } - - return getOutputAmount; - }() - /** - * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade - * @param outputAmount the output amount for which to quote the input amount - */ - ; - - _proto.getInputAmount = - /*#__PURE__*/ - function () { - var _getInputAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(outputAmount, sqrtPriceLimitX96) { - var zeroForOne, _yield$this$swap2, inputAmount, sqrtRatioX96, liquidity, tickCurrent, inputToken; - - return runtime_1.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - !(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency)) ? invariant(false, 'TOKEN') : void 0; - zeroForOne = outputAmount.currency.equals(this.token1); - _context2.next = 4; - return this.swap(zeroForOne, JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE), sqrtPriceLimitX96); - - case 4: - _yield$this$swap2 = _context2.sent; - inputAmount = _yield$this$swap2.amountCalculated; - sqrtRatioX96 = _yield$this$swap2.sqrtRatioX96; - liquidity = _yield$this$swap2.liquidity; - tickCurrent = _yield$this$swap2.tickCurrent; - inputToken = zeroForOne ? this.token0 : this.token1; - return _context2.abrupt("return", [sdkCore.CurrencyAmount.fromRawAmount(inputToken, inputAmount), new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)]); - - case 11: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function getInputAmount(_x3, _x4) { - return _getInputAmount.apply(this, arguments); - } - - return getInputAmount; - }(); - - _proto.swap = /*#__PURE__*/function () { - var _swap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(zeroForOne, amountSpecified, sqrtPriceLimitX96) { - var exactInput, state, step, _yield$this$tickDataP, _SwapMath$computeSwap, liquidityNet; - - return runtime_1.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - if (!sqrtPriceLimitX96) sqrtPriceLimitX96 = zeroForOne ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE) : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE); - - if (zeroForOne) { - !JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO) ? invariant(false, 'RATIO_MIN') : void 0; - !JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96) ? invariant(false, 'RATIO_CURRENT') : void 0; - } else { - !JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO) ? invariant(false, 'RATIO_MAX') : void 0; - !JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96) ? invariant(false, 'RATIO_CURRENT') : void 0; - } - - exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO); // keep track of swap state - - state = { - amountSpecifiedRemaining: amountSpecified, - amountCalculated: ZERO, - sqrtPriceX96: this.sqrtRatioX96, - tick: this.tickCurrent, - liquidity: this.liquidity - }; // start swap while loop - - case 4: - if (!(JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96)) { - _context3.next = 35; - break; - } - - step = {}; - step.sqrtPriceStartX96 = state.sqrtPriceX96; - _context3.next = 9; - return this.tickDataProvider.nextInitializedTickWithinOneWord(state.tick, zeroForOne, this.tickSpacing); - - case 9: - _yield$this$tickDataP = _context3.sent; - step.tickNext = _yield$this$tickDataP[0]; - step.initialized = _yield$this$tickDataP[1]; - - if (step.tickNext < TickMath.MIN_TICK) { - step.tickNext = TickMath.MIN_TICK; - } else if (step.tickNext > TickMath.MAX_TICK) { - step.tickNext = TickMath.MAX_TICK; - } - - step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); - _SwapMath$computeSwap = SwapMath.computeSwapStep(state.sqrtPriceX96, (zeroForOne ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96) : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)) ? sqrtPriceLimitX96 : step.sqrtPriceNextX96, state.liquidity, state.amountSpecifiedRemaining, this.fee); - state.sqrtPriceX96 = _SwapMath$computeSwap[0]; - step.amountIn = _SwapMath$computeSwap[1]; - step.amountOut = _SwapMath$computeSwap[2]; - step.feeAmount = _SwapMath$computeSwap[3]; - - if (exactInput) { - state.amountSpecifiedRemaining = JSBI.subtract(state.amountSpecifiedRemaining, JSBI.add(step.amountIn, step.feeAmount)); - state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut); - } else { - state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut); - state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount)); - } // TODO - - - if (!JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) { - _context3.next = 32; - break; - } - - if (!step.initialized) { - _context3.next = 29; - break; - } - - _context3.t0 = JSBI; - _context3.next = 25; - return this.tickDataProvider.getTick(step.tickNext); - - case 25: - _context3.t1 = _context3.sent.liquidityNet; - liquidityNet = _context3.t0.BigInt.call(_context3.t0, _context3.t1); - // if we're moving leftward, we interpret liquidityNet as the opposite sign - // safe because liquidityNet cannot be type(int128).min - if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE); - state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet); - - case 29: - state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; - _context3.next = 33; - break; - - case 32: - if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { - // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved - state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); - } - - case 33: - _context3.next = 4; - break; - - case 35: - return _context3.abrupt("return", { - amountCalculated: state.amountCalculated, - sqrtRatioX96: state.sqrtPriceX96, - liquidity: state.liquidity, - tickCurrent: state.tick - }); - - case 36: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function swap(_x5, _x6, _x7) { - return _swap.apply(this, arguments); - } - - return swap; - }(); - - _createClass(Pool, [{ - key: "token0Price", - get: function get() { - var _this$_token0Price; - - return (_this$_token0Price = this._token0Price) != null ? _this$_token0Price : this._token0Price = new sdkCore.Price(this.token0, this.token1, Q192, JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)); - } - /** - * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1 - */ - - }, { - key: "token1Price", - get: function get() { - var _this$_token1Price; - - return (_this$_token1Price = this._token1Price) != null ? _this$_token1Price : this._token1Price = new sdkCore.Price(this.token1, this.token0, JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96), Q192); - } - }, { - key: "chainId", - get: function get() { - return this.token0.chainId; - } - }, { - key: "tickSpacing", - get: function get() { - return TICK_SPACINGS[this.fee]; - } - }]); - - return Pool; -}(); - -/** - * Represents a position on a Uniswap V3 Pool - */ - -var Position = /*#__PURE__*/function () { - /** - * Constructs a position for a given pool with the given liquidity - * @param pool for which pool the liquidity is assigned - * @param liquidity the amount of liquidity that is in the position - * @param tickLower the lower tick of the position - * @param tickUpper the upper tick of the position - */ - function Position(_ref) { - var pool = _ref.pool, - liquidity = _ref.liquidity, - tickLower = _ref.tickLower, - tickUpper = _ref.tickUpper; - // cached resuts for the getters - this._token0Amount = null; - this._token1Amount = null; - this._mintAmounts = null; - !(tickLower < tickUpper) ? invariant(false, 'TICK_ORDER') : void 0; - !(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0) ? invariant(false, 'TICK_LOWER') : void 0; - !(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0) ? invariant(false, 'TICK_UPPER') : void 0; - this.pool = pool; - this.tickLower = tickLower; - this.tickUpper = tickUpper; - this.liquidity = JSBI.BigInt(liquidity); - } - /** - * Returns the price of token0 at the lower tick - */ - - - var _proto = Position.prototype; - - /** - * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage - * @param slippageTolerance amount by which the price can 'slip' - * @private - */ - _proto.ratiosAfterSlippage = function ratiosAfterSlippage(slippageTolerance) { - var priceLower = this.pool.token0Price.asFraction.multiply(new sdkCore.Percent(1).subtract(slippageTolerance)); - var priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1)); - var sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator); - - if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) { - sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1)); - } - - var sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator); - - if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) { - sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1)); - } - - return { - sqrtRatioX96Lower: sqrtRatioX96Lower, - sqrtRatioX96Upper: sqrtRatioX96Upper - }; - } - /** - * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position - * with the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the current price - */ - ; - - _proto.mintAmountsWithSlippage = function mintAmountsWithSlippage(slippageTolerance) { - // get lower/upper prices - var _this$ratiosAfterSlip = this.ratiosAfterSlippage(slippageTolerance), - sqrtRatioX96Upper = _this$ratiosAfterSlip.sqrtRatioX96Upper, - sqrtRatioX96Lower = _this$ratiosAfterSlip.sqrtRatioX96Lower; // construct counterfactual pools - - - var poolLower = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Lower, 0 - /* liquidity doesn't matter */ - , TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)); - var poolUpper = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Upper, 0 - /* liquidity doesn't matter */ - , TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)); // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage) - - var positionThatWillBeCreated = Position.fromAmounts(_extends({ - pool: this.pool, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }, this.mintAmounts, { - useFullPrecision: false - })); // we want the smaller amounts... - // ...which occurs at the upper price for amount0... - - var amount0 = new Position({ - pool: poolUpper, - liquidity: positionThatWillBeCreated.liquidity, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }).mintAmounts.amount0; // ...and the lower for amount1 - - var amount1 = new Position({ - pool: poolLower, - liquidity: positionThatWillBeCreated.liquidity, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }).mintAmounts.amount1; - return { - amount0: amount0, - amount1: amount1 - }; - } - /** - * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the - * position with the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the current price - */ - ; - - _proto.burnAmountsWithSlippage = function burnAmountsWithSlippage(slippageTolerance) { - // get lower/upper prices - var _this$ratiosAfterSlip2 = this.ratiosAfterSlippage(slippageTolerance), - sqrtRatioX96Upper = _this$ratiosAfterSlip2.sqrtRatioX96Upper, - sqrtRatioX96Lower = _this$ratiosAfterSlip2.sqrtRatioX96Lower; // construct counterfactual pools - - - var poolLower = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Lower, 0 - /* liquidity doesn't matter */ - , TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)); - var poolUpper = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Upper, 0 - /* liquidity doesn't matter */ - , TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)); // we want the smaller amounts... - // ...which occurs at the upper price for amount0... - - var amount0 = new Position({ - pool: poolUpper, - liquidity: this.liquidity, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }).amount0; // ...and the lower for amount1 - - var amount1 = new Position({ - pool: poolLower, - liquidity: this.liquidity, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }).amount1; - return { - amount0: amount0.quotient, - amount1: amount1.quotient - }; - } - /** - * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at - * the current price for the pool - */ - ; - - /** - * Computes the maximum amount of liquidity received for a given amount of token0, token1, - * and the prices at the tick boundaries. - * @param pool the pool for which the position should be created - * @param tickLower the lower tick of the position - * @param tickUpper the upper tick of the position - * @param amount0 token0 amount - * @param amount1 token1 amount - * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ - Position.fromAmounts = function fromAmounts(_ref2) { - var pool = _ref2.pool, - tickLower = _ref2.tickLower, - tickUpper = _ref2.tickUpper, - amount0 = _ref2.amount0, - amount1 = _ref2.amount1, - useFullPrecision = _ref2.useFullPrecision; - var sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower); - var sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper); - return new Position({ - pool: pool, - tickLower: tickLower, - tickUpper: tickUpper, - liquidity: maxLiquidityForAmounts(pool.sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1, useFullPrecision) - }); - } - /** - * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1 - * @param pool the pool for which the position is created - * @param tickLower the lower tick - * @param tickUpper the upper tick - * @param amount0 the desired amount of token0 - * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ - ; - - Position.fromAmount0 = function fromAmount0(_ref3) { - var pool = _ref3.pool, - tickLower = _ref3.tickLower, - tickUpper = _ref3.tickUpper, - amount0 = _ref3.amount0, - useFullPrecision = _ref3.useFullPrecision; - return Position.fromAmounts({ - pool: pool, - tickLower: tickLower, - tickUpper: tickUpper, - amount0: amount0, - amount1: sdkCore.MaxUint256, - useFullPrecision: useFullPrecision - }); - } - /** - * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0 - * @param pool the pool for which the position is created - * @param tickLower the lower tick - * @param tickUpper the upper tick - * @param amount1 the desired amount of token1 - */ - ; - - Position.fromAmount1 = function fromAmount1(_ref4) { - var pool = _ref4.pool, - tickLower = _ref4.tickLower, - tickUpper = _ref4.tickUpper, - amount1 = _ref4.amount1; - // this function always uses full precision, - return Position.fromAmounts({ - pool: pool, - tickLower: tickLower, - tickUpper: tickUpper, - amount0: sdkCore.MaxUint256, - amount1: amount1, - useFullPrecision: true - }); - }; - - _createClass(Position, [{ - key: "token0PriceLower", - get: function get() { - return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower); - } - /** - * Returns the price of token0 at the upper tick - */ - - }, { - key: "token0PriceUpper", - get: function get() { - return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper); - } - /** - * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price - */ - - }, { - key: "amount0", - get: function get() { - if (this._token0Amount === null) { - if (this.pool.tickCurrent < this.tickLower) { - this._token0Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token0, SqrtPriceMath.getAmount0Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); - } else if (this.pool.tickCurrent < this.tickUpper) { - this._token0Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token0, SqrtPriceMath.getAmount0Delta(this.pool.sqrtRatioX96, TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); - } else { - this._token0Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token0, ZERO); - } - } - - return this._token0Amount; - } - /** - * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price - */ - - }, { - key: "amount1", - get: function get() { - if (this._token1Amount === null) { - if (this.pool.tickCurrent < this.tickLower) { - this._token1Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token1, ZERO); - } else if (this.pool.tickCurrent < this.tickUpper) { - this._token1Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token1, SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), this.pool.sqrtRatioX96, this.liquidity, false)); - } else { - this._token1Amount = sdkCore.CurrencyAmount.fromRawAmount(this.pool.token1, SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); - } - } - - return this._token1Amount; - } - }, { - key: "mintAmounts", - get: function get() { - if (this._mintAmounts === null) { - if (this.pool.tickCurrent < this.tickLower) { - return { - amount0: SqrtPriceMath.getAmount0Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true), - amount1: ZERO - }; - } else if (this.pool.tickCurrent < this.tickUpper) { - return { - amount0: SqrtPriceMath.getAmount0Delta(this.pool.sqrtRatioX96, TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true), - amount1: SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), this.pool.sqrtRatioX96, this.liquidity, true) - }; - } else { - return { - amount0: ZERO, - amount1: SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true) - }; - } - } - - return this._mintAmounts; - } - }]); - - return Position; -}(); - -/** - * Represents a list of pools through which a swap can occur - */ - -var Route = /*#__PURE__*/function () { - function Route(pools, input, output) { - this._midPrice = null; - !(pools.length > 0) ? invariant(false, 'POOLS') : void 0; - var chainId = pools[0].chainId; - var allOnSameChain = pools.every(function (pool) { - return pool.chainId === chainId; - }); - !allOnSameChain ? invariant(false, 'CHAIN_IDS') : void 0; - var wrappedInput = sdkCore.wrappedCurrency(input, chainId); - !pools[0].involvesToken(wrappedInput) ? invariant(false, 'INPUT') : void 0; - !pools[pools.length - 1].involvesToken(sdkCore.wrappedCurrency(output, chainId)) ? invariant(false, 'OUTPUT') : void 0; - /** - * Normalizes token0-token1 order and selects the next token/fee step to add to the path - * */ - - var tokenPath = [wrappedInput]; - - for (var _iterator = _createForOfIteratorHelperLoose(pools.entries()), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - i = _step$value[0], - pool = _step$value[1]; - var currentInputToken = tokenPath[i]; - !(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1)) ? invariant(false, 'PATH') : void 0; - var nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0; - tokenPath.push(nextToken); - } - - this.pools = pools; - this.tokenPath = tokenPath; - this.input = input; - this.output = output != null ? output : tokenPath[tokenPath.length - 1]; - } - - _createClass(Route, [{ - key: "chainId", - get: function get() { - return this.pools[0].chainId; - } - /** - * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token. - */ - - }, { - key: "inputToken", - get: function get() { - return sdkCore.wrappedCurrency(this.input, this.chainId); - } - /** - * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token. - */ - - }, { - key: "outputToken", - get: function get() { - return sdkCore.wrappedCurrency(this.output, this.chainId); - } - /** - * Returns the mid price of the route - */ - - }, { - key: "midPrice", - get: function get() { - if (this._midPrice !== null) return this._midPrice; - var price = this.pools.slice(1).reduce(function (_ref, pool) { - var nextInput = _ref.nextInput, - price = _ref.price; - return nextInput.equals(pool.token0) ? { - nextInput: pool.token1, - price: price.multiply(pool.token0Price) - } : { - nextInput: pool.token0, - price: price.multiply(pool.token1Price) - }; - }, this.pools[0].token0.equals(this.inputToken) ? { - nextInput: this.pools[0].token1, - price: this.pools[0].token0Price - } : { - nextInput: this.pools[0].token0, - price: this.pools[0].token1Price - }).price; - return this._midPrice = new sdkCore.Price(this.input, this.output, price.denominator, price.numerator); - } - }]); - - return Route; -}(); - -function tradeComparator(a, b) { - // must have same input and output token for comparison - !sdkCore.currencyEquals(a.inputAmount.currency, b.inputAmount.currency) ? invariant(false, 'INPUT_CURRENCY') : void 0; - !sdkCore.currencyEquals(a.outputAmount.currency, b.outputAmount.currency) ? invariant(false, 'OUTPUT_CURRENCY') : void 0; - - if (a.outputAmount.equalTo(b.outputAmount)) { - if (a.inputAmount.equalTo(b.inputAmount)) { - // consider the number of hops since each hop costs gas - return a.route.tokenPath.length - b.route.tokenPath.length; - } // trade A requires less input than trade B, so A should come first - - - if (a.inputAmount.lessThan(b.inputAmount)) { - return -1; - } else { - return 1; - } - } else { - // tradeA has less output than trade B, so should come second - if (a.outputAmount.lessThan(b.outputAmount)) { - return 1; - } else { - return -1; - } - } -} -/** - * Represents a trade executed against a list of pools. - * Does not account for slippage, i.e. trades that front run this trade and move the price. - */ - -var Trade = /*#__PURE__*/function () { - /** - * Construct a trade by passing in the pre-computed property values - * @param route the route through which the trade occurs - * @param inputAmount the amount of input paid in the trade - * @param outputAmount the amount of output received in the trade - * @param tradeType the type of trade, exact input or exact output - */ - function Trade(_ref) { - var route = _ref.route, - inputAmount = _ref.inputAmount, - outputAmount = _ref.outputAmount, - tradeType = _ref.tradeType; - !sdkCore.currencyEquals(inputAmount.currency, route.input) ? invariant(false, 'INPUT_CURRENCY_MATCH') : void 0; - !sdkCore.currencyEquals(outputAmount.currency, route.output) ? invariant(false, 'OUTPUT_CURRENCY_MATCH') : void 0; - this.route = route; - this.inputAmount = inputAmount; - this.outputAmount = outputAmount; - this.tradeType = tradeType; - } - /** - * The price expressed in terms of output amount/input amount. - */ - - - /** - * Constructs an exact in trade with the given amount in and route - * @param route route of the exact in trade - * @param amountIn the amount being passed in - */ - Trade.exactIn = - /*#__PURE__*/ - function () { - var _exactIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(route, amountIn) { - return runtime_1.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - return _context.abrupt("return", Trade.fromRoute(route, amountIn, sdkCore.TradeType.EXACT_INPUT)); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - function exactIn(_x, _x2) { - return _exactIn.apply(this, arguments); - } - - return exactIn; - }() - /** - * Constructs an exact out trade with the given amount out and route - * @param route route of the exact out trade - * @param amountOut the amount returned by the trade - */ - ; - - Trade.exactOut = - /*#__PURE__*/ - function () { - var _exactOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(route, amountOut) { - return runtime_1.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - return _context2.abrupt("return", Trade.fromRoute(route, amountOut, sdkCore.TradeType.EXACT_OUTPUT)); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); - - function exactOut(_x3, _x4) { - return _exactOut.apply(this, arguments); - } - - return exactOut; - }() - /** - * Constructs a trade by simulating swaps through the given route - * @param route route to swap through - * @param amount the amount specified, either input or output, depending on tradeType - * @param tradeType whether the trade is an exact input or exact output swap - */ - ; - - Trade.fromRoute = - /*#__PURE__*/ - function () { - var _fromRoute = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(route, amount, tradeType) { - var amounts, inputAmount, outputAmount, i, pool, _yield$pool$getOutput, _outputAmount, _i, _pool, _yield$_pool$getInput, _inputAmount; - - return runtime_1.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - amounts = new Array(route.tokenPath.length); - - if (!(tradeType === sdkCore.TradeType.EXACT_INPUT)) { - _context3.next = 19; - break; - } - - !sdkCore.currencyEquals(amount.currency, route.input) ? invariant(false, 'INPUT') : void 0; - amounts[0] = sdkCore.wrappedCurrencyAmount(amount, route.chainId); - i = 0; - - case 5: - if (!(i < route.tokenPath.length - 1)) { - _context3.next = 15; - break; - } - - pool = route.pools[i]; - _context3.next = 9; - return pool.getOutputAmount(amounts[i]); - - case 9: - _yield$pool$getOutput = _context3.sent; - _outputAmount = _yield$pool$getOutput[0]; - amounts[i + 1] = _outputAmount; - - case 12: - i++; - _context3.next = 5; - break; - - case 15: - inputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator); - outputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.output, amounts[amounts.length - 1].numerator, amounts[amounts.length - 1].denominator); - _context3.next = 34; - break; - - case 19: - !sdkCore.currencyEquals(amount.currency, route.output) ? invariant(false, 'OUTPUT') : void 0; - amounts[amounts.length - 1] = sdkCore.wrappedCurrencyAmount(amount, route.chainId); - _i = route.tokenPath.length - 1; - - case 22: - if (!(_i > 0)) { - _context3.next = 32; - break; - } - - _pool = route.pools[_i - 1]; - _context3.next = 26; - return _pool.getInputAmount(amounts[_i]); - - case 26: - _yield$_pool$getInput = _context3.sent; - _inputAmount = _yield$_pool$getInput[0]; - amounts[_i - 1] = _inputAmount; - - case 29: - _i--; - _context3.next = 22; - break; - - case 32: - inputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator); - outputAmount = sdkCore.CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator); - - case 34: - return _context3.abrupt("return", new Trade({ - route: route, - tradeType: tradeType, - inputAmount: inputAmount, - outputAmount: outputAmount - })); - - case 35: - case "end": - return _context3.stop(); - } - } - }, _callee3); - })); - - function fromRoute(_x5, _x6, _x7) { - return _fromRoute.apply(this, arguments); - } - - return fromRoute; - }() - /** - * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade - * elsewhere and do not have any tick data - * @param constructorArguments the arguments passed to the trade constructor - */ - ; - - Trade.createUncheckedTrade = function createUncheckedTrade(constructorArguments) { - return new Trade(constructorArguments); - } - /** - * Get the minimum amount that must be received from this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - ; - - var _proto = Trade.prototype; - - _proto.minimumAmountOut = function minimumAmountOut(slippageTolerance) { - !!slippageTolerance.lessThan(ZERO) ? invariant(false, 'SLIPPAGE_TOLERANCE') : void 0; - - if (this.tradeType === sdkCore.TradeType.EXACT_OUTPUT) { - return this.outputAmount; - } else { - var slippageAdjustedAmountOut = new sdkCore.Fraction(ONE).add(slippageTolerance).invert().multiply(this.outputAmount.quotient).quotient; - return sdkCore.CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut); - } - } - /** - * Get the maximum amount in that can be spent via this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - ; - - _proto.maximumAmountIn = function maximumAmountIn(slippageTolerance) { - !!slippageTolerance.lessThan(ZERO) ? invariant(false, 'SLIPPAGE_TOLERANCE') : void 0; - - if (this.tradeType === sdkCore.TradeType.EXACT_INPUT) { - return this.inputAmount; - } else { - var slippageAdjustedAmountIn = new sdkCore.Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient).quotient; - return sdkCore.CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn); - } - } - /** - * Return the execution price after accounting for slippage tolerance - * @param slippageTolerance the allowed tolerated slippage - */ - ; - - _proto.worstExecutionPrice = function worstExecutionPrice(slippageTolerance) { - return new sdkCore.Price(this.inputAmount.currency, this.outputAmount.currency, this.maximumAmountIn(slippageTolerance).quotient, this.minimumAmountOut(slippageTolerance).quotient); - } - /** - * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token - * amount to an output token, making at most `maxHops` hops. - * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pools the pools to consider in finding the best trade - * @param nextAmountIn exact amount of input currency to spend - * @param currencyOut the desired currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool - * @param currentPools used in recursion; the current list of pools - * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter - * @param bestTrades used in recursion; the current list of best trades - */ - ; - - Trade.bestTradeExactIn = - /*#__PURE__*/ - function () { - var _bestTradeExactIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pools, currencyAmountIn, currencyOut, _temp, // used in recursion. - currentPools, nextAmountIn, bestTrades) { - var _ref2, _ref2$maxNumResults, maxNumResults, _ref2$maxHops, maxHops, chainId, amountIn, tokenOut, i, pool, amountOut, _yield$pool$getOutput2, poolsExcludingThisPool; - - return runtime_1.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _ref2 = _temp === void 0 ? {} : _temp, _ref2$maxNumResults = _ref2.maxNumResults, maxNumResults = _ref2$maxNumResults === void 0 ? 3 : _ref2$maxNumResults, _ref2$maxHops = _ref2.maxHops, maxHops = _ref2$maxHops === void 0 ? 3 : _ref2$maxHops; - - if (currentPools === void 0) { - currentPools = []; - } - - if (nextAmountIn === void 0) { - nextAmountIn = currencyAmountIn; - } - - if (bestTrades === void 0) { - bestTrades = []; - } - - !(pools.length > 0) ? invariant(false, 'POOLS') : void 0; - !(maxHops > 0) ? invariant(false, 'MAX_HOPS') : void 0; - !(currencyAmountIn === nextAmountIn || currentPools.length > 0) ? invariant(false, 'INVALID_RECURSION') : void 0; - chainId = nextAmountIn.currency.isToken ? nextAmountIn.currency.chainId : currencyOut.isToken ? currencyOut.chainId : undefined; - !(chainId !== undefined) ? invariant(false, 'CHAIN_ID') : void 0; - amountIn = sdkCore.wrappedCurrencyAmount(nextAmountIn, chainId); - tokenOut = sdkCore.wrappedCurrency(currencyOut, chainId); - i = 0; - - case 12: - if (!(i < pools.length)) { - _context4.next = 48; - break; - } - - pool = pools[i]; // pool irrelevant - - if (!(!sdkCore.currencyEquals(pool.token0, amountIn.currency) && !sdkCore.currencyEquals(pool.token1, amountIn.currency))) { - _context4.next = 16; - break; - } - - return _context4.abrupt("continue", 45); - - case 16: - amountOut = void 0; - _context4.prev = 17; - _context4.next = 21; - return pool.getOutputAmount(amountIn); - - case 21: - _yield$pool$getOutput2 = _context4.sent; - amountOut = _yield$pool$getOutput2[0]; - _context4.next = 30; - break; - - case 25: - _context4.prev = 25; - _context4.t0 = _context4["catch"](17); - - if (!_context4.t0.isInsufficientInputAmountError) { - _context4.next = 29; - break; - } - - return _context4.abrupt("continue", 45); - - case 29: - throw _context4.t0; - - case 30: - if (!(amountOut.currency.isToken && amountOut.currency.equals(tokenOut))) { - _context4.next = 41; - break; - } - - _context4.t1 = sdkCore.sortedInsert; - _context4.t2 = bestTrades; - _context4.next = 35; - return Trade.fromRoute(new Route([].concat(currentPools, [pool]), currencyAmountIn.currency, currencyOut), currencyAmountIn, sdkCore.TradeType.EXACT_INPUT); - - case 35: - _context4.t3 = _context4.sent; - _context4.t4 = maxNumResults; - _context4.t5 = tradeComparator; - (0, _context4.t1)(_context4.t2, _context4.t3, _context4.t4, _context4.t5); - _context4.next = 45; - break; - - case 41: - if (!(maxHops > 1 && pools.length > 1)) { - _context4.next = 45; - break; - } - - poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length)); // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops - - _context4.next = 45; - return Trade.bestTradeExactIn(poolsExcludingThisPool, currencyAmountIn, currencyOut, { - maxNumResults: maxNumResults, - maxHops: maxHops - 1 - }, [].concat(currentPools, [pool]), amountOut, bestTrades); - - case 45: - i++; - _context4.next = 12; - break; - - case 48: - return _context4.abrupt("return", bestTrades); - - case 49: - case "end": - return _context4.stop(); - } - } - }, _callee4, null, [[17, 25]]); - })); - - function bestTradeExactIn(_x8, _x9, _x10, _x11, _x12, _x13, _x14) { - return _bestTradeExactIn.apply(this, arguments); - } - - return bestTradeExactIn; - }() - /** - * similar to the above method but instead targets a fixed output amount - * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token - * to an output token amount, making at most `maxHops` hops - * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pools the pools to consider in finding the best trade - * @param currencyIn the currency to spend - * @param currencyAmountOut the desired currency amount out - * @param nextAmountOut the exact amount of currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool - * @param currentPools used in recursion; the current list of pools - * @param bestTrades used in recursion; the current list of best trades - */ - ; - - Trade.bestTradeExactOut = - /*#__PURE__*/ - function () { - var _bestTradeExactOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pools, currencyIn, currencyAmountOut, _temp2, // used in recursion. - currentPools, nextAmountOut, bestTrades) { - var _ref3, _ref3$maxNumResults, maxNumResults, _ref3$maxHops, maxHops, chainId, amountOut, tokenIn, i, pool, amountIn, _yield$pool$getInputA, poolsExcludingThisPool; - - return runtime_1.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - _ref3 = _temp2 === void 0 ? {} : _temp2, _ref3$maxNumResults = _ref3.maxNumResults, maxNumResults = _ref3$maxNumResults === void 0 ? 3 : _ref3$maxNumResults, _ref3$maxHops = _ref3.maxHops, maxHops = _ref3$maxHops === void 0 ? 3 : _ref3$maxHops; - - if (currentPools === void 0) { - currentPools = []; - } - - if (nextAmountOut === void 0) { - nextAmountOut = currencyAmountOut; - } - - if (bestTrades === void 0) { - bestTrades = []; - } - - !(pools.length > 0) ? invariant(false, 'POOLS') : void 0; - !(maxHops > 0) ? invariant(false, 'MAX_HOPS') : void 0; - !(currencyAmountOut === nextAmountOut || currentPools.length > 0) ? invariant(false, 'INVALID_RECURSION') : void 0; - chainId = nextAmountOut.currency.isToken ? nextAmountOut.currency.chainId : currencyIn.isToken ? currencyIn.chainId : undefined; - !(chainId !== undefined) ? invariant(false, 'CHAIN_ID') : void 0; - amountOut = sdkCore.wrappedCurrencyAmount(nextAmountOut, chainId); - tokenIn = sdkCore.wrappedCurrency(currencyIn, chainId); - i = 0; - - case 12: - if (!(i < pools.length)) { - _context5.next = 48; - break; - } - - pool = pools[i]; // pool irrelevant - - if (!(!sdkCore.currencyEquals(pool.token0, amountOut.currency) && !sdkCore.currencyEquals(pool.token1, amountOut.currency))) { - _context5.next = 16; - break; - } - - return _context5.abrupt("continue", 45); - - case 16: - amountIn = void 0; - _context5.prev = 17; - _context5.next = 21; - return pool.getInputAmount(amountOut); - - case 21: - _yield$pool$getInputA = _context5.sent; - amountIn = _yield$pool$getInputA[0]; - _context5.next = 30; - break; - - case 25: - _context5.prev = 25; - _context5.t0 = _context5["catch"](17); - - if (!_context5.t0.isInsufficientReservesError) { - _context5.next = 29; - break; - } - - return _context5.abrupt("continue", 45); - - case 29: - throw _context5.t0; - - case 30: - if (!sdkCore.currencyEquals(amountIn.currency, tokenIn)) { - _context5.next = 41; - break; - } - - _context5.t1 = sdkCore.sortedInsert; - _context5.t2 = bestTrades; - _context5.next = 35; - return Trade.fromRoute(new Route([pool].concat(currentPools), currencyIn, currencyAmountOut.currency), currencyAmountOut, sdkCore.TradeType.EXACT_OUTPUT); - - case 35: - _context5.t3 = _context5.sent; - _context5.t4 = maxNumResults; - _context5.t5 = tradeComparator; - (0, _context5.t1)(_context5.t2, _context5.t3, _context5.t4, _context5.t5); - _context5.next = 45; - break; - - case 41: - if (!(maxHops > 1 && pools.length > 1)) { - _context5.next = 45; - break; - } - - poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length)); // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops - - _context5.next = 45; - return Trade.bestTradeExactOut(poolsExcludingThisPool, currencyIn, currencyAmountOut, { - maxNumResults: maxNumResults, - maxHops: maxHops - 1 - }, [pool].concat(currentPools), amountIn, bestTrades); - - case 45: - i++; - _context5.next = 12; - break; - - case 48: - return _context5.abrupt("return", bestTrades); - - case 49: - case "end": - return _context5.stop(); - } - } - }, _callee5, null, [[17, 25]]); - })); - - function bestTradeExactOut(_x15, _x16, _x17, _x18, _x19, _x20, _x21) { - return _bestTradeExactOut.apply(this, arguments); - } - - return bestTradeExactOut; - }(); - - _createClass(Trade, [{ - key: "executionPrice", - get: function get() { - var _this$_executionPrice; - - return (_this$_executionPrice = this._executionPrice) != null ? _this$_executionPrice : this._executionPrice = new sdkCore.Price(this.inputAmount.currency, this.outputAmount.currency, this.inputAmount.quotient, this.outputAmount.quotient); - } - /** - * Returns the percent difference between the route's mid price and the price impact - */ - - }, { - key: "priceImpact", - get: function get() { - var _this$_priceImpact; - - return (_this$_priceImpact = this._priceImpact) != null ? _this$_priceImpact : this._priceImpact = sdkCore.computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount); - } - }]); - - return Trade; -}(); - -function isAllowedPermit(permitOptions) { - return 'nonce' in permitOptions; -} - -var SelfPermit = /*#__PURE__*/function () { - function SelfPermit() {} - - SelfPermit.encodePermit = function encodePermit(token, options) { - return isAllowedPermit(options) ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [token.address, toHex(options.nonce), toHex(options.expiry), options.v, options.r, options.s]) : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [token.address, toHex(options.amount), toHex(options.deadline), options.v, options.r, options.s]); - }; - - return SelfPermit; -}(); -SelfPermit.INTERFACE = /*#__PURE__*/new abi.Interface(ISelfPermit_json.abi); - -var MaxUint128 = /*#__PURE__*/toHex( /*#__PURE__*/JSBI.subtract( /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(128)), /*#__PURE__*/JSBI.BigInt(1))); // type guard - -function isMint(options) { - return Object.keys(options).some(function (k) { - return k === 'recipient'; - }); -} - -var NonfungiblePositionManager = /*#__PURE__*/function (_SelfPermit) { - _inheritsLoose(NonfungiblePositionManager, _SelfPermit); - - /** - * Cannot be constructed. - */ - function NonfungiblePositionManager() { - return _SelfPermit.call(this) || this; - } - - NonfungiblePositionManager.addCallParameters = function addCallParameters(position, options) { - !JSBI.greaterThan(position.liquidity, ZERO) ? invariant(false, 'ZERO_LIQUIDITY') : void 0; - var calldatas = []; // get amounts - - var _position$mintAmounts = position.mintAmounts, - amount0Desired = _position$mintAmounts.amount0, - amount1Desired = _position$mintAmounts.amount1; // adjust for slippage - - var minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance); - var amount0Min = toHex(minimumAmounts.amount0); - var amount1Min = toHex(minimumAmounts.amount1); - var deadline = toHex(options.deadline); // create pool if needed - - if (isMint(options) && options.createPool) { - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [position.pool.token0.address, position.pool.token1.address, position.pool.fee, toHex(position.pool.sqrtRatioX96)])); - } // permits if necessary - - - if (options.token0Permit) { - calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit)); - } - - if (options.token1Permit) { - calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit)); - } // mint - - - if (isMint(options)) { - var recipient = sdkCore.validateAndParseAddress(options.recipient); - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [{ - token0: position.pool.token0.address, - token1: position.pool.token1.address, - fee: position.pool.fee, - tickLower: position.tickLower, - tickUpper: position.tickUpper, - amount0Desired: toHex(amount0Desired), - amount1Desired: toHex(amount1Desired), - amount0Min: amount0Min, - amount1Min: amount1Min, - recipient: recipient, - deadline: deadline - }])); - } else { - // increase - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [{ - tokenId: toHex(options.tokenId), - amount0Desired: toHex(amount0Desired), - amount1Desired: toHex(amount1Desired), - amount0Min: amount0Min, - amount1Min: amount1Min, - deadline: deadline - }])); - } - - var value = toHex(0); - - if (options.useEther) { - var weth = sdkCore.WETH9[position.pool.chainId]; - !(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth))) ? invariant(false, 'NO_WETH') : void 0; - var wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired; // we only need to refund if we're actually sending ETH - - if (JSBI.greaterThan(wethValue, ZERO)) { - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH')); - } - - value = toHex(wethValue); - } - - return { - calldata: calldatas.length === 1 ? calldatas[0] : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), - value: value - }; - }; - - NonfungiblePositionManager.encodeCollect = function encodeCollect(options) { - var calldatas = []; - var tokenId = toHex(options.tokenId); - var involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther; - var recipient = sdkCore.validateAndParseAddress(options.recipient); // collect - - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [{ - tokenId: tokenId, - recipient: involvesETH ? ADDRESS_ZERO : recipient, - amount0Max: MaxUint128, - amount1Max: MaxUint128 - }])); - - if (involvesETH) { - var ethAmount = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed0.quotient : options.expectedCurrencyOwed1.quotient; - var token = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed1.currency : options.expectedCurrencyOwed0.currency; - var tokenAmount = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed1.quotient : options.expectedCurrencyOwed0.quotient; - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])); - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [token.address, toHex(tokenAmount), recipient])); - } - - return calldatas; - }; - - NonfungiblePositionManager.collectCallParameters = function collectCallParameters(options) { - var calldatas = NonfungiblePositionManager.encodeCollect(options); - return { - calldata: calldatas.length === 1 ? calldatas[0] : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), - value: toHex(0) - }; - } - /** - * Produces the calldata for completely or partially exiting a position - * @param position the position to exit - * @param options additional information necessary for generating the calldata - */ - ; - - NonfungiblePositionManager.removeCallParameters = function removeCallParameters(position, options) { - var calldatas = []; - var deadline = toHex(options.deadline); - var tokenId = toHex(options.tokenId); // construct a partial position with a percentage of liquidity - - var partialPosition = new Position({ - pool: position.pool, - liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient, - tickLower: position.tickLower, - tickUpper: position.tickUpper - }); - !JSBI.greaterThan(partialPosition.liquidity, ZERO) ? invariant(false, 'ZERO_LIQUIDITY') : void 0; // slippage-adjusted underlying amounts - - var _partialPosition$burn = partialPosition.burnAmountsWithSlippage(options.slippageTolerance), - amount0Min = _partialPosition$burn.amount0, - amount1Min = _partialPosition$burn.amount1; - - if (options.permit) { - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [sdkCore.validateAndParseAddress(options.permit.spender), tokenId, toHex(options.permit.deadline), options.permit.v, options.permit.r, options.permit.s])); - } // remove liquidity - - - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [{ - tokenId: tokenId, - liquidity: toHex(partialPosition.liquidity), - amount0Min: toHex(amount0Min), - amount1Min: toHex(amount1Min), - deadline: deadline - }])); - - var _options$collectOptio = options.collectOptions, - expectedCurrencyOwed0 = _options$collectOptio.expectedCurrencyOwed0, - expectedCurrencyOwed1 = _options$collectOptio.expectedCurrencyOwed1, - rest = _objectWithoutPropertiesLoose(_options$collectOptio, ["expectedCurrencyOwed0", "expectedCurrencyOwed1"]); - - calldatas.push.apply(calldatas, NonfungiblePositionManager.encodeCollect(_extends({ - tokenId: options.tokenId, - // add the underlying value to the expected currency already owed - expectedCurrencyOwed0: expectedCurrencyOwed0.add(expectedCurrencyOwed0.currency.isEther ? sdkCore.CurrencyAmount.ether(amount0Min) : sdkCore.CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency, amount0Min)), - expectedCurrencyOwed1: expectedCurrencyOwed1.add(expectedCurrencyOwed1.currency.isEther ? sdkCore.CurrencyAmount.ether(amount1Min) : sdkCore.CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency, amount1Min)) - }, rest))); - - if (options.liquidityPercentage.equalTo(ONE)) { - if (options.burnToken) { - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId])); - } - } else { - !(options.burnToken !== true) ? invariant(false, 'CANNOT_BURN') : void 0; - } - - return { - calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), - value: toHex(0) - }; - }; - - return NonfungiblePositionManager; -}(SelfPermit); -NonfungiblePositionManager.INTERFACE = /*#__PURE__*/new abi.Interface(NonfungiblePositionManager_json.abi); - -/** - * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades. - */ - -var SwapRouter = /*#__PURE__*/function (_SelfPermit) { - _inheritsLoose(SwapRouter, _SelfPermit); - - /** - * Cannot be constructed. - */ - function SwapRouter() { - return _SelfPermit.call(this) || this; - } - /** - * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. - * @param trade to produce call parameters for - * @param options options for the call parameters - */ - - - SwapRouter.swapCallParameters = function swapCallParameters(trade, options) { - var calldatas = []; // encode permit if necessary - - if (options.inputTokenPermit) { - !trade.inputAmount.currency.isToken ? invariant(false, 'NON_TOKEN_PERMIT') : void 0; - calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit)); - } - - var recipient = sdkCore.validateAndParseAddress(options.recipient); - var deadline = toHex(options.deadline); - var amountIn = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient); - var amountOut = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient); - var value = trade.inputAmount.currency.isEther ? amountIn : toHex(0); // flag for whether the trade is single hop or not - - var singleHop = trade.route.pools.length === 1; // flag for whether a refund needs to happen - - var mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === sdkCore.TradeType.EXACT_OUTPUT; // flags for whether funds should be send first to the router - - var outputIsEther = trade.outputAmount.currency.isEther; - var routerMustCustody = outputIsEther || !!options.fee; - - if (singleHop) { - if (trade.tradeType === sdkCore.TradeType.EXACT_INPUT) { - var _options$sqrtPriceLim; - - var exactInputSingleParams = { - tokenIn: trade.route.tokenPath[0].address, - tokenOut: trade.route.tokenPath[1].address, - fee: trade.route.pools[0].fee, - recipient: routerMustCustody ? ADDRESS_ZERO : recipient, - deadline: deadline, - amountIn: amountIn, - amountOutMinimum: amountOut, - sqrtPriceLimitX96: toHex((_options$sqrtPriceLim = options.sqrtPriceLimitX96) != null ? _options$sqrtPriceLim : 0) - }; - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams])); - } else { - var _options$sqrtPriceLim2; - - var exactOutputSingleParams = { - tokenIn: trade.route.tokenPath[0].address, - tokenOut: trade.route.tokenPath[1].address, - fee: trade.route.pools[0].fee, - recipient: routerMustCustody ? ADDRESS_ZERO : recipient, - deadline: deadline, - amountOut: amountOut, - amountInMaximum: amountIn, - sqrtPriceLimitX96: toHex((_options$sqrtPriceLim2 = options.sqrtPriceLimitX96) != null ? _options$sqrtPriceLim2 : 0) - }; - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams])); - } - } else { - !(options.sqrtPriceLimitX96 === undefined) ? invariant(false, 'MULTIHOP_PRICE_LIMIT') : void 0; - var path = encodeRouteToPath(trade.route, trade.tradeType === sdkCore.TradeType.EXACT_OUTPUT); - - if (trade.tradeType === sdkCore.TradeType.EXACT_INPUT) { - var exactInputParams = { - path: path, - recipient: routerMustCustody ? ADDRESS_ZERO : recipient, - deadline: deadline, - amountIn: amountIn, - amountOutMinimum: amountOut - }; - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams])); - } else { - var exactOutputParams = { - path: path, - recipient: routerMustCustody ? ADDRESS_ZERO : recipient, - deadline: deadline, - amountOut: amountOut, - amountInMaximum: amountIn - }; - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams])); - } - } // refund - - - if (mustRefund) { - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH')); - } // unwrap - - - if (routerMustCustody) { - if (!!options.fee) { - var feeRecipient = sdkCore.validateAndParseAddress(options.fee.recipient); - var fee = toHex(options.fee.fee.multiply(10000).quotient); - - if (outputIsEther) { - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])); - } else { - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [trade.route.tokenPath[trade.route.tokenPath.length - 1].address, amountOut, recipient, fee, feeRecipient])); - } - } else { - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient])); - } - } - - return { - calldata: calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]), - value: value - }; - }; - - return SwapRouter; -}(SelfPermit); -SwapRouter.INTERFACE = /*#__PURE__*/new abi.Interface(SwapRouter_json.abi); - -exports.ADDRESS_ZERO = ADDRESS_ZERO; -exports.FACTORY_ADDRESS = FACTORY_ADDRESS; -exports.FullMath = FullMath; -exports.LiquidityMath = LiquidityMath; -exports.NoTickDataProvider = NoTickDataProvider; -exports.NonfungiblePositionManager = NonfungiblePositionManager; -exports.POOL_INIT_CODE_HASH = POOL_INIT_CODE_HASH; -exports.Pool = Pool; -exports.Position = Position; -exports.Route = Route; -exports.SqrtPriceMath = SqrtPriceMath; -exports.SwapRouter = SwapRouter; -exports.TICK_SPACINGS = TICK_SPACINGS; -exports.Tick = Tick; -exports.TickList = TickList; -exports.TickListDataProvider = TickListDataProvider; -exports.TickMath = TickMath; -exports.Trade = Trade; -exports.computePoolAddress = computePoolAddress; -exports.encodeRouteToPath = encodeRouteToPath; -exports.encodeSqrtRatioX96 = encodeSqrtRatioX96; -exports.isSorted = isSorted; -exports.maxLiquidityForAmounts = maxLiquidityForAmounts; -exports.mostSignificantBit = mostSignificantBit; -exports.nearestUsableTick = nearestUsableTick; -exports.priceToClosestTick = priceToClosestTick; -exports.tickToPrice = tickToPrice; -exports.toHex = toHex; -exports.tradeComparator = tradeComparator; -//# sourceMappingURL=v3-sdk.cjs.development.js.map diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js.map b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js.map deleted file mode 100644 index 3fb73ecb319..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.development.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"v3-sdk.cjs.development.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/constants.ts","../src/internalConstants.ts","../src/utils/computePoolAddress.ts","../src/utils/liquidityMath.ts","../src/utils/fullMath.ts","../src/utils/sqrtPriceMath.ts","../src/utils/swapMath.ts","../src/utils/mostSignificantBit.ts","../src/utils/tickMath.ts","../src/entities/tickDataProvider.ts","../src/utils/isSorted.ts","../src/utils/tickList.ts","../src/utils/calldata.ts","../src/utils/encodeRouteToPath.ts","../src/utils/encodeSqrtRatioX96.ts","../src/utils/maxLiquidityForAmounts.ts","../src/utils/nearestUsableTick.ts","../src/utils/priceTickConversions.ts","../src/entities/tick.ts","../src/entities/tickListDataProvider.ts","../src/entities/pool.ts","../src/entities/position.ts","../src/entities/route.ts","../src/entities/trade.ts","../src/selfPermit.ts","../src/nonfungiblePositionManager.ts","../src/swapRouter.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","export const FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'\n\nexport const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'\n\nexport const POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'\n\n/**\n * The default factory enabled fee amounts, denominated in hundredths of bips.\n */\nexport enum FeeAmount {\n LOW = 500,\n MEDIUM = 3000,\n HIGH = 10000\n}\n\n/**\n * The default factory tick spacings by fee amount.\n */\nexport const TICK_SPACINGS: { [amount in FeeAmount]: number } = {\n [FeeAmount.LOW]: 10,\n [FeeAmount.MEDIUM]: 60,\n [FeeAmount.HIGH]: 200\n}\n","import JSBI from 'jsbi'\n\n// constants used internally but not expected to be used externally\nexport const NEGATIVE_ONE = JSBI.BigInt(-1)\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\n\n// used in liquidity amount math\nexport const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96))\nexport const Q192 = JSBI.exponentiate(Q96, JSBI.BigInt(2))\n","import { defaultAbiCoder } from '@ethersproject/abi'\nimport { getCreate2Address } from '@ethersproject/address'\nimport { keccak256 } from '@ethersproject/solidity'\nimport { Token } from '@uniswap/sdk-core'\nimport { FeeAmount, POOL_INIT_CODE_HASH } from '../constants'\n\nexport function computePoolAddress({\n factoryAddress,\n tokenA,\n tokenB,\n fee\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n fee: FeeAmount\n}): string {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(\n ['bytes'],\n [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]\n ),\n POOL_INIT_CODE_HASH\n )\n}\n","import JSBI from 'jsbi'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\n\nexport abstract class LiquidityMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static addDelta(x: JSBI, y: JSBI): JSBI {\n if (JSBI.lessThan(y, ZERO)) {\n return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE))\n } else {\n return JSBI.add(x, y)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { ONE, ZERO } from '../internalConstants'\n\nexport abstract class FullMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI {\n const product = JSBI.multiply(a, b)\n let result = JSBI.divide(product, denominator)\n if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE)\n return result\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO, Q96 } from '../internalConstants'\nimport { FullMath } from './fullMath'\n\nconst MaxUint160 = JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(160)), ONE)\n\nfunction multiplyIn256(x: JSBI, y: JSBI): JSBI {\n const product = JSBI.multiply(x, y)\n return JSBI.bitwiseAnd(product, MaxUint256)\n}\n\nfunction addIn256(x: JSBI, y: JSBI): JSBI {\n const sum = JSBI.add(x, y)\n return JSBI.bitwiseAnd(sum, MaxUint256)\n}\n\nexport abstract class SqrtPriceMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n const numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)\n\n return roundUp\n ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96)\n : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96)\n }\n\n public static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n return roundUp\n ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96)\n : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96)\n }\n\n public static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)\n : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true)\n }\n\n public static getNextSqrtPriceFromOutput(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amountOut: JSBI,\n zeroForOne: boolean\n ): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)\n : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false)\n }\n\n private static getNextSqrtPriceFromAmount0RoundingUp(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (JSBI.equal(amount, ZERO)) return sqrtPX96\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n\n if (add) {\n let product = multiplyIn256(amount, sqrtPX96)\n if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) {\n const denominator = addIn256(numerator1, product)\n if (JSBI.greaterThanOrEqual(denominator, numerator1)) {\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount))\n } else {\n let product = multiplyIn256(amount, sqrtPX96)\n\n invariant(JSBI.equal(JSBI.divide(product, amount), sqrtPX96))\n invariant(JSBI.greaterThan(numerator1, product))\n const denominator = JSBI.subtract(numerator1, product)\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n private static getNextSqrtPriceFromAmount1RoundingDown(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (add) {\n const quotient = JSBI.lessThanOrEqual(amount, MaxUint160)\n ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity)\n : JSBI.divide(JSBI.multiply(amount, Q96), liquidity)\n\n return JSBI.add(sqrtPX96, quotient)\n } else {\n const quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity)\n\n invariant(JSBI.greaterThan(sqrtPX96, quotient))\n return JSBI.subtract(sqrtPX96, quotient)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { FeeAmount } from '../constants'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\nimport { FullMath } from './fullMath'\nimport { SqrtPriceMath } from './sqrtPriceMath'\n\nconst MAX_FEE = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(6))\n\nexport abstract class SwapMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static computeSwapStep(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioTargetX96: JSBI,\n liquidity: JSBI,\n amountRemaining: JSBI,\n feePips: FeeAmount\n ): [JSBI, JSBI, JSBI, JSBI] {\n const returnValues: Partial<{\n sqrtRatioNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n }> = {}\n\n const zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96)\n const exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO)\n\n if (exactIn) {\n const amountRemainingLessFee = JSBI.divide(\n JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))),\n MAX_FEE\n )\n returnValues.amountIn = zeroForOne\n ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true)\n if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn!)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(\n sqrtRatioCurrentX96,\n liquidity,\n amountRemainingLessFee,\n zeroForOne\n )\n }\n } else {\n returnValues.amountOut = zeroForOne\n ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false)\n if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(\n sqrtRatioCurrentX96,\n liquidity,\n JSBI.multiply(amountRemaining, NEGATIVE_ONE),\n zeroForOne\n )\n }\n }\n\n const max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96)\n\n if (zeroForOne) {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false)\n } else {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false)\n }\n\n if (!exactIn && JSBI.greaterThan(returnValues.amountOut!, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) {\n returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE)\n }\n\n if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) {\n // we didn't reach the target, so take the remainder of the maximum input as fee\n returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn!)\n } else {\n returnValues.feeAmount = FullMath.mulDivRoundingUp(\n returnValues.amountIn!,\n JSBI.BigInt(feePips),\n JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))\n )\n }\n\n return [returnValues.sqrtRatioNextX96!, returnValues.amountIn!, returnValues.amountOut!, returnValues.feeAmount!]\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\n\nconst TWO = JSBI.BigInt(2)\nconst POWERS_OF_2 = [128, 64, 32, 16, 8, 4, 2, 1].map((pow: number): [number, JSBI] => [\n pow,\n JSBI.exponentiate(TWO, JSBI.BigInt(pow))\n])\n\nexport function mostSignificantBit(x: JSBI): number {\n invariant(JSBI.greaterThan(x, ZERO), 'ZERO')\n invariant(JSBI.lessThanOrEqual(x, MaxUint256), 'MAX')\n\n let msb: number = 0\n for (const [power, min] of POWERS_OF_2) {\n if (JSBI.greaterThanOrEqual(x, min)) {\n x = JSBI.signedRightShift(x, JSBI.BigInt(power))\n msb += power\n }\n }\n return msb\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { mostSignificantBit } from './mostSignificantBit'\n\nfunction mulShift(val: JSBI, mulBy: string): JSBI {\n return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128))\n}\n\nconst Q32 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(32))\n\nexport abstract class TickMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n /**\n * The minimum tick that can be used on any pool.\n */\n public static MIN_TICK: number = -887272\n /**\n * The maximum tick that can be used on any pool.\n */\n public static MAX_TICK: number = -TickMath.MIN_TICK\n\n /**\n * The sqrt ratio corresponding to the minimum tick that could be used on any pool.\n */\n public static MIN_SQRT_RATIO: JSBI = JSBI.BigInt('4295128739')\n /**\n * The sqrt ratio corresponding to the maximum tick that could be used on any pool.\n */\n public static MAX_SQRT_RATIO: JSBI = JSBI.BigInt('1461446703485210103287273052203988822378723970342')\n\n /**\n * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick\n * @param tick the tick for which to compute the sqrt ratio\n */\n public static getSqrtRatioAtTick(tick: number): JSBI {\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick), 'TICK')\n const absTick: number = tick < 0 ? tick * -1 : tick\n\n let ratio: JSBI =\n (absTick & 0x1) != 0\n ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001')\n : JSBI.BigInt('0x100000000000000000000000000000000')\n if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a')\n if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc')\n if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0')\n if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644')\n if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0')\n if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861')\n if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053')\n if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4')\n if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54')\n if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3')\n if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9')\n if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825')\n if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5')\n if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7')\n if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6')\n if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9')\n if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604')\n if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98')\n if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2')\n\n if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio)\n\n // back to Q96\n return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO)\n ? JSBI.add(JSBI.divide(ratio, Q32), ONE)\n : JSBI.divide(ratio, Q32)\n }\n\n /**\n * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96\n * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96\n * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick\n */\n public static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number {\n invariant(\n JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) &&\n JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO),\n 'SQRT_RATIO'\n )\n\n const sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32))\n\n const msb = mostSignificantBit(sqrtRatioX128)\n\n let r: JSBI\n if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) {\n r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127))\n } else {\n r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb))\n }\n\n let log_2: JSBI = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64))\n\n for (let i = 0; i < 14; i++) {\n r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127))\n const f = JSBI.signedRightShift(r, JSBI.BigInt(128))\n log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i)))\n r = JSBI.signedRightShift(r, f)\n }\n\n const log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141'))\n\n const tickLow = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')),\n JSBI.BigInt(128)\n )\n )\n const tickHigh = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')),\n JSBI.BigInt(128)\n )\n )\n\n return tickLow === tickHigh\n ? tickLow\n : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96)\n ? tickHigh\n : tickLow\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\n\n/**\n * Provides information about ticks\n */\nexport interface TickDataProvider {\n /**\n * Return information corresponding to a specific tick\n * @param tick the tick to load\n */\n getTick(tick: number): Promise<{ liquidityNet: BigintIsh }>\n\n /**\n * Return the next tick that is initialized within a single word\n * @param tick the current tick\n * @param lte whether the next tick should be lte the current tick\n * @param tickSpacing the tick spacing of the pool\n */\n nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>\n}\n\n/**\n * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you\n * do not need to load tick data for your use case.\n */\nexport class NoTickDataProvider implements TickDataProvider {\n private static ERROR_MESSAGE = 'No tick data provider was given'\n async getTick(_tick: number): Promise<{ liquidityNet: BigintIsh }> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n\n async nextInitializedTickWithinOneWord(\n _tick: number,\n _lte: boolean,\n _tickSpacing: number\n ): Promise<[number, boolean]> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n}\n","export function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean {\n for (let i = 0; i < list.length - 1; i++) {\n if (comparator(list[i], list[i + 1]) > 0) {\n return false\n }\n }\n return true\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { isSorted } from './isSorted'\nimport { Tick } from '../entities/tick'\n\nfunction tickComparator(a: Tick, b: Tick) {\n return a.index - b.index\n}\n\n/**\n * Utility methods for interacting with sorted lists of ticks\n */\nexport abstract class TickList {\n /**\n * Cannot be constructed\n */\n private constructor() {}\n\n public static validateList(ticks: Tick[], tickSpacing: number) {\n invariant(tickSpacing > 0, 'TICK_SPACING_NONZERO')\n // ensure ticks are spaced appropriately\n invariant(\n ticks.every(({ index }) => index % tickSpacing === 0),\n 'TICK_SPACING'\n )\n\n // ensure tick liquidity deltas sum to 0\n invariant(\n JSBI.equal(\n ticks.reduce((accumulator, { liquidityNet }) => JSBI.add(accumulator, liquidityNet), ZERO),\n ZERO\n ),\n 'ZERO_NET'\n )\n\n invariant(isSorted(ticks, tickComparator), 'SORTED')\n }\n\n public static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick < ticks[0].index\n }\n\n public static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick >= ticks[ticks.length - 1].index\n }\n\n public static getTick(ticks: readonly Tick[], index: number): Tick {\n const tick = ticks[this.binarySearch(ticks, index)]\n invariant(tick.index === index, 'NOT_CONTAINED')\n return tick\n }\n\n /**\n * Finds the largest tick in the list of ticks that is less than or equal to tick\n * @param ticks list of ticks\n * @param tick tick to find the largest tick that is less than or equal to tick\n * @private\n */\n private static binarySearch(ticks: readonly Tick[], tick: number): number {\n invariant(!this.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n\n let l = 0\n let r = ticks.length - 1\n let i\n while (true) {\n i = Math.floor((l + r) / 2)\n\n if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) {\n return i\n }\n\n if (ticks[i].index < tick) {\n l = i + 1\n } else {\n r = i - 1\n }\n }\n }\n\n public static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick {\n if (lte) {\n invariant(!TickList.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n if (TickList.isAtOrAboveLargest(ticks, tick)) {\n return ticks[ticks.length - 1]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index]\n } else {\n invariant(!this.isAtOrAboveLargest(ticks, tick), 'AT_OR_ABOVE_LARGEST')\n if (this.isBelowSmallest(ticks, tick)) {\n return ticks[0]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index + 1]\n }\n }\n\n public static nextInitializedTickWithinOneWord(\n ticks: readonly Tick[],\n tick: number,\n lte: boolean,\n tickSpacing: number\n ): [number, boolean] {\n const compressed = Math.floor(tick / tickSpacing) // matches rounding in the code\n\n if (lte) {\n const wordPos = compressed >> 8\n const minimum = (wordPos << 8) * tickSpacing\n\n if (TickList.isBelowSmallest(ticks, tick)) {\n return [minimum, false]\n }\n\n const index = TickList.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.max(minimum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n } else {\n const wordPos = (compressed + 1) >> 8\n const maximum = ((wordPos + 1) << 8) * tickSpacing - 1\n\n if (this.isAtOrAboveLargest(ticks, tick)) {\n return [maximum, false]\n }\n\n const index = this.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.min(maximum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n }\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\n\n/**\n * Generated method parameters for executing a call.\n */\nexport interface MethodParameters {\n /**\n * The hex encoded calldata to perform the given operation\n */\n calldata: string\n /**\n * The amount of ether (wei) to send in hex.\n */\n value: string\n}\n\nexport function toHex(bigintIsh: BigintIsh) {\n const bigInt = JSBI.BigInt(bigintIsh)\n let hex = bigInt.toString(16)\n if (hex.length % 2 !== 0) {\n hex = `0${hex}`\n }\n return `0x${hex}`\n}\n","import { pack } from '@ethersproject/solidity'\nimport { Currency, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from '../entities/pool'\nimport { Route } from '../entities/route'\n\n/**\n * Converts a route to a hex encoded path\n * @param route the v3 path to convert to an encoded path\n * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps\n */\nexport function encodeRouteToPath(route: Route, exactOutput: boolean): string {\n const firstInputToken: Token = wrappedCurrency(route.input, route.chainId)\n\n const { path, types } = route.pools.reduce(\n (\n { inputToken, path, types }: { inputToken: Token; path: (string | number)[]; types: string[] },\n pool: Pool,\n index\n ): { inputToken: Token; path: (string | number)[]; types: string[] } => {\n const outputToken: Token = pool.token0.equals(inputToken) ? pool.token1 : pool.token0\n if (index === 0) {\n return {\n inputToken: outputToken,\n types: ['address', 'uint24', 'address'],\n path: [inputToken.address, pool.fee, outputToken.address]\n }\n } else {\n return {\n inputToken: outputToken,\n types: [...types, 'uint24', 'address'],\n path: [...path, pool.fee, outputToken.address]\n }\n }\n },\n { inputToken: firstInputToken, path: [], types: [] }\n )\n\n return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path)\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, sqrt } from '@uniswap/sdk-core'\n\n/**\n * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0\n * @param amount1 the numerator amount, i.e. amount of token1\n * @param amount0 the denominator amount, i.en amount of token0\n */\nexport function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI {\n const numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192))\n const denominator = JSBI.BigInt(amount0)\n const ratioX192 = JSBI.divide(numerator, denominator)\n return sqrt(ratioX192)\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q96 } from '../internalConstants'\n\nfunction maxLiquidityForAmount0Imprecise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n const intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96)\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\nfunction maxLiquidityForAmount0Precise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96)\n const denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n\n return JSBI.divide(numerator, denominator)\n}\n\nfunction maxLiquidityForAmount1(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount1: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\n/**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param sqrtRatioCurrentX96 the current price\n * @param sqrtRatioAX96 price at lower boundary\n * @param sqrtRatioBX96 price at upper boundary\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\nexport function maxLiquidityForAmounts(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioAX96: JSBI,\n sqrtRatioBX96: JSBI,\n amount0: BigintIsh,\n amount1: BigintIsh,\n useFullPrecision: boolean\n): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise\n\n if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) {\n return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0)\n } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) {\n const liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0)\n const liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1)\n return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1\n } else {\n return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns the closest tick that is nearest a given tick and usable for the given tick spacing\n * @param tick the target tick\n * @param tickSpacing the spacing of the pool\n */\nexport function nearestUsableTick(tick: number, tickSpacing: number) {\n invariant(Number.isInteger(tick) && Number.isInteger(tickSpacing), 'INTEGERS')\n invariant(tickSpacing > 0, 'TICK_SPACING')\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, 'TICK_BOUND')\n const rounded = Math.round(tick / tickSpacing) * tickSpacing\n if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing\n else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing\n else return rounded\n}\n","import { Price, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q192 } from '../internalConstants'\nimport { encodeSqrtRatioX96 } from './encodeSqrtRatioX96'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns a price object corresponding to the input tick and the base/quote token\n * Inputs must be tokens because the address order is used to interpret the price represented by the tick\n * @param baseToken the base token of the price\n * @param quoteToken the quote token of the price\n * @param tick the tick for which to return the price\n */\nexport function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price {\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick)\n\n const ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96)\n\n return baseToken.sortsBefore(quoteToken)\n ? new Price(baseToken, quoteToken, Q192, ratioX192)\n : new Price(baseToken, quoteToken, ratioX192, Q192)\n}\n\n/**\n * Returns the first tick for which the given price is greater than or equal to the tick price\n * @param price for which to return the closest tick that represents a price less than or equal to the input price,\n * i.e. the price of the returned tick is less than or equal to the input price\n */\nexport function priceToClosestTick(price: Price): number {\n const sorted = price.baseCurrency.sortsBefore(price.quoteCurrency)\n\n const sqrtRatioX96 = sorted\n ? encodeSqrtRatioX96(price.numerator, price.denominator)\n : encodeSqrtRatioX96(price.denominator, price.numerator)\n\n let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96)\n const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1)\n if (sorted) {\n if (!price.lessThan(nextTickPrice)) {\n tick++\n }\n } else {\n if (!price.greaterThan(nextTickPrice)) {\n tick++\n }\n }\n return tick\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { BigintIsh } from '@uniswap/sdk-core'\nimport { TickMath } from '../utils'\n\nexport interface TickConstructorArgs {\n index: number\n liquidityGross: BigintIsh\n liquidityNet: BigintIsh\n}\n\nexport class Tick {\n public readonly index: number\n public readonly liquidityGross: JSBI\n public readonly liquidityNet: JSBI\n\n constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs) {\n invariant(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK, 'TICK')\n this.index = index\n this.liquidityGross = JSBI.BigInt(liquidityGross)\n this.liquidityNet = JSBI.BigInt(liquidityNet)\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport { TickList } from '../utils/tickList'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { TickDataProvider } from './tickDataProvider'\n\n/**\n * A data provider for ticks that is backed by an in-memory array of ticks.\n */\nexport class TickListDataProvider implements TickDataProvider {\n private ticks: readonly Tick[]\n\n constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number) {\n const ticksMapped: Tick[] = ticks.map(t => (t instanceof Tick ? t : new Tick(t)))\n TickList.validateList(ticksMapped, tickSpacing)\n this.ticks = ticksMapped\n }\n\n async getTick(tick: number): Promise<{ liquidityNet: BigintIsh; liquidityGross: BigintIsh }> {\n return TickList.getTick(this.ticks, tick)\n }\n\n async nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]> {\n return TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)\n }\n}\n","import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { FACTORY_ADDRESS, FeeAmount, TICK_SPACINGS } from '../constants'\nimport { NEGATIVE_ONE, ONE, Q192, ZERO } from '../internalConstants'\nimport { computePoolAddress } from '../utils/computePoolAddress'\nimport { LiquidityMath } from '../utils/liquidityMath'\nimport { SwapMath } from '../utils/swapMath'\nimport { TickMath } from '../utils/tickMath'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { NoTickDataProvider, TickDataProvider } from './tickDataProvider'\nimport { TickListDataProvider } from './tickListDataProvider'\n\ninterface StepComputations {\n sqrtPriceStartX96: JSBI\n tickNext: number\n initialized: boolean\n sqrtPriceNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n}\n\n/**\n * By default, pools will not allow operations that require ticks.\n */\nconst NO_TICK_DATA_PROVIDER_DEFAULT = new NoTickDataProvider()\n\n/**\n * Represents a V3 pool\n */\nexport class Pool {\n public readonly token0: Token\n public readonly token1: Token\n public readonly fee: FeeAmount\n public readonly sqrtRatioX96: JSBI\n public readonly liquidity: JSBI\n public readonly tickCurrent: number\n public readonly tickDataProvider: TickDataProvider\n\n private _token0Price?: Price\n private _token1Price?: Price\n\n public static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount): string {\n return computePoolAddress({ factoryAddress: FACTORY_ADDRESS, fee, tokenA, tokenB })\n }\n\n /**\n * Construct a pool\n * @param tokenA one of the tokens in the pool\n * @param tokenB the other token in the pool\n * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool\n * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0\n * @param liquidity the current value of in range liquidity\n * @param tickCurrent the current tick of the pool\n * @param ticks the current state of the pool ticks or a data provider that can return tick data\n */\n public constructor(\n tokenA: Token,\n tokenB: Token,\n fee: FeeAmount,\n sqrtRatioX96: BigintIsh,\n liquidity: BigintIsh,\n tickCurrent: number,\n ticks: TickDataProvider | (Tick | TickConstructorArgs)[] = NO_TICK_DATA_PROVIDER_DEFAULT\n ) {\n invariant(Number.isInteger(fee) && fee < 1_000_000, 'FEE')\n\n const tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent)\n const nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1)\n invariant(\n JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) &&\n JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96),\n 'PRICE_BOUNDS'\n )\n // always create a copy of the list since we want the pool's tick list to be immutable\n ;[this.token0, this.token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n this.fee = fee\n this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96)\n this.liquidity = JSBI.BigInt(liquidity)\n this.tickCurrent = tickCurrent\n this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0\n */\n public get token0Price(): Price {\n return (\n this._token0Price ??\n (this._token0Price = new Price(\n this.token0,\n this.token1,\n Q192,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)\n ))\n )\n }\n\n /**\n * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1\n */\n public get token1Price(): Price {\n return (\n this._token1Price ??\n (this._token1Price = new Price(\n this.token1,\n this.token0,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96),\n Q192\n ))\n )\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pool.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pool.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n /**\n * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade\n * @param inputAmount the input amount for which to quote the output amount\n */\n public async getOutputAmount(\n inputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n\n const zeroForOne = inputAmount.currency.equals(this.token0)\n\n const { amountCalculated: outputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n inputAmount.quotient,\n sqrtPriceLimitX96\n )\n const outputToken = zeroForOne ? this.token1 : this.token0\n return [\n CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n /**\n * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade\n * @param outputAmount the output amount for which to quote the input amount\n */\n public async getInputAmount(\n outputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency), 'TOKEN')\n\n const zeroForOne = outputAmount.currency.equals(this.token1)\n\n const { amountCalculated: inputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE),\n sqrtPriceLimitX96\n )\n const inputToken = zeroForOne ? this.token0 : this.token1\n return [\n CurrencyAmount.fromRawAmount(inputToken, inputAmount),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n private async swap(\n zeroForOne: boolean,\n amountSpecified: JSBI,\n sqrtPriceLimitX96?: JSBI\n ): Promise<{ amountCalculated: JSBI; sqrtRatioX96: JSBI; liquidity: JSBI; tickCurrent: number }> {\n if (!sqrtPriceLimitX96)\n sqrtPriceLimitX96 = zeroForOne\n ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE)\n : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE)\n\n if (zeroForOne) {\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO), 'RATIO_MIN')\n invariant(JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n } else {\n invariant(JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO), 'RATIO_MAX')\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n }\n\n const exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO)\n\n // keep track of swap state\n const state = {\n amountSpecifiedRemaining: amountSpecified,\n amountCalculated: ZERO,\n sqrtPriceX96: this.sqrtRatioX96,\n tick: this.tickCurrent,\n liquidity: this.liquidity\n }\n\n // start swap while loop\n while (JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96) {\n let step: Partial = {}\n step.sqrtPriceStartX96 = state.sqrtPriceX96\n\n // because each iteration of the while loop rounds, we can't optimize this code (relative to the smart contract)\n // by simply traversing to the next available tick, we instead need to exactly replicate\n // tickBitmap.nextInitializedTickWithinOneWord\n ;[step.tickNext, step.initialized] = await this.tickDataProvider.nextInitializedTickWithinOneWord(\n state.tick,\n zeroForOne,\n this.tickSpacing\n )\n\n if (step.tickNext < TickMath.MIN_TICK) {\n step.tickNext = TickMath.MIN_TICK\n } else if (step.tickNext > TickMath.MAX_TICK) {\n step.tickNext = TickMath.MAX_TICK\n }\n\n step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext)\n ;[state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount] = SwapMath.computeSwapStep(\n state.sqrtPriceX96,\n (zeroForOne\n ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)\n : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96))\n ? sqrtPriceLimitX96\n : step.sqrtPriceNextX96,\n state.liquidity,\n state.amountSpecifiedRemaining,\n this.fee\n )\n\n if (exactInput) {\n state.amountSpecifiedRemaining = JSBI.subtract(\n state.amountSpecifiedRemaining,\n JSBI.add(step.amountIn, step.feeAmount)\n )\n state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut)\n } else {\n state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut)\n state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount))\n }\n\n // TODO\n if (JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) {\n // if the tick is initialized, run the tick transition\n if (step.initialized) {\n let liquidityNet = JSBI.BigInt((await this.tickDataProvider.getTick(step.tickNext)).liquidityNet)\n // if we're moving leftward, we interpret liquidityNet as the opposite sign\n // safe because liquidityNet cannot be type(int128).min\n if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE)\n\n state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet)\n }\n\n state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext\n } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {\n // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved\n state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96)\n }\n }\n\n return {\n amountCalculated: state.amountCalculated,\n sqrtRatioX96: state.sqrtPriceX96,\n liquidity: state.liquidity,\n tickCurrent: state.tick\n }\n }\n\n public get tickSpacing(): number {\n return TICK_SPACINGS[this.fee]\n }\n}\n","import { BigintIsh, MaxUint256, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { maxLiquidityForAmounts } from '../utils/maxLiquidityForAmounts'\nimport { tickToPrice } from '../utils/priceTickConversions'\nimport { SqrtPriceMath } from '../utils/sqrtPriceMath'\nimport { TickMath } from '../utils/tickMath'\nimport { encodeSqrtRatioX96 } from '../utils/encodeSqrtRatioX96'\nimport { Pool } from './pool'\n\ninterface PositionConstructorArgs {\n pool: Pool\n tickLower: number\n tickUpper: number\n liquidity: BigintIsh\n}\n\n/**\n * Represents a position on a Uniswap V3 Pool\n */\nexport class Position {\n public readonly pool: Pool\n public readonly tickLower: number\n public readonly tickUpper: number\n public readonly liquidity: JSBI\n\n // cached resuts for the getters\n private _token0Amount: CurrencyAmount | null = null\n private _token1Amount: CurrencyAmount | null = null\n private _mintAmounts: Readonly<{ amount0: JSBI; amount1: JSBI }> | null = null\n\n /**\n * Constructs a position for a given pool with the given liquidity\n * @param pool for which pool the liquidity is assigned\n * @param liquidity the amount of liquidity that is in the position\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n */\n public constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs) {\n invariant(tickLower < tickUpper, 'TICK_ORDER')\n invariant(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0, 'TICK_LOWER')\n invariant(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0, 'TICK_UPPER')\n\n this.pool = pool\n this.tickLower = tickLower\n this.tickUpper = tickUpper\n this.liquidity = JSBI.BigInt(liquidity)\n }\n\n /**\n * Returns the price of token0 at the lower tick\n */\n public get token0PriceLower(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower)\n }\n\n /**\n * Returns the price of token0 at the upper tick\n */\n public get token0PriceUpper(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper)\n }\n\n /**\n * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price\n */\n public get amount0(): CurrencyAmount {\n if (this._token0Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else {\n this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO)\n }\n }\n return this._token0Amount\n }\n\n /**\n * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price\n */\n public get amount1(): CurrencyAmount {\n if (this._token1Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO)\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n false\n )\n )\n } else {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n }\n }\n return this._token1Amount\n }\n\n /**\n * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage\n * @param slippageTolerance amount by which the price can 'slip'\n * @private\n */\n private ratiosAfterSlippage(slippageTolerance: Percent): { sqrtRatioX96Lower: JSBI; sqrtRatioX96Upper: JSBI } {\n const priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance))\n const priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1))\n let sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator)\n if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) {\n sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1))\n }\n let sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator)\n if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) {\n sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1))\n }\n return {\n sqrtRatioX96Lower,\n sqrtRatioX96Upper\n }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position\n * with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage)\n const positionThatWillBeCreated = Position.fromAmounts({\n pool: this.pool,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper,\n ...this.mintAmounts, // the mint amounts are what will be passed as calldata\n useFullPrecision: false\n })\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const { amount0 } = new Position({\n pool: poolUpper,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n // ...and the lower for amount1\n const { amount1 } = new Position({\n pool: poolLower,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n\n return { amount0, amount1 }\n }\n\n /**\n * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the\n * position with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const amount0 = new Position({\n pool: poolUpper,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount0\n // ...and the lower for amount1\n const amount1 = new Position({\n pool: poolLower,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount1\n\n return { amount0: amount0.quotient, amount1: amount1.quotient }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at\n * the current price for the pool\n */\n public get mintAmounts(): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n if (this._mintAmounts === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: ZERO\n }\n } else if (this.pool.tickCurrent < this.tickUpper) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n true\n )\n }\n } else {\n return {\n amount0: ZERO,\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n )\n }\n }\n }\n return this._mintAmounts\n }\n\n /**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param pool the pool for which the position should be created\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmounts({\n pool,\n tickLower,\n tickUpper,\n amount0,\n amount1,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n amount1: BigintIsh\n useFullPrecision: boolean\n }) {\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower)\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper)\n return new Position({\n pool,\n tickLower,\n tickUpper,\n liquidity: maxLiquidityForAmounts(\n pool.sqrtRatioX96,\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0,\n amount1,\n useFullPrecision\n )\n })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount0 the desired amount of token0\n * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmount0({\n pool,\n tickLower,\n tickUpper,\n amount0,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n useFullPrecision: boolean\n }) {\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0, amount1: MaxUint256, useFullPrecision })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount1 the desired amount of token1\n */\n public static fromAmount1({\n pool,\n tickLower,\n tickUpper,\n amount1\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount1: BigintIsh\n }) {\n // this function always uses full precision,\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0: MaxUint256, amount1, useFullPrecision: true })\n }\n}\n","import invariant from 'tiny-invariant'\n\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from './pool'\n\n/**\n * Represents a list of pools through which a swap can occur\n */\nexport class Route {\n public readonly pools: Pool[]\n public readonly tokenPath: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n private _midPrice: Price | null = null\n\n public constructor(pools: Pool[], input: TInput, output: TOutput) {\n invariant(pools.length > 0, 'POOLS')\n\n const chainId = pools[0].chainId\n const allOnSameChain = pools.every(pool => pool.chainId === chainId)\n invariant(allOnSameChain, 'CHAIN_IDS')\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pools[0].involvesToken(wrappedInput), 'INPUT')\n\n invariant(pools[pools.length - 1].involvesToken(wrappedCurrency(output, chainId)), 'OUTPUT')\n\n /**\n * Normalizes token0-token1 order and selects the next token/fee step to add to the path\n * */\n const tokenPath: Token[] = [wrappedInput]\n for (const [i, pool] of pools.entries()) {\n const currentInputToken = tokenPath[i]\n invariant(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1), 'PATH')\n const nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0\n tokenPath.push(nextToken)\n }\n\n this.pools = pools\n this.tokenPath = tokenPath\n this.input = input\n this.output = output ?? tokenPath[tokenPath.length - 1]\n }\n\n public get chainId(): ChainId | number {\n return this.pools[0].chainId\n }\n\n /**\n * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token.\n */\n public get inputToken(): Token {\n return wrappedCurrency(this.input, this.chainId)\n }\n\n /**\n * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token.\n */\n public get outputToken(): Token {\n return wrappedCurrency(this.output, this.chainId)\n }\n\n /**\n * Returns the mid price of the route\n */\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n\n const price = this.pools.slice(1).reduce(\n ({ nextInput, price }, pool) => {\n return nextInput.equals(pool.token0)\n ? {\n nextInput: pool.token1,\n price: price.multiply(pool.token0Price)\n }\n : {\n nextInput: pool.token0,\n price: price.multiply(pool.token1Price)\n }\n },\n this.pools[0].token0.equals(this.inputToken)\n ? {\n nextInput: this.pools[0].token1,\n price: this.pools[0].token0Price\n }\n : {\n nextInput: this.pools[0].token0,\n price: this.pools[0].token1Price\n }\n ).price\n\n return (this._midPrice = new Price(this.input, this.output, price.denominator, price.numerator))\n }\n}\n","import {\n ChainId,\n Currency,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n CurrencyAmount,\n TradeType,\n wrappedCurrency,\n wrappedCurrencyAmount,\n Token,\n computePriceImpact\n} from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { Pool } from './pool'\nimport { Route } from './route'\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n // consider the number of hops since each hop costs gas\n return a.route.tokenPath.length - b.route.tokenPath.length\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pools.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pools the trade goes through.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n\n /**\n * The cached result of the computed execution price\n * @private\n */\n private _executionPrice: Price | undefined\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public get executionPrice(): Price {\n return (\n this._executionPrice ??\n (this._executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n ))\n )\n }\n\n /**\n * The cached result of the price impact computation\n * @private\n */\n private _priceImpact: Percent | undefined\n\n /**\n * Returns the percent difference between the route's mid price and the price impact\n */\n public get priceImpact(): Percent {\n return (\n this._priceImpact ??\n (this._priceImpact = computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount))\n )\n }\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static async exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static async exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n /**\n * Constructs a trade by simulating swaps through the given route\n * @param route route to swap through\n * @param amount the amount specified, either input or output, depending on tradeType\n * @param tradeType whether the trade is an exact input or exact output swap\n */\n public static async fromRoute(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ): Promise> {\n const amounts: CurrencyAmount[] = new Array(route.tokenPath.length)\n let inputAmount: CurrencyAmount\n let outputAmount: CurrencyAmount\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n amounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.tokenPath.length - 1; i++) {\n const pool = route.pools[i]\n const [outputAmount] = await pool.getOutputAmount(amounts[i])\n amounts[i + 1] = outputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n amounts[amounts.length - 1].numerator,\n amounts[amounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n amounts[amounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.tokenPath.length - 1; i > 0; i--) {\n const pool = route.pools[i - 1]\n const [inputAmount] = await pool.getInputAmount(amounts[i])\n amounts[i - 1] = inputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n\n return new Trade({\n route,\n tradeType,\n inputAmount,\n outputAmount\n })\n }\n\n /**\n * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade\n * elsewhere and do not have any tick data\n * @param constructorArguments the arguments passed to the trade constructor\n */\n public static createUncheckedTrade<\n TInput extends Currency,\n TOutput extends Currency,\n TTradeType extends TradeType\n >(constructorArguments: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }): Trade {\n return new Trade(constructorArguments)\n }\n\n /**\n * Construct a trade by passing in the pre-computed property values\n * @param route the route through which the trade occurs\n * @param inputAmount the amount of input paid in the trade\n * @param outputAmount the amount of output received in the trade\n * @param tradeType the type of trade, exact input or exact output\n */\n private constructor({\n route,\n inputAmount,\n outputAmount,\n tradeType\n }: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }) {\n invariant(currencyEquals(inputAmount.currency, route.input), 'INPUT_CURRENCY_MATCH')\n invariant(currencyEquals(outputAmount.currency, route.output), 'OUTPUT_CURRENCY_MATCH')\n this.route = route\n this.inputAmount = inputAmount\n this.outputAmount = outputAmount\n this.tradeType = tradeType\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactIn(\n pools: Pool[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountIn.currency) && !currencyEquals(pool.token1, amountIn.currency)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = await pool.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (amountOut.currency.isToken && amountOut.currency.equals(tokenOut)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([...currentPools, pool], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactIn(\n poolsExcludingThisPool,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPools, pool],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param currencyAmountOut the desired currency amount out\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactOut(\n pools: Pool[],\n currencyIn: Currency,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? currencyIn.chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountOut.currency) && !currencyEquals(pool.token1, amountOut.currency)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = await pool.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pool\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([pool, ...currentPools], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactOut(\n poolsExcludingThisPool,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pool, ...currentPools],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { BigintIsh, Token } from '@uniswap/sdk-core'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'\nimport { toHex } from './utils'\n\nexport interface StandardPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n amount: BigintIsh\n deadline: BigintIsh\n}\n\nexport interface AllowedPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n nonce: BigintIsh\n expiry: BigintIsh\n}\n\nexport type PermitOptions = StandardPermitArguments | AllowedPermitArguments\n\n// type guard\nfunction isAllowedPermit(permitOptions: PermitOptions): permitOptions is AllowedPermitArguments {\n return 'nonce' in permitOptions\n}\n\nexport abstract class SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n protected constructor() {}\n\n protected static encodePermit(token: Token, options: PermitOptions) {\n return isAllowedPermit(options)\n ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [\n token.address,\n toHex(options.nonce),\n toHex(options.expiry),\n options.v,\n options.r,\n options.s\n ])\n : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [\n token.address,\n toHex(options.amount),\n toHex(options.deadline),\n options.v,\n options.r,\n options.s\n ])\n }\n}\n","import {\n BigintIsh,\n ChainId,\n Percent,\n Token,\n CurrencyAmount,\n validateAndParseAddress,\n WETH9,\n Currency\n} from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { Position } from './entities/position'\nimport { ONE, ZERO } from './internalConstants'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { ADDRESS_ZERO } from './constants'\n\nconst MaxUint128 = toHex(JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(128)), JSBI.BigInt(1)))\n\nexport interface MintSpecificOptions {\n /**\n * The account that should receive the minted NFT.\n */\n recipient: string\n\n /**\n * Creates pool if not initialized before mint.\n */\n createPool?: boolean\n}\n\nexport interface IncreaseSpecificOptions {\n /**\n * Indicates the ID of the position to increase liquidity for.\n */\n tokenId: BigintIsh\n}\n\n/**\n * Options for producing the calldata to add liquidity.\n */\nexport interface CommonAddLiquidityOptions {\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false\n */\n useEther?: boolean\n\n /**\n * The optional permit parameters for spending token0\n */\n token0Permit?: PermitOptions\n\n /**\n * The optional permit parameters for spending token1\n */\n token1Permit?: PermitOptions\n}\n\nexport type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions\nexport type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions\n\nexport type AddLiquidityOptions = MintOptions | IncreaseOptions\n\n// type guard\nfunction isMint(options: AddLiquidityOptions): options is MintOptions {\n return Object.keys(options).some(k => k === 'recipient')\n}\n\nexport interface CollectOptions {\n /**\n * Indicates the ID of the position to collect for.\n */\n tokenId: BigintIsh\n\n /**\n * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed0: CurrencyAmount\n\n /**\n * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed1: CurrencyAmount\n\n /**\n * The account that should receive the tokens.\n */\n recipient: string\n}\n\nexport interface NFTPermitOptions {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n deadline: BigintIsh\n spender: string\n}\n\n/**\n * Options for producing the calldata to exit a position.\n */\nexport interface RemoveLiquidityOptions {\n /**\n * The ID of the token to exit\n */\n tokenId: BigintIsh\n\n /**\n * The percentage of position liquidity to exit.\n */\n liquidityPercentage: Percent\n\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether the NFT should be burned if the entire position is being exited, by default false.\n */\n burnToken?: boolean\n\n /**\n * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT\n */\n permit?: NFTPermitOptions\n\n /**\n * Parameters to be passed on to collect\n */\n collectOptions: Omit\n}\n\nexport abstract class NonfungiblePositionManager extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n public static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters {\n invariant(JSBI.greaterThan(position.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n const calldatas: string[] = []\n\n // get amounts\n const { amount0: amount0Desired, amount1: amount1Desired } = position.mintAmounts\n\n // adjust for slippage\n const minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance)\n const amount0Min = toHex(minimumAmounts.amount0)\n const amount1Min = toHex(minimumAmounts.amount1)\n\n const deadline = toHex(options.deadline)\n\n // create pool if needed\n if (isMint(options) && options.createPool) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [\n position.pool.token0.address,\n position.pool.token1.address,\n position.pool.fee,\n toHex(position.pool.sqrtRatioX96)\n ])\n )\n }\n\n // permits if necessary\n if (options.token0Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit))\n }\n if (options.token1Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit))\n }\n\n // mint\n if (isMint(options)) {\n const recipient: string = validateAndParseAddress(options.recipient)\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [\n {\n token0: position.pool.token0.address,\n token1: position.pool.token1.address,\n fee: position.pool.fee,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper,\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n recipient,\n deadline\n }\n ])\n )\n } else {\n // increase\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [\n {\n tokenId: toHex(options.tokenId),\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n deadline\n }\n ])\n )\n }\n\n let value: string = toHex(0)\n\n if (options.useEther) {\n const weth = WETH9[position.pool.chainId as ChainId]\n invariant(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth)), 'NO_WETH')\n\n const wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired\n\n // we only need to refund if we're actually sending ETH\n if (JSBI.greaterThan(wethValue, ZERO)) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n value = toHex(wethValue)\n }\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n\n private static encodeCollect(options: CollectOptions): string[] {\n const calldatas: string[] = []\n\n const tokenId = toHex(options.tokenId)\n\n const involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther\n\n const recipient = validateAndParseAddress(options.recipient)\n\n // collect\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [\n {\n tokenId,\n recipient: involvesETH ? ADDRESS_ZERO : recipient,\n amount0Max: MaxUint128,\n amount1Max: MaxUint128\n }\n ])\n )\n\n if (involvesETH) {\n const ethAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed0.quotient\n : options.expectedCurrencyOwed1.quotient\n const token = options.expectedCurrencyOwed0.currency.isEther\n ? (options.expectedCurrencyOwed1.currency as Token)\n : (options.expectedCurrencyOwed0.currency as Token)\n const tokenAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed1.quotient\n : options.expectedCurrencyOwed0.quotient\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])\n )\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [\n token.address,\n toHex(tokenAmount),\n recipient\n ])\n )\n }\n\n return calldatas\n }\n\n public static collectCallParameters(options: CollectOptions): MethodParameters {\n const calldatas: string[] = NonfungiblePositionManager.encodeCollect(options)\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n\n /**\n * Produces the calldata for completely or partially exiting a position\n * @param position the position to exit\n * @param options additional information necessary for generating the calldata\n */\n public static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters {\n const calldatas: string[] = []\n\n const deadline = toHex(options.deadline)\n const tokenId = toHex(options.tokenId)\n\n // construct a partial position with a percentage of liquidity\n const partialPosition = new Position({\n pool: position.pool,\n liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper\n })\n invariant(JSBI.greaterThan(partialPosition.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n // slippage-adjusted underlying amounts\n const { amount0: amount0Min, amount1: amount1Min } = partialPosition.burnAmountsWithSlippage(\n options.slippageTolerance\n )\n\n if (options.permit) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [\n validateAndParseAddress(options.permit.spender),\n tokenId,\n toHex(options.permit.deadline),\n options.permit.v,\n options.permit.r,\n options.permit.s\n ])\n )\n }\n\n // remove liquidity\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [\n {\n tokenId,\n liquidity: toHex(partialPosition.liquidity),\n amount0Min: toHex(amount0Min),\n amount1Min: toHex(amount1Min),\n deadline\n }\n ])\n )\n\n const { expectedCurrencyOwed0, expectedCurrencyOwed1, ...rest } = options.collectOptions\n calldatas.push(\n ...NonfungiblePositionManager.encodeCollect({\n tokenId: options.tokenId,\n // add the underlying value to the expected currency already owed\n expectedCurrencyOwed0: expectedCurrencyOwed0.add(\n expectedCurrencyOwed0.currency.isEther\n ? CurrencyAmount.ether(amount0Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency as Token, amount0Min)\n ),\n expectedCurrencyOwed1: expectedCurrencyOwed1.add(\n expectedCurrencyOwed1.currency.isEther\n ? CurrencyAmount.ether(amount1Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency as Token, amount1Min)\n ),\n ...rest\n })\n )\n\n if (options.liquidityPercentage.equalTo(ONE)) {\n if (options.burnToken) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId]))\n }\n } else {\n invariant(options.burnToken !== true, 'CANNOT_BURN')\n }\n\n return {\n calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { BigintIsh, Currency, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { Trade } from './entities/trade'\nimport { ADDRESS_ZERO } from './constants'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { encodeRouteToPath } from './utils'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'\n\nexport interface FeeOptions {\n /**\n * The percent of the output that will be taken as a fee.\n */\n fee: Percent\n\n /**\n * The recipient of the fee.\n */\n recipient: string\n}\n\n/**\n * Options for producing the arguments to send calls to the router.\n */\nexport interface SwapOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n slippageTolerance: Percent\n\n /**\n * The account that should receive the output.\n */\n recipient: string\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * The optional permit parameters for spending the input.\n */\n inputTokenPermit?: PermitOptions\n\n /**\n * The optional price limit for the trade.\n */\n sqrtPriceLimitX96?: BigintIsh\n\n /**\n * Optional information for taking a fee on output.\n */\n fee?: FeeOptions\n}\n\n/**\n * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades.\n */\nexport abstract class SwapRouter extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: SwapOptions\n ): MethodParameters {\n const calldatas: string[] = []\n\n // encode permit if necessary\n if (options.inputTokenPermit) {\n invariant(trade.inputAmount.currency.isToken, 'NON_TOKEN_PERMIT')\n calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit))\n }\n\n const recipient: string = validateAndParseAddress(options.recipient)\n\n const deadline = toHex(options.deadline)\n\n const amountIn: string = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient)\n const amountOut: string = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient)\n const value: string = trade.inputAmount.currency.isEther ? amountIn : toHex(0)\n\n // flag for whether the trade is single hop or not\n const singleHop = trade.route.pools.length === 1\n\n // flag for whether a refund needs to happen\n const mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === TradeType.EXACT_OUTPUT\n\n // flags for whether funds should be send first to the router\n const outputIsEther = trade.outputAmount.currency.isEther\n const routerMustCustody = outputIsEther || !!options.fee\n\n if (singleHop) {\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams]))\n } else {\n const exactOutputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams]))\n }\n } else {\n invariant(options.sqrtPriceLimitX96 === undefined, 'MULTIHOP_PRICE_LIMIT')\n\n const path: string = encodeRouteToPath(trade.route, trade.tradeType === TradeType.EXACT_OUTPUT)\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams]))\n } else {\n const exactOutputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams]))\n }\n }\n\n // refund\n if (mustRefund) {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n // unwrap\n if (routerMustCustody) {\n if (!!options.fee) {\n const feeRecipient: string = validateAndParseAddress(options.fee.recipient)\n const fee = toHex(options.fee.fee.multiply(10_000).quotient)\n\n if (outputIsEther) {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])\n )\n } else {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [\n trade.route.tokenPath[trade.route.tokenPath.length - 1].address,\n amountOut,\n recipient,\n fee,\n feeRecipient\n ])\n )\n }\n } else {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient]))\n }\n }\n\n return {\n calldata:\n calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n}\n"],"names":["undefined","FACTORY_ADDRESS","ADDRESS_ZERO","POOL_INIT_CODE_HASH","FeeAmount","TICK_SPACINGS","LOW","MEDIUM","HIGH","NEGATIVE_ONE","JSBI","BigInt","ZERO","ONE","Q96","exponentiate","Q192","computePoolAddress","factoryAddress","tokenA","tokenB","fee","sortsBefore","token0","token1","getCreate2Address","keccak256","defaultAbiCoder","encode","address","LiquidityMath","addDelta","x","y","lessThan","subtract","multiply","add","FullMath","mulDivRoundingUp","a","b","denominator","product","result","divide","notEqual","remainder","MaxUint160","multiplyIn256","bitwiseAnd","MaxUint256","addIn256","sum","SqrtPriceMath","getAmount0Delta","sqrtRatioAX96","sqrtRatioBX96","liquidity","roundUp","greaterThan","numerator1","leftShift","numerator2","getAmount1Delta","getNextSqrtPriceFromInput","sqrtPX96","amountIn","zeroForOne","invariant","getNextSqrtPriceFromAmount0RoundingUp","getNextSqrtPriceFromAmount1RoundingDown","getNextSqrtPriceFromOutput","amountOut","amount","equal","greaterThanOrEqual","quotient","lessThanOrEqual","MAX_FEE","SwapMath","computeSwapStep","sqrtRatioCurrentX96","sqrtRatioTargetX96","amountRemaining","feePips","returnValues","exactIn","amountRemainingLessFee","sqrtRatioNextX96","max","feeAmount","TWO","POWERS_OF_2","map","pow","mostSignificantBit","msb","power","min","signedRightShift","mulShift","val","mulBy","Q32","TickMath","getSqrtRatioAtTick","tick","MIN_TICK","MAX_TICK","Number","isInteger","absTick","ratio","getTickAtSqrtRatio","sqrtRatioX96","MIN_SQRT_RATIO","MAX_SQRT_RATIO","sqrtRatioX128","r","log_2","i","f","bitwiseOr","log_sqrt10001","tickLow","toNumber","tickHigh","NoTickDataProvider","getTick","_tick","Error","ERROR_MESSAGE","nextInitializedTickWithinOneWord","_lte","_tickSpacing","isSorted","list","comparator","length","tickComparator","index","TickList","validateList","ticks","tickSpacing","every","reduce","accumulator","liquidityNet","isBelowSmallest","isAtOrAboveLargest","binarySearch","l","Math","floor","nextInitializedTick","lte","compressed","wordPos","minimum","maximum","toHex","bigintIsh","bigInt","hex","toString","encodeRouteToPath","route","exactOutput","firstInputToken","wrappedCurrency","input","chainId","pools","pool","inputToken","path","types","outputToken","equals","pack","reverse","encodeSqrtRatioX96","amount1","amount0","numerator","ratioX192","sqrt","maxLiquidityForAmount0Imprecise","intermediate","maxLiquidityForAmount0Precise","maxLiquidityForAmount1","maxLiquidityForAmounts","useFullPrecision","maxLiquidityForAmount0","liquidity0","liquidity1","nearestUsableTick","rounded","round","tickToPrice","baseToken","quoteToken","Price","priceToClosestTick","price","sorted","baseCurrency","quoteCurrency","nextTickPrice","Tick","liquidityGross","TickListDataProvider","ticksMapped","t","NO_TICK_DATA_PROVIDER_DEFAULT","Pool","tickCurrent","tickCurrentSqrtRatioX96","nextTickSqrtRatioX96","tickDataProvider","Array","isArray","getAddress","involvesToken","token","priceOf","token0Price","token1Price","getOutputAmount","inputAmount","sqrtPriceLimitX96","currency","swap","outputAmount","amountCalculated","CurrencyAmount","fromRawAmount","getInputAmount","isToken","amountSpecified","exactInput","state","amountSpecifiedRemaining","sqrtPriceX96","step","sqrtPriceStartX96","tickNext","initialized","sqrtPriceNextX96","_token0Price","_token1Price","Position","tickLower","tickUpper","ratiosAfterSlippage","slippageTolerance","priceLower","asFraction","Percent","priceUpper","sqrtRatioX96Lower","sqrtRatioX96Upper","mintAmountsWithSlippage","poolLower","poolUpper","positionThatWillBeCreated","fromAmounts","mintAmounts","burnAmountsWithSlippage","fromAmount0","fromAmount1","_token0Amount","_token1Amount","_mintAmounts","Route","output","allOnSameChain","wrappedInput","tokenPath","entries","currentInputToken","nextToken","push","_midPrice","slice","nextInput","tradeComparator","currencyEquals","equalTo","Trade","tradeType","fromRoute","TradeType","EXACT_INPUT","exactOut","EXACT_OUTPUT","amounts","wrappedCurrencyAmount","fromFractionalAmount","createUncheckedTrade","constructorArguments","minimumAmountOut","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","worstExecutionPrice","bestTradeExactIn","currencyAmountIn","currencyOut","currentPools","nextAmountIn","bestTrades","maxNumResults","maxHops","tokenOut","isInsufficientInputAmountError","sortedInsert","poolsExcludingThisPool","concat","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","_executionPrice","_priceImpact","computePriceImpact","midPrice","isAllowedPermit","permitOptions","SelfPermit","encodePermit","options","INTERFACE","encodeFunctionData","nonce","expiry","v","s","deadline","Interface","abi","MaxUint128","isMint","Object","keys","some","k","NonfungiblePositionManager","addCallParameters","position","calldatas","amount0Desired","amount1Desired","minimumAmounts","amount0Min","amount1Min","createPool","token0Permit","token1Permit","recipient","validateAndParseAddress","tokenId","value","useEther","weth","WETH9","wethValue","calldata","encodeCollect","involvesETH","expectedCurrencyOwed0","isEther","expectedCurrencyOwed1","amount0Max","amount1Max","ethAmount","tokenAmount","collectCallParameters","removeCallParameters","partialPosition","liquidityPercentage","permit","spender","collectOptions","rest","ether","burnToken","SwapRouter","swapCallParameters","trade","inputTokenPermit","singleHop","mustRefund","outputIsEther","routerMustCustody","exactInputSingleParams","amountOutMinimum","exactOutputSingleParams","amountInMaximum","exactInputParams","exactOutputParams","feeRecipient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,UAAU,OAAO,EAAE;AAElC;AACA,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,EAAE,IAAI,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,SAAZ,CAAvD,CAAf;AACD;AACF;;AAED,WAAO;AACLQ,MAAAA,QAAQ,EACNjB,SAAS,CAACzN,MAAV,KAAqB,CAArB,GAAyByN,SAAS,CAAC,CAAD,CAAlC,GAAwCqC,UAAU,CAACvD,SAAX,CAAqBC,kBAArB,CAAwC,WAAxC,EAAqD,CAACiB,SAAD,CAArD,CAFrC;AAGLY,MAAAA,KAAK,EAALA;AAHK,KAAP;AAKD,GAzIH;;AAAA;AAAA,EAAyCjC,UAAzC;AACgB0D,oBAAA,gBAAuB,IAAIhD,aAAJ,CAAcC,mBAAd,CAAvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js deleted file mode 100644 index c3a564e17c8..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@uniswap/sdk-core"),n=t(require("jsbi")),r=t(require("tiny-invariant")),i=require("@ethersproject/abi"),o=require("@ethersproject/address"),u=require("@ethersproject/solidity"),a=require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"),c=require("@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json"),s=require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json");function p(t,e,n,r,i,o,u){try{var a=t[o](u),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function u(t){p(o,r,i,u,a,"next",t)}function a(t){p(o,r,i,u,a,"throw",t)}u(void 0)}))}}function d(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}var g,v,A,T=(function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=Object.create((e&&e.prototype instanceof l?e:l).prototype),o=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var u=n.delegate;if(u){var a=A(u,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,o),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var p={};function l(){}function d(){}function h(){}var f={};f[i]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(q([])));y&&y!==e&&n.call(y,i)&&(f=y);var k=h.prototype=l.prototype=Object.create(f);function g(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var r;this._invoke=function(i,o){function u(){return new e((function(r,u){!function r(i,o,u,a){var c=s(t[i],t,o);if("throw"!==c.type){var p=c.arg,l=p.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,u,a)}),(function(t){r("throw",t,u,a)})):e.resolve(l).then((function(t){p.value=t,u(p)}),(function(t){return r("throw",t,u,a)}))}a(c.arg)}(i,o,r,u)}))}return r=r?r.then(u,u):u()}}function A(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function q(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--i){var o=this.tryEntries[i],u=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(a&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:q(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(A={exports:{}}),A.exports),x="0x0000000000000000000000000000000000000000",I="0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54";(v=exports.FeeAmount||(exports.FeeAmount={}))[v.LOW=500]="LOW",v[v.MEDIUM=3e3]="MEDIUM",v[v.HIGH=1e4]="HIGH";var q=((g={})[exports.FeeAmount.LOW]=10,g[exports.FeeAmount.MEDIUM]=60,g[exports.FeeAmount.HIGH]=200,g),w=n.BigInt(-1),b=n.BigInt(0),R=n.BigInt(1),E=n.exponentiate(n.BigInt(2),n.BigInt(96)),P=n.exponentiate(E,n.BigInt(2));function C(t){var e=t.factoryAddress,n=t.tokenA,r=t.tokenB,a=t.fee,c=n.sortsBefore(r)?[n,r]:[r,n];return o.getCreate2Address(e,u.keccak256(["bytes"],[i.defaultAbiCoder.encode(["address","address","uint24"],[c[0].address,c[1].address,a])]),I)}var S=function(){function t(){}return t.addDelta=function(t,e){return n.lessThan(e,b)?n.subtract(t,n.multiply(e,w)):n.add(t,e)},t}(),O=function(){function t(){}return t.mulDivRoundingUp=function(t,e,r){var i=n.multiply(t,e),o=n.divide(i,r);return n.notEqual(n.remainder(i,r),b)&&(o=n.add(o,R)),o},t}(),N=n.subtract(n.exponentiate(n.BigInt(2),n.BigInt(160)),R);function _(t,r){var i=n.multiply(t,r);return n.bitwiseAnd(i,e.MaxUint256)}var F=function(){function t(){}return t.getAmount0Delta=function(t,e,r,i){if(n.greaterThan(t,e)){var o=[e,t];t=o[0],e=o[1]}var u=n.leftShift(r,n.BigInt(96)),a=n.subtract(e,t);return i?O.mulDivRoundingUp(O.mulDivRoundingUp(u,a,e),R,t):n.divide(n.divide(n.multiply(u,a),e),t)},t.getAmount1Delta=function(t,e,r,i){if(n.greaterThan(t,e)){var o=[e,t];t=o[0],e=o[1]}return i?O.mulDivRoundingUp(r,n.subtract(e,t),E):n.divide(n.multiply(r,n.subtract(e,t)),E)},t.getNextSqrtPriceFromInput=function(t,e,i,o){return n.greaterThan(t,b)||r(!1),n.greaterThan(e,b)||r(!1),o?this.getNextSqrtPriceFromAmount0RoundingUp(t,e,i,!0):this.getNextSqrtPriceFromAmount1RoundingDown(t,e,i,!0)},t.getNextSqrtPriceFromOutput=function(t,e,i,o){return n.greaterThan(t,b)||r(!1),n.greaterThan(e,b)||r(!1),o?this.getNextSqrtPriceFromAmount1RoundingDown(t,e,i,!1):this.getNextSqrtPriceFromAmount0RoundingUp(t,e,i,!1)},t.getNextSqrtPriceFromAmount0RoundingUp=function(t,i,o,u){if(n.equal(o,b))return t;var a=n.leftShift(i,n.BigInt(96));if(u){var c=_(o,t);if(n.equal(n.divide(c,o),t)){var s=(l=n.add(a,c),n.bitwiseAnd(l,e.MaxUint256));if(n.greaterThanOrEqual(s,a))return O.mulDivRoundingUp(a,t,s)}return O.mulDivRoundingUp(a,R,n.add(n.divide(a,t),o))}var p=_(o,t);n.equal(n.divide(p,o),t)||r(!1),n.greaterThan(a,p)||r(!1);var l,d=n.subtract(a,p);return O.mulDivRoundingUp(a,t,d)},t.getNextSqrtPriceFromAmount1RoundingDown=function(t,e,i,o){if(o){var u=n.lessThanOrEqual(i,N)?n.divide(n.leftShift(i,n.BigInt(96)),e):n.divide(n.multiply(i,E),e);return n.add(t,u)}var a=O.mulDivRoundingUp(i,E,e);return n.greaterThan(t,a)||r(!1),n.subtract(t,a)},t}(),L=n.exponentiate(n.BigInt(10),n.BigInt(6)),X=function(){function t(){}return t.computeSwapStep=function(t,e,r,i,o){var u={},a=n.greaterThanOrEqual(t,e),c=n.greaterThanOrEqual(i,b);if(c){var s=n.divide(n.multiply(i,n.subtract(L,n.BigInt(o))),L);u.amountIn=a?F.getAmount0Delta(e,t,r,!0):F.getAmount1Delta(t,e,r,!0),u.sqrtRatioNextX96=n.greaterThanOrEqual(s,u.amountIn)?e:F.getNextSqrtPriceFromInput(t,r,s,a)}else u.amountOut=a?F.getAmount1Delta(e,t,r,!1):F.getAmount0Delta(t,e,r,!1),u.sqrtRatioNextX96=n.greaterThanOrEqual(n.multiply(i,w),u.amountOut)?e:F.getNextSqrtPriceFromOutput(t,r,n.multiply(i,w),a);var p=n.equal(e,u.sqrtRatioNextX96);return a?(u.amountIn=p&&c?u.amountIn:F.getAmount0Delta(u.sqrtRatioNextX96,t,r,!0),u.amountOut=p&&!c?u.amountOut:F.getAmount1Delta(u.sqrtRatioNextX96,t,r,!1)):(u.amountIn=p&&c?u.amountIn:F.getAmount1Delta(t,u.sqrtRatioNextX96,r,!0),u.amountOut=p&&!c?u.amountOut:F.getAmount0Delta(t,u.sqrtRatioNextX96,r,!1)),!c&&n.greaterThan(u.amountOut,n.multiply(i,w))&&(u.amountOut=n.multiply(i,w)),u.feeAmount=c&&n.notEqual(u.sqrtRatioNextX96,e)?n.subtract(i,u.amountIn):O.mulDivRoundingUp(u.amountIn,n.BigInt(o),n.subtract(L,n.BigInt(o))),[u.sqrtRatioNextX96,u.amountIn,u.amountOut,u.feeAmount]},t}(),D=n.BigInt(2),U=[128,64,32,16,8,4,2,1].map((function(t){return[t,n.exponentiate(D,n.BigInt(t))]}));function B(t){n.greaterThan(t,b)||r(!1),n.lessThanOrEqual(t,e.MaxUint256)||r(!1);for(var i,o=0,u=k(U);!(i=u()).done;){var a=i.value,c=a[0];n.greaterThanOrEqual(t,a[1])&&(t=n.signedRightShift(t,n.BigInt(c)),o+=c)}return o}function M(t,e){return n.signedRightShift(n.multiply(t,n.BigInt(e)),n.BigInt(128))}var j=n.exponentiate(n.BigInt(2),n.BigInt(32)),W=function(){function t(){}return t.getSqrtRatioAtTick=function(i){i>=t.MIN_TICK&&i<=t.MAX_TICK&&Number.isInteger(i)||r(!1);var o=i<0?-1*i:i,u=n.BigInt(0!=(1&o)?"0xfffcb933bd6fad37aa2d162d1a594001":"0x100000000000000000000000000000000");return 0!=(2&o)&&(u=M(u,"0xfff97272373d413259a46990580e213a")),0!=(4&o)&&(u=M(u,"0xfff2e50f5f656932ef12357cf3c7fdcc")),0!=(8&o)&&(u=M(u,"0xffe5caca7e10e4e61c3624eaa0941cd0")),0!=(16&o)&&(u=M(u,"0xffcb9843d60f6159c9db58835c926644")),0!=(32&o)&&(u=M(u,"0xff973b41fa98c081472e6896dfb254c0")),0!=(64&o)&&(u=M(u,"0xff2ea16466c96a3843ec78b326b52861")),0!=(128&o)&&(u=M(u,"0xfe5dee046a99a2a811c461f1969c3053")),0!=(256&o)&&(u=M(u,"0xfcbe86c7900a88aedcffc83b479aa3a4")),0!=(512&o)&&(u=M(u,"0xf987a7253ac413176f2b074cf7815e54")),0!=(1024&o)&&(u=M(u,"0xf3392b0822b70005940c7a398e4b70f3")),0!=(2048&o)&&(u=M(u,"0xe7159475a2c29b7443b29c7fa6e889d9")),0!=(4096&o)&&(u=M(u,"0xd097f3bdfd2022b8845ad8f792aa5825")),0!=(8192&o)&&(u=M(u,"0xa9f746462d870fdf8a65dc1f90e061e5")),0!=(16384&o)&&(u=M(u,"0x70d869a156d2a1b890bb3df62baf32f7")),0!=(32768&o)&&(u=M(u,"0x31be135f97d08fd981231505542fcfa6")),0!=(65536&o)&&(u=M(u,"0x9aa508b5b7a84e1c677de54f3e99bc9")),0!=(131072&o)&&(u=M(u,"0x5d6af8dedb81196699c329225ee604")),0!=(262144&o)&&(u=M(u,"0x2216e584f5fa1ea926041bedfe98")),0!=(524288&o)&&(u=M(u,"0x48a170391f7dc42444e8fa2")),i>0&&(u=n.divide(e.MaxUint256,u)),n.greaterThan(n.remainder(u,j),b)?n.add(n.divide(u,j),R):n.divide(u,j)},t.getTickAtSqrtRatio=function(e){n.greaterThanOrEqual(e,t.MIN_SQRT_RATIO)&&n.lessThan(e,t.MAX_SQRT_RATIO)||r(!1);var i,o=n.leftShift(e,n.BigInt(32)),u=B(o);i=n.greaterThanOrEqual(n.BigInt(u),n.BigInt(128))?n.signedRightShift(o,n.BigInt(u-127)):n.leftShift(o,n.BigInt(127-u));for(var a=n.leftShift(n.subtract(n.BigInt(u),n.BigInt(128)),n.BigInt(64)),c=0;c<14;c++){i=n.signedRightShift(n.multiply(i,i),n.BigInt(127));var s=n.signedRightShift(i,n.BigInt(128));a=n.bitwiseOr(a,n.leftShift(s,n.BigInt(63-c))),i=n.signedRightShift(i,s)}var p=n.multiply(a,n.BigInt("255738958999603826347141")),l=n.toNumber(n.signedRightShift(n.subtract(p,n.BigInt("3402992956809132418596140100660247210")),n.BigInt(128))),d=n.toNumber(n.signedRightShift(n.add(p,n.BigInt("291339464771989622907027621153398088495")),n.BigInt(128)));return l===d?l:n.lessThanOrEqual(t.getSqrtRatioAtTick(d),e)?d:l},t}();W.MIN_TICK=-887272,W.MAX_TICK=-W.MIN_TICK,W.MIN_SQRT_RATIO=n.BigInt("4295128739"),W.MAX_SQRT_RATIO=n.BigInt("1461446703485210103287273052203988822378723970342");var H=function(){function t(){}var e=t.prototype;return e.getTick=function(){var e=l(T.mark((function e(n){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error(t.ERROR_MESSAGE);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.nextInitializedTickWithinOneWord=function(){var e=l(T.mark((function e(n,r,i){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error(t.ERROR_MESSAGE);case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),t}();function K(t,e){for(var n=0;n0)return!1;return!0}function G(t,e){return t.index-e.index}H.ERROR_MESSAGE="No tick data provider was given";var Q=function(){function t(){}return t.validateList=function(t,e){e>0||r(!1),t.every((function(t){return t.index%e==0}))||r(!1),n.equal(t.reduce((function(t,e){return n.add(t,e.liquidityNet)}),b),b)||r(!1),K(t,G)||r(!1)},t.isBelowSmallest=function(t,e){return t.length>0||r(!1),e0||r(!1),e>=t[t.length-1].index},t.getTick=function(t,e){var n=t[this.binarySearch(t,e)];return n.index!==e&&r(!1),n},t.binarySearch=function(t,e){this.isBelowSmallest(t,e)&&r(!1);for(var n,i=0,o=t.length-1;;){if(t[n=Math.floor((i+o)/2)].index<=e&&(n===t.length-1||t[n+1].index>e))return n;t[n].index>8<<8)*i;if(t.isBelowSmallest(e,n))return[u,!1];var a=t.nextInitializedTick(e,n,r).index,c=Math.max(u,a);return[c,c===a]}var s=(1+(o+1>>8)<<8)*i-1;if(this.isAtOrAboveLargest(e,n))return[s,!1];var p=this.nextInitializedTick(e,n,r).index,l=Math.min(s,p);return[l,l===p]},t}();function z(t){var e=n.BigInt(t).toString(16);return e.length%2!=0&&(e="0"+e),"0x"+e}function Y(t,n){var r=e.wrappedCurrency(t.input,t.chainId),i=t.pools.reduce((function(t,e,n){var r=t.inputToken,i=t.path,o=t.types,u=e.token0.equals(r)?e.token1:e.token0;return 0===n?{inputToken:u,types:["address","uint24","address"],path:[r.address,e.fee,u.address]}:{inputToken:u,types:[].concat(o,["uint24","address"]),path:[].concat(i,[e.fee,u.address])}}),{inputToken:r,path:[],types:[]}),o=i.path,a=i.types;return n?u.pack(a.reverse(),o.reverse()):u.pack(a,o)}function Z(t,r){var i=n.leftShift(n.BigInt(t),n.BigInt(192)),o=n.BigInt(r),u=n.divide(i,o);return e.sqrt(u)}function $(t,e,r){if(n.greaterThan(t,e)){var i=[e,t];t=i[0],e=i[1]}var o=n.divide(n.multiply(t,e),E);return n.divide(n.multiply(n.BigInt(r),o),n.subtract(e,t))}function J(t,e,r){if(n.greaterThan(t,e)){var i=[e,t];t=i[0],e=i[1]}var o=n.multiply(n.multiply(n.BigInt(r),t),e),u=n.multiply(E,n.subtract(e,t));return n.divide(o,u)}function V(t,e,r){if(n.greaterThan(t,e)){var i=[e,t];t=i[0],e=i[1]}return n.divide(n.multiply(n.BigInt(r),E),n.subtract(e,t))}function tt(t,e,r,i,o,u){if(n.greaterThan(e,r)){var a=[r,e];e=a[0],r=a[1]}var c=u?J:$;if(n.lessThanOrEqual(t,e))return c(e,r,i);if(n.lessThan(t,r)){var s=c(t,r,i),p=V(e,t,o);return n.lessThan(s,p)?s:p}return V(e,r,o)}function et(t,r,i){var o=W.getSqrtRatioAtTick(i),u=n.multiply(o,o);return t.sortsBefore(r)?new e.Price(t,r,P,u):new e.Price(t,r,u,P)}var nt=function(t){var e=t.index,i=t.liquidityGross,o=t.liquidityNet;e>=W.MIN_TICK&&e<=W.MAX_TICK||r(!1),this.index=e,this.liquidityGross=n.BigInt(i),this.liquidityNet=n.BigInt(o)},rt=function(){function t(t,e){var n=t.map((function(t){return t instanceof nt?t:new nt(t)}));Q.validateList(n,e),this.ticks=n}var e=t.prototype;return e.getTick=function(){var t=l(T.mark((function t(e){return T.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Q.getTick(this.ticks,e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.nextInitializedTickWithinOneWord=function(){var t=l(T.mark((function t(e,n,r){return T.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Q.nextInitializedTickWithinOneWord(this.ticks,e,n,r));case 1:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),t}(),it=new H,ot=function(){function t(t,e,i,o,u,a,c){void 0===c&&(c=it),Number.isInteger(i)&&i<1e6||r(!1);var s=W.getSqrtRatioAtTick(a),p=W.getSqrtRatioAtTick(a+1);n.greaterThanOrEqual(n.BigInt(o),s)&&n.lessThanOrEqual(n.BigInt(o),p)||r(!1);var l=t.sortsBefore(e)?[t,e]:[e,t];this.token0=l[0],this.token1=l[1],this.fee=i,this.sqrtRatioX96=n.BigInt(o),this.liquidity=n.BigInt(u),this.tickCurrent=a,this.tickDataProvider=Array.isArray(c)?new rt(c,q[i]):c}t.getAddress=function(t,e,n){return C({factoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",fee:n,tokenA:t,tokenB:e})};var i=t.prototype;return i.involvesToken=function(t){return t.equals(this.token0)||t.equals(this.token1)},i.priceOf=function(t){return this.involvesToken(t)||r(!1),t.equals(this.token0)?this.token0Price:this.token1Price},i.getOutputAmount=function(){var i=l(T.mark((function i(o,u){var a,c,s,p,l;return T.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.involvesToken(o.currency)||r(!1),a=o.currency.equals(this.token0),i.next=4,this.swap(a,o.quotient,u);case 4:return s=(c=i.sent).sqrtRatioX96,p=c.liquidity,l=c.tickCurrent,i.abrupt("return",[e.CurrencyAmount.fromRawAmount(a?this.token1:this.token0,n.multiply(c.amountCalculated,w)),new t(this.token0,this.token1,this.fee,s,p,l,this.tickDataProvider)]);case 11:case"end":return i.stop()}}),i,this)})));return function(t,e){return i.apply(this,arguments)}}(),i.getInputAmount=function(){var i=l(T.mark((function i(o,u){var a,c,s,p,l;return T.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o.currency.isToken&&this.involvesToken(o.currency)||r(!1),a=o.currency.equals(this.token1),i.next=4,this.swap(a,n.multiply(o.quotient,w),u);case 4:return s=(c=i.sent).sqrtRatioX96,p=c.liquidity,l=c.tickCurrent,i.abrupt("return",[e.CurrencyAmount.fromRawAmount(a?this.token0:this.token1,c.amountCalculated),new t(this.token0,this.token1,this.fee,s,p,l,this.tickDataProvider)]);case 11:case"end":return i.stop()}}),i,this)})));return function(t,e){return i.apply(this,arguments)}}(),i.swap=function(){var t=l(T.mark((function t(e,i,o){var u,a,c,s,p,l;return T.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o||(o=e?n.add(W.MIN_SQRT_RATIO,R):n.subtract(W.MAX_SQRT_RATIO,R)),e?(n.greaterThan(o,W.MIN_SQRT_RATIO)||r(!1),n.lessThan(o,this.sqrtRatioX96)||r(!1)):(n.lessThan(o,W.MAX_SQRT_RATIO)||r(!1),n.greaterThan(o,this.sqrtRatioX96)||r(!1)),u=n.greaterThanOrEqual(i,b),a={amountSpecifiedRemaining:i,amountCalculated:b,sqrtPriceX96:this.sqrtRatioX96,tick:this.tickCurrent,liquidity:this.liquidity};case 4:if(!n.notEqual(a.amountSpecifiedRemaining,b)||a.sqrtPriceX96==o){t.next=35;break}return(c={}).sqrtPriceStartX96=a.sqrtPriceX96,t.next=9,this.tickDataProvider.nextInitializedTickWithinOneWord(a.tick,e,this.tickSpacing);case 9:if(c.tickNext=(s=t.sent)[0],c.initialized=s[1],c.tickNextW.MAX_TICK&&(c.tickNext=W.MAX_TICK),c.sqrtPriceNextX96=W.getSqrtRatioAtTick(c.tickNext),p=X.computeSwapStep(a.sqrtPriceX96,(e?n.lessThan(c.sqrtPriceNextX96,o):n.greaterThan(c.sqrtPriceNextX96,o))?o:c.sqrtPriceNextX96,a.liquidity,a.amountSpecifiedRemaining,this.fee),a.sqrtPriceX96=p[0],c.amountIn=p[1],c.amountOut=p[2],c.feeAmount=p[3],u?(a.amountSpecifiedRemaining=n.subtract(a.amountSpecifiedRemaining,n.add(c.amountIn,c.feeAmount)),a.amountCalculated=n.subtract(a.amountCalculated,c.amountOut)):(a.amountSpecifiedRemaining=n.add(a.amountSpecifiedRemaining,c.amountOut),a.amountCalculated=n.add(a.amountCalculated,n.add(c.amountIn,c.feeAmount))),!n.equal(a.sqrtPriceX96,c.sqrtPriceNextX96)){t.next=32;break}if(!c.initialized){t.next=29;break}return t.t0=n,t.next=25,this.tickDataProvider.getTick(c.tickNext);case 25:t.t1=t.sent.liquidityNet,l=t.t0.BigInt.call(t.t0,t.t1),e&&(l=n.multiply(l,w)),a.liquidity=S.addDelta(a.liquidity,l);case 29:a.tick=e?c.tickNext-1:c.tickNext,t.next=33;break;case 32:a.sqrtPriceX96!=c.sqrtPriceStartX96&&(a.tick=W.getTickAtSqrtRatio(a.sqrtPriceX96));case 33:t.next=4;break;case 35:return t.abrupt("return",{amountCalculated:a.amountCalculated,sqrtRatioX96:a.sqrtPriceX96,liquidity:a.liquidity,tickCurrent:a.tick});case 36:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),h(t,[{key:"token0Price",get:function(){var t;return null!=(t=this._token0Price)?t:this._token0Price=new e.Price(this.token0,this.token1,P,n.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}},{key:"token1Price",get:function(){var t;return null!=(t=this._token1Price)?t:this._token1Price=new e.Price(this.token1,this.token0,n.multiply(this.sqrtRatioX96,this.sqrtRatioX96),P)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"tickSpacing",get:function(){return q[this.fee]}}]),t}(),ut=function(){function t(t){var e=t.pool,i=t.liquidity,o=t.tickLower,u=t.tickUpper;this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,o=W.MIN_TICK&&o%e.tickSpacing==0||r(!1),u<=W.MAX_TICK&&u%e.tickSpacing==0||r(!1),this.pool=e,this.tickLower=o,this.tickUpper=u,this.liquidity=n.BigInt(i)}var i=t.prototype;return i.ratiosAfterSlippage=function(t){var r=this.pool.token0Price.asFraction.multiply(new e.Percent(1).subtract(t)),i=this.pool.token0Price.asFraction.multiply(t.add(1)),o=Z(r.numerator,r.denominator);n.lessThanOrEqual(o,W.MIN_SQRT_RATIO)&&(o=n.add(W.MIN_SQRT_RATIO,n.BigInt(1)));var u=Z(i.numerator,i.denominator);return n.greaterThanOrEqual(u,W.MAX_SQRT_RATIO)&&(u=n.subtract(W.MAX_SQRT_RATIO,n.BigInt(1))),{sqrtRatioX96Lower:o,sqrtRatioX96Upper:u}},i.mintAmountsWithSlippage=function(e){var n=this.ratiosAfterSlippage(e),r=n.sqrtRatioX96Upper,i=n.sqrtRatioX96Lower,o=new ot(this.pool.token0,this.pool.token1,this.pool.fee,i,0,W.getTickAtSqrtRatio(i)),u=new ot(this.pool.token0,this.pool.token1,this.pool.fee,r,0,W.getTickAtSqrtRatio(r)),a=t.fromAmounts(f({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts,{useFullPrecision:!1}));return{amount0:new t({pool:u,liquidity:a.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount0,amount1:new t({pool:o,liquidity:a.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts.amount1}},i.burnAmountsWithSlippage=function(e){var n=this.ratiosAfterSlippage(e),r=n.sqrtRatioX96Upper,i=n.sqrtRatioX96Lower,o=new ot(this.pool.token0,this.pool.token1,this.pool.fee,i,0,W.getTickAtSqrtRatio(i)),u=new t({pool:new ot(this.pool.token0,this.pool.token1,this.pool.fee,r,0,W.getTickAtSqrtRatio(r)),liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,a=new t({pool:o,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount1;return{amount0:u.quotient,amount1:a.quotient}},t.fromAmounts=function(e){var n=e.pool,r=e.tickLower,i=e.tickUpper,o=e.amount0,u=e.amount1,a=e.useFullPrecision,c=W.getSqrtRatioAtTick(r),s=W.getSqrtRatioAtTick(i);return new t({pool:n,tickLower:r,tickUpper:i,liquidity:tt(n.sqrtRatioX96,c,s,o,u,a)})},t.fromAmount0=function(n){return t.fromAmounts({pool:n.pool,tickLower:n.tickLower,tickUpper:n.tickUpper,amount0:n.amount0,amount1:e.MaxUint256,useFullPrecision:n.useFullPrecision})},t.fromAmount1=function(n){return t.fromAmounts({pool:n.pool,tickLower:n.tickLower,tickUpper:n.tickUpper,amount0:e.MaxUint256,amount1:n.amount1,useFullPrecision:!0})},h(t,[{key:"token0PriceLower",get:function(){return et(this.pool.token0,this.pool.token1,this.tickLower)}},{key:"token0PriceUpper",get:function(){return et(this.pool.token0,this.pool.token1,this.tickUpper)}},{key:"amount0",get:function(){return null===this._token0Amount&&(this._token0Amount=e.CurrencyAmount.fromRawAmount(this.pool.token0,this.pool.tickCurrent0||r(!1);var o=t[0].chainId;t.every((function(t){return t.chainId===o}))||r(!1);var u=e.wrappedCurrency(n,o);t[0].involvesToken(u)||r(!1),t[t.length-1].involvesToken(e.wrappedCurrency(i,o))||r(!1);for(var a,c=[u],s=k(t.entries());!(a=s()).done;){var p=a.value,l=p[1],d=c[p[0]];d.equals(l.token0)||d.equals(l.token1)||r(!1);var h=d.equals(l.token0)?l.token1:l.token0;c.push(h)}this.pools=t,this.tokenPath=c,this.input=n,this.output=null!=i?i:c[c.length-1]}return h(t,[{key:"chainId",get:function(){return this.pools[0].chainId}},{key:"inputToken",get:function(){return e.wrappedCurrency(this.input,this.chainId)}},{key:"outputToken",get:function(){return e.wrappedCurrency(this.output,this.chainId)}},{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;var t=this.pools.slice(1).reduce((function(t,e){var n=t.price;return t.nextInput.equals(e.token0)?{nextInput:e.token1,price:n.multiply(e.token0Price)}:{nextInput:e.token0,price:n.multiply(e.token1Price)}}),this.pools[0].token0.equals(this.inputToken)?{nextInput:this.pools[0].token1,price:this.pools[0].token0Price}:{nextInput:this.pools[0].token0,price:this.pools[0].token1Price}).price;return this._midPrice=new e.Price(this.input,this.output,t.denominator,t.numerator)}}]),t}();function ct(t,n){return e.currencyEquals(t.inputAmount.currency,n.inputAmount.currency)||r(!1),e.currencyEquals(t.outputAmount.currency,n.outputAmount.currency)||r(!1),t.outputAmount.equalTo(n.outputAmount)?t.inputAmount.equalTo(n.inputAmount)?t.route.tokenPath.length-n.route.tokenPath.length:t.inputAmount.lessThan(n.inputAmount)?-1:1:t.outputAmount.lessThan(n.outputAmount)?1:-1}var st=function(){function t(t){var n=t.route,i=t.inputAmount,o=t.outputAmount,u=t.tradeType;e.currencyEquals(i.currency,n.input)||r(!1),e.currencyEquals(o.currency,n.output)||r(!1),this.route=n,this.inputAmount=i,this.outputAmount=o,this.tradeType=u}t.exactIn=function(){var n=l(T.mark((function n(r,i){return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",t.fromRoute(r,i,e.TradeType.EXACT_INPUT));case 1:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}(),t.exactOut=function(){var n=l(T.mark((function n(r,i){return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",t.fromRoute(r,i,e.TradeType.EXACT_OUTPUT));case 1:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}(),t.fromRoute=function(){var n=l(T.mark((function n(i,o,u){var a,c,s,p,l,d,h;return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=new Array(i.tokenPath.length),u!==e.TradeType.EXACT_INPUT){n.next=19;break}e.currencyEquals(o.currency,i.input)||r(!1),a[0]=e.wrappedCurrencyAmount(o,i.chainId),p=0;case 5:if(!(p0)){n.next=32;break}return h=i.pools[d-1],n.next=26,h.getInputAmount(a[d]);case 26:a[d-1]=n.sent[0];case 29:d--,n.next=22;break;case 32:c=e.CurrencyAmount.fromFractionalAmount(i.input,a[0].numerator,a[0].denominator),s=e.CurrencyAmount.fromFractionalAmount(i.output,o.numerator,o.denominator);case 34:return n.abrupt("return",new t({route:i,tradeType:u,inputAmount:c,outputAmount:s}));case 35:case"end":return n.stop()}}),n)})));return function(t,e,r){return n.apply(this,arguments)}}(),t.createUncheckedTrade=function(e){return new t(e)};var n=t.prototype;return n.minimumAmountOut=function(t){if(t.lessThan(b)&&r(!1),this.tradeType===e.TradeType.EXACT_OUTPUT)return this.outputAmount;var n=new e.Fraction(R).add(t).invert().multiply(this.outputAmount.quotient).quotient;return e.CurrencyAmount.fromRawAmount(this.outputAmount.currency,n)},n.maximumAmountIn=function(t){if(t.lessThan(b)&&r(!1),this.tradeType===e.TradeType.EXACT_INPUT)return this.inputAmount;var n=new e.Fraction(R).add(t).multiply(this.inputAmount.quotient).quotient;return e.CurrencyAmount.fromRawAmount(this.inputAmount.currency,n)},n.worstExecutionPrice=function(t){return new e.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(t).quotient,this.minimumAmountOut(t).quotient)},t.bestTradeExactIn=function(){var n=l(T.mark((function n(i,o,u,a,c,s,p){var l,d,h,f,m,y,k,g,v,A,x,I;return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:h=void 0===(d=(l=void 0===a?{}:a).maxNumResults)?3:d,m=void 0===(f=l.maxHops)?3:f,void 0===c&&(c=[]),void 0===s&&(s=o),void 0===p&&(p=[]),i.length>0||r(!1),m>0||r(!1),o===s||c.length>0||r(!1),void 0===(y=s.currency.isToken?s.currency.chainId:u.isToken?u.chainId:void 0)&&r(!1),k=e.wrappedCurrencyAmount(s,y),g=e.wrappedCurrency(u,y),v=0;case 12:if(!(v1&&i.length>1)){n.next=45;break}return I=i.slice(0,v).concat(i.slice(v+1,i.length)),n.next=45,t.bestTradeExactIn(I,o,u,{maxNumResults:h,maxHops:m-1},[].concat(c,[A]),x,p);case 45:v++,n.next=12;break;case 48:return n.abrupt("return",p);case 49:case"end":return n.stop()}}),n,null,[[17,25]])})));return function(t,e,r,i,o,u,a){return n.apply(this,arguments)}}(),t.bestTradeExactOut=function(){var n=l(T.mark((function n(i,o,u,a,c,s,p){var l,d,h,f,m,y,k,g,v,A,x,I;return T.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:h=void 0===(d=(l=void 0===a?{}:a).maxNumResults)?3:d,m=void 0===(f=l.maxHops)?3:f,void 0===c&&(c=[]),void 0===s&&(s=u),void 0===p&&(p=[]),i.length>0||r(!1),m>0||r(!1),u===s||c.length>0||r(!1),void 0===(y=s.currency.isToken?s.currency.chainId:o.isToken?o.chainId:void 0)&&r(!1),k=e.wrappedCurrencyAmount(s,y),g=e.wrappedCurrency(o,y),v=0;case 12:if(!(v1&&i.length>1)){n.next=45;break}return I=i.slice(0,v).concat(i.slice(v+1,i.length)),n.next=45,t.bestTradeExactOut(I,o,u,{maxNumResults:h,maxHops:m-1},[A].concat(c),x,p);case 45:v++,n.next=12;break;case 48:return n.abrupt("return",p);case 49:case"end":return n.stop()}}),n,null,[[17,25]])})));return function(t,e,r,i,o,u,a){return n.apply(this,arguments)}}(),h(t,[{key:"executionPrice",get:function(){var t;return null!=(t=this._executionPrice)?t:this._executionPrice=new e.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient)}},{key:"priceImpact",get:function(){var t;return null!=(t=this._priceImpact)?t:this._priceImpact=e.computePriceImpact(this.route.midPrice,this.inputAmount,this.outputAmount)}}]),t}(),pt=function(){function t(){}return t.encodePermit=function(e,n){return"nonce"in n?t.INTERFACE.encodeFunctionData("selfPermitAllowed",[e.address,z(n.nonce),z(n.expiry),n.v,n.r,n.s]):t.INTERFACE.encodeFunctionData("selfPermit",[e.address,z(n.amount),z(n.deadline),n.v,n.r,n.s])},t}();pt.INTERFACE=new i.Interface(c.abi);var lt=z(n.subtract(n.exponentiate(n.BigInt(2),n.BigInt(128)),n.BigInt(1)));function dt(t){return Object.keys(t).some((function(t){return"recipient"===t}))}var ht=function(t){function i(){return t.call(this)||this}return m(i,t),i.addCallParameters=function(t,o){n.greaterThan(t.liquidity,b)||r(!1);var u=[],a=t.mintAmounts,c=a.amount0,s=a.amount1,p=t.mintAmountsWithSlippage(o.slippageTolerance),l=z(p.amount0),d=z(p.amount1),h=z(o.deadline);if(dt(o)&&o.createPool&&u.push(i.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[t.pool.token0.address,t.pool.token1.address,t.pool.fee,z(t.pool.sqrtRatioX96)])),o.token0Permit&&u.push(i.encodePermit(t.pool.token0,o.token0Permit)),o.token1Permit&&u.push(i.encodePermit(t.pool.token1,o.token1Permit)),dt(o)){var f=e.validateAndParseAddress(o.recipient);u.push(i.INTERFACE.encodeFunctionData("mint",[{token0:t.pool.token0.address,token1:t.pool.token1.address,fee:t.pool.fee,tickLower:t.tickLower,tickUpper:t.tickUpper,amount0Desired:z(c),amount1Desired:z(s),amount0Min:l,amount1Min:d,recipient:f,deadline:h}]))}else u.push(i.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:z(o.tokenId),amount0Desired:z(c),amount1Desired:z(s),amount0Min:l,amount1Min:d,deadline:h}]));var m=z(0);if(o.useEther){var y=e.WETH9[t.pool.chainId];y&&(t.pool.token0.equals(y)||t.pool.token1.equals(y))||r(!1);var k=t.pool.token0.equals(y)?c:s;n.greaterThan(k,b)&&u.push(i.INTERFACE.encodeFunctionData("refundETH")),m=z(k)}return{calldata:1===u.length?u[0]:i.INTERFACE.encodeFunctionData("multicall",[u]),value:m}},i.encodeCollect=function(t){var n=[],r=z(t.tokenId),o=t.expectedCurrencyOwed0.currency.isEther||t.expectedCurrencyOwed1.currency.isEther,u=e.validateAndParseAddress(t.recipient);if(n.push(i.INTERFACE.encodeFunctionData("collect",[{tokenId:r,recipient:o?x:u,amount0Max:lt,amount1Max:lt}])),o){var a=t.expectedCurrencyOwed0.currency.isEther?t.expectedCurrencyOwed1.currency:t.expectedCurrencyOwed0.currency,c=t.expectedCurrencyOwed0.currency.isEther?t.expectedCurrencyOwed1.quotient:t.expectedCurrencyOwed0.quotient;n.push(i.INTERFACE.encodeFunctionData("unwrapWETH9",[z(t.expectedCurrencyOwed0.currency.isEther?t.expectedCurrencyOwed0.quotient:t.expectedCurrencyOwed1.quotient),u])),n.push(i.INTERFACE.encodeFunctionData("sweepToken",[a.address,z(c),u]))}return n},i.collectCallParameters=function(t){var e=i.encodeCollect(t);return{calldata:1===e.length?e[0]:i.INTERFACE.encodeFunctionData("multicall",[e]),value:z(0)}},i.removeCallParameters=function(t,o){var u=[],a=z(o.deadline),c=z(o.tokenId),s=new ut({pool:t.pool,liquidity:o.liquidityPercentage.multiply(t.liquidity).quotient,tickLower:t.tickLower,tickUpper:t.tickUpper});n.greaterThan(s.liquidity,b)||r(!1);var p=s.burnAmountsWithSlippage(o.slippageTolerance),l=p.amount0,d=p.amount1;o.permit&&u.push(i.INTERFACE.encodeFunctionData("permit",[e.validateAndParseAddress(o.permit.spender),c,z(o.permit.deadline),o.permit.v,o.permit.r,o.permit.s])),u.push(i.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:c,liquidity:z(s.liquidity),amount0Min:z(l),amount1Min:z(d),deadline:a}]));var h=o.collectOptions,m=h.expectedCurrencyOwed0,y=h.expectedCurrencyOwed1,k=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(h,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return u.push.apply(u,i.encodeCollect(f({tokenId:o.tokenId,expectedCurrencyOwed0:m.add(m.currency.isEther?e.CurrencyAmount.ether(l):e.CurrencyAmount.fromRawAmount(m.currency,l)),expectedCurrencyOwed1:y.add(y.currency.isEther?e.CurrencyAmount.ether(d):e.CurrencyAmount.fromRawAmount(y.currency,d))},k))),o.liquidityPercentage.equalTo(R)?o.burnToken&&u.push(i.INTERFACE.encodeFunctionData("burn",[c])):!0===o.burnToken&&r(!1),{calldata:i.INTERFACE.encodeFunctionData("multicall",[u]),value:z(0)}},i}(pt);ht.INTERFACE=new i.Interface(a.abi);var ft=function(t){function n(){return t.call(this)||this}return m(n,t),n.swapCallParameters=function(t,i){var o=[];i.inputTokenPermit&&(t.inputAmount.currency.isToken||r(!1),o.push(n.encodePermit(t.inputAmount.currency,i.inputTokenPermit)));var u=e.validateAndParseAddress(i.recipient),a=z(i.deadline),c=z(t.maximumAmountIn(i.slippageTolerance).quotient),s=z(t.minimumAmountOut(i.slippageTolerance).quotient),p=t.inputAmount.currency.isEther?c:z(0),l=t.inputAmount.currency.isEther&&t.tradeType===e.TradeType.EXACT_OUTPUT,d=t.outputAmount.currency.isEther,h=d||!!i.fee;if(1===t.route.pools.length)if(t.tradeType===e.TradeType.EXACT_INPUT){var f,m={tokenIn:t.route.tokenPath[0].address,tokenOut:t.route.tokenPath[1].address,fee:t.route.pools[0].fee,recipient:h?x:u,deadline:a,amountIn:c,amountOutMinimum:s,sqrtPriceLimitX96:z(null!=(f=i.sqrtPriceLimitX96)?f:0)};o.push(n.INTERFACE.encodeFunctionData("exactInputSingle",[m]))}else{var y,k={tokenIn:t.route.tokenPath[0].address,tokenOut:t.route.tokenPath[1].address,fee:t.route.pools[0].fee,recipient:h?x:u,deadline:a,amountOut:s,amountInMaximum:c,sqrtPriceLimitX96:z(null!=(y=i.sqrtPriceLimitX96)?y:0)};o.push(n.INTERFACE.encodeFunctionData("exactOutputSingle",[k]))}else{void 0!==i.sqrtPriceLimitX96&&r(!1);var g=Y(t.route,t.tradeType===e.TradeType.EXACT_OUTPUT);o.push(t.tradeType===e.TradeType.EXACT_INPUT?n.INTERFACE.encodeFunctionData("exactInput",[{path:g,recipient:h?x:u,deadline:a,amountIn:c,amountOutMinimum:s}]):n.INTERFACE.encodeFunctionData("exactOutput",[{path:g,recipient:h?x:u,deadline:a,amountOut:s,amountInMaximum:c}]))}if(l&&o.push(n.INTERFACE.encodeFunctionData("refundETH")),h)if(i.fee){var v=e.validateAndParseAddress(i.fee.recipient),A=z(i.fee.fee.multiply(1e4).quotient);o.push(d?n.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[s,u,A,v]):n.INTERFACE.encodeFunctionData("sweepTokenWithFee",[t.route.tokenPath[t.route.tokenPath.length-1].address,s,u,A,v]))}else o.push(n.INTERFACE.encodeFunctionData("unwrapWETH9",[s,u]));return{calldata:1===o.length?o[0]:n.INTERFACE.encodeFunctionData("multicall",[o]),value:p}},n}(pt);ft.INTERFACE=new i.Interface(s.abi),exports.ADDRESS_ZERO=x,exports.FACTORY_ADDRESS="0x1F98431c8aD98523631AE4a59f267346ea31F984",exports.FullMath=O,exports.LiquidityMath=S,exports.NoTickDataProvider=H,exports.NonfungiblePositionManager=ht,exports.POOL_INIT_CODE_HASH=I,exports.Pool=ot,exports.Position=ut,exports.Route=at,exports.SqrtPriceMath=F,exports.SwapRouter=ft,exports.TICK_SPACINGS=q,exports.Tick=nt,exports.TickList=Q,exports.TickListDataProvider=rt,exports.TickMath=W,exports.Trade=st,exports.computePoolAddress=C,exports.encodeRouteToPath=Y,exports.encodeSqrtRatioX96=Z,exports.isSorted=K,exports.maxLiquidityForAmounts=tt,exports.mostSignificantBit=B,exports.nearestUsableTick=function(t,e){Number.isInteger(t)&&Number.isInteger(e)||r(!1),e>0||r(!1),t>=W.MIN_TICK&&t<=W.MAX_TICK||r(!1);var n=Math.round(t/e)*e;return nW.MAX_TICK?n-e:n},exports.priceToClosestTick=function(t){var e=t.baseCurrency.sortsBefore(t.quoteCurrency),n=e?Z(t.numerator,t.denominator):Z(t.denominator,t.numerator),r=W.getTickAtSqrtRatio(n),i=et(t.baseCurrency,t.quoteCurrency,r+1);return e?t.lessThan(i)||r++:t.greaterThan(i)||r++,r},exports.tickToPrice=et,exports.toHex=z,exports.tradeComparator=ct; -//# sourceMappingURL=v3-sdk.cjs.production.min.js.map diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js.map b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js.map deleted file mode 100644 index 966b1fda1f1..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.cjs.production.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"v3-sdk.cjs.production.min.js","sources":["../src/constants.ts","../node_modules/regenerator-runtime/runtime.js","../src/internalConstants.ts","../src/utils/computePoolAddress.ts","../src/utils/liquidityMath.ts","../src/utils/fullMath.ts","../src/utils/sqrtPriceMath.ts","../src/utils/swapMath.ts","../src/utils/mostSignificantBit.ts","../src/utils/tickMath.ts","../src/entities/tickDataProvider.ts","../src/utils/isSorted.ts","../src/utils/tickList.ts","../src/utils/calldata.ts","../src/utils/encodeRouteToPath.ts","../src/utils/encodeSqrtRatioX96.ts","../src/utils/maxLiquidityForAmounts.ts","../src/utils/priceTickConversions.ts","../src/entities/tick.ts","../src/entities/tickListDataProvider.ts","../src/entities/pool.ts","../src/entities/position.ts","../src/entities/route.ts","../src/entities/trade.ts","../src/selfPermit.ts","../src/nonfungiblePositionManager.ts","../src/swapRouter.ts","../src/utils/nearestUsableTick.ts"],"sourcesContent":["export const FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'\n\nexport const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'\n\nexport const POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'\n\n/**\n * The default factory enabled fee amounts, denominated in hundredths of bips.\n */\nexport enum FeeAmount {\n LOW = 500,\n MEDIUM = 3000,\n HIGH = 10000\n}\n\n/**\n * The default factory tick spacings by fee amount.\n */\nexport const TICK_SPACINGS: { [amount in FeeAmount]: number } = {\n [FeeAmount.LOW]: 10,\n [FeeAmount.MEDIUM]: 60,\n [FeeAmount.HIGH]: 200\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import JSBI from 'jsbi'\n\n// constants used internally but not expected to be used externally\nexport const NEGATIVE_ONE = JSBI.BigInt(-1)\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\n\n// used in liquidity amount math\nexport const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96))\nexport const Q192 = JSBI.exponentiate(Q96, JSBI.BigInt(2))\n","import { defaultAbiCoder } from '@ethersproject/abi'\nimport { getCreate2Address } from '@ethersproject/address'\nimport { keccak256 } from '@ethersproject/solidity'\nimport { Token } from '@uniswap/sdk-core'\nimport { FeeAmount, POOL_INIT_CODE_HASH } from '../constants'\n\nexport function computePoolAddress({\n factoryAddress,\n tokenA,\n tokenB,\n fee\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n fee: FeeAmount\n}): string {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(\n ['bytes'],\n [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]\n ),\n POOL_INIT_CODE_HASH\n )\n}\n","import JSBI from 'jsbi'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\n\nexport abstract class LiquidityMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static addDelta(x: JSBI, y: JSBI): JSBI {\n if (JSBI.lessThan(y, ZERO)) {\n return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE))\n } else {\n return JSBI.add(x, y)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { ONE, ZERO } from '../internalConstants'\n\nexport abstract class FullMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI {\n const product = JSBI.multiply(a, b)\n let result = JSBI.divide(product, denominator)\n if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE)\n return result\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO, Q96 } from '../internalConstants'\nimport { FullMath } from './fullMath'\n\nconst MaxUint160 = JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(160)), ONE)\n\nfunction multiplyIn256(x: JSBI, y: JSBI): JSBI {\n const product = JSBI.multiply(x, y)\n return JSBI.bitwiseAnd(product, MaxUint256)\n}\n\nfunction addIn256(x: JSBI, y: JSBI): JSBI {\n const sum = JSBI.add(x, y)\n return JSBI.bitwiseAnd(sum, MaxUint256)\n}\n\nexport abstract class SqrtPriceMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n const numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)\n\n return roundUp\n ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96)\n : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96)\n }\n\n public static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n return roundUp\n ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96)\n : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96)\n }\n\n public static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)\n : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true)\n }\n\n public static getNextSqrtPriceFromOutput(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amountOut: JSBI,\n zeroForOne: boolean\n ): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)\n : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false)\n }\n\n private static getNextSqrtPriceFromAmount0RoundingUp(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (JSBI.equal(amount, ZERO)) return sqrtPX96\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n\n if (add) {\n let product = multiplyIn256(amount, sqrtPX96)\n if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) {\n const denominator = addIn256(numerator1, product)\n if (JSBI.greaterThanOrEqual(denominator, numerator1)) {\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount))\n } else {\n let product = multiplyIn256(amount, sqrtPX96)\n\n invariant(JSBI.equal(JSBI.divide(product, amount), sqrtPX96))\n invariant(JSBI.greaterThan(numerator1, product))\n const denominator = JSBI.subtract(numerator1, product)\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n private static getNextSqrtPriceFromAmount1RoundingDown(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (add) {\n const quotient = JSBI.lessThanOrEqual(amount, MaxUint160)\n ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity)\n : JSBI.divide(JSBI.multiply(amount, Q96), liquidity)\n\n return JSBI.add(sqrtPX96, quotient)\n } else {\n const quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity)\n\n invariant(JSBI.greaterThan(sqrtPX96, quotient))\n return JSBI.subtract(sqrtPX96, quotient)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { FeeAmount } from '../constants'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\nimport { FullMath } from './fullMath'\nimport { SqrtPriceMath } from './sqrtPriceMath'\n\nconst MAX_FEE = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(6))\n\nexport abstract class SwapMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static computeSwapStep(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioTargetX96: JSBI,\n liquidity: JSBI,\n amountRemaining: JSBI,\n feePips: FeeAmount\n ): [JSBI, JSBI, JSBI, JSBI] {\n const returnValues: Partial<{\n sqrtRatioNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n }> = {}\n\n const zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96)\n const exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO)\n\n if (exactIn) {\n const amountRemainingLessFee = JSBI.divide(\n JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))),\n MAX_FEE\n )\n returnValues.amountIn = zeroForOne\n ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true)\n if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn!)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(\n sqrtRatioCurrentX96,\n liquidity,\n amountRemainingLessFee,\n zeroForOne\n )\n }\n } else {\n returnValues.amountOut = zeroForOne\n ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false)\n if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(\n sqrtRatioCurrentX96,\n liquidity,\n JSBI.multiply(amountRemaining, NEGATIVE_ONE),\n zeroForOne\n )\n }\n }\n\n const max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96)\n\n if (zeroForOne) {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false)\n } else {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false)\n }\n\n if (!exactIn && JSBI.greaterThan(returnValues.amountOut!, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) {\n returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE)\n }\n\n if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) {\n // we didn't reach the target, so take the remainder of the maximum input as fee\n returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn!)\n } else {\n returnValues.feeAmount = FullMath.mulDivRoundingUp(\n returnValues.amountIn!,\n JSBI.BigInt(feePips),\n JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))\n )\n }\n\n return [returnValues.sqrtRatioNextX96!, returnValues.amountIn!, returnValues.amountOut!, returnValues.feeAmount!]\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\n\nconst TWO = JSBI.BigInt(2)\nconst POWERS_OF_2 = [128, 64, 32, 16, 8, 4, 2, 1].map((pow: number): [number, JSBI] => [\n pow,\n JSBI.exponentiate(TWO, JSBI.BigInt(pow))\n])\n\nexport function mostSignificantBit(x: JSBI): number {\n invariant(JSBI.greaterThan(x, ZERO), 'ZERO')\n invariant(JSBI.lessThanOrEqual(x, MaxUint256), 'MAX')\n\n let msb: number = 0\n for (const [power, min] of POWERS_OF_2) {\n if (JSBI.greaterThanOrEqual(x, min)) {\n x = JSBI.signedRightShift(x, JSBI.BigInt(power))\n msb += power\n }\n }\n return msb\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { mostSignificantBit } from './mostSignificantBit'\n\nfunction mulShift(val: JSBI, mulBy: string): JSBI {\n return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128))\n}\n\nconst Q32 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(32))\n\nexport abstract class TickMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n /**\n * The minimum tick that can be used on any pool.\n */\n public static MIN_TICK: number = -887272\n /**\n * The maximum tick that can be used on any pool.\n */\n public static MAX_TICK: number = -TickMath.MIN_TICK\n\n /**\n * The sqrt ratio corresponding to the minimum tick that could be used on any pool.\n */\n public static MIN_SQRT_RATIO: JSBI = JSBI.BigInt('4295128739')\n /**\n * The sqrt ratio corresponding to the maximum tick that could be used on any pool.\n */\n public static MAX_SQRT_RATIO: JSBI = JSBI.BigInt('1461446703485210103287273052203988822378723970342')\n\n /**\n * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick\n * @param tick the tick for which to compute the sqrt ratio\n */\n public static getSqrtRatioAtTick(tick: number): JSBI {\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick), 'TICK')\n const absTick: number = tick < 0 ? tick * -1 : tick\n\n let ratio: JSBI =\n (absTick & 0x1) != 0\n ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001')\n : JSBI.BigInt('0x100000000000000000000000000000000')\n if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a')\n if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc')\n if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0')\n if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644')\n if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0')\n if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861')\n if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053')\n if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4')\n if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54')\n if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3')\n if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9')\n if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825')\n if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5')\n if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7')\n if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6')\n if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9')\n if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604')\n if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98')\n if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2')\n\n if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio)\n\n // back to Q96\n return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO)\n ? JSBI.add(JSBI.divide(ratio, Q32), ONE)\n : JSBI.divide(ratio, Q32)\n }\n\n /**\n * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96\n * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96\n * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick\n */\n public static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number {\n invariant(\n JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) &&\n JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO),\n 'SQRT_RATIO'\n )\n\n const sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32))\n\n const msb = mostSignificantBit(sqrtRatioX128)\n\n let r: JSBI\n if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) {\n r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127))\n } else {\n r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb))\n }\n\n let log_2: JSBI = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64))\n\n for (let i = 0; i < 14; i++) {\n r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127))\n const f = JSBI.signedRightShift(r, JSBI.BigInt(128))\n log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i)))\n r = JSBI.signedRightShift(r, f)\n }\n\n const log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141'))\n\n const tickLow = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')),\n JSBI.BigInt(128)\n )\n )\n const tickHigh = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')),\n JSBI.BigInt(128)\n )\n )\n\n return tickLow === tickHigh\n ? tickLow\n : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96)\n ? tickHigh\n : tickLow\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\n\n/**\n * Provides information about ticks\n */\nexport interface TickDataProvider {\n /**\n * Return information corresponding to a specific tick\n * @param tick the tick to load\n */\n getTick(tick: number): Promise<{ liquidityNet: BigintIsh }>\n\n /**\n * Return the next tick that is initialized within a single word\n * @param tick the current tick\n * @param lte whether the next tick should be lte the current tick\n * @param tickSpacing the tick spacing of the pool\n */\n nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>\n}\n\n/**\n * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you\n * do not need to load tick data for your use case.\n */\nexport class NoTickDataProvider implements TickDataProvider {\n private static ERROR_MESSAGE = 'No tick data provider was given'\n async getTick(_tick: number): Promise<{ liquidityNet: BigintIsh }> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n\n async nextInitializedTickWithinOneWord(\n _tick: number,\n _lte: boolean,\n _tickSpacing: number\n ): Promise<[number, boolean]> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n}\n","export function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean {\n for (let i = 0; i < list.length - 1; i++) {\n if (comparator(list[i], list[i + 1]) > 0) {\n return false\n }\n }\n return true\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { isSorted } from './isSorted'\nimport { Tick } from '../entities/tick'\n\nfunction tickComparator(a: Tick, b: Tick) {\n return a.index - b.index\n}\n\n/**\n * Utility methods for interacting with sorted lists of ticks\n */\nexport abstract class TickList {\n /**\n * Cannot be constructed\n */\n private constructor() {}\n\n public static validateList(ticks: Tick[], tickSpacing: number) {\n invariant(tickSpacing > 0, 'TICK_SPACING_NONZERO')\n // ensure ticks are spaced appropriately\n invariant(\n ticks.every(({ index }) => index % tickSpacing === 0),\n 'TICK_SPACING'\n )\n\n // ensure tick liquidity deltas sum to 0\n invariant(\n JSBI.equal(\n ticks.reduce((accumulator, { liquidityNet }) => JSBI.add(accumulator, liquidityNet), ZERO),\n ZERO\n ),\n 'ZERO_NET'\n )\n\n invariant(isSorted(ticks, tickComparator), 'SORTED')\n }\n\n public static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick < ticks[0].index\n }\n\n public static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick >= ticks[ticks.length - 1].index\n }\n\n public static getTick(ticks: readonly Tick[], index: number): Tick {\n const tick = ticks[this.binarySearch(ticks, index)]\n invariant(tick.index === index, 'NOT_CONTAINED')\n return tick\n }\n\n /**\n * Finds the largest tick in the list of ticks that is less than or equal to tick\n * @param ticks list of ticks\n * @param tick tick to find the largest tick that is less than or equal to tick\n * @private\n */\n private static binarySearch(ticks: readonly Tick[], tick: number): number {\n invariant(!this.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n\n let l = 0\n let r = ticks.length - 1\n let i\n while (true) {\n i = Math.floor((l + r) / 2)\n\n if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) {\n return i\n }\n\n if (ticks[i].index < tick) {\n l = i + 1\n } else {\n r = i - 1\n }\n }\n }\n\n public static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick {\n if (lte) {\n invariant(!TickList.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n if (TickList.isAtOrAboveLargest(ticks, tick)) {\n return ticks[ticks.length - 1]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index]\n } else {\n invariant(!this.isAtOrAboveLargest(ticks, tick), 'AT_OR_ABOVE_LARGEST')\n if (this.isBelowSmallest(ticks, tick)) {\n return ticks[0]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index + 1]\n }\n }\n\n public static nextInitializedTickWithinOneWord(\n ticks: readonly Tick[],\n tick: number,\n lte: boolean,\n tickSpacing: number\n ): [number, boolean] {\n const compressed = Math.floor(tick / tickSpacing) // matches rounding in the code\n\n if (lte) {\n const wordPos = compressed >> 8\n const minimum = (wordPos << 8) * tickSpacing\n\n if (TickList.isBelowSmallest(ticks, tick)) {\n return [minimum, false]\n }\n\n const index = TickList.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.max(minimum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n } else {\n const wordPos = (compressed + 1) >> 8\n const maximum = ((wordPos + 1) << 8) * tickSpacing - 1\n\n if (this.isAtOrAboveLargest(ticks, tick)) {\n return [maximum, false]\n }\n\n const index = this.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.min(maximum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n }\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\n\n/**\n * Generated method parameters for executing a call.\n */\nexport interface MethodParameters {\n /**\n * The hex encoded calldata to perform the given operation\n */\n calldata: string\n /**\n * The amount of ether (wei) to send in hex.\n */\n value: string\n}\n\nexport function toHex(bigintIsh: BigintIsh) {\n const bigInt = JSBI.BigInt(bigintIsh)\n let hex = bigInt.toString(16)\n if (hex.length % 2 !== 0) {\n hex = `0${hex}`\n }\n return `0x${hex}`\n}\n","import { pack } from '@ethersproject/solidity'\nimport { Currency, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from '../entities/pool'\nimport { Route } from '../entities/route'\n\n/**\n * Converts a route to a hex encoded path\n * @param route the v3 path to convert to an encoded path\n * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps\n */\nexport function encodeRouteToPath(route: Route, exactOutput: boolean): string {\n const firstInputToken: Token = wrappedCurrency(route.input, route.chainId)\n\n const { path, types } = route.pools.reduce(\n (\n { inputToken, path, types }: { inputToken: Token; path: (string | number)[]; types: string[] },\n pool: Pool,\n index\n ): { inputToken: Token; path: (string | number)[]; types: string[] } => {\n const outputToken: Token = pool.token0.equals(inputToken) ? pool.token1 : pool.token0\n if (index === 0) {\n return {\n inputToken: outputToken,\n types: ['address', 'uint24', 'address'],\n path: [inputToken.address, pool.fee, outputToken.address]\n }\n } else {\n return {\n inputToken: outputToken,\n types: [...types, 'uint24', 'address'],\n path: [...path, pool.fee, outputToken.address]\n }\n }\n },\n { inputToken: firstInputToken, path: [], types: [] }\n )\n\n return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path)\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, sqrt } from '@uniswap/sdk-core'\n\n/**\n * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0\n * @param amount1 the numerator amount, i.e. amount of token1\n * @param amount0 the denominator amount, i.en amount of token0\n */\nexport function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI {\n const numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192))\n const denominator = JSBI.BigInt(amount0)\n const ratioX192 = JSBI.divide(numerator, denominator)\n return sqrt(ratioX192)\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q96 } from '../internalConstants'\n\nfunction maxLiquidityForAmount0Imprecise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n const intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96)\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\nfunction maxLiquidityForAmount0Precise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96)\n const denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n\n return JSBI.divide(numerator, denominator)\n}\n\nfunction maxLiquidityForAmount1(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount1: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\n/**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param sqrtRatioCurrentX96 the current price\n * @param sqrtRatioAX96 price at lower boundary\n * @param sqrtRatioBX96 price at upper boundary\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\nexport function maxLiquidityForAmounts(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioAX96: JSBI,\n sqrtRatioBX96: JSBI,\n amount0: BigintIsh,\n amount1: BigintIsh,\n useFullPrecision: boolean\n): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise\n\n if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) {\n return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0)\n } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) {\n const liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0)\n const liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1)\n return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1\n } else {\n return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1)\n }\n}\n","import { Price, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q192 } from '../internalConstants'\nimport { encodeSqrtRatioX96 } from './encodeSqrtRatioX96'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns a price object corresponding to the input tick and the base/quote token\n * Inputs must be tokens because the address order is used to interpret the price represented by the tick\n * @param baseToken the base token of the price\n * @param quoteToken the quote token of the price\n * @param tick the tick for which to return the price\n */\nexport function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price {\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick)\n\n const ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96)\n\n return baseToken.sortsBefore(quoteToken)\n ? new Price(baseToken, quoteToken, Q192, ratioX192)\n : new Price(baseToken, quoteToken, ratioX192, Q192)\n}\n\n/**\n * Returns the first tick for which the given price is greater than or equal to the tick price\n * @param price for which to return the closest tick that represents a price less than or equal to the input price,\n * i.e. the price of the returned tick is less than or equal to the input price\n */\nexport function priceToClosestTick(price: Price): number {\n const sorted = price.baseCurrency.sortsBefore(price.quoteCurrency)\n\n const sqrtRatioX96 = sorted\n ? encodeSqrtRatioX96(price.numerator, price.denominator)\n : encodeSqrtRatioX96(price.denominator, price.numerator)\n\n let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96)\n const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1)\n if (sorted) {\n if (!price.lessThan(nextTickPrice)) {\n tick++\n }\n } else {\n if (!price.greaterThan(nextTickPrice)) {\n tick++\n }\n }\n return tick\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { BigintIsh } from '@uniswap/sdk-core'\nimport { TickMath } from '../utils'\n\nexport interface TickConstructorArgs {\n index: number\n liquidityGross: BigintIsh\n liquidityNet: BigintIsh\n}\n\nexport class Tick {\n public readonly index: number\n public readonly liquidityGross: JSBI\n public readonly liquidityNet: JSBI\n\n constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs) {\n invariant(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK, 'TICK')\n this.index = index\n this.liquidityGross = JSBI.BigInt(liquidityGross)\n this.liquidityNet = JSBI.BigInt(liquidityNet)\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport { TickList } from '../utils/tickList'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { TickDataProvider } from './tickDataProvider'\n\n/**\n * A data provider for ticks that is backed by an in-memory array of ticks.\n */\nexport class TickListDataProvider implements TickDataProvider {\n private ticks: readonly Tick[]\n\n constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number) {\n const ticksMapped: Tick[] = ticks.map(t => (t instanceof Tick ? t : new Tick(t)))\n TickList.validateList(ticksMapped, tickSpacing)\n this.ticks = ticksMapped\n }\n\n async getTick(tick: number): Promise<{ liquidityNet: BigintIsh; liquidityGross: BigintIsh }> {\n return TickList.getTick(this.ticks, tick)\n }\n\n async nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]> {\n return TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)\n }\n}\n","import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { FACTORY_ADDRESS, FeeAmount, TICK_SPACINGS } from '../constants'\nimport { NEGATIVE_ONE, ONE, Q192, ZERO } from '../internalConstants'\nimport { computePoolAddress } from '../utils/computePoolAddress'\nimport { LiquidityMath } from '../utils/liquidityMath'\nimport { SwapMath } from '../utils/swapMath'\nimport { TickMath } from '../utils/tickMath'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { NoTickDataProvider, TickDataProvider } from './tickDataProvider'\nimport { TickListDataProvider } from './tickListDataProvider'\n\ninterface StepComputations {\n sqrtPriceStartX96: JSBI\n tickNext: number\n initialized: boolean\n sqrtPriceNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n}\n\n/**\n * By default, pools will not allow operations that require ticks.\n */\nconst NO_TICK_DATA_PROVIDER_DEFAULT = new NoTickDataProvider()\n\n/**\n * Represents a V3 pool\n */\nexport class Pool {\n public readonly token0: Token\n public readonly token1: Token\n public readonly fee: FeeAmount\n public readonly sqrtRatioX96: JSBI\n public readonly liquidity: JSBI\n public readonly tickCurrent: number\n public readonly tickDataProvider: TickDataProvider\n\n private _token0Price?: Price\n private _token1Price?: Price\n\n public static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount): string {\n return computePoolAddress({ factoryAddress: FACTORY_ADDRESS, fee, tokenA, tokenB })\n }\n\n /**\n * Construct a pool\n * @param tokenA one of the tokens in the pool\n * @param tokenB the other token in the pool\n * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool\n * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0\n * @param liquidity the current value of in range liquidity\n * @param tickCurrent the current tick of the pool\n * @param ticks the current state of the pool ticks or a data provider that can return tick data\n */\n public constructor(\n tokenA: Token,\n tokenB: Token,\n fee: FeeAmount,\n sqrtRatioX96: BigintIsh,\n liquidity: BigintIsh,\n tickCurrent: number,\n ticks: TickDataProvider | (Tick | TickConstructorArgs)[] = NO_TICK_DATA_PROVIDER_DEFAULT\n ) {\n invariant(Number.isInteger(fee) && fee < 1_000_000, 'FEE')\n\n const tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent)\n const nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1)\n invariant(\n JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) &&\n JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96),\n 'PRICE_BOUNDS'\n )\n // always create a copy of the list since we want the pool's tick list to be immutable\n ;[this.token0, this.token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n this.fee = fee\n this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96)\n this.liquidity = JSBI.BigInt(liquidity)\n this.tickCurrent = tickCurrent\n this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0\n */\n public get token0Price(): Price {\n return (\n this._token0Price ??\n (this._token0Price = new Price(\n this.token0,\n this.token1,\n Q192,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)\n ))\n )\n }\n\n /**\n * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1\n */\n public get token1Price(): Price {\n return (\n this._token1Price ??\n (this._token1Price = new Price(\n this.token1,\n this.token0,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96),\n Q192\n ))\n )\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pool.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pool.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n /**\n * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade\n * @param inputAmount the input amount for which to quote the output amount\n */\n public async getOutputAmount(\n inputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n\n const zeroForOne = inputAmount.currency.equals(this.token0)\n\n const { amountCalculated: outputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n inputAmount.quotient,\n sqrtPriceLimitX96\n )\n const outputToken = zeroForOne ? this.token1 : this.token0\n return [\n CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n /**\n * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade\n * @param outputAmount the output amount for which to quote the input amount\n */\n public async getInputAmount(\n outputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency), 'TOKEN')\n\n const zeroForOne = outputAmount.currency.equals(this.token1)\n\n const { amountCalculated: inputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE),\n sqrtPriceLimitX96\n )\n const inputToken = zeroForOne ? this.token0 : this.token1\n return [\n CurrencyAmount.fromRawAmount(inputToken, inputAmount),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n private async swap(\n zeroForOne: boolean,\n amountSpecified: JSBI,\n sqrtPriceLimitX96?: JSBI\n ): Promise<{ amountCalculated: JSBI; sqrtRatioX96: JSBI; liquidity: JSBI; tickCurrent: number }> {\n if (!sqrtPriceLimitX96)\n sqrtPriceLimitX96 = zeroForOne\n ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE)\n : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE)\n\n if (zeroForOne) {\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO), 'RATIO_MIN')\n invariant(JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n } else {\n invariant(JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO), 'RATIO_MAX')\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n }\n\n const exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO)\n\n // keep track of swap state\n const state = {\n amountSpecifiedRemaining: amountSpecified,\n amountCalculated: ZERO,\n sqrtPriceX96: this.sqrtRatioX96,\n tick: this.tickCurrent,\n liquidity: this.liquidity\n }\n\n // start swap while loop\n while (JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96) {\n let step: Partial = {}\n step.sqrtPriceStartX96 = state.sqrtPriceX96\n\n // because each iteration of the while loop rounds, we can't optimize this code (relative to the smart contract)\n // by simply traversing to the next available tick, we instead need to exactly replicate\n // tickBitmap.nextInitializedTickWithinOneWord\n ;[step.tickNext, step.initialized] = await this.tickDataProvider.nextInitializedTickWithinOneWord(\n state.tick,\n zeroForOne,\n this.tickSpacing\n )\n\n if (step.tickNext < TickMath.MIN_TICK) {\n step.tickNext = TickMath.MIN_TICK\n } else if (step.tickNext > TickMath.MAX_TICK) {\n step.tickNext = TickMath.MAX_TICK\n }\n\n step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext)\n ;[state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount] = SwapMath.computeSwapStep(\n state.sqrtPriceX96,\n (zeroForOne\n ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)\n : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96))\n ? sqrtPriceLimitX96\n : step.sqrtPriceNextX96,\n state.liquidity,\n state.amountSpecifiedRemaining,\n this.fee\n )\n\n if (exactInput) {\n state.amountSpecifiedRemaining = JSBI.subtract(\n state.amountSpecifiedRemaining,\n JSBI.add(step.amountIn, step.feeAmount)\n )\n state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut)\n } else {\n state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut)\n state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount))\n }\n\n // TODO\n if (JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) {\n // if the tick is initialized, run the tick transition\n if (step.initialized) {\n let liquidityNet = JSBI.BigInt((await this.tickDataProvider.getTick(step.tickNext)).liquidityNet)\n // if we're moving leftward, we interpret liquidityNet as the opposite sign\n // safe because liquidityNet cannot be type(int128).min\n if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE)\n\n state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet)\n }\n\n state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext\n } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {\n // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved\n state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96)\n }\n }\n\n return {\n amountCalculated: state.amountCalculated,\n sqrtRatioX96: state.sqrtPriceX96,\n liquidity: state.liquidity,\n tickCurrent: state.tick\n }\n }\n\n public get tickSpacing(): number {\n return TICK_SPACINGS[this.fee]\n }\n}\n","import { BigintIsh, MaxUint256, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { maxLiquidityForAmounts } from '../utils/maxLiquidityForAmounts'\nimport { tickToPrice } from '../utils/priceTickConversions'\nimport { SqrtPriceMath } from '../utils/sqrtPriceMath'\nimport { TickMath } from '../utils/tickMath'\nimport { encodeSqrtRatioX96 } from '../utils/encodeSqrtRatioX96'\nimport { Pool } from './pool'\n\ninterface PositionConstructorArgs {\n pool: Pool\n tickLower: number\n tickUpper: number\n liquidity: BigintIsh\n}\n\n/**\n * Represents a position on a Uniswap V3 Pool\n */\nexport class Position {\n public readonly pool: Pool\n public readonly tickLower: number\n public readonly tickUpper: number\n public readonly liquidity: JSBI\n\n // cached resuts for the getters\n private _token0Amount: CurrencyAmount | null = null\n private _token1Amount: CurrencyAmount | null = null\n private _mintAmounts: Readonly<{ amount0: JSBI; amount1: JSBI }> | null = null\n\n /**\n * Constructs a position for a given pool with the given liquidity\n * @param pool for which pool the liquidity is assigned\n * @param liquidity the amount of liquidity that is in the position\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n */\n public constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs) {\n invariant(tickLower < tickUpper, 'TICK_ORDER')\n invariant(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0, 'TICK_LOWER')\n invariant(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0, 'TICK_UPPER')\n\n this.pool = pool\n this.tickLower = tickLower\n this.tickUpper = tickUpper\n this.liquidity = JSBI.BigInt(liquidity)\n }\n\n /**\n * Returns the price of token0 at the lower tick\n */\n public get token0PriceLower(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower)\n }\n\n /**\n * Returns the price of token0 at the upper tick\n */\n public get token0PriceUpper(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper)\n }\n\n /**\n * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price\n */\n public get amount0(): CurrencyAmount {\n if (this._token0Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else {\n this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO)\n }\n }\n return this._token0Amount\n }\n\n /**\n * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price\n */\n public get amount1(): CurrencyAmount {\n if (this._token1Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO)\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n false\n )\n )\n } else {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n }\n }\n return this._token1Amount\n }\n\n /**\n * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage\n * @param slippageTolerance amount by which the price can 'slip'\n * @private\n */\n private ratiosAfterSlippage(slippageTolerance: Percent): { sqrtRatioX96Lower: JSBI; sqrtRatioX96Upper: JSBI } {\n const priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance))\n const priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1))\n let sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator)\n if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) {\n sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1))\n }\n let sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator)\n if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) {\n sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1))\n }\n return {\n sqrtRatioX96Lower,\n sqrtRatioX96Upper\n }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position\n * with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage)\n const positionThatWillBeCreated = Position.fromAmounts({\n pool: this.pool,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper,\n ...this.mintAmounts, // the mint amounts are what will be passed as calldata\n useFullPrecision: false\n })\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const { amount0 } = new Position({\n pool: poolUpper,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n // ...and the lower for amount1\n const { amount1 } = new Position({\n pool: poolLower,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n\n return { amount0, amount1 }\n }\n\n /**\n * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the\n * position with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const amount0 = new Position({\n pool: poolUpper,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount0\n // ...and the lower for amount1\n const amount1 = new Position({\n pool: poolLower,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount1\n\n return { amount0: amount0.quotient, amount1: amount1.quotient }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at\n * the current price for the pool\n */\n public get mintAmounts(): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n if (this._mintAmounts === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: ZERO\n }\n } else if (this.pool.tickCurrent < this.tickUpper) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n true\n )\n }\n } else {\n return {\n amount0: ZERO,\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n )\n }\n }\n }\n return this._mintAmounts\n }\n\n /**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param pool the pool for which the position should be created\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmounts({\n pool,\n tickLower,\n tickUpper,\n amount0,\n amount1,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n amount1: BigintIsh\n useFullPrecision: boolean\n }) {\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower)\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper)\n return new Position({\n pool,\n tickLower,\n tickUpper,\n liquidity: maxLiquidityForAmounts(\n pool.sqrtRatioX96,\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0,\n amount1,\n useFullPrecision\n )\n })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount0 the desired amount of token0\n * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmount0({\n pool,\n tickLower,\n tickUpper,\n amount0,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n useFullPrecision: boolean\n }) {\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0, amount1: MaxUint256, useFullPrecision })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount1 the desired amount of token1\n */\n public static fromAmount1({\n pool,\n tickLower,\n tickUpper,\n amount1\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount1: BigintIsh\n }) {\n // this function always uses full precision,\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0: MaxUint256, amount1, useFullPrecision: true })\n }\n}\n","import invariant from 'tiny-invariant'\n\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from './pool'\n\n/**\n * Represents a list of pools through which a swap can occur\n */\nexport class Route {\n public readonly pools: Pool[]\n public readonly tokenPath: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n private _midPrice: Price | null = null\n\n public constructor(pools: Pool[], input: TInput, output: TOutput) {\n invariant(pools.length > 0, 'POOLS')\n\n const chainId = pools[0].chainId\n const allOnSameChain = pools.every(pool => pool.chainId === chainId)\n invariant(allOnSameChain, 'CHAIN_IDS')\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pools[0].involvesToken(wrappedInput), 'INPUT')\n\n invariant(pools[pools.length - 1].involvesToken(wrappedCurrency(output, chainId)), 'OUTPUT')\n\n /**\n * Normalizes token0-token1 order and selects the next token/fee step to add to the path\n * */\n const tokenPath: Token[] = [wrappedInput]\n for (const [i, pool] of pools.entries()) {\n const currentInputToken = tokenPath[i]\n invariant(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1), 'PATH')\n const nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0\n tokenPath.push(nextToken)\n }\n\n this.pools = pools\n this.tokenPath = tokenPath\n this.input = input\n this.output = output ?? tokenPath[tokenPath.length - 1]\n }\n\n public get chainId(): ChainId | number {\n return this.pools[0].chainId\n }\n\n /**\n * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token.\n */\n public get inputToken(): Token {\n return wrappedCurrency(this.input, this.chainId)\n }\n\n /**\n * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token.\n */\n public get outputToken(): Token {\n return wrappedCurrency(this.output, this.chainId)\n }\n\n /**\n * Returns the mid price of the route\n */\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n\n const price = this.pools.slice(1).reduce(\n ({ nextInput, price }, pool) => {\n return nextInput.equals(pool.token0)\n ? {\n nextInput: pool.token1,\n price: price.multiply(pool.token0Price)\n }\n : {\n nextInput: pool.token0,\n price: price.multiply(pool.token1Price)\n }\n },\n this.pools[0].token0.equals(this.inputToken)\n ? {\n nextInput: this.pools[0].token1,\n price: this.pools[0].token0Price\n }\n : {\n nextInput: this.pools[0].token0,\n price: this.pools[0].token1Price\n }\n ).price\n\n return (this._midPrice = new Price(this.input, this.output, price.denominator, price.numerator))\n }\n}\n","import {\n ChainId,\n Currency,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n CurrencyAmount,\n TradeType,\n wrappedCurrency,\n wrappedCurrencyAmount,\n Token,\n computePriceImpact\n} from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { Pool } from './pool'\nimport { Route } from './route'\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n // consider the number of hops since each hop costs gas\n return a.route.tokenPath.length - b.route.tokenPath.length\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pools.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pools the trade goes through.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n\n /**\n * The cached result of the computed execution price\n * @private\n */\n private _executionPrice: Price | undefined\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public get executionPrice(): Price {\n return (\n this._executionPrice ??\n (this._executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n ))\n )\n }\n\n /**\n * The cached result of the price impact computation\n * @private\n */\n private _priceImpact: Percent | undefined\n\n /**\n * Returns the percent difference between the route's mid price and the price impact\n */\n public get priceImpact(): Percent {\n return (\n this._priceImpact ??\n (this._priceImpact = computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount))\n )\n }\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static async exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static async exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n /**\n * Constructs a trade by simulating swaps through the given route\n * @param route route to swap through\n * @param amount the amount specified, either input or output, depending on tradeType\n * @param tradeType whether the trade is an exact input or exact output swap\n */\n public static async fromRoute(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ): Promise> {\n const amounts: CurrencyAmount[] = new Array(route.tokenPath.length)\n let inputAmount: CurrencyAmount\n let outputAmount: CurrencyAmount\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n amounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.tokenPath.length - 1; i++) {\n const pool = route.pools[i]\n const [outputAmount] = await pool.getOutputAmount(amounts[i])\n amounts[i + 1] = outputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n amounts[amounts.length - 1].numerator,\n amounts[amounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n amounts[amounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.tokenPath.length - 1; i > 0; i--) {\n const pool = route.pools[i - 1]\n const [inputAmount] = await pool.getInputAmount(amounts[i])\n amounts[i - 1] = inputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n\n return new Trade({\n route,\n tradeType,\n inputAmount,\n outputAmount\n })\n }\n\n /**\n * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade\n * elsewhere and do not have any tick data\n * @param constructorArguments the arguments passed to the trade constructor\n */\n public static createUncheckedTrade<\n TInput extends Currency,\n TOutput extends Currency,\n TTradeType extends TradeType\n >(constructorArguments: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }): Trade {\n return new Trade(constructorArguments)\n }\n\n /**\n * Construct a trade by passing in the pre-computed property values\n * @param route the route through which the trade occurs\n * @param inputAmount the amount of input paid in the trade\n * @param outputAmount the amount of output received in the trade\n * @param tradeType the type of trade, exact input or exact output\n */\n private constructor({\n route,\n inputAmount,\n outputAmount,\n tradeType\n }: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }) {\n invariant(currencyEquals(inputAmount.currency, route.input), 'INPUT_CURRENCY_MATCH')\n invariant(currencyEquals(outputAmount.currency, route.output), 'OUTPUT_CURRENCY_MATCH')\n this.route = route\n this.inputAmount = inputAmount\n this.outputAmount = outputAmount\n this.tradeType = tradeType\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactIn(\n pools: Pool[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountIn.currency) && !currencyEquals(pool.token1, amountIn.currency)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = await pool.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (amountOut.currency.isToken && amountOut.currency.equals(tokenOut)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([...currentPools, pool], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactIn(\n poolsExcludingThisPool,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPools, pool],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param currencyAmountOut the desired currency amount out\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactOut(\n pools: Pool[],\n currencyIn: Currency,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? currencyIn.chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountOut.currency) && !currencyEquals(pool.token1, amountOut.currency)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = await pool.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pool\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([pool, ...currentPools], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactOut(\n poolsExcludingThisPool,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pool, ...currentPools],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { BigintIsh, Token } from '@uniswap/sdk-core'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'\nimport { toHex } from './utils'\n\nexport interface StandardPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n amount: BigintIsh\n deadline: BigintIsh\n}\n\nexport interface AllowedPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n nonce: BigintIsh\n expiry: BigintIsh\n}\n\nexport type PermitOptions = StandardPermitArguments | AllowedPermitArguments\n\n// type guard\nfunction isAllowedPermit(permitOptions: PermitOptions): permitOptions is AllowedPermitArguments {\n return 'nonce' in permitOptions\n}\n\nexport abstract class SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n protected constructor() {}\n\n protected static encodePermit(token: Token, options: PermitOptions) {\n return isAllowedPermit(options)\n ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [\n token.address,\n toHex(options.nonce),\n toHex(options.expiry),\n options.v,\n options.r,\n options.s\n ])\n : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [\n token.address,\n toHex(options.amount),\n toHex(options.deadline),\n options.v,\n options.r,\n options.s\n ])\n }\n}\n","import {\n BigintIsh,\n ChainId,\n Percent,\n Token,\n CurrencyAmount,\n validateAndParseAddress,\n WETH9,\n Currency\n} from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { Position } from './entities/position'\nimport { ONE, ZERO } from './internalConstants'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { ADDRESS_ZERO } from './constants'\n\nconst MaxUint128 = toHex(JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(128)), JSBI.BigInt(1)))\n\nexport interface MintSpecificOptions {\n /**\n * The account that should receive the minted NFT.\n */\n recipient: string\n\n /**\n * Creates pool if not initialized before mint.\n */\n createPool?: boolean\n}\n\nexport interface IncreaseSpecificOptions {\n /**\n * Indicates the ID of the position to increase liquidity for.\n */\n tokenId: BigintIsh\n}\n\n/**\n * Options for producing the calldata to add liquidity.\n */\nexport interface CommonAddLiquidityOptions {\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false\n */\n useEther?: boolean\n\n /**\n * The optional permit parameters for spending token0\n */\n token0Permit?: PermitOptions\n\n /**\n * The optional permit parameters for spending token1\n */\n token1Permit?: PermitOptions\n}\n\nexport type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions\nexport type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions\n\nexport type AddLiquidityOptions = MintOptions | IncreaseOptions\n\n// type guard\nfunction isMint(options: AddLiquidityOptions): options is MintOptions {\n return Object.keys(options).some(k => k === 'recipient')\n}\n\nexport interface CollectOptions {\n /**\n * Indicates the ID of the position to collect for.\n */\n tokenId: BigintIsh\n\n /**\n * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed0: CurrencyAmount\n\n /**\n * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed1: CurrencyAmount\n\n /**\n * The account that should receive the tokens.\n */\n recipient: string\n}\n\nexport interface NFTPermitOptions {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n deadline: BigintIsh\n spender: string\n}\n\n/**\n * Options for producing the calldata to exit a position.\n */\nexport interface RemoveLiquidityOptions {\n /**\n * The ID of the token to exit\n */\n tokenId: BigintIsh\n\n /**\n * The percentage of position liquidity to exit.\n */\n liquidityPercentage: Percent\n\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether the NFT should be burned if the entire position is being exited, by default false.\n */\n burnToken?: boolean\n\n /**\n * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT\n */\n permit?: NFTPermitOptions\n\n /**\n * Parameters to be passed on to collect\n */\n collectOptions: Omit\n}\n\nexport abstract class NonfungiblePositionManager extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n public static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters {\n invariant(JSBI.greaterThan(position.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n const calldatas: string[] = []\n\n // get amounts\n const { amount0: amount0Desired, amount1: amount1Desired } = position.mintAmounts\n\n // adjust for slippage\n const minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance)\n const amount0Min = toHex(minimumAmounts.amount0)\n const amount1Min = toHex(minimumAmounts.amount1)\n\n const deadline = toHex(options.deadline)\n\n // create pool if needed\n if (isMint(options) && options.createPool) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [\n position.pool.token0.address,\n position.pool.token1.address,\n position.pool.fee,\n toHex(position.pool.sqrtRatioX96)\n ])\n )\n }\n\n // permits if necessary\n if (options.token0Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit))\n }\n if (options.token1Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit))\n }\n\n // mint\n if (isMint(options)) {\n const recipient: string = validateAndParseAddress(options.recipient)\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [\n {\n token0: position.pool.token0.address,\n token1: position.pool.token1.address,\n fee: position.pool.fee,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper,\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n recipient,\n deadline\n }\n ])\n )\n } else {\n // increase\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [\n {\n tokenId: toHex(options.tokenId),\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n deadline\n }\n ])\n )\n }\n\n let value: string = toHex(0)\n\n if (options.useEther) {\n const weth = WETH9[position.pool.chainId as ChainId]\n invariant(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth)), 'NO_WETH')\n\n const wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired\n\n // we only need to refund if we're actually sending ETH\n if (JSBI.greaterThan(wethValue, ZERO)) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n value = toHex(wethValue)\n }\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n\n private static encodeCollect(options: CollectOptions): string[] {\n const calldatas: string[] = []\n\n const tokenId = toHex(options.tokenId)\n\n const involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther\n\n const recipient = validateAndParseAddress(options.recipient)\n\n // collect\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [\n {\n tokenId,\n recipient: involvesETH ? ADDRESS_ZERO : recipient,\n amount0Max: MaxUint128,\n amount1Max: MaxUint128\n }\n ])\n )\n\n if (involvesETH) {\n const ethAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed0.quotient\n : options.expectedCurrencyOwed1.quotient\n const token = options.expectedCurrencyOwed0.currency.isEther\n ? (options.expectedCurrencyOwed1.currency as Token)\n : (options.expectedCurrencyOwed0.currency as Token)\n const tokenAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed1.quotient\n : options.expectedCurrencyOwed0.quotient\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])\n )\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [\n token.address,\n toHex(tokenAmount),\n recipient\n ])\n )\n }\n\n return calldatas\n }\n\n public static collectCallParameters(options: CollectOptions): MethodParameters {\n const calldatas: string[] = NonfungiblePositionManager.encodeCollect(options)\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n\n /**\n * Produces the calldata for completely or partially exiting a position\n * @param position the position to exit\n * @param options additional information necessary for generating the calldata\n */\n public static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters {\n const calldatas: string[] = []\n\n const deadline = toHex(options.deadline)\n const tokenId = toHex(options.tokenId)\n\n // construct a partial position with a percentage of liquidity\n const partialPosition = new Position({\n pool: position.pool,\n liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper\n })\n invariant(JSBI.greaterThan(partialPosition.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n // slippage-adjusted underlying amounts\n const { amount0: amount0Min, amount1: amount1Min } = partialPosition.burnAmountsWithSlippage(\n options.slippageTolerance\n )\n\n if (options.permit) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [\n validateAndParseAddress(options.permit.spender),\n tokenId,\n toHex(options.permit.deadline),\n options.permit.v,\n options.permit.r,\n options.permit.s\n ])\n )\n }\n\n // remove liquidity\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [\n {\n tokenId,\n liquidity: toHex(partialPosition.liquidity),\n amount0Min: toHex(amount0Min),\n amount1Min: toHex(amount1Min),\n deadline\n }\n ])\n )\n\n const { expectedCurrencyOwed0, expectedCurrencyOwed1, ...rest } = options.collectOptions\n calldatas.push(\n ...NonfungiblePositionManager.encodeCollect({\n tokenId: options.tokenId,\n // add the underlying value to the expected currency already owed\n expectedCurrencyOwed0: expectedCurrencyOwed0.add(\n expectedCurrencyOwed0.currency.isEther\n ? CurrencyAmount.ether(amount0Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency as Token, amount0Min)\n ),\n expectedCurrencyOwed1: expectedCurrencyOwed1.add(\n expectedCurrencyOwed1.currency.isEther\n ? CurrencyAmount.ether(amount1Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency as Token, amount1Min)\n ),\n ...rest\n })\n )\n\n if (options.liquidityPercentage.equalTo(ONE)) {\n if (options.burnToken) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId]))\n }\n } else {\n invariant(options.burnToken !== true, 'CANNOT_BURN')\n }\n\n return {\n calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { BigintIsh, Currency, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { Trade } from './entities/trade'\nimport { ADDRESS_ZERO } from './constants'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { encodeRouteToPath } from './utils'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'\n\nexport interface FeeOptions {\n /**\n * The percent of the output that will be taken as a fee.\n */\n fee: Percent\n\n /**\n * The recipient of the fee.\n */\n recipient: string\n}\n\n/**\n * Options for producing the arguments to send calls to the router.\n */\nexport interface SwapOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n slippageTolerance: Percent\n\n /**\n * The account that should receive the output.\n */\n recipient: string\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * The optional permit parameters for spending the input.\n */\n inputTokenPermit?: PermitOptions\n\n /**\n * The optional price limit for the trade.\n */\n sqrtPriceLimitX96?: BigintIsh\n\n /**\n * Optional information for taking a fee on output.\n */\n fee?: FeeOptions\n}\n\n/**\n * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades.\n */\nexport abstract class SwapRouter extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: SwapOptions\n ): MethodParameters {\n const calldatas: string[] = []\n\n // encode permit if necessary\n if (options.inputTokenPermit) {\n invariant(trade.inputAmount.currency.isToken, 'NON_TOKEN_PERMIT')\n calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit))\n }\n\n const recipient: string = validateAndParseAddress(options.recipient)\n\n const deadline = toHex(options.deadline)\n\n const amountIn: string = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient)\n const amountOut: string = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient)\n const value: string = trade.inputAmount.currency.isEther ? amountIn : toHex(0)\n\n // flag for whether the trade is single hop or not\n const singleHop = trade.route.pools.length === 1\n\n // flag for whether a refund needs to happen\n const mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === TradeType.EXACT_OUTPUT\n\n // flags for whether funds should be send first to the router\n const outputIsEther = trade.outputAmount.currency.isEther\n const routerMustCustody = outputIsEther || !!options.fee\n\n if (singleHop) {\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams]))\n } else {\n const exactOutputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams]))\n }\n } else {\n invariant(options.sqrtPriceLimitX96 === undefined, 'MULTIHOP_PRICE_LIMIT')\n\n const path: string = encodeRouteToPath(trade.route, trade.tradeType === TradeType.EXACT_OUTPUT)\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams]))\n } else {\n const exactOutputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams]))\n }\n }\n\n // refund\n if (mustRefund) {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n // unwrap\n if (routerMustCustody) {\n if (!!options.fee) {\n const feeRecipient: string = validateAndParseAddress(options.fee.recipient)\n const fee = toHex(options.fee.fee.multiply(10_000).quotient)\n\n if (outputIsEther) {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])\n )\n } else {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [\n trade.route.tokenPath[trade.route.tokenPath.length - 1].address,\n amountOut,\n recipient,\n fee,\n feeRecipient\n ])\n )\n }\n } else {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient]))\n }\n }\n\n return {\n calldata:\n calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n}\n","import invariant from 'tiny-invariant'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns the closest tick that is nearest a given tick and usable for the given tick spacing\n * @param tick the target tick\n * @param tickSpacing the spacing of the pool\n */\nexport function nearestUsableTick(tick: number, tickSpacing: number) {\n invariant(Number.isInteger(tick) && Number.isInteger(tickSpacing), 'INTEGERS')\n invariant(tickSpacing > 0, 'TICK_SPACING')\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, 'TICK_BOUND')\n const rounded = Math.round(tick / tickSpacing) * tickSpacing\n if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing\n else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing\n else return rounded\n}\n"],"names":["FeeAmount","runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","Function","ADDRESS_ZERO","POOL_INIT_CODE_HASH","TICK_SPACINGS","LOW","MEDIUM","HIGH","NEGATIVE_ONE","JSBI","BigInt","ZERO","ONE","Q96","exponentiate","Q192","computePoolAddress","factoryAddress","tokenA","tokenB","fee","sortsBefore","getCreate2Address","keccak256","defaultAbiCoder","encode","address","LiquidityMath","addDelta","x","y","lessThan","subtract","multiply","add","FullMath","mulDivRoundingUp","a","b","denominator","product","divide","notEqual","remainder","MaxUint160","multiplyIn256","bitwiseAnd","MaxUint256","SqrtPriceMath","getAmount0Delta","sqrtRatioAX96","sqrtRatioBX96","liquidity","roundUp","greaterThan","numerator1","leftShift","numerator2","getAmount1Delta","getNextSqrtPriceFromInput","sqrtPX96","amountIn","zeroForOne","invariant","getNextSqrtPriceFromAmount0RoundingUp","getNextSqrtPriceFromAmount1RoundingDown","getNextSqrtPriceFromOutput","amountOut","amount","equal","sum","greaterThanOrEqual","quotient","lessThanOrEqual","MAX_FEE","SwapMath","computeSwapStep","sqrtRatioCurrentX96","sqrtRatioTargetX96","amountRemaining","feePips","returnValues","exactIn","amountRemainingLessFee","sqrtRatioNextX96","max","feeAmount","TWO","POWERS_OF_2","map","pow","mostSignificantBit","msb","power","signedRightShift","mulShift","val","mulBy","Q32","TickMath","getSqrtRatioAtTick","tick","MIN_TICK","MAX_TICK","Number","isInteger","absTick","ratio","getTickAtSqrtRatio","sqrtRatioX96","MIN_SQRT_RATIO","MAX_SQRT_RATIO","r","sqrtRatioX128","log_2","f","bitwiseOr","log_sqrt10001","tickLow","toNumber","tickHigh","NoTickDataProvider","getTick","_tick","ERROR_MESSAGE","nextInitializedTickWithinOneWord","_lte","_tickSpacing","isSorted","list","comparator","tickComparator","index","TickList","validateList","ticks","tickSpacing","every","reduce","accumulator","liquidityNet","isBelowSmallest","isAtOrAboveLargest","binarySearch","l","Math","floor","nextInitializedTick","lte","compressed","minimum","maximum","min","toHex","bigintIsh","hex","encodeRouteToPath","route","exactOutput","firstInputToken","wrappedCurrency","input","chainId","pools","pool","inputToken","path","types","outputToken","token0","equals","token1","pack","encodeSqrtRatioX96","amount1","amount0","numerator","ratioX192","sqrt","maxLiquidityForAmount0Imprecise","intermediate","maxLiquidityForAmount0Precise","maxLiquidityForAmount1","maxLiquidityForAmounts","useFullPrecision","maxLiquidityForAmount0","liquidity0","liquidity1","tickToPrice","baseToken","quoteToken","Price","Tick","liquidityGross","TickListDataProvider","ticksMapped","t","NO_TICK_DATA_PROVIDER_DEFAULT","Pool","tickCurrent","tickCurrentSqrtRatioX96","nextTickSqrtRatioX96","tickDataProvider","Array","isArray","getAddress","involvesToken","token","priceOf","token0Price","token1Price","getOutputAmount","inputAmount","sqrtPriceLimitX96","currency","swap","CurrencyAmount","fromRawAmount","amountCalculated","getInputAmount","outputAmount","isToken","amountSpecified","exactInput","amountSpecifiedRemaining","sqrtPriceX96","step","sqrtPriceStartX96","tickNext","initialized","sqrtPriceNextX96","_token0Price","_token1Price","Position","tickLower","tickUpper","ratiosAfterSlippage","slippageTolerance","priceLower","asFraction","Percent","priceUpper","sqrtRatioX96Lower","sqrtRatioX96Upper","mintAmountsWithSlippage","poolLower","poolUpper","positionThatWillBeCreated","fromAmounts","mintAmounts","burnAmountsWithSlippage","fromAmount0","fromAmount1","_token0Amount","_token1Amount","_mintAmounts","Route","output","wrappedInput","tokenPath","entries","currentInputToken","nextToken","_midPrice","price","nextInput","tradeComparator","currencyEquals","equalTo","Trade","tradeType","fromRoute","TradeType","EXACT_INPUT","exactOut","EXACT_OUTPUT","amounts","wrappedCurrencyAmount","fromFractionalAmount","createUncheckedTrade","constructorArguments","minimumAmountOut","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","worstExecutionPrice","bestTradeExactIn","currencyAmountIn","currencyOut","currentPools","nextAmountIn","bestTrades","maxNumResults","maxHops","tokenOut","_context4","isInsufficientInputAmountError","sortedInsert","poolsExcludingThisPool","concat","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","_context5","isInsufficientReservesError","_executionPrice","_priceImpact","computePriceImpact","midPrice","SelfPermit","encodePermit","options","INTERFACE","encodeFunctionData","nonce","expiry","v","s","deadline","Interface","abi","MaxUint128","isMint","some","k","NonfungiblePositionManager","_SelfPermit","addCallParameters","position","calldatas","amount0Desired","amount1Desired","minimumAmounts","amount0Min","amount1Min","createPool","token0Permit","token1Permit","recipient","validateAndParseAddress","tokenId","useEther","weth","WETH9","wethValue","calldata","encodeCollect","involvesETH","expectedCurrencyOwed0","isEther","expectedCurrencyOwed1","amount0Max","amount1Max","tokenAmount","collectCallParameters","removeCallParameters","partialPosition","liquidityPercentage","permit","spender","collectOptions","rest","ether","burnToken","SwapRouter","swapCallParameters","trade","inputTokenPermit","mustRefund","outputIsEther","routerMustCustody","exactInputSingleParams","amountOutMinimum","exactOutputSingleParams","amountInMaximum","feeRecipient","rounded","round","sorted","baseCurrency","quoteCurrency","nextTickPrice"],"mappings":"uwEASYA,mBCFZ,IAAIC,EAAW,SAAUC,GAGvB,IAAIC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,gBAE/C,SAASC,EAAOC,EAAKC,EAAKC,GAOxB,OANAf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,GAEb,IAEEF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,GAC1B,OAAOF,EAAIC,GAAOC,GAItB,SAASM,EAAKC,EAASC,EAASC,EAAMC,GAEpC,IACIC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,IAMzC,OAFAC,EAAUK,QAsMZ,SAA0BT,EAASE,EAAMK,GACvC,IAAIG,EA/KuB,iBAiL3B,OAAO,SAAgBC,EAAQC,GAC7B,GAhLoB,cAgLhBF,EACF,MAAM,IAAIG,MAAM,gCAGlB,GAnLoB,cAmLhBH,EAA6B,CAC/B,GAAe,UAAXC,EACF,MAAMC,EAKR,MAoQG,CAAEnB,WAzfPqB,EAyfyBC,MAAM,GA9P/B,IAHAR,EAAQI,OAASA,EACjBJ,EAAQK,IAAMA,IAED,CACX,IAAII,EAAWT,EAAQS,SACvB,GAAIA,EAAU,CACZ,IAAIC,EAAiBC,EAAoBF,EAAUT,GACnD,GAAIU,EAAgB,CAClB,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,cAAe,CAAC1P,EAAWmR,WAI/E,CACLO,SACuB,IAArBhB,EAAUvX,OAAeuX,EAAU,GAAKmC,EAAWpD,UAAUC,mBAAmB,YAAa,CAACgB,IAChGvc,MAAAA,OAvImCmb,IACzBuD,aAAuB,IAAI7C,YAAUC,sD1B7DtB,smB2BQG/N,EAAcmC,GACpChC,OAAOC,UAAUJ,IAASG,OAAOC,UAAU+B,IAArDzE,MACUyE,EAAc,GAAxBzE,MACUsC,GAAQF,EAASG,UAAYD,GAAQF,EAASI,UAAxDxC,UACM6T,EAAU3O,KAAK4O,MAAMxR,EAAOmC,GAAeA,SAC7CoP,EAAUzR,EAASG,SAAiBsR,EAAUpP,EACzCoP,EAAUzR,EAASI,SAAiBqR,EAAUpP,EAC3CoP,uCVaqBpH,OAC3BsH,EAAStH,EAAMuH,aAAa1W,YAAYmP,EAAMwH,eAE9CnR,EAAeiR,EACjBjN,EAAmB2F,EAAMxF,UAAWwF,EAAMjO,aAC1CsI,EAAmB2F,EAAMjO,YAAaiO,EAAMxF,WAE5C3E,EAAOF,EAASS,mBAAmBC,GACjCoR,EAAgBrM,GAAY4E,EAAMuH,aAAcvH,EAAMwH,cAAe3R,EAAO,UAC9EyR,EACGtH,EAAMzO,SAASkW,IAClB5R,IAGGmK,EAAMlN,YAAY2U,IACrB5R,IAGGA"} \ No newline at end of file diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js deleted file mode 100644 index c5deb04a0ad..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js +++ /dev/null @@ -1,3360 +0,0 @@ -import { MaxUint256, wrappedCurrency, sqrt, Price, CurrencyAmount, Percent, currencyEquals, TradeType, Fraction, computePriceImpact, wrappedCurrencyAmount, sortedInsert, validateAndParseAddress, WETH9 } from '@uniswap/sdk-core'; -import JSBI from 'jsbi'; -import invariant from 'tiny-invariant'; -import { defaultAbiCoder, Interface } from '@ethersproject/abi'; -import { getCreate2Address } from '@ethersproject/address'; -import { keccak256, pack } from '@ethersproject/solidity'; -import { abi as abi$1 } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'; -import { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'; -import { abi as abi$2 } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'; - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -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) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} - -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var runtime_1 = createCommonjsModule(function (module) { -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -var runtime = (function (exports) { - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined$1; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - function define(obj, key, value) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - return obj[key]; - } - try { - // IE 8 has a broken Object.defineProperty that only works on DOM objects. - define({}, ""); - } catch (err) { - define = function(obj, key, value) { - return obj[key] = value; - }; - } - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return generator; - } - exports.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = - Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunction.displayName = define( - GeneratorFunctionPrototype, - toStringTagSymbol, - "GeneratorFunction" - ); - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - define(prototype, method, function(arg) { - return this._invoke(method, arg); - }); - }); - } - - exports.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - exports.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - define(genFun, toStringTagSymbol, "GeneratorFunction"); - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - exports.awrap = function(arg) { - return { __await: arg }; - }; - - function AsyncIterator(generator, PromiseImpl) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && - typeof value === "object" && - hasOwn.call(value, "__await")) { - return PromiseImpl.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - - return PromiseImpl.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, function(error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke("throw", error, resolve, reject); - }); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new PromiseImpl(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - exports.AsyncIterator = AsyncIterator; - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { - if (PromiseImpl === void 0) PromiseImpl = Promise; - - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList), - PromiseImpl - ); - - return exports.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } - - // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined$1) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined$1; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined$1; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - define(Gp, toStringTagSymbol, "Generator"); - - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function() { - return this; - }; - - Gp.toString = function() { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - exports.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined$1; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - // Return an iterator with no values. - return { next: doneResult }; - } - exports.values = values; - - function doneResult() { - return { value: undefined$1, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined$1; - this.done = false; - this.delegate = null; - - this.method = "next"; - this.arg = undefined$1; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined$1; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined$1; - } - - return !! caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined$1; - } - - return ContinueSentinel; - } - }; - - // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; - -}( - // If this script is executing as a CommonJS module, use module.exports - // as the regeneratorRuntime namespace. Otherwise create a new empty - // object. Either way, the resulting object will be used to initialize - // the regeneratorRuntime variable at the top of this file. - module.exports -)); - -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); -} -}); - -var _TICK_SPACINGS; - -var FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'; -var ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'; -var POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'; -/** - * The default factory enabled fee amounts, denominated in hundredths of bips. - */ - -var FeeAmount; - -(function (FeeAmount) { - FeeAmount[FeeAmount["LOW"] = 500] = "LOW"; - FeeAmount[FeeAmount["MEDIUM"] = 3000] = "MEDIUM"; - FeeAmount[FeeAmount["HIGH"] = 10000] = "HIGH"; -})(FeeAmount || (FeeAmount = {})); -/** - * The default factory tick spacings by fee amount. - */ - - -var TICK_SPACINGS = (_TICK_SPACINGS = {}, _TICK_SPACINGS[FeeAmount.LOW] = 10, _TICK_SPACINGS[FeeAmount.MEDIUM] = 60, _TICK_SPACINGS[FeeAmount.HIGH] = 200, _TICK_SPACINGS); - -var NEGATIVE_ONE = /*#__PURE__*/JSBI.BigInt(-1); -var ZERO = /*#__PURE__*/JSBI.BigInt(0); -var ONE = /*#__PURE__*/JSBI.BigInt(1); // used in liquidity amount math - -var Q96 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(96)); -var Q192 = /*#__PURE__*/JSBI.exponentiate(Q96, /*#__PURE__*/JSBI.BigInt(2)); - -function computePoolAddress(_ref) { - var factoryAddress = _ref.factoryAddress, - tokenA = _ref.tokenA, - tokenB = _ref.tokenB, - fee = _ref.fee; - - var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], - token0 = _ref2[0], - token1 = _ref2[1]; // does safety checks - - - return getCreate2Address(factoryAddress, keccak256(['bytes'], [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]), POOL_INIT_CODE_HASH); -} - -var LiquidityMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function LiquidityMath() {} - - LiquidityMath.addDelta = function addDelta(x, y) { - if (JSBI.lessThan(y, ZERO)) { - return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE)); - } else { - return JSBI.add(x, y); - } - }; - - return LiquidityMath; -}(); - -var FullMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function FullMath() {} - - FullMath.mulDivRoundingUp = function mulDivRoundingUp(a, b, denominator) { - var product = JSBI.multiply(a, b); - var result = JSBI.divide(product, denominator); - if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE); - return result; - }; - - return FullMath; -}(); - -var MaxUint160 = /*#__PURE__*/JSBI.subtract( /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(160)), ONE); - -function multiplyIn256(x, y) { - var product = JSBI.multiply(x, y); - return JSBI.bitwiseAnd(product, MaxUint256); -} - -function addIn256(x, y) { - var sum = JSBI.add(x, y); - return JSBI.bitwiseAnd(sum, MaxUint256); -} - -var SqrtPriceMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function SqrtPriceMath() {} - - SqrtPriceMath.getAmount0Delta = function getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, liquidity, roundUp) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref[0]; - sqrtRatioBX96 = _ref[1]; - } - - var numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96)); - var numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96); - return roundUp ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96) : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96); - }; - - SqrtPriceMath.getAmount1Delta = function getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, liquidity, roundUp) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref2 = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref2[0]; - sqrtRatioBX96 = _ref2[1]; - } - - return roundUp ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96) : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96); - }; - - SqrtPriceMath.getNextSqrtPriceFromInput = function getNextSqrtPriceFromInput(sqrtPX96, liquidity, amountIn, zeroForOne) { - !JSBI.greaterThan(sqrtPX96, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - !JSBI.greaterThan(liquidity, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - return zeroForOne ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true) : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true); - }; - - SqrtPriceMath.getNextSqrtPriceFromOutput = function getNextSqrtPriceFromOutput(sqrtPX96, liquidity, amountOut, zeroForOne) { - !JSBI.greaterThan(sqrtPX96, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - !JSBI.greaterThan(liquidity, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - return zeroForOne ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false) : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false); - }; - - SqrtPriceMath.getNextSqrtPriceFromAmount0RoundingUp = function getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amount, add) { - if (JSBI.equal(amount, ZERO)) return sqrtPX96; - var numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96)); - - if (add) { - var product = multiplyIn256(amount, sqrtPX96); - - if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) { - var denominator = addIn256(numerator1, product); - - if (JSBI.greaterThanOrEqual(denominator, numerator1)) { - return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator); - } - } - - return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount)); - } else { - var _product = multiplyIn256(amount, sqrtPX96); - - !JSBI.equal(JSBI.divide(_product, amount), sqrtPX96) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - !JSBI.greaterThan(numerator1, _product) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - - var _denominator = JSBI.subtract(numerator1, _product); - - return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, _denominator); - } - }; - - SqrtPriceMath.getNextSqrtPriceFromAmount1RoundingDown = function getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amount, add) { - if (add) { - var quotient = JSBI.lessThanOrEqual(amount, MaxUint160) ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity) : JSBI.divide(JSBI.multiply(amount, Q96), liquidity); - return JSBI.add(sqrtPX96, quotient); - } else { - var _quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity); - - !JSBI.greaterThan(sqrtPX96, _quotient) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0; - return JSBI.subtract(sqrtPX96, _quotient); - } - }; - - return SqrtPriceMath; -}(); - -var MAX_FEE = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(10), /*#__PURE__*/JSBI.BigInt(6)); -var SwapMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function SwapMath() {} - - SwapMath.computeSwapStep = function computeSwapStep(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, amountRemaining, feePips) { - var returnValues = {}; - var zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96); - var exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO); - - if (exactIn) { - var amountRemainingLessFee = JSBI.divide(JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))), MAX_FEE); - returnValues.amountIn = zeroForOne ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true) : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true); - - if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn)) { - returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96; - } else { - returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(sqrtRatioCurrentX96, liquidity, amountRemainingLessFee, zeroForOne); - } - } else { - returnValues.amountOut = zeroForOne ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false) : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false); - - if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) { - returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96; - } else { - returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtRatioCurrentX96, liquidity, JSBI.multiply(amountRemaining, NEGATIVE_ONE), zeroForOne); - } - } - - var max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96); - - if (zeroForOne) { - returnValues.amountIn = max && exactIn ? returnValues.amountIn : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true); - returnValues.amountOut = max && !exactIn ? returnValues.amountOut : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false); - } else { - returnValues.amountIn = max && exactIn ? returnValues.amountIn : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true); - returnValues.amountOut = max && !exactIn ? returnValues.amountOut : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false); - } - - if (!exactIn && JSBI.greaterThan(returnValues.amountOut, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) { - returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE); - } - - if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) { - // we didn't reach the target, so take the remainder of the maximum input as fee - returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn); - } else { - returnValues.feeAmount = FullMath.mulDivRoundingUp(returnValues.amountIn, JSBI.BigInt(feePips), JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))); - } - - return [returnValues.sqrtRatioNextX96, returnValues.amountIn, returnValues.amountOut, returnValues.feeAmount]; - }; - - return SwapMath; -}(); - -var TWO = /*#__PURE__*/JSBI.BigInt(2); -var POWERS_OF_2 = /*#__PURE__*/[128, 64, 32, 16, 8, 4, 2, 1].map(function (pow) { - return [pow, JSBI.exponentiate(TWO, JSBI.BigInt(pow))]; -}); -function mostSignificantBit(x) { - !JSBI.greaterThan(x, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO') : invariant(false) : void 0; - !JSBI.lessThanOrEqual(x, MaxUint256) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX') : invariant(false) : void 0; - var msb = 0; - - for (var _iterator = _createForOfIteratorHelperLoose(POWERS_OF_2), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - power = _step$value[0], - min = _step$value[1]; - - if (JSBI.greaterThanOrEqual(x, min)) { - x = JSBI.signedRightShift(x, JSBI.BigInt(power)); - msb += power; - } - } - - return msb; -} - -function mulShift(val, mulBy) { - return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128)); -} - -var Q32 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(32)); -var TickMath = /*#__PURE__*/function () { - /** - * Cannot be constructed. - */ - function TickMath() {} - /** - * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick - * @param tick the tick for which to compute the sqrt ratio - */ - - - TickMath.getSqrtRatioAtTick = function getSqrtRatioAtTick(tick) { - !(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK') : invariant(false) : void 0; - var absTick = tick < 0 ? tick * -1 : tick; - var ratio = (absTick & 0x1) != 0 ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001') : JSBI.BigInt('0x100000000000000000000000000000000'); - if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a'); - if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc'); - if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0'); - if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644'); - if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0'); - if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861'); - if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053'); - if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4'); - if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54'); - if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3'); - if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9'); - if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825'); - if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5'); - if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7'); - if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6'); - if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9'); - if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604'); - if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98'); - if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2'); - if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio); // back to Q96 - - return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO) ? JSBI.add(JSBI.divide(ratio, Q32), ONE) : JSBI.divide(ratio, Q32); - } - /** - * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96 - * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96 - * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick - */ - ; - - TickMath.getTickAtSqrtRatio = function getTickAtSqrtRatio(sqrtRatioX96) { - !(JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) && JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SQRT_RATIO') : invariant(false) : void 0; - var sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32)); - var msb = mostSignificantBit(sqrtRatioX128); - var r; - - if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) { - r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127)); - } else { - r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb)); - } - - var log_2 = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64)); - - for (var i = 0; i < 14; i++) { - r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127)); - var f = JSBI.signedRightShift(r, JSBI.BigInt(128)); - log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i))); - r = JSBI.signedRightShift(r, f); - } - - var log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141')); - var tickLow = JSBI.toNumber(JSBI.signedRightShift(JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')), JSBI.BigInt(128))); - var tickHigh = JSBI.toNumber(JSBI.signedRightShift(JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')), JSBI.BigInt(128))); - return tickLow === tickHigh ? tickLow : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96) ? tickHigh : tickLow; - }; - - return TickMath; -}(); -/** - * The minimum tick that can be used on any pool. - */ - -TickMath.MIN_TICK = -887272; -/** - * The maximum tick that can be used on any pool. - */ - -TickMath.MAX_TICK = -TickMath.MIN_TICK; -/** - * The sqrt ratio corresponding to the minimum tick that could be used on any pool. - */ - -TickMath.MIN_SQRT_RATIO = /*#__PURE__*/JSBI.BigInt('4295128739'); -/** - * The sqrt ratio corresponding to the maximum tick that could be used on any pool. - */ - -TickMath.MAX_SQRT_RATIO = /*#__PURE__*/JSBI.BigInt('1461446703485210103287273052203988822378723970342'); - -/** - * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you - * do not need to load tick data for your use case. - */ -var NoTickDataProvider = /*#__PURE__*/function () { - function NoTickDataProvider() {} - - var _proto = NoTickDataProvider.prototype; - - _proto.getTick = /*#__PURE__*/function () { - var _getTick = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_tick) { - return runtime_1.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - throw new Error(NoTickDataProvider.ERROR_MESSAGE); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - function getTick(_x) { - return _getTick.apply(this, arguments); - } - - return getTick; - }(); - - _proto.nextInitializedTickWithinOneWord = /*#__PURE__*/function () { - var _nextInitializedTickWithinOneWord = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(_tick, _lte, _tickSpacing) { - return runtime_1.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - throw new Error(NoTickDataProvider.ERROR_MESSAGE); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); - - function nextInitializedTickWithinOneWord(_x2, _x3, _x4) { - return _nextInitializedTickWithinOneWord.apply(this, arguments); - } - - return nextInitializedTickWithinOneWord; - }(); - - return NoTickDataProvider; -}(); -NoTickDataProvider.ERROR_MESSAGE = 'No tick data provider was given'; - -function isSorted(list, comparator) { - for (var i = 0; i < list.length - 1; i++) { - if (comparator(list[i], list[i + 1]) > 0) { - return false; - } - } - - return true; -} - -function tickComparator(a, b) { - return a.index - b.index; -} -/** - * Utility methods for interacting with sorted lists of ticks - */ - - -var TickList = /*#__PURE__*/function () { - /** - * Cannot be constructed - */ - function TickList() {} - - TickList.validateList = function validateList(ticks, tickSpacing) { - !(tickSpacing > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_SPACING_NONZERO') : invariant(false) : void 0; // ensure ticks are spaced appropriately - - !ticks.every(function (_ref) { - var index = _ref.index; - return index % tickSpacing === 0; - }) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_SPACING') : invariant(false) : void 0; // ensure tick liquidity deltas sum to 0 - - !JSBI.equal(ticks.reduce(function (accumulator, _ref2) { - var liquidityNet = _ref2.liquidityNet; - return JSBI.add(accumulator, liquidityNet); - }, ZERO), ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO_NET') : invariant(false) : void 0; - !isSorted(ticks, tickComparator) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SORTED') : invariant(false) : void 0; - }; - - TickList.isBelowSmallest = function isBelowSmallest(ticks, tick) { - !(ticks.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LENGTH') : invariant(false) : void 0; - return tick < ticks[0].index; - }; - - TickList.isAtOrAboveLargest = function isAtOrAboveLargest(ticks, tick) { - !(ticks.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LENGTH') : invariant(false) : void 0; - return tick >= ticks[ticks.length - 1].index; - }; - - TickList.getTick = function getTick(ticks, index) { - var tick = ticks[this.binarySearch(ticks, index)]; - !(tick.index === index) ? process.env.NODE_ENV !== "production" ? invariant(false, 'NOT_CONTAINED') : invariant(false) : void 0; - return tick; - } - /** - * Finds the largest tick in the list of ticks that is less than or equal to tick - * @param ticks list of ticks - * @param tick tick to find the largest tick that is less than or equal to tick - * @private - */ - ; - - TickList.binarySearch = function binarySearch(ticks, tick) { - !!this.isBelowSmallest(ticks, tick) ? process.env.NODE_ENV !== "production" ? invariant(false, 'BELOW_SMALLEST') : invariant(false) : void 0; - var l = 0; - var r = ticks.length - 1; - var i; - - while (true) { - i = Math.floor((l + r) / 2); - - if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) { - return i; - } - - if (ticks[i].index < tick) { - l = i + 1; - } else { - r = i - 1; - } - } - }; - - TickList.nextInitializedTick = function nextInitializedTick(ticks, tick, lte) { - if (lte) { - !!TickList.isBelowSmallest(ticks, tick) ? process.env.NODE_ENV !== "production" ? invariant(false, 'BELOW_SMALLEST') : invariant(false) : void 0; - - if (TickList.isAtOrAboveLargest(ticks, tick)) { - return ticks[ticks.length - 1]; - } - - var index = this.binarySearch(ticks, tick); - return ticks[index]; - } else { - !!this.isAtOrAboveLargest(ticks, tick) ? process.env.NODE_ENV !== "production" ? invariant(false, 'AT_OR_ABOVE_LARGEST') : invariant(false) : void 0; - - if (this.isBelowSmallest(ticks, tick)) { - return ticks[0]; - } - - var _index = this.binarySearch(ticks, tick); - - return ticks[_index + 1]; - } - }; - - TickList.nextInitializedTickWithinOneWord = function nextInitializedTickWithinOneWord(ticks, tick, lte, tickSpacing) { - var compressed = Math.floor(tick / tickSpacing); // matches rounding in the code - - if (lte) { - var wordPos = compressed >> 8; - var minimum = (wordPos << 8) * tickSpacing; - - if (TickList.isBelowSmallest(ticks, tick)) { - return [minimum, false]; - } - - var index = TickList.nextInitializedTick(ticks, tick, lte).index; - var nextInitializedTick = Math.max(minimum, index); - return [nextInitializedTick, nextInitializedTick === index]; - } else { - var _wordPos = compressed + 1 >> 8; - - var maximum = (_wordPos + 1 << 8) * tickSpacing - 1; - - if (this.isAtOrAboveLargest(ticks, tick)) { - return [maximum, false]; - } - - var _index2 = this.nextInitializedTick(ticks, tick, lte).index; - - var _nextInitializedTick = Math.min(maximum, _index2); - - return [_nextInitializedTick, _nextInitializedTick === _index2]; - } - }; - - return TickList; -}(); - -function toHex(bigintIsh) { - var bigInt = JSBI.BigInt(bigintIsh); - var hex = bigInt.toString(16); - - if (hex.length % 2 !== 0) { - hex = "0" + hex; - } - - return "0x" + hex; -} - -/** - * Converts a route to a hex encoded path - * @param route the v3 path to convert to an encoded path - * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps - */ - -function encodeRouteToPath(route, exactOutput) { - var firstInputToken = wrappedCurrency(route.input, route.chainId); - - var _route$pools$reduce = route.pools.reduce(function (_ref, pool, index) { - var inputToken = _ref.inputToken, - path = _ref.path, - types = _ref.types; - var outputToken = pool.token0.equals(inputToken) ? pool.token1 : pool.token0; - - if (index === 0) { - return { - inputToken: outputToken, - types: ['address', 'uint24', 'address'], - path: [inputToken.address, pool.fee, outputToken.address] - }; - } else { - return { - inputToken: outputToken, - types: [].concat(types, ['uint24', 'address']), - path: [].concat(path, [pool.fee, outputToken.address]) - }; - } - }, { - inputToken: firstInputToken, - path: [], - types: [] - }), - path = _route$pools$reduce.path, - types = _route$pools$reduce.types; - - return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path); -} - -/** - * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0 - * @param amount1 the numerator amount, i.e. amount of token1 - * @param amount0 the denominator amount, i.en amount of token0 - */ - -function encodeSqrtRatioX96(amount1, amount0) { - var numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192)); - var denominator = JSBI.BigInt(amount0); - var ratioX192 = JSBI.divide(numerator, denominator); - return sqrt(ratioX192); -} - -function maxLiquidityForAmount0Imprecise(sqrtRatioAX96, sqrtRatioBX96, amount0) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref[0]; - sqrtRatioBX96 = _ref[1]; - } - - var intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96); - return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); -} - -function maxLiquidityForAmount0Precise(sqrtRatioAX96, sqrtRatioBX96, amount0) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref2 = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref2[0]; - sqrtRatioBX96 = _ref2[1]; - } - - var numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96); - var denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); - return JSBI.divide(numerator, denominator); -} - -function maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref3 = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref3[0]; - sqrtRatioBX96 = _ref3[1]; - } - - return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)); -} -/** - * Computes the maximum amount of liquidity received for a given amount of token0, token1, - * and the prices at the tick boundaries. - * @param sqrtRatioCurrentX96 the current price - * @param sqrtRatioAX96 price at lower boundary - * @param sqrtRatioBX96 price at upper boundary - * @param amount0 token0 amount - * @param amount1 token1 amount - * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ - - -function maxLiquidityForAmounts(sqrtRatioCurrentX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1, useFullPrecision) { - if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) { - var _ref4 = [sqrtRatioBX96, sqrtRatioAX96]; - sqrtRatioAX96 = _ref4[0]; - sqrtRatioBX96 = _ref4[1]; - } - - var maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise; - - if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) { - return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0); - } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) { - var liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0); - var liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1); - return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1; - } else { - return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1); - } -} - -/** - * Returns the closest tick that is nearest a given tick and usable for the given tick spacing - * @param tick the target tick - * @param tickSpacing the spacing of the pool - */ - -function nearestUsableTick(tick, tickSpacing) { - !(Number.isInteger(tick) && Number.isInteger(tickSpacing)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INTEGERS') : invariant(false) : void 0; - !(tickSpacing > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_SPACING') : invariant(false) : void 0; - !(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_BOUND') : invariant(false) : void 0; - var rounded = Math.round(tick / tickSpacing) * tickSpacing; - if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing;else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing;else return rounded; -} - -/** - * Returns a price object corresponding to the input tick and the base/quote token - * Inputs must be tokens because the address order is used to interpret the price represented by the tick - * @param baseToken the base token of the price - * @param quoteToken the quote token of the price - * @param tick the tick for which to return the price - */ - -function tickToPrice(baseToken, quoteToken, tick) { - var sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick); - var ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96); - return baseToken.sortsBefore(quoteToken) ? new Price(baseToken, quoteToken, Q192, ratioX192) : new Price(baseToken, quoteToken, ratioX192, Q192); -} -/** - * Returns the first tick for which the given price is greater than or equal to the tick price - * @param price for which to return the closest tick that represents a price less than or equal to the input price, - * i.e. the price of the returned tick is less than or equal to the input price - */ - -function priceToClosestTick(price) { - var sorted = price.baseCurrency.sortsBefore(price.quoteCurrency); - var sqrtRatioX96 = sorted ? encodeSqrtRatioX96(price.numerator, price.denominator) : encodeSqrtRatioX96(price.denominator, price.numerator); - var tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96); - var nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1); - - if (sorted) { - if (!price.lessThan(nextTickPrice)) { - tick++; - } - } else { - if (!price.greaterThan(nextTickPrice)) { - tick++; - } - } - - return tick; -} - -var Tick = function Tick(_ref) { - var index = _ref.index, - liquidityGross = _ref.liquidityGross, - liquidityNet = _ref.liquidityNet; - !(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK') : invariant(false) : void 0; - this.index = index; - this.liquidityGross = JSBI.BigInt(liquidityGross); - this.liquidityNet = JSBI.BigInt(liquidityNet); -}; - -/** - * A data provider for ticks that is backed by an in-memory array of ticks. - */ - -var TickListDataProvider = /*#__PURE__*/function () { - function TickListDataProvider(ticks, tickSpacing) { - var ticksMapped = ticks.map(function (t) { - return t instanceof Tick ? t : new Tick(t); - }); - TickList.validateList(ticksMapped, tickSpacing); - this.ticks = ticksMapped; - } - - var _proto = TickListDataProvider.prototype; - - _proto.getTick = /*#__PURE__*/function () { - var _getTick = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(tick) { - return runtime_1.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - return _context.abrupt("return", TickList.getTick(this.ticks, tick)); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function getTick(_x) { - return _getTick.apply(this, arguments); - } - - return getTick; - }(); - - _proto.nextInitializedTickWithinOneWord = /*#__PURE__*/function () { - var _nextInitializedTickWithinOneWord = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(tick, lte, tickSpacing) { - return runtime_1.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - return _context2.abrupt("return", TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function nextInitializedTickWithinOneWord(_x2, _x3, _x4) { - return _nextInitializedTickWithinOneWord.apply(this, arguments); - } - - return nextInitializedTickWithinOneWord; - }(); - - return TickListDataProvider; -}(); - -/** - * By default, pools will not allow operations that require ticks. - */ - -var NO_TICK_DATA_PROVIDER_DEFAULT = /*#__PURE__*/new NoTickDataProvider(); -/** - * Represents a V3 pool - */ - -var Pool = /*#__PURE__*/function () { - /** - * Construct a pool - * @param tokenA one of the tokens in the pool - * @param tokenB the other token in the pool - * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool - * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0 - * @param liquidity the current value of in range liquidity - * @param tickCurrent the current tick of the pool - * @param ticks the current state of the pool ticks or a data provider that can return tick data - */ - function Pool(tokenA, tokenB, fee, sqrtRatioX96, liquidity, tickCurrent, ticks) { - if (ticks === void 0) { - ticks = NO_TICK_DATA_PROVIDER_DEFAULT; - } - - !(Number.isInteger(fee) && fee < 1000000) ? process.env.NODE_ENV !== "production" ? invariant(false, 'FEE') : invariant(false) : void 0; - var tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent); - var nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1); - !(JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) && JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PRICE_BOUNDS') : invariant(false) : void 0; - - var _ref = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]; - - this.token0 = _ref[0]; - this.token1 = _ref[1]; - this.fee = fee; - this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96); - this.liquidity = JSBI.BigInt(liquidity); - this.tickCurrent = tickCurrent; - this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks; - } - - Pool.getAddress = function getAddress(tokenA, tokenB, fee) { - return computePoolAddress({ - factoryAddress: FACTORY_ADDRESS, - fee: fee, - tokenA: tokenA, - tokenB: tokenB - }); - } - /** - * Returns true if the token is either token0 or token1 - * @param token to check - */ - ; - - var _proto = Pool.prototype; - - _proto.involvesToken = function involvesToken(token) { - return token.equals(this.token0) || token.equals(this.token1); - } - /** - * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0 - */ - ; - - /** - * Return the price of the given token in terms of the other token in the pool. - * @param token token to return price of - */ - _proto.priceOf = function priceOf(token) { - !this.involvesToken(token) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - return token.equals(this.token0) ? this.token0Price : this.token1Price; - } - /** - * Returns the chain ID of the tokens in the pool. - */ - ; - - /** - * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade - * @param inputAmount the input amount for which to quote the output amount - */ - _proto.getOutputAmount = - /*#__PURE__*/ - function () { - var _getOutputAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(inputAmount, sqrtPriceLimitX96) { - var zeroForOne, _yield$this$swap, outputAmount, sqrtRatioX96, liquidity, tickCurrent, outputToken; - - return runtime_1.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - !this.involvesToken(inputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - zeroForOne = inputAmount.currency.equals(this.token0); - _context.next = 4; - return this.swap(zeroForOne, inputAmount.quotient, sqrtPriceLimitX96); - - case 4: - _yield$this$swap = _context.sent; - outputAmount = _yield$this$swap.amountCalculated; - sqrtRatioX96 = _yield$this$swap.sqrtRatioX96; - liquidity = _yield$this$swap.liquidity; - tickCurrent = _yield$this$swap.tickCurrent; - outputToken = zeroForOne ? this.token1 : this.token0; - return _context.abrupt("return", [CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)), new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)]); - - case 11: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function getOutputAmount(_x, _x2) { - return _getOutputAmount.apply(this, arguments); - } - - return getOutputAmount; - }() - /** - * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade - * @param outputAmount the output amount for which to quote the input amount - */ - ; - - _proto.getInputAmount = - /*#__PURE__*/ - function () { - var _getInputAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(outputAmount, sqrtPriceLimitX96) { - var zeroForOne, _yield$this$swap2, inputAmount, sqrtRatioX96, liquidity, tickCurrent, inputToken; - - return runtime_1.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - !(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TOKEN') : invariant(false) : void 0; - zeroForOne = outputAmount.currency.equals(this.token1); - _context2.next = 4; - return this.swap(zeroForOne, JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE), sqrtPriceLimitX96); - - case 4: - _yield$this$swap2 = _context2.sent; - inputAmount = _yield$this$swap2.amountCalculated; - sqrtRatioX96 = _yield$this$swap2.sqrtRatioX96; - liquidity = _yield$this$swap2.liquidity; - tickCurrent = _yield$this$swap2.tickCurrent; - inputToken = zeroForOne ? this.token0 : this.token1; - return _context2.abrupt("return", [CurrencyAmount.fromRawAmount(inputToken, inputAmount), new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)]); - - case 11: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function getInputAmount(_x3, _x4) { - return _getInputAmount.apply(this, arguments); - } - - return getInputAmount; - }(); - - _proto.swap = /*#__PURE__*/function () { - var _swap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(zeroForOne, amountSpecified, sqrtPriceLimitX96) { - var exactInput, state, step, _yield$this$tickDataP, _SwapMath$computeSwap, liquidityNet; - - return runtime_1.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - if (!sqrtPriceLimitX96) sqrtPriceLimitX96 = zeroForOne ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE) : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE); - - if (zeroForOne) { - !JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RATIO_MIN') : invariant(false) : void 0; - !JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RATIO_CURRENT') : invariant(false) : void 0; - } else { - !JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RATIO_MAX') : invariant(false) : void 0; - !JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RATIO_CURRENT') : invariant(false) : void 0; - } - - exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO); // keep track of swap state - - state = { - amountSpecifiedRemaining: amountSpecified, - amountCalculated: ZERO, - sqrtPriceX96: this.sqrtRatioX96, - tick: this.tickCurrent, - liquidity: this.liquidity - }; // start swap while loop - - case 4: - if (!(JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96)) { - _context3.next = 35; - break; - } - - step = {}; - step.sqrtPriceStartX96 = state.sqrtPriceX96; - _context3.next = 9; - return this.tickDataProvider.nextInitializedTickWithinOneWord(state.tick, zeroForOne, this.tickSpacing); - - case 9: - _yield$this$tickDataP = _context3.sent; - step.tickNext = _yield$this$tickDataP[0]; - step.initialized = _yield$this$tickDataP[1]; - - if (step.tickNext < TickMath.MIN_TICK) { - step.tickNext = TickMath.MIN_TICK; - } else if (step.tickNext > TickMath.MAX_TICK) { - step.tickNext = TickMath.MAX_TICK; - } - - step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); - _SwapMath$computeSwap = SwapMath.computeSwapStep(state.sqrtPriceX96, (zeroForOne ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96) : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)) ? sqrtPriceLimitX96 : step.sqrtPriceNextX96, state.liquidity, state.amountSpecifiedRemaining, this.fee); - state.sqrtPriceX96 = _SwapMath$computeSwap[0]; - step.amountIn = _SwapMath$computeSwap[1]; - step.amountOut = _SwapMath$computeSwap[2]; - step.feeAmount = _SwapMath$computeSwap[3]; - - if (exactInput) { - state.amountSpecifiedRemaining = JSBI.subtract(state.amountSpecifiedRemaining, JSBI.add(step.amountIn, step.feeAmount)); - state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut); - } else { - state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut); - state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount)); - } // TODO - - - if (!JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) { - _context3.next = 32; - break; - } - - if (!step.initialized) { - _context3.next = 29; - break; - } - - _context3.t0 = JSBI; - _context3.next = 25; - return this.tickDataProvider.getTick(step.tickNext); - - case 25: - _context3.t1 = _context3.sent.liquidityNet; - liquidityNet = _context3.t0.BigInt.call(_context3.t0, _context3.t1); - // if we're moving leftward, we interpret liquidityNet as the opposite sign - // safe because liquidityNet cannot be type(int128).min - if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE); - state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet); - - case 29: - state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; - _context3.next = 33; - break; - - case 32: - if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { - // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved - state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); - } - - case 33: - _context3.next = 4; - break; - - case 35: - return _context3.abrupt("return", { - amountCalculated: state.amountCalculated, - sqrtRatioX96: state.sqrtPriceX96, - liquidity: state.liquidity, - tickCurrent: state.tick - }); - - case 36: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function swap(_x5, _x6, _x7) { - return _swap.apply(this, arguments); - } - - return swap; - }(); - - _createClass(Pool, [{ - key: "token0Price", - get: function get() { - var _this$_token0Price; - - return (_this$_token0Price = this._token0Price) != null ? _this$_token0Price : this._token0Price = new Price(this.token0, this.token1, Q192, JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)); - } - /** - * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1 - */ - - }, { - key: "token1Price", - get: function get() { - var _this$_token1Price; - - return (_this$_token1Price = this._token1Price) != null ? _this$_token1Price : this._token1Price = new Price(this.token1, this.token0, JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96), Q192); - } - }, { - key: "chainId", - get: function get() { - return this.token0.chainId; - } - }, { - key: "tickSpacing", - get: function get() { - return TICK_SPACINGS[this.fee]; - } - }]); - - return Pool; -}(); - -/** - * Represents a position on a Uniswap V3 Pool - */ - -var Position = /*#__PURE__*/function () { - /** - * Constructs a position for a given pool with the given liquidity - * @param pool for which pool the liquidity is assigned - * @param liquidity the amount of liquidity that is in the position - * @param tickLower the lower tick of the position - * @param tickUpper the upper tick of the position - */ - function Position(_ref) { - var pool = _ref.pool, - liquidity = _ref.liquidity, - tickLower = _ref.tickLower, - tickUpper = _ref.tickUpper; - // cached resuts for the getters - this._token0Amount = null; - this._token1Amount = null; - this._mintAmounts = null; - !(tickLower < tickUpper) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_ORDER') : invariant(false) : void 0; - !(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_LOWER') : invariant(false) : void 0; - !(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'TICK_UPPER') : invariant(false) : void 0; - this.pool = pool; - this.tickLower = tickLower; - this.tickUpper = tickUpper; - this.liquidity = JSBI.BigInt(liquidity); - } - /** - * Returns the price of token0 at the lower tick - */ - - - var _proto = Position.prototype; - - /** - * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage - * @param slippageTolerance amount by which the price can 'slip' - * @private - */ - _proto.ratiosAfterSlippage = function ratiosAfterSlippage(slippageTolerance) { - var priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance)); - var priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1)); - var sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator); - - if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) { - sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1)); - } - - var sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator); - - if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) { - sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1)); - } - - return { - sqrtRatioX96Lower: sqrtRatioX96Lower, - sqrtRatioX96Upper: sqrtRatioX96Upper - }; - } - /** - * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position - * with the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the current price - */ - ; - - _proto.mintAmountsWithSlippage = function mintAmountsWithSlippage(slippageTolerance) { - // get lower/upper prices - var _this$ratiosAfterSlip = this.ratiosAfterSlippage(slippageTolerance), - sqrtRatioX96Upper = _this$ratiosAfterSlip.sqrtRatioX96Upper, - sqrtRatioX96Lower = _this$ratiosAfterSlip.sqrtRatioX96Lower; // construct counterfactual pools - - - var poolLower = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Lower, 0 - /* liquidity doesn't matter */ - , TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)); - var poolUpper = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Upper, 0 - /* liquidity doesn't matter */ - , TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)); // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage) - - var positionThatWillBeCreated = Position.fromAmounts(_extends({ - pool: this.pool, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }, this.mintAmounts, { - useFullPrecision: false - })); // we want the smaller amounts... - // ...which occurs at the upper price for amount0... - - var amount0 = new Position({ - pool: poolUpper, - liquidity: positionThatWillBeCreated.liquidity, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }).mintAmounts.amount0; // ...and the lower for amount1 - - var amount1 = new Position({ - pool: poolLower, - liquidity: positionThatWillBeCreated.liquidity, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }).mintAmounts.amount1; - return { - amount0: amount0, - amount1: amount1 - }; - } - /** - * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the - * position with the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the current price - */ - ; - - _proto.burnAmountsWithSlippage = function burnAmountsWithSlippage(slippageTolerance) { - // get lower/upper prices - var _this$ratiosAfterSlip2 = this.ratiosAfterSlippage(slippageTolerance), - sqrtRatioX96Upper = _this$ratiosAfterSlip2.sqrtRatioX96Upper, - sqrtRatioX96Lower = _this$ratiosAfterSlip2.sqrtRatioX96Lower; // construct counterfactual pools - - - var poolLower = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Lower, 0 - /* liquidity doesn't matter */ - , TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)); - var poolUpper = new Pool(this.pool.token0, this.pool.token1, this.pool.fee, sqrtRatioX96Upper, 0 - /* liquidity doesn't matter */ - , TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)); // we want the smaller amounts... - // ...which occurs at the upper price for amount0... - - var amount0 = new Position({ - pool: poolUpper, - liquidity: this.liquidity, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }).amount0; // ...and the lower for amount1 - - var amount1 = new Position({ - pool: poolLower, - liquidity: this.liquidity, - tickLower: this.tickLower, - tickUpper: this.tickUpper - }).amount1; - return { - amount0: amount0.quotient, - amount1: amount1.quotient - }; - } - /** - * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at - * the current price for the pool - */ - ; - - /** - * Computes the maximum amount of liquidity received for a given amount of token0, token1, - * and the prices at the tick boundaries. - * @param pool the pool for which the position should be created - * @param tickLower the lower tick of the position - * @param tickUpper the upper tick of the position - * @param amount0 token0 amount - * @param amount1 token1 amount - * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ - Position.fromAmounts = function fromAmounts(_ref2) { - var pool = _ref2.pool, - tickLower = _ref2.tickLower, - tickUpper = _ref2.tickUpper, - amount0 = _ref2.amount0, - amount1 = _ref2.amount1, - useFullPrecision = _ref2.useFullPrecision; - var sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower); - var sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper); - return new Position({ - pool: pool, - tickLower: tickLower, - tickUpper: tickUpper, - liquidity: maxLiquidityForAmounts(pool.sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1, useFullPrecision) - }); - } - /** - * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1 - * @param pool the pool for which the position is created - * @param tickLower the lower tick - * @param tickUpper the upper tick - * @param amount0 the desired amount of token0 - * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate, - * not what core can theoretically support - */ - ; - - Position.fromAmount0 = function fromAmount0(_ref3) { - var pool = _ref3.pool, - tickLower = _ref3.tickLower, - tickUpper = _ref3.tickUpper, - amount0 = _ref3.amount0, - useFullPrecision = _ref3.useFullPrecision; - return Position.fromAmounts({ - pool: pool, - tickLower: tickLower, - tickUpper: tickUpper, - amount0: amount0, - amount1: MaxUint256, - useFullPrecision: useFullPrecision - }); - } - /** - * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0 - * @param pool the pool for which the position is created - * @param tickLower the lower tick - * @param tickUpper the upper tick - * @param amount1 the desired amount of token1 - */ - ; - - Position.fromAmount1 = function fromAmount1(_ref4) { - var pool = _ref4.pool, - tickLower = _ref4.tickLower, - tickUpper = _ref4.tickUpper, - amount1 = _ref4.amount1; - // this function always uses full precision, - return Position.fromAmounts({ - pool: pool, - tickLower: tickLower, - tickUpper: tickUpper, - amount0: MaxUint256, - amount1: amount1, - useFullPrecision: true - }); - }; - - _createClass(Position, [{ - key: "token0PriceLower", - get: function get() { - return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower); - } - /** - * Returns the price of token0 at the upper tick - */ - - }, { - key: "token0PriceUpper", - get: function get() { - return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper); - } - /** - * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price - */ - - }, { - key: "amount0", - get: function get() { - if (this._token0Amount === null) { - if (this.pool.tickCurrent < this.tickLower) { - this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, SqrtPriceMath.getAmount0Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); - } else if (this.pool.tickCurrent < this.tickUpper) { - this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, SqrtPriceMath.getAmount0Delta(this.pool.sqrtRatioX96, TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); - } else { - this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO); - } - } - - return this._token0Amount; - } - /** - * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price - */ - - }, { - key: "amount1", - get: function get() { - if (this._token1Amount === null) { - if (this.pool.tickCurrent < this.tickLower) { - this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO); - } else if (this.pool.tickCurrent < this.tickUpper) { - this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), this.pool.sqrtRatioX96, this.liquidity, false)); - } else { - this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, false)); - } - } - - return this._token1Amount; - } - }, { - key: "mintAmounts", - get: function get() { - if (this._mintAmounts === null) { - if (this.pool.tickCurrent < this.tickLower) { - return { - amount0: SqrtPriceMath.getAmount0Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true), - amount1: ZERO - }; - } else if (this.pool.tickCurrent < this.tickUpper) { - return { - amount0: SqrtPriceMath.getAmount0Delta(this.pool.sqrtRatioX96, TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true), - amount1: SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), this.pool.sqrtRatioX96, this.liquidity, true) - }; - } else { - return { - amount0: ZERO, - amount1: SqrtPriceMath.getAmount1Delta(TickMath.getSqrtRatioAtTick(this.tickLower), TickMath.getSqrtRatioAtTick(this.tickUpper), this.liquidity, true) - }; - } - } - - return this._mintAmounts; - } - }]); - - return Position; -}(); - -/** - * Represents a list of pools through which a swap can occur - */ - -var Route = /*#__PURE__*/function () { - function Route(pools, input, output) { - this._midPrice = null; - !(pools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'POOLS') : invariant(false) : void 0; - var chainId = pools[0].chainId; - var allOnSameChain = pools.every(function (pool) { - return pool.chainId === chainId; - }); - !allOnSameChain ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_IDS') : invariant(false) : void 0; - var wrappedInput = wrappedCurrency(input, chainId); - !pools[0].involvesToken(wrappedInput) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT') : invariant(false) : void 0; - !pools[pools.length - 1].involvesToken(wrappedCurrency(output, chainId)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT') : invariant(false) : void 0; - /** - * Normalizes token0-token1 order and selects the next token/fee step to add to the path - * */ - - var tokenPath = [wrappedInput]; - - for (var _iterator = _createForOfIteratorHelperLoose(pools.entries()), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - i = _step$value[0], - pool = _step$value[1]; - var currentInputToken = tokenPath[i]; - !(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1)) ? process.env.NODE_ENV !== "production" ? invariant(false, 'PATH') : invariant(false) : void 0; - var nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0; - tokenPath.push(nextToken); - } - - this.pools = pools; - this.tokenPath = tokenPath; - this.input = input; - this.output = output != null ? output : tokenPath[tokenPath.length - 1]; - } - - _createClass(Route, [{ - key: "chainId", - get: function get() { - return this.pools[0].chainId; - } - /** - * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token. - */ - - }, { - key: "inputToken", - get: function get() { - return wrappedCurrency(this.input, this.chainId); - } - /** - * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token. - */ - - }, { - key: "outputToken", - get: function get() { - return wrappedCurrency(this.output, this.chainId); - } - /** - * Returns the mid price of the route - */ - - }, { - key: "midPrice", - get: function get() { - if (this._midPrice !== null) return this._midPrice; - var price = this.pools.slice(1).reduce(function (_ref, pool) { - var nextInput = _ref.nextInput, - price = _ref.price; - return nextInput.equals(pool.token0) ? { - nextInput: pool.token1, - price: price.multiply(pool.token0Price) - } : { - nextInput: pool.token0, - price: price.multiply(pool.token1Price) - }; - }, this.pools[0].token0.equals(this.inputToken) ? { - nextInput: this.pools[0].token1, - price: this.pools[0].token0Price - } : { - nextInput: this.pools[0].token0, - price: this.pools[0].token1Price - }).price; - return this._midPrice = new Price(this.input, this.output, price.denominator, price.numerator); - } - }]); - - return Route; -}(); - -function tradeComparator(a, b) { - // must have same input and output token for comparison - !currencyEquals(a.inputAmount.currency, b.inputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT_CURRENCY') : invariant(false) : void 0; - !currencyEquals(a.outputAmount.currency, b.outputAmount.currency) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT_CURRENCY') : invariant(false) : void 0; - - if (a.outputAmount.equalTo(b.outputAmount)) { - if (a.inputAmount.equalTo(b.inputAmount)) { - // consider the number of hops since each hop costs gas - return a.route.tokenPath.length - b.route.tokenPath.length; - } // trade A requires less input than trade B, so A should come first - - - if (a.inputAmount.lessThan(b.inputAmount)) { - return -1; - } else { - return 1; - } - } else { - // tradeA has less output than trade B, so should come second - if (a.outputAmount.lessThan(b.outputAmount)) { - return 1; - } else { - return -1; - } - } -} -/** - * Represents a trade executed against a list of pools. - * Does not account for slippage, i.e. trades that front run this trade and move the price. - */ - -var Trade = /*#__PURE__*/function () { - /** - * Construct a trade by passing in the pre-computed property values - * @param route the route through which the trade occurs - * @param inputAmount the amount of input paid in the trade - * @param outputAmount the amount of output received in the trade - * @param tradeType the type of trade, exact input or exact output - */ - function Trade(_ref) { - var route = _ref.route, - inputAmount = _ref.inputAmount, - outputAmount = _ref.outputAmount, - tradeType = _ref.tradeType; - !currencyEquals(inputAmount.currency, route.input) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT_CURRENCY_MATCH') : invariant(false) : void 0; - !currencyEquals(outputAmount.currency, route.output) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT_CURRENCY_MATCH') : invariant(false) : void 0; - this.route = route; - this.inputAmount = inputAmount; - this.outputAmount = outputAmount; - this.tradeType = tradeType; - } - /** - * The price expressed in terms of output amount/input amount. - */ - - - /** - * Constructs an exact in trade with the given amount in and route - * @param route route of the exact in trade - * @param amountIn the amount being passed in - */ - Trade.exactIn = - /*#__PURE__*/ - function () { - var _exactIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(route, amountIn) { - return runtime_1.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - return _context.abrupt("return", Trade.fromRoute(route, amountIn, TradeType.EXACT_INPUT)); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - function exactIn(_x, _x2) { - return _exactIn.apply(this, arguments); - } - - return exactIn; - }() - /** - * Constructs an exact out trade with the given amount out and route - * @param route route of the exact out trade - * @param amountOut the amount returned by the trade - */ - ; - - Trade.exactOut = - /*#__PURE__*/ - function () { - var _exactOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(route, amountOut) { - return runtime_1.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - return _context2.abrupt("return", Trade.fromRoute(route, amountOut, TradeType.EXACT_OUTPUT)); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); - - function exactOut(_x3, _x4) { - return _exactOut.apply(this, arguments); - } - - return exactOut; - }() - /** - * Constructs a trade by simulating swaps through the given route - * @param route route to swap through - * @param amount the amount specified, either input or output, depending on tradeType - * @param tradeType whether the trade is an exact input or exact output swap - */ - ; - - Trade.fromRoute = - /*#__PURE__*/ - function () { - var _fromRoute = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(route, amount, tradeType) { - var amounts, inputAmount, outputAmount, i, pool, _yield$pool$getOutput, _outputAmount, _i, _pool, _yield$_pool$getInput, _inputAmount; - - return runtime_1.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - amounts = new Array(route.tokenPath.length); - - if (!(tradeType === TradeType.EXACT_INPUT)) { - _context3.next = 19; - break; - } - - !currencyEquals(amount.currency, route.input) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INPUT') : invariant(false) : void 0; - amounts[0] = wrappedCurrencyAmount(amount, route.chainId); - i = 0; - - case 5: - if (!(i < route.tokenPath.length - 1)) { - _context3.next = 15; - break; - } - - pool = route.pools[i]; - _context3.next = 9; - return pool.getOutputAmount(amounts[i]); - - case 9: - _yield$pool$getOutput = _context3.sent; - _outputAmount = _yield$pool$getOutput[0]; - amounts[i + 1] = _outputAmount; - - case 12: - i++; - _context3.next = 5; - break; - - case 15: - inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator); - outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amounts[amounts.length - 1].numerator, amounts[amounts.length - 1].denominator); - _context3.next = 34; - break; - - case 19: - !currencyEquals(amount.currency, route.output) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OUTPUT') : invariant(false) : void 0; - amounts[amounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId); - _i = route.tokenPath.length - 1; - - case 22: - if (!(_i > 0)) { - _context3.next = 32; - break; - } - - _pool = route.pools[_i - 1]; - _context3.next = 26; - return _pool.getInputAmount(amounts[_i]); - - case 26: - _yield$_pool$getInput = _context3.sent; - _inputAmount = _yield$_pool$getInput[0]; - amounts[_i - 1] = _inputAmount; - - case 29: - _i--; - _context3.next = 22; - break; - - case 32: - inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator); - outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator); - - case 34: - return _context3.abrupt("return", new Trade({ - route: route, - tradeType: tradeType, - inputAmount: inputAmount, - outputAmount: outputAmount - })); - - case 35: - case "end": - return _context3.stop(); - } - } - }, _callee3); - })); - - function fromRoute(_x5, _x6, _x7) { - return _fromRoute.apply(this, arguments); - } - - return fromRoute; - }() - /** - * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade - * elsewhere and do not have any tick data - * @param constructorArguments the arguments passed to the trade constructor - */ - ; - - Trade.createUncheckedTrade = function createUncheckedTrade(constructorArguments) { - return new Trade(constructorArguments); - } - /** - * Get the minimum amount that must be received from this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - ; - - var _proto = Trade.prototype; - - _proto.minimumAmountOut = function minimumAmountOut(slippageTolerance) { - !!slippageTolerance.lessThan(ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SLIPPAGE_TOLERANCE') : invariant(false) : void 0; - - if (this.tradeType === TradeType.EXACT_OUTPUT) { - return this.outputAmount; - } else { - var slippageAdjustedAmountOut = new Fraction(ONE).add(slippageTolerance).invert().multiply(this.outputAmount.quotient).quotient; - return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut); - } - } - /** - * Get the maximum amount in that can be spent via this trade for the given slippage tolerance - * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade - */ - ; - - _proto.maximumAmountIn = function maximumAmountIn(slippageTolerance) { - !!slippageTolerance.lessThan(ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'SLIPPAGE_TOLERANCE') : invariant(false) : void 0; - - if (this.tradeType === TradeType.EXACT_INPUT) { - return this.inputAmount; - } else { - var slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient).quotient; - return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn); - } - } - /** - * Return the execution price after accounting for slippage tolerance - * @param slippageTolerance the allowed tolerated slippage - */ - ; - - _proto.worstExecutionPrice = function worstExecutionPrice(slippageTolerance) { - return new Price(this.inputAmount.currency, this.outputAmount.currency, this.maximumAmountIn(slippageTolerance).quotient, this.minimumAmountOut(slippageTolerance).quotient); - } - /** - * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token - * amount to an output token, making at most `maxHops` hops. - * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pools the pools to consider in finding the best trade - * @param nextAmountIn exact amount of input currency to spend - * @param currencyOut the desired currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool - * @param currentPools used in recursion; the current list of pools - * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter - * @param bestTrades used in recursion; the current list of best trades - */ - ; - - Trade.bestTradeExactIn = - /*#__PURE__*/ - function () { - var _bestTradeExactIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pools, currencyAmountIn, currencyOut, _temp, // used in recursion. - currentPools, nextAmountIn, bestTrades) { - var _ref2, _ref2$maxNumResults, maxNumResults, _ref2$maxHops, maxHops, chainId, amountIn, tokenOut, i, pool, amountOut, _yield$pool$getOutput2, poolsExcludingThisPool; - - return runtime_1.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _ref2 = _temp === void 0 ? {} : _temp, _ref2$maxNumResults = _ref2.maxNumResults, maxNumResults = _ref2$maxNumResults === void 0 ? 3 : _ref2$maxNumResults, _ref2$maxHops = _ref2.maxHops, maxHops = _ref2$maxHops === void 0 ? 3 : _ref2$maxHops; - - if (currentPools === void 0) { - currentPools = []; - } - - if (nextAmountIn === void 0) { - nextAmountIn = currencyAmountIn; - } - - if (bestTrades === void 0) { - bestTrades = []; - } - - !(pools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'POOLS') : invariant(false) : void 0; - !(maxHops > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_HOPS') : invariant(false) : void 0; - !(currencyAmountIn === nextAmountIn || currentPools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INVALID_RECURSION') : invariant(false) : void 0; - chainId = nextAmountIn.currency.isToken ? nextAmountIn.currency.chainId : currencyOut.isToken ? currencyOut.chainId : undefined; - !(chainId !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; - amountIn = wrappedCurrencyAmount(nextAmountIn, chainId); - tokenOut = wrappedCurrency(currencyOut, chainId); - i = 0; - - case 12: - if (!(i < pools.length)) { - _context4.next = 48; - break; - } - - pool = pools[i]; // pool irrelevant - - if (!(!currencyEquals(pool.token0, amountIn.currency) && !currencyEquals(pool.token1, amountIn.currency))) { - _context4.next = 16; - break; - } - - return _context4.abrupt("continue", 45); - - case 16: - amountOut = void 0; - _context4.prev = 17; - _context4.next = 21; - return pool.getOutputAmount(amountIn); - - case 21: - _yield$pool$getOutput2 = _context4.sent; - amountOut = _yield$pool$getOutput2[0]; - _context4.next = 30; - break; - - case 25: - _context4.prev = 25; - _context4.t0 = _context4["catch"](17); - - if (!_context4.t0.isInsufficientInputAmountError) { - _context4.next = 29; - break; - } - - return _context4.abrupt("continue", 45); - - case 29: - throw _context4.t0; - - case 30: - if (!(amountOut.currency.isToken && amountOut.currency.equals(tokenOut))) { - _context4.next = 41; - break; - } - - _context4.t1 = sortedInsert; - _context4.t2 = bestTrades; - _context4.next = 35; - return Trade.fromRoute(new Route([].concat(currentPools, [pool]), currencyAmountIn.currency, currencyOut), currencyAmountIn, TradeType.EXACT_INPUT); - - case 35: - _context4.t3 = _context4.sent; - _context4.t4 = maxNumResults; - _context4.t5 = tradeComparator; - (0, _context4.t1)(_context4.t2, _context4.t3, _context4.t4, _context4.t5); - _context4.next = 45; - break; - - case 41: - if (!(maxHops > 1 && pools.length > 1)) { - _context4.next = 45; - break; - } - - poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length)); // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops - - _context4.next = 45; - return Trade.bestTradeExactIn(poolsExcludingThisPool, currencyAmountIn, currencyOut, { - maxNumResults: maxNumResults, - maxHops: maxHops - 1 - }, [].concat(currentPools, [pool]), amountOut, bestTrades); - - case 45: - i++; - _context4.next = 12; - break; - - case 48: - return _context4.abrupt("return", bestTrades); - - case 49: - case "end": - return _context4.stop(); - } - } - }, _callee4, null, [[17, 25]]); - })); - - function bestTradeExactIn(_x8, _x9, _x10, _x11, _x12, _x13, _x14) { - return _bestTradeExactIn.apply(this, arguments); - } - - return bestTradeExactIn; - }() - /** - * similar to the above method but instead targets a fixed output amount - * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token - * to an output token amount, making at most `maxHops` hops - * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting - * the amount in among multiple routes. - * @param pools the pools to consider in finding the best trade - * @param currencyIn the currency to spend - * @param currencyAmountOut the desired currency amount out - * @param nextAmountOut the exact amount of currency out - * @param maxNumResults maximum number of results to return - * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool - * @param currentPools used in recursion; the current list of pools - * @param bestTrades used in recursion; the current list of best trades - */ - ; - - Trade.bestTradeExactOut = - /*#__PURE__*/ - function () { - var _bestTradeExactOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pools, currencyIn, currencyAmountOut, _temp2, // used in recursion. - currentPools, nextAmountOut, bestTrades) { - var _ref3, _ref3$maxNumResults, maxNumResults, _ref3$maxHops, maxHops, chainId, amountOut, tokenIn, i, pool, amountIn, _yield$pool$getInputA, poolsExcludingThisPool; - - return runtime_1.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - _ref3 = _temp2 === void 0 ? {} : _temp2, _ref3$maxNumResults = _ref3.maxNumResults, maxNumResults = _ref3$maxNumResults === void 0 ? 3 : _ref3$maxNumResults, _ref3$maxHops = _ref3.maxHops, maxHops = _ref3$maxHops === void 0 ? 3 : _ref3$maxHops; - - if (currentPools === void 0) { - currentPools = []; - } - - if (nextAmountOut === void 0) { - nextAmountOut = currencyAmountOut; - } - - if (bestTrades === void 0) { - bestTrades = []; - } - - !(pools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'POOLS') : invariant(false) : void 0; - !(maxHops > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MAX_HOPS') : invariant(false) : void 0; - !(currencyAmountOut === nextAmountOut || currentPools.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'INVALID_RECURSION') : invariant(false) : void 0; - chainId = nextAmountOut.currency.isToken ? nextAmountOut.currency.chainId : currencyIn.isToken ? currencyIn.chainId : undefined; - !(chainId !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CHAIN_ID') : invariant(false) : void 0; - amountOut = wrappedCurrencyAmount(nextAmountOut, chainId); - tokenIn = wrappedCurrency(currencyIn, chainId); - i = 0; - - case 12: - if (!(i < pools.length)) { - _context5.next = 48; - break; - } - - pool = pools[i]; // pool irrelevant - - if (!(!currencyEquals(pool.token0, amountOut.currency) && !currencyEquals(pool.token1, amountOut.currency))) { - _context5.next = 16; - break; - } - - return _context5.abrupt("continue", 45); - - case 16: - amountIn = void 0; - _context5.prev = 17; - _context5.next = 21; - return pool.getInputAmount(amountOut); - - case 21: - _yield$pool$getInputA = _context5.sent; - amountIn = _yield$pool$getInputA[0]; - _context5.next = 30; - break; - - case 25: - _context5.prev = 25; - _context5.t0 = _context5["catch"](17); - - if (!_context5.t0.isInsufficientReservesError) { - _context5.next = 29; - break; - } - - return _context5.abrupt("continue", 45); - - case 29: - throw _context5.t0; - - case 30: - if (!currencyEquals(amountIn.currency, tokenIn)) { - _context5.next = 41; - break; - } - - _context5.t1 = sortedInsert; - _context5.t2 = bestTrades; - _context5.next = 35; - return Trade.fromRoute(new Route([pool].concat(currentPools), currencyIn, currencyAmountOut.currency), currencyAmountOut, TradeType.EXACT_OUTPUT); - - case 35: - _context5.t3 = _context5.sent; - _context5.t4 = maxNumResults; - _context5.t5 = tradeComparator; - (0, _context5.t1)(_context5.t2, _context5.t3, _context5.t4, _context5.t5); - _context5.next = 45; - break; - - case 41: - if (!(maxHops > 1 && pools.length > 1)) { - _context5.next = 45; - break; - } - - poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length)); // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops - - _context5.next = 45; - return Trade.bestTradeExactOut(poolsExcludingThisPool, currencyIn, currencyAmountOut, { - maxNumResults: maxNumResults, - maxHops: maxHops - 1 - }, [pool].concat(currentPools), amountIn, bestTrades); - - case 45: - i++; - _context5.next = 12; - break; - - case 48: - return _context5.abrupt("return", bestTrades); - - case 49: - case "end": - return _context5.stop(); - } - } - }, _callee5, null, [[17, 25]]); - })); - - function bestTradeExactOut(_x15, _x16, _x17, _x18, _x19, _x20, _x21) { - return _bestTradeExactOut.apply(this, arguments); - } - - return bestTradeExactOut; - }(); - - _createClass(Trade, [{ - key: "executionPrice", - get: function get() { - var _this$_executionPrice; - - return (_this$_executionPrice = this._executionPrice) != null ? _this$_executionPrice : this._executionPrice = new Price(this.inputAmount.currency, this.outputAmount.currency, this.inputAmount.quotient, this.outputAmount.quotient); - } - /** - * Returns the percent difference between the route's mid price and the price impact - */ - - }, { - key: "priceImpact", - get: function get() { - var _this$_priceImpact; - - return (_this$_priceImpact = this._priceImpact) != null ? _this$_priceImpact : this._priceImpact = computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount); - } - }]); - - return Trade; -}(); - -function isAllowedPermit(permitOptions) { - return 'nonce' in permitOptions; -} - -var SelfPermit = /*#__PURE__*/function () { - function SelfPermit() {} - - SelfPermit.encodePermit = function encodePermit(token, options) { - return isAllowedPermit(options) ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [token.address, toHex(options.nonce), toHex(options.expiry), options.v, options.r, options.s]) : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [token.address, toHex(options.amount), toHex(options.deadline), options.v, options.r, options.s]); - }; - - return SelfPermit; -}(); -SelfPermit.INTERFACE = /*#__PURE__*/new Interface(abi); - -var MaxUint128 = /*#__PURE__*/toHex( /*#__PURE__*/JSBI.subtract( /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(128)), /*#__PURE__*/JSBI.BigInt(1))); // type guard - -function isMint(options) { - return Object.keys(options).some(function (k) { - return k === 'recipient'; - }); -} - -var NonfungiblePositionManager = /*#__PURE__*/function (_SelfPermit) { - _inheritsLoose(NonfungiblePositionManager, _SelfPermit); - - /** - * Cannot be constructed. - */ - function NonfungiblePositionManager() { - return _SelfPermit.call(this) || this; - } - - NonfungiblePositionManager.addCallParameters = function addCallParameters(position, options) { - !JSBI.greaterThan(position.liquidity, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO_LIQUIDITY') : invariant(false) : void 0; - var calldatas = []; // get amounts - - var _position$mintAmounts = position.mintAmounts, - amount0Desired = _position$mintAmounts.amount0, - amount1Desired = _position$mintAmounts.amount1; // adjust for slippage - - var minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance); - var amount0Min = toHex(minimumAmounts.amount0); - var amount1Min = toHex(minimumAmounts.amount1); - var deadline = toHex(options.deadline); // create pool if needed - - if (isMint(options) && options.createPool) { - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [position.pool.token0.address, position.pool.token1.address, position.pool.fee, toHex(position.pool.sqrtRatioX96)])); - } // permits if necessary - - - if (options.token0Permit) { - calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit)); - } - - if (options.token1Permit) { - calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit)); - } // mint - - - if (isMint(options)) { - var recipient = validateAndParseAddress(options.recipient); - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [{ - token0: position.pool.token0.address, - token1: position.pool.token1.address, - fee: position.pool.fee, - tickLower: position.tickLower, - tickUpper: position.tickUpper, - amount0Desired: toHex(amount0Desired), - amount1Desired: toHex(amount1Desired), - amount0Min: amount0Min, - amount1Min: amount1Min, - recipient: recipient, - deadline: deadline - }])); - } else { - // increase - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [{ - tokenId: toHex(options.tokenId), - amount0Desired: toHex(amount0Desired), - amount1Desired: toHex(amount1Desired), - amount0Min: amount0Min, - amount1Min: amount1Min, - deadline: deadline - }])); - } - - var value = toHex(0); - - if (options.useEther) { - var weth = WETH9[position.pool.chainId]; - !(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth))) ? process.env.NODE_ENV !== "production" ? invariant(false, 'NO_WETH') : invariant(false) : void 0; - var wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired; // we only need to refund if we're actually sending ETH - - if (JSBI.greaterThan(wethValue, ZERO)) { - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH')); - } - - value = toHex(wethValue); - } - - return { - calldata: calldatas.length === 1 ? calldatas[0] : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), - value: value - }; - }; - - NonfungiblePositionManager.encodeCollect = function encodeCollect(options) { - var calldatas = []; - var tokenId = toHex(options.tokenId); - var involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther; - var recipient = validateAndParseAddress(options.recipient); // collect - - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [{ - tokenId: tokenId, - recipient: involvesETH ? ADDRESS_ZERO : recipient, - amount0Max: MaxUint128, - amount1Max: MaxUint128 - }])); - - if (involvesETH) { - var ethAmount = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed0.quotient : options.expectedCurrencyOwed1.quotient; - var token = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed1.currency : options.expectedCurrencyOwed0.currency; - var tokenAmount = options.expectedCurrencyOwed0.currency.isEther ? options.expectedCurrencyOwed1.quotient : options.expectedCurrencyOwed0.quotient; - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])); - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [token.address, toHex(tokenAmount), recipient])); - } - - return calldatas; - }; - - NonfungiblePositionManager.collectCallParameters = function collectCallParameters(options) { - var calldatas = NonfungiblePositionManager.encodeCollect(options); - return { - calldata: calldatas.length === 1 ? calldatas[0] : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), - value: toHex(0) - }; - } - /** - * Produces the calldata for completely or partially exiting a position - * @param position the position to exit - * @param options additional information necessary for generating the calldata - */ - ; - - NonfungiblePositionManager.removeCallParameters = function removeCallParameters(position, options) { - var calldatas = []; - var deadline = toHex(options.deadline); - var tokenId = toHex(options.tokenId); // construct a partial position with a percentage of liquidity - - var partialPosition = new Position({ - pool: position.pool, - liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient, - tickLower: position.tickLower, - tickUpper: position.tickUpper - }); - !JSBI.greaterThan(partialPosition.liquidity, ZERO) ? process.env.NODE_ENV !== "production" ? invariant(false, 'ZERO_LIQUIDITY') : invariant(false) : void 0; // slippage-adjusted underlying amounts - - var _partialPosition$burn = partialPosition.burnAmountsWithSlippage(options.slippageTolerance), - amount0Min = _partialPosition$burn.amount0, - amount1Min = _partialPosition$burn.amount1; - - if (options.permit) { - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [validateAndParseAddress(options.permit.spender), tokenId, toHex(options.permit.deadline), options.permit.v, options.permit.r, options.permit.s])); - } // remove liquidity - - - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [{ - tokenId: tokenId, - liquidity: toHex(partialPosition.liquidity), - amount0Min: toHex(amount0Min), - amount1Min: toHex(amount1Min), - deadline: deadline - }])); - - var _options$collectOptio = options.collectOptions, - expectedCurrencyOwed0 = _options$collectOptio.expectedCurrencyOwed0, - expectedCurrencyOwed1 = _options$collectOptio.expectedCurrencyOwed1, - rest = _objectWithoutPropertiesLoose(_options$collectOptio, ["expectedCurrencyOwed0", "expectedCurrencyOwed1"]); - - calldatas.push.apply(calldatas, NonfungiblePositionManager.encodeCollect(_extends({ - tokenId: options.tokenId, - // add the underlying value to the expected currency already owed - expectedCurrencyOwed0: expectedCurrencyOwed0.add(expectedCurrencyOwed0.currency.isEther ? CurrencyAmount.ether(amount0Min) : CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency, amount0Min)), - expectedCurrencyOwed1: expectedCurrencyOwed1.add(expectedCurrencyOwed1.currency.isEther ? CurrencyAmount.ether(amount1Min) : CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency, amount1Min)) - }, rest))); - - if (options.liquidityPercentage.equalTo(ONE)) { - if (options.burnToken) { - calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId])); - } - } else { - !(options.burnToken !== true) ? process.env.NODE_ENV !== "production" ? invariant(false, 'CANNOT_BURN') : invariant(false) : void 0; - } - - return { - calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]), - value: toHex(0) - }; - }; - - return NonfungiblePositionManager; -}(SelfPermit); -NonfungiblePositionManager.INTERFACE = /*#__PURE__*/new Interface(abi$1); - -/** - * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades. - */ - -var SwapRouter = /*#__PURE__*/function (_SelfPermit) { - _inheritsLoose(SwapRouter, _SelfPermit); - - /** - * Cannot be constructed. - */ - function SwapRouter() { - return _SelfPermit.call(this) || this; - } - /** - * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade. - * @param trade to produce call parameters for - * @param options options for the call parameters - */ - - - SwapRouter.swapCallParameters = function swapCallParameters(trade, options) { - var calldatas = []; // encode permit if necessary - - if (options.inputTokenPermit) { - !trade.inputAmount.currency.isToken ? process.env.NODE_ENV !== "production" ? invariant(false, 'NON_TOKEN_PERMIT') : invariant(false) : void 0; - calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit)); - } - - var recipient = validateAndParseAddress(options.recipient); - var deadline = toHex(options.deadline); - var amountIn = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient); - var amountOut = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient); - var value = trade.inputAmount.currency.isEther ? amountIn : toHex(0); // flag for whether the trade is single hop or not - - var singleHop = trade.route.pools.length === 1; // flag for whether a refund needs to happen - - var mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === TradeType.EXACT_OUTPUT; // flags for whether funds should be send first to the router - - var outputIsEther = trade.outputAmount.currency.isEther; - var routerMustCustody = outputIsEther || !!options.fee; - - if (singleHop) { - if (trade.tradeType === TradeType.EXACT_INPUT) { - var _options$sqrtPriceLim; - - var exactInputSingleParams = { - tokenIn: trade.route.tokenPath[0].address, - tokenOut: trade.route.tokenPath[1].address, - fee: trade.route.pools[0].fee, - recipient: routerMustCustody ? ADDRESS_ZERO : recipient, - deadline: deadline, - amountIn: amountIn, - amountOutMinimum: amountOut, - sqrtPriceLimitX96: toHex((_options$sqrtPriceLim = options.sqrtPriceLimitX96) != null ? _options$sqrtPriceLim : 0) - }; - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams])); - } else { - var _options$sqrtPriceLim2; - - var exactOutputSingleParams = { - tokenIn: trade.route.tokenPath[0].address, - tokenOut: trade.route.tokenPath[1].address, - fee: trade.route.pools[0].fee, - recipient: routerMustCustody ? ADDRESS_ZERO : recipient, - deadline: deadline, - amountOut: amountOut, - amountInMaximum: amountIn, - sqrtPriceLimitX96: toHex((_options$sqrtPriceLim2 = options.sqrtPriceLimitX96) != null ? _options$sqrtPriceLim2 : 0) - }; - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams])); - } - } else { - !(options.sqrtPriceLimitX96 === undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'MULTIHOP_PRICE_LIMIT') : invariant(false) : void 0; - var path = encodeRouteToPath(trade.route, trade.tradeType === TradeType.EXACT_OUTPUT); - - if (trade.tradeType === TradeType.EXACT_INPUT) { - var exactInputParams = { - path: path, - recipient: routerMustCustody ? ADDRESS_ZERO : recipient, - deadline: deadline, - amountIn: amountIn, - amountOutMinimum: amountOut - }; - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams])); - } else { - var exactOutputParams = { - path: path, - recipient: routerMustCustody ? ADDRESS_ZERO : recipient, - deadline: deadline, - amountOut: amountOut, - amountInMaximum: amountIn - }; - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams])); - } - } // refund - - - if (mustRefund) { - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH')); - } // unwrap - - - if (routerMustCustody) { - if (!!options.fee) { - var feeRecipient = validateAndParseAddress(options.fee.recipient); - var fee = toHex(options.fee.fee.multiply(10000).quotient); - - if (outputIsEther) { - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])); - } else { - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [trade.route.tokenPath[trade.route.tokenPath.length - 1].address, amountOut, recipient, fee, feeRecipient])); - } - } else { - calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient])); - } - } - - return { - calldata: calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]), - value: value - }; - }; - - return SwapRouter; -}(SelfPermit); -SwapRouter.INTERFACE = /*#__PURE__*/new Interface(abi$2); - -export { ADDRESS_ZERO, FACTORY_ADDRESS, FeeAmount, FullMath, LiquidityMath, NoTickDataProvider, NonfungiblePositionManager, POOL_INIT_CODE_HASH, Pool, Position, Route, SqrtPriceMath, SwapRouter, TICK_SPACINGS, Tick, TickList, TickListDataProvider, TickMath, Trade, computePoolAddress, encodeRouteToPath, encodeSqrtRatioX96, isSorted, maxLiquidityForAmounts, mostSignificantBit, nearestUsableTick, priceToClosestTick, tickToPrice, toHex, tradeComparator }; -//# sourceMappingURL=v3-sdk.esm.js.map diff --git a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js.map b/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js.map deleted file mode 100644 index 5025579bdc8..00000000000 --- a/uniswap-packages-forks/v3-sdk/dist/v3-sdk.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"v3-sdk.esm.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/constants.ts","../src/internalConstants.ts","../src/utils/computePoolAddress.ts","../src/utils/liquidityMath.ts","../src/utils/fullMath.ts","../src/utils/sqrtPriceMath.ts","../src/utils/swapMath.ts","../src/utils/mostSignificantBit.ts","../src/utils/tickMath.ts","../src/entities/tickDataProvider.ts","../src/utils/isSorted.ts","../src/utils/tickList.ts","../src/utils/calldata.ts","../src/utils/encodeRouteToPath.ts","../src/utils/encodeSqrtRatioX96.ts","../src/utils/maxLiquidityForAmounts.ts","../src/utils/nearestUsableTick.ts","../src/utils/priceTickConversions.ts","../src/entities/tick.ts","../src/entities/tickListDataProvider.ts","../src/entities/pool.ts","../src/entities/position.ts","../src/entities/route.ts","../src/entities/trade.ts","../src/selfPermit.ts","../src/nonfungiblePositionManager.ts","../src/swapRouter.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","export const FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984'\n\nexport const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'\n\nexport const POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54'\n\n/**\n * The default factory enabled fee amounts, denominated in hundredths of bips.\n */\nexport enum FeeAmount {\n LOW = 500,\n MEDIUM = 3000,\n HIGH = 10000\n}\n\n/**\n * The default factory tick spacings by fee amount.\n */\nexport const TICK_SPACINGS: { [amount in FeeAmount]: number } = {\n [FeeAmount.LOW]: 10,\n [FeeAmount.MEDIUM]: 60,\n [FeeAmount.HIGH]: 200\n}\n","import JSBI from 'jsbi'\n\n// constants used internally but not expected to be used externally\nexport const NEGATIVE_ONE = JSBI.BigInt(-1)\nexport const ZERO = JSBI.BigInt(0)\nexport const ONE = JSBI.BigInt(1)\n\n// used in liquidity amount math\nexport const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96))\nexport const Q192 = JSBI.exponentiate(Q96, JSBI.BigInt(2))\n","import { defaultAbiCoder } from '@ethersproject/abi'\nimport { getCreate2Address } from '@ethersproject/address'\nimport { keccak256 } from '@ethersproject/solidity'\nimport { Token } from '@uniswap/sdk-core'\nimport { FeeAmount, POOL_INIT_CODE_HASH } from '../constants'\n\nexport function computePoolAddress({\n factoryAddress,\n tokenA,\n tokenB,\n fee\n}: {\n factoryAddress: string\n tokenA: Token\n tokenB: Token\n fee: FeeAmount\n}): string {\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks\n return getCreate2Address(\n factoryAddress,\n keccak256(\n ['bytes'],\n [defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]\n ),\n POOL_INIT_CODE_HASH\n )\n}\n","import JSBI from 'jsbi'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\n\nexport abstract class LiquidityMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static addDelta(x: JSBI, y: JSBI): JSBI {\n if (JSBI.lessThan(y, ZERO)) {\n return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE))\n } else {\n return JSBI.add(x, y)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { ONE, ZERO } from '../internalConstants'\n\nexport abstract class FullMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI {\n const product = JSBI.multiply(a, b)\n let result = JSBI.divide(product, denominator)\n if (JSBI.notEqual(JSBI.remainder(product, denominator), ZERO)) result = JSBI.add(result, ONE)\n return result\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO, Q96 } from '../internalConstants'\nimport { FullMath } from './fullMath'\n\nconst MaxUint160 = JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(160)), ONE)\n\nfunction multiplyIn256(x: JSBI, y: JSBI): JSBI {\n const product = JSBI.multiply(x, y)\n return JSBI.bitwiseAnd(product, MaxUint256)\n}\n\nfunction addIn256(x: JSBI, y: JSBI): JSBI {\n const sum = JSBI.add(x, y)\n return JSBI.bitwiseAnd(sum, MaxUint256)\n}\n\nexport abstract class SqrtPriceMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n const numerator2 = JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)\n\n return roundUp\n ? FullMath.mulDivRoundingUp(FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), ONE, sqrtRatioAX96)\n : JSBI.divide(JSBI.divide(JSBI.multiply(numerator1, numerator2), sqrtRatioBX96), sqrtRatioAX96)\n }\n\n public static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n return roundUp\n ? FullMath.mulDivRoundingUp(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96), Q96)\n : JSBI.divide(JSBI.multiply(liquidity, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96)), Q96)\n }\n\n public static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)\n : this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true)\n }\n\n public static getNextSqrtPriceFromOutput(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amountOut: JSBI,\n zeroForOne: boolean\n ): JSBI {\n invariant(JSBI.greaterThan(sqrtPX96, ZERO))\n invariant(JSBI.greaterThan(liquidity, ZERO))\n\n return zeroForOne\n ? this.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)\n : this.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false)\n }\n\n private static getNextSqrtPriceFromAmount0RoundingUp(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (JSBI.equal(amount, ZERO)) return sqrtPX96\n const numerator1 = JSBI.leftShift(liquidity, JSBI.BigInt(96))\n\n if (add) {\n let product = multiplyIn256(amount, sqrtPX96)\n if (JSBI.equal(JSBI.divide(product, amount), sqrtPX96)) {\n const denominator = addIn256(numerator1, product)\n if (JSBI.greaterThanOrEqual(denominator, numerator1)) {\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n return FullMath.mulDivRoundingUp(numerator1, ONE, JSBI.add(JSBI.divide(numerator1, sqrtPX96), amount))\n } else {\n let product = multiplyIn256(amount, sqrtPX96)\n\n invariant(JSBI.equal(JSBI.divide(product, amount), sqrtPX96))\n invariant(JSBI.greaterThan(numerator1, product))\n const denominator = JSBI.subtract(numerator1, product)\n return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)\n }\n }\n\n private static getNextSqrtPriceFromAmount1RoundingDown(\n sqrtPX96: JSBI,\n liquidity: JSBI,\n amount: JSBI,\n add: boolean\n ): JSBI {\n if (add) {\n const quotient = JSBI.lessThanOrEqual(amount, MaxUint160)\n ? JSBI.divide(JSBI.leftShift(amount, JSBI.BigInt(96)), liquidity)\n : JSBI.divide(JSBI.multiply(amount, Q96), liquidity)\n\n return JSBI.add(sqrtPX96, quotient)\n } else {\n const quotient = FullMath.mulDivRoundingUp(amount, Q96, liquidity)\n\n invariant(JSBI.greaterThan(sqrtPX96, quotient))\n return JSBI.subtract(sqrtPX96, quotient)\n }\n }\n}\n","import JSBI from 'jsbi'\nimport { FeeAmount } from '../constants'\nimport { NEGATIVE_ONE, ZERO } from '../internalConstants'\nimport { FullMath } from './fullMath'\nimport { SqrtPriceMath } from './sqrtPriceMath'\n\nconst MAX_FEE = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(6))\n\nexport abstract class SwapMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n public static computeSwapStep(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioTargetX96: JSBI,\n liquidity: JSBI,\n amountRemaining: JSBI,\n feePips: FeeAmount\n ): [JSBI, JSBI, JSBI, JSBI] {\n const returnValues: Partial<{\n sqrtRatioNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n }> = {}\n\n const zeroForOne = JSBI.greaterThanOrEqual(sqrtRatioCurrentX96, sqrtRatioTargetX96)\n const exactIn = JSBI.greaterThanOrEqual(amountRemaining, ZERO)\n\n if (exactIn) {\n const amountRemainingLessFee = JSBI.divide(\n JSBI.multiply(amountRemaining, JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))),\n MAX_FEE\n )\n returnValues.amountIn = zeroForOne\n ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true)\n if (JSBI.greaterThanOrEqual(amountRemainingLessFee, returnValues.amountIn!)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(\n sqrtRatioCurrentX96,\n liquidity,\n amountRemainingLessFee,\n zeroForOne\n )\n }\n } else {\n returnValues.amountOut = zeroForOne\n ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false)\n if (JSBI.greaterThanOrEqual(JSBI.multiply(amountRemaining, NEGATIVE_ONE), returnValues.amountOut)) {\n returnValues.sqrtRatioNextX96 = sqrtRatioTargetX96\n } else {\n returnValues.sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(\n sqrtRatioCurrentX96,\n liquidity,\n JSBI.multiply(amountRemaining, NEGATIVE_ONE),\n zeroForOne\n )\n }\n }\n\n const max = JSBI.equal(sqrtRatioTargetX96, returnValues.sqrtRatioNextX96)\n\n if (zeroForOne) {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount0Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount1Delta(returnValues.sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false)\n } else {\n returnValues.amountIn =\n max && exactIn\n ? returnValues.amountIn\n : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, true)\n returnValues.amountOut =\n max && !exactIn\n ? returnValues.amountOut\n : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, returnValues.sqrtRatioNextX96, liquidity, false)\n }\n\n if (!exactIn && JSBI.greaterThan(returnValues.amountOut!, JSBI.multiply(amountRemaining, NEGATIVE_ONE))) {\n returnValues.amountOut = JSBI.multiply(amountRemaining, NEGATIVE_ONE)\n }\n\n if (exactIn && JSBI.notEqual(returnValues.sqrtRatioNextX96, sqrtRatioTargetX96)) {\n // we didn't reach the target, so take the remainder of the maximum input as fee\n returnValues.feeAmount = JSBI.subtract(amountRemaining, returnValues.amountIn!)\n } else {\n returnValues.feeAmount = FullMath.mulDivRoundingUp(\n returnValues.amountIn!,\n JSBI.BigInt(feePips),\n JSBI.subtract(MAX_FEE, JSBI.BigInt(feePips))\n )\n }\n\n return [returnValues.sqrtRatioNextX96!, returnValues.amountIn!, returnValues.amountOut!, returnValues.feeAmount!]\n }\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\n\nconst TWO = JSBI.BigInt(2)\nconst POWERS_OF_2 = [128, 64, 32, 16, 8, 4, 2, 1].map((pow: number): [number, JSBI] => [\n pow,\n JSBI.exponentiate(TWO, JSBI.BigInt(pow))\n])\n\nexport function mostSignificantBit(x: JSBI): number {\n invariant(JSBI.greaterThan(x, ZERO), 'ZERO')\n invariant(JSBI.lessThanOrEqual(x, MaxUint256), 'MAX')\n\n let msb: number = 0\n for (const [power, min] of POWERS_OF_2) {\n if (JSBI.greaterThanOrEqual(x, min)) {\n x = JSBI.signedRightShift(x, JSBI.BigInt(power))\n msb += power\n }\n }\n return msb\n}\n","import { MaxUint256 } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { mostSignificantBit } from './mostSignificantBit'\n\nfunction mulShift(val: JSBI, mulBy: string): JSBI {\n return JSBI.signedRightShift(JSBI.multiply(val, JSBI.BigInt(mulBy)), JSBI.BigInt(128))\n}\n\nconst Q32 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(32))\n\nexport abstract class TickMath {\n /**\n * Cannot be constructed.\n */\n private constructor() {}\n\n /**\n * The minimum tick that can be used on any pool.\n */\n public static MIN_TICK: number = -887272\n /**\n * The maximum tick that can be used on any pool.\n */\n public static MAX_TICK: number = -TickMath.MIN_TICK\n\n /**\n * The sqrt ratio corresponding to the minimum tick that could be used on any pool.\n */\n public static MIN_SQRT_RATIO: JSBI = JSBI.BigInt('4295128739')\n /**\n * The sqrt ratio corresponding to the maximum tick that could be used on any pool.\n */\n public static MAX_SQRT_RATIO: JSBI = JSBI.BigInt('1461446703485210103287273052203988822378723970342')\n\n /**\n * Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick\n * @param tick the tick for which to compute the sqrt ratio\n */\n public static getSqrtRatioAtTick(tick: number): JSBI {\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK && Number.isInteger(tick), 'TICK')\n const absTick: number = tick < 0 ? tick * -1 : tick\n\n let ratio: JSBI =\n (absTick & 0x1) != 0\n ? JSBI.BigInt('0xfffcb933bd6fad37aa2d162d1a594001')\n : JSBI.BigInt('0x100000000000000000000000000000000')\n if ((absTick & 0x2) != 0) ratio = mulShift(ratio, '0xfff97272373d413259a46990580e213a')\n if ((absTick & 0x4) != 0) ratio = mulShift(ratio, '0xfff2e50f5f656932ef12357cf3c7fdcc')\n if ((absTick & 0x8) != 0) ratio = mulShift(ratio, '0xffe5caca7e10e4e61c3624eaa0941cd0')\n if ((absTick & 0x10) != 0) ratio = mulShift(ratio, '0xffcb9843d60f6159c9db58835c926644')\n if ((absTick & 0x20) != 0) ratio = mulShift(ratio, '0xff973b41fa98c081472e6896dfb254c0')\n if ((absTick & 0x40) != 0) ratio = mulShift(ratio, '0xff2ea16466c96a3843ec78b326b52861')\n if ((absTick & 0x80) != 0) ratio = mulShift(ratio, '0xfe5dee046a99a2a811c461f1969c3053')\n if ((absTick & 0x100) != 0) ratio = mulShift(ratio, '0xfcbe86c7900a88aedcffc83b479aa3a4')\n if ((absTick & 0x200) != 0) ratio = mulShift(ratio, '0xf987a7253ac413176f2b074cf7815e54')\n if ((absTick & 0x400) != 0) ratio = mulShift(ratio, '0xf3392b0822b70005940c7a398e4b70f3')\n if ((absTick & 0x800) != 0) ratio = mulShift(ratio, '0xe7159475a2c29b7443b29c7fa6e889d9')\n if ((absTick & 0x1000) != 0) ratio = mulShift(ratio, '0xd097f3bdfd2022b8845ad8f792aa5825')\n if ((absTick & 0x2000) != 0) ratio = mulShift(ratio, '0xa9f746462d870fdf8a65dc1f90e061e5')\n if ((absTick & 0x4000) != 0) ratio = mulShift(ratio, '0x70d869a156d2a1b890bb3df62baf32f7')\n if ((absTick & 0x8000) != 0) ratio = mulShift(ratio, '0x31be135f97d08fd981231505542fcfa6')\n if ((absTick & 0x10000) != 0) ratio = mulShift(ratio, '0x9aa508b5b7a84e1c677de54f3e99bc9')\n if ((absTick & 0x20000) != 0) ratio = mulShift(ratio, '0x5d6af8dedb81196699c329225ee604')\n if ((absTick & 0x40000) != 0) ratio = mulShift(ratio, '0x2216e584f5fa1ea926041bedfe98')\n if ((absTick & 0x80000) != 0) ratio = mulShift(ratio, '0x48a170391f7dc42444e8fa2')\n\n if (tick > 0) ratio = JSBI.divide(MaxUint256, ratio)\n\n // back to Q96\n return JSBI.greaterThan(JSBI.remainder(ratio, Q32), ZERO)\n ? JSBI.add(JSBI.divide(ratio, Q32), ONE)\n : JSBI.divide(ratio, Q32)\n }\n\n /**\n * Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96\n * and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96\n * @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick\n */\n public static getTickAtSqrtRatio(sqrtRatioX96: JSBI): number {\n invariant(\n JSBI.greaterThanOrEqual(sqrtRatioX96, TickMath.MIN_SQRT_RATIO) &&\n JSBI.lessThan(sqrtRatioX96, TickMath.MAX_SQRT_RATIO),\n 'SQRT_RATIO'\n )\n\n const sqrtRatioX128 = JSBI.leftShift(sqrtRatioX96, JSBI.BigInt(32))\n\n const msb = mostSignificantBit(sqrtRatioX128)\n\n let r: JSBI\n if (JSBI.greaterThanOrEqual(JSBI.BigInt(msb), JSBI.BigInt(128))) {\n r = JSBI.signedRightShift(sqrtRatioX128, JSBI.BigInt(msb - 127))\n } else {\n r = JSBI.leftShift(sqrtRatioX128, JSBI.BigInt(127 - msb))\n }\n\n let log_2: JSBI = JSBI.leftShift(JSBI.subtract(JSBI.BigInt(msb), JSBI.BigInt(128)), JSBI.BigInt(64))\n\n for (let i = 0; i < 14; i++) {\n r = JSBI.signedRightShift(JSBI.multiply(r, r), JSBI.BigInt(127))\n const f = JSBI.signedRightShift(r, JSBI.BigInt(128))\n log_2 = JSBI.bitwiseOr(log_2, JSBI.leftShift(f, JSBI.BigInt(63 - i)))\n r = JSBI.signedRightShift(r, f)\n }\n\n const log_sqrt10001 = JSBI.multiply(log_2, JSBI.BigInt('255738958999603826347141'))\n\n const tickLow = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.subtract(log_sqrt10001, JSBI.BigInt('3402992956809132418596140100660247210')),\n JSBI.BigInt(128)\n )\n )\n const tickHigh = JSBI.toNumber(\n JSBI.signedRightShift(\n JSBI.add(log_sqrt10001, JSBI.BigInt('291339464771989622907027621153398088495')),\n JSBI.BigInt(128)\n )\n )\n\n return tickLow === tickHigh\n ? tickLow\n : JSBI.lessThanOrEqual(TickMath.getSqrtRatioAtTick(tickHigh), sqrtRatioX96)\n ? tickHigh\n : tickLow\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\n\n/**\n * Provides information about ticks\n */\nexport interface TickDataProvider {\n /**\n * Return information corresponding to a specific tick\n * @param tick the tick to load\n */\n getTick(tick: number): Promise<{ liquidityNet: BigintIsh }>\n\n /**\n * Return the next tick that is initialized within a single word\n * @param tick the current tick\n * @param lte whether the next tick should be lte the current tick\n * @param tickSpacing the tick spacing of the pool\n */\n nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>\n}\n\n/**\n * This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you\n * do not need to load tick data for your use case.\n */\nexport class NoTickDataProvider implements TickDataProvider {\n private static ERROR_MESSAGE = 'No tick data provider was given'\n async getTick(_tick: number): Promise<{ liquidityNet: BigintIsh }> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n\n async nextInitializedTickWithinOneWord(\n _tick: number,\n _lte: boolean,\n _tickSpacing: number\n ): Promise<[number, boolean]> {\n throw new Error(NoTickDataProvider.ERROR_MESSAGE)\n }\n}\n","export function isSorted(list: Array, comparator: (a: T, b: T) => number): boolean {\n for (let i = 0; i < list.length - 1; i++) {\n if (comparator(list[i], list[i + 1]) > 0) {\n return false\n }\n }\n return true\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { isSorted } from './isSorted'\nimport { Tick } from '../entities/tick'\n\nfunction tickComparator(a: Tick, b: Tick) {\n return a.index - b.index\n}\n\n/**\n * Utility methods for interacting with sorted lists of ticks\n */\nexport abstract class TickList {\n /**\n * Cannot be constructed\n */\n private constructor() {}\n\n public static validateList(ticks: Tick[], tickSpacing: number) {\n invariant(tickSpacing > 0, 'TICK_SPACING_NONZERO')\n // ensure ticks are spaced appropriately\n invariant(\n ticks.every(({ index }) => index % tickSpacing === 0),\n 'TICK_SPACING'\n )\n\n // ensure tick liquidity deltas sum to 0\n invariant(\n JSBI.equal(\n ticks.reduce((accumulator, { liquidityNet }) => JSBI.add(accumulator, liquidityNet), ZERO),\n ZERO\n ),\n 'ZERO_NET'\n )\n\n invariant(isSorted(ticks, tickComparator), 'SORTED')\n }\n\n public static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick < ticks[0].index\n }\n\n public static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean {\n invariant(ticks.length > 0, 'LENGTH')\n return tick >= ticks[ticks.length - 1].index\n }\n\n public static getTick(ticks: readonly Tick[], index: number): Tick {\n const tick = ticks[this.binarySearch(ticks, index)]\n invariant(tick.index === index, 'NOT_CONTAINED')\n return tick\n }\n\n /**\n * Finds the largest tick in the list of ticks that is less than or equal to tick\n * @param ticks list of ticks\n * @param tick tick to find the largest tick that is less than or equal to tick\n * @private\n */\n private static binarySearch(ticks: readonly Tick[], tick: number): number {\n invariant(!this.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n\n let l = 0\n let r = ticks.length - 1\n let i\n while (true) {\n i = Math.floor((l + r) / 2)\n\n if (ticks[i].index <= tick && (i === ticks.length - 1 || ticks[i + 1].index > tick)) {\n return i\n }\n\n if (ticks[i].index < tick) {\n l = i + 1\n } else {\n r = i - 1\n }\n }\n }\n\n public static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick {\n if (lte) {\n invariant(!TickList.isBelowSmallest(ticks, tick), 'BELOW_SMALLEST')\n if (TickList.isAtOrAboveLargest(ticks, tick)) {\n return ticks[ticks.length - 1]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index]\n } else {\n invariant(!this.isAtOrAboveLargest(ticks, tick), 'AT_OR_ABOVE_LARGEST')\n if (this.isBelowSmallest(ticks, tick)) {\n return ticks[0]\n }\n const index = this.binarySearch(ticks, tick)\n return ticks[index + 1]\n }\n }\n\n public static nextInitializedTickWithinOneWord(\n ticks: readonly Tick[],\n tick: number,\n lte: boolean,\n tickSpacing: number\n ): [number, boolean] {\n const compressed = Math.floor(tick / tickSpacing) // matches rounding in the code\n\n if (lte) {\n const wordPos = compressed >> 8\n const minimum = (wordPos << 8) * tickSpacing\n\n if (TickList.isBelowSmallest(ticks, tick)) {\n return [minimum, false]\n }\n\n const index = TickList.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.max(minimum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n } else {\n const wordPos = (compressed + 1) >> 8\n const maximum = ((wordPos + 1) << 8) * tickSpacing - 1\n\n if (this.isAtOrAboveLargest(ticks, tick)) {\n return [maximum, false]\n }\n\n const index = this.nextInitializedTick(ticks, tick, lte).index\n const nextInitializedTick = Math.min(maximum, index)\n return [nextInitializedTick, nextInitializedTick === index]\n }\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\n\n/**\n * Generated method parameters for executing a call.\n */\nexport interface MethodParameters {\n /**\n * The hex encoded calldata to perform the given operation\n */\n calldata: string\n /**\n * The amount of ether (wei) to send in hex.\n */\n value: string\n}\n\nexport function toHex(bigintIsh: BigintIsh) {\n const bigInt = JSBI.BigInt(bigintIsh)\n let hex = bigInt.toString(16)\n if (hex.length % 2 !== 0) {\n hex = `0${hex}`\n }\n return `0x${hex}`\n}\n","import { pack } from '@ethersproject/solidity'\nimport { Currency, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from '../entities/pool'\nimport { Route } from '../entities/route'\n\n/**\n * Converts a route to a hex encoded path\n * @param route the v3 path to convert to an encoded path\n * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps\n */\nexport function encodeRouteToPath(route: Route, exactOutput: boolean): string {\n const firstInputToken: Token = wrappedCurrency(route.input, route.chainId)\n\n const { path, types } = route.pools.reduce(\n (\n { inputToken, path, types }: { inputToken: Token; path: (string | number)[]; types: string[] },\n pool: Pool,\n index\n ): { inputToken: Token; path: (string | number)[]; types: string[] } => {\n const outputToken: Token = pool.token0.equals(inputToken) ? pool.token1 : pool.token0\n if (index === 0) {\n return {\n inputToken: outputToken,\n types: ['address', 'uint24', 'address'],\n path: [inputToken.address, pool.fee, outputToken.address]\n }\n } else {\n return {\n inputToken: outputToken,\n types: [...types, 'uint24', 'address'],\n path: [...path, pool.fee, outputToken.address]\n }\n }\n },\n { inputToken: firstInputToken, path: [], types: [] }\n )\n\n return exactOutput ? pack(types.reverse(), path.reverse()) : pack(types, path)\n}\n","import JSBI from 'jsbi'\nimport { BigintIsh, sqrt } from '@uniswap/sdk-core'\n\n/**\n * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0\n * @param amount1 the numerator amount, i.e. amount of token1\n * @param amount0 the denominator amount, i.en amount of token0\n */\nexport function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI {\n const numerator = JSBI.leftShift(JSBI.BigInt(amount1), JSBI.BigInt(192))\n const denominator = JSBI.BigInt(amount0)\n const ratioX192 = JSBI.divide(numerator, denominator)\n return sqrt(ratioX192)\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q96 } from '../internalConstants'\n\nfunction maxLiquidityForAmount0Imprecise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n const intermediate = JSBI.divide(JSBI.multiply(sqrtRatioAX96, sqrtRatioBX96), Q96)\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount0), intermediate), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\nfunction maxLiquidityForAmount0Precise(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const numerator = JSBI.multiply(JSBI.multiply(JSBI.BigInt(amount0), sqrtRatioAX96), sqrtRatioBX96)\n const denominator = JSBI.multiply(Q96, JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n\n return JSBI.divide(numerator, denominator)\n}\n\nfunction maxLiquidityForAmount1(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount1: BigintIsh): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n return JSBI.divide(JSBI.multiply(JSBI.BigInt(amount1), Q96), JSBI.subtract(sqrtRatioBX96, sqrtRatioAX96))\n}\n\n/**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param sqrtRatioCurrentX96 the current price\n * @param sqrtRatioAX96 price at lower boundary\n * @param sqrtRatioBX96 price at upper boundary\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\nexport function maxLiquidityForAmounts(\n sqrtRatioCurrentX96: JSBI,\n sqrtRatioAX96: JSBI,\n sqrtRatioBX96: JSBI,\n amount0: BigintIsh,\n amount1: BigintIsh,\n useFullPrecision: boolean\n): JSBI {\n if (JSBI.greaterThan(sqrtRatioAX96, sqrtRatioBX96)) {\n ;[sqrtRatioAX96, sqrtRatioBX96] = [sqrtRatioBX96, sqrtRatioAX96]\n }\n\n const maxLiquidityForAmount0 = useFullPrecision ? maxLiquidityForAmount0Precise : maxLiquidityForAmount0Imprecise\n\n if (JSBI.lessThanOrEqual(sqrtRatioCurrentX96, sqrtRatioAX96)) {\n return maxLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0)\n } else if (JSBI.lessThan(sqrtRatioCurrentX96, sqrtRatioBX96)) {\n const liquidity0 = maxLiquidityForAmount0(sqrtRatioCurrentX96, sqrtRatioBX96, amount0)\n const liquidity1 = maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioCurrentX96, amount1)\n return JSBI.lessThan(liquidity0, liquidity1) ? liquidity0 : liquidity1\n } else {\n return maxLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1)\n }\n}\n","import invariant from 'tiny-invariant'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns the closest tick that is nearest a given tick and usable for the given tick spacing\n * @param tick the target tick\n * @param tickSpacing the spacing of the pool\n */\nexport function nearestUsableTick(tick: number, tickSpacing: number) {\n invariant(Number.isInteger(tick) && Number.isInteger(tickSpacing), 'INTEGERS')\n invariant(tickSpacing > 0, 'TICK_SPACING')\n invariant(tick >= TickMath.MIN_TICK && tick <= TickMath.MAX_TICK, 'TICK_BOUND')\n const rounded = Math.round(tick / tickSpacing) * tickSpacing\n if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing\n else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing\n else return rounded\n}\n","import { Price, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport { Q192 } from '../internalConstants'\nimport { encodeSqrtRatioX96 } from './encodeSqrtRatioX96'\nimport { TickMath } from './tickMath'\n\n/**\n * Returns a price object corresponding to the input tick and the base/quote token\n * Inputs must be tokens because the address order is used to interpret the price represented by the tick\n * @param baseToken the base token of the price\n * @param quoteToken the quote token of the price\n * @param tick the tick for which to return the price\n */\nexport function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price {\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick)\n\n const ratioX192 = JSBI.multiply(sqrtRatioX96, sqrtRatioX96)\n\n return baseToken.sortsBefore(quoteToken)\n ? new Price(baseToken, quoteToken, Q192, ratioX192)\n : new Price(baseToken, quoteToken, ratioX192, Q192)\n}\n\n/**\n * Returns the first tick for which the given price is greater than or equal to the tick price\n * @param price for which to return the closest tick that represents a price less than or equal to the input price,\n * i.e. the price of the returned tick is less than or equal to the input price\n */\nexport function priceToClosestTick(price: Price): number {\n const sorted = price.baseCurrency.sortsBefore(price.quoteCurrency)\n\n const sqrtRatioX96 = sorted\n ? encodeSqrtRatioX96(price.numerator, price.denominator)\n : encodeSqrtRatioX96(price.denominator, price.numerator)\n\n let tick = TickMath.getTickAtSqrtRatio(sqrtRatioX96)\n const nextTickPrice = tickToPrice(price.baseCurrency, price.quoteCurrency, tick + 1)\n if (sorted) {\n if (!price.lessThan(nextTickPrice)) {\n tick++\n }\n } else {\n if (!price.greaterThan(nextTickPrice)) {\n tick++\n }\n }\n return tick\n}\n","import JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { BigintIsh } from '@uniswap/sdk-core'\nimport { TickMath } from '../utils'\n\nexport interface TickConstructorArgs {\n index: number\n liquidityGross: BigintIsh\n liquidityNet: BigintIsh\n}\n\nexport class Tick {\n public readonly index: number\n public readonly liquidityGross: JSBI\n public readonly liquidityNet: JSBI\n\n constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs) {\n invariant(index >= TickMath.MIN_TICK && index <= TickMath.MAX_TICK, 'TICK')\n this.index = index\n this.liquidityGross = JSBI.BigInt(liquidityGross)\n this.liquidityNet = JSBI.BigInt(liquidityNet)\n }\n}\n","import { BigintIsh } from '@uniswap/sdk-core'\nimport { TickList } from '../utils/tickList'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { TickDataProvider } from './tickDataProvider'\n\n/**\n * A data provider for ticks that is backed by an in-memory array of ticks.\n */\nexport class TickListDataProvider implements TickDataProvider {\n private ticks: readonly Tick[]\n\n constructor(ticks: (Tick | TickConstructorArgs)[], tickSpacing: number) {\n const ticksMapped: Tick[] = ticks.map(t => (t instanceof Tick ? t : new Tick(t)))\n TickList.validateList(ticksMapped, tickSpacing)\n this.ticks = ticksMapped\n }\n\n async getTick(tick: number): Promise<{ liquidityNet: BigintIsh; liquidityGross: BigintIsh }> {\n return TickList.getTick(this.ticks, tick)\n }\n\n async nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]> {\n return TickList.nextInitializedTickWithinOneWord(this.ticks, tick, lte, tickSpacing)\n }\n}\n","import { BigintIsh, ChainId, Price, Token, CurrencyAmount } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { FACTORY_ADDRESS, FeeAmount, TICK_SPACINGS } from '../constants'\nimport { NEGATIVE_ONE, ONE, Q192, ZERO } from '../internalConstants'\nimport { computePoolAddress } from '../utils/computePoolAddress'\nimport { LiquidityMath } from '../utils/liquidityMath'\nimport { SwapMath } from '../utils/swapMath'\nimport { TickMath } from '../utils/tickMath'\nimport { Tick, TickConstructorArgs } from './tick'\nimport { NoTickDataProvider, TickDataProvider } from './tickDataProvider'\nimport { TickListDataProvider } from './tickListDataProvider'\n\ninterface StepComputations {\n sqrtPriceStartX96: JSBI\n tickNext: number\n initialized: boolean\n sqrtPriceNextX96: JSBI\n amountIn: JSBI\n amountOut: JSBI\n feeAmount: JSBI\n}\n\n/**\n * By default, pools will not allow operations that require ticks.\n */\nconst NO_TICK_DATA_PROVIDER_DEFAULT = new NoTickDataProvider()\n\n/**\n * Represents a V3 pool\n */\nexport class Pool {\n public readonly token0: Token\n public readonly token1: Token\n public readonly fee: FeeAmount\n public readonly sqrtRatioX96: JSBI\n public readonly liquidity: JSBI\n public readonly tickCurrent: number\n public readonly tickDataProvider: TickDataProvider\n\n private _token0Price?: Price\n private _token1Price?: Price\n\n public static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount): string {\n return computePoolAddress({ factoryAddress: FACTORY_ADDRESS, fee, tokenA, tokenB })\n }\n\n /**\n * Construct a pool\n * @param tokenA one of the tokens in the pool\n * @param tokenB the other token in the pool\n * @param fee the fee in hundredths of a bips of the input amount of every swap that is collected by the pool\n * @param sqrtRatioX96 the sqrt of the current ratio of amounts of token1 to token0\n * @param liquidity the current value of in range liquidity\n * @param tickCurrent the current tick of the pool\n * @param ticks the current state of the pool ticks or a data provider that can return tick data\n */\n public constructor(\n tokenA: Token,\n tokenB: Token,\n fee: FeeAmount,\n sqrtRatioX96: BigintIsh,\n liquidity: BigintIsh,\n tickCurrent: number,\n ticks: TickDataProvider | (Tick | TickConstructorArgs)[] = NO_TICK_DATA_PROVIDER_DEFAULT\n ) {\n invariant(Number.isInteger(fee) && fee < 1_000_000, 'FEE')\n\n const tickCurrentSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent)\n const nextTickSqrtRatioX96 = TickMath.getSqrtRatioAtTick(tickCurrent + 1)\n invariant(\n JSBI.greaterThanOrEqual(JSBI.BigInt(sqrtRatioX96), tickCurrentSqrtRatioX96) &&\n JSBI.lessThanOrEqual(JSBI.BigInt(sqrtRatioX96), nextTickSqrtRatioX96),\n 'PRICE_BOUNDS'\n )\n // always create a copy of the list since we want the pool's tick list to be immutable\n ;[this.token0, this.token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n this.fee = fee\n this.sqrtRatioX96 = JSBI.BigInt(sqrtRatioX96)\n this.liquidity = JSBI.BigInt(liquidity)\n this.tickCurrent = tickCurrent\n this.tickDataProvider = Array.isArray(ticks) ? new TickListDataProvider(ticks, TICK_SPACINGS[fee]) : ticks\n }\n\n /**\n * Returns true if the token is either token0 or token1\n * @param token to check\n */\n public involvesToken(token: Token): boolean {\n return token.equals(this.token0) || token.equals(this.token1)\n }\n\n /**\n * Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0\n */\n public get token0Price(): Price {\n return (\n this._token0Price ??\n (this._token0Price = new Price(\n this.token0,\n this.token1,\n Q192,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96)\n ))\n )\n }\n\n /**\n * Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1\n */\n public get token1Price(): Price {\n return (\n this._token1Price ??\n (this._token1Price = new Price(\n this.token1,\n this.token0,\n JSBI.multiply(this.sqrtRatioX96, this.sqrtRatioX96),\n Q192\n ))\n )\n }\n\n /**\n * Return the price of the given token in terms of the other token in the pool.\n * @param token token to return price of\n */\n public priceOf(token: Token): Price {\n invariant(this.involvesToken(token), 'TOKEN')\n return token.equals(this.token0) ? this.token0Price : this.token1Price\n }\n\n /**\n * Returns the chain ID of the tokens in the pool.\n */\n public get chainId(): ChainId | number {\n return this.token0.chainId\n }\n\n /**\n * Given an input amount of a token, return the computed output amount and a pool with state updated after the trade\n * @param inputAmount the input amount for which to quote the output amount\n */\n public async getOutputAmount(\n inputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(this.involvesToken(inputAmount.currency), 'TOKEN')\n\n const zeroForOne = inputAmount.currency.equals(this.token0)\n\n const { amountCalculated: outputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n inputAmount.quotient,\n sqrtPriceLimitX96\n )\n const outputToken = zeroForOne ? this.token1 : this.token0\n return [\n CurrencyAmount.fromRawAmount(outputToken, JSBI.multiply(outputAmount, NEGATIVE_ONE)),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n /**\n * Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade\n * @param outputAmount the output amount for which to quote the input amount\n */\n public async getInputAmount(\n outputAmount: CurrencyAmount,\n sqrtPriceLimitX96?: JSBI\n ): Promise<[CurrencyAmount, Pool]> {\n invariant(outputAmount.currency.isToken && this.involvesToken(outputAmount.currency), 'TOKEN')\n\n const zeroForOne = outputAmount.currency.equals(this.token1)\n\n const { amountCalculated: inputAmount, sqrtRatioX96, liquidity, tickCurrent } = await this.swap(\n zeroForOne,\n JSBI.multiply(outputAmount.quotient, NEGATIVE_ONE),\n sqrtPriceLimitX96\n )\n const inputToken = zeroForOne ? this.token0 : this.token1\n return [\n CurrencyAmount.fromRawAmount(inputToken, inputAmount),\n new Pool(this.token0, this.token1, this.fee, sqrtRatioX96, liquidity, tickCurrent, this.tickDataProvider)\n ]\n }\n\n private async swap(\n zeroForOne: boolean,\n amountSpecified: JSBI,\n sqrtPriceLimitX96?: JSBI\n ): Promise<{ amountCalculated: JSBI; sqrtRatioX96: JSBI; liquidity: JSBI; tickCurrent: number }> {\n if (!sqrtPriceLimitX96)\n sqrtPriceLimitX96 = zeroForOne\n ? JSBI.add(TickMath.MIN_SQRT_RATIO, ONE)\n : JSBI.subtract(TickMath.MAX_SQRT_RATIO, ONE)\n\n if (zeroForOne) {\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, TickMath.MIN_SQRT_RATIO), 'RATIO_MIN')\n invariant(JSBI.lessThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n } else {\n invariant(JSBI.lessThan(sqrtPriceLimitX96, TickMath.MAX_SQRT_RATIO), 'RATIO_MAX')\n invariant(JSBI.greaterThan(sqrtPriceLimitX96, this.sqrtRatioX96), 'RATIO_CURRENT')\n }\n\n const exactInput = JSBI.greaterThanOrEqual(amountSpecified, ZERO)\n\n // keep track of swap state\n const state = {\n amountSpecifiedRemaining: amountSpecified,\n amountCalculated: ZERO,\n sqrtPriceX96: this.sqrtRatioX96,\n tick: this.tickCurrent,\n liquidity: this.liquidity\n }\n\n // start swap while loop\n while (JSBI.notEqual(state.amountSpecifiedRemaining, ZERO) && state.sqrtPriceX96 != sqrtPriceLimitX96) {\n let step: Partial = {}\n step.sqrtPriceStartX96 = state.sqrtPriceX96\n\n // because each iteration of the while loop rounds, we can't optimize this code (relative to the smart contract)\n // by simply traversing to the next available tick, we instead need to exactly replicate\n // tickBitmap.nextInitializedTickWithinOneWord\n ;[step.tickNext, step.initialized] = await this.tickDataProvider.nextInitializedTickWithinOneWord(\n state.tick,\n zeroForOne,\n this.tickSpacing\n )\n\n if (step.tickNext < TickMath.MIN_TICK) {\n step.tickNext = TickMath.MIN_TICK\n } else if (step.tickNext > TickMath.MAX_TICK) {\n step.tickNext = TickMath.MAX_TICK\n }\n\n step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext)\n ;[state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount] = SwapMath.computeSwapStep(\n state.sqrtPriceX96,\n (zeroForOne\n ? JSBI.lessThan(step.sqrtPriceNextX96, sqrtPriceLimitX96)\n : JSBI.greaterThan(step.sqrtPriceNextX96, sqrtPriceLimitX96))\n ? sqrtPriceLimitX96\n : step.sqrtPriceNextX96,\n state.liquidity,\n state.amountSpecifiedRemaining,\n this.fee\n )\n\n if (exactInput) {\n state.amountSpecifiedRemaining = JSBI.subtract(\n state.amountSpecifiedRemaining,\n JSBI.add(step.amountIn, step.feeAmount)\n )\n state.amountCalculated = JSBI.subtract(state.amountCalculated, step.amountOut)\n } else {\n state.amountSpecifiedRemaining = JSBI.add(state.amountSpecifiedRemaining, step.amountOut)\n state.amountCalculated = JSBI.add(state.amountCalculated, JSBI.add(step.amountIn, step.feeAmount))\n }\n\n // TODO\n if (JSBI.equal(state.sqrtPriceX96, step.sqrtPriceNextX96)) {\n // if the tick is initialized, run the tick transition\n if (step.initialized) {\n let liquidityNet = JSBI.BigInt((await this.tickDataProvider.getTick(step.tickNext)).liquidityNet)\n // if we're moving leftward, we interpret liquidityNet as the opposite sign\n // safe because liquidityNet cannot be type(int128).min\n if (zeroForOne) liquidityNet = JSBI.multiply(liquidityNet, NEGATIVE_ONE)\n\n state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet)\n }\n\n state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext\n } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {\n // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved\n state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96)\n }\n }\n\n return {\n amountCalculated: state.amountCalculated,\n sqrtRatioX96: state.sqrtPriceX96,\n liquidity: state.liquidity,\n tickCurrent: state.tick\n }\n }\n\n public get tickSpacing(): number {\n return TICK_SPACINGS[this.fee]\n }\n}\n","import { BigintIsh, MaxUint256, Percent, Price, CurrencyAmount, Token } from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { ZERO } from '../internalConstants'\nimport { maxLiquidityForAmounts } from '../utils/maxLiquidityForAmounts'\nimport { tickToPrice } from '../utils/priceTickConversions'\nimport { SqrtPriceMath } from '../utils/sqrtPriceMath'\nimport { TickMath } from '../utils/tickMath'\nimport { encodeSqrtRatioX96 } from '../utils/encodeSqrtRatioX96'\nimport { Pool } from './pool'\n\ninterface PositionConstructorArgs {\n pool: Pool\n tickLower: number\n tickUpper: number\n liquidity: BigintIsh\n}\n\n/**\n * Represents a position on a Uniswap V3 Pool\n */\nexport class Position {\n public readonly pool: Pool\n public readonly tickLower: number\n public readonly tickUpper: number\n public readonly liquidity: JSBI\n\n // cached resuts for the getters\n private _token0Amount: CurrencyAmount | null = null\n private _token1Amount: CurrencyAmount | null = null\n private _mintAmounts: Readonly<{ amount0: JSBI; amount1: JSBI }> | null = null\n\n /**\n * Constructs a position for a given pool with the given liquidity\n * @param pool for which pool the liquidity is assigned\n * @param liquidity the amount of liquidity that is in the position\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n */\n public constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs) {\n invariant(tickLower < tickUpper, 'TICK_ORDER')\n invariant(tickLower >= TickMath.MIN_TICK && tickLower % pool.tickSpacing === 0, 'TICK_LOWER')\n invariant(tickUpper <= TickMath.MAX_TICK && tickUpper % pool.tickSpacing === 0, 'TICK_UPPER')\n\n this.pool = pool\n this.tickLower = tickLower\n this.tickUpper = tickUpper\n this.liquidity = JSBI.BigInt(liquidity)\n }\n\n /**\n * Returns the price of token0 at the lower tick\n */\n public get token0PriceLower(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickLower)\n }\n\n /**\n * Returns the price of token0 at the upper tick\n */\n public get token0PriceUpper(): Price {\n return tickToPrice(this.pool.token0, this.pool.token1, this.tickUpper)\n }\n\n /**\n * Returns the amount of token0 that this position's liquidity could be burned for at the current pool price\n */\n public get amount0(): CurrencyAmount {\n if (this._token0Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token0Amount = CurrencyAmount.fromRawAmount(\n this.pool.token0,\n SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n } else {\n this._token0Amount = CurrencyAmount.fromRawAmount(this.pool.token0, ZERO)\n }\n }\n return this._token0Amount\n }\n\n /**\n * Returns the amount of token1 that this position's liquidity could be burned for at the current pool price\n */\n public get amount1(): CurrencyAmount {\n if (this._token1Amount === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n this._token1Amount = CurrencyAmount.fromRawAmount(this.pool.token1, ZERO)\n } else if (this.pool.tickCurrent < this.tickUpper) {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n false\n )\n )\n } else {\n this._token1Amount = CurrencyAmount.fromRawAmount(\n this.pool.token1,\n SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n false\n )\n )\n }\n }\n return this._token1Amount\n }\n\n /**\n * Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage\n * @param slippageTolerance amount by which the price can 'slip'\n * @private\n */\n private ratiosAfterSlippage(slippageTolerance: Percent): { sqrtRatioX96Lower: JSBI; sqrtRatioX96Upper: JSBI } {\n const priceLower = this.pool.token0Price.asFraction.multiply(new Percent(1).subtract(slippageTolerance))\n const priceUpper = this.pool.token0Price.asFraction.multiply(slippageTolerance.add(1))\n let sqrtRatioX96Lower = encodeSqrtRatioX96(priceLower.numerator, priceLower.denominator)\n if (JSBI.lessThanOrEqual(sqrtRatioX96Lower, TickMath.MIN_SQRT_RATIO)) {\n sqrtRatioX96Lower = JSBI.add(TickMath.MIN_SQRT_RATIO, JSBI.BigInt(1))\n }\n let sqrtRatioX96Upper = encodeSqrtRatioX96(priceUpper.numerator, priceUpper.denominator)\n if (JSBI.greaterThanOrEqual(sqrtRatioX96Upper, TickMath.MAX_SQRT_RATIO)) {\n sqrtRatioX96Upper = JSBI.subtract(TickMath.MAX_SQRT_RATIO, JSBI.BigInt(1))\n }\n return {\n sqrtRatioX96Lower,\n sqrtRatioX96Upper\n }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position\n * with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // because the router is imprecise, we need to calculate the position that will be created (assuming no slippage)\n const positionThatWillBeCreated = Position.fromAmounts({\n pool: this.pool,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper,\n ...this.mintAmounts, // the mint amounts are what will be passed as calldata\n useFullPrecision: false\n })\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const { amount0 } = new Position({\n pool: poolUpper,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n // ...and the lower for amount1\n const { amount1 } = new Position({\n pool: poolLower,\n liquidity: positionThatWillBeCreated.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).mintAmounts\n\n return { amount0, amount1 }\n }\n\n /**\n * Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the\n * position with the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the current price\n */\n public burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n // get lower/upper prices\n const { sqrtRatioX96Upper, sqrtRatioX96Lower } = this.ratiosAfterSlippage(slippageTolerance)\n\n // construct counterfactual pools\n const poolLower = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Lower,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Lower)\n )\n const poolUpper = new Pool(\n this.pool.token0,\n this.pool.token1,\n this.pool.fee,\n sqrtRatioX96Upper,\n 0 /* liquidity doesn't matter */,\n TickMath.getTickAtSqrtRatio(sqrtRatioX96Upper)\n )\n\n // we want the smaller amounts...\n // ...which occurs at the upper price for amount0...\n const amount0 = new Position({\n pool: poolUpper,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount0\n // ...and the lower for amount1\n const amount1 = new Position({\n pool: poolLower,\n liquidity: this.liquidity,\n tickLower: this.tickLower,\n tickUpper: this.tickUpper\n }).amount1\n\n return { amount0: amount0.quotient, amount1: amount1.quotient }\n }\n\n /**\n * Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at\n * the current price for the pool\n */\n public get mintAmounts(): Readonly<{ amount0: JSBI; amount1: JSBI }> {\n if (this._mintAmounts === null) {\n if (this.pool.tickCurrent < this.tickLower) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: ZERO\n }\n } else if (this.pool.tickCurrent < this.tickUpper) {\n return {\n amount0: SqrtPriceMath.getAmount0Delta(\n this.pool.sqrtRatioX96,\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n ),\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n this.pool.sqrtRatioX96,\n this.liquidity,\n true\n )\n }\n } else {\n return {\n amount0: ZERO,\n amount1: SqrtPriceMath.getAmount1Delta(\n TickMath.getSqrtRatioAtTick(this.tickLower),\n TickMath.getSqrtRatioAtTick(this.tickUpper),\n this.liquidity,\n true\n )\n }\n }\n }\n return this._mintAmounts\n }\n\n /**\n * Computes the maximum amount of liquidity received for a given amount of token0, token1,\n * and the prices at the tick boundaries.\n * @param pool the pool for which the position should be created\n * @param tickLower the lower tick of the position\n * @param tickUpper the upper tick of the position\n * @param amount0 token0 amount\n * @param amount1 token1 amount\n * @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmounts({\n pool,\n tickLower,\n tickUpper,\n amount0,\n amount1,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n amount1: BigintIsh\n useFullPrecision: boolean\n }) {\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower)\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper)\n return new Position({\n pool,\n tickLower,\n tickUpper,\n liquidity: maxLiquidityForAmounts(\n pool.sqrtRatioX96,\n sqrtRatioAX96,\n sqrtRatioBX96,\n amount0,\n amount1,\n useFullPrecision\n )\n })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount0 the desired amount of token0\n * @param useFullPrecision if true, liquidity will be maximized according to what the router can calculate,\n * not what core can theoretically support\n */\n public static fromAmount0({\n pool,\n tickLower,\n tickUpper,\n amount0,\n useFullPrecision\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount0: BigintIsh\n useFullPrecision: boolean\n }) {\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0, amount1: MaxUint256, useFullPrecision })\n }\n\n /**\n * Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0\n * @param pool the pool for which the position is created\n * @param tickLower the lower tick\n * @param tickUpper the upper tick\n * @param amount1 the desired amount of token1\n */\n public static fromAmount1({\n pool,\n tickLower,\n tickUpper,\n amount1\n }: {\n pool: Pool\n tickLower: number\n tickUpper: number\n amount1: BigintIsh\n }) {\n // this function always uses full precision,\n return Position.fromAmounts({ pool, tickLower, tickUpper, amount0: MaxUint256, amount1, useFullPrecision: true })\n }\n}\n","import invariant from 'tiny-invariant'\n\nimport { ChainId, Currency, Price, Token, wrappedCurrency } from '@uniswap/sdk-core'\nimport { Pool } from './pool'\n\n/**\n * Represents a list of pools through which a swap can occur\n */\nexport class Route {\n public readonly pools: Pool[]\n public readonly tokenPath: Token[]\n public readonly input: TInput\n public readonly output: TOutput\n\n private _midPrice: Price | null = null\n\n public constructor(pools: Pool[], input: TInput, output: TOutput) {\n invariant(pools.length > 0, 'POOLS')\n\n const chainId = pools[0].chainId\n const allOnSameChain = pools.every(pool => pool.chainId === chainId)\n invariant(allOnSameChain, 'CHAIN_IDS')\n\n const wrappedInput = wrappedCurrency(input, chainId)\n invariant(pools[0].involvesToken(wrappedInput), 'INPUT')\n\n invariant(pools[pools.length - 1].involvesToken(wrappedCurrency(output, chainId)), 'OUTPUT')\n\n /**\n * Normalizes token0-token1 order and selects the next token/fee step to add to the path\n * */\n const tokenPath: Token[] = [wrappedInput]\n for (const [i, pool] of pools.entries()) {\n const currentInputToken = tokenPath[i]\n invariant(currentInputToken.equals(pool.token0) || currentInputToken.equals(pool.token1), 'PATH')\n const nextToken = currentInputToken.equals(pool.token0) ? pool.token1 : pool.token0\n tokenPath.push(nextToken)\n }\n\n this.pools = pools\n this.tokenPath = tokenPath\n this.input = input\n this.output = output ?? tokenPath[tokenPath.length - 1]\n }\n\n public get chainId(): ChainId | number {\n return this.pools[0].chainId\n }\n\n /**\n * Returns the token representation of the input currency. If the input currency is Ether, returns the wrapped ether token.\n */\n public get inputToken(): Token {\n return wrappedCurrency(this.input, this.chainId)\n }\n\n /**\n * Returns the token representation of the output currency. If the output currency is Ether, returns the wrapped ether token.\n */\n public get outputToken(): Token {\n return wrappedCurrency(this.output, this.chainId)\n }\n\n /**\n * Returns the mid price of the route\n */\n public get midPrice(): Price {\n if (this._midPrice !== null) return this._midPrice\n\n const price = this.pools.slice(1).reduce(\n ({ nextInput, price }, pool) => {\n return nextInput.equals(pool.token0)\n ? {\n nextInput: pool.token1,\n price: price.multiply(pool.token0Price)\n }\n : {\n nextInput: pool.token0,\n price: price.multiply(pool.token1Price)\n }\n },\n this.pools[0].token0.equals(this.inputToken)\n ? {\n nextInput: this.pools[0].token1,\n price: this.pools[0].token0Price\n }\n : {\n nextInput: this.pools[0].token0,\n price: this.pools[0].token1Price\n }\n ).price\n\n return (this._midPrice = new Price(this.input, this.output, price.denominator, price.numerator))\n }\n}\n","import {\n ChainId,\n Currency,\n currencyEquals,\n Fraction,\n Percent,\n Price,\n sortedInsert,\n CurrencyAmount,\n TradeType,\n wrappedCurrency,\n wrappedCurrencyAmount,\n Token,\n computePriceImpact\n} from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { ONE, ZERO } from '../internalConstants'\nimport { Pool } from './pool'\nimport { Route } from './route'\n\n// extension of the input output comparator that also considers other dimensions of the trade in ranking them\nexport function tradeComparator(\n a: Trade,\n b: Trade\n) {\n // must have same input and output token for comparison\n invariant(currencyEquals(a.inputAmount.currency, b.inputAmount.currency), 'INPUT_CURRENCY')\n invariant(currencyEquals(a.outputAmount.currency, b.outputAmount.currency), 'OUTPUT_CURRENCY')\n if (a.outputAmount.equalTo(b.outputAmount)) {\n if (a.inputAmount.equalTo(b.inputAmount)) {\n // consider the number of hops since each hop costs gas\n return a.route.tokenPath.length - b.route.tokenPath.length\n }\n // trade A requires less input than trade B, so A should come first\n if (a.inputAmount.lessThan(b.inputAmount)) {\n return -1\n } else {\n return 1\n }\n } else {\n // tradeA has less output than trade B, so should come second\n if (a.outputAmount.lessThan(b.outputAmount)) {\n return 1\n } else {\n return -1\n }\n }\n}\n\nexport interface BestTradeOptions {\n // how many results to return\n maxNumResults?: number\n // the maximum number of hops a trade should contain\n maxHops?: number\n}\n\n/**\n * Represents a trade executed against a list of pools.\n * Does not account for slippage, i.e. trades that front run this trade and move the price.\n */\nexport class Trade {\n /**\n * The route of the trade, i.e. which pools the trade goes through.\n */\n public readonly route: Route\n /**\n * The type of the trade, either exact in or exact out.\n */\n public readonly tradeType: TTradeType\n /**\n * The input amount for the trade assuming no slippage.\n */\n public readonly inputAmount: CurrencyAmount\n /**\n * The output amount for the trade assuming no slippage.\n */\n public readonly outputAmount: CurrencyAmount\n\n /**\n * The cached result of the computed execution price\n * @private\n */\n private _executionPrice: Price | undefined\n /**\n * The price expressed in terms of output amount/input amount.\n */\n public get executionPrice(): Price {\n return (\n this._executionPrice ??\n (this._executionPrice = new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.inputAmount.quotient,\n this.outputAmount.quotient\n ))\n )\n }\n\n /**\n * The cached result of the price impact computation\n * @private\n */\n private _priceImpact: Percent | undefined\n\n /**\n * Returns the percent difference between the route's mid price and the price impact\n */\n public get priceImpact(): Percent {\n return (\n this._priceImpact ??\n (this._priceImpact = computePriceImpact(this.route.midPrice, this.inputAmount, this.outputAmount))\n )\n }\n\n /**\n * Constructs an exact in trade with the given amount in and route\n * @param route route of the exact in trade\n * @param amountIn the amount being passed in\n */\n public static async exactIn(\n route: Route,\n amountIn: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountIn, TradeType.EXACT_INPUT)\n }\n\n /**\n * Constructs an exact out trade with the given amount out and route\n * @param route route of the exact out trade\n * @param amountOut the amount returned by the trade\n */\n public static async exactOut(\n route: Route,\n amountOut: CurrencyAmount\n ): Promise> {\n return Trade.fromRoute(route, amountOut, TradeType.EXACT_OUTPUT)\n }\n\n /**\n * Constructs a trade by simulating swaps through the given route\n * @param route route to swap through\n * @param amount the amount specified, either input or output, depending on tradeType\n * @param tradeType whether the trade is an exact input or exact output swap\n */\n public static async fromRoute(\n route: Route,\n amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount,\n tradeType: TTradeType\n ): Promise> {\n const amounts: CurrencyAmount[] = new Array(route.tokenPath.length)\n let inputAmount: CurrencyAmount\n let outputAmount: CurrencyAmount\n if (tradeType === TradeType.EXACT_INPUT) {\n invariant(currencyEquals(amount.currency, route.input), 'INPUT')\n amounts[0] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = 0; i < route.tokenPath.length - 1; i++) {\n const pool = route.pools[i]\n const [outputAmount] = await pool.getOutputAmount(amounts[i])\n amounts[i + 1] = outputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amount.numerator, amount.denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(\n route.output,\n amounts[amounts.length - 1].numerator,\n amounts[amounts.length - 1].denominator\n )\n } else {\n invariant(currencyEquals(amount.currency, route.output), 'OUTPUT')\n amounts[amounts.length - 1] = wrappedCurrencyAmount(amount, route.chainId)\n for (let i = route.tokenPath.length - 1; i > 0; i--) {\n const pool = route.pools[i - 1]\n const [inputAmount] = await pool.getInputAmount(amounts[i])\n amounts[i - 1] = inputAmount\n }\n inputAmount = CurrencyAmount.fromFractionalAmount(route.input, amounts[0].numerator, amounts[0].denominator)\n outputAmount = CurrencyAmount.fromFractionalAmount(route.output, amount.numerator, amount.denominator)\n }\n\n return new Trade({\n route,\n tradeType,\n inputAmount,\n outputAmount\n })\n }\n\n /**\n * Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade\n * elsewhere and do not have any tick data\n * @param constructorArguments the arguments passed to the trade constructor\n */\n public static createUncheckedTrade<\n TInput extends Currency,\n TOutput extends Currency,\n TTradeType extends TradeType\n >(constructorArguments: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }): Trade {\n return new Trade(constructorArguments)\n }\n\n /**\n * Construct a trade by passing in the pre-computed property values\n * @param route the route through which the trade occurs\n * @param inputAmount the amount of input paid in the trade\n * @param outputAmount the amount of output received in the trade\n * @param tradeType the type of trade, exact input or exact output\n */\n private constructor({\n route,\n inputAmount,\n outputAmount,\n tradeType\n }: {\n route: Route\n inputAmount: CurrencyAmount\n outputAmount: CurrencyAmount\n tradeType: TTradeType\n }) {\n invariant(currencyEquals(inputAmount.currency, route.input), 'INPUT_CURRENCY_MATCH')\n invariant(currencyEquals(outputAmount.currency, route.output), 'OUTPUT_CURRENCY_MATCH')\n this.route = route\n this.inputAmount = inputAmount\n this.outputAmount = outputAmount\n this.tradeType = tradeType\n }\n\n /**\n * Get the minimum amount that must be received from this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public minimumAmountOut(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_OUTPUT) {\n return this.outputAmount\n } else {\n const slippageAdjustedAmountOut = new Fraction(ONE)\n .add(slippageTolerance)\n .invert()\n .multiply(this.outputAmount.quotient).quotient\n return CurrencyAmount.fromRawAmount(this.outputAmount.currency, slippageAdjustedAmountOut)\n }\n }\n\n /**\n * Get the maximum amount in that can be spent via this trade for the given slippage tolerance\n * @param slippageTolerance tolerance of unfavorable slippage from the execution price of this trade\n */\n public maximumAmountIn(slippageTolerance: Percent): CurrencyAmount {\n invariant(!slippageTolerance.lessThan(ZERO), 'SLIPPAGE_TOLERANCE')\n if (this.tradeType === TradeType.EXACT_INPUT) {\n return this.inputAmount\n } else {\n const slippageAdjustedAmountIn = new Fraction(ONE).add(slippageTolerance).multiply(this.inputAmount.quotient)\n .quotient\n return CurrencyAmount.fromRawAmount(this.inputAmount.currency, slippageAdjustedAmountIn)\n }\n }\n\n /**\n * Return the execution price after accounting for slippage tolerance\n * @param slippageTolerance the allowed tolerated slippage\n */\n public worstExecutionPrice(slippageTolerance: Percent): Price {\n return new Price(\n this.inputAmount.currency,\n this.outputAmount.currency,\n this.maximumAmountIn(slippageTolerance).quotient,\n this.minimumAmountOut(slippageTolerance).quotient\n )\n }\n\n /**\n * Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token\n * amount to an output token, making at most `maxHops` hops.\n * Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param nextAmountIn exact amount of input currency to spend\n * @param currencyOut the desired currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactIn(\n pools: Pool[],\n currencyAmountIn: CurrencyAmount,\n currencyOut: TOutput,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountIn: CurrencyAmount = currencyAmountIn,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountIn === nextAmountIn || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountIn.currency.isToken\n ? nextAmountIn.currency.chainId\n : currencyOut.isToken\n ? (currencyOut as Token).chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountIn = wrappedCurrencyAmount(nextAmountIn, chainId)\n const tokenOut = wrappedCurrency(currencyOut, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountIn.currency) && !currencyEquals(pool.token1, amountIn.currency)) continue\n\n let amountOut: CurrencyAmount\n try {\n ;[amountOut] = await pool.getOutputAmount(amountIn)\n } catch (error) {\n // input too low\n if (error.isInsufficientInputAmountError) {\n continue\n }\n throw error\n }\n // we have arrived at the output token, so this is the final trade of one of the paths\n if (amountOut.currency.isToken && amountOut.currency.equals(tokenOut)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([...currentPools, pool], currencyAmountIn.currency, currencyOut),\n currencyAmountIn,\n TradeType.EXACT_INPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that lead from this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactIn(\n poolsExcludingThisPool,\n currencyAmountIn,\n currencyOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [...currentPools, pool],\n amountOut,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n\n /**\n * similar to the above method but instead targets a fixed output amount\n * given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token\n * to an output token amount, making at most `maxHops` hops\n * note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting\n * the amount in among multiple routes.\n * @param pools the pools to consider in finding the best trade\n * @param currencyIn the currency to spend\n * @param currencyAmountOut the desired currency amount out\n * @param nextAmountOut the exact amount of currency out\n * @param maxNumResults maximum number of results to return\n * @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool\n * @param currentPools used in recursion; the current list of pools\n * @param bestTrades used in recursion; the current list of best trades\n */\n public static async bestTradeExactOut(\n pools: Pool[],\n currencyIn: Currency,\n currencyAmountOut: CurrencyAmount,\n { maxNumResults = 3, maxHops = 3 }: BestTradeOptions = {},\n // used in recursion.\n currentPools: Pool[] = [],\n nextAmountOut: CurrencyAmount = currencyAmountOut,\n bestTrades: Trade[] = []\n ): Promise[]> {\n invariant(pools.length > 0, 'POOLS')\n invariant(maxHops > 0, 'MAX_HOPS')\n invariant(currencyAmountOut === nextAmountOut || currentPools.length > 0, 'INVALID_RECURSION')\n const chainId: ChainId | undefined = nextAmountOut.currency.isToken\n ? nextAmountOut.currency.chainId\n : currencyIn.isToken\n ? currencyIn.chainId\n : undefined\n invariant(chainId !== undefined, 'CHAIN_ID')\n\n const amountOut = wrappedCurrencyAmount(nextAmountOut, chainId)\n const tokenIn = wrappedCurrency(currencyIn, chainId)\n for (let i = 0; i < pools.length; i++) {\n const pool = pools[i]\n // pool irrelevant\n if (!currencyEquals(pool.token0, amountOut.currency) && !currencyEquals(pool.token1, amountOut.currency)) continue\n\n let amountIn: CurrencyAmount\n try {\n ;[amountIn] = await pool.getInputAmount(amountOut)\n } catch (error) {\n // not enough liquidity in this pool\n if (error.isInsufficientReservesError) {\n continue\n }\n throw error\n }\n // we have arrived at the input token, so this is the first trade of one of the paths\n if (currencyEquals(amountIn.currency, tokenIn)) {\n sortedInsert(\n bestTrades,\n await Trade.fromRoute(\n new Route([pool, ...currentPools], currencyIn, currencyAmountOut.currency),\n currencyAmountOut,\n TradeType.EXACT_OUTPUT\n ),\n maxNumResults,\n tradeComparator\n )\n } else if (maxHops > 1 && pools.length > 1) {\n const poolsExcludingThisPool = pools.slice(0, i).concat(pools.slice(i + 1, pools.length))\n\n // otherwise, consider all the other paths that arrive at this token as long as we have not exceeded maxHops\n await Trade.bestTradeExactOut(\n poolsExcludingThisPool,\n currencyIn,\n currencyAmountOut,\n {\n maxNumResults,\n maxHops: maxHops - 1\n },\n [pool, ...currentPools],\n amountIn,\n bestTrades\n )\n }\n }\n\n return bestTrades\n }\n}\n","import { BigintIsh, Token } from '@uniswap/sdk-core'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/interfaces/ISelfPermit.sol/ISelfPermit.json'\nimport { toHex } from './utils'\n\nexport interface StandardPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n amount: BigintIsh\n deadline: BigintIsh\n}\n\nexport interface AllowedPermitArguments {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n nonce: BigintIsh\n expiry: BigintIsh\n}\n\nexport type PermitOptions = StandardPermitArguments | AllowedPermitArguments\n\n// type guard\nfunction isAllowedPermit(permitOptions: PermitOptions): permitOptions is AllowedPermitArguments {\n return 'nonce' in permitOptions\n}\n\nexport abstract class SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n protected constructor() {}\n\n protected static encodePermit(token: Token, options: PermitOptions) {\n return isAllowedPermit(options)\n ? SelfPermit.INTERFACE.encodeFunctionData('selfPermitAllowed', [\n token.address,\n toHex(options.nonce),\n toHex(options.expiry),\n options.v,\n options.r,\n options.s\n ])\n : SelfPermit.INTERFACE.encodeFunctionData('selfPermit', [\n token.address,\n toHex(options.amount),\n toHex(options.deadline),\n options.v,\n options.r,\n options.s\n ])\n }\n}\n","import {\n BigintIsh,\n ChainId,\n Percent,\n Token,\n CurrencyAmount,\n validateAndParseAddress,\n WETH9,\n Currency\n} from '@uniswap/sdk-core'\nimport JSBI from 'jsbi'\nimport invariant from 'tiny-invariant'\nimport { Position } from './entities/position'\nimport { ONE, ZERO } from './internalConstants'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { Interface } from '@ethersproject/abi'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { ADDRESS_ZERO } from './constants'\n\nconst MaxUint128 = toHex(JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(128)), JSBI.BigInt(1)))\n\nexport interface MintSpecificOptions {\n /**\n * The account that should receive the minted NFT.\n */\n recipient: string\n\n /**\n * Creates pool if not initialized before mint.\n */\n createPool?: boolean\n}\n\nexport interface IncreaseSpecificOptions {\n /**\n * Indicates the ID of the position to increase liquidity for.\n */\n tokenId: BigintIsh\n}\n\n/**\n * Options for producing the calldata to add liquidity.\n */\nexport interface CommonAddLiquidityOptions {\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether to spend ether. If true, one of the pool tokens must be WETH, by default false\n */\n useEther?: boolean\n\n /**\n * The optional permit parameters for spending token0\n */\n token0Permit?: PermitOptions\n\n /**\n * The optional permit parameters for spending token1\n */\n token1Permit?: PermitOptions\n}\n\nexport type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions\nexport type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions\n\nexport type AddLiquidityOptions = MintOptions | IncreaseOptions\n\n// type guard\nfunction isMint(options: AddLiquidityOptions): options is MintOptions {\n return Object.keys(options).some(k => k === 'recipient')\n}\n\nexport interface CollectOptions {\n /**\n * Indicates the ID of the position to collect for.\n */\n tokenId: BigintIsh\n\n /**\n * Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed0: CurrencyAmount\n\n /**\n * Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned\n */\n expectedCurrencyOwed1: CurrencyAmount\n\n /**\n * The account that should receive the tokens.\n */\n recipient: string\n}\n\nexport interface NFTPermitOptions {\n v: 0 | 1 | 27 | 28\n r: string\n s: string\n deadline: BigintIsh\n spender: string\n}\n\n/**\n * Options for producing the calldata to exit a position.\n */\nexport interface RemoveLiquidityOptions {\n /**\n * The ID of the token to exit\n */\n tokenId: BigintIsh\n\n /**\n * The percentage of position liquidity to exit.\n */\n liquidityPercentage: Percent\n\n /**\n * How much the pool price is allowed to move.\n */\n slippageTolerance: Percent\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * Whether the NFT should be burned if the entire position is being exited, by default false.\n */\n burnToken?: boolean\n\n /**\n * The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT\n */\n permit?: NFTPermitOptions\n\n /**\n * Parameters to be passed on to collect\n */\n collectOptions: Omit\n}\n\nexport abstract class NonfungiblePositionManager extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n public static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters {\n invariant(JSBI.greaterThan(position.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n const calldatas: string[] = []\n\n // get amounts\n const { amount0: amount0Desired, amount1: amount1Desired } = position.mintAmounts\n\n // adjust for slippage\n const minimumAmounts = position.mintAmountsWithSlippage(options.slippageTolerance)\n const amount0Min = toHex(minimumAmounts.amount0)\n const amount1Min = toHex(minimumAmounts.amount1)\n\n const deadline = toHex(options.deadline)\n\n // create pool if needed\n if (isMint(options) && options.createPool) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('createAndInitializePoolIfNecessary', [\n position.pool.token0.address,\n position.pool.token1.address,\n position.pool.fee,\n toHex(position.pool.sqrtRatioX96)\n ])\n )\n }\n\n // permits if necessary\n if (options.token0Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token0, options.token0Permit))\n }\n if (options.token1Permit) {\n calldatas.push(NonfungiblePositionManager.encodePermit(position.pool.token1, options.token1Permit))\n }\n\n // mint\n if (isMint(options)) {\n const recipient: string = validateAndParseAddress(options.recipient)\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('mint', [\n {\n token0: position.pool.token0.address,\n token1: position.pool.token1.address,\n fee: position.pool.fee,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper,\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n recipient,\n deadline\n }\n ])\n )\n } else {\n // increase\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('increaseLiquidity', [\n {\n tokenId: toHex(options.tokenId),\n amount0Desired: toHex(amount0Desired),\n amount1Desired: toHex(amount1Desired),\n amount0Min,\n amount1Min,\n deadline\n }\n ])\n )\n }\n\n let value: string = toHex(0)\n\n if (options.useEther) {\n const weth = WETH9[position.pool.chainId as ChainId]\n invariant(weth && (position.pool.token0.equals(weth) || position.pool.token1.equals(weth)), 'NO_WETH')\n\n const wethValue = position.pool.token0.equals(weth) ? amount0Desired : amount1Desired\n\n // we only need to refund if we're actually sending ETH\n if (JSBI.greaterThan(wethValue, ZERO)) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n value = toHex(wethValue)\n }\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n\n private static encodeCollect(options: CollectOptions): string[] {\n const calldatas: string[] = []\n\n const tokenId = toHex(options.tokenId)\n\n const involvesETH = options.expectedCurrencyOwed0.currency.isEther || options.expectedCurrencyOwed1.currency.isEther\n\n const recipient = validateAndParseAddress(options.recipient)\n\n // collect\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [\n {\n tokenId,\n recipient: involvesETH ? ADDRESS_ZERO : recipient,\n amount0Max: MaxUint128,\n amount1Max: MaxUint128\n }\n ])\n )\n\n if (involvesETH) {\n const ethAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed0.quotient\n : options.expectedCurrencyOwed1.quotient\n const token = options.expectedCurrencyOwed0.currency.isEther\n ? (options.expectedCurrencyOwed1.currency as Token)\n : (options.expectedCurrencyOwed0.currency as Token)\n const tokenAmount = options.expectedCurrencyOwed0.currency.isEther\n ? options.expectedCurrencyOwed1.quotient\n : options.expectedCurrencyOwed0.quotient\n\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('unwrapWETH9', [toHex(ethAmount), recipient])\n )\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('sweepToken', [\n token.address,\n toHex(tokenAmount),\n recipient\n ])\n )\n }\n\n return calldatas\n }\n\n public static collectCallParameters(options: CollectOptions): MethodParameters {\n const calldatas: string[] = NonfungiblePositionManager.encodeCollect(options)\n\n return {\n calldata:\n calldatas.length === 1\n ? calldatas[0]\n : NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n\n /**\n * Produces the calldata for completely or partially exiting a position\n * @param position the position to exit\n * @param options additional information necessary for generating the calldata\n */\n public static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters {\n const calldatas: string[] = []\n\n const deadline = toHex(options.deadline)\n const tokenId = toHex(options.tokenId)\n\n // construct a partial position with a percentage of liquidity\n const partialPosition = new Position({\n pool: position.pool,\n liquidity: options.liquidityPercentage.multiply(position.liquidity).quotient,\n tickLower: position.tickLower,\n tickUpper: position.tickUpper\n })\n invariant(JSBI.greaterThan(partialPosition.liquidity, ZERO), 'ZERO_LIQUIDITY')\n\n // slippage-adjusted underlying amounts\n const { amount0: amount0Min, amount1: amount1Min } = partialPosition.burnAmountsWithSlippage(\n options.slippageTolerance\n )\n\n if (options.permit) {\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('permit', [\n validateAndParseAddress(options.permit.spender),\n tokenId,\n toHex(options.permit.deadline),\n options.permit.v,\n options.permit.r,\n options.permit.s\n ])\n )\n }\n\n // remove liquidity\n calldatas.push(\n NonfungiblePositionManager.INTERFACE.encodeFunctionData('decreaseLiquidity', [\n {\n tokenId,\n liquidity: toHex(partialPosition.liquidity),\n amount0Min: toHex(amount0Min),\n amount1Min: toHex(amount1Min),\n deadline\n }\n ])\n )\n\n const { expectedCurrencyOwed0, expectedCurrencyOwed1, ...rest } = options.collectOptions\n calldatas.push(\n ...NonfungiblePositionManager.encodeCollect({\n tokenId: options.tokenId,\n // add the underlying value to the expected currency already owed\n expectedCurrencyOwed0: expectedCurrencyOwed0.add(\n expectedCurrencyOwed0.currency.isEther\n ? CurrencyAmount.ether(amount0Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed0.currency as Token, amount0Min)\n ),\n expectedCurrencyOwed1: expectedCurrencyOwed1.add(\n expectedCurrencyOwed1.currency.isEther\n ? CurrencyAmount.ether(amount1Min)\n : CurrencyAmount.fromRawAmount(expectedCurrencyOwed1.currency as Token, amount1Min)\n ),\n ...rest\n })\n )\n\n if (options.liquidityPercentage.equalTo(ONE)) {\n if (options.burnToken) {\n calldatas.push(NonfungiblePositionManager.INTERFACE.encodeFunctionData('burn', [tokenId]))\n }\n } else {\n invariant(options.burnToken !== true, 'CANNOT_BURN')\n }\n\n return {\n calldata: NonfungiblePositionManager.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value: toHex(0)\n }\n }\n}\n","import { Interface } from '@ethersproject/abi'\nimport { BigintIsh, Currency, Percent, TradeType, validateAndParseAddress } from '@uniswap/sdk-core'\nimport invariant from 'tiny-invariant'\nimport { Trade } from './entities/trade'\nimport { ADDRESS_ZERO } from './constants'\nimport { PermitOptions, SelfPermit } from './selfPermit'\nimport { encodeRouteToPath } from './utils'\nimport { MethodParameters, toHex } from './utils/calldata'\nimport { abi } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'\n\nexport interface FeeOptions {\n /**\n * The percent of the output that will be taken as a fee.\n */\n fee: Percent\n\n /**\n * The recipient of the fee.\n */\n recipient: string\n}\n\n/**\n * Options for producing the arguments to send calls to the router.\n */\nexport interface SwapOptions {\n /**\n * How much the execution price is allowed to move unfavorably from the trade execution price.\n */\n slippageTolerance: Percent\n\n /**\n * The account that should receive the output.\n */\n recipient: string\n\n /**\n * When the transaction expires, in epoch seconds.\n */\n deadline: BigintIsh\n\n /**\n * The optional permit parameters for spending the input.\n */\n inputTokenPermit?: PermitOptions\n\n /**\n * The optional price limit for the trade.\n */\n sqrtPriceLimitX96?: BigintIsh\n\n /**\n * Optional information for taking a fee on output.\n */\n fee?: FeeOptions\n}\n\n/**\n * Represents the Uniswap V2 SwapRouter, and has static methods for helping execute trades.\n */\nexport abstract class SwapRouter extends SelfPermit {\n public static INTERFACE: Interface = new Interface(abi)\n\n /**\n * Cannot be constructed.\n */\n private constructor() {\n super()\n }\n\n /**\n * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.\n * @param trade to produce call parameters for\n * @param options options for the call parameters\n */\n public static swapCallParameters(\n trade: Trade,\n options: SwapOptions\n ): MethodParameters {\n const calldatas: string[] = []\n\n // encode permit if necessary\n if (options.inputTokenPermit) {\n invariant(trade.inputAmount.currency.isToken, 'NON_TOKEN_PERMIT')\n calldatas.push(SwapRouter.encodePermit(trade.inputAmount.currency, options.inputTokenPermit))\n }\n\n const recipient: string = validateAndParseAddress(options.recipient)\n\n const deadline = toHex(options.deadline)\n\n const amountIn: string = toHex(trade.maximumAmountIn(options.slippageTolerance).quotient)\n const amountOut: string = toHex(trade.minimumAmountOut(options.slippageTolerance).quotient)\n const value: string = trade.inputAmount.currency.isEther ? amountIn : toHex(0)\n\n // flag for whether the trade is single hop or not\n const singleHop = trade.route.pools.length === 1\n\n // flag for whether a refund needs to happen\n const mustRefund = trade.inputAmount.currency.isEther && trade.tradeType === TradeType.EXACT_OUTPUT\n\n // flags for whether funds should be send first to the router\n const outputIsEther = trade.outputAmount.currency.isEther\n const routerMustCustody = outputIsEther || !!options.fee\n\n if (singleHop) {\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInputSingle', [exactInputSingleParams]))\n } else {\n const exactOutputSingleParams = {\n tokenIn: trade.route.tokenPath[0].address,\n tokenOut: trade.route.tokenPath[1].address,\n fee: trade.route.pools[0].fee,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn,\n sqrtPriceLimitX96: toHex(options.sqrtPriceLimitX96 ?? 0)\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutputSingle', [exactOutputSingleParams]))\n }\n } else {\n invariant(options.sqrtPriceLimitX96 === undefined, 'MULTIHOP_PRICE_LIMIT')\n\n const path: string = encodeRouteToPath(trade.route, trade.tradeType === TradeType.EXACT_OUTPUT)\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n const exactInputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountIn,\n amountOutMinimum: amountOut\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactInput', [exactInputParams]))\n } else {\n const exactOutputParams = {\n path,\n recipient: routerMustCustody ? ADDRESS_ZERO : recipient,\n deadline,\n amountOut,\n amountInMaximum: amountIn\n }\n\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('exactOutput', [exactOutputParams]))\n }\n }\n\n // refund\n if (mustRefund) {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('refundETH'))\n }\n\n // unwrap\n if (routerMustCustody) {\n if (!!options.fee) {\n const feeRecipient: string = validateAndParseAddress(options.fee.recipient)\n const fee = toHex(options.fee.fee.multiply(10_000).quotient)\n\n if (outputIsEther) {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9WithFee', [amountOut, recipient, fee, feeRecipient])\n )\n } else {\n calldatas.push(\n SwapRouter.INTERFACE.encodeFunctionData('sweepTokenWithFee', [\n trade.route.tokenPath[trade.route.tokenPath.length - 1].address,\n amountOut,\n recipient,\n fee,\n feeRecipient\n ])\n )\n }\n } else {\n calldatas.push(SwapRouter.INTERFACE.encodeFunctionData('unwrapWETH9', [amountOut, recipient]))\n }\n }\n\n return {\n calldata:\n calldatas.length === 1 ? calldatas[0] : SwapRouter.INTERFACE.encodeFunctionData('multicall', [calldatas]),\n value\n }\n }\n}\n"],"names":["undefined","FACTORY_ADDRESS","ADDRESS_ZERO","POOL_INIT_CODE_HASH","FeeAmount","TICK_SPACINGS","LOW","MEDIUM","HIGH","NEGATIVE_ONE","JSBI","BigInt","ZERO","ONE","Q96","exponentiate","Q192","computePoolAddress","factoryAddress","tokenA","tokenB","fee","sortsBefore","token0","token1","getCreate2Address","keccak256","defaultAbiCoder","encode","address","LiquidityMath","addDelta","x","y","lessThan","subtract","multiply","add","FullMath","mulDivRoundingUp","a","b","denominator","product","result","divide","notEqual","remainder","MaxUint160","multiplyIn256","bitwiseAnd","MaxUint256","addIn256","sum","SqrtPriceMath","getAmount0Delta","sqrtRatioAX96","sqrtRatioBX96","liquidity","roundUp","greaterThan","numerator1","leftShift","numerator2","getAmount1Delta","getNextSqrtPriceFromInput","sqrtPX96","amountIn","zeroForOne","invariant","getNextSqrtPriceFromAmount0RoundingUp","getNextSqrtPriceFromAmount1RoundingDown","getNextSqrtPriceFromOutput","amountOut","amount","equal","greaterThanOrEqual","quotient","lessThanOrEqual","MAX_FEE","SwapMath","computeSwapStep","sqrtRatioCurrentX96","sqrtRatioTargetX96","amountRemaining","feePips","returnValues","exactIn","amountRemainingLessFee","sqrtRatioNextX96","max","feeAmount","TWO","POWERS_OF_2","map","pow","mostSignificantBit","msb","power","min","signedRightShift","mulShift","val","mulBy","Q32","TickMath","getSqrtRatioAtTick","tick","MIN_TICK","MAX_TICK","Number","isInteger","absTick","ratio","getTickAtSqrtRatio","sqrtRatioX96","MIN_SQRT_RATIO","MAX_SQRT_RATIO","sqrtRatioX128","r","log_2","i","f","bitwiseOr","log_sqrt10001","tickLow","toNumber","tickHigh","NoTickDataProvider","getTick","_tick","Error","ERROR_MESSAGE","nextInitializedTickWithinOneWord","_lte","_tickSpacing","isSorted","list","comparator","length","tickComparator","index","TickList","validateList","ticks","tickSpacing","every","reduce","accumulator","liquidityNet","isBelowSmallest","isAtOrAboveLargest","binarySearch","l","Math","floor","nextInitializedTick","lte","compressed","wordPos","minimum","maximum","toHex","bigintIsh","bigInt","hex","toString","encodeRouteToPath","route","exactOutput","firstInputToken","wrappedCurrency","input","chainId","pools","pool","inputToken","path","types","outputToken","equals","pack","reverse","encodeSqrtRatioX96","amount1","amount0","numerator","ratioX192","sqrt","maxLiquidityForAmount0Imprecise","intermediate","maxLiquidityForAmount0Precise","maxLiquidityForAmount1","maxLiquidityForAmounts","useFullPrecision","maxLiquidityForAmount0","liquidity0","liquidity1","nearestUsableTick","rounded","round","tickToPrice","baseToken","quoteToken","Price","priceToClosestTick","price","sorted","baseCurrency","quoteCurrency","nextTickPrice","Tick","liquidityGross","TickListDataProvider","ticksMapped","t","NO_TICK_DATA_PROVIDER_DEFAULT","Pool","tickCurrent","tickCurrentSqrtRatioX96","nextTickSqrtRatioX96","tickDataProvider","Array","isArray","getAddress","involvesToken","token","priceOf","token0Price","token1Price","getOutputAmount","inputAmount","sqrtPriceLimitX96","currency","swap","outputAmount","amountCalculated","CurrencyAmount","fromRawAmount","getInputAmount","isToken","amountSpecified","exactInput","state","amountSpecifiedRemaining","sqrtPriceX96","step","sqrtPriceStartX96","tickNext","initialized","sqrtPriceNextX96","_token0Price","_token1Price","Position","tickLower","tickUpper","ratiosAfterSlippage","slippageTolerance","priceLower","asFraction","Percent","priceUpper","sqrtRatioX96Lower","sqrtRatioX96Upper","mintAmountsWithSlippage","poolLower","poolUpper","positionThatWillBeCreated","fromAmounts","mintAmounts","burnAmountsWithSlippage","fromAmount0","fromAmount1","_token0Amount","_token1Amount","_mintAmounts","Route","output","allOnSameChain","wrappedInput","tokenPath","entries","currentInputToken","nextToken","push","_midPrice","slice","nextInput","tradeComparator","currencyEquals","equalTo","Trade","tradeType","fromRoute","TradeType","EXACT_INPUT","exactOut","EXACT_OUTPUT","amounts","wrappedCurrencyAmount","fromFractionalAmount","createUncheckedTrade","constructorArguments","minimumAmountOut","slippageAdjustedAmountOut","Fraction","invert","maximumAmountIn","slippageAdjustedAmountIn","worstExecutionPrice","bestTradeExactIn","currencyAmountIn","currencyOut","currentPools","nextAmountIn","bestTrades","maxNumResults","maxHops","tokenOut","isInsufficientInputAmountError","sortedInsert","poolsExcludingThisPool","concat","bestTradeExactOut","currencyIn","currencyAmountOut","nextAmountOut","tokenIn","isInsufficientReservesError","_executionPrice","_priceImpact","computePriceImpact","midPrice","isAllowedPermit","permitOptions","SelfPermit","encodePermit","options","INTERFACE","encodeFunctionData","nonce","expiry","v","s","deadline","Interface","abi","MaxUint128","isMint","Object","keys","some","k","NonfungiblePositionManager","addCallParameters","position","calldatas","amount0Desired","amount1Desired","minimumAmounts","amount0Min","amount1Min","createPool","token0Permit","token1Permit","recipient","validateAndParseAddress","tokenId","value","useEther","weth","WETH9","wethValue","calldata","encodeCollect","involvesETH","expectedCurrencyOwed0","isEther","expectedCurrencyOwed1","amount0Max","amount1Max","ethAmount","tokenAmount","collectCallParameters","removeCallParameters","partialPosition","liquidityPercentage","permit","spender","collectOptions","rest","ether","burnToken","SwapRouter","swapCallParameters","trade","inputTokenPermit","singleHop","mustRefund","outputIsEther","routerMustCustody","exactInputSingleParams","amountOutMinimum","exactOutputSingleParams","amountInMaximum","exactInputParams","exactOutputParams","feeRecipient"],"mappings":";;;;;;;;;;;;;;;;;;;;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AA,QAAQ,EACNjB,SAAS,CAACzN,MAAV,KAAqB,CAArB,GAAyByN,SAAS,CAAC,CAAD,CAAlC,GAAwCqC,UAAU,CAACvD,SAAX,CAAqBC,kBAArB,CAAwC,WAAxC,EAAqD,CAACiB,SAAD,CAArD,CAFrC;AAGLY,MAAAA,KAAK,EAALA;AAHK,KAAP;AAKD,GAzIH;;AAAA;AAAA,EAAyCjC,UAAzC;AACgB0D,oBAAA,gBAAuB,IAAIhD,SAAJ,CAAcC,KAAd,CAAvB;;;;"} \ No newline at end of file diff --git a/uniswap-packages-forks/v3-sdk/package.json b/uniswap-packages-forks/v3-sdk/package.json deleted file mode 100644 index 2fc227d078a..00000000000 --- a/uniswap-packages-forks/v3-sdk/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "@uniswap/v3-sdk", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "version": "3.0.0-alpha.6", - "description": "⚒️ An SDK for building applications on top of Uniswap V3", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "files": [ - "dist" - ], - "repository": "https://github.com/Uniswap/uniswap-v3-sdk.git", - "keywords": [ - "uniswap", - "ethereum" - ], - "module": "dist/v3-sdk.esm.js", - "scripts": { - "build": "tsdx build", - "start": "tsdx watch", - "test": "tsdx test", - "prepublishOnly": "tsdx build" - }, - "dependencies": { - "@ethersproject/abi": "^5.0.12", - "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "file:../sdk-core", - "@uniswap/v3-periphery": "1.0.0", - "tiny-invariant": "^1.1.0", - "tiny-warning": "^1.0.3" - }, - "devDependencies": { - "@types/jest": "^24.0.25", - "@uniswap/v3-core": "1.0.0", - "tsdx": "^0.14.1" - }, - "engines": { - "node": ">=10" - }, - "prettier": { - "printWidth": 120, - "semi": false, - "singleQuote": true - } -} diff --git a/yarn.lock b/yarn.lock index ae52467d3fb..9d884208310 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,30 @@ # yarn lockfile v1 +"@alagunoff/uniswap-sdk-core@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@alagunoff/uniswap-sdk-core/-/uniswap-sdk-core-3.0.0.tgz#197a73f47970a8f461399b40283266b2e2b2e162" + integrity sha512-I1u75P/o+BPZE88RxsRCXY7w34waflEwbVXtHRcGl1ZVFChBLEKYH2g6n8Z0A1Deq77mSfSPZDZwwRnMNEIhnQ== + dependencies: + "@ethersproject/address" "5.0.2" + big.js "5.2.2" + decimal.js-light "2.5.0" + jsbi "3.1.4" + tiny-invariant "1.1.0" + toformat "2.0.0" + +"@alagunoff/uniswap-v3-sdk@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@alagunoff/uniswap-v3-sdk/-/uniswap-v3-sdk-3.0.0.tgz#8e93f288e2af6c179397cfde70efe49717dfa8d9" + integrity sha512-JGyxjBN8sHuLY1EGQLlqk7RaNxwyXm2keRJNega/mBQSVwxDQSvhLabDNRAJm5+D0TYm7Vv9TgSiGTn3xKiWGA== + dependencies: + "@alagunoff/uniswap-sdk-core" "3.0.0" + "@ethersproject/abi" "5.0.12" + "@ethersproject/solidity" "5.0.9" + "@uniswap/v3-periphery" "1.0.0" + tiny-invariant "1.1.0" + tiny-warning "1.0.3" + "@babel/code-frame@7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" @@ -1385,7 +1409,22 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@ethersproject/abi@5.1.0", "@ethersproject/abi@^5.0.12", "@ethersproject/abi@^5.1.0": +"@ethersproject/abi@5.0.12": + version "5.0.12" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.12.tgz#9aebe6aedc05ce45bb6c41b06d80bd195b7de77c" + integrity sha512-Ujr/3bwyYYjXLDQfebeiiTuvOw9XtUKM8av6YkoBeMXyGQM9GkjrQlwJMNwGTmqjATH/ZNbRgCh98GjOLiIB1Q== + dependencies: + "@ethersproject/address" "^5.0.9" + "@ethersproject/bignumber" "^5.0.13" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/constants" "^5.0.8" + "@ethersproject/hash" "^5.0.10" + "@ethersproject/keccak256" "^5.0.7" + "@ethersproject/logger" "^5.0.8" + "@ethersproject/properties" "^5.0.7" + "@ethersproject/strings" "^5.0.8" + +"@ethersproject/abi@5.1.0", "@ethersproject/abi@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.1.0.tgz#d582c9f6a8e8192778b5f2c991ce19d7b336b0c5" integrity sha512-N/W9Sbn1/C6Kh2kuHRjf/hX6euMK4+9zdJRBB8sDWmihVntjUAfxbusGZKzDQD8i3szAHhTz8K7XADV5iFNfJw== @@ -1413,6 +1452,19 @@ "@ethersproject/transactions" "^5.1.0" "@ethersproject/web" "^5.1.0" +"@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + "@ethersproject/abstract-signer@5.1.0", "@ethersproject/abstract-signer@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.1.0.tgz#744c7a2d0ebe3cc0bc38294d0f53d5ca3f4e49e3" @@ -1424,6 +1476,29 @@ "@ethersproject/logger" "^5.1.0" "@ethersproject/properties" "^5.1.0" +"@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.2.tgz#80d0ddfb7d4bd0d32657747fa4bdd2defef2e00a" + integrity sha512-+rz26RKj7ujGfQynys4V9VJRbR+wpC6eL8F22q3raWMH3152Ha31GwJPWzxE/bEA+43M/zTNVwY0R53gn53L2Q== + dependencies: + "@ethersproject/bignumber" "^5.0.0" + "@ethersproject/bytes" "^5.0.0" + "@ethersproject/keccak256" "^5.0.0" + "@ethersproject/logger" "^5.0.0" + "@ethersproject/rlp" "^5.0.0" + bn.js "^4.4.0" + "@ethersproject/address@5.1.0", "@ethersproject/address@^5.0.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.1.0.tgz#3854fd7ebcb6af7597de66f847c3345dae735b58" @@ -1435,6 +1510,17 @@ "@ethersproject/logger" "^5.1.0" "@ethersproject/rlp" "^5.1.0" +"@ethersproject/address@^5.0.9", "@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/base64@5.1.0", "@ethersproject/base64@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.1.0.tgz#27240c174d0a4e13f6eae87416fd876caf7f42b6" @@ -1442,6 +1528,13 @@ dependencies: "@ethersproject/bytes" "^5.1.0" +"@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/basex@5.1.0", "@ethersproject/basex@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.1.0.tgz#80da2e86f9da0cb5ccd446b337364d791f6a131c" @@ -1459,6 +1552,15 @@ "@ethersproject/logger" "^5.1.0" bn.js "^4.4.0" +"@ethersproject/bignumber@^5.0.0", "@ethersproject/bignumber@^5.0.13", "@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + "@ethersproject/bytes@5.1.0", "@ethersproject/bytes@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.1.0.tgz#55dfa9c4c21df1b1b538be3accb50fb76d5facfd" @@ -1466,6 +1568,13 @@ dependencies: "@ethersproject/logger" "^5.1.0" +"@ethersproject/bytes@^5.0.0", "@ethersproject/bytes@^5.0.9", "@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + "@ethersproject/constants@5.1.0", "@ethersproject/constants@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.1.0.tgz#4e7da6367ea0e9be87585d8b09f3fccf384b1452" @@ -1473,6 +1582,13 @@ dependencies: "@ethersproject/bignumber" "^5.1.0" +"@ethersproject/constants@^5.0.8", "@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/contracts@5.1.1": version "5.1.1" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.1.1.tgz#c66cb6d618fcbd73e20a6b808e8f768b2b781d0b" @@ -1512,6 +1628,21 @@ "@ethersproject/properties" "^5.1.0" "@ethersproject/strings" "^5.1.0" +"@ethersproject/hash@^5.0.10": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/hdnode@5.1.0", "@ethersproject/hdnode@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.1.0.tgz#2bf5c4048935136ce83e9242e1bd570afcc0bc83" @@ -1557,11 +1688,24 @@ "@ethersproject/bytes" "^5.1.0" js-sha3 "0.5.7" +"@ethersproject/keccak256@^5.0.0", "@ethersproject/keccak256@^5.0.7", "@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + "@ethersproject/logger@5.1.0", "@ethersproject/logger@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.1.0.tgz#4cdeeefac029373349d5818f39c31b82cc6d9bbf" integrity sha512-wtUaD1lBX10HBXjjKV9VHCBnTdUaKQnQ2XSET1ezglqLdPdllNOIlLfhyCRqXm5xwcjExVI5ETokOYfjPtaAlw== +"@ethersproject/logger@^5.0.0", "@ethersproject/logger@^5.0.8", "@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + "@ethersproject/networks@5.1.0", "@ethersproject/networks@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.1.0.tgz#f537290cb05aa6dc5e81e910926c04cfd5814bca" @@ -1569,6 +1713,13 @@ dependencies: "@ethersproject/logger" "^5.1.0" +"@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2@5.1.0", "@ethersproject/pbkdf2@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.1.0.tgz#6b740a85dc780e879338af74856ca2c0d3b24d19" @@ -1584,6 +1735,13 @@ dependencies: "@ethersproject/logger" "^5.1.0" +"@ethersproject/properties@^5.0.7", "@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + "@ethersproject/providers@5.1.1": version "5.1.1" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.1.1.tgz#a72f446ee0ddd93eb8f7d86178629565c03b55b6" @@ -1625,6 +1783,14 @@ "@ethersproject/bytes" "^5.1.0" "@ethersproject/logger" "^5.1.0" +"@ethersproject/rlp@^5.0.0", "@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/sha2@5.1.0", "@ethersproject/sha2@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.1.0.tgz#6ca42d1a26884b3e32ffa943fe6494af7211506c" @@ -1634,6 +1800,15 @@ "@ethersproject/logger" "^5.1.0" hash.js "1.1.3" +"@ethersproject/sha2@^5.0.7": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + hash.js "1.1.7" + "@ethersproject/signing-key@5.1.0", "@ethersproject/signing-key@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.1.0.tgz#6eddfbddb6826b597b9650e01acf817bf8991b9c" @@ -1645,7 +1820,30 @@ bn.js "^4.4.0" elliptic "6.5.4" -"@ethersproject/solidity@5.1.0", "@ethersproject/solidity@^5.0.0", "@ethersproject/solidity@^5.0.9": +"@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.0.9": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.0.9.tgz#49100fbe9f364ac56f7ff7c726f4f3d151901134" + integrity sha512-LIxSAYEQgLRXE3mRPCq39ou61kqP8fDrGqEeNcaNJS3aLbmAOS8MZp56uK++WsdI9hj8sNsFh78hrAa6zR9Jag== + dependencies: + "@ethersproject/bignumber" "^5.0.13" + "@ethersproject/bytes" "^5.0.9" + "@ethersproject/keccak256" "^5.0.7" + "@ethersproject/sha2" "^5.0.7" + "@ethersproject/strings" "^5.0.8" + +"@ethersproject/solidity@5.1.0", "@ethersproject/solidity@^5.0.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.1.0.tgz#095a9c75244edccb26c452c155736d363399b954" integrity sha512-kPodsGyo9zg1g9XSXp1lGhFaezBAUUsAUB1Vf6OkppE5Wksg4Et+x3kG4m7J/uShDMP2upkJtHNsIBK2XkVpKQ== @@ -1665,6 +1863,15 @@ "@ethersproject/constants" "^5.1.0" "@ethersproject/logger" "^5.1.0" +"@ethersproject/strings@^5.0.8", "@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/transactions@5.1.1", "@ethersproject/transactions@^5.1.0": version "5.1.1" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.1.1.tgz#5a6bbb25fb062c3cc75eb0db12faefcdd3870813" @@ -1680,6 +1887,21 @@ "@ethersproject/rlp" "^5.1.0" "@ethersproject/signing-key" "^5.1.0" +"@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/units@5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.1.0.tgz#b6ab3430ebc22adc3cb4839516496f167bee3ad5" @@ -1721,6 +1943,17 @@ "@ethersproject/properties" "^5.1.0" "@ethersproject/strings" "^5.1.0" +"@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/wordlists@5.1.0", "@ethersproject/wordlists@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.1.0.tgz#54eb9ef3a00babbff90ffe124e19c89e07e6aace" @@ -3130,8 +3363,10 @@ resolved "https://registry.yarnpkg.com/@uniswap/merkle-distributor/-/merkle-distributor-1.0.1.tgz#dc3d911f65a860fc3f0cae074bdcd08ed6a27a4d" integrity sha512-5gDiTI5hrXIh5UWTrxKYjw30QQDnpl8ckDSpefldNenDlYO1RKkdUYMYpvrqGi2r7YzLYTlO6+TDlNs6O7hDRw== -"@uniswap/sdk-core@file:uniswap-packages-forks/sdk-core": - version "3.0.0-alpha.1" +"@uniswap/sdk-core@^3.0.0-alpha.1": + version "3.2.6" + resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-3.2.6.tgz#1a652516fab0c6bc1420c2226648da967a10f52a" + integrity sha512-MvH/3G0W0sM2g7XjaUy9qU7IabxL/KQp/ucU0AQGpVxiTaAhmVRtsjkkv9UDyzpIXVrmevl4kRgV7KKE29UuXA== dependencies: "@ethersproject/address" "^5.0.2" big.js "^5.2.2" @@ -3163,12 +3398,14 @@ "@uniswap/lib" "1.1.1" "@uniswap/v2-core" "1.0.0" -"@uniswap/v2-sdk@file:./uniswap-packages-forks/v2-sdk": +"@uniswap/v2-sdk@3.0.0-alpha.0": version "3.0.0-alpha.0" + resolved "https://registry.yarnpkg.com/@uniswap/v2-sdk/-/v2-sdk-3.0.0-alpha.0.tgz#5bbd3133f832bf8b36bacf9213b06de520313e28" + integrity sha512-KHgdCldJ0JY6NC7KImJuU00G5E7X3LNq5yyVy5tGqf2S9fzBf/az91tlVSZzkEyALmH+8RiSvtqKjSNMXTXTfw== dependencies: "@ethersproject/address" "^5.0.0" "@ethersproject/solidity" "^5.0.0" - "@uniswap/sdk-core" "file:../../AppData/Local/Yarn/Cache/v6/npm-@uniswap-v2-sdk-3.0.0-alpha.0-f1f74993-b968-4d03-b793-38921ad14899-1735313914952/node_modules/@uniswap/sdk-core" + "@uniswap/sdk-core" "^3.0.0-alpha.1" tiny-invariant "^1.1.0" tiny-warning "^1.0.3" @@ -3188,16 +3425,6 @@ "@uniswap/v3-core" "1.0.0" base64-sol "1.0.1" -"@uniswap/v3-sdk@file:./uniswap-packages-forks/v3-sdk": - version "3.0.0-alpha.6" - dependencies: - "@ethersproject/abi" "^5.0.12" - "@ethersproject/solidity" "^5.0.9" - "@uniswap/sdk-core" "file:../../AppData/Local/Yarn/Cache/v6/npm-@uniswap-v3-sdk-3.0.0-alpha.6-8cc04188-5211-461b-a835-9421f513ff67-1735313914956/node_modules/@uniswap/sdk-core" - "@uniswap/v3-periphery" "1.0.0" - tiny-invariant "^1.1.0" - tiny-warning "^1.0.3" - "@walletconnect/browser-utils@^1.4.2-rc.2": version "1.4.2-rc.2" resolved "https://registry.yarnpkg.com/@walletconnect/browser-utils/-/browser-utils-1.4.2-rc.2.tgz#d03fd86e0240bd34b2fc2be3183e29d0b8e6b79d" @@ -4831,7 +5058,7 @@ bfj@^7.0.2: hoopy "^0.1.4" tryer "^1.0.1" -big.js@^5.2.2: +big.js@5.2.2, big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== @@ -4895,6 +5122,11 @@ bn.js@^5.0.0, bn.js@^5.1.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== +bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + body-parser@1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -6289,6 +6521,11 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= +decimal.js-light@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.0.tgz#ca7faf504c799326df94b0ab920424fdfc125348" + integrity sha512-b3VJCbd2hwUpeRGG3Toob+CRo8W22xplipNhP3tN7TSVB/cyMX71P1vM2Xjc9H74uV6dS2hDDmo/rHq8L87Upg== + decimal.js-light@^2.5.0: version "2.5.1" resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934" @@ -8481,7 +8718,7 @@ hash.js@1.1.3: inherits "^2.0.3" minimalistic-assert "^1.0.0" -hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -9928,6 +10165,11 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +jsbi@3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.1.4.tgz#9654dd02207a66a4911b4e4bb74265bc2cbc9dd0" + integrity sha512-52QRRFSsi9impURE8ZUbzAMCLjPm4THO7H2fcuIvaaeFTbSysvkodbQQXIVsNgq/ypDbq6dJiuGKL0vZ/i9hUg== + jsbi@^3.1.4: version "3.2.5" resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" @@ -14968,12 +15210,12 @@ timsort@^0.3.0: resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= -tiny-invariant@^1.0.2, tiny-invariant@^1.0.6, tiny-invariant@^1.1.0: +tiny-invariant@1.1.0, tiny-invariant@^1.0.2, tiny-invariant@^1.0.6, tiny-invariant@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875" integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw== -tiny-warning@^1.0.0, tiny-warning@^1.0.3: +tiny-warning@1.0.3, tiny-warning@^1.0.0, tiny-warning@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== @@ -15035,7 +15277,7 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -toformat@^2.0.0: +toformat@2.0.0, toformat@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/toformat/-/toformat-2.0.0.tgz#7a043fd2dfbe9021a4e36e508835ba32056739d8" integrity sha512-03SWBVop6nU8bpyZCx7SodpYznbZF5R4ljwNLBcTQzKOD9xuihRo/psX58llS1BMFhhAI08H3luot5GoXJz2pQ== From 56d55587b7936a50cb6d56f338e15fcb57369eff Mon Sep 17 00:00:00 2001 From: alagunoff Date: Sat, 28 Dec 2024 12:06:27 +0300 Subject: [PATCH 26/30] fix: change packages names in imports --- src/components/CurrencyInputPanel/FiatValue.tsx | 2 +- src/components/CurrencyInputPanel/index.tsx | 2 +- src/components/CurrencyLogo/index.tsx | 2 +- src/components/DoubleLogo/index.tsx | 2 +- src/components/FeeSelector/index.tsx | 2 +- src/components/FormattedCurrencyAmount/index.tsx | 2 +- src/components/Header/UniBalanceContent.tsx | 2 +- src/components/Header/index.tsx | 2 +- src/components/InputStepCounter/InputStepCounter.tsx | 2 +- src/components/NavigationTabs/index.tsx | 2 +- src/components/Popups/ClaimPopup.tsx | 2 +- src/components/PositionCard/Sushi.tsx | 2 +- src/components/PositionCard/V2.tsx | 2 +- src/components/PositionCard/index.tsx | 2 +- src/components/PositionListItem/index.tsx | 4 ++-- src/components/PositionPreview/index.tsx | 4 ++-- src/components/RangeSelector/index.tsx | 2 +- src/components/RateToggle/index.tsx | 2 +- src/components/SearchModal/CommonBases.tsx | 2 +- src/components/SearchModal/CurrencyList.tsx | 2 +- src/components/SearchModal/CurrencySearch.tsx | 2 +- src/components/SearchModal/CurrencySearchModal.tsx | 2 +- src/components/SearchModal/ImportRow.tsx | 2 +- src/components/SearchModal/ImportToken.tsx | 2 +- src/components/SearchModal/Manage.tsx | 2 +- src/components/SearchModal/ManageTokens.tsx | 2 +- src/components/SearchModal/filtering.ts | 2 +- src/components/SearchModal/sorting.ts | 2 +- src/components/Settings/index.tsx | 2 +- src/components/TokenWarningModal/index.tsx | 2 +- src/components/TransactionConfirmationModal/index.tsx | 2 +- src/components/TransactionSettings/index.tsx | 2 +- src/components/claim/AddressClaimModal.tsx | 2 +- src/components/claim/ClaimModal.tsx | 2 +- src/components/earn/PoolCard.tsx | 2 +- src/components/earn/StakingModal.tsx | 2 +- src/components/swap/AdvancedSwapDetails.tsx | 4 ++-- src/components/swap/ConfirmSwapModal.tsx | 4 ++-- src/components/swap/FormattedPriceImpact.tsx | 2 +- src/components/swap/SwapHeader.tsx | 2 +- src/components/swap/SwapModalFooter.tsx | 4 ++-- src/components/swap/SwapModalHeader.tsx | 4 ++-- src/components/swap/SwapRoute.tsx | 4 ++-- src/components/swap/TradePrice.tsx | 2 +- src/components/swap/UnsupportedCurrencyFooter.tsx | 2 +- src/components/swap/confirmPriceImpactWithoutFee.ts | 2 +- src/components/vote/VoteModal.tsx | 2 +- src/connectors/Fortmatic.ts | 2 +- src/connectors/index.ts | 2 +- src/constants/addresses.ts | 4 ++-- src/constants/governance.ts | 2 +- src/constants/misc.ts | 2 +- src/constants/routing.ts | 2 +- src/constants/tokens.ts | 2 +- src/hooks/Tokens.ts | 2 +- src/hooks/useAddTokenToMetamask.ts | 2 +- src/hooks/useAllCurrencyCombinations.ts | 2 +- src/hooks/useAllV3Routes.ts | 4 ++-- src/hooks/useApproveCallback.ts | 4 ++-- src/hooks/useBestV3Trade.ts | 4 ++-- src/hooks/useColor.ts | 2 +- src/hooks/useContract.ts | 2 +- src/hooks/useDerivedPositionInfo.ts | 2 +- src/hooks/useERC20Permit.ts | 4 ++-- src/hooks/useFetchListCallback.ts | 2 +- src/hooks/useIsSwapUnsupported.ts | 2 +- src/hooks/usePools.ts | 6 +++--- src/hooks/useSwapCallback.ts | 4 ++-- src/hooks/useSwapSlippageTolerance.ts | 4 ++-- src/hooks/useTickToPrice.ts | 4 ++-- src/hooks/useTokenAllowance.ts | 2 +- src/hooks/useTotalSupply.ts | 2 +- src/hooks/useUSDCPrice.ts | 2 +- src/hooks/useV2Pairs.ts | 2 +- src/hooks/useV2Trade.ts | 2 +- src/hooks/useV3PositionFees.ts | 4 ++-- src/hooks/useV3SwapPools.ts | 4 ++-- src/hooks/useWrapCallback.ts | 2 +- src/hooks/web3.ts | 2 +- src/pages/AddLiquidity/PoolPriceBar.tsx | 2 +- src/pages/AddLiquidity/Review.tsx | 4 ++-- src/pages/AddLiquidity/index.tsx | 6 +++--- src/pages/AddLiquidity/redirects.tsx | 2 +- src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx | 2 +- src/pages/AddLiquidityV2/PoolPriceBar.tsx | 2 +- src/pages/AddLiquidityV2/index.tsx | 2 +- src/pages/Earn/Manage.tsx | 2 +- src/pages/MigrateV2/MigrateV2Pair.tsx | 4 ++-- src/pages/MigrateV2/index.tsx | 2 +- src/pages/Pool/PositionPage.tsx | 4 ++-- src/pages/PoolFinder/index.tsx | 2 +- src/pages/RemoveLiquidity/V3.tsx | 4 ++-- src/pages/RemoveLiquidity/index.tsx | 2 +- src/pages/Swap/index.tsx | 4 ++-- src/pages/Vote/VotePage.tsx | 2 +- src/pages/Vote/index.tsx | 2 +- src/state/application/reducer.test.ts | 2 +- src/state/application/reducer.ts | 2 +- src/state/burn/hooks.ts | 2 +- src/state/burn/v3/hooks.ts | 4 ++-- src/state/claim/hooks.ts | 2 +- src/state/governance/hooks.ts | 2 +- src/state/lists/actions.ts | 2 +- src/state/lists/hooks.ts | 2 +- src/state/lists/reducer.test.ts | 2 +- src/state/lists/reducer.ts | 2 +- src/state/lists/updater.ts | 2 +- src/state/lists/wrappedTokenInfo.ts | 2 +- src/state/mint/hooks.ts | 2 +- src/state/mint/v3/hooks.ts | 4 ++-- src/state/mint/v3/utils.ts | 4 ++-- src/state/stake/hooks.ts | 2 +- src/state/swap/hooks.ts | 4 ++-- src/state/transactions/actions.ts | 2 +- src/state/transactions/reducer.test.ts | 2 +- src/state/user/hooks.tsx | 2 +- src/state/wallet/hooks.ts | 2 +- src/utils/calculateSlippageAmount.test.ts | 2 +- src/utils/calculateSlippageAmount.ts | 2 +- src/utils/computeFiatValuePriceImpact.tsx | 2 +- src/utils/computeUniCirculation.test.ts | 2 +- src/utils/computeUniCirculation.ts | 2 +- src/utils/constructSameAddressMap.ts | 2 +- src/utils/currencyId.ts | 2 +- src/utils/formatTokenAmount.ts | 2 +- src/utils/getExplorerLink.test.ts | 2 +- src/utils/getExplorerLink.ts | 2 +- src/utils/getTickToPrice.ts | 4 ++-- src/utils/getTradeVersion.ts | 4 ++-- src/utils/index.ts | 4 ++-- src/utils/isTradeBetter.ts | 4 ++-- src/utils/maxAmountSpend.ts | 2 +- src/utils/prices.test.ts | 2 +- src/utils/prices.ts | 4 ++-- src/utils/supportedChainId.ts | 2 +- src/utils/wrappedCurrency.ts | 2 +- 136 files changed, 171 insertions(+), 171 deletions(-) diff --git a/src/components/CurrencyInputPanel/FiatValue.tsx b/src/components/CurrencyInputPanel/FiatValue.tsx index e94d553400e..e8a0302ad8a 100644 --- a/src/components/CurrencyInputPanel/FiatValue.tsx +++ b/src/components/CurrencyInputPanel/FiatValue.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Percent } from '@alagunoff/uniswap-sdk-core' import React, { useMemo } from 'react' import useTheme from '../../hooks/useTheme' import { TYPE } from '../../theme' diff --git a/src/components/CurrencyInputPanel/index.tsx b/src/components/CurrencyInputPanel/index.tsx index db70a905f79..1a1bfcb1a3d 100644 --- a/src/components/CurrencyInputPanel/index.tsx +++ b/src/components/CurrencyInputPanel/index.tsx @@ -1,5 +1,5 @@ import { Pair } from '@uniswap/v2-sdk' -import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Percent, Token } from '@alagunoff/uniswap-sdk-core' import React, { useState, useCallback } from 'react' import styled from 'styled-components/macro' import { darken } from 'polished' diff --git a/src/components/CurrencyLogo/index.tsx b/src/components/CurrencyLogo/index.tsx index 855d9a2db84..a8f2a4d82b6 100644 --- a/src/components/CurrencyLogo/index.tsx +++ b/src/components/CurrencyLogo/index.tsx @@ -1,4 +1,4 @@ -import { ChainId, Currency } from '@uniswap/sdk-core' +import { ChainId, Currency } from '@alagunoff/uniswap-sdk-core' import React, { useMemo } from 'react' import styled from 'styled-components/macro' import EthereumLogo from '../../assets/images/ethereum-logo.png' diff --git a/src/components/DoubleLogo/index.tsx b/src/components/DoubleLogo/index.tsx index b8828073e49..a2e62200c31 100644 --- a/src/components/DoubleLogo/index.tsx +++ b/src/components/DoubleLogo/index.tsx @@ -1,4 +1,4 @@ -import { Currency } from '@uniswap/sdk-core' +import { Currency } from '@alagunoff/uniswap-sdk-core' import React from 'react' import styled from 'styled-components/macro' import CurrencyLogo from '../CurrencyLogo' diff --git a/src/components/FeeSelector/index.tsx b/src/components/FeeSelector/index.tsx index f164344b808..f07925c76bf 100644 --- a/src/components/FeeSelector/index.tsx +++ b/src/components/FeeSelector/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { FeeAmount } from '@uniswap/v3-sdk' +import { FeeAmount } from '@alagunoff/uniswap-v3-sdk' import { useTranslation } from 'react-i18next' import { AutoColumn } from 'components/Column' import { DynamicSection } from 'pages/AddLiquidity/styled' diff --git a/src/components/FormattedCurrencyAmount/index.tsx b/src/components/FormattedCurrencyAmount/index.tsx index 5421ad22ebc..60e16e84510 100644 --- a/src/components/FormattedCurrencyAmount/index.tsx +++ b/src/components/FormattedCurrencyAmount/index.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React from 'react' -import { Currency, CurrencyAmount, Fraction } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Fraction } from '@alagunoff/uniswap-sdk-core' const CURRENCY_AMOUNT_MIN = new Fraction(JSBI.BigInt(1), JSBI.BigInt(1000000)) diff --git a/src/components/Header/UniBalanceContent.tsx b/src/components/Header/UniBalanceContent.tsx index deed875fa9f..e08c78a3a7d 100644 --- a/src/components/Header/UniBalanceContent.tsx +++ b/src/components/Header/UniBalanceContent.tsx @@ -1,4 +1,4 @@ -import { ChainId, CurrencyAmount, Token } from '@uniswap/sdk-core' +import { ChainId, CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import React, { useMemo } from 'react' import { X } from 'react-feather' import styled from 'styled-components/macro' diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index cc84a6982bd..ad29b362656 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import useScrollPosition from '@react-hook/window-scroll' import React, { useState } from 'react' import { Text } from 'rebass' diff --git a/src/components/InputStepCounter/InputStepCounter.tsx b/src/components/InputStepCounter/InputStepCounter.tsx index e92da780450..967d312965c 100644 --- a/src/components/InputStepCounter/InputStepCounter.tsx +++ b/src/components/InputStepCounter/InputStepCounter.tsx @@ -6,7 +6,7 @@ import styled, { keyframes } from 'styled-components' import { TYPE } from 'theme' import { AutoColumn } from 'components/Column' import { ButtonPrimary } from 'components/Button' -import { FeeAmount } from '@uniswap/v3-sdk' +import { FeeAmount } from '@alagunoff/uniswap-v3-sdk' import { formattedFeeAmount } from 'utils' const pulse = (color: string) => keyframes` diff --git a/src/components/NavigationTabs/index.tsx b/src/components/NavigationTabs/index.tsx index d6acc5c3d42..dc6c6171bce 100644 --- a/src/components/NavigationTabs/index.tsx +++ b/src/components/NavigationTabs/index.tsx @@ -3,7 +3,7 @@ import styled from 'styled-components/macro' import { darken } from 'polished' import { useTranslation } from 'react-i18next' import { NavLink, Link as HistoryLink } from 'react-router-dom' -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '@alagunoff/uniswap-sdk-core' import { ArrowLeft } from 'react-feather' import { RowBetween } from '../Row' diff --git a/src/components/Popups/ClaimPopup.tsx b/src/components/Popups/ClaimPopup.tsx index f1ca2b0edc9..ef050b4148a 100644 --- a/src/components/Popups/ClaimPopup.tsx +++ b/src/components/Popups/ClaimPopup.tsx @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import React, { useEffect } from 'react' import { X } from 'react-feather' import styled, { keyframes } from 'styled-components' diff --git a/src/components/PositionCard/Sushi.tsx b/src/components/PositionCard/Sushi.tsx index f6619403a1a..1b2ea703441 100644 --- a/src/components/PositionCard/Sushi.tsx +++ b/src/components/PositionCard/Sushi.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Token } from '@uniswap/sdk-core' +import { Token } from '@alagunoff/uniswap-sdk-core' import { Link } from 'react-router-dom' import { Text } from 'rebass' import styled from 'styled-components/macro' diff --git a/src/components/PositionCard/V2.tsx b/src/components/PositionCard/V2.tsx index 233022e17f2..31021dd0642 100644 --- a/src/components/PositionCard/V2.tsx +++ b/src/components/PositionCard/V2.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React, { useState } from 'react' -import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core' +import { Percent, CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import { Pair } from '@uniswap/v2-sdk' import { ChevronDown, ChevronUp } from 'react-feather' import { Link } from 'react-router-dom' diff --git a/src/components/PositionCard/index.tsx b/src/components/PositionCard/index.tsx index ee7de8d4348..9279202f10d 100644 --- a/src/components/PositionCard/index.tsx +++ b/src/components/PositionCard/index.tsx @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core' +import { Percent, CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import { Pair } from '@uniswap/v2-sdk' import { darken } from 'polished' import React, { useState } from 'react' diff --git a/src/components/PositionListItem/index.tsx b/src/components/PositionListItem/index.tsx index 383992036ef..2f98214877b 100644 --- a/src/components/PositionListItem/index.tsx +++ b/src/components/PositionListItem/index.tsx @@ -1,5 +1,5 @@ import React, { useMemo, useState } from 'react' -import { Position } from '@uniswap/v3-sdk' +import { Position } from '@alagunoff/uniswap-v3-sdk' import Badge from 'components/Badge' import DoubleCurrencyLogo from 'components/DoubleLogo' import { usePool } from 'hooks/usePools' @@ -8,7 +8,7 @@ import { Link } from 'react-router-dom' import styled from 'styled-components/macro' import { HideSmall, MEDIA_WIDTHS, SmallOnly } from 'theme' import { PositionDetails } from 'types/position' -import { WETH9, Price, Token, Percent, ChainId } from '@uniswap/sdk-core' +import { WETH9, Price, Token, Percent, ChainId } from '@alagunoff/uniswap-sdk-core' import { formatPrice } from 'utils/formatTokenAmount' import Loader from 'components/Loader' import { unwrappedToken } from 'utils/wrappedCurrency' diff --git a/src/components/PositionPreview/index.tsx b/src/components/PositionPreview/index.tsx index 839fee08cf8..226de3ec1a2 100644 --- a/src/components/PositionPreview/index.tsx +++ b/src/components/PositionPreview/index.tsx @@ -1,5 +1,5 @@ import React, { useState, useCallback, useContext } from 'react' -import { Position } from '@uniswap/v3-sdk' +import { Position } from '@alagunoff/uniswap-v3-sdk' import { LightCard } from 'components/Card' import { AutoColumn } from 'components/Column' import { TYPE } from 'theme' @@ -8,7 +8,7 @@ import CurrencyLogo from 'components/CurrencyLogo' import { unwrappedToken } from 'utils/wrappedCurrency' import { Break } from 'components/earn/styled' import { useTranslation } from 'react-i18next' -import { Currency } from '@uniswap/sdk-core' +import { Currency } from '@alagunoff/uniswap-sdk-core' import RateToggle from 'components/RateToggle' import DoubleCurrencyLogo from 'components/DoubleLogo' import RangeBadge from 'components/Badge/RangeBadge' diff --git a/src/components/RangeSelector/index.tsx b/src/components/RangeSelector/index.tsx index ad153cb16a6..65cc8b82be7 100644 --- a/src/components/RangeSelector/index.tsx +++ b/src/components/RangeSelector/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Currency, Price, Token } from '@uniswap/sdk-core' +import { Currency, Price, Token } from '@alagunoff/uniswap-sdk-core' import StepCounter from 'components/InputStepCounter/InputStepCounter' import { RowBetween } from 'components/Row' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/components/RateToggle/index.tsx b/src/components/RateToggle/index.tsx index 30d68b7266c..f24821a2d24 100644 --- a/src/components/RateToggle/index.tsx +++ b/src/components/RateToggle/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Currency } from '@uniswap/sdk-core' +import { Currency } from '@alagunoff/uniswap-sdk-core' import { ToggleElement, ToggleWrapper } from 'components/Toggle/MultiToggle' import { useActiveWeb3React } from 'hooks/web3' import { wrappedCurrency } from 'utils/wrappedCurrency' diff --git a/src/components/SearchModal/CommonBases.tsx b/src/components/SearchModal/CommonBases.tsx index 6dcb10116f8..a7b61577e00 100644 --- a/src/components/SearchModal/CommonBases.tsx +++ b/src/components/SearchModal/CommonBases.tsx @@ -1,6 +1,6 @@ import React from 'react' import { Text } from 'rebass' -import { ChainId, Currency, currencyEquals, Token, ETHER, POL } from '@uniswap/sdk-core' +import { ChainId, Currency, currencyEquals, Token, ETHER, POL } from '@alagunoff/uniswap-sdk-core' import styled from 'styled-components/macro' import { SUGGESTED_BASES } from '../../constants/routing' diff --git a/src/components/SearchModal/CurrencyList.tsx b/src/components/SearchModal/CurrencyList.tsx index ab9a74c457b..243fbee0758 100644 --- a/src/components/SearchModal/CurrencyList.tsx +++ b/src/components/SearchModal/CurrencyList.tsx @@ -1,4 +1,4 @@ -import { ChainId, Currency, CurrencyAmount, currencyEquals, Token } from '@uniswap/sdk-core' +import { ChainId, Currency, CurrencyAmount, currencyEquals, Token } from '@alagunoff/uniswap-sdk-core' import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react' import { FixedSizeList } from 'react-window' import { Text } from 'rebass' diff --git a/src/components/SearchModal/CurrencySearch.tsx b/src/components/SearchModal/CurrencySearch.tsx index 135b5a845ba..1996f35b542 100644 --- a/src/components/SearchModal/CurrencySearch.tsx +++ b/src/components/SearchModal/CurrencySearch.tsx @@ -1,4 +1,4 @@ -import { Currency, ETHER, POL, Token } from '@uniswap/sdk-core' +import { Currency, ETHER, POL, Token } from '@alagunoff/uniswap-sdk-core' import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react' import ReactGA from 'react-ga' import { useTranslation } from 'react-i18next' diff --git a/src/components/SearchModal/CurrencySearchModal.tsx b/src/components/SearchModal/CurrencySearchModal.tsx index 12a7a4ee343..c6233482514 100644 --- a/src/components/SearchModal/CurrencySearchModal.tsx +++ b/src/components/SearchModal/CurrencySearchModal.tsx @@ -1,4 +1,4 @@ -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '@alagunoff/uniswap-sdk-core' import React, { useCallback, useEffect, useState } from 'react' import useLast from '../../hooks/useLast' import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo' diff --git a/src/components/SearchModal/ImportRow.tsx b/src/components/SearchModal/ImportRow.tsx index b9abcde89d1..996c85bed26 100644 --- a/src/components/SearchModal/ImportRow.tsx +++ b/src/components/SearchModal/ImportRow.tsx @@ -1,5 +1,5 @@ import React, { CSSProperties } from 'react' -import { Token } from '@uniswap/sdk-core' +import { Token } from '@alagunoff/uniswap-sdk-core' import { AutoRow, RowFixed } from 'components/Row' import { AutoColumn } from 'components/Column' import CurrencyLogo from 'components/CurrencyLogo' diff --git a/src/components/SearchModal/ImportToken.tsx b/src/components/SearchModal/ImportToken.tsx index 410a92e4fc7..c2274ffdc86 100644 --- a/src/components/SearchModal/ImportToken.tsx +++ b/src/components/SearchModal/ImportToken.tsx @@ -1,6 +1,6 @@ import { TokenList } from '@uniswap/token-lists/dist/types' import React from 'react' -import { Token, Currency } from '@uniswap/sdk-core' +import { Token, Currency } from '@alagunoff/uniswap-sdk-core' import styled from 'styled-components/macro' import { TYPE, CloseIcon } from 'theme' import Card from 'components/Card' diff --git a/src/components/SearchModal/Manage.tsx b/src/components/SearchModal/Manage.tsx index aeeb4211332..8a1f9c08364 100644 --- a/src/components/SearchModal/Manage.tsx +++ b/src/components/SearchModal/Manage.tsx @@ -5,7 +5,7 @@ import { ArrowLeft } from 'react-feather' import { Text } from 'rebass' import { CloseIcon } from 'theme' import styled from 'styled-components/macro' -import { Token } from '@uniswap/sdk-core' +import { Token } from '@alagunoff/uniswap-sdk-core' import { ManageLists } from './ManageLists' import ManageTokens from './ManageTokens' import { TokenList } from '@uniswap/token-lists' diff --git a/src/components/SearchModal/ManageTokens.tsx b/src/components/SearchModal/ManageTokens.tsx index b3aa934fd62..0a23904e209 100644 --- a/src/components/SearchModal/ManageTokens.tsx +++ b/src/components/SearchModal/ManageTokens.tsx @@ -7,7 +7,7 @@ import { TYPE, ExternalLinkIcon, TrashIcon, ButtonText, ExternalLink } from 'the import { useToken } from 'hooks/Tokens' import styled from 'styled-components/macro' import { useUserAddedTokens, useRemoveUserAddedToken } from 'state/user/hooks' -import { Token } from '@uniswap/sdk-core' +import { Token } from '@alagunoff/uniswap-sdk-core' import CurrencyLogo from 'components/CurrencyLogo' import { isAddress } from 'utils' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/components/SearchModal/filtering.ts b/src/components/SearchModal/filtering.ts index 23dfa2cf554..72c22a92414 100644 --- a/src/components/SearchModal/filtering.ts +++ b/src/components/SearchModal/filtering.ts @@ -1,7 +1,7 @@ import { TokenInfo } from '@uniswap/token-lists' import { useMemo } from 'react' import { isAddress } from '../../utils' -import { Token } from '@uniswap/sdk-core' +import { Token } from '@alagunoff/uniswap-sdk-core' const alwaysTrue = () => true diff --git a/src/components/SearchModal/sorting.ts b/src/components/SearchModal/sorting.ts index 2b270748800..49923646170 100644 --- a/src/components/SearchModal/sorting.ts +++ b/src/components/SearchModal/sorting.ts @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount, Currency } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, Currency } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' import { useAllTokenBalances } from '../../state/wallet/hooks' diff --git a/src/components/Settings/index.tsx b/src/components/Settings/index.tsx index 8b8b9f77aa2..80176bdb0bc 100644 --- a/src/components/Settings/index.tsx +++ b/src/components/Settings/index.tsx @@ -15,7 +15,7 @@ import QuestionHelper from '../QuestionHelper' import { RowBetween, RowFixed } from '../Row' import Toggle from '../Toggle' import TransactionSettings from '../TransactionSettings' -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '@alagunoff/uniswap-sdk-core' const StyledMenuIcon = styled(Settings)` height: 20px; diff --git a/src/components/TokenWarningModal/index.tsx b/src/components/TokenWarningModal/index.tsx index 8f21614098b..46a431d40b5 100644 --- a/src/components/TokenWarningModal/index.tsx +++ b/src/components/TokenWarningModal/index.tsx @@ -1,4 +1,4 @@ -import { Token } from '@uniswap/sdk-core' +import { Token } from '@alagunoff/uniswap-sdk-core' import React from 'react' import Modal from '../Modal' import { ImportToken } from 'components/SearchModal/ImportToken' diff --git a/src/components/TransactionConfirmationModal/index.tsx b/src/components/TransactionConfirmationModal/index.tsx index abbc804f436..dbd45b14eee 100644 --- a/src/components/TransactionConfirmationModal/index.tsx +++ b/src/components/TransactionConfirmationModal/index.tsx @@ -1,4 +1,4 @@ -import { ChainId, Currency } from '@uniswap/sdk-core' +import { ChainId, Currency } from '@alagunoff/uniswap-sdk-core' import React, { useContext } from 'react' import styled, { ThemeContext } from 'styled-components' import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink' diff --git a/src/components/TransactionSettings/index.tsx b/src/components/TransactionSettings/index.tsx index d55c0023605..75def7eda21 100644 --- a/src/components/TransactionSettings/index.tsx +++ b/src/components/TransactionSettings/index.tsx @@ -1,5 +1,5 @@ import React, { useState, useContext } from 'react' -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '@alagunoff/uniswap-sdk-core' import styled, { ThemeContext } from 'styled-components' import QuestionHelper from '../QuestionHelper' diff --git a/src/components/claim/AddressClaimModal.tsx b/src/components/claim/AddressClaimModal.tsx index 1e288993e55..a707156c987 100644 --- a/src/components/claim/AddressClaimModal.tsx +++ b/src/components/claim/AddressClaimModal.tsx @@ -18,7 +18,7 @@ import { isAddress } from 'ethers/lib/utils' import Confetti from '../Confetti' import { CardNoise, CardBGImage, CardBGImageSmaller } from '../earn/styled' import { useIsTransactionPending } from '../../state/transactions/hooks' -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import { shortenAddress } from '../../utils' const ContentWrapper = styled(AutoColumn)` diff --git a/src/components/claim/ClaimModal.tsx b/src/components/claim/ClaimModal.tsx index b7b5f93788e..1c581187407 100644 --- a/src/components/claim/ClaimModal.tsx +++ b/src/components/claim/ClaimModal.tsx @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import { isAddress } from 'ethers/lib/utils' import React, { useEffect, useState } from 'react' import { Text } from 'rebass' diff --git a/src/components/earn/PoolCard.tsx b/src/components/earn/PoolCard.tsx index 9ee6c1173e7..94d340b4df0 100644 --- a/src/components/earn/PoolCard.tsx +++ b/src/components/earn/PoolCard.tsx @@ -4,7 +4,7 @@ import { RowBetween } from '../Row' import styled from 'styled-components/macro' import { TYPE, StyledInternalLink } from '../../theme' import DoubleCurrencyLogo from '../DoubleLogo' -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' import { ButtonPrimary } from '../Button' import { StakingInfo } from '../../state/stake/hooks' diff --git a/src/components/earn/StakingModal.tsx b/src/components/earn/StakingModal.tsx index cfe206669be..875fa3f6049 100644 --- a/src/components/earn/StakingModal.tsx +++ b/src/components/earn/StakingModal.tsx @@ -11,7 +11,7 @@ import { ButtonConfirmed, ButtonError } from '../Button' import ProgressCircles from '../ProgressSteps' import CurrencyInputPanel from '../CurrencyInputPanel' import { Pair } from '@uniswap/v2-sdk' -import { Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import { useActiveWeb3React } from '../../hooks/web3' import { maxAmountSpend } from '../../utils/maxAmountSpend' import { usePairContract, useStakingContract } from '../../hooks/useContract' diff --git a/src/components/swap/AdvancedSwapDetails.tsx b/src/components/swap/AdvancedSwapDetails.tsx index c9c1471c03c..7af2189a448 100644 --- a/src/components/swap/AdvancedSwapDetails.tsx +++ b/src/components/swap/AdvancedSwapDetails.tsx @@ -1,6 +1,6 @@ -import { Percent, Currency, TradeType } from '@uniswap/sdk-core' +import { Percent, Currency, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import React, { useContext, useMemo } from 'react' import { ThemeContext } from 'styled-components' import { TYPE } from '../../theme' diff --git a/src/components/swap/ConfirmSwapModal.tsx b/src/components/swap/ConfirmSwapModal.tsx index 97161a6a6ab..ff1956195e8 100644 --- a/src/components/swap/ConfirmSwapModal.tsx +++ b/src/components/swap/ConfirmSwapModal.tsx @@ -1,6 +1,6 @@ -import { Currency, currencyEquals, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, currencyEquals, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import React, { useCallback, useMemo } from 'react' import TransactionConfirmationModal, { ConfirmationModalContent, diff --git a/src/components/swap/FormattedPriceImpact.tsx b/src/components/swap/FormattedPriceImpact.tsx index 5f1e1621431..c00759f0bd5 100644 --- a/src/components/swap/FormattedPriceImpact.tsx +++ b/src/components/swap/FormattedPriceImpact.tsx @@ -1,4 +1,4 @@ -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '@alagunoff/uniswap-sdk-core' import React from 'react' import { warningSeverity } from '../../utils/prices' import { ErrorText, ErrorPill } from './styleds' diff --git a/src/components/swap/SwapHeader.tsx b/src/components/swap/SwapHeader.tsx index 6d3d9329a92..3708cc30d51 100644 --- a/src/components/swap/SwapHeader.tsx +++ b/src/components/swap/SwapHeader.tsx @@ -1,7 +1,7 @@ import React from 'react' import styled from 'styled-components/macro' import SettingsTab from '../Settings' -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '@alagunoff/uniswap-sdk-core' import { RowBetween, RowFixed } from '../Row' import { TYPE } from '../../theme' diff --git a/src/components/swap/SwapModalFooter.tsx b/src/components/swap/SwapModalFooter.tsx index 9617a2b0591..9b23107a393 100644 --- a/src/components/swap/SwapModalFooter.tsx +++ b/src/components/swap/SwapModalFooter.tsx @@ -1,6 +1,6 @@ -import { Currency, TradeType } from '@uniswap/sdk-core' +import { Currency, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import React from 'react' import { Text } from 'rebass' diff --git a/src/components/swap/SwapModalHeader.tsx b/src/components/swap/SwapModalHeader.tsx index 5a8eabcb54c..4561d2cd9c9 100644 --- a/src/components/swap/SwapModalHeader.tsx +++ b/src/components/swap/SwapModalHeader.tsx @@ -1,6 +1,6 @@ -import { Currency, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import React, { useContext, useState } from 'react' import { ArrowDown, AlertTriangle } from 'react-feather' import { Text } from 'rebass' diff --git a/src/components/swap/SwapRoute.tsx b/src/components/swap/SwapRoute.tsx index 569f64b3271..0e29a49cea3 100644 --- a/src/components/swap/SwapRoute.tsx +++ b/src/components/swap/SwapRoute.tsx @@ -1,6 +1,6 @@ -import { Currency, TradeType } from '@uniswap/sdk-core' +import { Currency, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade, FeeAmount } from '@uniswap/v3-sdk' +import { Trade as V3Trade, FeeAmount } from '@alagunoff/uniswap-v3-sdk' import React, { Fragment, memo, useContext } from 'react' import { ChevronRight } from 'react-feather' import { Flex } from 'rebass' diff --git a/src/components/swap/TradePrice.tsx b/src/components/swap/TradePrice.tsx index d8843cf9e04..90cfedbbcfe 100644 --- a/src/components/swap/TradePrice.tsx +++ b/src/components/swap/TradePrice.tsx @@ -1,5 +1,5 @@ import React, { useCallback } from 'react' -import { Price, Currency } from '@uniswap/sdk-core' +import { Price, Currency } from '@alagunoff/uniswap-sdk-core' import { useContext } from 'react' import { Text } from 'rebass' import styled, { ThemeContext } from 'styled-components' diff --git a/src/components/swap/UnsupportedCurrencyFooter.tsx b/src/components/swap/UnsupportedCurrencyFooter.tsx index c8ca3ffe350..859c8748ed1 100644 --- a/src/components/swap/UnsupportedCurrencyFooter.tsx +++ b/src/components/swap/UnsupportedCurrencyFooter.tsx @@ -8,7 +8,7 @@ import { RowBetween, AutoRow } from 'components/Row' import { AutoColumn } from 'components/Column' import CurrencyLogo from 'components/CurrencyLogo' import { useActiveWeb3React } from 'hooks/web3' -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '@alagunoff/uniswap-sdk-core' import { wrappedCurrency } from 'utils/wrappedCurrency' import { useUnsupportedTokens } from '../../hooks/Tokens' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' diff --git a/src/components/swap/confirmPriceImpactWithoutFee.ts b/src/components/swap/confirmPriceImpactWithoutFee.ts index 392768bc8e4..10f0b419604 100644 --- a/src/components/swap/confirmPriceImpactWithoutFee.ts +++ b/src/components/swap/confirmPriceImpactWithoutFee.ts @@ -1,4 +1,4 @@ -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '@alagunoff/uniswap-sdk-core' import { ALLOWED_PRICE_IMPACT_HIGH, PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN } from '../../constants/misc' /** diff --git a/src/components/vote/VoteModal.tsx b/src/components/vote/VoteModal.tsx index 4b14efd105a..5c0d4437db8 100644 --- a/src/components/vote/VoteModal.tsx +++ b/src/components/vote/VoteModal.tsx @@ -13,7 +13,7 @@ import Circle from '../../assets/images/blue-loader.svg' import { useVoteCallback, useUserVotes } from '../../state/governance/hooks' import { ExternalLink } from '../../theme/components' import { formatTokenAmount } from 'utils/formatTokenAmount' -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' const ContentWrapper = styled(AutoColumn)` width: 100%; diff --git a/src/connectors/Fortmatic.ts b/src/connectors/Fortmatic.ts index 8cb80e52237..f378659e959 100644 --- a/src/connectors/Fortmatic.ts +++ b/src/connectors/Fortmatic.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { FortmaticConnector as FortmaticConnectorCore } from '@web3-react/fortmatic-connector' export const OVERLAY_READY = 'OVERLAY_READY' diff --git a/src/connectors/index.ts b/src/connectors/index.ts index 73f73deece3..70e37773fa9 100644 --- a/src/connectors/index.ts +++ b/src/connectors/index.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { Web3Provider } from '@ethersproject/providers' import { InjectedConnector } from '@web3-react/injected-connector' import { WalletConnectConnector } from '@web3-react/walletconnect-connector' diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 7f68ba860f9..0df68b4b6b9 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -1,5 +1,5 @@ -import { ChainId } from '@uniswap/sdk-core' -import { FACTORY_ADDRESS as V3_FACTORY_ADDRESS } from '@uniswap/v3-sdk' +import { ChainId } from '@alagunoff/uniswap-sdk-core' +import { FACTORY_ADDRESS as V3_FACTORY_ADDRESS } from '@alagunoff/uniswap-v3-sdk' import { constructSameAddressMap } from '../utils/constructSameAddressMap' export const UNI_ADDRESS = constructSameAddressMap('0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984') diff --git a/src/constants/governance.ts b/src/constants/governance.ts index c8b4f83c582..ddafa08d2d8 100644 --- a/src/constants/governance.ts +++ b/src/constants/governance.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { GOVERNANCE_ADDRESS, TIMELOCK_ADDRESS, UNI_ADDRESS } from './addresses' export const COMMON_CONTRACT_NAMES: { [chainId in ChainId]?: { [address: string]: string } } = { diff --git a/src/constants/misc.ts b/src/constants/misc.ts index 2ede179ffd9..1b1cce91abc 100644 --- a/src/constants/misc.ts +++ b/src/constants/misc.ts @@ -1,4 +1,4 @@ -import { Percent } from '@uniswap/sdk-core' +import { Percent } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' diff --git a/src/constants/routing.ts b/src/constants/routing.ts index 4e35ab04315..87695aa1e4d 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -1,5 +1,5 @@ // a list of tokens by chain -import { ChainId, Token, WETH9 } from '@uniswap/sdk-core' +import { ChainId, Token, WETH9 } from '@alagunoff/uniswap-sdk-core' import { AMPL, DAI, diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index 21015b8ed53..16dfc9b2af0 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -1,4 +1,4 @@ -import { ChainId, Token } from '@uniswap/sdk-core' +import { ChainId, Token } from '@alagunoff/uniswap-sdk-core' import { UNI_ADDRESS } from './addresses' export const AMPL = new Token(ChainId.MAINNET, '0xD46bA6D942050d489DBd938a2C909A5d5039A161', 9, 'AMPL', 'Ampleforth') diff --git a/src/hooks/Tokens.ts b/src/hooks/Tokens.ts index a0ca8c74041..96c6dcb47ef 100644 --- a/src/hooks/Tokens.ts +++ b/src/hooks/Tokens.ts @@ -1,5 +1,5 @@ import { parseBytes32String } from '@ethersproject/strings' -import { Currency, currencyEquals, ETHER, POL, Token } from '@uniswap/sdk-core' +import { Currency, currencyEquals, ETHER, POL, Token } from '@alagunoff/uniswap-sdk-core' import { arrayify } from 'ethers/lib/utils' import { useMemo } from 'react' import { createTokenFilterFunction } from '../components/SearchModal/filtering' diff --git a/src/hooks/useAddTokenToMetamask.ts b/src/hooks/useAddTokenToMetamask.ts index 3b5b12ae92b..106e7a12804 100644 --- a/src/hooks/useAddTokenToMetamask.ts +++ b/src/hooks/useAddTokenToMetamask.ts @@ -1,6 +1,6 @@ import { getTokenLogoURL } from './../components/CurrencyLogo/index' import { wrappedCurrency } from 'utils/wrappedCurrency' -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '@alagunoff/uniswap-sdk-core' import { useCallback, useState } from 'react' import { useActiveWeb3React } from 'hooks/web3' diff --git a/src/hooks/useAllCurrencyCombinations.ts b/src/hooks/useAllCurrencyCombinations.ts index 7a209a7370a..5f82456cf4e 100644 --- a/src/hooks/useAllCurrencyCombinations.ts +++ b/src/hooks/useAllCurrencyCombinations.ts @@ -1,4 +1,4 @@ -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '@alagunoff/uniswap-sdk-core' import flatMap from 'lodash.flatmap' import { useMemo } from 'react' import { ADDITIONAL_BASES, BASES_TO_CHECK_TRADES_AGAINST, CUSTOM_BASES } from '../constants/routing' diff --git a/src/hooks/useAllV3Routes.ts b/src/hooks/useAllV3Routes.ts index fec692e0ae4..cc3408c8401 100644 --- a/src/hooks/useAllV3Routes.ts +++ b/src/hooks/useAllV3Routes.ts @@ -1,5 +1,5 @@ -import { ChainId, Currency } from '@uniswap/sdk-core' -import { Pool, Route } from '@uniswap/v3-sdk' +import { ChainId, Currency } from '@alagunoff/uniswap-sdk-core' +import { Pool, Route } from '@alagunoff/uniswap-v3-sdk' import { useMemo } from 'react' import { useUserSingleHopOnly } from '../state/user/hooks' import { wrappedCurrency } from '../utils/wrappedCurrency' diff --git a/src/hooks/useApproveCallback.ts b/src/hooks/useApproveCallback.ts index c2c2656cd16..4c8b9a9e635 100644 --- a/src/hooks/useApproveCallback.ts +++ b/src/hooks/useApproveCallback.ts @@ -1,8 +1,8 @@ import { MaxUint256 } from '@ethersproject/constants' import { TransactionResponse } from '@ethersproject/providers' -import { CurrencyAmount, ChainId, Percent, Currency, TradeType } from '@uniswap/sdk-core' +import { CurrencyAmount, ChainId, Percent, Currency, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { useCallback, useMemo } from 'react' import { SWAP_ROUTER_ADDRESSES, V2_ROUTER_ADDRESS } from '../constants/addresses' import { useTransactionAdder, useHasPendingApproval } from '../state/transactions/hooks' diff --git a/src/hooks/useBestV3Trade.ts b/src/hooks/useBestV3Trade.ts index e1f7283dada..7df4d5182eb 100644 --- a/src/hooks/useBestV3Trade.ts +++ b/src/hooks/useBestV3Trade.ts @@ -1,5 +1,5 @@ -import { Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core' -import { encodeRouteToPath, Route, Trade } from '@uniswap/v3-sdk' +import { Currency, CurrencyAmount, TradeType } from '@alagunoff/uniswap-sdk-core' +import { encodeRouteToPath, Route, Trade } from '@alagunoff/uniswap-v3-sdk' import { BigNumber } from 'ethers' import { useMemo } from 'react' import { useSingleContractMultipleData } from '../state/multicall/hooks' diff --git a/src/hooks/useColor.ts b/src/hooks/useColor.ts index 5d1575435f0..0148440a445 100644 --- a/src/hooks/useColor.ts +++ b/src/hooks/useColor.ts @@ -2,7 +2,7 @@ import { useState, useLayoutEffect } from 'react' import { shade } from 'polished' import Vibrant from 'node-vibrant' import { hex } from 'wcag-contrast' -import { Token, ChainId } from '@uniswap/sdk-core' +import { Token, ChainId } from '@alagunoff/uniswap-sdk-core' import uriToHttp from 'utils/uriToHttp' async function getColorFromToken(token: Token): Promise { diff --git a/src/hooks/useContract.ts b/src/hooks/useContract.ts index 1e0a836c4af..f2f2dbd8af2 100644 --- a/src/hooks/useContract.ts +++ b/src/hooks/useContract.ts @@ -1,5 +1,5 @@ import { Contract } from '@ethersproject/contracts' -import { ChainId, WETH9 } from '@uniswap/sdk-core' +import { ChainId, WETH9 } from '@alagunoff/uniswap-sdk-core' import { abi as GOVERNANCE_ABI } from '@uniswap/governance/build/GovernorAlpha.json' import { abi as UNI_ABI } from '@uniswap/governance/build/Uni.json' import { abi as STAKING_REWARDS_ABI } from '@uniswap/liquidity-staker/build/StakingRewards.json' diff --git a/src/hooks/useDerivedPositionInfo.ts b/src/hooks/useDerivedPositionInfo.ts index bcc5b46db06..6e13cdc1937 100644 --- a/src/hooks/useDerivedPositionInfo.ts +++ b/src/hooks/useDerivedPositionInfo.ts @@ -1,4 +1,4 @@ -import { Pool, Position } from '@uniswap/v3-sdk' +import { Pool, Position } from '@alagunoff/uniswap-v3-sdk' import { usePool } from 'hooks/usePools' import { PositionDetails } from 'types/position' import { useCurrency } from './Tokens' diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index b991e93038c..4f20f6a4b86 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -1,7 +1,7 @@ import JSBI from 'jsbi' -import { ChainId, Percent, CurrencyAmount, Currency, TradeType, Token } from '@uniswap/sdk-core' +import { ChainId, Percent, CurrencyAmount, Currency, TradeType, Token } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { splitSignature } from 'ethers/lib/utils' import { useMemo, useState } from 'react' import { SWAP_ROUTER_ADDRESSES } from '../constants/addresses' diff --git a/src/hooks/useFetchListCallback.ts b/src/hooks/useFetchListCallback.ts index 1a4a8ec3d48..345793ff0c8 100644 --- a/src/hooks/useFetchListCallback.ts +++ b/src/hooks/useFetchListCallback.ts @@ -1,5 +1,5 @@ import { nanoid } from '@reduxjs/toolkit' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { TokenList } from '@uniswap/token-lists' import { useCallback } from 'react' import { useDispatch } from 'react-redux' diff --git a/src/hooks/useIsSwapUnsupported.ts b/src/hooks/useIsSwapUnsupported.ts index 739e971a516..ec92f04b86c 100644 --- a/src/hooks/useIsSwapUnsupported.ts +++ b/src/hooks/useIsSwapUnsupported.ts @@ -1,4 +1,4 @@ -import { Currency, Token } from '@uniswap/sdk-core' +import { Currency, Token } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' import { useUnsupportedTokens } from './Tokens' diff --git a/src/hooks/usePools.ts b/src/hooks/usePools.ts index 560f9e28b7e..de3f6a56a8c 100644 --- a/src/hooks/usePools.ts +++ b/src/hooks/usePools.ts @@ -1,12 +1,12 @@ -import { computePoolAddress } from '@uniswap/v3-sdk' +import { computePoolAddress } from '@alagunoff/uniswap-v3-sdk' import { V3_CORE_FACTORY_ADDRESSES } from '../constants/addresses' import { IUniswapV3PoolStateInterface } from '../types/v3/IUniswapV3PoolState' -import { Token, Currency } from '@uniswap/sdk-core' +import { Token, Currency } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' import { useActiveWeb3React } from './web3' import { useMultipleContractSingleData } from '../state/multicall/hooks' import { wrappedCurrency } from '../utils/wrappedCurrency' -import { Pool, FeeAmount } from '@uniswap/v3-sdk' +import { Pool, FeeAmount } from '@alagunoff/uniswap-v3-sdk' import { abi as IUniswapV3PoolStateABI } from '@uniswap/v3-core/artifacts/contracts/interfaces/pool/IUniswapV3PoolState.sol/IUniswapV3PoolState.json' import { Interface } from '@ethersproject/abi' diff --git a/src/hooks/useSwapCallback.ts b/src/hooks/useSwapCallback.ts index ce04803ba18..08e913d9fd8 100644 --- a/src/hooks/useSwapCallback.ts +++ b/src/hooks/useSwapCallback.ts @@ -1,7 +1,7 @@ import { BigNumber } from '@ethersproject/bignumber' import { Router, Trade as V2Trade } from '@uniswap/v2-sdk' -import { SwapRouter, Trade as V3Trade } from '@uniswap/v3-sdk' -import { ChainId, Currency, Percent, TradeType } from '@uniswap/sdk-core' +import { SwapRouter, Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' +import { ChainId, Currency, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' import { SWAP_ROUTER_ADDRESSES } from '../constants/addresses' import { calculateGasMargin } from '../utils/calculateGasMargin' diff --git a/src/hooks/useSwapSlippageTolerance.ts b/src/hooks/useSwapSlippageTolerance.ts index f5ad6d2aa2f..096ada492b7 100644 --- a/src/hooks/useSwapSlippageTolerance.ts +++ b/src/hooks/useSwapSlippageTolerance.ts @@ -1,5 +1,5 @@ -import { Currency, Percent, TradeType } from '@uniswap/sdk-core' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Currency, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { useMemo } from 'react' import { useUserSlippageToleranceWithDefault } from '../state/user/hooks' diff --git a/src/hooks/useTickToPrice.ts b/src/hooks/useTickToPrice.ts index e6e5ffdb0e7..9e8d2d42f6d 100644 --- a/src/hooks/useTickToPrice.ts +++ b/src/hooks/useTickToPrice.ts @@ -1,5 +1,5 @@ -import { Token, Price } from '@uniswap/sdk-core' -import { tickToPrice } from '@uniswap/v3-sdk' +import { Token, Price } from '@alagunoff/uniswap-sdk-core' +import { tickToPrice } from '@alagunoff/uniswap-v3-sdk' export function getTickToPrice( baseToken: Token | undefined, diff --git a/src/hooks/useTokenAllowance.ts b/src/hooks/useTokenAllowance.ts index 4e62c36d02e..8808dca356c 100644 --- a/src/hooks/useTokenAllowance.ts +++ b/src/hooks/useTokenAllowance.ts @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' import { useSingleCallResult } from '../state/multicall/hooks' import { useTokenContract } from './useContract' diff --git a/src/hooks/useTotalSupply.ts b/src/hooks/useTotalSupply.ts index f247d5325a4..fb5e1fc736d 100644 --- a/src/hooks/useTotalSupply.ts +++ b/src/hooks/useTotalSupply.ts @@ -1,5 +1,5 @@ import { BigNumber } from '@ethersproject/bignumber' -import { Token, CurrencyAmount, Currency } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, Currency } from '@alagunoff/uniswap-sdk-core' import { useTokenContract } from './useContract' import { useSingleCallResult } from '../state/multicall/hooks' diff --git a/src/hooks/useUSDCPrice.ts b/src/hooks/useUSDCPrice.ts index 33061904fae..8c1c722fe63 100644 --- a/src/hooks/useUSDCPrice.ts +++ b/src/hooks/useUSDCPrice.ts @@ -1,4 +1,4 @@ -import { ChainId, Currency, CurrencyAmount, Price, Token } from '@uniswap/sdk-core' +import { ChainId, Currency, CurrencyAmount, Price, Token } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' import { USDC } from '../constants/tokens' import { useV2TradeExactOut } from './useV2Trade' diff --git a/src/hooks/useV2Pairs.ts b/src/hooks/useV2Pairs.ts index 2bf74e58ea4..d1c505ce43b 100644 --- a/src/hooks/useV2Pairs.ts +++ b/src/hooks/useV2Pairs.ts @@ -5,7 +5,7 @@ import { Interface } from '@ethersproject/abi' import { useActiveWeb3React } from './web3' import { useMultipleContractSingleData } from '../state/multicall/hooks' import { wrappedCurrency } from '../utils/wrappedCurrency' -import { Currency, CurrencyAmount } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' const PAIR_INTERFACE = new Interface(IUniswapV2PairABI) diff --git a/src/hooks/useV2Trade.ts b/src/hooks/useV2Trade.ts index f8a203b2375..ba9243cb2a4 100644 --- a/src/hooks/useV2Trade.ts +++ b/src/hooks/useV2Trade.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, TradeType } from '@alagunoff/uniswap-sdk-core' import { Pair, Trade } from '@uniswap/v2-sdk' import { useMemo } from 'react' import { isTradeBetter } from 'utils/isTradeBetter' diff --git a/src/hooks/useV3PositionFees.ts b/src/hooks/useV3PositionFees.ts index 93b4cdc5ff8..55c2c43f036 100644 --- a/src/hooks/useV3PositionFees.ts +++ b/src/hooks/useV3PositionFees.ts @@ -2,8 +2,8 @@ import { useSingleCallResult } from 'state/multicall/hooks' import { useEffect, useState } from 'react' import { useV3NFTPositionManagerContract } from './useContract' import { BigNumber } from '@ethersproject/bignumber' -import { Pool } from '@uniswap/v3-sdk' -import { CurrencyAmount, Token, currencyEquals, ETHER, Ether } from '@uniswap/sdk-core' +import { Pool } from '@alagunoff/uniswap-v3-sdk' +import { CurrencyAmount, Token, currencyEquals, ETHER, Ether } from '@alagunoff/uniswap-sdk-core' import { useBlockNumber } from 'state/application/hooks' import { unwrappedToken } from 'utils/wrappedCurrency' diff --git a/src/hooks/useV3SwapPools.ts b/src/hooks/useV3SwapPools.ts index 70a4bd5f419..093631538b1 100644 --- a/src/hooks/useV3SwapPools.ts +++ b/src/hooks/useV3SwapPools.ts @@ -1,5 +1,5 @@ -import { Currency, Token } from '@uniswap/sdk-core' -import { FeeAmount, Pool } from '@uniswap/v3-sdk' +import { Currency, Token } from '@alagunoff/uniswap-sdk-core' +import { FeeAmount, Pool } from '@alagunoff/uniswap-v3-sdk' import { useMemo } from 'react' import { useAllCurrencyCombinations } from './useAllCurrencyCombinations' import { PoolState, usePools } from './usePools' diff --git a/src/hooks/useWrapCallback.ts b/src/hooks/useWrapCallback.ts index 5a719f04f81..3a6e10cf987 100644 --- a/src/hooks/useWrapCallback.ts +++ b/src/hooks/useWrapCallback.ts @@ -1,4 +1,4 @@ -import { Currency, currencyEquals, WETH9 } from '@uniswap/sdk-core' +import { Currency, currencyEquals, WETH9 } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' import { tryParseAmount } from '../state/swap/hooks' import { useTransactionAdder } from '../state/transactions/hooks' diff --git a/src/hooks/web3.ts b/src/hooks/web3.ts index b45860bb995..ee4235ed01d 100644 --- a/src/hooks/web3.ts +++ b/src/hooks/web3.ts @@ -1,5 +1,5 @@ import { Web3Provider } from '@ethersproject/providers' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { useWeb3React as useWeb3ReactCore } from '@web3-react/core' import { Web3ReactContextInterface } from '@web3-react/core/dist/types' import { useEffect, useState } from 'react' diff --git a/src/pages/AddLiquidity/PoolPriceBar.tsx b/src/pages/AddLiquidity/PoolPriceBar.tsx index e0465c63cfc..9d3ede0d89f 100644 --- a/src/pages/AddLiquidity/PoolPriceBar.tsx +++ b/src/pages/AddLiquidity/PoolPriceBar.tsx @@ -1,4 +1,4 @@ -import { Currency, Percent, Price } from '@uniswap/sdk-core' +import { Currency, Percent, Price } from '@alagunoff/uniswap-sdk-core' import React, { useContext } from 'react' import { Text } from 'rebass' import { ThemeContext } from 'styled-components' diff --git a/src/pages/AddLiquidity/Review.tsx b/src/pages/AddLiquidity/Review.tsx index 0303303a3b2..4830dcfc38a 100644 --- a/src/pages/AddLiquidity/Review.tsx +++ b/src/pages/AddLiquidity/Review.tsx @@ -3,8 +3,8 @@ import { Field } from '../../state/mint/v3/actions' import { AutoColumn } from 'components/Column' import Card from 'components/Card' import styled from 'styled-components/macro' -import { Currency, CurrencyAmount, Price } from '@uniswap/sdk-core' -import { Position } from '@uniswap/v3-sdk' +import { Currency, CurrencyAmount, Price } from '@alagunoff/uniswap-sdk-core' +import { Position } from '@alagunoff/uniswap-v3-sdk' import { PositionPreview } from 'components/PositionPreview' const Wrapper = styled.div` diff --git a/src/pages/AddLiquidity/index.tsx b/src/pages/AddLiquidity/index.tsx index d06be6db83f..9003ff59a70 100644 --- a/src/pages/AddLiquidity/index.tsx +++ b/src/pages/AddLiquidity/index.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useContext, useMemo, useState } from 'react' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, CurrencyAmount, currencyEquals, Percent } from '@uniswap/sdk-core' -import { WETH9 } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, currencyEquals, Percent } from '@alagunoff/uniswap-sdk-core' +import { WETH9 } from '@alagunoff/uniswap-sdk-core' import { AlertTriangle, AlertCircle } from 'react-feather' import ReactGA from 'react-ga' import { ZERO_PERCENT } from '../../constants/misc' @@ -43,7 +43,7 @@ import { useRangeHopCallbacks, useV3DerivedMintInfo, } from 'state/mint/v3/hooks' -import { FeeAmount, NonfungiblePositionManager } from '@uniswap/v3-sdk' +import { FeeAmount, NonfungiblePositionManager } from '@alagunoff/uniswap-v3-sdk' import { useV3PositionFromTokenId } from 'hooks/useV3Positions' import { useDerivedPositionInfo } from 'hooks/useDerivedPositionInfo' import { PositionPreview } from 'components/PositionPreview' diff --git a/src/pages/AddLiquidity/redirects.tsx b/src/pages/AddLiquidity/redirects.tsx index b3227d2caef..00c5bd9f859 100644 --- a/src/pages/AddLiquidity/redirects.tsx +++ b/src/pages/AddLiquidity/redirects.tsx @@ -2,7 +2,7 @@ import { useActiveWeb3React } from 'hooks/web3' import React from 'react' import { Redirect, RouteComponentProps } from 'react-router-dom' import AddLiquidity from './index' -import { WETH9 } from '@uniswap/sdk-core' +import { WETH9 } from '@alagunoff/uniswap-sdk-core' export function RedirectDuplicateTokenIds( props: RouteComponentProps<{ currencyIdA: string; currencyIdB: string; feeAmount?: string }> diff --git a/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx b/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx index a9cb2bc65f0..aec42eb3d7d 100644 --- a/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx +++ b/src/pages/AddLiquidityV2/ConfirmAddModalBottom.tsx @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Fraction, Percent } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent } from '@alagunoff/uniswap-sdk-core' import React from 'react' import { Text } from 'rebass' import { ButtonPrimary } from '../../components/Button' diff --git a/src/pages/AddLiquidityV2/PoolPriceBar.tsx b/src/pages/AddLiquidityV2/PoolPriceBar.tsx index 2acde3b4920..a1a2bfa81ae 100644 --- a/src/pages/AddLiquidityV2/PoolPriceBar.tsx +++ b/src/pages/AddLiquidityV2/PoolPriceBar.tsx @@ -1,4 +1,4 @@ -import { Currency, Percent, Price } from '@uniswap/sdk-core' +import { Currency, Percent, Price } from '@alagunoff/uniswap-sdk-core' import React, { useContext } from 'react' import { Text } from 'rebass' import { ThemeContext } from 'styled-components' diff --git a/src/pages/AddLiquidityV2/index.tsx b/src/pages/AddLiquidityV2/index.tsx index 112955254d5..e25f6962337 100644 --- a/src/pages/AddLiquidityV2/index.tsx +++ b/src/pages/AddLiquidityV2/index.tsx @@ -1,6 +1,6 @@ import { BigNumber } from '@ethersproject/bignumber' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, CurrencyAmount, currencyEquals, Percent, WETH9 } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, currencyEquals, Percent, WETH9 } from '@alagunoff/uniswap-sdk-core' import React, { useCallback, useContext, useState } from 'react' import { Plus } from 'react-feather' import ReactGA from 'react-ga' diff --git a/src/pages/Earn/Manage.tsx b/src/pages/Earn/Manage.tsx index 537d100a97c..33daa764abe 100644 --- a/src/pages/Earn/Manage.tsx +++ b/src/pages/Earn/Manage.tsx @@ -3,7 +3,7 @@ import { AutoColumn } from '../../components/Column' import styled from 'styled-components/macro' import { Link } from 'react-router-dom' import JSBI from 'jsbi' -import { Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import { RouteComponentProps } from 'react-router-dom' import DoubleCurrencyLogo from '../../components/DoubleLogo' import { useCurrency } from '../../hooks/Tokens' diff --git a/src/pages/MigrateV2/MigrateV2Pair.tsx b/src/pages/MigrateV2/MigrateV2Pair.tsx index 1cc028e209d..9d7d4f9fb8f 100644 --- a/src/pages/MigrateV2/MigrateV2Pair.tsx +++ b/src/pages/MigrateV2/MigrateV2Pair.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import React, { useCallback, useMemo, useState, useEffect } from 'react' -import { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '@uniswap/sdk-core' +import { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '@alagunoff/uniswap-sdk-core' import { FACTORY_ADDRESS } from '@uniswap/v2-sdk' import { Redirect, RouteComponentProps } from 'react-router' import { Text } from 'rebass' @@ -21,7 +21,7 @@ import { calculateGasMargin } from '../../utils/calculateGasMargin' import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink' import { BodyWrapper } from '../AppBody' import { PoolState, usePool } from 'hooks/usePools' -import { FeeAmount, Pool, Position, priceToClosestTick, TickMath } from '@uniswap/v3-sdk' +import { FeeAmount, Pool, Position, priceToClosestTick, TickMath } from '@alagunoff/uniswap-v3-sdk' import { BlueCard, DarkGreyCard, LightCard, YellowCard } from 'components/Card' import { ApprovalState, useApproveCallback } from 'hooks/useApproveCallback' import { Dots } from 'components/swap/styleds' diff --git a/src/pages/MigrateV2/index.tsx b/src/pages/MigrateV2/index.tsx index c4708add488..1403f812c3c 100644 --- a/src/pages/MigrateV2/index.tsx +++ b/src/pages/MigrateV2/index.tsx @@ -1,6 +1,6 @@ import React, { useContext, useMemo } from 'react' import { Pair } from '@uniswap/v2-sdk' -import { Token, ChainId } from '@uniswap/sdk-core' +import { Token, ChainId } from '@alagunoff/uniswap-sdk-core' import { ThemeContext } from 'styled-components' import { AutoColumn } from '../../components/Column' import { AutoRow } from '../../components/Row' diff --git a/src/pages/Pool/PositionPage.tsx b/src/pages/Pool/PositionPage.tsx index 3eec74bb27c..c5a5f5d22db 100644 --- a/src/pages/Pool/PositionPage.tsx +++ b/src/pages/Pool/PositionPage.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useMemo, useRef, useState } from 'react' -import { NonfungiblePositionManager, Pool, Position } from '@uniswap/v3-sdk' +import { NonfungiblePositionManager, Pool, Position } from '@alagunoff/uniswap-v3-sdk' import { PoolState, usePool } from 'hooks/usePools' import { useToken } from 'hooks/Tokens' @@ -34,7 +34,7 @@ import { Ether, currencyEquals, ETHER, -} from '@uniswap/sdk-core' +} from '@alagunoff/uniswap-sdk-core' import { useActiveWeb3React } from 'hooks/web3' import { useV3NFTPositionManagerContract } from 'hooks/useContract' import { useIsTransactionPending, useTransactionAdder } from 'state/transactions/hooks' diff --git a/src/pages/PoolFinder/index.tsx b/src/pages/PoolFinder/index.tsx index d9bd7a51661..636c6030b18 100644 --- a/src/pages/PoolFinder/index.tsx +++ b/src/pages/PoolFinder/index.tsx @@ -1,4 +1,4 @@ -import { Currency, ETHER, CurrencyAmount, Token } from '@uniswap/sdk-core' +import { Currency, ETHER, CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' import React, { useCallback, useEffect, useState } from 'react' import { Plus } from 'react-feather' diff --git a/src/pages/RemoveLiquidity/V3.tsx b/src/pages/RemoveLiquidity/V3.tsx index 7efbe3f24bd..a0e601d3545 100644 --- a/src/pages/RemoveLiquidity/V3.tsx +++ b/src/pages/RemoveLiquidity/V3.tsx @@ -22,13 +22,13 @@ import ReactGA from 'react-ga' import { useActiveWeb3React } from 'hooks/web3' import { TransactionResponse } from '@ethersproject/providers' import { useTransactionAdder } from 'state/transactions/hooks' -import { Percent, currencyEquals, Token, ETHER } from '@uniswap/sdk-core' +import { Percent, currencyEquals, Token, ETHER } from '@alagunoff/uniswap-sdk-core' import { TYPE } from 'theme' import { Wrapper, SmallMaxButton, ResponsiveHeaderText } from './styled' import Loader from 'components/Loader' import DoubleCurrencyLogo from 'components/DoubleLogo' import { Break } from 'components/earn/styled' -import { NonfungiblePositionManager } from '@uniswap/v3-sdk' +import { NonfungiblePositionManager } from '@alagunoff/uniswap-v3-sdk' import useTheme from 'hooks/useTheme' import { AddRemoveTabs } from 'components/NavigationTabs' import RangeBadge from 'components/Badge/RangeBadge' diff --git a/src/pages/RemoveLiquidity/index.tsx b/src/pages/RemoveLiquidity/index.tsx index fa9b6f8c347..25204708f5c 100644 --- a/src/pages/RemoveLiquidity/index.tsx +++ b/src/pages/RemoveLiquidity/index.tsx @@ -1,6 +1,6 @@ import { Contract } from '@ethersproject/contracts' import { TransactionResponse } from '@ethersproject/providers' -import { Currency, currencyEquals, Percent, WETH9 } from '@uniswap/sdk-core' +import { Currency, currencyEquals, Percent, WETH9 } from '@alagunoff/uniswap-sdk-core' import React, { useCallback, useContext, useMemo, useState } from 'react' import { ArrowDown, Plus } from 'react-feather' import ReactGA from 'react-ga' diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index be078b864d7..6203a8356d9 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -1,6 +1,6 @@ -import { Currency, CurrencyAmount, Token, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Token, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { AdvancedSwapDetails } from 'components/swap/AdvancedSwapDetails' import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter' import { MouseoverTooltip, MouseoverTooltipContent } from 'components/Tooltip' diff --git a/src/pages/Vote/VotePage.tsx b/src/pages/Vote/VotePage.tsx index 429eecb8855..0c34d728f4b 100644 --- a/src/pages/Vote/VotePage.tsx +++ b/src/pages/Vote/VotePage.tsx @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import { BigNumber } from 'ethers' import useCurrentBlockTimestamp from 'hooks/useCurrentBlockTimestamp' import JSBI from 'jsbi' diff --git a/src/pages/Vote/index.tsx b/src/pages/Vote/index.tsx index 782f4fd6331..6c4308aaa8a 100644 --- a/src/pages/Vote/index.tsx +++ b/src/pages/Vote/index.tsx @@ -22,7 +22,7 @@ import DelegateModal from '../../components/vote/DelegateModal' import { useTokenBalance } from '../../state/wallet/hooks' import { useActiveWeb3React } from '../../hooks/web3' import { ZERO_ADDRESS } from '../../constants/misc' -import { Token, CurrencyAmount, ChainId } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, ChainId } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' import { shortenAddress } from '../../utils' import Loader from '../../components/Loader' diff --git a/src/state/application/reducer.test.ts b/src/state/application/reducer.test.ts index 51bed65dbf9..0a72c41e3fa 100644 --- a/src/state/application/reducer.test.ts +++ b/src/state/application/reducer.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { createStore, Store } from 'redux' import { addPopup, ApplicationModal, removePopup, setOpenModal, updateBlockNumber } from './actions' import reducer, { ApplicationState } from './reducer' diff --git a/src/state/application/reducer.ts b/src/state/application/reducer.ts index 7543f1e901e..2f324df1dbe 100644 --- a/src/state/application/reducer.ts +++ b/src/state/application/reducer.ts @@ -1,6 +1,6 @@ import { createReducer, nanoid } from '@reduxjs/toolkit' import { addPopup, PopupContent, removePopup, updateBlockNumber, ApplicationModal, setOpenModal } from './actions' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' type PopupList = Array<{ key: string; show: boolean; content: PopupContent; removeAfterMs: number | null }> diff --git a/src/state/burn/hooks.ts b/src/state/burn/hooks.ts index 6da54033cfd..95f2d4dc5e4 100644 --- a/src/state/burn/hooks.ts +++ b/src/state/burn/hooks.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Token, Currency, Percent, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, Currency, Percent, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import { Pair } from '@uniswap/v2-sdk' import { useCallback } from 'react' import { useDispatch, useSelector } from 'react-redux' diff --git a/src/state/burn/v3/hooks.ts b/src/state/burn/v3/hooks.ts index 30749820dfe..6657e630ec3 100644 --- a/src/state/burn/v3/hooks.ts +++ b/src/state/burn/v3/hooks.ts @@ -1,5 +1,5 @@ -import { Token, CurrencyAmount, Percent, Ether, currencyEquals, ETHER } from '@uniswap/sdk-core' -import { Position } from '@uniswap/v3-sdk' +import { Token, CurrencyAmount, Percent, Ether, currencyEquals, ETHER } from '@alagunoff/uniswap-sdk-core' +import { Position } from '@alagunoff/uniswap-v3-sdk' import { usePool } from 'hooks/usePools' import { useActiveWeb3React } from 'hooks/web3' import { useToken } from 'hooks/Tokens' diff --git a/src/state/claim/hooks.ts b/src/state/claim/hooks.ts index 027d473023b..9736101f682 100644 --- a/src/state/claim/hooks.ts +++ b/src/state/claim/hooks.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { CurrencyAmount, ChainId, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, ChainId, Token } from '@alagunoff/uniswap-sdk-core' import { TransactionResponse } from '@ethersproject/providers' import { useEffect, useState } from 'react' import { UNI } from '../../constants/tokens' diff --git a/src/state/governance/hooks.ts b/src/state/governance/hooks.ts index 7f37630bcf6..4d17b70fa3f 100644 --- a/src/state/governance/hooks.ts +++ b/src/state/governance/hooks.ts @@ -1,4 +1,4 @@ -import { CurrencyAmount, Token } from '@uniswap/sdk-core' +import { CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' import { isAddress } from 'ethers/lib/utils' import { PROPOSAL_DESCRIPTION_TEXT } from '../../constants/proposals' import { UNI } from '../../constants/tokens' diff --git a/src/state/lists/actions.ts b/src/state/lists/actions.ts index 6f9d9e1eb37..dc458bbf34b 100644 --- a/src/state/lists/actions.ts +++ b/src/state/lists/actions.ts @@ -1,6 +1,6 @@ import { ActionCreatorWithPayload, createAction } from '@reduxjs/toolkit' import { TokenList, Version } from '@uniswap/token-lists' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' export const fetchTokenList: Readonly<{ pending: ActionCreatorWithPayload<{ url: string; requestId: string }> diff --git a/src/state/lists/hooks.ts b/src/state/lists/hooks.ts index 522d61ecaf3..8d6675f9918 100644 --- a/src/state/lists/hooks.ts +++ b/src/state/lists/hooks.ts @@ -1,5 +1,5 @@ import DEFAULT_TOKEN_LIST from '../../constants/tokenLists/uniswap-default.tokenlist.json' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { TokenList } from '@uniswap/token-lists' import { useMemo } from 'react' import { useSelector } from 'react-redux' diff --git a/src/state/lists/reducer.test.ts b/src/state/lists/reducer.test.ts index 216dbde55d3..8f24272b460 100644 --- a/src/state/lists/reducer.test.ts +++ b/src/state/lists/reducer.test.ts @@ -4,7 +4,7 @@ import { DEFAULT_LIST_OF_LISTS } from '../../constants/lists' import { updateVersion } from '../global/actions' import { fetchTokenList, acceptListUpdate, addList, removeList, enableList } from './actions' import reducer, { ListsState } from './reducer' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' const STUB_TOKEN_LIST = { name: '', diff --git a/src/state/lists/reducer.ts b/src/state/lists/reducer.ts index 7015219841f..e65d27a152f 100644 --- a/src/state/lists/reducer.ts +++ b/src/state/lists/reducer.ts @@ -5,7 +5,7 @@ import { TokenList } from '@uniswap/token-lists/dist/types' import { DEFAULT_LIST_OF_LISTS } from '../../constants/lists' import { updateVersion } from '../global/actions' import { acceptListUpdate, addList, fetchTokenList, removeList, enableList, disableList } from './actions' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' export interface ListsState { readonly byUrl: { diff --git a/src/state/lists/updater.ts b/src/state/lists/updater.ts index debd7dc627f..2b505a765de 100644 --- a/src/state/lists/updater.ts +++ b/src/state/lists/updater.ts @@ -10,7 +10,7 @@ import { AppDispatch } from '../index' import { acceptListUpdate } from './actions' import { useActiveListUrls } from './hooks' import { UNSUPPORTED_LIST_URLS } from 'constants/lists' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' export default function Updater(): null { const { library } = useActiveWeb3React() diff --git a/src/state/lists/wrappedTokenInfo.ts b/src/state/lists/wrappedTokenInfo.ts index 8d7a1d0f1c9..931a844b888 100644 --- a/src/state/lists/wrappedTokenInfo.ts +++ b/src/state/lists/wrappedTokenInfo.ts @@ -1,4 +1,4 @@ -import { ChainId, Token } from '@uniswap/sdk-core' +import { ChainId, Token } from '@alagunoff/uniswap-sdk-core' import { Tags, TokenInfo } from '@uniswap/token-lists' import { TokenList } from '@uniswap/token-lists/dist/types' import { isAddress } from '../../utils' diff --git a/src/state/mint/hooks.ts b/src/state/mint/hooks.ts index 233a44599a2..82862018abb 100644 --- a/src/state/mint/hooks.ts +++ b/src/state/mint/hooks.ts @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from 'react-redux' import { AppDispatch, AppState } from '../index' import { Field, typeInput } from './actions' import { Pair } from '@uniswap/v2-sdk' -import { Currency, Token, Percent, Price, CurrencyAmount } from '@uniswap/sdk-core' +import { Currency, Token, Percent, Price, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' import { PairState, useV2Pair } from '../../hooks/useV2Pairs' import { useTotalSupply } from '../../hooks/useTotalSupply' diff --git a/src/state/mint/v3/hooks.ts b/src/state/mint/v3/hooks.ts index 62c23c6ddcc..c51d6d97683 100644 --- a/src/state/mint/v3/hooks.ts +++ b/src/state/mint/v3/hooks.ts @@ -11,8 +11,8 @@ import { tickToPrice, TICK_SPACINGS, encodeSqrtRatioX96, -} from '@uniswap/v3-sdk/dist/' -import { Currency, Token, CurrencyAmount, currencyEquals, Price, Rounding } from '@uniswap/sdk-core' +} from '@alagunoff/uniswap-v3-sdk/dist/' +import { Currency, Token, CurrencyAmount, currencyEquals, Price, Rounding } from '@alagunoff/uniswap-sdk-core' import { useCallback, useMemo } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useActiveWeb3React } from '../../../hooks/web3' diff --git a/src/state/mint/v3/utils.ts b/src/state/mint/v3/utils.ts index 8c5669879fe..7ca30cb2e45 100644 --- a/src/state/mint/v3/utils.ts +++ b/src/state/mint/v3/utils.ts @@ -5,8 +5,8 @@ import { TICK_SPACINGS, encodeSqrtRatioX96, TickMath, -} from '@uniswap/v3-sdk/dist/' -import { Price, Token } from '@uniswap/sdk-core' +} from '@alagunoff/uniswap-v3-sdk/dist/' +import { Price, Token } from '@alagunoff/uniswap-sdk-core' import { tryParseAmount } from 'state/swap/hooks' import JSBI from 'jsbi' diff --git a/src/state/stake/hooks.ts b/src/state/stake/hooks.ts index f73d12be0b2..49e295f523a 100644 --- a/src/state/stake/hooks.ts +++ b/src/state/stake/hooks.ts @@ -1,4 +1,4 @@ -import { ChainId, Token, CurrencyAmount, WETH9 } from '@uniswap/sdk-core' +import { ChainId, Token, CurrencyAmount, WETH9 } from '@alagunoff/uniswap-sdk-core' import { Pair } from '@uniswap/v2-sdk' import JSBI from 'jsbi' import { useMemo } from 'react' diff --git a/src/state/swap/hooks.ts b/src/state/swap/hooks.ts index 855bc250e66..c76b25d812e 100644 --- a/src/state/swap/hooks.ts +++ b/src/state/swap/hooks.ts @@ -1,9 +1,9 @@ import JSBI from 'jsbi' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { useBestV3TradeExactIn, useBestV3TradeExactOut, V3TradeState } from '../../hooks/useBestV3Trade' import useENS from '../../hooks/useENS' import { parseUnits } from '@ethersproject/units' -import { Currency, CurrencyAmount, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' import { ParsedQs } from 'qs' import { useCallback, useEffect, useState } from 'react' diff --git a/src/state/transactions/actions.ts b/src/state/transactions/actions.ts index b56b712e3fb..94f0f588ace 100644 --- a/src/state/transactions/actions.ts +++ b/src/state/transactions/actions.ts @@ -1,5 +1,5 @@ import { createAction } from '@reduxjs/toolkit' -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' export interface SerializableTransactionReceipt { to: string diff --git a/src/state/transactions/reducer.test.ts b/src/state/transactions/reducer.test.ts index 8914b83db58..f954dbea535 100644 --- a/src/state/transactions/reducer.test.ts +++ b/src/state/transactions/reducer.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { createStore, Store } from 'redux' import { addTransaction, checkedTransaction, clearAllTransactions, finalizeTransaction } from './actions' import reducer, { initialState, TransactionState } from './reducer' diff --git a/src/state/user/hooks.tsx b/src/state/user/hooks.tsx index a2217ef0b8c..5ce87b95f51 100644 --- a/src/state/user/hooks.tsx +++ b/src/state/user/hooks.tsx @@ -1,4 +1,4 @@ -import { ChainId, Percent, Token } from '@uniswap/sdk-core' +import { ChainId, Percent, Token } from '@alagunoff/uniswap-sdk-core' import { Pair } from '@uniswap/v2-sdk' import JSBI from 'jsbi' import flatMap from 'lodash.flatmap' diff --git a/src/state/wallet/hooks.ts b/src/state/wallet/hooks.ts index 93537db6947..34f73a2d6f3 100644 --- a/src/state/wallet/hooks.ts +++ b/src/state/wallet/hooks.ts @@ -1,4 +1,4 @@ -import { Currency, Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Currency, Token, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' import { useMemo } from 'react' import { UNI } from '../../constants/tokens' diff --git a/src/utils/calculateSlippageAmount.test.ts b/src/utils/calculateSlippageAmount.test.ts index e8245260892..30ee782fda2 100644 --- a/src/utils/calculateSlippageAmount.test.ts +++ b/src/utils/calculateSlippageAmount.test.ts @@ -1,5 +1,5 @@ import { AddressZero } from '@ethersproject/constants' -import { ChainId, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' +import { ChainId, CurrencyAmount, Percent, Token } from '@alagunoff/uniswap-sdk-core' import { calculateSlippageAmount } from './calculateSlippageAmount' describe('#calculateSlippageAmount', () => { diff --git a/src/utils/calculateSlippageAmount.ts b/src/utils/calculateSlippageAmount.ts index 9dd5fbadb86..75f4a879f3f 100644 --- a/src/utils/calculateSlippageAmount.ts +++ b/src/utils/calculateSlippageAmount.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount, Fraction, Percent } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' const ONE = new Fraction(1, 1) diff --git a/src/utils/computeFiatValuePriceImpact.tsx b/src/utils/computeFiatValuePriceImpact.tsx index f4206253c51..6e1334b6f6c 100644 --- a/src/utils/computeFiatValuePriceImpact.tsx +++ b/src/utils/computeFiatValuePriceImpact.tsx @@ -1,4 +1,4 @@ -import { Token, CurrencyAmount, currencyEquals, Percent } from '@uniswap/sdk-core' +import { Token, CurrencyAmount, currencyEquals, Percent } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' import { ONE_HUNDRED_PERCENT } from '../constants/misc' diff --git a/src/utils/computeUniCirculation.test.ts b/src/utils/computeUniCirculation.test.ts index 6cc5cbb07b1..3c9a44b01fb 100644 --- a/src/utils/computeUniCirculation.test.ts +++ b/src/utils/computeUniCirculation.test.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { ChainId, Token, CurrencyAmount } from '@uniswap/sdk-core' +import { ChainId, Token, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import { BigNumber } from 'ethers' import { ZERO_ADDRESS } from '../constants/misc' import { computeUniCirculation } from './computeUniCirculation' diff --git a/src/utils/computeUniCirculation.ts b/src/utils/computeUniCirculation.ts index c669887e74c..c5e82aaaad8 100644 --- a/src/utils/computeUniCirculation.ts +++ b/src/utils/computeUniCirculation.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { Token, CurrencyAmount } from '@uniswap/sdk-core' +import { Token, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import { BigNumber } from 'ethers' import { STAKING_GENESIS } from '../state/stake/hooks' diff --git a/src/utils/constructSameAddressMap.ts b/src/utils/constructSameAddressMap.ts index 7df238f5cbf..965ed203790 100644 --- a/src/utils/constructSameAddressMap.ts +++ b/src/utils/constructSameAddressMap.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' export function constructSameAddressMap( address: T, diff --git a/src/utils/currencyId.ts b/src/utils/currencyId.ts index c35e8b9a181..05a47369839 100644 --- a/src/utils/currencyId.ts +++ b/src/utils/currencyId.ts @@ -1,4 +1,4 @@ -import { Currency } from '@uniswap/sdk-core' +import { Currency } from '@alagunoff/uniswap-sdk-core' export function currencyId(currency: Currency): string { if (currency.isEther) return 'ETH' diff --git a/src/utils/formatTokenAmount.ts b/src/utils/formatTokenAmount.ts index 5a3b0daab6c..38c705b992e 100644 --- a/src/utils/formatTokenAmount.ts +++ b/src/utils/formatTokenAmount.ts @@ -1,4 +1,4 @@ -import { Price, CurrencyAmount, Currency, Fraction } from '@uniswap/sdk-core' +import { Price, CurrencyAmount, Currency, Fraction } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' export function formatTokenAmount(amount: CurrencyAmount | undefined, sigFigs: number) { diff --git a/src/utils/getExplorerLink.test.ts b/src/utils/getExplorerLink.test.ts index 33f785830b6..1da7cfccf2b 100644 --- a/src/utils/getExplorerLink.test.ts +++ b/src/utils/getExplorerLink.test.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { ExplorerDataType, getExplorerLink } from './getExplorerLink' describe('#getExplorerLink', () => { diff --git a/src/utils/getExplorerLink.ts b/src/utils/getExplorerLink.ts index 76038f88aee..2a85caf6a39 100644 --- a/src/utils/getExplorerLink.ts +++ b/src/utils/getExplorerLink.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' const CHAIN_ID_TO_PREFIX: { [chainId in ChainId]: string } = { 1: 'https://etherscan.io', diff --git a/src/utils/getTickToPrice.ts b/src/utils/getTickToPrice.ts index 68494e99822..c3e28cf451f 100644 --- a/src/utils/getTickToPrice.ts +++ b/src/utils/getTickToPrice.ts @@ -1,5 +1,5 @@ -import { Token, Price } from '@uniswap/sdk-core' -import { tickToPrice } from '@uniswap/v3-sdk' +import { Token, Price } from '@alagunoff/uniswap-sdk-core' +import { tickToPrice } from '@alagunoff/uniswap-v3-sdk' export function getTickToPrice(baseToken?: Token, quoteToken?: Token, tick?: number): Price | undefined { if (!baseToken || !quoteToken || typeof tick !== 'number') { diff --git a/src/utils/getTradeVersion.ts b/src/utils/getTradeVersion.ts index 059762692d4..ba1093e52ec 100644 --- a/src/utils/getTradeVersion.ts +++ b/src/utils/getTradeVersion.ts @@ -1,6 +1,6 @@ -import { Currency, TradeType } from '@uniswap/sdk-core' +import { Currency, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { Version } from '../hooks/useToggledVersion' export function getTradeVersion( diff --git a/src/utils/index.ts b/src/utils/index.ts index b9bde0d3078..9a8395b46e3 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -2,8 +2,8 @@ import { getAddress } from '@ethersproject/address' import { AddressZero } from '@ethersproject/constants' import { Contract } from '@ethersproject/contracts' import { JsonRpcSigner, Web3Provider } from '@ethersproject/providers' -import { ChainId, Token } from '@uniswap/sdk-core' -import { FeeAmount } from '@uniswap/v3-sdk/dist/' +import { ChainId, Token } from '@alagunoff/uniswap-sdk-core' +import { FeeAmount } from '@alagunoff/uniswap-v3-sdk/dist/' import { TokenAddressMap } from '../state/lists/hooks' // returns the checksummed address if the address is valid, otherwise returns false diff --git a/src/utils/isTradeBetter.ts b/src/utils/isTradeBetter.ts index c90e5ac5f41..5c9adc182e1 100644 --- a/src/utils/isTradeBetter.ts +++ b/src/utils/isTradeBetter.ts @@ -1,7 +1,7 @@ import { ZERO_PERCENT, ONE_HUNDRED_PERCENT } from '../constants/misc' -import { Percent, currencyEquals, Currency, TradeType } from '@uniswap/sdk-core' +import { Percent, currencyEquals, Currency, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' // returns whether tradeB is better than tradeA by at least a threshold percentage amount export function isTradeBetter( diff --git a/src/utils/maxAmountSpend.ts b/src/utils/maxAmountSpend.ts index 2e7c0555f38..7b95aceeecf 100644 --- a/src/utils/maxAmountSpend.ts +++ b/src/utils/maxAmountSpend.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyAmount } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' import { MIN_ETH } from '../constants/misc' diff --git a/src/utils/prices.test.ts b/src/utils/prices.test.ts index 9063a13b3ca..34cc463eb1c 100644 --- a/src/utils/prices.test.ts +++ b/src/utils/prices.test.ts @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import { ChainId, Percent, Token, CurrencyAmount, TradeType } from '@uniswap/sdk-core' +import { ChainId, Percent, Token, CurrencyAmount, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade, Pair, Route } from '@uniswap/v2-sdk' import { computeRealizedLPFeeAmount, warningSeverity } from './prices' diff --git a/src/utils/prices.ts b/src/utils/prices.ts index c5ca96442c8..3dabc1e3d8c 100644 --- a/src/utils/prices.ts +++ b/src/utils/prices.ts @@ -1,7 +1,7 @@ import JSBI from 'jsbi' -import { Currency, CurrencyAmount, Fraction, Percent, TradeType } from '@uniswap/sdk-core' +import { Currency, CurrencyAmount, Fraction, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@uniswap/v2-sdk' -import { Trade as V3Trade } from '@uniswap/v3-sdk' +import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { ALLOWED_PRICE_IMPACT_HIGH, ALLOWED_PRICE_IMPACT_LOW, diff --git a/src/utils/supportedChainId.ts b/src/utils/supportedChainId.ts index 5d9aefce0c7..d858f07654f 100644 --- a/src/utils/supportedChainId.ts +++ b/src/utils/supportedChainId.ts @@ -1,4 +1,4 @@ -import { ChainId } from '@uniswap/sdk-core' +import { ChainId } from '@alagunoff/uniswap-sdk-core' /** * Returns the input chain ID if chain is supported. If not, return undefined diff --git a/src/utils/wrappedCurrency.ts b/src/utils/wrappedCurrency.ts index fda3d0ef181..d7cb5053cfa 100644 --- a/src/utils/wrappedCurrency.ts +++ b/src/utils/wrappedCurrency.ts @@ -7,7 +7,7 @@ import { wrappedCurrency as wrappedCurrencyInternal, wrappedCurrencyAmount as wrappedCurrencyAmountInternal, WETH9, -} from '@uniswap/sdk-core' +} from '@alagunoff/uniswap-sdk-core' import { supportedChainId } from './supportedChainId' export function wrappedCurrency(currency: Currency | undefined, chainId: ChainId | undefined): Token | undefined { From 123e5e0bd94c09169872c32aa86decadef5153e7 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Sat, 28 Dec 2024 12:53:35 +0300 Subject: [PATCH 27/30] chore: update dependencies --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 310c6e28e31..d2931360ded 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@uniswap/v2-sdk": "3.0.0-alpha.0", "@uniswap/v3-core": "1.0.0", "@uniswap/v3-periphery": "1.0.0", - "@alagunoff/uniswap-v3-sdk": "3.0.0", + "@alagunoff/uniswap-v3-sdk": "3.0.1", "@web3-react/core": "^6.0.9", "@web3-react/fortmatic-connector": "^6.0.9", "@web3-react/injected-connector": "^6.0.7", diff --git a/yarn.lock b/yarn.lock index 9d884208310..8662e6b5f8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,10 +14,10 @@ tiny-invariant "1.1.0" toformat "2.0.0" -"@alagunoff/uniswap-v3-sdk@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@alagunoff/uniswap-v3-sdk/-/uniswap-v3-sdk-3.0.0.tgz#8e93f288e2af6c179397cfde70efe49717dfa8d9" - integrity sha512-JGyxjBN8sHuLY1EGQLlqk7RaNxwyXm2keRJNega/mBQSVwxDQSvhLabDNRAJm5+D0TYm7Vv9TgSiGTn3xKiWGA== +"@alagunoff/uniswap-v3-sdk@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@alagunoff/uniswap-v3-sdk/-/uniswap-v3-sdk-3.0.1.tgz#650b905fcf8def4e7a459224e6ebc132130c2873" + integrity sha512-ZloqdbKBhQQk/9PrfmUTBPLCCvMYR7vnLpNmnFLuCXbU42iLzFc3rebe0GCfv525Hzhx76CBXWey2DPeI5PMUw== dependencies: "@alagunoff/uniswap-sdk-core" "3.0.0" "@ethersproject/abi" "5.0.12" From b51bcc1304cc4d5df03fb4f5164e64909ee18bdf Mon Sep 17 00:00:00 2001 From: alagunoff Date: Sat, 28 Dec 2024 12:54:06 +0300 Subject: [PATCH 28/30] feat: pass pool init code hash to computePoolAddress function --- src/constants/addresses.ts | 19 +++++++++++++------ src/hooks/usePools.ts | 10 ++++++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 0df68b4b6b9..d9a9ddf2913 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -1,5 +1,4 @@ import { ChainId } from '@alagunoff/uniswap-sdk-core' -import { FACTORY_ADDRESS as V3_FACTORY_ADDRESS } from '@alagunoff/uniswap-v3-sdk' import { constructSameAddressMap } from '../utils/constructSameAddressMap' export const UNI_ADDRESS = constructSameAddressMap('0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984') @@ -21,13 +20,21 @@ export const ARGENT_WALLET_DETECTOR_ADDRESS: { [chainId in ChainId]?: string } = [ChainId.MAINNET]: '0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8', } export const V3_CORE_FACTORY_ADDRESSES = { - [ChainId.MAINNET]: V3_FACTORY_ADDRESS, - [ChainId.ROPSTEN]: V3_FACTORY_ADDRESS, - [ChainId.RINKEBY]: V3_FACTORY_ADDRESS, - [ChainId.GÖRLI]: V3_FACTORY_ADDRESS, - [ChainId.KOVAN]: V3_FACTORY_ADDRESS, + [ChainId.MAINNET]: '0x1F98431c8aD98523631AE4a59f267346ea31F984', + [ChainId.ROPSTEN]: '0x1F98431c8aD98523631AE4a59f267346ea31F984', + [ChainId.RINKEBY]: '0x1F98431c8aD98523631AE4a59f267346ea31F984', + [ChainId.GÖRLI]: '0x1F98431c8aD98523631AE4a59f267346ea31F984', + [ChainId.KOVAN]: '0x1F98431c8aD98523631AE4a59f267346ea31F984', [ChainId.POLYGON_AMOY]: '0x8fa8F86d4339afdC0A1911E8C8b22bF096DBeC65', } +export const POOL_INIT_CODE_HASHES = { + [ChainId.MAINNET]: '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54', + [ChainId.ROPSTEN]: '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54', + [ChainId.RINKEBY]: '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54', + [ChainId.GÖRLI]: '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54', + [ChainId.KOVAN]: '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54', + [ChainId.POLYGON_AMOY]: '0x5cbb8bb02cda6c7c4793e82230914ebc54ed194586a4670cff86a5883f4616b1', +} export const QUOTER_ADDRESSES = { [ChainId.MAINNET]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', [ChainId.ROPSTEN]: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6', diff --git a/src/hooks/usePools.ts b/src/hooks/usePools.ts index de3f6a56a8c..8b455df3762 100644 --- a/src/hooks/usePools.ts +++ b/src/hooks/usePools.ts @@ -1,5 +1,5 @@ import { computePoolAddress } from '@alagunoff/uniswap-v3-sdk' -import { V3_CORE_FACTORY_ADDRESSES } from '../constants/addresses' +import { V3_CORE_FACTORY_ADDRESSES, POOL_INIT_CODE_HASHES } from '../constants/addresses' import { IUniswapV3PoolStateInterface } from '../types/v3/IUniswapV3PoolState' import { Token, Currency } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' @@ -37,15 +37,17 @@ export function usePools( }, [chainId, poolKeys]) const poolAddresses: (string | undefined)[] = useMemo(() => { - const v3CoreFactoryAddress = chainId && V3_CORE_FACTORY_ADDRESSES[chainId] + const factoryAddress = chainId && V3_CORE_FACTORY_ADDRESSES[chainId] + const poolInitCodeHash = chainId && POOL_INIT_CODE_HASHES[chainId] return transformed.map((value) => { - if (!v3CoreFactoryAddress || !value) return undefined + if (!factoryAddress || !poolInitCodeHash || !value) return undefined return computePoolAddress({ - factoryAddress: v3CoreFactoryAddress, + factoryAddress, tokenA: value[0], tokenB: value[1], fee: value[2], + poolInitCodeHash, }) }) }, [chainId, transformed]) From 4eef07120a10306f1c0947456fe0ac5c2cc38a10 Mon Sep 17 00:00:00 2001 From: alagunoff Date: Sat, 28 Dec 2024 14:27:48 +0300 Subject: [PATCH 29/30] feat: use custom version of uniswap v2 sdk --- package.json | 4 +- src/components/CurrencyInputPanel/index.tsx | 2 +- src/components/PositionCard/V2.tsx | 2 +- src/components/PositionCard/index.tsx | 2 +- src/components/earn/StakingModal.tsx | 19 +++-- src/components/swap/AdvancedSwapDetails.tsx | 2 +- src/components/swap/ConfirmSwapModal.tsx | 2 +- src/components/swap/SwapModalFooter.tsx | 2 +- src/components/swap/SwapModalHeader.tsx | 2 +- src/components/swap/SwapRoute.tsx | 2 +- src/constants/addresses.ts | 16 +++++ src/hooks/useApproveCallback.ts | 2 +- src/hooks/useERC20Permit.ts | 2 +- src/hooks/useSwapCallback.ts | 2 +- src/hooks/useSwapSlippageTolerance.ts | 2 +- src/hooks/useV2Pairs.ts | 26 +++++-- src/hooks/useV2Trade.ts | 70 ++++++++++++++---- src/pages/MigrateV2/MigrateV2Pair.tsx | 7 +- src/pages/MigrateV2/index.tsx | 33 +++++---- src/pages/Pool/v2.tsx | 22 ++++-- src/pages/Swap/index.tsx | 2 +- src/state/burn/hooks.ts | 2 +- src/state/lists/wrappedTokenInfo.ts | 1 + src/state/mint/hooks.ts | 2 +- src/state/stake/hooks.ts | 13 +++- src/state/swap/hooks.ts | 2 +- src/state/user/hooks.tsx | 21 +++++- src/utils/calculateGasMargin.test.ts | 9 --- src/utils/calculateSlippageAmount.test.ts | 56 --------------- src/utils/chunkArray.test.ts | 17 ----- src/utils/computeUniCirculation.test.ts | 37 ---------- src/utils/getExplorerLink.test.ts | 25 ------- src/utils/getTradeVersion.ts | 2 +- src/utils/index.test.ts | 43 ----------- src/utils/isTradeBetter.ts | 2 +- src/utils/parseENSAddress.test.ts | 19 ----- src/utils/prices.test.ts | 67 ----------------- src/utils/prices.ts | 2 +- src/utils/retry.test.ts | 66 ----------------- src/utils/uriToHttp.test.ts | 28 -------- yarn.lock | 79 +++++++++++---------- 41 files changed, 234 insertions(+), 482 deletions(-) delete mode 100644 src/utils/calculateGasMargin.test.ts delete mode 100644 src/utils/calculateSlippageAmount.test.ts delete mode 100644 src/utils/chunkArray.test.ts delete mode 100644 src/utils/computeUniCirculation.test.ts delete mode 100644 src/utils/getExplorerLink.test.ts delete mode 100644 src/utils/index.test.ts delete mode 100644 src/utils/parseENSAddress.test.ts delete mode 100644 src/utils/prices.test.ts delete mode 100644 src/utils/retry.test.ts delete mode 100644 src/utils/uriToHttp.test.ts diff --git a/package.json b/package.json index d2931360ded..52291a6fd68 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,10 @@ "@uniswap/token-lists": "^1.0.0-beta.19", "@uniswap/v2-core": "1.0.0", "@uniswap/v2-periphery": "^1.1.0-beta.0", - "@uniswap/v2-sdk": "3.0.0-alpha.0", "@uniswap/v3-core": "1.0.0", "@uniswap/v3-periphery": "1.0.0", "@alagunoff/uniswap-v3-sdk": "3.0.1", + "@alagunoff/uniswap-v2-sdk": "3.0.0", "@web3-react/core": "^6.0.9", "@web3-react/fortmatic-connector": "^6.0.9", "@web3-react/injected-connector": "^6.0.7", @@ -114,7 +114,7 @@ "build": "yarn compile-contract-types && react-scripts build", "postinstall": "yarn compile-contract-types", "start": "yarn compile-contract-types && react-scripts start", - "test": "react-scripts test --env=jsdom" + "typescript:check": "tsc --noEmit" }, "eslintConfig": { "extends": "react-app", diff --git a/src/components/CurrencyInputPanel/index.tsx b/src/components/CurrencyInputPanel/index.tsx index 1a1bfcb1a3d..02c2601d239 100644 --- a/src/components/CurrencyInputPanel/index.tsx +++ b/src/components/CurrencyInputPanel/index.tsx @@ -1,4 +1,4 @@ -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' import { Currency, CurrencyAmount, Percent, Token } from '@alagunoff/uniswap-sdk-core' import React, { useState, useCallback } from 'react' import styled from 'styled-components/macro' diff --git a/src/components/PositionCard/V2.tsx b/src/components/PositionCard/V2.tsx index 31021dd0642..cfdcc931034 100644 --- a/src/components/PositionCard/V2.tsx +++ b/src/components/PositionCard/V2.tsx @@ -1,7 +1,7 @@ import JSBI from 'jsbi' import React, { useState } from 'react' import { Percent, CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' import { ChevronDown, ChevronUp } from 'react-feather' import { Link } from 'react-router-dom' import { Text } from 'rebass' diff --git a/src/components/PositionCard/index.tsx b/src/components/PositionCard/index.tsx index 9279202f10d..8070b40cb99 100644 --- a/src/components/PositionCard/index.tsx +++ b/src/components/PositionCard/index.tsx @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import { Percent, CurrencyAmount, Token } from '@alagunoff/uniswap-sdk-core' -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' import { darken } from 'polished' import React, { useState } from 'react' import { ChevronDown, ChevronUp } from 'react-feather' diff --git a/src/components/earn/StakingModal.tsx b/src/components/earn/StakingModal.tsx index 875fa3f6049..19eadf407c4 100644 --- a/src/components/earn/StakingModal.tsx +++ b/src/components/earn/StakingModal.tsx @@ -1,5 +1,5 @@ import React, { useState, useCallback } from 'react' -import { V2_ROUTER_ADDRESS } from '../../constants/addresses' +import { PAIR_INIT_CODE_HASHES, V2_CORE_FACTORY_ADDRESSES, V2_ROUTER_ADDRESS } from '../../constants/addresses' import { useV2LiquidityTokenPermit } from '../../hooks/useERC20Permit' import useTransactionDeadline from '../../hooks/useTransactionDeadline' import Modal from '../Modal' @@ -10,7 +10,7 @@ import { TYPE, CloseIcon } from '../../theme' import { ButtonConfirmed, ButtonError } from '../Button' import ProgressCircles from '../ProgressSteps' import CurrencyInputPanel from '../CurrencyInputPanel' -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' import { Token, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import { useActiveWeb3React } from '../../hooks/web3' import { maxAmountSpend } from '../../utils/maxAmountSpend' @@ -75,11 +75,16 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui }, [onDismiss]) // pair contract for this token to be staked - const dummyPair = new Pair( - CurrencyAmount.fromRawAmount(stakingInfo.tokens[0], '0'), - CurrencyAmount.fromRawAmount(stakingInfo.tokens[1], '0') - ) - const pairContract = usePairContract(dummyPair.liquidityToken.address) + const dummyPair = + typeof chainId === 'number' + ? new Pair( + V2_CORE_FACTORY_ADDRESSES[chainId], + CurrencyAmount.fromRawAmount(stakingInfo.tokens[0], '0'), + CurrencyAmount.fromRawAmount(stakingInfo.tokens[1], '0'), + PAIR_INIT_CODE_HASHES[chainId] + ) + : undefined + const pairContract = usePairContract(dummyPair?.liquidityToken.address) // approval data for stake const deadline = useTransactionDeadline() diff --git a/src/components/swap/AdvancedSwapDetails.tsx b/src/components/swap/AdvancedSwapDetails.tsx index 7af2189a448..82f40eb7ed3 100644 --- a/src/components/swap/AdvancedSwapDetails.tsx +++ b/src/components/swap/AdvancedSwapDetails.tsx @@ -1,5 +1,5 @@ import { Percent, Currency, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import React, { useContext, useMemo } from 'react' import { ThemeContext } from 'styled-components' diff --git a/src/components/swap/ConfirmSwapModal.tsx b/src/components/swap/ConfirmSwapModal.tsx index ff1956195e8..1b08515fe48 100644 --- a/src/components/swap/ConfirmSwapModal.tsx +++ b/src/components/swap/ConfirmSwapModal.tsx @@ -1,5 +1,5 @@ import { Currency, currencyEquals, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import React, { useCallback, useMemo } from 'react' import TransactionConfirmationModal, { diff --git a/src/components/swap/SwapModalFooter.tsx b/src/components/swap/SwapModalFooter.tsx index 9b23107a393..0f3cc9e6a8c 100644 --- a/src/components/swap/SwapModalFooter.tsx +++ b/src/components/swap/SwapModalFooter.tsx @@ -1,5 +1,5 @@ import { Currency, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import React from 'react' diff --git a/src/components/swap/SwapModalHeader.tsx b/src/components/swap/SwapModalHeader.tsx index 4561d2cd9c9..25151aff7a7 100644 --- a/src/components/swap/SwapModalHeader.tsx +++ b/src/components/swap/SwapModalHeader.tsx @@ -1,5 +1,5 @@ import { Currency, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import React, { useContext, useState } from 'react' import { ArrowDown, AlertTriangle } from 'react-feather' diff --git a/src/components/swap/SwapRoute.tsx b/src/components/swap/SwapRoute.tsx index 0e29a49cea3..6c53922dd93 100644 --- a/src/components/swap/SwapRoute.tsx +++ b/src/components/swap/SwapRoute.tsx @@ -1,5 +1,5 @@ import { Currency, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade, FeeAmount } from '@alagunoff/uniswap-v3-sdk' import React, { Fragment, memo, useContext } from 'react' import { ChevronRight } from 'react-feather' diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index d9a9ddf2913..a485070938c 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -19,6 +19,22 @@ export const MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = { export const ARGENT_WALLET_DETECTOR_ADDRESS: { [chainId in ChainId]?: string } = { [ChainId.MAINNET]: '0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8', } +export const V2_CORE_FACTORY_ADDRESSES = { + [ChainId.MAINNET]: '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f', + [ChainId.ROPSTEN]: '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f', + [ChainId.RINKEBY]: '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f', + [ChainId.GÖRLI]: '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f', + [ChainId.KOVAN]: '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f', + [ChainId.POLYGON_AMOY]: '0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f', +} +export const PAIR_INIT_CODE_HASHES = { + [ChainId.MAINNET]: '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f', + [ChainId.ROPSTEN]: '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f', + [ChainId.RINKEBY]: '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f', + [ChainId.GÖRLI]: '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f', + [ChainId.KOVAN]: '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f', + [ChainId.POLYGON_AMOY]: '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f', +} export const V3_CORE_FACTORY_ADDRESSES = { [ChainId.MAINNET]: '0x1F98431c8aD98523631AE4a59f267346ea31F984', [ChainId.ROPSTEN]: '0x1F98431c8aD98523631AE4a59f267346ea31F984', diff --git a/src/hooks/useApproveCallback.ts b/src/hooks/useApproveCallback.ts index 4c8b9a9e635..71f31e5bff5 100644 --- a/src/hooks/useApproveCallback.ts +++ b/src/hooks/useApproveCallback.ts @@ -1,7 +1,7 @@ import { MaxUint256 } from '@ethersproject/constants' import { TransactionResponse } from '@ethersproject/providers' import { CurrencyAmount, ChainId, Percent, Currency, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { useCallback, useMemo } from 'react' import { SWAP_ROUTER_ADDRESSES, V2_ROUTER_ADDRESS } from '../constants/addresses' diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index 4f20f6a4b86..87bfeafd911 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import { ChainId, Percent, CurrencyAmount, Currency, TradeType, Token } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { splitSignature } from 'ethers/lib/utils' import { useMemo, useState } from 'react' diff --git a/src/hooks/useSwapCallback.ts b/src/hooks/useSwapCallback.ts index 08e913d9fd8..e6e22075ba1 100644 --- a/src/hooks/useSwapCallback.ts +++ b/src/hooks/useSwapCallback.ts @@ -1,5 +1,5 @@ import { BigNumber } from '@ethersproject/bignumber' -import { Router, Trade as V2Trade } from '@uniswap/v2-sdk' +import { Router, Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { SwapRouter, Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { ChainId, Currency, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' import { useMemo } from 'react' diff --git a/src/hooks/useSwapSlippageTolerance.ts b/src/hooks/useSwapSlippageTolerance.ts index 096ada492b7..3f572a6f68b 100644 --- a/src/hooks/useSwapSlippageTolerance.ts +++ b/src/hooks/useSwapSlippageTolerance.ts @@ -1,6 +1,6 @@ import { Currency, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { useMemo } from 'react' import { useUserSlippageToleranceWithDefault } from '../state/user/hooks' diff --git a/src/hooks/useV2Pairs.ts b/src/hooks/useV2Pairs.ts index d1c505ce43b..ee3839213d3 100644 --- a/src/hooks/useV2Pairs.ts +++ b/src/hooks/useV2Pairs.ts @@ -1,4 +1,4 @@ -import { Pair } from '@uniswap/v2-sdk' +import { computePairAddress, Pair } from '@alagunoff/uniswap-v2-sdk' import { useMemo } from 'react' import { abi as IUniswapV2PairABI } from '@uniswap/v2-core/build/IUniswapV2Pair.json' import { Interface } from '@ethersproject/abi' @@ -6,6 +6,7 @@ import { useActiveWeb3React } from './web3' import { useMultipleContractSingleData } from '../state/multicall/hooks' import { wrappedCurrency } from '../utils/wrappedCurrency' import { Currency, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' +import { PAIR_INIT_CODE_HASHES, V2_CORE_FACTORY_ADDRESSES } from 'constants/addresses' const PAIR_INTERFACE = new Interface(IUniswapV2PairABI) @@ -28,12 +29,22 @@ export function useV2Pairs(currencies: [Currency | undefined, Currency | undefin [chainId, currencies] ) + const factoryAddress = chainId && V2_CORE_FACTORY_ADDRESSES[chainId] + const pairInitCodeHash = chainId && PAIR_INIT_CODE_HASHES[chainId] + const pairAddresses = useMemo( () => tokens.map(([tokenA, tokenB]) => { - return tokenA && tokenB && !tokenA.equals(tokenB) ? Pair.getAddress(tokenA, tokenB) : undefined + return tokenA && tokenB && !tokenA.equals(tokenB) && factoryAddress && pairInitCodeHash + ? computePairAddress({ + factoryAddress, + tokenA, + tokenB, + pairInitCodeHash, + }) + : undefined }), - [tokens] + [tokens, factoryAddress, pairInitCodeHash] ) const results = useMultipleContractSingleData(pairAddresses, PAIR_INTERFACE, 'getReserves') @@ -45,19 +56,22 @@ export function useV2Pairs(currencies: [Currency | undefined, Currency | undefin const tokenB = tokens[i][1] if (loading) return [PairState.LOADING, null] - if (!tokenA || !tokenB || tokenA.equals(tokenB)) return [PairState.INVALID, null] + if (!tokenA || !tokenB || tokenA.equals(tokenB) || !factoryAddress || !pairInitCodeHash) + return [PairState.INVALID, null] if (!reserves) return [PairState.NOT_EXISTS, null] const { reserve0, reserve1 } = reserves const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] return [ PairState.EXISTS, new Pair( + factoryAddress, CurrencyAmount.fromRawAmount(token0, reserve0.toString()), - CurrencyAmount.fromRawAmount(token1, reserve1.toString()) + CurrencyAmount.fromRawAmount(token1, reserve1.toString()), + pairInitCodeHash ), ] }) - }, [results, tokens]) + }, [results, tokens, factoryAddress, pairInitCodeHash]) } export function useV2Pair(tokenA?: Currency, tokenB?: Currency): [PairState, Pair | null] { diff --git a/src/hooks/useV2Trade.ts b/src/hooks/useV2Trade.ts index ba9243cb2a4..a252ac08294 100644 --- a/src/hooks/useV2Trade.ts +++ b/src/hooks/useV2Trade.ts @@ -1,10 +1,12 @@ import { Currency, CurrencyAmount, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Pair, Trade } from '@uniswap/v2-sdk' +import { Pair, Trade } from '@alagunoff/uniswap-v2-sdk' import { useMemo } from 'react' import { isTradeBetter } from 'utils/isTradeBetter' import { BETTER_TRADE_LESS_HOPS_THRESHOLD } from '../constants/misc' import { useAllCurrencyCombinations } from './useAllCurrencyCombinations' import { PairState, useV2Pairs } from './useV2Pairs' +import { useActiveWeb3React } from './web3' +import { PAIR_INIT_CODE_HASHES, V2_CORE_FACTORY_ADDRESSES } from 'constants/addresses' function useAllCommonPairs(currencyA?: Currency, currencyB?: Currency): Pair[] { const allCurrencyCombinations = useAllCurrencyCombinations(currencyA, currencyB) @@ -38,22 +40,43 @@ export function useV2TradeExactIn( currencyOut?: Currency, { maxHops = MAX_HOPS } = {} ): Trade | null { + const { chainId } = useActiveWeb3React() const allowedPairs = useAllCommonPairs(currencyAmountIn?.currency, currencyOut) + const factoryAddress = chainId && V2_CORE_FACTORY_ADDRESSES[chainId] + const pairInitCodeHash = chainId && PAIR_INIT_CODE_HASHES[chainId] return useMemo(() => { - if (currencyAmountIn && currencyOut && allowedPairs.length > 0) { + if (currencyAmountIn && currencyOut && allowedPairs.length > 0 && factoryAddress && pairInitCodeHash) { if (maxHops === 1) { return ( - Trade.bestTradeExactIn(allowedPairs, currencyAmountIn, currencyOut, { maxHops: 1, maxNumResults: 1 })[0] ?? - null + Trade.bestTradeExactIn( + allowedPairs, + currencyAmountIn, + currencyOut, + { maxHops: 1, maxNumResults: 1 }, + undefined, + undefined, + undefined, + factoryAddress, + pairInitCodeHash + )[0] ?? null ) } // search through trades with varying hops, find best trade out of them let bestTradeSoFar: Trade | null = null for (let i = 1; i <= maxHops; i++) { const currentTrade: Trade | null = - Trade.bestTradeExactIn(allowedPairs, currencyAmountIn, currencyOut, { maxHops: i, maxNumResults: 1 })[0] ?? - null + Trade.bestTradeExactIn( + allowedPairs, + currencyAmountIn, + currencyOut, + { maxHops: i, maxNumResults: 1 }, + undefined, + undefined, + undefined, + factoryAddress, + pairInitCodeHash + )[0] ?? null // if current trade is best yet, save it if (isTradeBetter(bestTradeSoFar, currentTrade, BETTER_TRADE_LESS_HOPS_THRESHOLD)) { bestTradeSoFar = currentTrade @@ -63,7 +86,7 @@ export function useV2TradeExactIn( } return null - }, [allowedPairs, currencyAmountIn, currencyOut, maxHops]) + }, [allowedPairs, currencyAmountIn, currencyOut, maxHops, factoryAddress, pairInitCodeHash]) } /** @@ -74,22 +97,43 @@ export function useV2TradeExactOut( currencyAmountOut?: CurrencyAmount, { maxHops = MAX_HOPS } = {} ): Trade | null { + const { chainId } = useActiveWeb3React() const allowedPairs = useAllCommonPairs(currencyIn, currencyAmountOut?.currency) + const factoryAddress = chainId && V2_CORE_FACTORY_ADDRESSES[chainId] + const pairInitCodeHash = chainId && PAIR_INIT_CODE_HASHES[chainId] return useMemo(() => { - if (currencyIn && currencyAmountOut && allowedPairs.length > 0) { + if (currencyIn && currencyAmountOut && allowedPairs.length > 0 && factoryAddress && pairInitCodeHash) { if (maxHops === 1) { return ( - Trade.bestTradeExactOut(allowedPairs, currencyIn, currencyAmountOut, { maxHops: 1, maxNumResults: 1 })[0] ?? - null + Trade.bestTradeExactOut( + allowedPairs, + currencyIn, + currencyAmountOut, + { maxHops: 1, maxNumResults: 1 }, + undefined, + undefined, + undefined, + factoryAddress, + pairInitCodeHash + )[0] ?? null ) } // search through trades with varying hops, find best trade out of them let bestTradeSoFar: Trade | null = null for (let i = 1; i <= maxHops; i++) { const currentTrade = - Trade.bestTradeExactOut(allowedPairs, currencyIn, currencyAmountOut, { maxHops: i, maxNumResults: 1 })[0] ?? - null + Trade.bestTradeExactOut( + allowedPairs, + currencyIn, + currencyAmountOut, + { maxHops: i, maxNumResults: 1 }, + undefined, + undefined, + undefined, + factoryAddress, + pairInitCodeHash + )[0] ?? null if (isTradeBetter(bestTradeSoFar, currentTrade, BETTER_TRADE_LESS_HOPS_THRESHOLD)) { bestTradeSoFar = currentTrade } @@ -97,5 +141,5 @@ export function useV2TradeExactOut( return bestTradeSoFar } return null - }, [currencyIn, currencyAmountOut, allowedPairs, maxHops]) + }, [currencyIn, currencyAmountOut, allowedPairs, maxHops, factoryAddress, pairInitCodeHash]) } diff --git a/src/pages/MigrateV2/MigrateV2Pair.tsx b/src/pages/MigrateV2/MigrateV2Pair.tsx index 9d7d4f9fb8f..bbfd70809e7 100644 --- a/src/pages/MigrateV2/MigrateV2Pair.tsx +++ b/src/pages/MigrateV2/MigrateV2Pair.tsx @@ -1,7 +1,6 @@ import JSBI from 'jsbi' import React, { useCallback, useMemo, useState, useEffect } from 'react' import { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '@alagunoff/uniswap-sdk-core' -import { FACTORY_ADDRESS } from '@uniswap/v2-sdk' import { Redirect, RouteComponentProps } from 'react-router' import { Text } from 'rebass' import { AutoColumn } from '../../components/Column' @@ -48,6 +47,7 @@ import Badge, { BadgeVariant } from 'components/Badge' import { useDispatch } from 'react-redux' import { AppDispatch } from 'state' import SettingsTab from 'components/Settings' +import { V2_CORE_FACTORY_ADDRESSES } from 'constants/addresses' const ZERO = JSBI.BigInt(0) @@ -125,7 +125,10 @@ function V2PairMigration({ const theme = useTheme() const pairFactory = useSingleCallResult(pair, 'factory') - const isNotUniswap = pairFactory.result?.[0] && pairFactory.result[0] !== FACTORY_ADDRESS + const isNotUniswap = + pairFactory.result?.[0] && + typeof chainId === 'number' && + pairFactory.result[0] !== V2_CORE_FACTORY_ADDRESSES[chainId] const deadline = useTransactionDeadline() // custom from users settings const blockTimestamp = useCurrentBlockTimestamp() diff --git a/src/pages/MigrateV2/index.tsx b/src/pages/MigrateV2/index.tsx index 1403f812c3c..722468eefbf 100644 --- a/src/pages/MigrateV2/index.tsx +++ b/src/pages/MigrateV2/index.tsx @@ -1,5 +1,5 @@ import React, { useContext, useMemo } from 'react' -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' import { Token, ChainId } from '@alagunoff/uniswap-sdk-core' import { ThemeContext } from 'styled-components' import { AutoColumn } from '../../components/Column' @@ -18,6 +18,7 @@ import MigrateSushiPositionCard from 'components/PositionCard/Sushi' import { PairState, useV2Pairs } from 'hooks/useV2Pairs' import { getCreate2Address } from '@ethersproject/address' import { pack, keccak256 } from '@ethersproject/solidity' +import { PAIR_INIT_CODE_HASHES, V2_CORE_FACTORY_ADDRESSES } from 'constants/addresses' function EmptyState({ message }: { message: string }) { return ( @@ -49,24 +50,28 @@ function toSushiLiquidityToken([tokenA, tokenB]: [Token, Token]): Token { export default function MigrateV2() { const theme = useContext(ThemeContext) const { account, chainId } = useActiveWeb3React() + const factoryAddress = chainId && V2_CORE_FACTORY_ADDRESSES[chainId] + const pairInitCodeHash = chainId && PAIR_INIT_CODE_HASHES[chainId] // fetch the user's balances of all tracked V2 LP tokens const trackedTokenPairs = useTrackedTokenPairs() // calculate v2 + sushi pair contract addresses for all token pairs - const tokenPairsWithLiquidityTokens = useMemo( - () => - trackedTokenPairs.map((tokens) => { - // sushi liquidity token or null - const sushiLiquidityToken = chainId === ChainId.MAINNET ? toSushiLiquidityToken(tokens) : null - return { - v2liquidityToken: toV2LiquidityToken(tokens), - sushiLiquidityToken, - tokens, - } - }), - [trackedTokenPairs, chainId] - ) + const tokenPairsWithLiquidityTokens = useMemo(() => { + if (!factoryAddress || !pairInitCodeHash) { + return [] + } + + return trackedTokenPairs.map((tokens) => { + // sushi liquidity token or null + const sushiLiquidityToken = chainId === ChainId.MAINNET ? toSushiLiquidityToken(tokens) : null + return { + v2liquidityToken: toV2LiquidityToken(factoryAddress, tokens, pairInitCodeHash), + sushiLiquidityToken, + tokens, + } + }) + }, [trackedTokenPairs, chainId, factoryAddress, pairInitCodeHash]) // get pair liquidity token addresses for balance-fetching purposes const allLiquidityTokens = useMemo(() => { diff --git a/src/pages/Pool/v2.tsx b/src/pages/Pool/v2.tsx index 5c52034b532..1421fbd06c3 100644 --- a/src/pages/Pool/v2.tsx +++ b/src/pages/Pool/v2.tsx @@ -21,7 +21,8 @@ import { Dots } from '../../components/swap/styleds' import { CardSection, DataCard, CardNoise, CardBGImage } from '../../components/earn/styled' import { useStakingInfo } from '../../state/stake/hooks' import { BIG_INT_ZERO } from '../../constants/misc' -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' +import { PAIR_INIT_CODE_HASHES, V2_CORE_FACTORY_ADDRESSES } from 'constants/addresses' const PageWrapper = styled(AutoColumn)` max-width: 640px; @@ -77,14 +78,21 @@ const EmptyProposals = styled.div` export default function Pool() { const theme = useContext(ThemeContext) - const { account } = useActiveWeb3React() - + const { account, chainId } = useActiveWeb3React() + const factoryAddress = chainId && V2_CORE_FACTORY_ADDRESSES[chainId] + const pairInitCodeHash = chainId && PAIR_INIT_CODE_HASHES[chainId] // fetch the user's balances of all tracked V2 LP tokens const trackedTokenPairs = useTrackedTokenPairs() - const tokenPairsWithLiquidityTokens = useMemo( - () => trackedTokenPairs.map((tokens) => ({ liquidityToken: toV2LiquidityToken(tokens), tokens })), - [trackedTokenPairs] - ) + const tokenPairsWithLiquidityTokens = useMemo(() => { + if (!factoryAddress || !pairInitCodeHash) { + return [] + } + + return trackedTokenPairs.map((tokens) => ({ + liquidityToken: toV2LiquidityToken(factoryAddress, tokens, pairInitCodeHash), + tokens, + })) + }, [trackedTokenPairs, factoryAddress, pairInitCodeHash]) const liquidityTokens = useMemo(() => tokenPairsWithLiquidityTokens.map((tpwlt) => tpwlt.liquidityToken), [ tokenPairsWithLiquidityTokens, ]) diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index 6203a8356d9..c7c7e27338c 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -1,5 +1,5 @@ import { Currency, CurrencyAmount, Token, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { AdvancedSwapDetails } from 'components/swap/AdvancedSwapDetails' import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter' diff --git a/src/state/burn/hooks.ts b/src/state/burn/hooks.ts index 95f2d4dc5e4..69c5fa8ddcb 100644 --- a/src/state/burn/hooks.ts +++ b/src/state/burn/hooks.ts @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import { Token, Currency, Percent, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' import { useCallback } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useV2Pair } from '../../hooks/useV2Pairs' diff --git a/src/state/lists/wrappedTokenInfo.ts b/src/state/lists/wrappedTokenInfo.ts index 931a844b888..d2d17d5d7dc 100644 --- a/src/state/lists/wrappedTokenInfo.ts +++ b/src/state/lists/wrappedTokenInfo.ts @@ -12,6 +12,7 @@ export interface TagInfo extends TagDetails { */ export class WrappedTokenInfo implements Token { public readonly isEther: false = false + public readonly isPol: false = false public readonly isToken: true = true public readonly list: TokenList diff --git a/src/state/mint/hooks.ts b/src/state/mint/hooks.ts index 82862018abb..d8b3138f911 100644 --- a/src/state/mint/hooks.ts +++ b/src/state/mint/hooks.ts @@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react' import { useDispatch, useSelector } from 'react-redux' import { AppDispatch, AppState } from '../index' import { Field, typeInput } from './actions' -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' import { Currency, Token, Percent, Price, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' import JSBI from 'jsbi' import { PairState, useV2Pair } from '../../hooks/useV2Pairs' diff --git a/src/state/stake/hooks.ts b/src/state/stake/hooks.ts index 49e295f523a..ef07a35a06a 100644 --- a/src/state/stake/hooks.ts +++ b/src/state/stake/hooks.ts @@ -1,5 +1,5 @@ import { ChainId, Token, CurrencyAmount, WETH9 } from '@alagunoff/uniswap-sdk-core' -import { Pair } from '@uniswap/v2-sdk' +import { Pair } from '@alagunoff/uniswap-v2-sdk' import JSBI from 'jsbi' import { useMemo } from 'react' import { DAI, UNI, USDC, USDT, WBTC } from '../../constants/tokens' @@ -9,6 +9,7 @@ import { tryParseAmount } from '../swap/hooks' import useCurrentBlockTimestamp from 'hooks/useCurrentBlockTimestamp' import { Interface } from '@ethersproject/abi' import { abi as STAKING_REWARDS_ABI } from '@uniswap/liquidity-staker/build/StakingRewards.json' +import { PAIR_INIT_CODE_HASHES, V2_CORE_FACTORY_ADDRESSES } from 'constants/addresses' export const STAKING_REWARDS_INTERFACE = new Interface(STAKING_REWARDS_ABI) @@ -118,9 +119,11 @@ export function useStakingInfo(pairToFilterBy?: Pair | null): StakingInfo[] { undefined, NEVER_RELOAD ) + const factoryAddress = chainId && V2_CORE_FACTORY_ADDRESSES[chainId] + const pairInitCodeHash = chainId && PAIR_INIT_CODE_HASHES[chainId] return useMemo(() => { - if (!chainId || !uni) return [] + if (!chainId || !uni || !factoryAddress || !pairInitCodeHash) return [] return rewardsAddresses.reduce((memo, rewardsAddress, index) => { // these two are dependent on account @@ -158,8 +161,10 @@ export function useStakingInfo(pairToFilterBy?: Pair | null): StakingInfo[] { // get the LP token const tokens = info[index].tokens const dummyPair = new Pair( + factoryAddress, CurrencyAmount.fromRawAmount(tokens[0], '0'), - CurrencyAmount.fromRawAmount(tokens[1], '0') + CurrencyAmount.fromRawAmount(tokens[1], '0'), + pairInitCodeHash ) // check for account, if no account set to 0 @@ -222,6 +227,8 @@ export function useStakingInfo(pairToFilterBy?: Pair | null): StakingInfo[] { rewardsAddresses, totalSupplies, uni, + factoryAddress, + pairInitCodeHash, ]) } diff --git a/src/state/swap/hooks.ts b/src/state/swap/hooks.ts index c76b25d812e..6af109bc623 100644 --- a/src/state/swap/hooks.ts +++ b/src/state/swap/hooks.ts @@ -4,7 +4,7 @@ import { useBestV3TradeExactIn, useBestV3TradeExactOut, V3TradeState } from '../ import useENS from '../../hooks/useENS' import { parseUnits } from '@ethersproject/units' import { Currency, CurrencyAmount, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { ParsedQs } from 'qs' import { useCallback, useEffect, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' diff --git a/src/state/user/hooks.tsx b/src/state/user/hooks.tsx index 5ce87b95f51..021a6d5a62a 100644 --- a/src/state/user/hooks.tsx +++ b/src/state/user/hooks.tsx @@ -1,5 +1,5 @@ import { ChainId, Percent, Token } from '@alagunoff/uniswap-sdk-core' -import { Pair } from '@uniswap/v2-sdk' +import { computePairAddress, Pair } from '@alagunoff/uniswap-v2-sdk' import JSBI from 'jsbi' import flatMap from 'lodash.flatmap' import { useCallback, useMemo } from 'react' @@ -226,8 +226,23 @@ export function useURLWarningToggle(): () => void { * @param tokenA one of the two tokens * @param tokenB the other token */ -export function toV2LiquidityToken([tokenA, tokenB]: [Token, Token]): Token { - return new Token(tokenA.chainId, Pair.getAddress(tokenA, tokenB), 18, 'UNI-V2', 'Uniswap V2') +export function toV2LiquidityToken( + factoryAddress: string, + [tokenA, tokenB]: [Token, Token], + pairInitCodeHash: string +): Token { + return new Token( + tokenA.chainId, + computePairAddress({ + factoryAddress, + tokenA, + tokenB, + pairInitCodeHash, + }), + 18, + 'UNI-V2', + 'Uniswap V2' + ) } /** diff --git a/src/utils/calculateGasMargin.test.ts b/src/utils/calculateGasMargin.test.ts deleted file mode 100644 index bd07df58c69..00000000000 --- a/src/utils/calculateGasMargin.test.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { BigNumber } from '@ethersproject/bignumber' -import { calculateGasMargin } from './calculateGasMargin' - -describe('#calculateGasMargin', () => { - it('adds 20%', () => { - expect(calculateGasMargin(BigNumber.from(1000)).toString()).toEqual('1200') - expect(calculateGasMargin(BigNumber.from(50)).toString()).toEqual('60') - }) -}) diff --git a/src/utils/calculateSlippageAmount.test.ts b/src/utils/calculateSlippageAmount.test.ts deleted file mode 100644 index 30ee782fda2..00000000000 --- a/src/utils/calculateSlippageAmount.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { AddressZero } from '@ethersproject/constants' -import { ChainId, CurrencyAmount, Percent, Token } from '@alagunoff/uniswap-sdk-core' -import { calculateSlippageAmount } from './calculateSlippageAmount' - -describe('#calculateSlippageAmount', () => { - it('bounds are correct', () => { - const tokenAmount = CurrencyAmount.fromRawAmount(new Token(ChainId.MAINNET, AddressZero, 0), '100') - expect(() => calculateSlippageAmount(tokenAmount, new Percent(-1, 10_000))).toThrow('Unexpected slippage') - expect(() => calculateSlippageAmount(tokenAmount, new Percent(10_001, 10_000))).toThrow('Unexpected slippage') - expect(calculateSlippageAmount(tokenAmount, new Percent(0, 10_000)).map((bound) => bound.toString())).toEqual([ - '100', - '100', - ]) - expect(calculateSlippageAmount(tokenAmount, new Percent(5, 100)).map((bound) => bound.toString())).toEqual([ - '95', - '105', - ]) - expect(calculateSlippageAmount(tokenAmount, new Percent(100, 10_000)).map((bound) => bound.toString())).toEqual([ - '99', - '101', - ]) - expect(calculateSlippageAmount(tokenAmount, new Percent(200, 10_000)).map((bound) => bound.toString())).toEqual([ - '98', - '102', - ]) - expect(calculateSlippageAmount(tokenAmount, new Percent(10000, 10_000)).map((bound) => bound.toString())).toEqual([ - '0', - '200', - ]) - }) - it('works for 18 decimals', () => { - const tokenAmount = CurrencyAmount.fromRawAmount(new Token(ChainId.MAINNET, AddressZero, 18), '100') - expect(() => calculateSlippageAmount(tokenAmount, new Percent(-1, 10_000))).toThrow('Unexpected slippage') - expect(() => calculateSlippageAmount(tokenAmount, new Percent(10_001, 10_000))).toThrow('Unexpected slippage') - expect(calculateSlippageAmount(tokenAmount, new Percent(0, 10_000)).map((bound) => bound.toString())).toEqual([ - '100', - '100', - ]) - expect(calculateSlippageAmount(tokenAmount, new Percent(5, 100)).map((bound) => bound.toString())).toEqual([ - '95', - '105', - ]) - expect(calculateSlippageAmount(tokenAmount, new Percent(100, 10_000)).map((bound) => bound.toString())).toEqual([ - '99', - '101', - ]) - expect(calculateSlippageAmount(tokenAmount, new Percent(200, 10_000)).map((bound) => bound.toString())).toEqual([ - '98', - '102', - ]) - expect(calculateSlippageAmount(tokenAmount, new Percent(10000, 10_000)).map((bound) => bound.toString())).toEqual([ - '0', - '200', - ]) - }) -}) diff --git a/src/utils/chunkArray.test.ts b/src/utils/chunkArray.test.ts deleted file mode 100644 index fbfb3fba5e8..00000000000 --- a/src/utils/chunkArray.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import chunkArray, { DEFAULT_GAS_REQUIRED } from './chunkArray' - -describe('#chunkArray', () => { - it('size 1', () => { - expect(chunkArray([1, 2, 3], 1)).toEqual([[1], [2], [3]]) - expect(chunkArray([1, 2, 3], DEFAULT_GAS_REQUIRED)).toEqual([[1], [2], [3]]) - }) - it('size gt items', () => { - expect(chunkArray([1, 2, 3], DEFAULT_GAS_REQUIRED * 3 + 1)).toEqual([[1, 2, 3]]) - }) - it('size exact half', () => { - expect(chunkArray([1, 2, 3, 4], DEFAULT_GAS_REQUIRED * 2 + 1)).toEqual([ - [1, 2], - [3, 4], - ]) - }) -}) diff --git a/src/utils/computeUniCirculation.test.ts b/src/utils/computeUniCirculation.test.ts deleted file mode 100644 index 3c9a44b01fb..00000000000 --- a/src/utils/computeUniCirculation.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import JSBI from 'jsbi' -import { ChainId, Token, CurrencyAmount } from '@alagunoff/uniswap-sdk-core' -import { BigNumber } from 'ethers' -import { ZERO_ADDRESS } from '../constants/misc' -import { computeUniCirculation } from './computeUniCirculation' - -describe('computeUniCirculation', () => { - const token = new Token(ChainId.RINKEBY, ZERO_ADDRESS, 18) - - function expandTo18Decimals(num: JSBI | string | number) { - return JSBI.multiply(JSBI.BigInt(num), JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(18))) - } - - function tokenAmount(num: JSBI | string | number) { - return CurrencyAmount.fromRawAmount(token, expandTo18Decimals(num)) - } - - it('before staking', () => { - expect(computeUniCirculation(token, BigNumber.from(0), undefined)).toEqual(tokenAmount(150_000_000)) - expect(computeUniCirculation(token, BigNumber.from(1600387200), undefined)).toEqual(tokenAmount(150_000_000)) - }) - it('mid staking', () => { - expect(computeUniCirculation(token, BigNumber.from(1600387200 + 15 * 24 * 60 * 60), undefined)).toEqual( - tokenAmount(155_000_000) - ) - }) - it('after staking and treasury vesting cliff', () => { - expect(computeUniCirculation(token, BigNumber.from(1600387200 + 60 * 24 * 60 * 60), undefined)).toEqual( - tokenAmount(224_575_341) - ) - }) - it('subtracts unclaimed uni', () => { - expect(computeUniCirculation(token, BigNumber.from(1600387200 + 15 * 24 * 60 * 60), tokenAmount(1000))).toEqual( - tokenAmount(154_999_000) - ) - }) -}) diff --git a/src/utils/getExplorerLink.test.ts b/src/utils/getExplorerLink.test.ts deleted file mode 100644 index 1da7cfccf2b..00000000000 --- a/src/utils/getExplorerLink.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ChainId } from '@alagunoff/uniswap-sdk-core' -import { ExplorerDataType, getExplorerLink } from './getExplorerLink' - -describe('#getExplorerLink', () => { - it('correct for tx', () => { - expect(getExplorerLink(1, 'abc', ExplorerDataType.TRANSACTION)).toEqual('https://etherscan.io/tx/abc') - }) - it('correct for token', () => { - expect(getExplorerLink(1, 'abc', ExplorerDataType.TOKEN)).toEqual('https://etherscan.io/token/abc') - }) - it('correct for address', () => { - expect(getExplorerLink(1, 'abc', ExplorerDataType.ADDRESS)).toEqual('https://etherscan.io/address/abc') - }) - it('unrecognized chain id defaults to mainnet', () => { - expect(getExplorerLink(2, 'abc', ExplorerDataType.ADDRESS)).toEqual('https://etherscan.io/address/abc') - }) - it('ropsten', () => { - expect(getExplorerLink(3, 'abc', ExplorerDataType.ADDRESS)).toEqual('https://ropsten.etherscan.io/address/abc') - }) - it('enum', () => { - expect(getExplorerLink(ChainId.RINKEBY, 'abc', ExplorerDataType.ADDRESS)).toEqual( - 'https://rinkeby.etherscan.io/address/abc' - ) - }) -}) diff --git a/src/utils/getTradeVersion.ts b/src/utils/getTradeVersion.ts index ba1093e52ec..2c646352a68 100644 --- a/src/utils/getTradeVersion.ts +++ b/src/utils/getTradeVersion.ts @@ -1,5 +1,5 @@ import { Currency, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { Version } from '../hooks/useToggledVersion' diff --git a/src/utils/index.test.ts b/src/utils/index.test.ts deleted file mode 100644 index 45b4642f701..00000000000 --- a/src/utils/index.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { isAddress, shortenAddress } from '.' - -describe('utils', () => { - describe('#isAddress', () => { - it('returns false if not', () => { - expect(isAddress('')).toBe(false) - expect(isAddress('0x0000')).toBe(false) - expect(isAddress(1)).toBe(false) - expect(isAddress({})).toBe(false) - expect(isAddress(undefined)).toBe(false) - }) - - it('returns the checksummed address', () => { - expect(isAddress('0xf164fc0ec4e93095b804a4795bbe1e041497b92a')).toBe('0xf164fC0Ec4E93095b804a4795bBe1e041497b92a') - expect(isAddress('0xf164fC0Ec4E93095b804a4795bBe1e041497b92a')).toBe('0xf164fC0Ec4E93095b804a4795bBe1e041497b92a') - }) - - it('succeeds even without prefix', () => { - expect(isAddress('f164fc0ec4e93095b804a4795bbe1e041497b92a')).toBe('0xf164fC0Ec4E93095b804a4795bBe1e041497b92a') - }) - it('fails if too long', () => { - expect(isAddress('f164fc0ec4e93095b804a4795bbe1e041497b92a0')).toBe(false) - }) - }) - - describe('#shortenAddress', () => { - it('throws on invalid address', () => { - expect(() => shortenAddress('abc')).toThrow("Invalid 'address'") - }) - - it('truncates middle characters', () => { - expect(shortenAddress('0xf164fc0ec4e93095b804a4795bbe1e041497b92a')).toBe('0xf164...b92a') - }) - - it('truncates middle characters even without prefix', () => { - expect(shortenAddress('f164fc0ec4e93095b804a4795bbe1e041497b92a')).toBe('0xf164...b92a') - }) - - it('renders checksummed address', () => { - expect(shortenAddress('0x2E1b342132A67Ea578e4E3B814bae2107dc254CC'.toLowerCase())).toBe('0x2E1b...54CC') - }) - }) -}) diff --git a/src/utils/isTradeBetter.ts b/src/utils/isTradeBetter.ts index 5c9adc182e1..5f51fbf196d 100644 --- a/src/utils/isTradeBetter.ts +++ b/src/utils/isTradeBetter.ts @@ -1,6 +1,6 @@ import { ZERO_PERCENT, ONE_HUNDRED_PERCENT } from '../constants/misc' import { Percent, currencyEquals, Currency, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' // returns whether tradeB is better than tradeA by at least a threshold percentage amount diff --git a/src/utils/parseENSAddress.test.ts b/src/utils/parseENSAddress.test.ts deleted file mode 100644 index 975449b6017..00000000000 --- a/src/utils/parseENSAddress.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { parseENSAddress } from './parseENSAddress' - -describe('parseENSAddress', () => { - it('test cases', () => { - expect(parseENSAddress('hello.eth')).toEqual({ ensName: 'hello.eth', ensPath: undefined }) - expect(parseENSAddress('hello.eth/')).toEqual({ ensName: 'hello.eth', ensPath: '/' }) - expect(parseENSAddress('hello.world.eth/')).toEqual({ ensName: 'hello.world.eth', ensPath: '/' }) - expect(parseENSAddress('hello.world.eth/abcdef')).toEqual({ ensName: 'hello.world.eth', ensPath: '/abcdef' }) - expect(parseENSAddress('abso.lutely')).toEqual(undefined) - expect(parseENSAddress('abso.lutely.eth')).toEqual({ ensName: 'abso.lutely.eth', ensPath: undefined }) - expect(parseENSAddress('eth')).toEqual(undefined) - expect(parseENSAddress('eth/hello-world')).toEqual(undefined) - expect(parseENSAddress('hello-world.eth')).toEqual({ ensName: 'hello-world.eth', ensPath: undefined }) - expect(parseENSAddress('-prefix-dash.eth')).toEqual(undefined) - expect(parseENSAddress('suffix-dash-.eth')).toEqual(undefined) - expect(parseENSAddress('it.eth')).toEqual({ ensName: 'it.eth', ensPath: undefined }) - expect(parseENSAddress('only-single--dash.eth')).toEqual(undefined) - }) -}) diff --git a/src/utils/prices.test.ts b/src/utils/prices.test.ts deleted file mode 100644 index 34cc463eb1c..00000000000 --- a/src/utils/prices.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import JSBI from 'jsbi' -import { ChainId, Percent, Token, CurrencyAmount, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade, Pair, Route } from '@uniswap/v2-sdk' -import { computeRealizedLPFeeAmount, warningSeverity } from './prices' - -describe('prices', () => { - const token1 = new Token(ChainId.MAINNET, '0x0000000000000000000000000000000000000001', 18) - const token2 = new Token(ChainId.MAINNET, '0x0000000000000000000000000000000000000002', 18) - const token3 = new Token(ChainId.MAINNET, '0x0000000000000000000000000000000000000003', 18) - - const pair12 = new Pair( - CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(10000)), - CurrencyAmount.fromRawAmount(token2, JSBI.BigInt(20000)) - ) - const pair23 = new Pair( - CurrencyAmount.fromRawAmount(token2, JSBI.BigInt(20000)), - CurrencyAmount.fromRawAmount(token3, JSBI.BigInt(30000)) - ) - - describe('#computeRealizedLPFeeAmount', () => { - it('returns undefined for undefined', () => { - expect(computeRealizedLPFeeAmount(undefined)).toEqual(undefined) - }) - - it('correct realized lp fee for single hop', () => { - expect( - computeRealizedLPFeeAmount( - new Trade( - new Route([pair12], token1, token2), - CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(1000)), - TradeType.EXACT_INPUT - ) - ) - ).toEqual(CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(3))) - }) - - it('correct realized lp fee for double hop', () => { - expect( - computeRealizedLPFeeAmount( - new Trade( - new Route([pair12, pair23], token1, token3), - CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(1000)), - TradeType.EXACT_INPUT - ) - ) - ).toEqual(CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(5))) - }) - }) - - describe('#warningSeverity', () => { - it('max for undefined', () => { - expect(warningSeverity(undefined)).toEqual(4) - }) - it('correct for 0', () => { - expect(warningSeverity(new Percent(0))).toEqual(0) - }) - it('correct for 0.5', () => { - expect(warningSeverity(new Percent(5, 1000))).toEqual(0) - }) - it('correct for 5', () => { - expect(warningSeverity(new Percent(5, 100))).toEqual(2) - }) - it('correct for 50', () => { - expect(warningSeverity(new Percent(5, 10))).toEqual(4) - }) - }) -}) diff --git a/src/utils/prices.ts b/src/utils/prices.ts index 3dabc1e3d8c..9d3b4591287 100644 --- a/src/utils/prices.ts +++ b/src/utils/prices.ts @@ -1,6 +1,6 @@ import JSBI from 'jsbi' import { Currency, CurrencyAmount, Fraction, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' -import { Trade as V2Trade } from '@uniswap/v2-sdk' +import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { ALLOWED_PRICE_IMPACT_HIGH, diff --git a/src/utils/retry.test.ts b/src/utils/retry.test.ts deleted file mode 100644 index fe1952ac320..00000000000 --- a/src/utils/retry.test.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { retry, RetryableError } from './retry' - -describe('retry', () => { - function makeFn(fails: number, result: T, retryable = true): () => Promise { - return async () => { - if (fails > 0) { - fails-- - throw retryable ? new RetryableError('failure') : new Error('bad failure') - } - return result - } - } - - it('fails for non-retryable error', async () => { - await expect(retry(makeFn(1, 'abc', false), { n: 3, maxWait: 0, minWait: 0 }).promise).rejects.toThrow( - 'bad failure' - ) - }) - - it('works after one fail', async () => { - await expect(retry(makeFn(1, 'abc'), { n: 3, maxWait: 0, minWait: 0 }).promise).resolves.toEqual('abc') - }) - - it('works after two fails', async () => { - await expect(retry(makeFn(2, 'abc'), { n: 3, maxWait: 0, minWait: 0 }).promise).resolves.toEqual('abc') - }) - - it('throws if too many fails', async () => { - await expect(retry(makeFn(4, 'abc'), { n: 3, maxWait: 0, minWait: 0 }).promise).rejects.toThrow('failure') - }) - - it('cancel causes promise to reject', async () => { - const { promise, cancel } = retry(makeFn(2, 'abc'), { n: 3, minWait: 100, maxWait: 100 }) - cancel() - await expect(promise).rejects.toThrow('Cancelled') - }) - - it('cancel no-op after complete', async () => { - const { promise, cancel } = retry(makeFn(0, 'abc'), { n: 3, minWait: 100, maxWait: 100 }) - // defer - setTimeout(cancel, 0) - await expect(promise).resolves.toEqual('abc') - }) - - async function checkTime(fn: () => Promise, min: number, max: number) { - const time = new Date().getTime() - await fn() - const diff = new Date().getTime() - time - expect(diff).toBeGreaterThanOrEqual(min) - expect(diff).toBeLessThanOrEqual(max) - } - - it('waits random amount of time between min and max', async () => { - const promises = [] - for (let i = 0; i < 10; i++) { - promises.push( - checkTime( - () => expect(retry(makeFn(4, 'abc'), { n: 3, maxWait: 100, minWait: 50 }).promise).rejects.toThrow('failure'), - 150, - 400 - ) - ) - } - await Promise.all(promises) - }) -}) diff --git a/src/utils/uriToHttp.test.ts b/src/utils/uriToHttp.test.ts deleted file mode 100644 index 2e922cf9fa8..00000000000 --- a/src/utils/uriToHttp.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import uriToHttp from './uriToHttp' - -describe('uriToHttp', () => { - it('returns .eth.link for ens names', () => { - expect(uriToHttp('t2crtokens.eth')).toEqual([]) - }) - it('returns https first for http', () => { - expect(uriToHttp('http://test.com')).toEqual(['https://test.com', 'http://test.com']) - }) - it('returns https for https', () => { - expect(uriToHttp('https://test.com')).toEqual(['https://test.com']) - }) - it('returns ipfs gateways for ipfs:// urls', () => { - expect(uriToHttp('ipfs://QmV8AfDE8GFSGQvt3vck8EwAzsPuNTmtP8VcQJE3qxRPaZ')).toEqual([ - 'https://cloudflare-ipfs.com/ipfs/QmV8AfDE8GFSGQvt3vck8EwAzsPuNTmtP8VcQJE3qxRPaZ/', - 'https://ipfs.io/ipfs/QmV8AfDE8GFSGQvt3vck8EwAzsPuNTmtP8VcQJE3qxRPaZ/', - ]) - }) - it('returns ipns gateways for ipns:// urls', () => { - expect(uriToHttp('ipns://app.uniswap.org')).toEqual([ - 'https://cloudflare-ipfs.com/ipns/app.uniswap.org/', - 'https://ipfs.io/ipns/app.uniswap.org/', - ]) - }) - it('returns empty array for invalid scheme', () => { - expect(uriToHttp('blah:test')).toEqual([]) - }) -}) diff --git a/yarn.lock b/yarn.lock index 8662e6b5f8d..382b8a02ac4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,6 +14,17 @@ tiny-invariant "1.1.0" toformat "2.0.0" +"@alagunoff/uniswap-v2-sdk@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@alagunoff/uniswap-v2-sdk/-/uniswap-v2-sdk-3.0.0.tgz#516d4438a7ca213a96d3429952eb642ed919946e" + integrity sha512-s85QZ5ZuHFUZlQPtEaUGiJcJw5co64CmOKJZnWgEi02OmMrrJSZfP2FIKSqYb91P/j1UzCzkoJTfVXypGL9XYA== + dependencies: + "@alagunoff/uniswap-sdk-core" "3.0.0" + "@ethersproject/address" "5.0.0" + "@ethersproject/solidity" "5.0.0" + tiny-invariant "1.1.0" + tiny-warning "1.0.3" + "@alagunoff/uniswap-v3-sdk@3.0.1": version "3.0.1" resolved "https://registry.yarnpkg.com/@alagunoff/uniswap-v3-sdk/-/uniswap-v3-sdk-3.0.1.tgz#650b905fcf8def4e7a459224e6ebc132130c2873" @@ -1487,6 +1498,18 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/properties" "^5.7.0" +"@ethersproject/address@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.0.tgz#77afa2823e66c131cab7412fa2c0e56bd3a4d177" + integrity sha512-CwGCI6xBHsxmEDvf0tDF9N2uofiLO1yEALDixU/jFg4+bT8C6WVK+KDiF1M/V8v96TFR98zlycoShN9s8PddKA== + dependencies: + "@ethersproject/bignumber" "^5.0.0" + "@ethersproject/bytes" "^5.0.0" + "@ethersproject/keccak256" "^5.0.0" + "@ethersproject/logger" "^5.0.0" + "@ethersproject/rlp" "^5.0.0" + bn.js "^4.4.0" + "@ethersproject/address@5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.2.tgz#80d0ddfb7d4bd0d32657747fa4bdd2defef2e00a" @@ -1499,7 +1522,7 @@ "@ethersproject/rlp" "^5.0.0" bn.js "^4.4.0" -"@ethersproject/address@5.1.0", "@ethersproject/address@^5.0.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.1.0": +"@ethersproject/address@5.1.0", "@ethersproject/address@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.1.0.tgz#3854fd7ebcb6af7597de66f847c3345dae735b58" integrity sha512-rfWQR12eHn2cpstCFS4RF7oGjfbkZb0oqep+BfrT+gWEGWG2IowJvIsacPOvzyS1jhNF4MQ4BS59B04Mbovteg== @@ -1800,7 +1823,7 @@ "@ethersproject/logger" "^5.1.0" hash.js "1.1.3" -"@ethersproject/sha2@^5.0.7": +"@ethersproject/sha2@^5.0.0", "@ethersproject/sha2@^5.0.7": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== @@ -1832,6 +1855,17 @@ elliptic "6.5.4" hash.js "1.1.7" +"@ethersproject/solidity@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.0.0.tgz#77aa224734f292729d3f4ce805b43ff6368d9354" + integrity sha512-jHhT2fvz3qOR53b5ja54iURVWChvmPz3w+G/wCRaSUOwuWmorcOIoBKvgNJ87ix/kr+Y9EykYkJ2Cymb6m4oVg== + dependencies: + "@ethersproject/bignumber" "^5.0.0" + "@ethersproject/bytes" "^5.0.0" + "@ethersproject/keccak256" "^5.0.0" + "@ethersproject/sha2" "^5.0.0" + "@ethersproject/strings" "^5.0.0" + "@ethersproject/solidity@5.0.9": version "5.0.9" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.0.9.tgz#49100fbe9f364ac56f7ff7c726f4f3d151901134" @@ -1843,7 +1877,7 @@ "@ethersproject/sha2" "^5.0.7" "@ethersproject/strings" "^5.0.8" -"@ethersproject/solidity@5.1.0", "@ethersproject/solidity@^5.0.0": +"@ethersproject/solidity@5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.1.0.tgz#095a9c75244edccb26c452c155736d363399b954" integrity sha512-kPodsGyo9zg1g9XSXp1lGhFaezBAUUsAUB1Vf6OkppE5Wksg4Et+x3kG4m7J/uShDMP2upkJtHNsIBK2XkVpKQ== @@ -1863,7 +1897,7 @@ "@ethersproject/constants" "^5.1.0" "@ethersproject/logger" "^5.1.0" -"@ethersproject/strings@^5.0.8", "@ethersproject/strings@^5.7.0": +"@ethersproject/strings@^5.0.0", "@ethersproject/strings@^5.0.8", "@ethersproject/strings@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== @@ -3363,18 +3397,6 @@ resolved "https://registry.yarnpkg.com/@uniswap/merkle-distributor/-/merkle-distributor-1.0.1.tgz#dc3d911f65a860fc3f0cae074bdcd08ed6a27a4d" integrity sha512-5gDiTI5hrXIh5UWTrxKYjw30QQDnpl8ckDSpefldNenDlYO1RKkdUYMYpvrqGi2r7YzLYTlO6+TDlNs6O7hDRw== -"@uniswap/sdk-core@^3.0.0-alpha.1": - version "3.2.6" - resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-3.2.6.tgz#1a652516fab0c6bc1420c2226648da967a10f52a" - integrity sha512-MvH/3G0W0sM2g7XjaUy9qU7IabxL/KQp/ucU0AQGpVxiTaAhmVRtsjkkv9UDyzpIXVrmevl4kRgV7KKE29UuXA== - dependencies: - "@ethersproject/address" "^5.0.2" - big.js "^5.2.2" - decimal.js-light "^2.5.0" - jsbi "^3.1.4" - tiny-invariant "^1.1.0" - toformat "^2.0.0" - "@uniswap/token-lists@^1.0.0-beta.19": version "1.0.0-beta.21" resolved "https://registry.yarnpkg.com/@uniswap/token-lists/-/token-lists-1.0.0-beta.21.tgz#5a4844236e328d3b0e87161c19edaace669e3e6e" @@ -3398,17 +3420,6 @@ "@uniswap/lib" "1.1.1" "@uniswap/v2-core" "1.0.0" -"@uniswap/v2-sdk@3.0.0-alpha.0": - version "3.0.0-alpha.0" - resolved "https://registry.yarnpkg.com/@uniswap/v2-sdk/-/v2-sdk-3.0.0-alpha.0.tgz#5bbd3133f832bf8b36bacf9213b06de520313e28" - integrity sha512-KHgdCldJ0JY6NC7KImJuU00G5E7X3LNq5yyVy5tGqf2S9fzBf/az91tlVSZzkEyALmH+8RiSvtqKjSNMXTXTfw== - dependencies: - "@ethersproject/address" "^5.0.0" - "@ethersproject/solidity" "^5.0.0" - "@uniswap/sdk-core" "^3.0.0-alpha.1" - tiny-invariant "^1.1.0" - tiny-warning "^1.0.3" - "@uniswap/v3-core@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@uniswap/v3-core/-/v3-core-1.0.0.tgz#6c24adacc4c25dceee0ba3ca142b35adbd7e359d" @@ -6526,11 +6537,6 @@ decimal.js-light@2.5.0: resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.0.tgz#ca7faf504c799326df94b0ab920424fdfc125348" integrity sha512-b3VJCbd2hwUpeRGG3Toob+CRo8W22xplipNhP3tN7TSVB/cyMX71P1vM2Xjc9H74uV6dS2hDDmo/rHq8L87Upg== -decimal.js-light@^2.5.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934" - integrity sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg== - decimal.js@^10.2.1: version "10.2.1" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" @@ -10170,11 +10176,6 @@ jsbi@3.1.4: resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.1.4.tgz#9654dd02207a66a4911b4e4bb74265bc2cbc9dd0" integrity sha512-52QRRFSsi9impURE8ZUbzAMCLjPm4THO7H2fcuIvaaeFTbSysvkodbQQXIVsNgq/ypDbq6dJiuGKL0vZ/i9hUg== -jsbi@^3.1.4: - version "3.2.5" - resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" - integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== - jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -15210,7 +15211,7 @@ timsort@^0.3.0: resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= -tiny-invariant@1.1.0, tiny-invariant@^1.0.2, tiny-invariant@^1.0.6, tiny-invariant@^1.1.0: +tiny-invariant@1.1.0, tiny-invariant@^1.0.2, tiny-invariant@^1.0.6: version "1.1.0" resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875" integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw== @@ -15277,7 +15278,7 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -toformat@2.0.0, toformat@^2.0.0: +toformat@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/toformat/-/toformat-2.0.0.tgz#7a043fd2dfbe9021a4e36e508835ba32056739d8" integrity sha512-03SWBVop6nU8bpyZCx7SodpYznbZF5R4ljwNLBcTQzKOD9xuihRo/psX58llS1BMFhhAI08H3luot5GoXJz2pQ== From 7beba99b2e68d3ff6d7a89a7a40afcd0a62e6d0f Mon Sep 17 00:00:00 2001 From: alagunoff Date: Sat, 28 Dec 2024 15:52:58 +0300 Subject: [PATCH 30/30] - feat: add pool creation for polygon amoy - refactor: use enum for accessing chain ids; change new tokens' metadata --- src/components/CurrencyLogo/index.tsx | 15 +++++---------- src/components/Header/index.tsx | 2 +- src/components/SearchModal/CommonBases.tsx | 2 +- src/components/SearchModal/CurrencyList.tsx | 2 +- src/components/SearchModal/CurrencySearch.tsx | 6 +++--- .../tokenLists/uniswap-default.tokenlist.json | 8 ++++---- src/pages/Pool/index.tsx | 9 +++++++-- src/state/swap/hooks.ts | 18 ++++++++++++------ 8 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/components/CurrencyLogo/index.tsx b/src/components/CurrencyLogo/index.tsx index a8f2a4d82b6..6e87dfe9b45 100644 --- a/src/components/CurrencyLogo/index.tsx +++ b/src/components/CurrencyLogo/index.tsx @@ -6,7 +6,6 @@ import PolygonMaticLogo from '../../assets/images/polygon-matic-logo.png' import useHttpLocations from '../../hooks/useHttpLocations' import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo' import Logo from '../Logo' -import { useWeb3React } from '@web3-react/core' export const getTokenLogoURL = (address: string) => `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/${address}/logo.png` @@ -36,7 +35,6 @@ export default function CurrencyLogo({ size?: string style?: React.CSSProperties }) { - const { chainId } = useWeb3React() const uriLocations = useHttpLocations(currency instanceof WrappedTokenInfo ? currency.logoURI : undefined) const srcs: string[] = useMemo(() => { @@ -53,14 +51,11 @@ export default function CurrencyLogo({ }, [currency, uriLocations]) if (currency?.isEther) { - return ( - - ) + return + } + + if (currency?.isPol) { + return } return diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index ad29b362656..4a74ae33d90 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -384,7 +384,7 @@ export default function Header() { {account && userEthBalance ? ( - {userEthBalance?.toSignificant(4)} {chainId === 80002 ? 'POL' : 'ETH'} + {userEthBalance?.toSignificant(4)} {chainId === ChainId.POLYGON_AMOY ? 'POL' : 'ETH'} ) : null} diff --git a/src/components/SearchModal/CommonBases.tsx b/src/components/SearchModal/CommonBases.tsx index a7b61577e00..a0fa00e946a 100644 --- a/src/components/SearchModal/CommonBases.tsx +++ b/src/components/SearchModal/CommonBases.tsx @@ -34,7 +34,7 @@ export default function CommonBases({ selectedCurrency?: Currency | null onSelect: (currency: Currency) => void }) { - const firstCurrency = chainId === 80002 ? POL : ETHER + const firstCurrency = chainId === ChainId.POLYGON_AMOY ? POL : ETHER return ( diff --git a/src/components/SearchModal/CurrencyList.tsx b/src/components/SearchModal/CurrencyList.tsx index 243fbee0758..160136c3d6c 100644 --- a/src/components/SearchModal/CurrencyList.tsx +++ b/src/components/SearchModal/CurrencyList.tsx @@ -24,7 +24,7 @@ import QuestionHelper from 'components/QuestionHelper' import useTheme from 'hooks/useTheme' function currencyKey(currency: Currency, chainId: ChainId | undefined): string { - return currency.isToken ? currency.address : chainId === 80002 ? 'POL' : 'ETHER' + return currency.isToken ? currency.address : chainId === ChainId.POLYGON_AMOY ? 'POL' : 'ETHER' } const StyledBalanceText = styled(Text)` diff --git a/src/components/SearchModal/CurrencySearch.tsx b/src/components/SearchModal/CurrencySearch.tsx index 1996f35b542..b304895fc6c 100644 --- a/src/components/SearchModal/CurrencySearch.tsx +++ b/src/components/SearchModal/CurrencySearch.tsx @@ -1,4 +1,4 @@ -import { Currency, ETHER, POL, Token } from '@alagunoff/uniswap-sdk-core' +import { ChainId, Currency, ETHER, POL, Token } from '@alagunoff/uniswap-sdk-core' import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react' import ReactGA from 'react-ga' import { useTranslation } from 'react-i18next' @@ -108,7 +108,7 @@ export function CurrencySearch({ const filteredSortedTokensWithETHOrPOL: Currency[] = useMemo(() => { const s = debouncedQuery.toLowerCase().trim() - if (chainId === 80002 && (s === '' || s === 'p' || s === 'po' || s === 'pol')) { + if (chainId === ChainId.POLYGON_AMOY && (s === '' || s === 'p' || s === 'po' || s === 'pol')) { return [POL, ...filteredSortedTokens] } @@ -145,7 +145,7 @@ export function CurrencySearch({ (e: KeyboardEvent) => { if (e.key === 'Enter') { const s = debouncedQuery.toLowerCase().trim() - if (chainId === 80002 && s === 'pol') { + if (chainId === ChainId.POLYGON_AMOY && s === 'pol') { handleCurrencySelect(POL) } else if (s === 'eth') { handleCurrencySelect(ETHER) diff --git a/src/constants/tokenLists/uniswap-default.tokenlist.json b/src/constants/tokenLists/uniswap-default.tokenlist.json index 1ce2a70ec45..dc7a1914a04 100644 --- a/src/constants/tokenLists/uniswap-default.tokenlist.json +++ b/src/constants/tokenLists/uniswap-default.tokenlist.json @@ -437,7 +437,7 @@ { "chainId": 80002, "address": "0x36fE2Bdb44f043034cb45A83C514a93a50b10489", - "name": "SHIBA INU", + "name": "Shiba inu", "symbol": "SHIB", "decimals": 18, "logoURI": "https://etherscan.io/token/images/shibainu_ofc_32.svg" @@ -445,7 +445,7 @@ { "chainId": 80002, "address": "0x24BD3A3EeabC51f11Ff724F4D0ed4b52569952c2", - "name": "USD Coin", + "name": "USDC", "symbol": "USDC", "decimals": 6, "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" @@ -453,7 +453,7 @@ { "chainId": 80002, "address": "0xF0602a35Fd6895bd62cDB4158BaC82689490afCE", - "name": "Tether USD", + "name": "Tether", "symbol": "USDT", "decimals": 6, "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png" @@ -461,7 +461,7 @@ { "chainId": 80002, "address": "0xDcaA4611e721ce9a06D568A0E45dfbBA161A28BA", - "name": "Wrapped BTC", + "name": "Wrapped Bitcoin", "symbol": "WBTC", "decimals": 8, "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png" diff --git a/src/pages/Pool/index.tsx b/src/pages/Pool/index.tsx index d8651f396e2..936fb03c772 100644 --- a/src/pages/Pool/index.tsx +++ b/src/pages/Pool/index.tsx @@ -1,4 +1,5 @@ import React, { useContext } from 'react' +import { ChainId } from '@alagunoff/uniswap-sdk-core' import { ButtonGray, ButtonOutlined, ButtonPrimary } from 'components/Button' import { AutoColumn } from 'components/Column' import { FlyoutAlignment, NewMenu } from 'components/Menu' @@ -93,7 +94,7 @@ const MainContentWrapper = styled.main` ` export default function Pool() { - const { account } = useActiveWeb3React() + const { account, chainId } = useActiveWeb3React() const toggleWalletModal = useWalletModalToggle() const { t } = useTranslation() const theme = useContext(ThemeContext) @@ -166,7 +167,11 @@ export default function Pool() { )} /> - + + {t('New Position')} diff --git a/src/state/swap/hooks.ts b/src/state/swap/hooks.ts index 6af109bc623..e9c59a0c239 100644 --- a/src/state/swap/hooks.ts +++ b/src/state/swap/hooks.ts @@ -3,7 +3,7 @@ import { Trade as V3Trade } from '@alagunoff/uniswap-v3-sdk' import { useBestV3TradeExactIn, useBestV3TradeExactOut, V3TradeState } from '../../hooks/useBestV3Trade' import useENS from '../../hooks/useENS' import { parseUnits } from '@ethersproject/units' -import { Currency, CurrencyAmount, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' +import { ChainId, Currency, CurrencyAmount, Percent, TradeType } from '@alagunoff/uniswap-sdk-core' import { Trade as V2Trade } from '@alagunoff/uniswap-v2-sdk' import { ParsedQs } from 'qs' import { useCallback, useEffect, useState } from 'react' @@ -37,7 +37,7 @@ export function useSwapActionHandlers(): { dispatch( selectCurrency({ field, - currencyId: currency.isToken ? currency.address : currency.isEther ? 'ETH' : '', + currencyId: currency.isToken ? currency.address : currency.isEther ? 'ETH' : currency.isPol ? 'POL' : '', }) ) }, @@ -226,6 +226,7 @@ function parseCurrencyFromURLParameter(urlParam: any): string { const valid = isAddress(urlParam) if (valid) return valid if (urlParam.toUpperCase() === 'ETH') return 'ETH' + if (urlParam.toUpperCase() === 'POL') return 'POL' } return '' } @@ -249,12 +250,17 @@ function validatedRecipient(recipient: any): string | null { return null } -export function queryParametersToSwapState(parsedQs: ParsedQs): SwapState { +export function queryParametersToSwapState(parsedQs: ParsedQs, chainId: ChainId): SwapState { let inputCurrency = parseCurrencyFromURLParameter(parsedQs.inputCurrency) let outputCurrency = parseCurrencyFromURLParameter(parsedQs.outputCurrency) if (inputCurrency === '' && outputCurrency === '') { - // default to ETH input - inputCurrency = 'ETH' + if (chainId === ChainId.POLYGON_AMOY) { + // default to POL input + inputCurrency = 'POL' + } else { + // default to ETH input + inputCurrency = 'ETH' + } } else if (inputCurrency === outputCurrency) { // clear output if identical outputCurrency = '' @@ -288,7 +294,7 @@ export function useDefaultsFromURLSearch(): useEffect(() => { if (!chainId) return - const parsed = queryParametersToSwapState(parsedQs) + const parsed = queryParametersToSwapState(parsedQs, chainId) dispatch( replaceSwapState({