Full Service API
  • Welcome!
  • Overview
  • API Endpoints
    • v2
      • Account
        • Account
          • Create Account
          • Import Account
          • Import Account Legacy
          • Get Accounts
          • Get Account Status
          • Get Balance
          • Update Account Name
          • Set Require Spend Subaddress
          • Remove Account
        • Account Secrets
          • Export Account Secrets
        • Address
          • Assign Address For Account
          • Get Address For Account
          • Get Addresses
          • Get Address Status
          • Verify Address
        • View Only Account
          • Import View Only Account
          • Create View Only Account Import Request
          • Create View Only Account Sync Request
          • Sync View Only Account
      • Transaction
        • Transaction
          • Build Transaction
          • Submit Transaction
          • Build And Submit Transaction
          • Build Burn Transaction
          • Build Unsigned Transaction
          • Build Unsigned Burn Transaction
        • Transaction Output TXO
          • Memo
            • Validate Sender Memo
          • Get TXO
          • Get TXOs
          • Get MobileCoin Protocol TXO
          • Get TXO Membership Proofs
          • Sample Mixins
          • Get TXO Block Index
        • Confirmation
          • Get Confirmations
          • Validate Confirmations
        • Receiver Receipt
          • Check Receiver Receipt Status
          • Create Receiver Receipts
        • Transaction Log
          • Get Transaction Log
          • Get Transaction Logs
          • Get MobileCoin Protocol Transaction
        • Payment Request
          • Create Payment Request
          • Check B58 Type
      • Block
        • Get Block
        • Get Blocks
        • Get Recent Blocks
        • Search Ledger
      • Network Status
        • Get Network Status
      • Wallet Status
        • Get Wallet Status
      • Version
        • Get Version
    • v1 (deprecated)
      • Account
        • Account
          • Create Account
          • Import Account
          • Import Account Legacy
          • Get Account
          • Get All Accounts
          • Get Account Status
          • Update Account Name
          • Remove Account
        • Account Secrets
          • Export Account Secrets
        • Address
          • Assign Address For Account
          • Get Addresses For Account
          • Verify Address
        • Balance
          • Get Balance For Account
          • Get Balance For Address
      • Transaction
        • Transaction
          • Build Transaction
          • Submit Transaction
          • Build And Submit Transaction
          • Build Split Txo Transaction
        • Transaction Output TXO
          • Get TXO
          • Get MobileCoin Protocol TXO
          • Get TXOs For Account
          • Get TXOs For View Only Account
          • Get All TXOs For Address
        • Confirmation
          • Get Confirmations
          • Validate Confirmations
        • Receiver Receipt
          • Check Receiver Receipt Status
          • Create Receiver Receipts
        • Transaction Log
          • Get Transaction Object
          • Get Transaction Log
          • Get Transaction Logs For Account
          • Get All Transaction Logs For Block
          • Get All Transaction Logs Ordered By Block
          • Get MobileCoin Protocol Transaction
        • Payment Request
          • Create Payment Request
          • Check B58 Type
      • Gift Code
        • Build Gift Code
        • Submit Gift Code
        • Get Gift Code
        • Get All Gift Codes
        • Check Gift Code Status
        • Claim Gift Code
        • Remove Gift Code
      • Block
        • Get Block
      • Network Status
        • Get Network Status
      • Wallet Status
        • Get Wallet Status
      • Version
        • Get Version
    • Signer Service
      • Create Account
      • Get Account
      • Sign Transaction
      • Sync Txos
  • Usage
    • Getting Started
      • Running Full Service
      • Create an Account
      • Receiving MobileCoin
      • Sending MobileCoin
      • Next Steps
    • Full Service Network Diagram
    • Supported Token Metadata
    • Database Usage
    • API Key
    • View Only Account
      • Signer
      • Signer Service
    • No Wallet Mode
    • Validator Service
      • Running
      • Running With TLS
    • Mirror Service
      • Running
      • Running With TLS
      • Running With Encryption
    • Logging
      • Text Logs (syslog style)
      • Crash Reports
    • T3
    • Sender Memos
  • FAQ
    • Resolving Disputes
    • How do I check if Full-Service is operational?
    • Where are logs stored?
    • How do I speed up account import?
    • What is the precision of MOB?
  • Glossary
    • Account
    • Block
    • Blockchain
    • Consensus Protocol
    • Fog
    • Full Service
    • Key Image
    • Ledger
    • MOB
    • Public Address
    • Secure Enclave
    • Subaddress
    • Transaction
    • Transaction Proposal
    • Validator Node
    • Validator Service
Powered by GitBook
On this page
  • Create a New Account
  • Import an Existing Account

Was this helpful?

  1. Usage
  2. Getting Started

Create an Account

PreviousRunning Full ServiceNextReceiving MobileCoin

Last updated 2 years ago

Was this helpful?

Create a New Account

Call 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
from 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
    }' \
    | jq

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

 const response = await fetch('http://localhost:9090/wallet/v2', {
   method: 'POST',
   body: `{
     "method": "export_account_secrets",
     "params": {
         "account_id": "b504409093f....2d87a35d02c",
     },
     "jsonrpc": "2.0",
     "id": 1
 }`,
   headers: {
     'Content-Type': 'application/json'
   }
 });
 const myJson = await response.json();
 account_secrets = myJson.result.account_secrets;

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

 const response = await fetch('http://localhost:9090/wallet/v2', {
   method: 'POST',
   body: `{
     "method": "import_account",
     "params": {
        "mnemonic": "sheriff odor square mistake huge skate mouse shoot purity weapon proof stuff correct concert blanket neck own shift clay mistake air viable stick group",
        "key_derivation_version": "2",
        "first_block_index": "1200000"
     },
     "jsonrpc": "2.0",
     "id": 1
   }`,
   headers: {
     'Content-Type': 'application/json'
   }
 });
 const myJson = await response.json();
 account = myJson.result.account;

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.

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

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

If you have an account that was created before the use of mnemonics, please use the api call.

create_account
export_account_secrets
import_account
Import From Legacy Root Entropy