Skip to content

Commit 7b243d1

Browse files
committed
feat: fetch block receipts
1 parent c95c49c commit 7b243d1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/subcommands/block.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ pub struct Block {
1111
provider: ProviderArgs,
1212
#[clap(long, help = "Fetch full transactions instead of hashes only")]
1313
full: bool,
14+
#[clap(long, help = "Fetch receipts alongside transactions")]
15+
receipts: bool,
1416
#[clap(
1517
default_value = "latest",
1618
help = "Block number, hash, or tag (latest/pending)"
@@ -28,7 +30,9 @@ impl Block {
2830

2931
let block_id = parse_block_id(&self.block_id)?;
3032

31-
let block_json = if self.full {
33+
let block_json = if self.receipts {
34+
serde_json::to_value(provider.get_block_with_receipts(block_id).await?)?
35+
} else if self.full {
3236
serde_json::to_value(provider.get_block_with_txs(block_id).await?)?
3337
} else {
3438
serde_json::to_value(provider.get_block_with_tx_hashes(block_id).await?)?

0 commit comments

Comments
 (0)