On this page

latest contributor to this doc

Last Edit:

@gcharang

Account Balance Tasks

If you have activated a coin with the task::enable_utxo::init or task::enable_qtum::init and used the "priv_key_policy": "Trezor" parameter, your funds may be spread across a range of addresses under a specified account index. The methods below will return the combined balance of your account, detailing the balance for each active account address.

API-v2task::account_balance::init

Use the task::account_balance::init method to initialise an account balance request.

ParameterTypeDescription
coinstringTicker of activated coin you want to see addresses and balance for
account_indexstringFor GUIs, this will be zero. In CLI you can use other values if you know what you are doing

ParameterTypeDescription
task_idintegerAn identifying number which is used to query task status.

POST
task::account_balance::init
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::account_balance::init",
  "params": {
    "coin": "COIN_NAME",
    "account_index": 0
  }
}
API-v2task::account_balance::status

Use the task::account_balance::status method to view the status / response of an account balance request.

ParameterTypeDescription
task_idintegerThe identifying number returned when initiating the withdrawal process.
forget_if_finishedbooleanIf false, will return final response for completed tasks. Optional, defaults to true.

ParameterTypeDescription
resultobjectObject containing status and details of the task
.statusstringStatus of the task (Ok or Error)
..account_indexintegerFor GUIs, this will return 0. In CLI it will return the same as the user request input
..derivation_pathstringThe The BIP44 derivation path of the wallet.
..total_balanceobjectContains the spendable and unspendable balance for the wallet
...spendablestring(numeric)Spendable balance for this wallet
...unspendablestring(numeric)Unspendable balance for this wallet (e.g. from unconfirmed incoming transactions)
..addresseslistContains information about current active addresses in the wallet
...addressstringSpendable balance for this address
...derivation_pathstringThe The BIP44 derivation path of an address.
...chainstring(numeric)Internal or External. External is used for addresses that are meant to be visible outside of the wallet (e.g. for receiving payments). Internal is used for addresses which are not meant to be visible outside of the wallet and is used for return transaction change.
...balanceobjectContains the spendable and unspendable balance for this address
....spendablestring(numeric)Spendable balance for this address
....unspendablestring(numeric)Unspendable balance for this address (e.g. from unconfirmed incoming transactions)

POST
task::account_balance::status
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::account_balance::status",
  "params": {
    "task_id": 3,
    "forget_if_finished": false
  }
}
API-v2task::account_balance::cancel

Use the task::account_balance::cancel method to cancel an account balance request.

ParameterTypeDescription
task_idintegerThe identifying number returned when initiating the withdrawal process.

ParameterTypeDescription
resultstringReturns with value success when successful, otherwise returns the error values below
errorstringDescription of the error
error_pathstringUsed for debugging. A reference to the function in code base which returned the error
error_tracestringUsed for debugging. A trace of lines of code which led to the returned error
error_typestringAn enumerated error identifier to indicate the category of error
error_datastringAdditonal context for the error type

POST
task::account_balance::cancel
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::account_balance::cancel",
  "params": {
    "task_id": 3,
    "forget_if_finished": false
  }
}