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
91157b7a
Unverified
Commit
91157b7a
authored
Dec 02, 2022
by
Vignesh Mohankumar
Committed by
GitHub
Dec 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove unused hooks, utils, components (#5524)
parent
d5e676ef
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
15 additions
and
440 deletions
+15
-440
SwapWarningDropdown.tsx
src/components/swap/SwapWarningDropdown.tsx
+0
-75
useStablecoinPrice.ts
src/hooks/useStablecoinPrice.ts
+1
-1
useTokenDetailPageQuery.tsx
src/hooks/useTokenDetailPageQuery.tsx
+0
-128
useTokenPrice.ts
src/hooks/useTokenPrice.ts
+0
-85
useTokenRelevantResources.ts
src/hooks/useTokenRelevantResources.ts
+0
-84
useCurrencyLogoURIs.ts
src/lib/hooks/useCurrencyLogoURIs.ts
+1
-1
useIsValidBlock.ts
src/lib/hooks/useIsValidBlock.ts
+1
-1
multicall.tsx
src/lib/state/multicall.tsx
+0
-3
colors.ts
src/nft/utils/colors.ts
+0
-1
toSignificant.ts
src/nft/utils/toSignificant.ts
+0
-27
x2y2.ts
src/nft/utils/x2y2.ts
+0
-6
reducer.ts
src/state/connection/reducer.ts
+2
-2
hooks.ts
src/state/governance/hooks.ts
+1
-1
hooks.ts
src/state/lists/hooks.ts
+1
-1
hooks.ts
src/state/logs/hooks.ts
+2
-2
slice.ts
src/state/logs/slice.ts
+1
-1
reducer.ts
src/state/mint/v3/reducer.ts
+1
-1
types.ts
src/state/transactions/types.ts
+1
-1
reducer.ts
src/state/user/reducer.ts
+0
-7
reducer.ts
src/state/wallets/reducer.ts
+2
-2
colors.ts
src/theme/colors.ts
+1
-1
tuple.ts
src/types/tuple.ts
+0
-4
listVersionLabel.ts
src/utils/listVersionLabel.ts
+0
-5
No files found.
src/components/swap/SwapWarningDropdown.tsx
deleted
100644 → 0
View file @
d5e676ef
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Currency
,
CurrencyAmount
,
Token
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
RowBetween
}
from
'
components/Row
'
import
{
MouseoverTooltipContent
}
from
'
components/Tooltip
'
import
{
Info
}
from
'
react-feather
'
import
{
InterfaceTrade
}
from
'
state/routing/types
'
import
styled
from
'
styled-components/macro
'
import
{
ThemedText
}
from
'
theme
'
import
{
ResponsiveTooltipContainer
}
from
'
./styleds
'
const
Wrapper
=
styled
.
div
`
background-color:
${({
theme
})
=>
theme
.
deprecated_bg1
}
;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
padding: 14px;
margin-top: -20px;
padding-top: 32px;
`
const
StyledInfoIcon
=
styled
(
Info
)
`
stroke:
${({
theme
})
=>
theme
.
deprecated_text3
}
;
`
/**
* @returns Dropdown card for showing edge case warnings outside of button
*/
export
default
function
SwapWarningDropdown
({
fiatValueInput
,
trade
,
}:
{
fiatValueInput
:
CurrencyAmount
<
Token
>
|
null
trade
:
InterfaceTrade
<
Currency
,
Currency
,
TradeType
>
|
undefined
})
{
// gas cost estimate is more than half of input value
const
showNetworkFeeWarning
=
Boolean
(
fiatValueInput
&&
trade
?.
gasUseEstimateUSD
&&
parseFloat
(
trade
.
gasUseEstimateUSD
.
toSignificant
(
6
))
>
parseFloat
(
fiatValueInput
.
toFixed
(
6
))
/
2
)
if
(
!
showNetworkFeeWarning
)
{
return
null
}
return
(
<
Wrapper
>
{
showNetworkFeeWarning
?
(
<
RowBetween
>
<
ThemedText
.
DeprecatedMain
fontSize=
"14px"
color=
"text3"
>
<
Trans
>
Network fees exceed 50% of the swap amount!
</
Trans
>
</
ThemedText
.
DeprecatedMain
>
<
MouseoverTooltipContent
wrap=
{
false
}
content=
{
<
ResponsiveTooltipContainer
origin=
"top right"
style=
{
{
padding
:
'
12px
'
}
}
>
<
ThemedText
.
DeprecatedMain
fontSize=
"12px"
color=
"text3"
maxWidth=
"200px"
>
<
Trans
>
The cost of sending this transaction is more than half of the value of the input amount.
</
Trans
>
</
ThemedText
.
DeprecatedMain
>
<
ThemedText
.
DeprecatedMain
fontSize=
"12px"
color=
"text3"
maxWidth=
"200px"
mt=
"8px"
>
<
Trans
>
You might consider waiting until the network fees go down to complete this transaction.
</
Trans
>
</
ThemedText
.
DeprecatedMain
>
</
ResponsiveTooltipContainer
>
}
placement=
"bottom"
>
<
StyledInfoIcon
size=
{
16
}
/>
</
MouseoverTooltipContent
>
</
RowBetween
>
)
:
null
}
</
Wrapper
>
)
}
src/hooks/useStablecoinPrice.ts
View file @
91157b7a
...
...
@@ -10,7 +10,7 @@ import { CUSD_CELO, DAI_OPTIMISM, USDC_ARBITRUM, USDC_MAINNET, USDC_POLYGON } fr
// Stablecoin amounts used when calculating spot price for a given currency.
// The amount is large enough to filter low liquidity pairs.
export
const
STABLECOIN_AMOUNT_OUT
:
{
[
chainId
:
number
]:
CurrencyAmount
<
Token
>
}
=
{
const
STABLECOIN_AMOUNT_OUT
:
{
[
chainId
:
number
]:
CurrencyAmount
<
Token
>
}
=
{
[
SupportedChainId
.
MAINNET
]:
CurrencyAmount
.
fromRawAmount
(
USDC_MAINNET
,
100
_000e6
),
[
SupportedChainId
.
ARBITRUM_ONE
]:
CurrencyAmount
.
fromRawAmount
(
USDC_ARBITRUM
,
10
_000e6
),
[
SupportedChainId
.
OPTIMISM
]:
CurrencyAmount
.
fromRawAmount
(
DAI_OPTIMISM
,
10
_000e18
),
...
...
src/hooks/useTokenDetailPageQuery.tsx
deleted
100644 → 0
View file @
d5e676ef
import
{
SupportedChainId
}
from
'
constants/chains
'
import
{
isAddress
}
from
'
ethers/lib/utils
'
import
{
useEffect
,
useState
}
from
'
react
'
// mock data relies on this wip reference:
// https://www.notion.so/uniswaplabs/GraphQL-Schema-eebbd70635ae4acc851e2542cb5de575
enum
Currency
{
USD
,
}
enum
TimePeriod
{
hour
=
'
hour
'
,
day
=
'
day
'
,
week
=
'
week
'
,
month
=
'
month
'
,
year
=
'
year
'
,
max
=
'
max
'
,
}
interface
HistoricalPrice
{
id
:
string
currency
:
Currency
priceInCurrency
:
number
timestamp
:
string
}
type
TokenDetailPageQueryResult
=
{
priceHistory
:
Partial
<
Record
<
SupportedChainId
,
HistoricalPrice
[]
>>
links
:
{
name
:
string
url
:
string
displayable_name
:
string
}[]
marketCap
:
number
volume
:
{
[
TimePeriod
.
day
]:
number
}
}
interface
UseTokenDetailPageQueryResult
{
data
:
TokenDetailPageQueryResult
|
null
error
:
string
|
null
loading
:
boolean
}
const
FAKE_TOKEN_DETAIL_PAGE_QUERY_RESULT
:
TokenDetailPageQueryResult
=
{
priceHistory
:
{
[
SupportedChainId
.
MAINNET
]:
[
{
id
:
'
string
'
,
currency
:
Currency
.
USD
,
priceInCurrency
:
1000
,
timestamp
:
'
Sat Jul 23 2022 08:35:30 GMT-0000
'
,
},
{
id
:
'
string
'
,
currency
:
Currency
.
USD
,
priceInCurrency
:
1100
,
timestamp
:
'
Sat Jul 23 2022 09:35:30 GMT-0000
'
,
},
{
id
:
'
string
'
,
currency
:
Currency
.
USD
,
priceInCurrency
:
900
,
timestamp
:
'
Sat Jul 23 2022 10:35:30 GMT-0000
'
,
},
],
},
links
:
[
{
name
:
'
github
'
,
url
:
'
https://github.com/JFrankfurt
'
,
displayable_name
:
'
Github
'
,
},
{
name
:
'
twitter
'
,
url
:
'
https://twitter.com/JordanFrankfurt
'
,
displayable_name
:
'
Twitter
'
,
},
],
marketCap
:
1
_000_000_000
,
volume
:
{
[
TimePeriod
.
day
]:
1
_000_000
,
},
}
const
useTokenDetailPageQuery
=
(
tokenAddress
:
string
|
undefined
):
UseTokenDetailPageQueryResult
=>
{
const
[
data
,
setData
]
=
useState
<
TokenDetailPageQueryResult
|
null
>
(
null
)
const
[
error
,
setError
]
=
useState
<
string
|
null
>
(
null
)
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
fetchTokenDetails
=
async
(
addresses
:
string
):
Promise
<
TokenDetailPageQueryResult
|
void
>
=>
{
const
waitRandom
=
(
min
:
number
,
max
:
number
):
Promise
<
void
>
=>
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
min
+
Math
.
round
(
Math
.
random
()
*
Math
.
max
(
0
,
max
-
min
))))
try
{
setLoading
(
true
)
setError
(
null
)
await
waitRandom
(
250
,
2000
)
if
(
Math
.
random
()
<
0.05
)
{
throw
new
Error
(
'
fake error
'
)
}
console
.
log
(
'
fetchTokenDetails
'
,
addresses
)
return
FAKE_TOKEN_DETAIL_PAGE_QUERY_RESULT
}
catch
(
e
)
{
setError
(
'
something went wrong
'
)
}
finally
{
setLoading
(
false
)
}
}
useEffect
(()
=>
{
if
(
tokenAddress
&&
isAddress
(
tokenAddress
))
{
setLoading
(
true
)
setError
(
null
)
fetchTokenDetails
(
tokenAddress
)
.
then
((
data
)
=>
{
if
(
data
)
setData
(
data
)
})
.
catch
((
e
)
=>
setError
(
e
))
.
finally
(()
=>
setLoading
(
false
))
}
},
[
tokenAddress
])
return
{
data
,
error
,
loading
}
}
export
default
useTokenDetailPageQuery
src/hooks/useTokenPrice.ts
deleted
100644 → 0
View file @
d5e676ef
import
{
useEffect
,
useState
}
from
'
react
'
enum
TimePeriod
{
hour
=
'
hour
'
,
day
=
'
day
'
,
week
=
'
week
'
,
month
=
'
month
'
,
year
=
'
year
'
,
}
type
Dictionary
<
K
extends
keyof
any
,
T
>
=
Partial
<
Record
<
K
,
T
>>
type
TokenData
=
{
[
address
:
string
]:
{
price
:
number
delta
:
Dictionary
<
TimePeriod
,
number
>
}
}
interface
UseTokenPriceResult
{
data
:
TokenData
|
null
error
:
string
|
null
loading
:
boolean
}
const
FAKE_TOKEN_PRICE_RESULT
=
{
'
0x03ab458634910aad20ef5f1c8ee96f1d6ac54919
'
:
{
price
:
3.05
,
delta
:
{
[
TimePeriod
.
hour
]:
25
_000
,
[
TimePeriod
.
day
]:
619
_000
,
[
TimePeriod
.
week
]:
16
_800_000
,
[
TimePeriod
.
month
]:
58
_920_000
,
},
},
'
0x0cec1a9154ff802e7934fc916ed7ca50bde6844e
'
:
{
price
:
0.66543
,
delta
:
{
[
TimePeriod
.
hour
]:
5
_000
,
[
TimePeriod
.
day
]:
100
_000
,
[
TimePeriod
.
week
]:
800
_000
,
[
TimePeriod
.
month
]:
4
_920_000
,
},
},
}
const
useTokenPrice
=
(
tokenAddresses
:
Set
<
string
>
):
UseTokenPriceResult
=>
{
const
[
data
,
setData
]
=
useState
<
TokenData
|
null
>
(
null
)
const
[
error
,
setError
]
=
useState
<
string
|
null
>
(
null
)
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
fetchTokenPrices
=
async
(
addresses
:
Set
<
string
>
):
Promise
<
TokenData
|
void
>
=>
{
const
waitRandom
=
(
min
:
number
,
max
:
number
):
Promise
<
void
>
=>
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
min
+
Math
.
round
(
Math
.
random
()
*
Math
.
max
(
0
,
max
-
min
))))
try
{
setLoading
(
true
)
setError
(
null
)
await
waitRandom
(
250
,
2000
)
if
(
Math
.
random
()
<
0.05
)
{
throw
new
Error
(
'
fake error
'
)
}
console
.
log
(
'
fetchTokenPrices
'
,
addresses
)
return
FAKE_TOKEN_PRICE_RESULT
}
catch
(
e
)
{
setError
(
'
something went wrong
'
)
}
finally
{
setLoading
(
false
)
}
}
useEffect
(()
=>
{
setLoading
(
true
)
setError
(
null
)
fetchTokenPrices
(
tokenAddresses
)
.
then
((
data
)
=>
{
if
(
data
)
setData
(
data
)
})
.
catch
((
e
)
=>
setError
(
e
))
.
finally
(()
=>
setLoading
(
false
))
},
[
tokenAddresses
])
return
{
data
,
error
,
loading
}
}
export
default
useTokenPrice
src/hooks/useTokenRelevantResources.ts
deleted
100644 → 0
View file @
d5e676ef
import
{
useEffect
,
useState
}
from
'
react
'
interface
RelevantResource
{
name
:
string
url
:
string
displayName
:
string
}
interface
RelevantResourcesMap
{
[
address
:
string
]:
RelevantResource
[]
}
interface
useTokenRelevantResourcesResult
{
data
:
RelevantResourcesMap
|
null
error
:
string
|
null
loading
:
boolean
}
const
FAKE_TOKEN_RELEVANT_RESOURCES
=
{
'
0x03ab458634910aad20ef5f1c8ee96f1d6ac54919
'
:
[
{
name
:
'
github
'
,
url
:
'
https://github.com/reflexer-labs/
'
,
displayName
:
'
Github
'
,
},
{
name
:
'
website
'
,
url
:
'
https://reflexer.finance/
'
,
displayName
:
'
reflexer.finance
'
,
},
],
'
0x0cec1a9154ff802e7934fc916ed7ca50bde6844e
'
:
[
{
name
:
'
github
'
,
url
:
'
https://github.com/pooltogether/
'
,
displayName
:
'
Github
'
,
},
{
name
:
'
website
'
,
url
:
'
https://pooltogether.com/
'
,
displayName
:
'
pooltogether.com
'
,
},
],
}
const
useTokenRelevantResources
=
(
addresses
:
Set
<
string
>
):
useTokenRelevantResourcesResult
=>
{
const
[
data
,
setData
]
=
useState
<
RelevantResourcesMap
|
null
>
(
null
)
const
[
error
,
setError
]
=
useState
<
string
|
null
>
(
null
)
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
fetchRelevantResources
=
async
(
addresses
:
Set
<
string
>
):
Promise
<
RelevantResourcesMap
|
void
>
=>
{
const
waitRandom
=
(
min
:
number
,
max
:
number
):
Promise
<
void
>
=>
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
min
+
Math
.
round
(
Math
.
random
()
*
Math
.
max
(
0
,
max
-
min
))))
try
{
setLoading
(
true
)
setError
(
null
)
console
.
log
(
'
useTokenRelevantResources.fetchRelevantResources
'
,
addresses
)
await
waitRandom
(
250
,
2000
)
if
(
Math
.
random
()
<
0.05
)
{
throw
new
Error
(
'
fake error
'
)
}
return
FAKE_TOKEN_RELEVANT_RESOURCES
}
catch
(
e
)
{
setError
(
'
something went wrong
'
)
}
finally
{
setLoading
(
false
)
}
}
useEffect
(()
=>
{
setLoading
(
true
)
setError
(
null
)
fetchRelevantResources
(
addresses
)
.
then
((
data
)
=>
{
if
(
data
)
setData
(
data
)
})
.
catch
((
e
)
=>
setError
(
e
))
.
finally
(()
=>
setLoading
(
false
))
},
[
addresses
])
return
{
data
,
error
,
loading
}
}
export
default
useTokenRelevantResources
src/lib/hooks/useCurrencyLogoURIs.ts
View file @
91157b7a
...
...
@@ -38,7 +38,7 @@ export function getNativeLogoURI(chainId: SupportedChainId = SupportedChainId.MA
}
}
export
function
getTokenLogoURI
(
address
:
string
,
chainId
:
SupportedChainId
=
SupportedChainId
.
MAINNET
):
string
|
void
{
function
getTokenLogoURI
(
address
:
string
,
chainId
:
SupportedChainId
=
SupportedChainId
.
MAINNET
):
string
|
void
{
const
networkName
=
chainIdToNetworkName
(
chainId
)
const
networksWithUrls
=
[
SupportedChainId
.
ARBITRUM_ONE
,
SupportedChainId
.
MAINNET
,
SupportedChainId
.
OPTIMISM
]
if
(
networksWithUrls
.
includes
(
chainId
))
{
...
...
src/lib/hooks/useIsValidBlock.ts
View file @
91157b7a
...
...
@@ -10,7 +10,7 @@ const oldestBlockMapAtom = atomWithImmer<{ [chainId: number]: number }>({})
const
DEFAULT_MAX_BLOCK_AGE
=
10
export
function
useGetIsValidBlock
(
maxBlockAge
=
DEFAULT_MAX_BLOCK_AGE
):
(
block
:
number
)
=>
boolean
{
function
useGetIsValidBlock
(
maxBlockAge
=
DEFAULT_MAX_BLOCK_AGE
):
(
block
:
number
)
=>
boolean
{
const
{
chainId
}
=
useWeb3React
()
const
currentBlock
=
useBlockNumber
()
const
oldestBlockMap
=
useAtomValue
(
oldestBlockMapAtom
)
...
...
src/lib/state/multicall.tsx
View file @
91157b7a
...
...
@@ -4,11 +4,8 @@ import { SupportedChainId } from 'constants/chains'
import
{
useInterfaceMulticall
}
from
'
hooks/useContract
'
import
useBlockNumber
from
'
lib/hooks/useBlockNumber
'
import
{
useMemo
}
from
'
react
'
import
{
combineReducers
,
createStore
}
from
'
redux
'
const
multicall
=
createMulticall
()
const
reducer
=
combineReducers
({
[
multicall
.
reducerPath
]:
multicall
.
reducer
})
export
const
store
=
createStore
(
reducer
)
export
default
multicall
...
...
src/nft/utils/colors.ts
deleted
100644 → 0
View file @
d5e676ef
export
const
backgrounds
=
[
'
#5DCCB9
'
,
'
#9AFBCF
'
,
'
#D1F8E7
'
,
'
#73F54B
'
,
'
#D3FB51
'
,
'
#FCF958
'
]
src/nft/utils/toSignificant.ts
deleted
100644 → 0
View file @
d5e676ef
/**
* Format number in human-readable way
* @example
* ```js
* nFormat(134_256) // => 134K
* ```
* @param num number to format
* @param digits digits after decimal point
* @returns formatted number string
*/
export
function
nFormat
(
num
:
number
,
digits
=
0
):
string
{
const
lookup
=
[
{
value
:
1
,
symbol
:
''
},
//{ value: 1e3, symbol: 'K' },
{
value
:
1
e6
,
symbol
:
'
M
'
},
{
value
:
1
e9
,
symbol
:
'
B
'
},
{
value
:
1
e12
,
symbol
:
'
T
'
},
{
value
:
1
e15
,
symbol
:
'
Qa
'
},
{
value
:
1
e18
,
symbol
:
'
Qi
'
},
]
const
rx
=
/
\.
0+$|
(\.[
0-9
]
*
[
1-9
])
0+$/
const
item
=
lookup
.
slice
()
.
reverse
()
.
find
((
item
)
=>
num
>=
item
.
value
)
return
item
?
(
num
/
item
.
value
).
toFixed
(
digits
).
replace
(
rx
,
'
$1
'
)
+
item
.
symbol
:
'
0
'
}
src/nft/utils/x2y2.ts
View file @
91157b7a
...
...
@@ -62,12 +62,6 @@ export type OrderPayload = {
isCollection
:
boolean
}
export
type
OrderResp
=
{
success
:
boolean
code
:
number
error
?:
string
}
const
randomSalt
=
()
=>
{
const
randomHex
=
BigNumber
.
from
(
randomBytes
(
16
)).
toHexString
()
return
hexZeroPad
(
randomHex
,
64
)
...
...
src/state/connection/reducer.ts
View file @
91157b7a
import
{
createSlice
}
from
'
@reduxjs/toolkit
'
import
{
ConnectionType
}
from
'
connection
'
export
interface
ConnectionState
{
interface
ConnectionState
{
errorByConnectionType
:
Record
<
ConnectionType
,
string
|
undefined
>
}
export
const
initialState
:
ConnectionState
=
{
const
initialState
:
ConnectionState
=
{
errorByConnectionType
:
{
[
ConnectionType
.
INJECTED
]:
undefined
,
[
ConnectionType
.
WALLET_CONNECT
]:
undefined
,
...
...
src/state/governance/hooks.ts
View file @
91157b7a
...
...
@@ -52,7 +52,7 @@ function useGovernanceBravoContract(): Contract | null {
const
useLatestGovernanceContract
=
useGovernanceBravoContract
export
function
useUniContract
()
{
function
useUniContract
()
{
const
{
chainId
}
=
useWeb3React
()
const
uniAddress
=
useMemo
(()
=>
(
chainId
?
UNI
[
chainId
]?.
address
:
undefined
),
[
chainId
])
return
useContract
(
uniAddress
,
UNI_ABI
,
true
)
...
...
src/state/lists/hooks.ts
View file @
91157b7a
...
...
@@ -22,7 +22,7 @@ export function useAllLists(): AppState['lists']['byUrl'] {
* @param map1 the base token map
* @param map2 the map of additioanl tokens to add to the base map
*/
export
function
combineMaps
(
map1
:
TokenAddressMap
,
map2
:
TokenAddressMap
):
TokenAddressMap
{
function
combineMaps
(
map1
:
TokenAddressMap
,
map2
:
TokenAddressMap
):
TokenAddressMap
{
const
chainIds
=
Object
.
keys
(
Object
.
keys
(
map1
)
.
concat
(
Object
.
keys
(
map2
))
...
...
src/state/logs/hooks.ts
View file @
91157b7a
...
...
@@ -7,7 +7,7 @@ import { useAppDispatch, useAppSelector } from '../hooks'
import
{
addListener
,
removeListener
}
from
'
./slice
'
import
{
filterToKey
,
isHistoricalLog
,
Log
}
from
'
./utils
'
e
xport
e
num
LogsState
{
enum
LogsState
{
// The filter is invalid
INVALID
,
// The logs are being loaded
...
...
@@ -20,7 +20,7 @@ export enum LogsState {
SYNCED
,
}
export
interface
UseLogsResult
{
interface
UseLogsResult
{
logs
:
Log
[]
|
undefined
state
:
LogsState
}
...
...
src/state/logs/slice.ts
View file @
91157b7a
...
...
@@ -3,7 +3,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import
{
filterToKey
,
Log
}
from
'
./utils
'
export
interface
LogsState
{
interface
LogsState
{
[
chainId
:
number
]:
{
[
filterKey
:
string
]:
{
listeners
:
number
...
...
src/state/mint/v3/reducer.ts
View file @
91157b7a
...
...
@@ -10,7 +10,7 @@ import {
typeStartPriceInput
,
}
from
'
./actions
'
export
type
FullRange
=
true
type
FullRange
=
true
interface
MintState
{
readonly
independentField
:
Field
...
...
src/state/transactions/types.ts
View file @
91157b7a
...
...
@@ -37,7 +37,7 @@ export enum TransactionType {
EXECUTE
,
}
export
interface
BaseTransactionInfo
{
interface
BaseTransactionInfo
{
type
:
TransactionType
}
...
...
src/state/user/reducer.ts
View file @
91157b7a
...
...
@@ -53,8 +53,6 @@ export interface UserState {
// undefined means has not gone through A/B split yet
showSurveyPopup
:
boolean
|
undefined
showDonationLink
:
boolean
hideNFTWelcomeModal
:
boolean
}
...
...
@@ -79,7 +77,6 @@ export const initialState: UserState = {
URLWarningVisible
:
true
,
hideNFTPromoBanner
:
false
,
showSurveyPopup
:
undefined
,
showDonationLink
:
true
,
hideNFTWelcomeModal
:
false
,
}
...
...
@@ -123,9 +120,6 @@ const userSlice = createSlice({
updateShowSurveyPopup
(
state
,
action
)
{
state
.
showSurveyPopup
=
action
.
payload
.
showSurveyPopup
},
updateShowDonationLink
(
state
,
action
)
{
state
.
showDonationLink
=
action
.
payload
.
showDonationLink
},
updateHideNFTWelcomeModal
(
state
,
action
)
{
state
.
hideNFTWelcomeModal
=
action
.
payload
.
hideNFTWelcomeModal
},
...
...
@@ -213,7 +207,6 @@ export const {
removeSerializedToken
,
updateHideClosedPositions
,
updateMatchesDarkMode
,
updateShowDonationLink
,
updateShowSurveyPopup
,
updateUserClientSideRouter
,
updateHideNFTWelcomeModal
,
...
...
src/state/wallets/reducer.ts
View file @
91157b7a
...
...
@@ -5,11 +5,11 @@ import { Wallet } from './types'
/* Used to track wallets that have been connected by the user in current session, and remove them when deliberately disconnected.
Used to compute is_reconnect event property for analytics */
export
interface
WalletState
{
interface
WalletState
{
connectedWallets
:
Wallet
[]
}
export
const
initialState
:
WalletState
=
{
const
initialState
:
WalletState
=
{
connectedWallets
:
[],
}
...
...
src/theme/colors.ts
View file @
91157b7a
...
...
@@ -95,7 +95,7 @@ export const colors = {
networkEthereumSoft
:
'
rgba(98, 126, 234, 0.16)
'
,
}
export
type
Theme
=
typeof
darkTheme
type
Theme
=
typeof
darkTheme
const
commonTheme
=
{
white
:
colors
.
white
,
...
...
src/types/tuple.ts
View file @
91157b7a
...
...
@@ -7,8 +7,4 @@ export type TupleSplit<T, N extends number, O extends readonly any[] = readonly
?
TupleSplit
<
readonly
[...
R
],
N
,
readonly
[...
O
,
F
]
>
:
[
O
,
T
]
export
type
TakeFirst
<
T
extends
readonly
any
[],
N
extends
number
>
=
TupleSplit
<
T
,
N
>
[
0
]
export
type
SkipFirst
<
T
extends
readonly
any
[],
N
extends
number
>
=
TupleSplit
<
T
,
N
>
[
1
]
export
type
NonNullable
<
T
>
=
T
extends
null
|
undefined
?
never
:
T
src/utils/listVersionLabel.ts
deleted
100644 → 0
View file @
d5e676ef
import
{
Version
}
from
'
@uniswap/token-lists
'
export
default
function
listVersionLabel
(
version
:
Version
):
string
{
return
`v
${
version
.
major
}
.
${
version
.
minor
}
.
${
version
.
patch
}
`
}
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