@@ -19,7 +19,6 @@ use bdk_wallet::bitcoin::secp256k1::Secp256k1;
19
19
use bdk_wallet:: bitcoin:: Amount as BdkAmount ;
20
20
use bdk_wallet:: bitcoin:: BlockHash as BitcoinBlockHash ;
21
21
use bdk_wallet:: bitcoin:: FeeRate as BdkFeeRate ;
22
- use bdk_wallet:: bitcoin:: Network ;
23
22
use bdk_wallet:: bitcoin:: OutPoint as BdkOutPoint ;
24
23
use bdk_wallet:: bitcoin:: Psbt as BdkPsbt ;
25
24
use bdk_wallet:: bitcoin:: ScriptBuf as BdkScriptBuf ;
@@ -39,6 +38,7 @@ use std::str::FromStr;
39
38
use std:: sync:: { Arc , Mutex } ;
40
39
41
40
pub ( crate ) type DescriptorType = bdk_wallet:: miniscript:: descriptor:: DescriptorType ;
41
+ pub type Network = bdk_wallet:: bitcoin:: Network ;
42
42
43
43
/// A reference to an unspent output by TXID and output index.
44
44
#[ derive( Debug , Clone , Eq , PartialEq , std:: hash:: Hash , uniffi:: Record ) ]
@@ -76,6 +76,24 @@ impl From<OutPoint> for BdkOutPoint {
76
76
}
77
77
}
78
78
79
+ /// The cryptocurrency network to act on.
80
+ ///
81
+ /// This is an exhaustive enum, meaning that we cannot add any future networks without defining a
82
+ /// new, incompatible version of this type. If you are using this type directly and wish to support
83
+ /// the new network, this will be a breaking change to your APIs and likely require changes in your
84
+ /// code.
85
+ ///
86
+ /// If you are concerned about forward compatibility, consider using T: Into<Params> instead of this
87
+ /// type as a parameter to functions in your public API, or directly using the Params type.
88
+ #[ uniffi:: remote( Enum ) ]
89
+ pub enum Network {
90
+ Bitcoin ,
91
+ Testnet ,
92
+ Testnet4 ,
93
+ Signet ,
94
+ Regtest ,
95
+ }
96
+
79
97
/// An [`OutPoint`] used as a key in a hash map.
80
98
///
81
99
/// Due to limitations in generating the foreign language bindings, we cannot use [`OutPoint`] as a
0 commit comments