Skip to content

Commit

Permalink
pcli: add AuctionCmd
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Apr 24, 2024
1 parent 6ace25a commit a36baf8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions crates/bin/pcli/src/command/view/auction.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use anyhow::Result;
use penumbra_keys::FullViewingKey;
use penumbra_view::ViewClient;

#[derive(Debug, clap::Args)]
pub struct AuctionCmd {
#[clap(long)]
/// If set, includes the inactive auctions as well.
pub include_inactive: bool,
}

impl AuctionCmd {
pub fn offline(&self) -> bool {
false
}

pub async fn exec(
&self,
view_client: &mut impl ViewClient,
_fvk: &FullViewingKey,
) -> Result<()> {
let auctions = view_client.auctions().await?;

auctions.iter().for_each(|(id, snr)|{
println!("{id:?} {}",snr.note.amount());
});
todo!()
}
}

0 comments on commit a36baf8

Please sign in to comment.