@@ -9,7 +9,8 @@ use std::collections::BTreeMap;
99
1010use bitcoin:: address:: NetworkUnchecked ;
1111use bitcoin:: {
12- block, Address , Block , BlockHash , CompactTarget , Network , TxOut , Txid , Weight , Work ,
12+ block, Address , Block , BlockHash , CompactTarget , Network , TxMerkleNode , TxOut , Txid , Weight ,
13+ Work ,
1314} ;
1415use serde:: { Deserialize , Serialize } ;
1516
@@ -176,6 +177,51 @@ pub struct Bip9SoftforkStatistics {
176177 pub possible : Option < bool > ,
177178}
178179
180+ /// Models the result of JSON-RPC method `getblockcount`.
181+ #[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
182+ pub struct GetBlockCount ( pub u64 ) ;
183+
184+ /// Models the result of JSON-RPC method `getblockhash`.
185+ #[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
186+ pub struct GetBlockHash ( pub BlockHash ) ;
187+
188+ /// Models the result of JSON-RPC method `getblockheader`.
189+ #[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
190+ pub struct GetBlockHeader ( pub block:: Header ) ;
191+
192+ /// Models the result of JSON-RPC method `getblockheader`.
193+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
194+ pub struct GetBlockHeaderVerbose {
195+ /// the block hash (same as provided).
196+ pub hash : BlockHash ,
197+ /// The number of confirmations, or -1 if the block is not on the main chain.
198+ pub confirmations : i64 ,
199+ /// The block height or index.
200+ pub height : u64 ,
201+ /// Block version, now repurposed for soft fork signalling.
202+ pub version : block:: Version ,
203+ /// The root hash of the Merkle tree of transactions in the block.
204+ pub merkle_root : TxMerkleNode ,
205+ /// The timestamp of the block, as claimed by the miner (seconds since epoch (Jan 1 1970 GMT).
206+ pub time : u64 ,
207+ /// The median block time in seconds since epoch (Jan 1 1970 GMT).
208+ pub median_time : u64 ,
209+ /// The nonce.
210+ pub nonce : u64 ,
211+ /// The target value below which the blockhash must lie.
212+ pub bits : CompactTarget ,
213+ /// The difficulty.
214+ pub difficulty : f64 ,
215+ /// Expected number of hashes required to produce the current chain.
216+ pub chainwork : Work ,
217+ /// The number of transactions in the block.
218+ pub n_tx : u32 ,
219+ /// The hash of the previous block (if available).
220+ pub previous_block_hash : Option < BlockHash > ,
221+ /// The hash of the next block (if available).
222+ pub next_block_hash : Option < BlockHash > ,
223+ }
224+
179225/// Models the result of JSON-RPC method `gettxout`.
180226#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
181227pub struct GetTxOut {
0 commit comments