Commit eff512de authored by Moody Salem's avatar Moody Salem

bump sdk-core

parent 562b4022
...@@ -51,12 +51,8 @@ export function useV3PositionFees( ...@@ -51,12 +51,8 @@ export function useV3PositionFees(
if (pool && amounts) { if (pool && amounts) {
return [ return [
!asWETH && unwrappedToken(pool.token0).isNative CurrencyAmount.fromRawAmount(!asWETH ? unwrappedToken(pool.token0) : pool.token0, amounts[0].toString()),
? CurrencyAmount.ether(pool.chainId, amounts[0].toString()) CurrencyAmount.fromRawAmount(!asWETH ? unwrappedToken(pool.token1) : pool.token1, amounts[1].toString()),
: CurrencyAmount.fromRawAmount(pool.token0, amounts[0].toString()),
!asWETH && unwrappedToken(pool.token1).isNative
? CurrencyAmount.ether(pool.chainId, amounts[1].toString())
: CurrencyAmount.fromRawAmount(pool.token1, amounts[1].toString()),
] ]
} else { } else {
return [undefined, undefined] return [undefined, undefined]
......
import { useCallback, useMemo } from 'react' import { useCallback, useMemo } from 'react'
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import { unwrappedToken } from '../../utils/unwrappedToken'
import { AppDispatch, AppState } from '../index' import { AppDispatch, AppState } from '../index'
import { Field, typeInput } from './actions' import { Field, typeInput } from './actions'
import { Pair } from '@uniswap/v2-sdk' import { Pair } from '@uniswap/v2-sdk'
...@@ -121,7 +122,7 @@ export function useDerivedMintInfo( ...@@ -121,7 +122,7 @@ export function useDerivedMintInfo(
? pair.priceOf(tokenA).quote(wrappedIndependentAmount) ? pair.priceOf(tokenA).quote(wrappedIndependentAmount)
: pair.priceOf(tokenB).quote(wrappedIndependentAmount) : pair.priceOf(tokenB).quote(wrappedIndependentAmount)
return dependentCurrency?.isNative return dependentCurrency?.isNative
? CurrencyAmount.ether(dependentCurrency.chainId, dependentTokenAmount.quotient) ? CurrencyAmount.fromRawAmount(unwrappedToken(dependentCurrency), dependentTokenAmount.quotient)
: dependentTokenAmount : dependentTokenAmount
} }
return undefined return undefined
......
import { Currency, Token, CurrencyAmount } from '@uniswap/sdk-core' import { Currency, Token, CurrencyAmount, Ether } from '@uniswap/sdk-core'
import JSBI from 'jsbi' import JSBI from 'jsbi'
import { useMemo } from 'react' import { useMemo } from 'react'
import { UNI } from '../../constants/tokens' import { UNI } from '../../constants/tokens'
...@@ -42,7 +42,8 @@ export function useETHBalances(uncheckedAddresses?: (string | undefined)[]): { ...@@ -42,7 +42,8 @@ export function useETHBalances(uncheckedAddresses?: (string | undefined)[]): {
() => () =>
addresses.reduce<{ [address: string]: CurrencyAmount<Currency> }>((memo, address, i) => { addresses.reduce<{ [address: string]: CurrencyAmount<Currency> }>((memo, address, i) => {
const value = results?.[i]?.result?.[0] const value = results?.[i]?.result?.[0]
if (value && chainId) memo[address] = CurrencyAmount.ether(chainId, JSBI.BigInt(value.toString())) if (value && chainId)
memo[address] = CurrencyAmount.fromRawAmount(Ether.onChain(chainId), JSBI.BigInt(value.toString()))
return memo return memo
}, {}), }, {}),
[addresses, chainId, results] [addresses, chainId, results]
......
...@@ -10,9 +10,9 @@ export function maxAmountSpend(currencyAmount?: CurrencyAmount<Currency>): Curre ...@@ -10,9 +10,9 @@ export function maxAmountSpend(currencyAmount?: CurrencyAmount<Currency>): Curre
if (!currencyAmount) return undefined if (!currencyAmount) return undefined
if (currencyAmount.currency.isNative) { if (currencyAmount.currency.isNative) {
if (JSBI.greaterThan(currencyAmount.quotient, MIN_ETH)) { if (JSBI.greaterThan(currencyAmount.quotient, MIN_ETH)) {
return CurrencyAmount.ether(currencyAmount.currency.chainId, JSBI.subtract(currencyAmount.quotient, MIN_ETH)) return CurrencyAmount.fromRawAmount(currencyAmount.currency, JSBI.subtract(currencyAmount.quotient, MIN_ETH))
} else { } else {
return CurrencyAmount.ether(currencyAmount.currency.chainId, JSBI.BigInt(0)) return CurrencyAmount.fromRawAmount(currencyAmount.currency, JSBI.BigInt(0))
} }
} }
return currencyAmount return currencyAmount
......
import { Currency, Token, WETH9, Ether } from '@uniswap/sdk-core' import { Currency, WETH9, Ether } from '@uniswap/sdk-core'
import { supportedChainId } from './supportedChainId' import { supportedChainId } from './supportedChainId'
export function unwrappedToken(currency: Token): Currency { export function unwrappedToken(currency: Currency): Currency {
if (currency.isNative) return currency if (currency.isNative) return currency
const formattedChainId = supportedChainId(currency.chainId) const formattedChainId = supportedChainId(currency.chainId)
if (formattedChainId && currency.equals(WETH9[formattedChainId])) return Ether.onChain(currency.chainId) if (formattedChainId && currency.equals(WETH9[formattedChainId])) return Ether.onChain(currency.chainId)
......
...@@ -4169,10 +4169,10 @@ ...@@ -4169,10 +4169,10 @@
resolved "https://registry.yarnpkg.com/@uniswap/merkle-distributor/-/merkle-distributor-1.0.1.tgz#dc3d911f65a860fc3f0cae074bdcd08ed6a27a4d" resolved "https://registry.yarnpkg.com/@uniswap/merkle-distributor/-/merkle-distributor-1.0.1.tgz#dc3d911f65a860fc3f0cae074bdcd08ed6a27a4d"
integrity sha512-5gDiTI5hrXIh5UWTrxKYjw30QQDnpl8ckDSpefldNenDlYO1RKkdUYMYpvrqGi2r7YzLYTlO6+TDlNs6O7hDRw== integrity sha512-5gDiTI5hrXIh5UWTrxKYjw30QQDnpl8ckDSpefldNenDlYO1RKkdUYMYpvrqGi2r7YzLYTlO6+TDlNs6O7hDRw==
"@uniswap/sdk-core@^3.0.0-alpha.2": "@uniswap/sdk-core@^3.0.0-alpha.3":
version "3.0.0-alpha.2" version "3.0.0-alpha.3"
resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-3.0.0-alpha.2.tgz#58f850a3a4e31c366a7471a92bcf704c35491cdd" resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-3.0.0-alpha.3.tgz#a742b430a9587fe48384aa5007706d225497c875"
integrity sha512-X4tqngp/HLNIbfzHLXtf25OeLtgDVHafp6bCGYR29qsWwlOJR+GlQ+cYDuR+3tOZHt6kuJcXG4rAP6vnjkcqkg== integrity sha512-SS6fFbFZT2s/oq1dCdbqLGppVszfL1dkP8uQOIgXm9qecH9Vt70zTwQU73bLP2VskFZcpkN5inTAwSZiZSs5wA==
dependencies: dependencies:
"@ethersproject/address" "^5.0.2" "@ethersproject/address" "^5.0.2"
big.js "^5.2.2" big.js "^5.2.2"
...@@ -4204,14 +4204,14 @@ ...@@ -4204,14 +4204,14 @@
"@uniswap/lib" "1.1.1" "@uniswap/lib" "1.1.1"
"@uniswap/v2-core" "1.0.0" "@uniswap/v2-core" "1.0.0"
"@uniswap/v2-sdk@^3.0.0-alpha.1": "@uniswap/v2-sdk@^3.0.0-alpha.2":
version "3.0.0-alpha.1" version "3.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@uniswap/v2-sdk/-/v2-sdk-3.0.0-alpha.1.tgz#dd5469299badc0b1d51e7a13e1d24240d3fd7fac" resolved "https://registry.yarnpkg.com/@uniswap/v2-sdk/-/v2-sdk-3.0.0-alpha.2.tgz#139a3f79091ee5aa68270bd3d1238580fd808686"
integrity sha512-AdoRY51MY7nAAKC00oNTXBZi/5f1bWEoXWy7Np5Q6zk/nnH3ImSRPUg2BOwfOKH1SHffk9yZhFKARmS8+hhGBQ== integrity sha512-LkGGZMdJueIIC3OBzgiBMV/1GdZgzTTf2qGEgBAxJUuCSFf5wZQgWNU4KOkoaBrl/FlEctAGSgGh3j3BhWKL5Q==
dependencies: dependencies:
"@ethersproject/address" "^5.0.0" "@ethersproject/address" "^5.0.0"
"@ethersproject/solidity" "^5.0.0" "@ethersproject/solidity" "^5.0.0"
"@uniswap/sdk-core" "^3.0.0-alpha.2" "@uniswap/sdk-core" "^3.0.0-alpha.3"
tiny-invariant "^1.1.0" tiny-invariant "^1.1.0"
tiny-warning "^1.0.3" tiny-warning "^1.0.3"
...@@ -4231,14 +4231,14 @@ ...@@ -4231,14 +4231,14 @@
"@uniswap/v3-core" "1.0.0" "@uniswap/v3-core" "1.0.0"
base64-sol "1.0.1" base64-sol "1.0.1"
"@uniswap/v3-sdk@^3.0.0-alpha.7": "@uniswap/v3-sdk@^3.0.0-alpha.8":
version "3.0.0-alpha.7" version "3.0.0-alpha.8"
resolved "https://registry.yarnpkg.com/@uniswap/v3-sdk/-/v3-sdk-3.0.0-alpha.7.tgz#77175c1f0bb277a7d24a6741d2bfa7e6d6bec997" resolved "https://registry.yarnpkg.com/@uniswap/v3-sdk/-/v3-sdk-3.0.0-alpha.8.tgz#eac192f13c621ab3812fbd9471e27db24fe95562"
integrity sha512-Z2APVF56aOjN9UvHXKV+d1Bccq40Fz6BexlwiwK1HEDeHyQ6v52O23usO7xfNEnenEPVscMu9bQV12W6tFMPdg== integrity sha512-7Me6xgaN2oL6S51RNJoDczs1oJsRIUzYyNtCLPc9jOjZOryw3BvxqGl++UORMxraFc0FzvRc8loyZO4AKzMJwQ==
dependencies: dependencies:
"@ethersproject/abi" "^5.0.12" "@ethersproject/abi" "^5.0.12"
"@ethersproject/solidity" "^5.0.9" "@ethersproject/solidity" "^5.0.9"
"@uniswap/sdk-core" "^3.0.0-alpha.2" "@uniswap/sdk-core" "^3.0.0-alpha.3"
"@uniswap/v3-periphery" "1.0.0" "@uniswap/v3-periphery" "1.0.0"
tiny-invariant "^1.1.0" tiny-invariant "^1.1.0"
tiny-warning "^1.0.3" tiny-warning "^1.0.3"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment