Skip to content

Commit

Permalink
Add Rootstock network
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsan-javaiid committed Aug 31, 2023
1 parent d259302 commit 5f0eb37
Show file tree
Hide file tree
Showing 20 changed files with 106 additions and 19 deletions.
2 changes: 2 additions & 0 deletions AlphaWallet/Common/Types/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ struct Configuration {
static let blockChainFantomTestnet = UIColor.red
static let blockChainAvalanche = UIColor.red
static let blockChainAvalancheTestnet = UIColor.red
static let blockChainRootstock = UIColor.black
static let blockChainRootstockTestnet = UIColor.black
static let blockChainPolygon = UIColor(red: 130, green: 71, blue: 229)
static let blockChainOptimistic = UIColor.red
static let blockChainCronosTestnet = UIColor.red
Expand Down
6 changes: 6 additions & 0 deletions AlphaWallet/Extensions/RPCServer+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ extension RPCServer {
case .fantom_testnet: return R.string.localizable.blockchainFantomTest()
case .avalanche: return R.string.localizable.blockchainAvalanche()
case .avalanche_testnet: return R.string.localizable.blockchainAvalancheTest()
case .rootstock: return R.string.localizable.blockchainRootstock()
case .rootstock_testnet: return R.string.localizable.blockchainRootstockTest()
case .polygon: return R.string.localizable.blockchainPolygon()
case .mumbai_testnet: return R.string.localizable.blockchainMumbai()
case .optimistic: return R.string.localizable.blockchainOptimistic()
Expand Down Expand Up @@ -62,6 +64,7 @@ extension RPCServer {
case .heco_testnet: return R.image.hthecoTestnet()
case .fantom, .fantom_testnet: return R.image.iconsTokensFantom()
case .avalanche, .avalanche_testnet: return R.image.iconsTokensAvalanche()
case .rootstock, .rootstock_testnet: return R.image.iconsTokensRootstock()
case .polygon, .mumbai_testnet: return R.image.iconsTokensPolygon()
case .optimistic: return R.image.iconsTokensOptimistic()
case .arbitrum: return R.image.arbitrum()
Expand Down Expand Up @@ -91,6 +94,8 @@ extension RPCServer {
case .fantom_testnet: return Configuration.Color.Semantic.blockChainFantomTestnet
case .avalanche: return Configuration.Color.Semantic.blockChainAvalanche
case .avalanche_testnet: return Configuration.Color.Semantic.blockChainAvalancheTestnet
case .rootstock: return Configuration.Color.Semantic.blockChainRootstock
case .rootstock_testnet: return Configuration.Color.Semantic.blockChainRootstockTestnet
case .polygon, .mumbai_testnet: return Configuration.Color.Semantic.blockChainPolygon
case .optimistic: return Configuration.Color.Semantic.blockChainOptimistic
case .cronosMainnet: return Configuration.Color.Semantic.blockChainCronosMainnet
Expand Down Expand Up @@ -122,6 +127,7 @@ extension RPCServer {
case .cronosMainnet: return R.image.iconsNetworkCronos()
case .fantom, .fantom_testnet: return R.image.iconsNetworkFantom()
case .avalanche, .avalanche_testnet: return R.image.iconsNetworkAvalanche()
case .rootstock, .rootstock_testnet: return R.image.iconsNetworkRootstock()
case .polygon: return R.image.iconsNetworkPolygon()
case .mumbai_testnet: return nil
case .optimistic: return R.image.iconsNetworkOptimism()
Expand Down
2 changes: 2 additions & 0 deletions AlphaWallet/Localization/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@
"blockchain.fantom.test" = "Fantom Testnet Network";
"blockchain.Avalanche" = "Avalanche Mainnet C-Chain";
"blockchain.Avalanche.test" = "Avalanche FUJI C-Chain";
"blockchain.Rootstock" = "Rootstock Mainnet";
"blockchain.Rootstock.test" = "Rootstock Testnet";
"blockchain.Polygon" = "Polygon Mainnet";
"blockchain.Mumbai" = "Mumbai Testnet";
"blockchain.Optimistic" = "Optimistic Testnet";
Expand Down
2 changes: 2 additions & 0 deletions AlphaWallet/Localization/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@
"blockchain.fantom.test" = "Fantom Testnet Network";
"blockchain.Avalanche" = "Avalanche Mainnet C-Chain";
"blockchain.Avalanche.test" = "Avalanche FUJI C-Chain";
"blockchain.Rootstock" = "Rootstock Mainnet";
"blockchain.Rootstock.test" = "Rootstock Testnet";
"blockchain.Polygon" = "Polygon Mainnet";
"blockchain.Mumbai" = "Mumbai Testnet";
"blockchain.Optimistic" = "Optimistic Testnet";
Expand Down
2 changes: 2 additions & 0 deletions AlphaWallet/Localization/fi.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@
"blockchain.fantom.test" = "Fantom Testnet Network";
"blockchain.Avalanche" = "Avalanche Mainnet C-Chain";
"blockchain.Avalanche.test" = "Avalanche FUJI C-Chain";
"blockchain.Rootstock" = "Rootstock Mainnet";
"blockchain.Rootstock.test" = "Rootstock Testnet";
"blockchain.Polygon" = "Polygon Mainnet";
"blockchain.Mumbai" = "Mumbai Testnet";
"blockchain.Optimistic" = "Optimistic Testnet";
Expand Down
2 changes: 2 additions & 0 deletions AlphaWallet/Localization/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@
"blockchain.fantom.test" = "Fantom Testnet Network";
"blockchain.Avalanche" = "Avalanche Mainnet C-Chain";
"blockchain.Avalanche.test" = "Avalanche FUJI C-Chain";
"blockchain.Rootstock" = "Rootstock Mainnet";
"blockchain.Rootstock.test" = "Rootstock Testnet";
"blockchain.Polygon" = "Polygon Mainnet";
"blockchain.Mumbai" = "Mumbai Testnet";
"blockchain.Optimistic" = "Optimistic Testnet";
Expand Down
2 changes: 2 additions & 0 deletions AlphaWallet/Localization/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@
"blockchain.fantom.test" = "Fantom Testnet Network";
"blockchain.Avalanche" = "Avalanche Mainnet C-Chain";
"blockchain.Avalanche.test" = "Avalanche FUJI C-Chain";
"blockchain.Rootstock" = "Rootstock Mainnet";
"blockchain.Rootstock.test" = "Rootstock Testnet";
"blockchain.Polygon" = "Polygon Mainnet";
"blockchain.Mumbai" = "Mumbai Testnet";
"blockchain.Optimistic" = "Optimistic Testnet";
Expand Down
2 changes: 2 additions & 0 deletions AlphaWallet/Localization/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@
"blockchain.fantom.test" = "Fantom Testnet Network";
"blockchain.Avalanche" = "Avalanche Mainnet C-Chain";
"blockchain.Avalanche.test" = "Avalanche FUJI C-Chain";
"blockchain.Rootstock" = "Rootstock Mainnet";
"blockchain.Rootstock.test" = "Rootstock Testnet";
"blockchain.Polygon" = "Polygon Mainnet";
"blockchain.Mumbai" = "Mumbai Testnet";
"blockchain.Optimistic" = "Optimistic Testnet";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "icons-network-rootstock.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"images" : [
{
"filename" : "iconsTokensRootstock.pdf",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
6 changes: 6 additions & 0 deletions modules/AlphaWalletCore/AlphaWalletCore/Types/RPCServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public enum RPCServer: Hashable, CaseIterable {
case fantom_testnet
case avalanche
case avalanche_testnet
case rootstock
case rootstock_testnet
case polygon
case mumbai_testnet
case optimistic
Expand Down Expand Up @@ -58,6 +60,8 @@ public enum RPCServer: Hashable, CaseIterable {
case .fantom_testnet: return 0xfa2
case .avalanche: return 0xa86a
case .avalanche_testnet: return 0xa869
case .rootstock: return 30
case .rootstock_testnet: return 31
case .polygon: return 137
case .mumbai_testnet: return 80001
case .optimistic: return 10
Expand Down Expand Up @@ -93,6 +97,8 @@ public enum RPCServer: Hashable, CaseIterable {
.fantom_testnet,
.avalanche,
.avalanche_testnet,
.rootstock,
.rootstock_testnet,
.polygon,
.callisto,
.mumbai_testnet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private protocol CoinTickerServiceIdentifieble {
extension CoinTickerServiceIdentifieble {
var coinTickerProviderType: CoinTickersFetcher.Type {
switch server {
case .main, .classic, .callisto, .custom, .goerli, .xDai, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .cronosTestnet, .arbitrum, .palm, .palmTestnet, .klaytnCypress, .klaytnBaobabTestnet, .ioTeX, .ioTeXTestnet, .optimismGoerli, .arbitrumGoerli, .cronosMainnet, .okx, .sepolia:
case .main, .classic, .callisto, .custom, .goerli, .xDai, .binance_smart_chain, .binance_smart_chain_testnet, .heco, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .rootstock, .rootstock_testnet, .polygon, .mumbai_testnet, .optimistic, .cronosTestnet, .arbitrum, .palm, .palmTestnet, .klaytnCypress, .klaytnBaobabTestnet, .ioTeX, .ioTeXTestnet, .optimismGoerli, .arbitrumGoerli, .cronosMainnet, .okx, .sepolia:
return CoinGeckoTickersFetcher.self
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ extension RPCServer {
case "xdai": self = .xDai
case "binance-smart-chain": self = .binance_smart_chain
case "avalanche": self = .avalanche
case "rootstock": self = .rootstock
case "polygon-pos": self = .polygon
case "fantom": self = .fantom
case "arbitrum-one": self = .arbitrum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extension RPCServer {
var supportsEip1559: Bool {
switch self {
case .main, .polygon, .goerli: return true
case .binance_smart_chain, .heco, .arbitrum, .klaytnCypress, .klaytnBaobabTestnet, .xDai, .custom, .callisto, .classic, .binance_smart_chain_testnet, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .mumbai_testnet, .optimistic, .cronosTestnet, .palm, .palmTestnet, .ioTeX, .ioTeXTestnet, .optimismGoerli, .arbitrumGoerli, .cronosMainnet, .okx, .sepolia: return false
case .binance_smart_chain, .heco, .arbitrum, .klaytnCypress, .klaytnBaobabTestnet, .xDai, .custom, .callisto, .classic, .binance_smart_chain_testnet, .heco_testnet, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .rootstock, .rootstock_testnet, .mumbai_testnet, .optimistic, .cronosTestnet, .palm, .palmTestnet, .ioTeX, .ioTeXTestnet, .optimismGoerli, .arbitrumGoerli, .cronosMainnet, .okx, .sepolia: return false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public struct Constants {
static let fantomTestMagicLinkHost = "test-fantom.aw.app"
static let avalancheMagicLinkHost = "avalanche.aw.app"
static let avalancheTestMagicLinkHost = "test-avalanche.aw.app"
static let rootstockMagicLinkHost = "rootstock.aw.app"
static let rootstockTestMagicLinkHost = "test-rootstock.aw.app"
static let maticMagicLinkHost = "polygon.aw.app"
static let mumbaiTestMagicLinkHost = "test-polygon.aw.app"
static let optimisticMagicLinkHost = "optimistic.aw.app"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ private extension RPCServer {
case .fantom_testnet: return ""
case .avalanche: return ""
case .avalanche_testnet: return ""
case .rootstock: return ""
case .rootstock_testnet: return ""
case .polygon: return ""
case .mumbai_testnet: return ""
case .optimistic: return ""
Expand Down
Loading

0 comments on commit 5f0eb37

Please sign in to comment.