query_key - 查询密钥
query_key
返回消费或查看私钥。无别名。
输入参数
- key_type:要查询的密钥类型,string, "mnemonic" - 助记词种子,"view_key" - 查看密钥
输出结果
- key:密钥采用16进制编码,助记词为单词字符串,string
示例代码
查询密钥:
$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json'
响应结果:
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501"
}
}
查询助记词:
$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json'
响应结果:
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow"
}
}