Wallet class

class Wallet()

An object of this class is not created using the new operator, but is returned by the static factory method new_wallet().

Static methods

new_mnemonic_phrase()
Returns

A string containing generated Mnemonic phrase.

Generates a new mnemonic phrase.
Example:
var mnemonic_phrase = GetRes(Module.CryptoCoreWallet.new_mnemonic_pharase());
console.log("New mnemonic phrase '" + mnemonic_phrase + "'");
new_wallet()
Returns

An object of Wallet() class.

Factory static method to create a new object of Wallet class.
Example:
if (!window.crypto_core_wallet)
{
   console.log("New wallet");
   window.crypto_core_wallet = GetRes(Module.CryptoCoreWallet.new_wallet());
}

Class methods

add_hd_group(mnemonic, password)
Arguments
  • mnemonic (String) – A mnemonic phrase to import from.

  • password (String) – An optional password for mnemonic import.

Returns

sInt64 a new Group ID.

Method for creating a new HD Group in the HD Wallet.
Further, the returned ID is used for operations with HD Address es.
var crypto_core_hdGroupId = GetRes(window.crypto_core_wallet.add_hd_group(mnemonic, password));
console.log("New HD group ID = " + crypto_core_hdGroupId);
delete_hd_group(groupID)
Arguments
Method for deletion the HD Group by given groupID.
generate_next_hd_address(groupID)
Arguments
Returns

An object of Addr() class.

Method for deriving the next HD Address for the HD Group by given groupID parameter.
Example:
var hdAddr = GetRes(window.crypto_core_wallet.generate_next_hd_address(crypto_core_hdGroupId));
generate_random_address()
Returns

An object of Addr() class.

Method for generating a random Address not associated with any HD Group.
delete_address(hexAddress)
Arguments
Method for deletion the Address from the Wallet by given Public-address.
find_address(hexAddress)
Arguments
Returns

An object of Addr() class.

Method for finding and getting the object of Addr() class in the Wallet by given Public-address.