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
bd346030
Unverified
Commit
bd346030
authored
Apr 24, 2021
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
useAllV3Routes, some cleanup
parent
aa742f41
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
24 deletions
+12
-24
package.json
package.json
+2
-3
index.ts
src/constants/index.ts
+1
-2
index.ts
src/constants/v3/index.ts
+6
-0
reducer.ts
src/state/lists/reducer.ts
+1
-1
updater.ts
src/state/lists/updater.ts
+1
-11
wrappedCurrency.ts
src/utils/wrappedCurrency.ts
+1
-7
No files found.
package.json
View file @
bd346030
...
@@ -43,14 +43,13 @@
...
@@ -43,14 +43,13 @@
"
@uniswap/governance
"
:
"
^1.0.2
"
,
"
@uniswap/governance
"
:
"
^1.0.2
"
,
"
@uniswap/liquidity-staker
"
:
"
^1.0.2
"
,
"
@uniswap/liquidity-staker
"
:
"
^1.0.2
"
,
"
@uniswap/merkle-distributor
"
:
"
1.0.1
"
,
"
@uniswap/merkle-distributor
"
:
"
1.0.1
"
,
"
@uniswap/sdk-core
"
:
"
^1.0.9
"
,
"
@uniswap/token-lists
"
:
"
^1.0.0-beta.19
"
,
"
@uniswap/token-lists
"
:
"
^1.0.0-beta.19
"
,
"
@uniswap/v2-core
"
:
"
1.0.0
"
,
"
@uniswap/v2-core
"
:
"
1.0.0
"
,
"
@uniswap/v2-periphery
"
:
"
^1.1.0-beta.0
"
,
"
@uniswap/v2-periphery
"
:
"
^1.1.0-beta.0
"
,
"
@uniswap/v2-sdk
"
:
"
^1.0.
7
"
,
"
@uniswap/v2-sdk
"
:
"
^1.0.
8
"
,
"
@uniswap/v3-core
"
:
"
^1.0.0-rc.2
"
,
"
@uniswap/v3-core
"
:
"
^1.0.0-rc.2
"
,
"
@uniswap/v3-periphery
"
:
"
^1.0.0-beta.20
"
,
"
@uniswap/v3-periphery
"
:
"
^1.0.0-beta.20
"
,
"
@uniswap/v3-sdk
"
:
"
^1.0.0-alpha.1
8
"
,
"
@uniswap/v3-sdk
"
:
"
^1.0.0-alpha.1
9
"
,
"
@web3-react/core
"
:
"
^6.0.9
"
,
"
@web3-react/core
"
:
"
^6.0.9
"
,
"
@web3-react/fortmatic-connector
"
:
"
^6.0.9
"
,
"
@web3-react/fortmatic-connector
"
:
"
^6.0.9
"
,
"
@web3-react/injected-connector
"
:
"
^6.0.7
"
,
"
@web3-react/injected-connector
"
:
"
^6.0.7
"
,
...
...
src/constants/index.ts
View file @
bd346030
...
@@ -26,7 +26,7 @@ export { PRELOADED_PROPOSALS } from './proposals'
...
@@ -26,7 +26,7 @@ export { PRELOADED_PROPOSALS } from './proposals'
// a list of tokens by chain
// a list of tokens by chain
type
ChainTokenList
=
{
type
ChainTokenList
=
{
readonly
[
chainId
in
ChainId
|
1337
]:
Token
[]
readonly
[
chainId
in
ChainId
]:
Token
[]
}
}
export
const
AMPL
=
new
Token
(
ChainId
.
MAINNET
,
'
0xD46bA6D942050d489DBd938a2C909A5d5039A161
'
,
9
,
'
AMPL
'
,
'
Ampleforth
'
)
export
const
AMPL
=
new
Token
(
ChainId
.
MAINNET
,
'
0xD46bA6D942050d489DBd938a2C909A5d5039A161
'
,
9
,
'
AMPL
'
,
'
Ampleforth
'
)
...
@@ -74,7 +74,6 @@ const WETH_ONLY: ChainTokenList = {
...
@@ -74,7 +74,6 @@ const WETH_ONLY: ChainTokenList = {
[
ChainId
.
RINKEBY
]:
[
WETH9
[
ChainId
.
RINKEBY
]],
[
ChainId
.
RINKEBY
]:
[
WETH9
[
ChainId
.
RINKEBY
]],
[
ChainId
.
G
Ö
RLI
]:
[
WETH9
[
ChainId
.
G
Ö
RLI
]],
[
ChainId
.
G
Ö
RLI
]:
[
WETH9
[
ChainId
.
G
Ö
RLI
]],
[
ChainId
.
KOVAN
]:
[
WETH9
[
ChainId
.
KOVAN
]],
[
ChainId
.
KOVAN
]:
[
WETH9
[
ChainId
.
KOVAN
]],
[
1337
]:
[
WETH9
[
ChainId
.
KOVAN
]],
}
}
// used to construct intermediary pairs for trading
// used to construct intermediary pairs for trading
...
...
src/constants/v3/index.ts
View file @
bd346030
...
@@ -6,6 +6,12 @@ export const V3_CORE_FACTORY_ADDRESSES: { [chainId in ChainId]?: string } = {
...
@@ -6,6 +6,12 @@ export const V3_CORE_FACTORY_ADDRESSES: { [chainId in ChainId]?: string } = {
[
ChainId
.
KOVAN
]:
'
0x58f6b77148BE49BF7898472268ae8f26377d0AA6
'
,
[
ChainId
.
KOVAN
]:
'
0x58f6b77148BE49BF7898472268ae8f26377d0AA6
'
,
}
}
export
const
QUOTER_ADDRESSES
:
{
[
chainId
in
ChainId
]?:
string
}
=
{
[
ChainId
.
RINKEBY
]:
'
0x91a64CCaead471caFF912314E466D9CF7C55E0E8
'
,
[
ChainId
.
G
Ö
RLI
]:
'
0x3d137e860008BaF6d1c063158e5ec0baBbcFefF8
'
,
[
ChainId
.
KOVAN
]:
'
0x865F20efC14A5186bF985aD42c64f5e71C055376
'
,
}
export
const
TICK_LENS_ADDRESSES
:
{
[
chainId
in
ChainId
]?:
string
}
=
{
export
const
TICK_LENS_ADDRESSES
:
{
[
chainId
in
ChainId
]?:
string
}
=
{
[
ChainId
.
RINKEBY
]:
'
0x3d137e860008BaF6d1c063158e5ec0baBbcFefF8
'
,
[
ChainId
.
RINKEBY
]:
'
0x3d137e860008BaF6d1c063158e5ec0baBbcFefF8
'
,
[
ChainId
.
G
Ö
RLI
]:
'
0x80AacDBEe92DC1c2Fbaa261Fb369696AF1AD9f98
'
,
[
ChainId
.
G
Ö
RLI
]:
'
0x80AacDBEe92DC1c2Fbaa261Fb369696AF1AD9f98
'
,
...
...
src/state/lists/reducer.ts
View file @
bd346030
...
@@ -36,7 +36,7 @@ type Mutable<T> = { -readonly [P in keyof T]: T[P] extends ReadonlyArray<infer U
...
@@ -36,7 +36,7 @@ type Mutable<T> = { -readonly [P in keyof T]: T[P] extends ReadonlyArray<infer U
const
initialState
:
ListsState
=
{
const
initialState
:
ListsState
=
{
lastInitializedDefaultListOfLists
:
DEFAULT_LIST_OF_LISTS
,
lastInitializedDefaultListOfLists
:
DEFAULT_LIST_OF_LISTS
,
byUrl
:
{
byUrl
:
{
...
DEFAULT_LIST_OF_LISTS
.
concat
(
...
UNSUPPORTED_LIST_URLS
).
reduce
<
Mutable
<
ListsState
[
'
byUrl
'
]
>>
((
memo
,
listUrl
)
=>
{
...
DEFAULT_LIST_OF_LISTS
.
concat
(
UNSUPPORTED_LIST_URLS
).
reduce
<
Mutable
<
ListsState
[
'
byUrl
'
]
>>
((
memo
,
listUrl
)
=>
{
memo
[
listUrl
]
=
NEW_LIST_STATE
memo
[
listUrl
]
=
NEW_LIST_STATE
return
memo
return
memo
},
{}),
},
{}),
...
...
src/state/lists/updater.ts
View file @
bd346030
...
@@ -47,17 +47,7 @@ export default function Updater(): null {
...
@@ -47,17 +47,7 @@ export default function Updater(): null {
// if any lists from unsupported lists are loaded, check them too (in case new updates since last visit)
// if any lists from unsupported lists are loaded, check them too (in case new updates since last visit)
useEffect
(()
=>
{
useEffect
(()
=>
{
Object
.
keys
(
UNSUPPORTED_LIST_URLS
).
forEach
((
listUrl
)
=>
{
UNSUPPORTED_LIST_URLS
.
forEach
((
listUrl
)
=>
{
const
list
=
lists
[
listUrl
]
if
(
!
list
||
(
!
list
.
current
&&
!
list
.
loadingRequestId
&&
!
list
.
error
))
{
fetchList
(
listUrl
).
catch
((
error
)
=>
console
.
debug
(
'
list added fetching error
'
,
error
))
}
})
},
[
dispatch
,
fetchList
,
library
,
lists
])
// if any lists from unsupported lists are loaded, check them too (in case new updates since last visit)
useEffect
(()
=>
{
Object
.
keys
(
UNSUPPORTED_LIST_URLS
).
forEach
((
listUrl
)
=>
{
const
list
=
lists
[
listUrl
]
const
list
=
lists
[
listUrl
]
if
(
!
list
||
(
!
list
.
current
&&
!
list
.
loadingRequestId
&&
!
list
.
error
))
{
if
(
!
list
||
(
!
list
.
current
&&
!
list
.
loadingRequestId
&&
!
list
.
error
))
{
fetchList
(
listUrl
).
catch
((
error
)
=>
console
.
debug
(
'
list added fetching error
'
,
error
))
fetchList
(
listUrl
).
catch
((
error
)
=>
console
.
debug
(
'
list added fetching error
'
,
error
))
...
...
src/utils/wrappedCurrency.ts
View file @
bd346030
...
@@ -2,13 +2,7 @@ import { supportedChainId } from 'utils'
...
@@ -2,13 +2,7 @@ import { supportedChainId } from 'utils'
import
{
ChainId
,
Currency
,
CurrencyAmount
,
ETHER
,
Token
,
TokenAmount
,
WETH9
}
from
'
@uniswap/sdk-core
'
import
{
ChainId
,
Currency
,
CurrencyAmount
,
ETHER
,
Token
,
TokenAmount
,
WETH9
}
from
'
@uniswap/sdk-core
'
export
function
wrappedCurrency
(
currency
:
Currency
|
undefined
,
chainId
:
ChainId
|
undefined
):
Token
|
undefined
{
export
function
wrappedCurrency
(
currency
:
Currency
|
undefined
,
chainId
:
ChainId
|
undefined
):
Token
|
undefined
{
return
chainId
&&
currency
===
ETHER
return
chainId
&&
currency
===
ETHER
?
WETH9
[
chainId
]
:
currency
instanceof
Token
?
currency
:
undefined
?
chainId
===
1337
?
new
Token
(
1337
,
'
0xbBca0fFBFE60F60071630A8c80bb6253dC9D6023
'
,
18
,
'
WETH
'
,
'
WETH9
'
)
:
WETH9
[
chainId
]
:
currency
instanceof
Token
?
currency
:
undefined
}
}
export
function
wrappedCurrencyAmount
(
export
function
wrappedCurrencyAmount
(
...
...
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