Merge pull request #3916 from AlphaWallet/support-arbitrum-testnet-rinkeby

Add support for Arbitrum Rinkey, testnet
pull/3910/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit cca9e6b03b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      AlphaWallet/Core/BuyToken/Ramp/Ramp.swift
  2. 4
      AlphaWallet/Core/CoinTicker/CoinTickersFetcher.swift
  3. 8
      AlphaWallet/Core/Enjin/EnjinProvider.swift
  4. 2
      AlphaWallet/Core/SwapToken/HoneySwap/HoneySwap.swift
  5. 2
      AlphaWallet/Core/SwapToken/Oneinch/Oneinch.swift
  6. 2
      AlphaWallet/Core/SwapToken/QuickSwap/QuickSwap.swift
  7. 2
      AlphaWallet/Core/SwapToken/Uniswap/UniswapERC20Token.swift
  8. 4
      AlphaWallet/EtherClient/OpenSea.swift
  9. 4
      AlphaWallet/EtherClient/TrustClient/AlphaWalletService.swift
  10. 2
      AlphaWallet/Gas/Models/GasPriceEstimator.swift
  11. 1
      AlphaWallet/Localization/en.lproj/Localizable.strings
  12. 1
      AlphaWallet/Localization/es.lproj/Localizable.strings
  13. 1
      AlphaWallet/Localization/fi.lproj/Localizable.strings
  14. 1
      AlphaWallet/Localization/ja.lproj/Localizable.strings
  15. 1
      AlphaWallet/Localization/ko.lproj/Localizable.strings
  16. 1
      AlphaWallet/Localization/zh-Hans.lproj/Localizable.strings
  17. 4
      AlphaWallet/Market/Coordinators/ImportMagicLinkCoordinator.swift
  18. 1
      AlphaWallet/Settings/Coordinators/ServersCoordinator.swift
  19. 4
      AlphaWallet/Settings/Models/SendPrivateTransactionsProvider.swift
  20. 4
      AlphaWallet/Settings/Types/ConfigExplorer.swift
  21. 1
      AlphaWallet/Settings/Types/Constants.swift
  22. 48
      AlphaWallet/Settings/Types/RPCServers.swift
  23. 2
      AlphaWallet/Tokens/Coordinators/SingleChainTokenCoordinator.swift
  24. 5
      AlphaWallet/Tokens/Types/TokenCollection.swift
  25. 2
      AlphaWallet/Tokens/ViewModels/TokenViewControllerViewModel.swift
  26. 4
      AlphaWallet/Transactions/Coordinators/SingleChainTransactionEtherscanDataCoordinator.swift
  27. 6
      AlphaWallet/Transfer/Controllers/TransactionConfigurator.swift
  28. 8
      AlphaWallet/UI/TokenObject+UI.swift

@ -26,12 +26,12 @@ class Ramp: TokenActionsProvider, BuyTokenURLProviderType {
func url(token: TokenActionsServiceKey) -> URL? {
guard let account = account else { return nil }
switch token.server {
case .xDai:
return URL(string: "\(Constants.buyXDaiWitRampUrl)&userAddress=\(account.address.eip55String)")
//TODO need to check if Ramp supports these? Or is it taken care of elsehwere
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .custom, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .custom, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return asset(for: token).flatMap {
return URL(string: "\(Constants.buyWitRampUrl(asset: $0.symbol))&userAddress=\(account.address.eip55String)")
}
@ -48,7 +48,7 @@ class Ramp: TokenActionsProvider, BuyTokenURLProviderType {
switch token.server {
case .xDai:
return true
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .custom, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .custom, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return asset(for: token) != nil
}
}

@ -336,7 +336,7 @@ fileprivate struct Ticker: Codable {
case .polygon: return platform == "polygon-pos"
case .fantom: return platform == "fantom"
case .arbitrum: return platform == "arbitrum-one"
case .poa, .kovan, .sokol, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain_testnet, .ropsten, .rinkeby, .heco, .heco_testnet, .fantom_testnet, .avalanche_testnet, .mumbai_testnet, .custom, .optimistic, .optimisticKovan, .cronosTestnet, .palm, .palmTestnet:
case .poa, .kovan, .sokol, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain_testnet, .ropsten, .rinkeby, .heco, .heco_testnet, .fantom_testnet, .avalanche_testnet, .mumbai_testnet, .custom, .optimistic, .optimisticKovan, .cronosTestnet, .palm, .palmTestnet, .arbitrumRinkeby:
return false
}
}
@ -350,7 +350,7 @@ fileprivate struct Ticker: Codable {
case .avalanche: return true
case .polygon: return true
case .arbitrum: return true
case .poa, .kovan, .sokol, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain_testnet, .ropsten, .rinkeby, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche_testnet, .mumbai_testnet, .custom, .optimistic, .optimisticKovan, .cronosTestnet, .palm, .palmTestnet:
case .poa, .kovan, .sokol, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain_testnet, .ropsten, .rinkeby, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche_testnet, .mumbai_testnet, .custom, .optimistic, .optimisticKovan, .cronosTestnet, .palm, .palmTestnet, .arbitrumRinkeby:
return false
}
}

@ -7,7 +7,7 @@
import Foundation
import Apollo
import PromiseKit
import PromiseKit
struct EnjinError: Error {
var localizedDescription: String
@ -33,7 +33,7 @@ class EnjinProvider {
private static var graphqlClient: ApolloClient = {
let provider = NetworkInterceptorProvider(store: store, client: client)
let transport = RequestChainNetworkTransport(interceptorProvider: provider, endpointURL: Constants.enjinApiUrl)
return ApolloClient(networkTransport: transport, store: store)
}()
@ -69,7 +69,7 @@ class EnjinProvider {
switch server {
case .main:
return true
case .rinkeby, .kovan, .ropsten, .poa, .sokol, .classic, .callisto, .custom, .goerli, .xDai, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .rinkeby, .kovan, .ropsten, .poa, .sokol, .classic, .callisto, .custom, .goerli, .xDai, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return false
}
}
@ -243,7 +243,7 @@ extension EnjinProvider.functional {
if ids.isEmpty {
return .value([owner: []])
}
let promises = ids.compactMap({ tokenId in
return Promise<GetEnjinTokenQuery.Data.EnjinToken> { seal in
graphqlClient.fetch(query: GetEnjinTokenQuery(id: tokenId)) { response in

@ -97,7 +97,7 @@ class HoneySwap: TokenActionsProvider, SwapTokenURLProviderType {
switch token.server {
case .xDai:
return true
case .main, .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_sigma1, .artis_tau1, .custom, .poa, .callisto, .classic, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_sigma1, .artis_tau1, .custom, .poa, .callisto, .classic, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return false
}
}

@ -65,7 +65,7 @@ class Oneinch: TokenActionsProvider, SwapTokenURLProviderType {
switch token.server {
case .main, .arbitrum:
return availableTokens[token.contractAddress] != nil
case .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_sigma1, .artis_tau1, .custom, .poa, .callisto, .xDai, .classic, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .palm, .palmTestnet:
case .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_sigma1, .artis_tau1, .custom, .poa, .callisto, .xDai, .classic, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .palm, .palmTestnet, .arbitrumRinkeby:
return false
}
}

@ -102,7 +102,7 @@ struct QuickSwap: TokenActionsProvider, SwapTokenURLProviderType {
switch token.server {
case .polygon:
return true
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .custom, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .xDai, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .custom, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .xDai, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return false
}
}

@ -19,7 +19,7 @@ extension UniswapERC20Token {
switch token.server {
case .main:
return availableTokens.contains(where: { $0.contract.sameContract(as: token.contractAddress) })
case .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_sigma1, .artis_tau1, .custom, .poa, .callisto, .xDai, .classic, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_sigma1, .artis_tau1, .custom, .poa, .callisto, .xDai, .classic, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return false
}
}

@ -51,7 +51,7 @@ class OpenSea {
switch server {
case .main, .rinkeby:
return true
case .kovan, .ropsten, .poa, .sokol, .classic, .callisto, .custom, .goerli, .xDai, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .kovan, .ropsten, .poa, .sokol, .classic, .callisto, .custom, .goerli, .xDai, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return false
}
}
@ -103,7 +103,7 @@ class OpenSea {
return Constants.openseaAPI
case .rinkeby:
return Constants.openseaRinkebyAPI
case .kovan, .ropsten, .poa, .sokol, .classic, .callisto, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .kovan, .ropsten, .poa, .sokol, .classic, .callisto, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return Constants.openseaAPI
}
}

@ -47,7 +47,7 @@ extension AlphaWalletService: TargetType {
switch self {
case .getTransactions(_, let server, _, _, _, _):
switch server {
case .main, .classic, .callisto, .kovan, .ropsten, .custom, .rinkeby, .poa, .sokol, .goerli, .xDai, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .classic, .callisto, .kovan, .ropsten, .custom, .rinkeby, .poa, .sokol, .goerli, .xDai, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return ""
}
case .oneInchTokens:
@ -123,7 +123,7 @@ extension AlphaWalletService: TargetType {
switch self {
case .getTransactions(_, let server, _, _, _, _):
switch server {
case .main, .classic, .callisto, .kovan, .ropsten, .custom, .rinkeby, .poa, .sokol, .goerli, .xDai, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .classic, .callisto, .kovan, .ropsten, .custom, .rinkeby, .poa, .sokol, .goerli, .xDai, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return [
"Content-type": "application/json",
"client": Bundle.main.bundleIdentifier ?? "",

@ -36,7 +36,7 @@ fileprivate extension RPCServer {
switch self {
case .main, .binance_smart_chain, .heco, .polygon:
return etherscanApiRoot?.appendingQueryString("\("module=gastracker&action=gasoracle")\(apiKeyParameter)")
case .artis_sigma1, .artis_tau1, .binance_smart_chain_testnet, .callisto, .poa, .sokol, .classic, .xDai, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .mumbai_testnet, .cronosTestnet, .custom, .arbitrum, .kovan, .ropsten, .rinkeby, .goerli, .optimistic, .optimisticKovan, .palm, .palmTestnet:
case .artis_sigma1, .artis_tau1, .binance_smart_chain_testnet, .callisto, .poa, .sokol, .classic, .xDai, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .mumbai_testnet, .cronosTestnet, .custom, .arbitrum, .arbitrumRinkeby, .kovan, .ropsten, .rinkeby, .goerli, .optimistic, .optimisticKovan, .palm, .palmTestnet:
return nil
}
}

@ -463,6 +463,7 @@
"blockchain.Optimistic.Kovan" = "Optimistic Kovan Testnet";
"blockchain.Cronos.Testnet" = "Cronos Testnet";
"blockchain.arbitrum" = "Arbitrum";
"blockchain.arbitrum.rinkeby" = "Arbitrum Rinkeby";
"blockchain.palm" = "Palm";
"blockchain.palm.Testnet" = "Palm (Testnet)";
"photos" = "Browse";

@ -463,6 +463,7 @@
"blockchain.Optimistic.Kovan" = "Optimistic Kovan Testnet";
"blockchain.Cronos.Testnet" = "Cronos Testnet";
"blockchain.arbitrum" = "Arbitrum";
"blockchain.arbitrum.rinkeby" = "Arbitrum Rinkeby";
"blockchain.palm" = "Palm";
"blockchain.palm.Testnet" = "Palm (Testnet)";
"photos" = "Explorar";

@ -463,6 +463,7 @@
"blockchain.Optimistic.Kovan" = "Optimistic Kovan Testnet";
"blockchain.Cronos.Testnet" = "Cronos Testnet";
"blockchain.arbitrum" = "Arbitrum";
"blockchain.arbitrum.rinkeby" = "Arbitrum Rinkeby";
"blockchain.palm" = "Palm";
"blockchain.palm.Testnet" = "Palm (Testnet)";
"photos" = "Selaa kuvia";

@ -461,6 +461,7 @@
"blockchain.Optimistic.Kovan" = "Optimistic Kovan Testnet";
"blockchain.Cronos.Testnet" = "Cronos Testnet";
"blockchain.arbitrum" = "Arbitrum";
"blockchain.arbitrum.rinkeby" = "Arbitrum Rinkeby";
"blockchain.palm" = "Palm";
"blockchain.palm.Testnet" = "Palm (Testnet)";
"a.claim.token.failed.notEnoughXDAI.title" = "a.claim.token.failed.notEnoughXDAI.title";

@ -460,6 +460,7 @@
"blockchain.Optimistic.Kovan" = "Optimistic Kovan Testnet";
"blockchain.Cronos.Testnet" = "Cronos Testnet";
"blockchain.arbitrum" = "Arbitrum";
"blockchain.arbitrum.rinkeby" = "Arbitrum Rinkeby";
"blockchain.palm" = "Palm";
"blockchain.palm.Testnet" = "Palm (Testnet)";
"a.claim.token.failed.notEnoughXDAI.title" = "a.claim.token.failed.notEnoughXDAI.title";

@ -463,6 +463,7 @@
"blockchain.Optimistic.Kovan" = "Optimistic Kovan Testnet";
"blockchain.Cronos.Testnet" = "Cronos Testnet";
"blockchain.arbitrum" = "Arbitrum";
"blockchain.arbitrum.rinkeby" = "Arbitrum Rinkeby";
"blockchain.palm" = "Palm";
"blockchain.palm.Testnet" = "Palm (Testnet)";
"photos" = "浏览";

@ -82,6 +82,8 @@ class ImportMagicLinkCoordinator: Coordinator {
return custom.symbol ?? "ETH"
case .arbitrum:
return "AETH"
case .arbitrumRinkeby:
return "ARETH"
case .palm:
return "PALM"
case .palmTestnet:
@ -436,7 +438,7 @@ class ImportMagicLinkCoordinator: Coordinator {
switch server {
case .xDai:
errorMessage = R.string.localizable.aClaimTokenFailedNotEnoughXDAITitle()
case .classic, .main, .poa, .callisto, .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .classic, .main, .poa, .callisto, .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
errorMessage = R.string.localizable.aClaimTokenFailedNotEnoughEthTitle()
}
if ethPrice.value == nil {

@ -38,6 +38,7 @@ class ServersCoordinator: Coordinator {
.optimisticKovan,
.cronosTestnet,
.arbitrum,
.arbitrumRinkeby,
] + RPCServer.customServers
if Features.isPalmEnabled {
return all + [.palm, .palmTestnet]

@ -30,7 +30,7 @@ enum SendPrivateTransactionsProvider: String {
switch server {
case .main:
return URL(string: "https://rpc.ethermine.org")!
case .xDai, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .xDai, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return nil
}
case .eden:
@ -39,7 +39,7 @@ enum SendPrivateTransactionsProvider: String {
return URL(string: "https://api.edennetwork.io/v1/rpc")!
case .ropsten:
return URL(string: "https://dev-api.edennetwork.io/v1/rpc")!
case .xDai, .kovan, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .xDai, .kovan, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return nil
}
}

@ -16,7 +16,7 @@ struct ConfigExplorer {
guard let endpoint = result.url else { return .none }
let urlString: String? = {
switch server {
case .main, .kovan, .ropsten, .rinkeby, .sokol, .classic, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .callisto, .poa, .cronosTestnet, .custom, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .sokol, .classic, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .callisto, .poa, .cronosTestnet, .custom, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return endpoint + "/tx/" + ID
}
}()
@ -29,7 +29,7 @@ struct ConfigExplorer {
switch server {
case .main, .kovan, .ropsten, .rinkeby, .goerli:
return "Etherscan"
case .classic, .poa, .custom, .callisto, .sokol, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .classic, .poa, .custom, .callisto, .sokol, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return "\(server.name) Explorer"
case .xDai:
return "Blockscout"

@ -38,6 +38,7 @@ public struct Constants {
public static let optimisticTestMagicLinkHost = "optimistic-kovan.aw.app"
public static let cronosTestMagicLinkHost = "test-cronos.aw.app"
public static let arbitrumMagicLinkHost = "arbitrum.aw.app"
public static let arbitrumRinkebyMagicLinkHost = "arbitrum-rinkeby.aw.app"
public static let palmMagicLinkHost = "palm.aw.app"
public static let palmTestnetMagicLinkHost = "palmTestnet.aw.app"

@ -48,6 +48,7 @@ enum RPCServer: Hashable, CaseIterable {
case cronosTestnet
case custom(CustomRPC)
case arbitrum
case arbitrumRinkeby
case palm
case palmTestnet
@ -92,6 +93,7 @@ enum RPCServer: Hashable, CaseIterable {
case .optimisticKovan: return 69
case .cronosTestnet: return 338
case .arbitrum: return 42161
case .arbitrumRinkeby: return 421611
case .palm: return 11297108109
case .palmTestnet: return 11297108099
}
@ -126,6 +128,7 @@ enum RPCServer: Hashable, CaseIterable {
case .optimisticKovan: return "Optimistic Kovan"
case .cronosTestnet: return "Cronos Testnet"
case .arbitrum: return "Arbitrum One"
case .arbitrumRinkeby: return "Arbitrum Rinkeby"
case .palm: return "Palm"
case .palmTestnet: return "Palm (Testnet)"
}
@ -135,7 +138,7 @@ enum RPCServer: Hashable, CaseIterable {
switch self {
case .xDai, .classic, .main, .poa, .callisto, .binance_smart_chain, .artis_sigma1, .heco, .fantom, .avalanche, .polygon, .optimistic, .arbitrum, .palm:
return false
case .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_tau1, .binance_smart_chain_testnet, .heco_testnet, .fantom_testnet, .avalanche_testnet, .mumbai_testnet, .optimisticKovan, .cronosTestnet, .palmTestnet:
case .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_tau1, .binance_smart_chain_testnet, .heco_testnet, .fantom_testnet, .avalanche_testnet, .mumbai_testnet, .optimisticKovan, .cronosTestnet, .palmTestnet, .arbitrumRinkeby:
return true
case .custom(let custom):
return custom.isTestnet
@ -144,7 +147,7 @@ enum RPCServer: Hashable, CaseIterable {
var customRpc: CustomRPC? {
switch self {
case .xDai, .classic, .main, .poa, .callisto, .binance_smart_chain, .artis_sigma1, .heco, .fantom, .avalanche, .polygon, .optimistic, .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_tau1, .binance_smart_chain_testnet, .heco_testnet, .fantom_testnet, .avalanche_testnet, .mumbai_testnet, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .xDai, .classic, .main, .poa, .callisto, .binance_smart_chain, .artis_sigma1, .heco, .fantom, .avalanche, .polygon, .optimistic, .kovan, .ropsten, .rinkeby, .sokol, .goerli, .artis_tau1, .binance_smart_chain_testnet, .heco_testnet, .fantom_testnet, .avalanche_testnet, .mumbai_testnet, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return nil
case .custom(let custom):
return custom
@ -157,7 +160,7 @@ enum RPCServer: Hashable, CaseIterable {
var etherscanURLForGeneralTransactionHistory: URL? {
switch self {
case .main, .ropsten, .rinkeby, .kovan, .poa, .classic, .goerli, .xDai, .artis_sigma1, .artis_tau1, .polygon, .binance_smart_chain, .binance_smart_chain_testnet, .sokol, .callisto, .optimistic, .optimisticKovan, .cronosTestnet, .custom, .arbitrum, .palm, .palmTestnet:
case .main, .ropsten, .rinkeby, .kovan, .poa, .classic, .goerli, .xDai, .artis_sigma1, .artis_tau1, .polygon, .binance_smart_chain, .binance_smart_chain_testnet, .sokol, .callisto, .optimistic, .optimisticKovan, .cronosTestnet, .custom, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return etherscanApiRoot?.appendingQueryString("module=account&action=txlist")
case .heco: return nil
case .heco_testnet: return nil
@ -208,6 +211,7 @@ enum RPCServer: Hashable, CaseIterable {
case .custom: return nil
case .fantom_testnet, .avalanche, .avalanche_testnet: return nil
case .arbitrum: return "https://arbiscan.io"
case .arbitrumRinkeby: return "https://testnet.arbiscan.io"
case .palm: return "https://explorer.palm.io"
case .palmTestnet: return "https://explorer.palm-uat.xyz"
}
@ -251,6 +255,7 @@ enum RPCServer: Hashable, CaseIterable {
case .optimisticKovan: return "https://api-kovan-optimistic.etherscan.io/api"
case .cronosTestnet: return "https://cronos-explorer.crypto.org/api"
case .arbitrum: return "https://api.arbiscan.io/api"
case .arbitrumRinkeby: return "https://testnet.arbiscan.io/api"
case .palm: return "https://explorer.palm.io/api"
case .palmTestnet: return "https://explorer.palm-uat.xyz/api"
}
@ -272,7 +277,7 @@ enum RPCServer: Hashable, CaseIterable {
private var etherscanCompatibleType: EtherscanCompatibleType {
switch self {
case .main, .ropsten, .rinkeby, .kovan, .goerli, .fantom, .heco, .heco_testnet, .optimistic, .optimisticKovan, .binance_smart_chain, .binance_smart_chain_testnet, .polygon, .arbitrum:
case .main, .ropsten, .rinkeby, .kovan, .goerli, .fantom, .heco, .heco_testnet, .optimistic, .optimisticKovan, .binance_smart_chain, .binance_smart_chain_testnet, .polygon, .arbitrum, .arbitrumRinkeby:
return .etherscan
case .poa, .sokol, .classic, .xDai, .artis_sigma1, .artis_tau1, .mumbai_testnet, .callisto, .cronosTestnet, .palm, .palmTestnet:
return .blockscout
@ -285,7 +290,7 @@ enum RPCServer: Hashable, CaseIterable {
var etherscanApiKey: String? {
switch self {
case .main, .kovan, .ropsten, .rinkeby, .goerli, .optimistic, .optimisticKovan, .arbitrum:
case .main, .kovan, .ropsten, .rinkeby, .goerli, .optimistic, .optimisticKovan, .arbitrum, .arbitrumRinkeby:
return Constants.Credentials.etherscanKey
case .binance_smart_chain:
//Key not needed for testnet (empirically)
@ -304,7 +309,7 @@ enum RPCServer: Hashable, CaseIterable {
switch self {
case .optimistic, .optimisticKovan:
return AlphaWallet.Address(string: "0x4200000000000000000000000000000000000006")!
case .main, .ropsten, .rinkeby, .kovan, .goerli, .fantom, .heco, .heco_testnet, .binance_smart_chain, .binance_smart_chain_testnet, .polygon, .poa, .sokol, .classic, .xDai, .artis_sigma1, .artis_tau1, .mumbai_testnet, .callisto, .cronosTestnet, .fantom_testnet, .avalanche, .avalanche_testnet, .custom, .arbitrum, .palm, .palmTestnet:
case .main, .ropsten, .rinkeby, .kovan, .goerli, .fantom, .heco, .heco_testnet, .binance_smart_chain, .binance_smart_chain_testnet, .polygon, .poa, .sokol, .classic, .xDai, .artis_sigma1, .artis_tau1, .mumbai_testnet, .callisto, .cronosTestnet, .fantom_testnet, .avalanche, .avalanche_testnet, .custom, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return nil
}
}
@ -314,7 +319,7 @@ enum RPCServer: Hashable, CaseIterable {
switch self {
case .main, .ropsten, .rinkeby, .kovan, .goerli, .fantom, .heco, .heco_testnet, .binance_smart_chain, .binance_smart_chain_testnet, .polygon, .poa, .sokol, .classic, .xDai, .artis_sigma1, .artis_tau1, .mumbai_testnet, .callisto, .cronosTestnet, .fantom_testnet, .avalanche, .avalanche_testnet, .custom, .arbitrum, .palm, .palmTestnet:
return true
case .optimistic, .optimisticKovan:
case .optimistic, .optimisticKovan, .arbitrumRinkeby:
return false
}
}
@ -389,14 +394,14 @@ enum RPCServer: Hashable, CaseIterable {
switch self {
case .main:
return etherscanWebpageRoot?.appendingPathComponent("token").appendingPathComponent(address.eip55String)
case .ropsten, .rinkeby, .kovan, .xDai, .goerli, .poa, .sokol, .classic, .callisto, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .ropsten, .rinkeby, .kovan, .xDai, .goerli, .poa, .sokol, .classic, .callisto, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return etherscanContractDetailsWebPageURL(for: address)
}
}
var priceID: AlphaWallet.Address {
switch self {
case .main, .ropsten, .rinkeby, .kovan, .sokol, .custom, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .ropsten, .rinkeby, .kovan, .sokol, .custom, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return AlphaWallet.Address(string: "0x000000000000000000000000000000000000003c")!
case .poa:
return AlphaWallet.Address(string: "0x00000000000000000000000000000000000000AC")!
@ -435,6 +440,7 @@ enum RPCServer: Hashable, CaseIterable {
case .optimisticKovan: return "ETH"
case .cronosTestnet: return "tCRO"
case .arbitrum: return "AETH"
case .arbitrumRinkeby: return "ARETH"
case .palm: return "PALM"
case .palmTestnet: return "PALM"
}
@ -463,6 +469,7 @@ enum RPCServer: Hashable, CaseIterable {
case .custom(let custom):
return custom.nativeCryptoTokenName ?? "Ether"
case .arbitrum: return "AETH"
case .arbitrumRinkeby: return "ARETH"
case .palm: return "PALM"
case .palmTestnet: return "PALM"
}
@ -478,7 +485,7 @@ enum RPCServer: Hashable, CaseIterable {
case .kovan: return .Kovan
case .ropsten: return .Ropsten
case .rinkeby: return .Rinkeby
case .poa, .sokol, .classic, .callisto, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .custom, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .poa, .sokol, .classic, .callisto, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .custom, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return .Custom(networkID: BigUInt(chainID))
}
}
@ -544,6 +551,8 @@ enum RPCServer: Hashable, CaseIterable {
return Constants.cronosTestMagicLinkHost
case .arbitrum:
return Constants.arbitrumMagicLinkHost
case .arbitrumRinkeby:
return Constants.arbitrumRinkebyMagicLinkHost
case .palm:
return Constants.palmMagicLinkHost
case .palmTestnet:
@ -581,6 +590,7 @@ enum RPCServer: Hashable, CaseIterable {
case .optimisticKovan: return "https://kovan.optimism.io"
case .cronosTestnet: return "https://cronos-testnet.crypto.org:8545"
case .arbitrum: return "https://arbitrum-mainnet.infura.io/v3/\(Constants.Credentials.infuraKey)"
case .arbitrumRinkeby: return "https://arbitrum-rinkeby.infura.io/v3/\(Constants.Credentials.infuraKey)"
case .palm: return "https://palm-mainnet.infura.io/v3/\(Constants.Credentials.infuraKey)"
case .palmTestnet: return "https://palm-testnet.infura.io/v3/\(Constants.Credentials.infuraKey)"
}
@ -590,7 +600,7 @@ enum RPCServer: Hashable, CaseIterable {
var transactionInfoEndpoints: URL? {
switch self {
case .main, .kovan, .ropsten, .rinkeby, .goerli, .classic, .poa, .xDai, .sokol, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .fantom, .polygon, .mumbai_testnet, .heco, .heco_testnet, .callisto, .optimistic, .optimisticKovan, .cronosTestnet, .custom, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .goerli, .classic, .poa, .xDai, .sokol, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .fantom, .polygon, .mumbai_testnet, .heco, .heco_testnet, .callisto, .optimistic, .optimisticKovan, .cronosTestnet, .custom, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return etherscanApiRoot
case .fantom_testnet: return URL(string: "https://explorer.testnet.fantom.network/tx/")
case .avalanche: return URL(string: "https://cchain.explorer.avax.network/tx/")
@ -604,14 +614,14 @@ enum RPCServer: Hashable, CaseIterable {
case .ropsten: return Constants.ENSRegistrarRopsten
case .rinkeby: return Constants.ENSRegistrarRinkeby
case .goerli: return Constants.ENSRegistrarGoerli
case .xDai, .kovan, .poa, .sokol, .classic, .callisto, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .xDai, .kovan, .poa, .sokol, .classic, .callisto, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return Constants.ENSRegistrarAddress
}
}
var endRecordsContract: AlphaWallet.Address {
switch self {
case .main, .xDai, .kovan, .ropsten, .rinkeby, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .xDai, .kovan, .ropsten, .rinkeby, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return Constants.ENSRecordsContractAddress
case .poa:
return Constants.ENSRecordsContractAddressPOA
@ -622,7 +632,7 @@ enum RPCServer: Hashable, CaseIterable {
switch self {
case .main, .xDai:
return .normal
case .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return .low
}
}
@ -667,6 +677,8 @@ enum RPCServer: Hashable, CaseIterable {
return custom.chainName
case .arbitrum:
return R.string.localizable.blockchainArbitrum()
case .arbitrumRinkeby:
return R.string.localizable.blockchainArbitrumRinkeby()
case .palm:
return R.string.localizable.blockchainPalm()
case .palmTestnet:
@ -700,6 +712,7 @@ enum RPCServer: Hashable, CaseIterable {
case .optimisticKovan: return .red
case .cronosTestnet: return .red
case .arbitrum: return .red
case .arbitrumRinkeby: return .red
case .palm: return .red
case .palmTestnet: return .red
}
@ -707,7 +720,7 @@ enum RPCServer: Hashable, CaseIterable {
var transactionDataCoordinatorType: SingleChainTransactionDataCoordinator.Type {
switch self {
case .main, .classic, .callisto, .kovan, .ropsten, .custom, .rinkeby, .poa, .sokol, .goerli, .xDai, .artis_sigma1, .binance_smart_chain, .binance_smart_chain_testnet, .artis_tau1, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .classic, .callisto, .kovan, .ropsten, .custom, .rinkeby, .poa, .sokol, .goerli, .xDai, .artis_sigma1, .binance_smart_chain, .binance_smart_chain_testnet, .artis_tau1, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return SingleChainTransactionEtherscanDataCoordinator.self
}
}
@ -748,6 +761,8 @@ enum RPCServer: Hashable, CaseIterable {
return R.image.iconsTokensOptimisticKovan()
case .arbitrum:
return R.image.arbitrum()
case .arbitrumRinkeby:
return nil
case .palm:
return R.image.iconsTokensPalm()
case .palmTestnet:
@ -812,6 +827,7 @@ enum RPCServer: Hashable, CaseIterable {
.optimisticKovan,
.cronosTestnet,
.arbitrum,
.arbitrumRinkeby,
]
if Features.isPalmEnabled {
return all + [.palm, .palmTestnet]
@ -848,7 +864,7 @@ enum RPCServer: Hashable, CaseIterable {
case .polygon:
//These not allow range more than 3500
return .blockNumber(fromBlockNumber + 3499)
case .mumbai_testnet, .cronosTestnet, .arbitrum:
case .mumbai_testnet, .cronosTestnet, .arbitrum, .arbitrumRinkeby:
//These not allow range more than 100000
return .blockNumber(fromBlockNumber + 99990)
case .main, .kovan, .ropsten, .rinkeby, .poa, .classic, .callisto, .xDai, .goerli, .artis_sigma1, .artis_tau1, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .optimisticKovan, .sokol, .custom, .palm, .palmTestnet:

@ -179,7 +179,7 @@ class SingleChainTokenCoordinator: Coordinator {
autoDetectXDaiPartnerTokens()
case .rinkeby:
autoDetectRinkebyPartnerTokens()
case .kovan, .ropsten, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .binance_smart_chain, .binance_smart_chain_testnet, .artis_tau1, .custom, .heco_testnet, .heco, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .kovan, .ropsten, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .binance_smart_chain, .binance_smart_chain_testnet, .artis_tau1, .custom, .heco_testnet, .heco, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
break
}
}

@ -129,8 +129,9 @@ extension RPCServer {
case .optimisticKovan: return 23
case .cronosTestnet: return 24
case .arbitrum: return 25
case .palm: return 26
case .palmTestnet: return 27
case .arbitrumRinkeby: return 26
case .palm: return 27
case .palmTestnet: return 28
}
}
}

@ -55,7 +55,7 @@ struct TokenViewControllerViewModel {
switch token.server {
case .xDai:
return [.init(type: .erc20Send), .init(type: .erc20Receive)] + tokenActionsProvider.actions(token: key)
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .custom, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .custom, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return actions + tokenActionsProvider.actions(token: key)
}
}

@ -352,7 +352,7 @@ class SingleChainTransactionEtherscanDataCoordinator: SingleChainTransactionData
}
case .classic, .xDai:
break
case .kovan, .ropsten, .rinkeby, .poa, .sokol, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .kovan, .ropsten, .rinkeby, .poa, .sokol, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
break
}
}
@ -377,7 +377,7 @@ class SingleChainTransactionEtherscanDataCoordinator: SingleChainTransactionData
switch session.server {
case .main, .xDai:
content.body = R.string.localizable.transactionsReceivedEther(amount, session.server.symbol)
case .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
content.body = R.string.localizable.transactionsReceivedEther("\(amount) (\(session.server.name))", session.server.symbol)
}
content.sound = .default

@ -229,7 +229,7 @@ class TransactionConfigurator {
switch server {
case .xDai:
return estimateGasPriceForXDai()
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
return Promise(estimateGasPriceForUseRpcNode(server: server))
}
}
@ -309,7 +309,7 @@ class TransactionConfigurator {
// return .networkCongested
//}
break
case .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .fantom, .fantom_testnet, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .xDai, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .fantom, .fantom_testnet, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
break
}
return nil
@ -320,7 +320,7 @@ class TransactionConfigurator {
case .xDai:
//xdai transactions are always 1 gwei in gasPrice
return GasPriceConfiguration.xDaiGasPrice
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .palm, .palmTestnet:
case .main, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet, .arbitrum, .arbitrumRinkeby, .palm, .palmTestnet:
if let gasPrice = transaction.gasPrice, gasPrice > 0 {
return min(max(gasPrice, GasPriceConfiguration.minPrice), GasPriceConfiguration.maxPrice)
} else {

@ -66,6 +66,8 @@ extension RPCServer {
return nil
case .arbitrum:
return R.image.iconsNetworkArbitrum()
case .arbitrumRinkeby:
return nil
case .palm, .palmTestnet:
return R.image.iconsTokensPalm()
}
@ -162,7 +164,7 @@ class TokenImageFetcher {
TokenImageFetcher.subscribables[key] = sub
subscribable = sub
}
func getDefaultOrGenerateIcon() -> TokenImage? {
switch type {
case .nativeCryptocurrency:
@ -200,7 +202,7 @@ class TokenImageFetcher {
if let image = generatedImage, image.isFinal {
return
}
}
firstly {
TokenImageFetcher
@ -213,7 +215,7 @@ class TokenImageFetcher {
.fetchFromOpenSea(type, balance: balance, queue: queue)
.map(on: queue, { url -> TokenImage in
return (image: url, symbol: "", isFinal: true, overlayServerIcon: server.staticOverlayIcon)
})
})
}).recover(on: queue, { _ -> Promise<TokenImage> in
return TokenImageFetcher
.fetchFromAssetGitHubRepo(.thirdParty, contractAddress: contractAddress, queue: queue)

Loading…
Cancel
Save