/
types.ts
75 lines (70 loc) · 1.57 KB
/
types.ts
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
66
67
68
69
70
71
72
73
74
75
import { Theme } from "./theme";
export const MAINNET_CHAINS = {
solana: 1,
ethereum: 2,
bsc: 4,
polygon: 5,
avalanche: 6,
fantom: 10,
celo: 14,
moonbeam: 16,
osmosis: 20,
sui: 21,
aptos: 22,
arbitrum: 23,
optimism: 24,
base: 30,
evmos: 4001,
kujira: 4002,
} as const;
export type MainnetChainName = keyof typeof MAINNET_CHAINS;
export type MainnetChainId = (typeof MAINNET_CHAINS)[MainnetChainName];
export const TESTNET_CHAINS = {
solana: 1,
goerli: 2,
bsc: 4,
mumbai: 5,
fuji: 6,
fantom: 10,
alfajores: 14,
moonbasealpha: 16,
osmosis: 20,
sui: 21,
aptos: 22,
arbitrumgoerli: 23,
optimismgoerli: 24,
basegoerli: 30,
evmos: 4001,
kujira: 4002,
} as const;
export type TestnetChainName = keyof typeof TESTNET_CHAINS;
export type TestnetChainId = (typeof TESTNET_CHAINS)[TestnetChainName];
export type ChainName = MainnetChainName | TestnetChainName;
export type ChainId = MainnetChainId | TestnetChainId;
export type Rpcs = {
[chain in ChainName]?: string;
};
export interface BridgeDefaults {
fromNetwork?: ChainName;
toNetwork?: ChainName;
token?: string;
requiredNetwork?: ChainName;
}
// Keep this in sync with wormhole-connect/src/config/types.ts!
// TODO: move to a shared package
export interface WormholeConnectConfig {
env?: "mainnet" | "testnet" | "devnet";
rpcs?: Rpcs;
rest?: Rpcs;
networks?: ChainName[];
tokens?: string[];
mode?: "dark" | "light";
customTheme?: Theme;
cta?: {
text: string;
link: string;
};
bridgeDefaults?: BridgeDefaults;
routes?: string[];
pageHeader?: string;
}