File tree Expand file tree Collapse file tree 4 files changed +53
-5
lines changed Expand file tree Collapse file tree 4 files changed +53
-5
lines changed Original file line number Diff line number Diff line change 700
700
}
701
701
}
702
702
}
703
+ },
704
+ "Testnet4" : {
705
+
703
706
},
704
707
"To" : {
705
708
"extractionState" : "stale",
Original file line number Diff line number Diff line change @@ -24,8 +24,21 @@ private class BDKService {
24
24
self . keyClient = keyClient
25
25
let storedNetworkString = try ? keyClient. getNetwork ( ) ?? Network . signet. description
26
26
self . network = Network ( stringValue: storedNetworkString ?? " " ) ?? . signet
27
- self . esploraURL =
28
- try ! keyClient. getEsploraURL ( ) ?? Constants . Config. EsploraServerURLNetwork. Signet. mutiny
27
+
28
+ switch self . network {
29
+ case . bitcoin:
30
+ self . esploraURL = Constants . Config. EsploraServerURLNetwork. Bitcoin. allValues. first ?? " "
31
+ case . testnet:
32
+ self . esploraURL = Constants . Config. EsploraServerURLNetwork. Testnet. allValues. first ?? " "
33
+ case . regtest:
34
+ self . esploraURL = Constants . Config. EsploraServerURLNetwork. Regtest. allValues. first ?? " "
35
+ case . signet:
36
+ self . esploraURL = Constants . Config. EsploraServerURLNetwork. Signet. allValues. first ?? " "
37
+ case . testnet4:
38
+ self . esploraURL =
39
+ Constants . Config. EsploraServerURLNetwork. Testnet4. allValues. first ?? " "
40
+ }
41
+
29
42
self . esploraClient = EsploraClient ( url: self . esploraURL)
30
43
}
31
44
@@ -188,8 +201,19 @@ private class BDKService {
188
201
} else {
189
202
}
190
203
191
- let baseUrl =
192
- try keyClient. getEsploraURL ( ) ?? Constants . Config. EsploraServerURLNetwork. Signet. mutiny
204
+ let baseUrl : String
205
+ switch self . network {
206
+ case . bitcoin:
207
+ baseUrl = Constants . Config. EsploraServerURLNetwork. Bitcoin. allValues. first ?? " "
208
+ case . testnet:
209
+ baseUrl = Constants . Config. EsploraServerURLNetwork. Testnet. allValues. first ?? " "
210
+ case . regtest:
211
+ baseUrl = Constants . Config. EsploraServerURLNetwork. Regtest. allValues. first ?? " "
212
+ case . signet:
213
+ baseUrl = Constants . Config. EsploraServerURLNetwork. Signet. allValues. first ?? " "
214
+ case . testnet4:
215
+ baseUrl = Constants . Config. EsploraServerURLNetwork. Testnet4. allValues. first ?? " "
216
+ }
193
217
194
218
guard let descriptorString = descriptor, !descriptorString. isEmpty else {
195
219
throw WalletError . walletNotFound
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ struct TransactionListView: View {
41
41
if let mutinyFaucetURL,
42
42
let signetFaucetURL,
43
43
viewModel. getNetwork ( ) != Network . testnet. description
44
+ && viewModel. getNetwork ( ) != Network . testnet4. description
44
45
{
45
-
46
46
Button {
47
47
UIApplication . shared. open (
48
48
viewModel. getEsploraURL ( )
@@ -59,7 +59,27 @@ struct TransactionListView: View {
59
59
. underline ( )
60
60
}
61
61
. buttonStyle ( . plain)
62
+ }
63
+
64
+ let testnet4FaucetURL = URL ( string: " https://mempool.space/testnet4/faucet " )
62
65
66
+ if let testnet4FaucetURL,
67
+ viewModel. getNetwork ( ) == Network . testnet4. description
68
+ {
69
+ Button {
70
+ UIApplication . shared. open (
71
+ testnet4FaucetURL
72
+ )
73
+ } label: {
74
+ HStack ( spacing: 2 ) {
75
+ Text ( " Get sats from faucet " )
76
+ Image ( systemName: " arrow.right " )
77
+ }
78
+ . font ( . caption)
79
+ . foregroundStyle ( . secondary)
80
+ . underline ( )
81
+ }
82
+ . buttonStyle ( . plain)
63
83
}
64
84
65
85
}
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ struct OnboardingView: View {
114
114
Picker ( " Network " , selection: $viewModel. selectedNetwork) {
115
115
Text ( " Signet " ) . tag ( Network . signet)
116
116
Text ( " Testnet " ) . tag ( Network . testnet)
117
+ Text ( " Testnet4 " ) . tag ( Network . testnet4)
117
118
}
118
119
. pickerStyle ( . automatic)
119
120
. tint ( . primary)
You can’t perform that action at this time.
0 commit comments