File tree Expand file tree Collapse file tree 5 files changed +21
-19
lines changed
java/org/bitcoindevkit/devkitwallet
presentation/ui/components Expand file tree Collapse file tree 5 files changed +21
-19
lines changed Original file line number Diff line number Diff line change @@ -40,17 +40,11 @@ class BlockchainClientsConfig {
40
40
fun createDefaultConfig (network : Network ): BlockchainClientsConfig {
41
41
val config = BlockchainClientsConfig ()
42
42
when (network) {
43
- Network .REGTEST -> {
44
- config.addClient(EsploraClient (" http://10.0.2.2:3002" ), true )
45
- }
46
- Network .TESTNET -> {
47
- config.addClient(EsploraClient (" https://blockstream.info/testnet/api/" ), true )
48
- }
49
- Network .TESTNET4 -> throw IllegalArgumentException (" This app does not support testnet 4 yet" )
50
- Network .SIGNET -> {
51
- config.addClient(EsploraClient (" http://signet.bitcoindevkit.net" ), true )
52
- }
53
- Network .BITCOIN -> throw IllegalArgumentException (" This app does not support mainnet" )
43
+ Network .REGTEST -> config.addClient(EsploraClient (" http://10.0.2.2:3002" ), true )
44
+ Network .SIGNET -> config.addClient(EsploraClient (" http://signet.bitcoindevkit.net" ), true )
45
+ Network .TESTNET -> config.addClient(EsploraClient (" https://blockstream.info/testnet/api/" ), true )
46
+ Network .TESTNET4 -> config.addClient(EsploraClient (" https://mempool.space/testnet4/api/" ), true )
47
+ Network .BITCOIN -> throw IllegalArgumentException (" This app does not support mainnet" )
54
48
}
55
49
return config
56
50
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2021-2025 thunderbiscuit and contributors.
3
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the ./LICENSE file.
4
+ */
5
+
1
6
package org.bitcoindevkit.devkitwallet.domain
2
7
3
8
import org.bitcoindevkit.Network
4
9
5
10
val supportedNetworks: List <Network > = listOf (
6
11
Network .SIGNET ,
7
12
Network .TESTNET ,
13
+ Network .TESTNET4 ,
8
14
Network .REGTEST ,
9
15
)
10
16
Original file line number Diff line number Diff line change @@ -11,18 +11,19 @@ import org.bitcoindevkit.devkitwallet.data.ActiveWalletNetwork
11
11
fun Network.intoProto (): ActiveWalletNetwork {
12
12
return when (this ) {
13
13
Network .REGTEST -> ActiveWalletNetwork .REGTEST
14
- Network .TESTNET -> ActiveWalletNetwork .TESTNET
15
- Network .TESTNET4 -> throw IllegalArgumentException ( " Bitcoin testnet 4 network is not supported " )
14
+ Network .TESTNET -> ActiveWalletNetwork .TESTNET3
15
+ Network .TESTNET4 -> ActiveWalletNetwork . TESTNET4
16
16
Network .SIGNET -> ActiveWalletNetwork .SIGNET
17
17
Network .BITCOIN -> throw IllegalArgumentException (" Bitcoin mainnet network is not supported" )
18
18
}
19
19
}
20
20
21
21
fun ActiveWalletNetwork.intoDomain (): Network {
22
22
return when (this ) {
23
- ActiveWalletNetwork .TESTNET -> Network .TESTNET
24
- ActiveWalletNetwork .SIGNET -> Network .SIGNET
25
- ActiveWalletNetwork .REGTEST -> Network .REGTEST
23
+ ActiveWalletNetwork .REGTEST -> Network .REGTEST
24
+ ActiveWalletNetwork .SIGNET -> Network .SIGNET
25
+ ActiveWalletNetwork .TESTNET3 -> Network .TESTNET
26
+ ActiveWalletNetwork .TESTNET4 -> Network .TESTNET4
26
27
ActiveWalletNetwork .UNRECOGNIZED -> throw IllegalArgumentException (" Unrecognized network" )
27
28
}
28
29
}
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ fun WalletOptionsCard(
60
60
isSelected = selectedNetwork.value == it,
61
61
onSelect = { selectedNetwork.value = it }
62
62
)
63
- if (index == 2 ) Spacer (modifier = Modifier .padding(bottom = 8 .dp))
63
+ if (index == 3 ) Spacer (modifier = Modifier .padding(bottom = 8 .dp))
64
64
}
65
65
66
66
Text (
Original file line number Diff line number Diff line change @@ -20,9 +20,10 @@ message SingleWallet {
20
20
}
21
21
22
22
enum ActiveWalletNetwork {
23
- TESTNET = 0 ;
23
+ REGTEST = 0 ;
24
24
SIGNET = 1 ;
25
- REGTEST = 2 ;
25
+ TESTNET3 = 2 ;
26
+ TESTNET4 = 3 ;
26
27
}
27
28
28
29
enum ActiveWalletScriptType {
You can’t perform that action at this time.
0 commit comments