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.accountfrom mobilecoin.client import ClientSync
client = ClientSync()
account = client.create_account()
print(account)curl -s localhost:9090/wallet/v2 \
-X POST \
-H 'Content-type: application/json' \
-d '{
"method": "create_account",
"params": {},
"jsonrpc": "2.0",
"id": 1
}' \
| jqThis 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
An account's secret mnemonic is extremely sensitive and anyone with this information will be able to see and spend from your account! Please use best practices for securing and storing this information as without it you will lose all access to your account and funds.
Import an Existing Account
If you already have an account, you can access it with the import_account method.
Last updated
Was this helpful?