Add CELO network

This commit is contained in:
Ivan Grachev 2022-07-14 18:17:49 +03:00
parent 3203f93740
commit 80381f4c9a

View File

@ -11,6 +11,7 @@ enum EthereumChain: Int {
case avalanche = 43114 case avalanche = 43114
case gnosisChain = 100 case gnosisChain = 100
case fantomOpera = 250 case fantomOpera = 250
case celo = 42220
// Testnets // Testnets
case arbitrumRinkeby = 421611 case arbitrumRinkeby = 421611
@ -34,7 +35,7 @@ enum EthereumChain: Int {
return "0x" + String(id, radix: 16, uppercase: false) return "0x" + String(id, radix: 16, uppercase: false)
} }
static let allMainnets: [EthereumChain] = [.ethereum, .polygon, .optimism, .binance, .arbitrum, .avalanche, .gnosisChain, .fantomOpera] static let allMainnets: [EthereumChain] = [.ethereum, .polygon, .optimism, .binance, .arbitrum, .avalanche, .gnosisChain, .fantomOpera, .celo]
static let allTestnets: [EthereumChain] = [.ethereumRopsten, .ethereumKovan, .ethereumRinkeby, .ethereumGoerli, .optimisticKovan, .arbitrumKovan, .arbitrumRinkeby, .polygonMumbai, .binanceTestnet, .avalancheFuji, .fantomTestnet, .neonDevnet] static let allTestnets: [EthereumChain] = [.ethereumRopsten, .ethereumKovan, .ethereumRinkeby, .ethereumGoerli, .optimisticKovan, .arbitrumKovan, .arbitrumRinkeby, .polygonMumbai, .binanceTestnet, .avalancheFuji, .fantomTestnet, .neonDevnet]
var name: String { var name: String {
@ -47,6 +48,7 @@ enum EthereumChain: Int {
case .avalanche: return "Avalanche" case .avalanche: return "Avalanche"
case .gnosisChain: return "Gnosis Chain" case .gnosisChain: return "Gnosis Chain"
case .fantomOpera: return "Fantom Opera" case .fantomOpera: return "Fantom Opera"
case .celo: return "Celo"
case .arbitrumRinkeby: return "Arbitrum Rinkeby" case .arbitrumRinkeby: return "Arbitrum Rinkeby"
case .optimisticKovan: return "Optimistic Kovan" case .optimisticKovan: return "Optimistic Kovan"
@ -77,6 +79,8 @@ enum EthereumChain: Int {
return "xDai" return "xDai"
case .fantomOpera, .fantomTestnet: case .fantomOpera, .fantomTestnet:
return "FTM" return "FTM"
case .celo:
return "CELO"
case .neonDevnet: case .neonDevnet:
return "NEON" return "NEON"
} }
@ -105,6 +109,7 @@ enum EthereumChain: Int {
case .avalanche: return "https://api.avax.network/ext/bc/C/rpc" case .avalanche: return "https://api.avax.network/ext/bc/C/rpc"
case .gnosisChain: return "https://rpc.gnosischain.com/" case .gnosisChain: return "https://rpc.gnosischain.com/"
case .fantomOpera: return "https://rpc.ftm.tools/" case .fantomOpera: return "https://rpc.ftm.tools/"
case .celo: return "https://rpc.ankr.com/celo"
case .arbitrumRinkeby: return "https://rinkeby.arbitrum.io/rpc" case .arbitrumRinkeby: return "https://rinkeby.arbitrum.io/rpc"
case .arbitrumKovan: return "https://kovan5.arbitrum.io/rpc" case .arbitrumKovan: return "https://kovan5.arbitrum.io/rpc"