account_info - 获取账户信息
account_info
命令用来获取指定账户的信息,例如其活动情况以及XRP余额。
返回的所有数据都相对于指定的账本版本。
API请求格式
WebSocket请求示例
{
"id": 2,
"command": "account_info",
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"strict": true,
"ledger_index": "current",
"queue": true
}
JSON-RPC请求示例
{
"method": "account_info",
"params": [
{
"account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"strict": true,
"ledger_index": "current",
"queue": true
}
]
}
命令行请求示例
#Syntax: account_info account [ledger_index|ledger_hash] [strict]
rippled account_info r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59 true
命令请求参数
- account:用于查询的账户唯一ID,通常使用账户地址,字符串
- strict:是否只能使用账户地址或公钥作为账户ID,布尔值,可选
- ledger_hash:要使用的账本哈希值,字符串,可选
- ledger_index:要使用的账本索引号或账本选择快捷符,数值或字符串,可选
- queue:是否返回此账户的排队交易信息,布尔值,可选
- signer_lists:是否返回此账户相关的签名清单,布尔值,可选
API响应格式
WebSocket响应示例
{
"id": 5,
"status": "success",
"type": "response",
"result": {
"account_data": {
"Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"Balance": "999999999960",
"Flags": 8388608,
"LedgerEntryType": "AccountRoot",
"OwnerCount": 0,
"PreviousTxnID": "4294BEBE5B569A18C0A2702387C9B1E7146DC3A5850C1E87204951C6FDAA4C42",
"PreviousTxnLgrSeq": 3,
"Sequence": 6,
"index": "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F"
},
"ledger_current_index": 4,
"queue_data": {
"auth_change_queued": true,
"highest_sequence": 10,
"lowest_sequence": 6,
"max_spend_drops_total": "500",
"transactions": [
{
"auth_change": false,
"fee": "100",
"fee_level": "2560",
"max_spend_drops": "100",
"seq": 6
},
... (trimmed for length) ...
{
"LastLedgerSequence": 10,
"auth_change": true,
"fee": "100",
"fee_level": "2560",
"max_spend_drops": "100",
"seq": 10
}
],
"txn_count": 5
},
"validated": false
}
}
JSON-RPC响应示例
{
"result": {
"account_data": {
"Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"Balance": "999999999960",
"Flags": 8388608,
"LedgerEntryType": "AccountRoot",
"OwnerCount": 0,
"PreviousTxnID": "4294BEBE5B569A18C0A2702387C9B1E7146DC3A5850C1E87204951C6FDAA4C42",
"PreviousTxnLgrSeq": 3,
"Sequence": 6,
"index": "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F"
},
"ledger_current_index": 4,
"queue_data": {
"auth_change_queued": true,
"highest_sequence": 10,
"lowest_sequence": 6,
"max_spend_drops_total": "500",
"transactions": [
{
"auth_change": false,
"fee": "100",
"fee_level": "2560",
"max_spend_drops": "100",
"seq": 6
},
... (trimmed for length) ...
{
"LastLedgerSequence": 10,
"auth_change": true,
"fee": "100",
"fee_level": "2560",
"max_spend_drops": "100",
"seq": 10
}
],
"txn_count": 5
},
"status": "success",
"validated": false
}
}
命令响应字段
- account_data:账户信息对象
- signer_lists:签名者清单列表,数组
- ledger_current_index:所使用的最新账本序列号,整数
- ledger_index:所使用的账本序列号,整数
- queue_data:账户相关交易的排队数据对象
- validated:查询结果是否来自已验证账本,布尔值
queue_data对象主要包含以下字段:
- txn_count:排队交易数量,整数
- auth_change_queued:队列中是否存在验证方式变更的交易,布尔值
- lowest_sequence:队列中交易的最小序列号
- highest_sequence:队列中交易的最大序列号
- max_spend_drops_total:队列中交易的总开销,单位:drop
- transactions:交易对象数组
transaction对象主要包含如下字段:
- auth_change:交易是否变更了其验证方式,布尔值
- fee:交易手续费,单位:drop,字符串
- fee_level:相对于同类交易的手续费等级,字符串
- max_spend_drops:交易可能发送或销毁的最大数量,单位:drop
- seq:交易序列号,整数