Skip to content

Commit fdffae5

Browse files
committed
src/lib.rs:srs/args.rs:GET /api/address/:address/utxo
address/utxo working
1 parent fb88bf7 commit fdffae5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/args.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub struct Args {
205205
/// `https://mempool.space/address/<ADDRESS>/txs/mempool`
206206
pub address_txs_mempool: Option<String>,
207207
/// `https://mempool.space/api/address/<ADDRESS>/utxo`
208-
pub address_utxos: Option<String>,
208+
pub address_utxo: Option<String>,
209209
/// `https://mempool.space/api/validate-address/<ADDRESS>`
210210
pub validate_address: Option<String>,
211211

@@ -334,7 +334,7 @@ impl Args {
334334
"address_txs_mempool api call",
335335
"ADDRESS_TXS_MEMPOOL",
336336
);
337-
opts.optopt("", "address_utxos", "address_utxos api call", "ADDRESS_UTXOS");
337+
opts.optopt("", "address_utxo", "address_utxos api call", "ADDRESS_UTXO");
338338
opts.optopt("", "validate_address", "validate an address", "VALIDATE_ADDRESS");
339339

340340
// BLOCK/S
@@ -429,6 +429,11 @@ impl Args {
429429
api("address_txs_mempool", &address.unwrap());
430430
std::process::exit(0);
431431
}
432+
if matches.opt_present("address_utxo") {
433+
let address = matches.opt_str("address_utxo");
434+
api("address_utxo", &address.unwrap());
435+
std::process::exit(0);
436+
}
432437
if matches.opt_present("validate_address") {
433438
let validate_address = matches.opt_str("validate_address");
434439
api("validate_address", &validate_address.unwrap());
@@ -550,7 +555,7 @@ impl Args {
550555
address_txs: matches.opt_str("address_txs"),
551556
address_txs_chain: matches.opt_str("address_txs_chain"),
552557
address_txs_mempool: matches.opt_str("address_txs_mempool"),
553-
address_utxos: matches.opt_str("address_utxos"),
558+
address_utxo: matches.opt_str("address_utxo"),
554559
validate_address: matches.opt_str("validate_address"),
555560

556561
// BLOCK/S

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
/// TESTING 2
9898
9999
#[warn(missing_docs, clippy::unwrap_used)]
100-
101100
pub mod api;
102101
pub mod blockheight;
103102
pub mod blocking;

0 commit comments

Comments
 (0)