post https://api.infstones.com/neo/mainnet/
Imports the private key to the wallet.
Before you can invoke this method, wallet must be open first.
Parameters
Object Name | Required | Type | Detail |
---|---|---|---|
KEY | ✅ | String | The WIF-format private key. |
"params": ["QZA2VMgxdftok4ejoGFNNqvieEjxw9QWuBy8G6pSzezNyNg66a8k"]
Result
The address corresponding to the key.
Example
Request
curl <your-endpoint> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "importprivkey", "params": ["QZA2VMgxdftok4ejoGFNNqvieEjxw9QWuBy8G6pSzezNyNg66a8k"],"id": 1}'
Return
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"address": "NSk8xEBm3FNAFDueUf21cMugkWidJn5N1n",
"haskey": true,
"label": null,
"watchonly": false
}
}