On this page

Initialize Get New Address Task

API-v2task::get_new_address::init

A hierarchical-deterministic (HD) wallet generates a new key pair from a master key pair, allowing for multiple addresses to be generated from the same seed so that change from transactions go to a previously unused address, enhancing privacy and security. The hierarchical structure resembles that of a tree, with the master key "determining" the key pairs that follow it in the hierarchy. If you are running KDF in HD mode, and don't already have too many unused addresses, you can use the get_new_address method to generate a new address. The generated address will be shown in the task::account_balance RPCs and at the next coin activation.

ParameterTypeRequiredDefaultDescription
coinstring-The ticker of the coin you want to get a new address for
account_idinteger0Generally this will be 0 unless you have multiple accounts registered on your Trezor
chainstring"External"Internal, or External. External is used for addresses that are intended to be visible outside of the wallet (e.g. for receiving payments). Internal is used for addresses which are not meant to be visible outside of the wallet and is used to return the leftover change from a transaction.
gap_limitinteger20The maximum number of empty addresses in a row. Defaults to the value provided on activation or 20 if no value was provided

ParameterTypeDescription
new_addressobjectA standard NewAddressInfo object.

Some reasons you might not be able to get a new address are:

  • EmptyAddressesLimitReached - Last gap_limit addresses are still unused.
  • AddressLimitReached - Addresses limit reached. Currently, the limit is 2^31

task::get_new_address::init

POST
task::get_new_address::init
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::get_new_address::init",
  "params": {
    "coin": "DOC",
    "account_id": 0,
    "chain": "External",
    "gap_limit": 20
  }
}