Task: Create New Account

If you have enabled a coin with task managed activation and are using HD Mode, your funds may be spread across a range of addresses under a specified account index. The methods below will initialise a wallet account, and scan for existing addresses with a balance.

task::create_new_account::initAPI-v2task::create_new_account::init

Use the task::create_new_account::init method to initialise a HD account.

Arguments

ParameterTypeDescription
coinstringTicker of coin you would like to initialise a HD account for.
account_idstringOptional. If not defined, will increment to the next unused account id in the wallet.
scanstringOptional. If true, will scan the account for funded addresses. Defaults to true.
gap_limitstringOptional. The maximum number of empty addresses in a row. Defaults to the value provided on activation, or 20 if no value was provided.

Response

ParameterTypeDescription
task_idintegerAn identifying number which is used to query task status.

📌 Examples

Command

POST task::create_new_account::init
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::create_new_account::init",
  "params": {
    "coin": "KMD",
    "account_id": 77,
    "scan": true,
    "gap_limit": 20
  }
}
Show Response

Response (ready, successful)

{
  "mmrpc": "2.0",
  "result": {
    "task_id": 6
  },
  "id": null
}

task::create_new_account::statusAPI-v2task::create_new_account::status

Use the task::create_new_account::status method to query the status of a HD account creation task.

Arguments

ParameterTypeDescription
task_idintegerThe identifying number returned when initiating the task.
forget_if_finishedbooleanIf false, will return final response for completed tasks. Optional, defaults to true.

Response

ParameterTypeDescription
statusstringStatus of the task. Ok, InProgress or Error.
detailsstring or objectIf in progress, either Preparing or RequestingAccountBalance. Once complete, a standard WalletAccountInfo object.

📌 Examples

Command

POST task::create_new_account::status
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::create_new_account::status",
  "params": {
    "task_id": 1
  }
}
Show Response

Response (ready, successful)

{
    "mmrpc": "2.0",
    "result": {
        "status": "Ok",
        "details": {
            "account_index": 77,
            "derivation_path": "m/44'/141'/77'",
            "total_balance": {
                "spendable": "7.777",
                "unspendable": "0"
            },
            "addresses": [
                {
                    "address": "RMsnNdVfZbxWwDxJafc6scbaN1xYVoR7Gx",
                    "derivation_path": "m/44'/141'/77'/0/4",
                    "chain": "External",
                    "balance": {
                        "spendable": "0",
                        "unspendable": "0"
                    }
                },
                {
                    "address": "R9roM4acnrrp1BL73MXd9EWdF5biRcSJ5X",
                    "derivation_path": "m/44'/141'/77'/0/5",
                    "chain": "External",
                    "balance": {
                        "spendable": "0",
                        "unspendable": "0"
                    }
                },
                {
                    "address": "RLNu8gszQ8ENUrY3VSyBS2714CNVwn1f7P",
                    "derivation_path": "m/44'/141'/77'/0/7",
                    "chain": "External",
                    "balance": {
                        "spendable": "7.777",
                        "unspendable": "0"
                    }
                }
            ]
        }
    },
    "id": null
}

Response (in progress)

{
  "mmrpc": "2.0",
  "result": {
      "status": "InProgress",
      "details": "Preparing"
  },
  "id": null
}