-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
101 lines (79 loc) · 5.22 KB
/
index.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { Asset, AssetKeys, NetworkType } from "../types"
export const Chains = {
SOL: "Solana",
ALGO: "Algorand",
ETH: "Ethereum"
}
export const EVM_WALLETS = {
Metamask: 'Metamask',
}
export const ALGORAND_WALLETS = {MyAlgo: 'MyAlgo', Pera: 'Pera'}
export const SOLANA_WALLETS = {Phantom: 'Phantom', Solflare: 'Solflare'}
export const Assets: Record<string, Record<string,Record<string, Asset>>> = {
[NetworkType.MAINNET]: {
[Chains.SOL]:{
[AssetKeys.xALGO_Glitter]: {symbol: 'xALGO', description: 'Wrapped ALGO on Solana', address: 'xALGoH1zUfRmpCriy94qbfoMXHtK6NDnMKzT4Xdvgms', decimals: 18, imageUrl: "https://cryptologos.cc/logos/algorand-algo-logo.png?v=002" },
[AssetKeys.SOL]: {symbol: 'SOL', description: 'Native Solana on Solana', address: '', decimals: 9, imageUrl: "https://cryptologos.cc/logos/solana-sol-logo.png?v=024"},
[AssetKeys.USDCs]: {symbol: 'USDC', description: "USDC on Solana", address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', decimals: 6, imageUrl: "https://cryptologos.cc/logos/usd-coin-usdc-logo.png?v=002"}
},
[Chains.ALGO]:{
[AssetKeys.ALGO]: {symbol: 'ALGO', description: 'Native ALGO on Algorand', address: '', decimals: 18, imageUrl: "https://cryptologos.cc/logos/algorand-algo-logo.png?v=002"},
[AssetKeys.xSOL_Glitter]: {symbol: 'xSOL', description: 'Wrapped Sol on Algorand', address: '792313023', decimals: 9, imageUrl: "https://cryptologos.cc/logos/solana-sol-logo.png?v=024"},
[AssetKeys.USDCa]: {symbol: 'USDC', description: "USDC on Algorand", address: '31566704', decimals: 6, imageUrl: "https://cryptologos.cc/logos/usd-coin-usdc-logo.png?v=002"},
[AssetKeys.WETH_Wormhole]: {symbol: 'WETH', description: "Wormhole Wrapped ether on algorand", address: '887406851', decimals: 18, imageUrl: "https://cryptologos.cc/logos/ethereum-eth-logo.png?v=002"} //@Todo insert correct address
},
[Chains.ETH]:{
[AssetKeys.ETH]: {symbol: 'ETH', description: 'Native ETH on Ethereum', address: '', decimals: 18, imageUrl: "https://cryptologos.cc/logos/ethereum-eth-logo.png?v=002"},
}
},
[NetworkType.TESTNET]: {
[Chains.SOL]:{
[AssetKeys.xALGO_Glitter]: {symbol: 'xALGO', description: 'Wrapped ALGO on Solana', address: 'xALGoH1zUfRmpCriy94qbfoMXHtK6NDnMKzT4Xdvgms', decimals:6, imageUrl: "https://cryptologos.cc/logos/algorand-algo-logo.png?v=002"},
[AssetKeys.SOL]: {symbol: 'SOL', description: 'Native Solana on Solana', address: '11111111111111111111111111111111', decimals: 9, imageUrl: "https://cryptologos.cc/logos/solana-sol-logo.png?v=024"},
[AssetKeys.USDCs]: {symbol: 'USDC', description: "USDC on Solana", address: '4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU', decimals: 6, imageUrl: "https://cryptologos.cc/logos/usd-coin-usdc-logo.png?v=002"}
},
[Chains.ALGO]:{
[AssetKeys.ALGO]: {symbol: 'ALGO', description: 'Native ALGO on Algorand', address: '', decimals: 6, imageUrl: "https://cryptologos.cc/logos/algorand-algo-logo.png?v=002"},
[AssetKeys.xSOL_Glitter]: {symbol: 'xSOL', description: 'Wrapped Sol on Algorand', address: "31566704", decimals: 9, imageUrl: "https://cryptologos.cc/logos/solana-sol-logo.png?v=024"},
[AssetKeys.USDCa]: {symbol: 'USDC', description: "USDC on Algorand", address: '10458941', decimals: 6, imageUrl: "https://cryptologos.cc/logos/usd-coin-usdc-logo.png?v=002"},
[AssetKeys.WETH_Wormhole]: {symbol: 'WETH', description: "Wormhole Wrapped ether on algorand", address: '', decimals: 18, imageUrl: "https://cryptologos.cc/logos/ethereum-eth-logo.png?v=002"} //@Todo insert correct address
},
[Chains.ETH]:{
[AssetKeys.ETH]: {symbol: 'ETH', description: 'Native ETH on Ethereum', address: '', decimals: 18, imageUrl: "https://cryptologos.cc/logos/ethereum-eth-logo.png?v=002"},
}
}
}
export const BRIDGE_STATUS = {
SUCCESS : 'success',
FAILED : 'failed',
WAITING_FOR_SEND_CONFIRMATION : 'Waiting for send confirmation',
SEND_CONFIRMED: 'Send Confirmed',
RECEIVING: 'receiving',
WAITING_FOR_RECEIPT_CONFIRMATION: 'waiting for receipt confirmation'
}
export const BRIDGE_FROM_ETHEREUM_STATUS = {
...BRIDGE_STATUS,
WAITING_FOR_APPROVAL_CONFIRMATION : 'Waiting for approval confirmation',
APPROVAL_CONFIRMED : 'Approval confirmed',
}
export const BRIDGE_FROM_ALGORAND_STATUS = {
...BRIDGE_STATUS,
}
export const BRIDGE_FROM_SOLANA_STATUS = {
...BRIDGE_STATUS,
}
export function getAlgorandHost(network: NetworkType) {
return network === NetworkType.MAINNET ? {
algodToken: "",
algodServer: "https://testnet-api.algonode.cloud", //@Todo change this to mainnet
algodPort: "",
} : {
algodToken: "",
algodServer: "https://testnet-api.algonode.cloud",
algodPort: "",
}
}
export function getWormHoleRpchost(network: NetworkType) {
return network === NetworkType.MAINNET ? ["https://wormhole-v2-mainnet-api.certus.one"] : ["https://wormhole-v2-testnet-api.certus.one"];
}
export const ALGORAND_WAIT_FOR_CONFIRMATIONS = 4 // 4 rounds. a block is created every round