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.UnoSemuxWallet.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.semux_wallet)
{
   console.log("New wallet");
   window.semux_wallet = GetRes(Module.UnoSemuxWallet.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 semux_hdGroupId = GetRes(window.semux_wallet.add_hd_group(mnemonic, password));
console.log("New HD group ID = " + semux_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.semux_wallet.generate_next_hd_address(semux_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 Semux-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 Semux-address.