Class: MoneroWalletKeys

MoneroWalletKeys

Implements a MoneroWallet which only manages keys using WebAssembly.

Methods

(async, static) createWallet(config) → {MoneroWalletKeys}

Create a wallet using WebAssembly bindings to monero-project.

Example:

let wallet = await MoneroWalletKeys.createWallet({
   password: "abc123",
   networkType: MoneroNetworkType.STAGENET,
   mnemonic: "coexist igloo pamphlet lagoon..."
});
Parameters:
Name Type Description
config MoneroWalletConfig | object MoneroWalletConfig or equivalent config object
Properties
Name Type Description
networkType string | number network type of the wallet to create (one of "mainnet", "testnet", "stagenet" or MoneroNetworkType.MAINNET|TESTNET|STAGENET)
mnemonic string mnemonic of the wallet to create (optional, random wallet created if neither mnemonic nor keys given)
seedOffset string the offset used to derive a new seed from the given mnemonic to recover a secret wallet from the mnemonic phrase
primaryAddress string primary address of the wallet to create (only provide if restoring from keys)
privateViewKey string private view key of the wallet to create (optional)
privateSpendKey string private spend key of the wallet to create (optional)
language string language of the wallet's mnemonic phrase (defaults to "English" or auto-detected)
Source:
Returns:
the created wallet
Type
MoneroWalletKeys

(async, static) getMnemonicLanguages()

Source:

(async) addListener(listener)

Register a listener to receive wallet notifications.
Parameters:
Name Type Description
listener MoneroWalletListener listener to receive wallet notifications
Implements:
Source:

(async) close(save)

Optionally save then close the wallet.
Parameters:
Name Type Description
save boolean specifies if the wallet should be saved before being closed (default false)
Implements:
Source:

getAccounts(includeSubaddresses, tag) → {Array.<MoneroAccount>}

Get accounts with a given tag.
Parameters:
Name Type Description
includeSubaddresses boolean include subaddresses if true
tag string tag for filtering accounts, all accounts if undefined
Implements:
Source:
Returns:
all accounts with the given tag
Type
Array.<MoneroAccount>

(async) getAddress(accountIdx, subaddressIdx) → {string}

Get the address of a specific subaddress.
Parameters:
Name Type Description
accountIdx int the account index of the address's subaddress
subaddressIdx int the subaddress index within the account
Implements:
Source:
Returns:
the receive address of the specified subaddress
Type
string

(async) getAddressIndex(address) → {MoneroSubaddress}

Get the account and subaddress index of the given address.
Parameters:
Name Type Description
address string address to get the account and subaddress index from
Implements:
Source:
Returns:
the account and subaddress indices
Type
MoneroSubaddress

(async) getMnemonic() → {string}

Get the wallet's mnemonic phrase derived from the seed.
Implements:
Source:
Returns:
the wallet's mnemonic phrase
Type
string

(async) getMnemonicLanguage() → {string}

Get the language of the wallet's mnemonic phrase.
Implements:
Source:
Returns:
the language of the wallet's mnemonic phrase
Type
string

(async) getPrimaryAddress() → {string}

Get the wallet's primary address.
Implements:
Source:
Returns:
the wallet's primary address
Type
string

(async) getPrivateSpendKey() → {string}

Get the wallet's private spend key.
Implements:
Source:
Returns:
the wallet's private spend key
Type
string

(async) getPrivateViewKey() → {string}

Get the wallet's private view key.
Implements:
Source:
Returns:
the wallet's private view key
Type
string

(async) getPublicSpendKey() → {string}

Get the wallet's public spend key.
Implements:
Source:
Returns:
the wallet's public spend key
Type
string

(async) getPublicViewKey() → {string}

Get the wallet's public view key.
Implements:
Source:
Returns:
the wallet's public view key
Type
string

(async) getSubaddress(accountIdx, subaddressIdx) → {MoneroSubaddress}

Get a subaddress.
Parameters:
Name Type Description
accountIdx int index of the subaddress's account
subaddressIdx int index of the subaddress within the account
Implements:
Source:
Returns:
the retrieved subaddress
Type
MoneroSubaddress

(async) getVersion() → {MoneroVersion}

Gets the version of the wallet.
Implements:
Source:
Returns:
the version of the wallet
Type
MoneroVersion

(async) isClosed() → {boolean}

Indicates if this wallet is closed or not.
Implements:
Source:
Returns:
true if the wallet is closed, false otherwise
Type
boolean

(async) isConnectedToDaemon() → {boolean}

Indicates if the wallet is connected to daemon.
Implements:
Source:
Returns:
true if the wallet is connected to a daemon, false otherwise
Type
boolean

(async) isViewOnly() → {bool}

Indicates if the wallet is view-only, meaning it does not have the private spend key and can therefore only observe incoming outputs.
Implements:
Source:
Returns:
true if the wallet is view-only, false otherwise
Type
bool

(async) removeListener(listener)

Unregister a listener to receive wallet notifications.
Parameters:
Name Type Description
listener MoneroWalletListener listener to unregister
Implements:
Source: