imports a private key to the wallet and writes the new wallet to disk.
Note: this private key is in a hex string and you may generate it with qx wiftopriv
tool from a WIF key, which should be compatible with BTC network (in contrast to dumpPrivKey and importWIFPrivKey, both are incompatible). You may export this WIF key from any wallet service that follows this rule, such as KAHF
accountName: (string)
name of the imported account. MUST be: “imported”privKey: (hex string)
private key.null
-32000 -4
imported addresses must belong to the imported account
curl --location --request POST 'http://127.0.0.1:8130/api/' -u test:test -H 'Content-Type: application/json' -d '{"id":1, "jsonrpc":"2.0","method":"wallet_importPrivKey","params":["imported", "9999999999999999999999999999999999999999999999999999999999999999"]}'
{"jsonrpc":"2.0","id":1,"result":null}
© Copyright Qitmeer 2021.
This work is licensed under a Creative Commons Attribution 4.0 International License