z_getbalanceforviewingkey - Zcash 5.3.0 RPC

z_getbalanceforviewingkey "fvk" ( minconf )

Returns the balance viewable by a full viewing key known to the node's wallet
for each value pool. Sprout viewing keys may be used only if the wallet controls
the corresponding spending key.
Arguments:
1. "fvk"        (string) The selected full viewing key.
2. minconf      (numeric, optional, default=1) Only include transactions confirmed at least this many times.

Result:
{
  "pools": {
    "transparent": {
        "valueZat": amount   (numeric) The amount viewable by this FVK held in the transparent value pool
    "},
    "sprout": {
        "valueZat": amount   (numeric) The amount viewable by this FVK held in the Sprout value pool
    "},
    "sapling": {
        "valueZat": amount   (numeric) The amount viewable by this FVK held in the Sapling value pool
    "},
    "orchard": {
        "valueZat": amount   (numeric) The amount viewable by this FVK held in the Orchard value pool
    "}
  "},
  "minimum_confirmations": n (numeric) The given minconf argument
}
Result amounts are in units of zatoshis.
Pools for which the balance is zero are not shown.

Examples:

The per-pool amount viewable by key "myfvk" with at least 1 block confirmed
> zcash-cli z_getbalanceforviewingkey "myfvk"

The per-pool amount viewable by key "myfvk" with at least 5 blocks confirmed
> zcash-cli z_getbalanceforviewingkey "myfvk" 5

As a JSON RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getbalanceforviewingkey", "params": ["myfvk", 5] }' -H 'content-type: text/plain;' http://127.0.0.1:8232/


Maintained by @_garethtdavies; modified by: mdr0id;license of the docs is MIT (see zcash repo), license of the scripts and webpage is also MIT (github repo)

Note it uses a mainnet zcash node