add_key
add_key
调用向密钥链添加一个私钥。
请求参数
- mnemonic:用来生成私钥的助记词
- type:操作类型
响应结果
add_key
调用返回一个JSON对象,主要包含如下字段:
- fingerprint:指纹
- success:是否成功
示例代码
请求:
curl --insecure \
--cert ~/.chia/mainnet/config/ssl/wallet/private_wallet.crt \
--key ~/.chia/mainnet/config/ssl/wallet/private_wallet.key \
-d '{"mnemonic": [
"consider",
"toe",
"board",
"output",
"coral",
"demise",
"latin",
"avocado",
"sight",
"fluid",
"bracket",
"fortune",
"assault",
"cinnamon",
"chronic",
"demand",
"fiscal",
"sea",
"target",
"lake",
"table",
"found",
"raise",
"exhibit"
], "type": "new_wallet"}' \
-H "Content-Type: application/json" \
-X POST \
https://localhost:9256/add_key
响应:
{
"fingerprint": 3886196528,
"success": true
}
```