@@ -98,8 +98,49 @@ pub struct Args {
98
98
/// `https://mempool.space/api/validate-address/<ADDRESS>`
99
99
pub validate_address : Option < String > ,
100
100
101
- /// block.
101
+ /// - BLOCK
102
+ /// `https://mempool.space/api/block/<BLOCK_HASH>`
102
103
pub block : Option < String > ,
104
+ /// `https://mempool.space/api/block/<BLOCK_HASH>/header`
105
+ pub block_header : Option < String > ,
106
+
107
+ /// - BLOCK_HEIGHT
108
+ /// `https://mempool.space/api/block-height/<BLOCK_HEIGHT>`
109
+ pub block_height : Option < String > ,
110
+
111
+ /// - V1 MINING BLOCKS TIMESTAMP <UTC_SECS>
112
+ /// `https://mempool.space/api/v1/mining/blocks/timestamp/<UTC_SECS>`
113
+ pub block_timestamp : Option < String > ,
114
+
115
+ /// - BLOCK
116
+ /// `https://mempool.space/api/block/<BLOCK_HASH>/raw`
117
+ pub block_raw : Option < String > ,
118
+ /// `https://mempool.space/api/block/<BLOCK_HASH>/status`
119
+ pub block_status : Option < String > ,
120
+
121
+ /// - BLOCKS TIP HEIGHT
122
+ /// `https://mempool.space/api/blocks/tip/height`
123
+ pub blocks_tip_height : Option < String > ,
124
+ /// - BLOCKS TIP HASH
125
+ /// `https://mempool.space/api/blocks/tip/hash`
126
+ pub blocks_tip_hash : Option < String > ,
127
+
128
+ /// - BLOCK <BLOCK_HASH> <TXID> <INDEX>
129
+ /// `https://mempool.space/api/block/<TXID>/<INDEX>`
130
+ pub block_txid : Option < String > ,
131
+ /// - BLOCK <BLOCK_HASH> <TXIDS>
132
+ /// `https://mempool.space/api/block/<TXID>`
133
+ pub block_txids : Option < String > ,
134
+
135
+ /// - BLOCK <BLOCK_HASH> <TXS>
136
+ /// `https://mempool.space/api/block/<BLOCK_HASH>/txs`
137
+ pub block_txs : Option < String > ,
138
+ /// - V1 BLOCKS <BLOCK_HEIGHT>
139
+ /// `https://mempool.space/api/v1/blocks/<BLOCK_HEIGHT>`
140
+ pub blocks : Option < String > ,
141
+ /// - V1 BLOCKS_BULK <BLOCK_HEIGHT_START> <BLOCK_HEIGHT_STOP>
142
+ /// `https://mempool.space/api/v1/blocks-bulk/<BLOCK_HEIGHT_START>/<BLOCK_HEIGHT_STOP>`
143
+ pub blocks_bulk : Option < String > ,
103
144
104
145
/// Configuration file.
105
146
pub config : Option < PathBuf > ,
@@ -157,8 +198,18 @@ impl Args {
157
198
// ADDRESSES
158
199
opts. optopt ( "" , "address" , "address api call" , "ADDRESS" ) ;
159
200
opts. optopt ( "" , "address_txs" , "address_txs api call" , "ADDRESS_TXS" ) ;
160
- opts. optopt ( "" , "address_txs_chain" , "address_txs_chain api call" , "ADDRESS_TXS_CHAIN" ) ;
161
- opts. optopt ( "" , "address_txs_mempool" , "address_txs_mempool api call" , "ADDRESS_TXS_MEMPOOL" ) ;
201
+ opts. optopt (
202
+ "" ,
203
+ "address_txs_chain" ,
204
+ "address_txs_chain api call" ,
205
+ "ADDRESS_TXS_CHAIN" ,
206
+ ) ;
207
+ opts. optopt (
208
+ "" ,
209
+ "address_txs_mempool" ,
210
+ "address_txs_mempool api call" ,
211
+ "ADDRESS_TXS_MEMPOOL" ,
212
+ ) ;
162
213
opts. optopt ( "" , "address_utxos" , "address_utxos api call" , "ADDRESS_UTXOS" ) ;
163
214
opts. optopt ( "" , "validate_address" , "validate an address" , "VALIDATE_ADDRESS" ) ;
164
215
@@ -302,7 +353,52 @@ impl Args {
302
353
address_utxos : matches. opt_str ( "address_utxos" ) ,
303
354
validate_address : matches. opt_str ( "validate_address" ) ,
304
355
356
+ // BLOCK/S
357
+ // https://mempool.space/api/block/<endpoint>
358
+ // https://mempool.space/api/block/<block_hash>
359
+ // BLOCK
305
360
block : matches. opt_str ( "block" ) ,
361
+ // https://mempool.space/api/block/<block_hash>/header
362
+ block_header : matches. opt_str ( "block_header" ) ,
363
+ // BLOCK_HEIGHT
364
+ // https://mempool.space/api/block-height/615615
365
+ block_height : matches. opt_str ( "block_height" ) ,
366
+
367
+ // V1 MINING BLOCKS
368
+ // https://mempool.space/api/v1/mining/blocks/timestamp/<UTC_SECS>"
369
+ block_timestamp : matches. opt_str ( "block_timestamp" ) ,
370
+
371
+ // BLOCK
372
+ // https://mempool.space/api/block/<block_hash>/raw
373
+ block_raw : matches. opt_str ( "block_raw" ) ,
374
+ // https://mempool.space/api/block/<block_hash>/status
375
+ block_status : matches. opt_str ( "block_status" ) ,
376
+
377
+ // BLOCKS
378
+ // BLOCKS TIP HEIGHT
379
+ // https://mempool.space/api/blocks/tip/height
380
+ blocks_tip_height : matches. opt_str ( "blocks_tip_height" ) ,
381
+ // BLOCKS TIP HASH
382
+ // https://mempool.space/api/blocks/tip/hash
383
+ blocks_tip_hash : matches. opt_str ( "blocks_tip_hash" ) ,
384
+
385
+ // BLOCK
386
+ // BLOCK BLOCK_HASH TXID INDEX
387
+ // https://mempool.space/api/block/<block_hash>/<txid>/<index>
388
+ block_txid : matches. opt_str ( "block_txid" ) ,
389
+ // BLOCK BLOCK_HASH TXIDS
390
+ // https://mempool.space/api/block/<block_hash>/<txids>
391
+ block_txids : matches. opt_str ( "block_txids" ) ,
392
+ // BLOCK BLOCK_HASH TXS
393
+ // https://mempool.space/api/block/<block_hash>/<txs>
394
+ block_txs : matches. opt_str ( "block_txs" ) ,
395
+
396
+ // V1 BLOCKS
397
+ // https://mempool.space/api/v1/blocks/<BLOCK_HEIGHT>"
398
+ blocks : matches. opt_str ( "blocks" ) ,
399
+ // V1 BLOCKS_BULK
400
+ // https://mempool.space/api/v1/blocks-bulk/<BLOCK_HEIGHT_START>/<BLOCK_HEIGHT_STOP>"
401
+ blocks_bulk : matches. opt_str ( "blocks_bulk" ) ,
306
402
307
403
server : matches. opt_str ( "s" ) ,
308
404
auth : matches. opt_str ( "a" ) ,
0 commit comments