The createAddress() method creates an additional address in your wallet or imports a wallet from a given spendSecretKey.

back to methods summary

Input:

ArgumentMandatoryDescriptionFormat
spendPublicKey No Public spend key. If spendPublicKey is specified, RPC Wallet creates view only addressstring
spendSecretKey No Private spend key. If spendSecretKey is specified, RPC Wallet creates spend addressstring
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:

ArgumentDescriptionFormatExample
addressCreated addressstringir2qzAzr1KfCk2sTsLdEq8BRSRyHnahcKJrPRZg8rHtkRCNBHJiiyNz8vWjwoM6F4PSbPQuNusEgGXc2A4NoDrQr2dH4rbmGs

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"
  }
}


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'
  }
}

back to methods summary


1)
Actually, reset is currently alway on but will be used to resync completly or not when specifiying a height or a timestamp is available
2)
Balance is not shared beetwen differents spend keys