@@ -84,7 +84,7 @@ pub struct Args {
84
84
/// `https://mempool.space/api/v1/historical-price?currency=USD?timestamp=0`
85
85
pub timestamp : Option < String > ,
86
86
87
- // ADDRESSES
87
+ /// - ADDRESSES
88
88
/// `https://mempool.space/api/address/<ADDRESS>`
89
89
pub address : Option < String > ,
90
90
/// `https://mempool.space/api/address/<ADDRESS>/txs`
@@ -101,6 +101,8 @@ pub struct Args {
101
101
/// - BLOCK
102
102
/// `https://mempool.space/api/block/<BLOCK_HASH>`
103
103
pub block : Option < String > ,
104
+
105
+ /// - BLOCK_HEADER
104
106
/// `https://mempool.space/api/block/<BLOCK_HASH>/header`
105
107
pub block_header : Option < String > ,
106
108
@@ -213,7 +215,10 @@ impl Args {
213
215
opts. optopt ( "" , "address_utxos" , "address_utxos api call" , "ADDRESS_UTXOS" ) ;
214
216
opts. optopt ( "" , "validate_address" , "validate an address" , "VALIDATE_ADDRESS" ) ;
215
217
218
+ // BLOCK/S
216
219
opts. optopt ( "" , "block" , "block api call" , "BLOCK" ) ;
220
+ opts. optopt ( "" , "block_header" , "block-header api call" , "BLOCK_HEADER" ) ;
221
+ opts. optopt ( "" , "block_height" , "block-height api call" , "BLOCK_HEIGHT" ) ;
217
222
218
223
//OPTOPT
219
224
opts. optopt ( "c" , "config" , "sets the configuration file" , "CONFIG" ) ;
@@ -293,7 +298,18 @@ impl Args {
293
298
}
294
299
295
300
if matches. opt_present ( "block" ) {
296
- print ! ( "69:block" ) ;
301
+ let block = matches. opt_str ( "block" ) ;
302
+ generic_sys_call ( "block" , & block. unwrap ( ) ) ;
303
+ std:: process:: exit ( 0 ) ;
304
+ }
305
+ if matches. opt_present ( "block_header" ) {
306
+ let block_header = matches. opt_str ( "block_header" ) ;
307
+ generic_sys_call ( "block_header" , & block_header. unwrap ( ) ) ;
308
+ std:: process:: exit ( 0 ) ;
309
+ }
310
+ if matches. opt_present ( "block_height" ) {
311
+ let block_height = matches. opt_str ( "block_height" ) ;
312
+ generic_sys_call ( "block_height" , & block_height. unwrap ( ) ) ;
297
313
std:: process:: exit ( 0 ) ;
298
314
}
299
315
0 commit comments