Account.create

Creates an Account instance.

Creates a KeyPair in a password-protected format and keeps it in the Account instance.

Parameters

Name Type Description
baseUrl string Server API Base URL
password string The password of the account to be created
callback function callback

Callback

Name Type Description
err error Error
account Account Generated Account instance

Usage

  • Create an Account and save it to LocalStorage

    Z.com Cloud BlockChain
    var _baseUrl = 'https://beta.blockchain.z.com';
    
    ConoHa BlockChain
    var _baseUrl = 'https://beta.blockchain.conoha.jp';
    
    Account generation and local storage
    Account.create(
        _baseUrl,
        '__PASSWORD__',
        function(err, account) {
            if (err) console.error(err);
            else localStorage.setItem('keystore', account.serialize());
        }
    );
    

`

results matching ""

    No results matching ""