Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "ord wallet cardinals" command to list the cardinal outputs. #1904

Merged
merged 6 commits into from
Mar 27, 2023

Conversation

gmart7t2
Copy link
Contributor

@gmart7t2 gmart7t2 commented Mar 9, 2023

There's no easy way to find a list of cardinal outputs. You have to list all the outputs and remove the inscriptions.

Hence: ord wallet cardinals.

cryptonaut420 added a commit to cryptonaut420/ord that referenced this pull request Mar 12, 2023
@BTCAlchemist
Copy link

This would really be helpful. I'm overwhelmed with the list of outputs and have difficulty discerning how many cardinal UTXOs and the balances that remain. @raphjaph Would you be the right person to tag for review?

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just gonna change these things real quick myself

@@ -48,6 +49,8 @@ pub(crate) enum Wallet {
Transactions(transactions::Transactions),
#[clap(about = "List wallet outputs")]
Outputs,
#[clap(about = "List wallet cardinals")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[clap(about = "List wallet cardinals")]
#[clap(about = "List unspent cardinal outputs in wallet")]

@@ -48,6 +49,8 @@ pub(crate) enum Wallet {
Transactions(transactions::Transactions),
#[clap(about = "List wallet outputs")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[clap(about = "List wallet outputs")]
#[clap(about = "List all unspent outputs in wallet")]

.collect::<BTreeSet<OutPoint>>();

let mut outputs = Vec::new();
for (output, amount) in index.get_unspent_outputs(Wallet::load(&options)?)? {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do a filter map

@raphjaph raphjaph enabled auto-merge (squash) March 27, 2023 20:02
@raphjaph raphjaph merged commit ab2f178 into ordinals:master Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants