Wallet
newWallet
Adds a new key to the Wallet.
Params
- passphrase : String - Wallet Password
Result
- Returns a JSON Object with Wallet Address
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"newWallet","params":{"passphrase":"YourPassword"},"id":123456}' http://localhost:8121
Response
{"result":{"wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E"},"id":"123456","jsonrpc":"2.0"}
activeWallet
Enable deactivation wallet.
Params
- wallet : String - Wallet Address
- private : HEXASTRING - Sender Wallet Encoded PrivateKey
Result
- Returns a JSON Object with Wallet Address
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"activeWallet","params":{"wallet":"YourWallet","private":"YourPrivateKey"},"id":123456}' http://localhost:8121
Response
{"result":{"wallet":"YourWallet"},"id":"123456","jsonrpc":"2.0"}
getWalletInfo
Get infomation of specified wallet.
Params
- wallet : String - Wallet Address
Result
- Returns a JSON Object with a "Account Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getWalletInfo","params":{"wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E"},"id":123456}' http://localhost:8121
Response
{"result":{"account":11,"updated_active":32,"updated_passive":32,"n_operation":0,"balance":"0","wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","volume_lock":"0","volume_timelock":"0","state":"normal wallet"},"id":"100","jsonrpc":"2.0"}
getKeyStoreInfo
Returns a JSON array containing the wallet information of node keystore.
Params
- max : Integer - (optional, default = 100). If provided, will return max keystores. If not provided, max=100 by default
Result
- Returns each JSON Object with a "Account Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getKeyStoreInfo","params":{"max":100},"id":123456}' http://localhost:8121
Response
{"result":[{"account":11,"updated_active":32,"updated_passive":32,"n_operation":0,"balance":"0","wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","volume_lock":"0","volume_timelock":"0","state":"normal wallet"}],"id":"100","jsonrpc":"2.0"}
getKeyStoreCount
Returns node keystore count.
Params
- none
Result
- Integer with Keystore count of node
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getKeyStoreCount","params":{},"id":123456}' http://localhost:8121
Response
{"result":11,"id":"123456","jsonrpc":"2.0"}
lockWallet
Locks the Wallet
Params
- wallet : String - Wallet Address
Result
- Returns a Boolean indicating if Wallet is locked. If false that means that cannot be locked
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"lockWallet","params":{"wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E"},"id":123456}' http://localhost:8121
Response
{"result":true,"id":"123456","jsonrpc":"2.0"}
unlockWallet
Unlocks the Wallet
Params
- wallet : String - Wallet Address
- passphrase : String - Wallet Password
Result
- Returns a Boolean indicating if Wallet is unlocked after using password
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"unlockWallet","params":{"wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","passphrase":"YourPassword"},"id":123456}' http://localhost:8121
Response
{"result":true,"id":"123456","jsonrpc":"2.0"}
dumpPrivateKey
Get private key of specified wallet.
Params
- wallet : String - Wallet Address
- passphrase : String - Wallet Password
Result
- Returns a JSON Object with a "Private Key Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"dumpPrivateKey","params":{"wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","passphrase":"YourPassword"},"id":123456}' http://localhost:8121
Response
{"result":{"status":true,"priv":"CA022000....."},"id":"123456","jsonrpc":"2.0"}
inputPrivateKey
Imports the given unencrypted private key into the key store, encrypting it with the passphrase.
Params
- private : String - Private key
- passphrase : String - Wallet Password
Result
- status : Boolean - Wallet Status
- wallet : String - Wallet Address
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"inputPrivateKey","params":{"private":"CA02200....","passphrase":"YourPassword"},"id":123456}' http://localhost:8121
Response
{"result":{"status":true,"wallet":"HN6C7B799FC795AFA8D9FE612B26220340AAA6D1A1B5C381"},"id":"123456","jsonrpc":"2.0"}
signMessage
Signs a message using a private key
Params
- wallet : String - Wallet Address
- passphrase : String - Wallet Password
- message : String - Origin Message
Result
- Returns a JSON Object with a "SignMessage Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"signMessage","params":{"wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","passphrase":"YourPassword","message":"YourMessage"}},"id":123456}' http://localhost:8121
Response
{"result":{"wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","msg":"YourMessage","enc":"CA0220000CAA6158843D4F535D73B95311900CF4515D0FD62924FA5EF87DD82E9A87A1AA2000B20C2D91FB42BB7EE28F27E60ED4980FD47E2EECAA635924432EE76C8C6C95CC","sig":"2000A1FDAB16C533D3EAB30EAD8AC9CCC660B96A499AE20946563F30F108C16F3903200091083CA59D29EC165EE22CA1E5EA5980A2B65AB155B3A15ABF0ED3CEE23B19EF","version":"1"},"id":"123456","jsonrpc":"2.0"}
verifyMessage
Verify if a digest message is signed by a private key.
Params
Signed return JSON
- data : JsonString - Signed return JSON
- wallet : String - Wallet Address
- msg : String - Origin Message
- enc : HEXASTRING - Encrypt Public Key
- sig : HEXASTRING - Signature
- version : Integer - Wallet Version
Result
- Returns a Boolean indicating if successfully signed with the privatekey.
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"verifyMessage","params":{"data":{"wallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","msg":"YourMessage","enc":"CA0220000CAA6158843D4F535D73B95311900CF4515D0FD62924FA5EF87DD82E9A87A1AA2000B20C2D91FB42BB7EE28F27E60ED4980FD47E2EECAA635924432EE76C8C6C95CC","sig":"2000A1FDAB16C533D3EAB30EAD8AC9CCC660B96A499AE20946563F30F108C16F3903200091083CA59D29EC165EE22CA1E5EA5980A2B65AB155B3A15ABF0ED3CEE23B19EF","version":"1"}},"id":123456}' http://localhost:8121
Response
{"result":true,"id":"100","jsonrpc":"2.0"}
walletRefresh
Update the keystore in the keystore directory.
Params
- none
Result
- Returns a Boolean.
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"walletRefresh","id":123456}' http://localhost:8121
Response
{"result":true,"id":"123456","jsonrpc":"2.0"}