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
fb3abf27
Unverified
Commit
fb3abf27
authored
Jun 22, 2023
by
Brendan Wong
Committed by
GitHub
Jun 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: added op and arb as base tokens (#6810)
* fix: added op and arb as base tokens * fix: unit testing
parent
f6ad6942
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
routing.test.ts
src/constants/routing.test.ts
+31
-0
routing.ts
src/constants/routing.ts
+4
-0
tokens.ts
src/constants/tokens.ts
+8
-0
No files found.
src/constants/routing.test.ts
0 → 100644
View file @
fb3abf27
import
{
SupportedChainId
}
from
'
./chains
'
import
{
COMMON_BASES
}
from
'
./routing
'
describe
(
'
Routing
'
,
()
=>
{
describe
(
'
COMMON_BASES
'
,
()
=>
{
it
(
'
contains all coins for mainnet
'
,
()
=>
{
const
symbols
=
COMMON_BASES
[
SupportedChainId
.
MAINNET
].
map
((
coin
)
=>
coin
.
symbol
)
expect
(
symbols
).
toEqual
([
'
ETH
'
,
'
DAI
'
,
'
USDC
'
,
'
USDT
'
,
'
WBTC
'
,
'
WETH
'
])
})
it
(
'
contains all coins for arbitrum
'
,
()
=>
{
const
symbols
=
COMMON_BASES
[
SupportedChainId
.
ARBITRUM_ONE
].
map
((
coin
)
=>
coin
.
symbol
)
expect
(
symbols
).
toEqual
([
'
ETH
'
,
'
ARB
'
,
'
DAI
'
,
'
USDC
'
,
'
USDT
'
,
'
WBTC
'
,
'
WETH
'
])
})
it
(
'
contains all coins for optimism
'
,
()
=>
{
const
symbols
=
COMMON_BASES
[
SupportedChainId
.
OPTIMISM
].
map
((
coin
)
=>
coin
.
symbol
)
expect
(
symbols
).
toEqual
([
'
ETH
'
,
'
OP
'
,
'
DAI
'
,
'
USDC
'
,
'
USDT
'
,
'
WBTC
'
])
})
it
(
'
contains all coins for polygon
'
,
()
=>
{
const
symbols
=
COMMON_BASES
[
SupportedChainId
.
POLYGON
].
map
((
coin
)
=>
coin
.
symbol
)
expect
(
symbols
).
toEqual
([
'
MATIC
'
,
'
WETH
'
,
'
USDC
'
,
'
DAI
'
,
'
USDT
'
,
'
WBTC
'
])
})
it
(
'
contains all coins for celo
'
,
()
=>
{
const
symbols
=
COMMON_BASES
[
SupportedChainId
.
CELO
].
map
((
coin
)
=>
coin
.
symbol
)
expect
(
symbols
).
toEqual
([
'
CELO
'
,
'
cEUR
'
,
'
cUSD
'
,
'
ETH
'
,
'
USDCet
'
,
'
cMCO2
'
])
})
it
(
'
contains all coins for bsc
'
,
()
=>
{
const
symbols
=
COMMON_BASES
[
SupportedChainId
.
BNB
].
map
((
coin
)
=>
coin
.
symbol
)
expect
(
symbols
).
toEqual
([
'
BNB
'
,
'
DAI
'
,
'
USDC
'
,
'
USDT
'
,
'
ETH
'
,
'
BTCB
'
,
'
BUSD
'
])
})
})
})
src/constants/routing.ts
View file @
fb3abf27
...
@@ -4,6 +4,7 @@ import { SupportedChainId } from 'constants/chains'
...
@@ -4,6 +4,7 @@ import { SupportedChainId } from 'constants/chains'
import
{
import
{
AMPL
,
AMPL
,
ARB
,
BTC_BSC
,
BTC_BSC
,
BUSD_BSC
,
BUSD_BSC
,
CAKE_BSC
,
CAKE_BSC
,
...
@@ -25,6 +26,7 @@ import {
...
@@ -25,6 +26,7 @@ import {
FXS
,
FXS
,
MATIC_BSC
,
MATIC_BSC
,
nativeOnChain
,
nativeOnChain
,
OP
,
PORTAL_ETH_CELO
,
PORTAL_ETH_CELO
,
PORTAL_USDC_CELO
,
PORTAL_USDC_CELO
,
renBTC
,
renBTC
,
...
@@ -152,6 +154,7 @@ export const COMMON_BASES: ChainCurrencyList = {
...
@@ -152,6 +154,7 @@ export const COMMON_BASES: ChainCurrencyList = {
],
],
[
SupportedChainId
.
ARBITRUM_ONE
]:
[
[
SupportedChainId
.
ARBITRUM_ONE
]:
[
nativeOnChain
(
SupportedChainId
.
ARBITRUM_ONE
),
nativeOnChain
(
SupportedChainId
.
ARBITRUM_ONE
),
ARB
,
DAI_ARBITRUM_ONE
,
DAI_ARBITRUM_ONE
,
USDC_ARBITRUM
,
USDC_ARBITRUM
,
USDT_ARBITRUM_ONE
,
USDT_ARBITRUM_ONE
,
...
@@ -165,6 +168,7 @@ export const COMMON_BASES: ChainCurrencyList = {
...
@@ -165,6 +168,7 @@ export const COMMON_BASES: ChainCurrencyList = {
],
],
[
SupportedChainId
.
OPTIMISM
]:
[
[
SupportedChainId
.
OPTIMISM
]:
[
nativeOnChain
(
SupportedChainId
.
OPTIMISM
),
nativeOnChain
(
SupportedChainId
.
OPTIMISM
),
OP
,
DAI_OPTIMISM
,
DAI_OPTIMISM
,
USDC_OPTIMISM
,
USDC_OPTIMISM
,
USDT_OPTIMISM
,
USDT_OPTIMISM
,
...
...
src/constants/tokens.ts
View file @
fb3abf27
...
@@ -400,6 +400,14 @@ export const ARB = new Token(
...
@@ -400,6 +400,14 @@ export const ARB = new Token(
'
Arbitrum
'
'
Arbitrum
'
)
)
export
const
OP
=
new
Token
(
SupportedChainId
.
OPTIMISM
,
'
0x4200000000000000000000000000000000000042
'
,
18
,
'
OP
'
,
'
Optimism
'
)
export
const
WRAPPED_NATIVE_CURRENCY
:
{
[
chainId
:
number
]:
Token
|
undefined
}
=
{
export
const
WRAPPED_NATIVE_CURRENCY
:
{
[
chainId
:
number
]:
Token
|
undefined
}
=
{
...(
WETH9
as
Record
<
SupportedChainId
,
Token
>
),
...(
WETH9
as
Record
<
SupportedChainId
,
Token
>
),
[
SupportedChainId
.
OPTIMISM
]:
new
Token
(
[
SupportedChainId
.
OPTIMISM
]:
new
Token
(
...
...
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