pin some networks

This commit is contained in:
ivan grachev 2023-11-08 21:01:33 +03:00
parent c6ef3e39ec
commit 748868b444
3 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,10 @@ struct Networks {
return allBundledDict[id]
}
static let pinned: [EthereumNetwork] = {
return [1, 7777777, 10, 8453, 42161].compactMap { Networks.withChainId($0) }
}()
static let allMainnets: [EthereumNetwork] = {
return allBundled.filter { !$0.isTestnet }
}()

View File

@ -96,5 +96,6 @@ struct Strings {
static let pleaseGetANewOne = "please get a new one"
static let notNow = "not now"
static let done = "Done"
static let pinned = "Pinned"
}

View File

@ -6,6 +6,7 @@ struct NetworksListView: View {
private let mainnets = Networks.allMainnets
private let testnets = Networks.allTestnets
private let pinned = Networks.pinned
@Environment(\.presentationMode) var presentationMode
@State private var selectedChainId: Int?
@ -16,6 +17,7 @@ struct NetworksListView: View {
NavigationView {
VStack {
List {
networkSection(networks: pinned, title: Strings.pinned)
networkSection(networks: mainnets)
networkSection(networks: testnets, title: Strings.testnets)
}