-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathbridge.ts
More file actions
65 lines (57 loc) · 1.9 KB
/
bridge.ts
File metadata and controls
65 lines (57 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { SolScope, BtcScope, TrxScope } from '@metamask/keyring-api';
import { CHAIN_IDS } from '@metamask/transaction-controller';
import { CaipChainId, Hex } from '@metamask/utils';
/**
* Swaps testnet chain ID (1337 in decimal)
* Used for testing swaps functionality on local/test networks
*/
export const SWAPS_TESTNET_CHAIN_ID: Hex = '0x539';
/**
* Native token address (zero address)
* Used to represent native tokens (ETH, BNB, MATIC, etc.) across all EVM chains
*/
export const NATIVE_SWAPS_TOKEN_ADDRESS: Hex =
'0x0000000000000000000000000000000000000000';
// TODO read from feature flags
export const ALLOWED_BRIDGE_CHAIN_IDS = [
CHAIN_IDS.MAINNET,
CHAIN_IDS.BSC,
CHAIN_IDS.POLYGON,
CHAIN_IDS.ZKSYNC_ERA,
CHAIN_IDS.AVALANCHE,
CHAIN_IDS.OPTIMISM,
CHAIN_IDS.ARBITRUM,
CHAIN_IDS.LINEA_MAINNET,
CHAIN_IDS.BASE,
CHAIN_IDS.SEI,
CHAIN_IDS.MONAD,
SolScope.Mainnet as const,
TrxScope.Mainnet as const,
];
export type AllowedBridgeChainIds = (typeof ALLOWED_BRIDGE_CHAIN_IDS)[number];
export const ETH_USDT_ADDRESS = '0xdac17f958d2ee523a2206206994597c13d831ec7';
export const NETWORK_TO_SHORT_NETWORK_NAME_MAP: Record<
Hex | CaipChainId,
string
> = {
[CHAIN_IDS.MAINNET]: 'Ethereum',
[CHAIN_IDS.LINEA_MAINNET]: 'Linea',
[CHAIN_IDS.POLYGON]: 'Polygon',
[CHAIN_IDS.AVALANCHE]: 'Avalanche',
[CHAIN_IDS.BSC]: 'BNB',
[CHAIN_IDS.ARBITRUM]: 'Arbitrum',
[CHAIN_IDS.OPTIMISM]: 'Optimism',
[CHAIN_IDS.ZKSYNC_ERA]: 'zkSync',
[CHAIN_IDS.BASE]: 'Base',
[CHAIN_IDS.SEI]: 'Sei',
[CHAIN_IDS.MONAD]: 'Monad',
[SolScope.Mainnet]: 'Solana',
[BtcScope.Mainnet]: 'Bitcoin',
[TrxScope.Mainnet]: 'Tron',
};
// export const BRIDGE_API_BASE_URL =
// process.env.BRIDGE_USE_DEV_APIS === 'true'
// ? BRIDGE_DEV_API_BASE_URL
// : BRIDGE_PROD_API_BASE_URL;
//TODO link to dev bridge API. Update to prod bridge API when ready.
export const BRIDGE_API_BASE_URL = 'http://localhost:3000';