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

New RPC: z_getbalanceforaddress #5182

Closed
str4d opened this issue May 24, 2021 · 3 comments
Closed

New RPC: z_getbalanceforaddress #5182

str4d opened this issue May 24, 2021 · 3 comments
Assignees
Labels
A-rpc-interface Area: RPC interface A-wallet Area: Wallet S-committed Status: Planned work in a sprint

Comments

@str4d
Copy link
Contributor

str4d commented May 24, 2021

Usage: z_getbalanceforaddress ADDRESS MINCONF

  • Returns a dictionary (with space for extending with metadata later):
    • pools
      • POOL_NAME (for each pool included in the address)
        • valueZat
  • Empty pools are omitted.
  • Also accepts full viewing keys, including UFVKs.
@LarryRuane
Copy link
Collaborator

Would this be a reasonable format (example) for the return string:

{
    "pool": {
        "transparent": {
            "amount": 7000
        },
        "sprout": {
            "amount": 1225
        },
        "sapling": {
            "amount": 31
        },
        "orchard": {
            "amount": 4241
        }
    }
}

We would omit entries for which the amount is zero. This is somewhat "wordy" but does leave room for metadata outside the individual pools, and also leaves room for per-pool data beyond just amount.

Should there be an optional inZat argument after minconf to specify the units (zats or zec), as z_getbalance has (and its default there is false)? Or just always return Zats?

@str4d
Copy link
Contributor Author

str4d commented Jul 21, 2021

What you've outlined almost matches the structure I originally suggested in the top post. If you changed pool to pools and amount to valueZat then it will be identical.

@str4d str4d removed the S-committed Status: Planned work in a sprint label Jul 30, 2021
@str4d str4d added the S-committed Status: Planned work in a sprint label Aug 30, 2021
@r3ld3v r3ld3v added S-committed Status: Planned work in a sprint and removed S-committed Status: Planned work in a sprint labels Oct 13, 2021
@r3ld3v r3ld3v removed this from the Core Sprint 2021-40 milestone Oct 25, 2021
@r3ld3v r3ld3v added this to the Core Sprint 2021-42 milestone Oct 25, 2021
@str4d str4d added S-committed Status: Planned work in a sprint and removed S-committed Status: Planned work in a sprint labels Nov 22, 2021
@r3ld3v r3ld3v added S-committed Status: Planned work in a sprint and removed S-committed Status: Planned work in a sprint labels Dec 7, 2021
@r3ld3v r3ld3v added S-committed Status: Planned work in a sprint and removed S-committed Status: Planned work in a sprint labels Dec 20, 2021
@r3ld3v r3ld3v modified the milestones: Core Sprint 2021-50, 2021-52 Jan 3, 2022
str4d added a commit to str4d/zcash that referenced this issue Jan 26, 2022
@str4d
Copy link
Contributor Author

str4d commented Jan 28, 2022

Closed by #5500, merged into #5419.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc-interface Area: RPC interface A-wallet Area: Wallet S-committed Status: Planned work in a sprint
Projects
None yet
Development

No branches or pull requests

4 participants