0xPolygonMiden / miden-client

Client library that facilitates interaction with the Miden rollup
MIT License
32 stars 28 forks source link

Refactor `note list` command #332

Closed igamigo closed 4 months ago

igamigo commented 4 months ago

I would still probably go with two separate lists - maybe something that looks like so:

image

Basically, two independent lists side-by-side.

This is probably a relatively big change - so, maybe makes sense to break it out into a stand-alone issue.

Originally posted by @bobbinth in https://github.com/0xPolygonMiden/miden-client/issues/314#issuecomment-2102187726

mFragaBA commented 4 months ago

On a second note, I'm wondering if we should expose the difference between input and output notes to the CLI user (I feel like changes so far have been done in order to treat them uniformfly).

The upside of doing so is that it would simplify the CLI code quite a bit. The downside would be exposing too much info to the CLI user

Also, on a side note, I'm guessing the image works in an illustrative way and there should be more details shown in miden notes --list. Or should we restrict it to showing only <Note ID, Note Status> instead and if users wants more info they can just use --show instead?

bobbinth commented 4 months ago

Also, on a side note, I'm guessing the image works in an illustrative way and there should be more details shown in miden notes --list. Or should we restrict it to showing only <Note ID, Note Status> instead and if users wants more info they can just use --show instead?

I was thinking for note --list we'd show minimum amount of info. So, just <note id, status> could probably work, but if we want to add some other useful tidbit that may be OK too (e.g., some additional info about the status). And then if the user wanted to see note details, they'd use note --show <note_id>.

I'm actually thinking we could make similar simplifications in other places too. For example, account --list could also show just account ID (maybe account nickname, if we add it in the future), whether the account is a default account or not, and maybe some other small tidbit. And similarly, account --show <account_id> would be used to view full account details.

tomyrd commented 4 months ago

If we are separating input and output notes on the CLI. How should we treat the notes that count as both? Show them on both lists?

Also, should we add an option to only show input/output notes? Like miden notes -l commited --output

bobbinth commented 4 months ago

If we are separating input and output notes on the CLI. How should we treat the notes that count as both? Show them on both lists?

For now, we can probably show them in both lists. In the future, we may be able to come up with a more intuitive approach.

Also, should we add an option to only show input/output notes? Like miden notes -l commited --output

I would probably not introduce this option for now. Once the basic command is working, we can revisit this as a follow up.