get_accounts - 获取全部账户
get_accounts
获取钱包中的全部账户,可以使用tag过滤(可选)。无别名。
输入参数
- tag:用于过滤账户的tag,string,可选
输出结果
- subaddress_accounts:结构如下:
- account_index:账户索引, unsigned int
- balance:账户余额, unsigned int
- base_address:基地址,string
- label:账户标签,string,可选
- tag:用于过滤的tag,string,可选
- unlocked_balance:解锁余额,unsigned int
- total_balance:总余额,unsigned int
- total_unlocked_balance:总解锁余额,unsigned int
示例代码
curl请求:
$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json'
响应结果:
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"subaddress_accounts": [{
"account_index": 0,
"balance": 157663195572433688,
"base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"label": "Primary account",
"tag": "myTag",
"unlocked_balance": 157443303037455077
},{
"account_index": 1,
"balance": 0,
"base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp",
"label": "Secondary account",
"tag": "myTag",
"unlocked_balance": 0
}],
"total_balance": 157663195572433688,
"total_unlocked_balance": 157443303037455077
}
}