@@ -30,7 +30,7 @@ use bitcoin::block::Version;
30
30
use bitcoin:: consensus:: encode;
31
31
use bitcoin:: hashes:: hex:: FromHex ;
32
32
use bitcoin:: hashes:: sha256;
33
- use bitcoin:: { Address , Amount , PrivateKey , PublicKey , SignedAmount , Transaction , ScriptBuf , Script , bip158, bip32, Network } ;
33
+ use bitcoin:: { Address , Amount , PrivateKey , PublicKey , SignedAmount , Transaction , ScriptBuf , Script , bip158, bip32, Network , BlockHash } ;
34
34
use serde:: de:: Error as SerdeError ;
35
35
use serde:: { Deserialize , Serialize } ;
36
36
use std:: fmt;
@@ -2087,6 +2087,28 @@ pub enum PubKeyOrAddress<'a> {
2087
2087
PubKey ( & ' a PublicKey ) ,
2088
2088
}
2089
2089
2090
+ #[ derive( Serialize , Deserialize , Clone , PartialEq , Eq , Debug ) ]
2091
+ #[ serde( untagged) ]
2092
+ /// Start a scan of the UTXO set for an [output descriptor](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md).
2093
+ pub enum ScanBlocksRequest {
2094
+ /// Scan for a single descriptor
2095
+ Single ( String ) ,
2096
+ /// Scan for a descriptor with xpubs
2097
+ Extended {
2098
+ /// Descriptor
2099
+ desc : String ,
2100
+ /// Range of the xpub derivations to scan
2101
+ range : Option < ( u64 , u64 ) > ,
2102
+ } ,
2103
+ }
2104
+
2105
+ #[ derive( Serialize , Deserialize , Clone , PartialEq , Eq , Debug ) ]
2106
+ pub struct ScanBlocksResult {
2107
+ pub from_height : u64 ,
2108
+ pub to_height : u64 ,
2109
+ pub relevant_blocks : Vec < BlockHash > ,
2110
+ }
2111
+
2090
2112
#[ derive( Serialize , Deserialize , Clone , PartialEq , Eq , Debug ) ]
2091
2113
#[ serde( untagged) ]
2092
2114
/// Start a scan of the UTXO set for an [output descriptor](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md).
0 commit comments