@ -6,6 +6,9 @@ import {
TEST _ETH _TOKEN _IMAGE _URL ,
BNB _TOKEN _IMAGE _URL ,
BSC _CHAIN _ID ,
POLYGON _CHAIN _ID ,
MATIC _SYMBOL ,
MATIC _TOKEN _IMAGE _URL ,
} from './network' ;
export const QUOTES _EXPIRED _ERROR = 'quotes-expired' ;
@ -35,6 +38,14 @@ export const BNB_SWAPS_TOKEN_OBJECT = {
iconUrl : BNB _TOKEN _IMAGE _URL ,
} ;
export const MATIC _SWAPS _TOKEN _OBJECT = {
symbol : MATIC _SYMBOL ,
name : 'Matic' ,
address : DEFAULT _TOKEN _ADDRESS ,
decimals : 18 ,
iconUrl : MATIC _TOKEN _IMAGE _URL ,
} ;
export const TEST _ETH _SWAPS _TOKEN _OBJECT = {
symbol : TEST _ETH _SYMBOL ,
name : 'Test Ether' ,
@ -52,6 +63,9 @@ const TESTNET_CONTRACT_ADDRESS = '0x881d40237659c251811cec9c364ef91dc08d300c';
const BSC _CONTRACT _ADDRESS = '0x1a1ec25dc08e98e5e93f1104b5e5cdd298707d31' ;
// It's the same as we use for BSC.
const POLYGON _CONTRACT _ADDRESS = '0x1a1ec25dc08e98e5e93f1104b5e5cdd298707d31' ;
export const ETH _WETH _CONTRACT _ADDRESS =
'0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ;
@ -64,13 +78,16 @@ const SWAPS_TESTNET_HOST = 'https://metaswap-api.airswap-dev.codefi.network';
const BSC _DEFAULT _BLOCK _EXPLORER _URL = 'https://bscscan.com/' ;
const MAINNET _DEFAULT _BLOCK _EXPLORER _URL = 'https://etherscan.io/' ;
const POLYGON _DEFAULT _BLOCK _EXPLORER _URL = 'https://polygonscan.com/' ;
export const ALLOWED _SWAPS _CHAIN _IDS = {
[ MAINNET _CHAIN _ID ] : true ,
[ SWAPS _TESTNET _CHAIN _ID ] : true ,
[ BSC _CHAIN _ID ] : true ,
[ POLYGON _CHAIN _ID ] : true ,
} ;
// This is mapping for v1 URLs and will be removed once we migrate to v2.
export const METASWAP _CHAINID _API _HOST _MAP = {
[ MAINNET _CHAIN _ID ] : METASWAP _ETH _API _HOST ,
[ SWAPS _TESTNET _CHAIN _ID ] : SWAPS _TESTNET _HOST ,
@ -81,17 +98,20 @@ export const SWAPS_CHAINID_CONTRACT_ADDRESS_MAP = {
[ MAINNET _CHAIN _ID ] : MAINNET _CONTRACT _ADDRESS ,
[ SWAPS _TESTNET _CHAIN _ID ] : TESTNET _CONTRACT _ADDRESS ,
[ BSC _CHAIN _ID ] : BSC _CONTRACT _ADDRESS ,
[ POLYGON _CHAIN _ID ] : POLYGON _CONTRACT _ADDRESS ,
} ;
export const SWAPS _CHAINID _DEFAULT _TOKEN _MAP = {
[ MAINNET _CHAIN _ID ] : ETH _SWAPS _TOKEN _OBJECT ,
[ SWAPS _TESTNET _CHAIN _ID ] : TEST _ETH _SWAPS _TOKEN _OBJECT ,
[ BSC _CHAIN _ID ] : BNB _SWAPS _TOKEN _OBJECT ,
[ POLYGON _CHAIN _ID ] : MATIC _SWAPS _TOKEN _OBJECT ,
} ;
export const SWAPS _CHAINID _DEFAULT _BLOCK _EXPLORER _URL _MAP = {
[ BSC _CHAIN _ID ] : BSC _DEFAULT _BLOCK _EXPLORER _URL ,
[ MAINNET _CHAIN _ID ] : MAINNET _DEFAULT _BLOCK _EXPLORER _URL ,
[ POLYGON _CHAIN _ID ] : POLYGON _DEFAULT _BLOCK _EXPLORER _URL ,
} ;
export const ETHEREUM = 'ethereum' ;