Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
3aa04530
Unverified
Commit
3aa04530
authored
May 12, 2021
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove a few unused isToken calls
parent
e0a7c379
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
15 deletions
+10
-15
CurrencyList.tsx
src/components/SearchModal/CurrencyList.tsx
+2
-2
PoolCard.tsx
src/components/earn/PoolCard.tsx
+1
-3
StakingModal.tsx
src/components/earn/StakingModal.tsx
+1
-1
useBestV3Trade.ts
src/hooks/useBestV3Trade.ts
+1
-3
useIsSwapUnsupported.ts
src/hooks/useIsSwapUnsupported.ts
+2
-2
index.ts
src/utils/index.ts
+3
-4
No files found.
src/components/SearchModal/CurrencyList.tsx
View file @
3aa04530
...
...
@@ -114,7 +114,7 @@ function CurrencyRow({
const
{
account
}
=
useActiveWeb3React
()
const
key
=
currencyKey
(
currency
)
const
selectedTokenList
=
useCombinedActiveList
()
const
isOnSelectedList
=
isTokenOnList
(
selectedTokenList
,
currency
)
const
isOnSelectedList
=
isTokenOnList
(
selectedTokenList
,
currency
.
isToken
?
currency
:
undefined
)
const
customAdded
=
useIsUserAddedToken
(
currency
)
const
balance
=
useCurrencyBalance
(
account
??
undefined
,
currency
)
...
...
@@ -133,7 +133,7 @@ function CurrencyRow({
{
currency
.
symbol
}
</
Text
>
<
TYPE
.
darkGray
ml=
"0px"
fontSize=
{
'
12px
'
}
fontWeight=
{
300
}
>
{
currency
.
name
}
{
!
isOnSelectedList
&&
customAdded
&&
'
• Added by user
'
}
{
currency
.
name
}
{
!
currency
.
isEther
&&
!
isOnSelectedList
&&
customAdded
&&
'
• Added by user
'
}
</
TYPE
.
darkGray
>
</
Column
>
<
TokenTags
currency=
{
currency
}
/>
...
...
src/components/earn/PoolCard.tsx
View file @
3aa04530
...
...
@@ -83,9 +83,7 @@ export default function PoolCard({ stakingInfo }: { stakingInfo: StakingInfo })
const
WETH
=
currency0
.
isEther
?
token0
:
token1
const
backgroundColor
=
useColor
(
token
)
const
totalSupplyOfStakingToken
=
useTotalSupply
(
stakingInfo
.
stakedAmount
.
currency
.
isToken
?
stakingInfo
.
stakedAmount
.
currency
:
undefined
)
const
totalSupplyOfStakingToken
=
useTotalSupply
(
stakingInfo
.
stakedAmount
.
currency
)
const
[,
stakingTokenPair
]
=
useV2Pair
(...
stakingInfo
.
tokens
)
// let returnOverMonth: Percent = new Percent('0')
...
...
src/components/earn/StakingModal.tsx
View file @
3aa04530
...
...
@@ -50,7 +50,7 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
const
[
typedValue
,
setTypedValue
]
=
useState
(
''
)
const
{
parsedAmount
,
error
}
=
useDerivedStakeInfo
(
typedValue
,
stakingInfo
.
stakedAmount
.
currency
.
isToken
?
stakingInfo
.
stakedAmount
.
currency
:
undefined
,
stakingInfo
.
stakedAmount
.
currency
,
userLiquidityUnstaked
)
const
parsedAmountWrapped
=
wrappedCurrencyAmount
(
parsedAmount
,
chainId
)
...
...
src/hooks/useBestV3Trade.ts
View file @
3aa04530
...
...
@@ -89,9 +89,7 @@ export function useBestV3TradeExactIn(
route
:
bestRoute
,
tradeType
:
TradeType
.
EXACT_INPUT
,
inputAmount
:
amountIn
,
outputAmount
:
currencyOut
.
isToken
?
CurrencyAmount
.
fromRawAmount
(
currencyOut
,
amountOut
.
toString
())
:
CurrencyAmount
.
ether
(
amountOut
.
toString
()),
outputAmount
:
CurrencyAmount
.
fromRawAmount
(
currencyOut
,
amountOut
.
toString
()),
}),
}
},
[
amountIn
,
currencyOut
,
quotesResults
,
routes
,
routesLoading
])
...
...
src/hooks/useIsSwapUnsupported.ts
View file @
3aa04530
...
...
@@ -14,8 +14,8 @@ export function useIsSwapUnsupported(currencyIn?: Currency, currencyOut?: Curren
// if unsupported list loaded & either token on list, mark as unsupported
return
Boolean
(
unsupportedTokens
&&
((
currencyIn
&&
currencyIn
.
isToken
&&
unsupportedTokens
[
currencyIn
.
address
])
||
(
currencyOut
&&
currencyOut
.
isToken
&&
unsupportedTokens
[
currencyOut
.
address
]))
((
currencyIn
?
.
isToken
&&
unsupportedTokens
[
currencyIn
.
address
])
||
(
currencyOut
?
.
isToken
&&
unsupportedTokens
[
currencyOut
.
address
]))
)
},
[
currencyIn
,
currencyOut
,
unsupportedTokens
])
}
src/utils/index.ts
View file @
3aa04530
...
...
@@ -3,7 +3,7 @@ import { getAddress } from '@ethersproject/address'
import
{
AddressZero
}
from
'
@ethersproject/constants
'
import
{
JsonRpcSigner
,
Web3Provider
}
from
'
@ethersproject/providers
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
ChainId
,
Percent
,
CurrencyAmount
,
Currency
,
Fraction
}
from
'
@uniswap/sdk-core
'
import
{
ChainId
,
Percent
,
CurrencyAmount
,
Currency
,
Fraction
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
FeeAmount
}
from
'
@uniswap/v3-sdk/dist/
'
import
JSBI
from
'
jsbi
'
import
{
TokenAddressMap
}
from
'
../state/lists/hooks
'
...
...
@@ -92,9 +92,8 @@ export function escapeRegExp(string: string): string {
return
string
.
replace
(
/
[
.*+?^${}()|[
\]\\]
/g
,
'
\\
$&
'
)
// $& means the whole matched string
}
export
function
isTokenOnList
(
defaultTokens
:
TokenAddressMap
,
currency
?:
Currency
):
boolean
{
if
(
currency
?.
isEther
)
return
true
return
Boolean
(
currency
?.
isToken
&&
defaultTokens
[
currency
.
chainId
as
ChainId
]?.[
currency
.
address
])
export
function
isTokenOnList
(
tokenAddressMap
:
TokenAddressMap
,
token
?:
Token
):
boolean
{
return
Boolean
(
token
?.
isToken
&&
tokenAddressMap
[
token
.
chainId
as
ChainId
]?.[
token
.
address
])
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment