Create an Account

Create a New Account

Call create_account to create a new account

 const response = await fetch('http://localhost:9090/wallet/v2', {
   method: 'POST',
   body: `{
     "method": "create_account",
     "params": {
         "name": "Joshua Goldbard",
     },
     "jsonrpc": "2.0",
     "id": 1
 }`,
   headers: {
     'Content-Type': 'application/json'
   }
 });
 const myJson = await response.json();
 account = myJson.result.account

This method will return a number of parameters including the accounts id, the main_address to receive assets, and the first_block_index.

To protect yourself from ever losing your the associated funds in the account, run export_account_secrets using the * account_id* from the previous step to show the secret mnemonic that can be used to import the account again

Import an Existing Account

If you already have an account, you can access it with the import_account method.

If you have an account that was created before the use of mnemonics, please use the Import From Legacy Root Entropy api call.

To identify your account, you must provide the method with your secret mnemonic and an account name to be used, however the name parameter is optional

To speed up the import process, you can provide the method with the first block index that you'd like to scan from the ledger. If you don’t include the first block index, it will default to scanning the entire ledger, which will take longer as the ledger size increases.

Last updated

Was this helpful?