Wallet class¶
- class Wallet()¶
An object of this class is not created using the
new
operator, but is returned by the static factory methodnew_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 + "'");
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.
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);
- generate_next_hd_address(groupID)¶
- Arguments
groupID (String) – The ID of the HD Group, that is used to get the next HD Address.
- Returns
An
object
ofAddr()
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));
- delete_address(hexAddress)¶
- Arguments
hexAddress (String) – The Public-address representation of Address to delete from the Wallet.
- find_address(hexAddress)¶
- Arguments
hexAddress (String) – The Public-address representation of Address to find in the Wallet.
- Returns
An
object
ofAddr()
class.