iridium_walletd createAddress method
The createAddress() method creates an additional address in your wallet or imports a wallet from a given spendSecretKey.
Input:
Argument | Mandatory | Description | Format |
---|---|---|---|
spendPublicKey | No | Public spend key. If spendPublicKey is specified, RPC Wallet creates view only address | string |
spendSecretKey | No | Private spend key. If spendSecretKey is specified, RPC Wallet creates spend address | string |
reset | No | defautl is true: when importing a spend key (view only or full), a reset is made to sync the imported key 1) | boolean |
Note: If none of the above mentioned parameters were specified, RPC Wallet creates a new spend address with new generated spend keys.
Note: spendPublicKey and spendSecretKey parameters can't be both present in a single request.
Output:
Argument | Description | Format | Example |
---|---|---|---|
address | Created address | string | ir2qzAzr1KfCk2sTsLdEq8BRSRyHnahcKJrPRZg8rHtkRCNBHJiiyNz8vWjwoM6F4PSbPQuNusEgGXc2A4NoDrQr2dH4rbmGs |
Create a new address from the same viewSecretKey
This mean you already created a wallet file and wants another spend address 2).
Input example:
{ "params":{}, "jsonrpc":"2.0", "id":"test", "method":"createAddress" }
$ curl -s -X POST -d '{"params":{},"jsonrpc":"2.0","id":"test","method":"createAddress"}' localhost:14101/json_rpc | jq -C
Output example:
{ "id": "test", "jsonrpc": "2.0", "result": { "address": "ir2Zyyk347tKN1KMPLWSJFUjaj6cz4m5TUGBm383zvArdE2QUEXh5r8jXtrbwzwpJ6Kp2ebwHErWD9VxBVnmXBk41oD6CFt9m" } }
Import an address from a viewSecretKey
Input example:
{ "params":{ "spendSecretKey":"82ba95954959d01497d5aa2269408830e39401f55b9c179feaffd50564caa00e" }, "jsonrpc":"2.0", "id":"test", "method":"createAddress" }
$ curl -s -X POST -d '{"params":{"spendSecretKey":"82ba95954959d01497d5aa2269408830e39401f55b9c179feaffd50564caa00e"},"jsonrpc":"2.0","id":"test","method":"createAddress"}' localhost:14101/json_rpc | jq -C
Output example:
{ 'jsonrpc':'2.0', 'id':'test', 'result':{ 'address':'ir2qzAzr1KfCk2sTsLdEq8BRSRyHnahcKJrPRZg8rHtkRCNBHJiiyNz8vWjwoM6F4PSbPQuNusEgGXc2A4NoDrQr2dH4rbmGs' } }