Class: MoneroWalletFull

MoneroWalletFull

Implements a Monero wallet using fully client-side WebAssembly bindings to monero-project's wallet2 in C++.

Extends

Methods

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

Create a wallet using WebAssembly bindings to wallet2.h.

Example:

let wallet = await MoneroWalletFull.createWallet({
   path: "./test_wallets/wallet1", // leave blank for in-memory wallet
   password: "supersecretpassword",
   networkType: MoneroNetworkType.STAGENET,
   mnemonic: "coexist igloo pamphlet lagoon...",
   restoreHeight: 1543218,
   server: new MoneroRpcConnection("http://localhost:38081", "daemon_user", "daemon_password_123"),
});
Parameters:
Name Type Description
config object | MoneroWalletConfig MoneroWalletConfig or equivalent config object
Properties
Name Type Description
path string path of the wallet to create (optional, in-memory wallet if not given)
password string password of the wallet to create
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)
restoreHeight number block height to start scanning from (defaults to 0 unless generating random wallet)
language string language of the wallet's mnemonic phrase (defaults to "English" or auto-detected)
accountLookahead number number of accounts to scan (optional)
subaddressLookahead number number of subaddresses to scan per account (optional)
serverUri string uri of the wallet's daemon (optional)
serverUsername string username to authenticate with the daemon (optional)
serverPassword string password to authenticate with the daemon (optional)
rejectUnauthorized boolean reject self-signed server certificates if true (defaults to true)
server MoneroRpcConnection | object MoneroRpcConnection or equivalent JS object providing daemon configuration (optional)
proxyToWorker boolean proxies wallet operations to a worker in order to not block the main thread (default true)
fs fs Node.js compatible file system to use (defaults to disk or in-memory FS if browser)
Source:
Returns:
the created wallet
Type
MoneroWalletFull

(async, static) getMnemonicLanguages()

Source:

(async, static) openWallet(configOrPath, password, networkType, daemonUriOrConnection, proxyToWorker, fs) → {MoneroWalletFull}

Open an existing wallet using WebAssembly bindings to wallet2.h.

Examples:

let wallet1 = await MoneroWalletFull.openWallet(
   "./wallets/wallet1",
   "supersecretpassword",
   MoneroNetworkType.STAGENET,
   "http://localhost:38081" // daemon uri
);

let wallet2 = await MoneroWalletFull.openWallet({
   path: "./wallets/wallet2",
   password: "supersecretpassword",
   networkType: MoneroNetworkType.STAGENET,
   serverUri: "http://localhost:38081", // daemon configuration
   serverUsername: "superuser",
   serverPassword: "abctesting123"
});

Parameters:
Name Type Description
configOrPath MoneroWalletConfig | object | string MoneroWalletConfig or equivalent config object or a path to a wallet to open
Properties
Name Type Description
path string path of the wallet to open (optional if 'keysData' provided)
password string password of the wallet to open
networkType string | number network type of the wallet to open (one of "mainnet", "testnet", "stagenet" or MoneroNetworkType.MAINNET|TESTNET|STAGENET)
keysData Uint8Array wallet keys data to open (optional if path provided)
cacheData Uint8Array wallet cache data to open (optional)
serverUri string uri of the wallet's daemon (optional)
serverUsername string username to authenticate with the daemon (optional)
serverPassword string password to authenticate with the daemon (optional)
rejectUnauthorized boolean reject self-signed server certificates if true (default true)
server MoneroRpcConnection | object MoneroRpcConnection or equivalent JS object configuring the daemon connection (optional)
proxyToWorker boolean proxies wallet operations to a worker in order to not block the main thread (default true)
fs fs Node.js compatible file system to use (defaults to disk or in-memory FS if browser)
password string password of the wallet to open
networkType string | number network type of the wallet to open
daemonUriOrConnection string | MoneroRpcConnection daemon URI or MoneroRpcConnection
proxyToWorker boolean proxies wallet operations to a worker in order to not block the main thread (default true)
fs fs Node.js compatible file system to use (defaults to disk or in-memory FS if browser)
Source:
Returns:
the opened wallet
Type
MoneroWalletFull

(static) walletExists(path, fs) → {boolean}

Check if a wallet exists at a given path.
Parameters:
Name Type Description
path string path of the wallet on the file system
fs fs Node.js compatible file system to use (optional, defaults to disk if nodejs)
Source:
Returns:
true if a wallet exists at the given path, false otherwise
Type
boolean

(async) addAddressBookEntry(address, description) → {int}

Add an address book entry.
Parameters:
Name Type Description
address string entry address
description string entry description (optional)
Implements:
Source:
Returns:
the index of the added entry
Type
int

(async) addListener(listener)

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

(async) changePassword(oldPassword, newPassword)

Change the wallet password.
Parameters:
Name Type Description
oldPassword string the wallet's old password
newPassword string the wallet's new password
Implements:
Source:

(async) checkReserveProof(address, message, signature) → {MoneroCheckReserve}

Proves a wallet has a disposable reserve using a signature.
Parameters:
Name Type Description
address string public wallet address
message string message included with the signature to further authenticate the proof (optional)
signature string reserve proof signature to check
Implements:
Source:
Returns:
the result of checking the signature proof
Type
MoneroCheckReserve

(async) checkSpendProof(txHash, message, signature) → {boolean}

Prove a spend using a signature. Unlike proving a transaction, it does not require the destination public address.
Parameters:
Name Type Description
txHash string transaction to prove
message string message included with the signature to further authenticate the proof (optional)
signature string transaction signature to confirm
Implements:
Source:
Returns:
true if the signature is good, false otherwise
Type
boolean

(async) checkTxKey(txHash, txKey, address) → {MoneroCheckTx}

Check a transaction in the blockchain with its secret key.
Parameters:
Name Type Description
txHash string transaction to check
txKey string transaction's secret key
address string destination public address of the transaction
Implements:
Source:
Returns:
the result of the check
Type
MoneroCheckTx

(async) checkTxProof(txHash, address, message, signature) → {MoneroCheckTx}

Prove a transaction by checking its signature.
Parameters:
Name Type Description
txHash string transaction to prove
address string destination public address of the transaction
message string message included with the signature to further authenticate the proof (optional)
signature string transaction signature to confirm
Implements:
Source:
Returns:
the result of the check
Type
MoneroCheckTx

(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)
Overrides:
Implements:
Source:

(async) createAccount(label) → {MoneroAccount}

Create a new account with a label for the first subaddress.
Parameters:
Name Type Description
label string label for account's first subaddress (optional)
Implements:
Source:
Returns:
the created account
Type
MoneroAccount

(async) createSubaddress(accountIdx, label) → {MoneroSubaddress}

Create a subaddress within an account.
Parameters:
Name Type Description
accountIdx int index of the account to create the subaddress within
label string the label for the subaddress (optional)
Implements:
Source:
Returns:
the created subaddress
Type
MoneroSubaddress

(async) createTx(config) → {MoneroTxWallet}

Create a transaction to transfer funds from this wallet.
Parameters:
Name Type Description
config MoneroTxConfig | object configures the transaction to create (required)
Properties
Name Type Description
address string single destination address (required unless `destinations` provided)
amount BigInteger | string single destination amount (required unless `destinations` provided)
accountIndex int source account index to transfer funds from (required)
subaddressIndex int source subaddress index to transfer funds from (optional)
subaddressIndices Array.<int> source subaddress indices to transfer funds from (optional)
relay boolean relay the transaction to peers to commit to the blockchain (default false)
priority MoneroTxPriority transaction priority (default MoneroTxPriority.NORMAL)
destinations Array.<MoneroDestination> addresses and amounts in a multi-destination tx (required unless `address` and `amount` provided)
paymentId string transaction payment ID (optional)
unlockHeight int minimum height for the transaction to unlock (default 0)
Implements:
Source:
Returns:
the created transaction
Type
MoneroTxWallet

(async) createTxs(config) → {Array.<MoneroTxWallet>}

Create one or more transactions to transfer funds from this wallet.
Parameters:
Name Type Description
config MoneroTxConfig | object configures the transactions to create (required)
Properties
Name Type Description
address string single destination address (required unless `destinations` provided)
amount BigInteger | string single destination amount (required unless `destinations` provided)
accountIndex int source account index to transfer funds from (required)
subaddressIndex int source subaddress index to transfer funds from (optional)
subaddressIndices Array.<int> source subaddress indices to transfer funds from (optional)
relay boolean relay the transactions to peers to commit to the blockchain (default false)
priority MoneroTxPriority transaction priority (default MoneroTxPriority.NORMAL)
destinations Array.<MoneroDestination> addresses and amounts in a multi-destination tx (required unless `address` and `amount` provided)
paymentId string transaction payment ID (optional)
unlockHeight int minimum height for the transactions to unlock (default 0)
canSplit boolean allow funds to be transferred using multiple transactions (default true)
Implements:
Source:
Returns:
the created transactions
Type
Array.<MoneroTxWallet>

(async) decodeIntegratedAddress(integratedAddress) → {MoneroIntegratedAddress}

Decode an integrated address to get its standard address and payment id.
Parameters:
Name Type Description
integratedAddress string integrated address to decode
Implements:
Source:
Returns:
the decoded integrated address including standard address and payment id
Type
MoneroIntegratedAddress

(async) deleteAddressBookEntry(entryIdx)

Delete an address book entry.
Parameters:
Name Type Description
entryIdx int index of the entry to delete
Implements:
Source:

(async) describeTxSet(txSet) → {MoneroTxSet}

Describe a tx set containing unsigned or multisig tx hex to a new tx set containing structured transactions.
Parameters:
Name Type Description
txSet MoneroTxSet a tx set containing unsigned or multisig tx hex
Implements:
Source:
Returns:
the tx set containing structured transactions
Type
MoneroTxSet

(async) editAddressBookEntry(index, setAddress, address, setDescription, description)

Edit an address book entry.
Parameters:
Name Type Description
index number index of the address book entry to edit
setAddress boolean specifies if the address should be updated
address string updated address
setDescription boolean specifies if the description should be updated
description string updated description
Implements:
Source:

(async) exchangeMultisigKeys(multisigHexes, password) → {MoneroMultisigInitResult}

Exchange multisig hex with participants in a M/N multisig wallet. This process must be repeated with participants exactly N-M times.
Parameters:
Name Type Description
multisigHexes Array.<string> are multisig hex from each participant
password string wallet's password // TODO monero-project: redundant? wallet is created with password
Implements:
Source:
Returns:
the result which has the multisig's address xor this wallet's multisig hex to share with participants iff not done
Type
MoneroMultisigInitResult

(async) exportKeyImages(all) → {Array.<MoneroKeyImage>}

Export signed key images.
Parameters:
Name Type Description
all boolean export all key images if true, else export the key images since the last export
Implements:
Source:
Returns:
the wallet's signed key images
Type
Array.<MoneroKeyImage>

(async) exportMultisigHex() → {string}

Export this wallet's multisig info as hex for other participants.
Implements:
Source:
Returns:
this wallet's multisig info as hex for other participants
Type
string

(async) exportOutputs(all) → {string}

Export outputs in hex format.
Parameters:
Name Type Description
all boolean export all outputs if true, else export the outputs since the last export
Implements:
Source:
Returns:
outputs in hex format
Type
string

(async) freezeOutput(keyImage)

Freeze an output.
Parameters:
Name Type Description
keyImage string key image of the output to freeze
Implements:
Source:

(async) getAccount(accountIdx, includeSubaddresses) → {MoneroAccount}

Get an account.
Parameters:
Name Type Description
accountIdx int index of the account to get
includeSubaddresses boolean include subaddresses if true
Implements:
Source:
Returns:
the retrieved account
Type
MoneroAccount

(async) 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
Overrides:
Implements:
Source:
Returns:
all accounts with the given tag
Type
Array.<MoneroAccount>

(async) getAccountTags() → {Array.<MoneroAccountTag>}

Return all account tags.
Implements:
Source:
Returns:
the wallet's account tags
Type
Array.<MoneroAccountTag>

(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
Overrides:
Implements:
Source:
Returns:
the receive address of the specified subaddress
Type
string

(async) getAddressBookEntries(entryIndices) → {Array.<MoneroAddressBookEntry>}

Get address book entries.
Parameters:
Name Type Description
entryIndices Array.<int> indices of the entries to get
Implements:
Source:
Returns:
the address book entries
Type
Array.<MoneroAddressBookEntry>

(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
Overrides:
Implements:
Source:
Returns:
the account and subaddress indices
Type
MoneroSubaddress

(async) getAttribute(key) → {string}

Get an attribute.
Parameters:
Name Type Description
key string attribute to get the value of
Implements:
Source:
Returns:
the attribute's value
Type
string

(async) getBalance(accountIdx, subaddressIdx) → {BigInteger}

Get the balance of the wallet, account, or subaddress.
Parameters:
Name Type Description
accountIdx int index of the account to get the balance of (default all accounts)
subaddressIdx int index of the subaddress to get the balance of (default all subaddresses)
Implements:
Source:
Returns:
the balance of the wallet, account, or subaddress
Type
BigInteger

(async) getDaemonConnection() → {MoneroRpcConnection}

Get the wallet's daemon connection.
Implements:
Source:
Returns:
the wallet's daemon connection
Type
MoneroRpcConnection

(async) getDaemonHeight() → {int}

Get the blockchain's height.
Implements:
Source:
Returns:
the blockchain's height
Type
int

(async) getDaemonMaxPeerHeight() → {number}

Get the maximum height of the peers the wallet's daemon is connected to.
Source:
Returns:
the maximum height of the peers the wallet's daemon is connected to
Type
number

(async) getData() → {Array.<DataView>}

Get the wallet's keys and cache data.
Source:
Returns:
is the keys and cache data respectively
Type
Array.<DataView>

(async) getHeight() → {int}

Get the block height that the wallet is synced to.
Implements:
Source:
Returns:
the block height that the wallet is synced to
Type
int

(async) getHeightByDate(year, month, day)

Get the blockchain's height by date as a conservative estimate for scanning.
Parameters:
Name Type Description
year int year of the height to get
month int month of the height to get as a number between 1 and 12
day int day of the height to get as a number between 1 and 31
Implements:
Source:
Returns:
the blockchain's approximate height at the given date

(async) getIncomingTransfers(query) → {Array.<MoneroIncomingTransfer>}

Get incoming transfers.
Parameters:
Name Type Description
query MoneroTransferQuery | object configures the query (optional)
Properties
Name Type Description
address string get incoming transfers to a specific address in the wallet (optional)
accountIndex int get incoming transfers to a specific account index (optional)
subaddressIndex int get incoming transfers to a specific subaddress index (optional)
subaddressIndices Array.<int> get transfers destined for specific subaddress indices (optional)
amount BigInteger amount being transferred (optional)
txQuery MoneroTxQuery get transfers whose transaction meets this query (optional)
Implements:
Source:
Returns:
incoming transfers that meet the query
Type
Array.<MoneroIncomingTransfer>

(async) getIntegratedAddress(standardAddress, paymentId) → {MoneroIntegratedAddress}

Get an integrated address based on the given standard address and payment ID. Uses the wallet's primary address if an address is not given. Generates a random payment ID if a payment ID is not given.
Parameters:
Name Type Description
standardAddress string is the standard address to generate the integrated address from (wallet's primary address if undefined)
paymentId string is the payment ID to generate an integrated address from (randomly generated if undefined)
Implements:
Source:
Returns:
the integrated address
Type
MoneroIntegratedAddress

getListeners() → {Array.<MoneroWalletListener>}

Get the listeners registered with the wallet.
Implements:
Source:
Returns:
the registered listeners
Type
Array.<MoneroWalletListener>

(async) getMnemonic() → {string}

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

(async) getMnemonicLanguage() → {string}

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

(async) getMultisigInfo() → {MoneroMultisigInfo}

Get multisig info about this wallet.
Implements:
Source:
Returns:
multisig info about this wallet
Type
MoneroMultisigInfo

(async) getNetworkType() → {MoneroNetworkType}

Get the wallet's network type (mainnet, testnet, or stagenet).
Source:
Returns:
the wallet's network type
Type
MoneroNetworkType

(async) getNewKeyImagesFromLastImport() → {Array.<MoneroKeyImage>}

Get new key images from the last imported outputs.
Implements:
Source:
Returns:
the key images from the last imported outputs
Type
Array.<MoneroKeyImage>

(async) getNumBlocksToUnlock() → {Array.<int>}

Get the number of blocks until the next and last funds unlock.
Implements:
Source:
Returns:
the number of blocks until the next and last funds unlock in elements 0 and 1, respectively, or undefined if no balance
Type
Array.<int>

(async) getOutgoingTransfers(query) → {Array.<MoneroOutgoingTransfer>}

Get outgoing transfers.
Parameters:
Name Type Description
query MoneroTransferQuery | object configures the query (optional)
Properties
Name Type Description
address string get outgoing transfers from a specific address in the wallet (optional)
accountIndex int get outgoing transfers from a specific account index (optional)
subaddressIndex int get outgoing transfers from a specific subaddress index (optional)
subaddressIndices Array.<int> get outgoing transfers from specific subaddress indices (optional)
amount BigInteger amount being transferred (optional)
destinations Array.<MoneroDestination> individual destinations of an outgoing transfer, which is local wallet data and NOT recoverable from the blockchain (optional)
hasDestinations boolean get transfers that have destinations or not (optional)
txQuery MoneroTxQuery get transfers whose transaction meets this query (optional)
Implements:
Source:
Returns:
outgoing transfers that meet the query
Type
Array.<MoneroOutgoingTransfer>

(async) getOutputs(query) → {Array.<MoneroOutputWallet>}

Get outputs created from previous transactions that belong to the wallet (i.e. that the wallet can spend one time). Outputs are part of transactions which are stored in blocks on the blockchain.

Results can be filtered by passing a query object. Outputs must meet every criteria defined in the query in order to be returned. All filtering is optional and no filtering is applied when not defined.

Parameters:
Name Type Description
query MoneroOutputQuery | object configures the query (optional)
Properties
Name Type Description
accountIndex int get outputs associated with a specific account index (optional)
subaddressIndex int get outputs associated with a specific subaddress index (optional)
subaddressIndices Array.<int> get outputs associated with specific subaddress indices (optional)
amount BigInteger get outputs with a specific amount (optional)
minAmount BigInteger get outputs greater than or equal to a minimum amount (optional)
maxAmount BigInteger get outputs less than or equal to a maximum amount (optional)
isSpent boolean get outputs that are spent or not (optional)
keyImage string | MoneroKeyImage get output with a key image or which matches fields defined in a MoneroKeyImage (optional)
txQuery MoneroTxQuery get outputs whose transaction meets this filter (optional)
Implements:
Source:
Returns:
the queried outputs
Type
Array.<MoneroOutputWallet>

(async) getPath() → {string}

Get the wallet's path.
Overrides:
  • MoneroWalletKeys#getPath
Implements:
Source:
Returns:
the path the wallet can be opened with
Type
string

(async) getPaymentUri(config) → {string}

Creates a payment URI from a send configuration.
Parameters:
Name Type Description
config MoneroTxConfig specifies configuration for a potential tx
Implements:
Source:
Returns:
the payment uri
Type
string

(async) getPrimaryAddress() → {string}

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

(async) getPrivateSpendKey() → {string}

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

(async) getPrivateViewKey() → {string}

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

(async) getPublicSpendKey() → {string}

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

(async) getPublicViewKey() → {string}

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

(async) getReserveProofAccount(accountIdx, amount, message) → {string}

Generate a signature to prove an available amount in an account.
Parameters:
Name Type Description
accountIdx int account to prove ownership of the amount
amount BigInteger minimum amount to prove as available in the account
message string message to include with the signature to further authenticate the proof (optional)
Implements:
Source:
Returns:
the reserve proof signature
Type
string

(async) getReserveProofWallet(message)

Generate a signature to prove the entire balance of the wallet.
Parameters:
Name Type Description
message message included with the signature to further authenticate the proof (optional)
Implements:
Source:
Returns:
the reserve proof signature

(async) getSpendProof(txHash, message) → {string}

Generate a signature to prove a spend. Unlike proving a transaction, it does not require the destination public address.
Parameters:
Name Type Description
txHash string transaction to prove
message string message to include with the signature to further authenticate the proof (optional)
Implements:
Source:
Returns:
the transaction signature
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
Overrides:
Implements:
Source:
Returns:
the retrieved subaddress
Type
MoneroSubaddress

(async) getSubaddresses(accountIdx, subaddressIndices) → {Array.<MoneroSubaddress>}

Get subaddresses in an account.
Parameters:
Name Type Description
accountIdx int account to get subaddresses within
subaddressIndices Array.<int> indices of subaddresses to get (optional)
Implements:
Source:
Returns:
the retrieved subaddresses
Type
Array.<MoneroSubaddress>

(async) getSyncHeight() → {number}

Get the height of the first block that the wallet scans.
Source:
Returns:
the height of the first block that the wallet scans
Type
number

(async) getTransfers(query) → {Array.<MoneroTransfer>}

Get incoming and outgoing transfers to and from this wallet. An outgoing transfer represents a total amount sent from one or more subaddresses within an account to individual destination addresses, each with their own amount. An incoming transfer represents a total amount received into a subaddress within an account. Transfers belong to transactions which are stored on the blockchain.

Results can be filtered by passing a query object. Transfers must meet every criteria defined in the query in order to be returned. All criteria are optional and no filtering is applied when not defined.

Parameters:
Name Type Description
query MoneroTransferQuery | object configures the query (optional)
Properties
Name Type Description
isOutgoing boolean get transfers that are outgoing or not (optional)
isIncoming boolean get transfers that are incoming or not (optional)
address string wallet's address that a transfer either originated from (if outgoing) or is destined for (if incoming) (optional)
accountIndex int get transfers that either originated from (if outgoing) or are destined for (if incoming) a specific account index (optional)
subaddressIndex int get transfers that either originated from (if outgoing) or are destined for (if incoming) a specific subaddress index (optional)
subaddressIndices Array.<int> get transfers that either originated from (if outgoing) or are destined for (if incoming) specific subaddress indices (optional)
amount BigInteger amount being transferred (optional)
destinations Array.<MoneroDestination> individual destinations of an outgoing transfer, which is local wallet data and NOT recoverable from the blockchain (optional)
hasDestinations boolean get transfers that have destinations or not (optional)
txQuery MoneroTxQuery get transfers whose transaction meets this query (optional)
Implements:
Source:
Returns:
wallet transfers that meet the query
Type
Array.<MoneroTransfer>

(async) getTx(txHash) → {MoneroTxWallet}

Get a wallet transaction by hash.
Parameters:
Name Type Description
txHash string hash of a transaction to get
Implements:
Source:
Returns:
the identified transactions
Type
MoneroTxWallet

(async) getTxKey(txHash) → {string}

Get a transaction's secret key from its hash.
Parameters:
Name Type Description
txHash string transaction's hash
Implements:
Source:
Returns:
- transaction's secret key
Type
string

(async) getTxNote(txHash) → {string}

Get a transaction note.
Parameters:
Name Type Description
txHash string transaction to get the note of
Implements:
Source:
Returns:
the tx note
Type
string

(async) getTxNotes(txHashes) → {Array.<string>}

Get notes for multiple transactions.
Parameters:
Name Type Description
txHashes Array.<string> hashes of the transactions to get notes for
Implements:
Source:
Returns:
notes for the transactions
Type
Array.<string>

(async) getTxProof(txHash, address, message) → {string}

Get a transaction signature to prove it.
Parameters:
Name Type Description
txHash string transaction to prove
address string destination public address of the transaction
message string message to include with the signature to further authenticate the proof (optional)
Implements:
Source:
Returns:
the transaction signature
Type
string

(async) getTxs(query, missingTxHashes) → {Array.<MoneroTxWallet>}

Get wallet transactions. Wallet transactions contain one or more transfers that are either incoming or outgoing to the wallet.

Results can be filtered by passing a query object. Transactions must meet every criteria defined in the query in order to be returned. All criteria are optional and no filtering is applied when not defined.

Parameters:
Name Type Description
query MoneroTxQuery | Array.<string> | object configures the query (optional)
Properties
Name Type Description
isConfirmed boolean get txs that are confirmed or not (optional)
inTxPool boolean get txs that are in the tx pool or not (optional)
isRelayed boolean get txs that are relayed or not (optional)
isFailed boolean get txs that are failed or not (optional)
isMinerTx boolean get miner txs or not (optional)
hash string get a tx with the hash (optional)
hashes Array.<string> get txs with the hashes (optional)
paymentId string get transactions with the payment id (optional)
paymentIds Array.<string> get transactions with the payment ids (optional)
hasPaymentId boolean get transactions with a payment id or not (optional)
minHeight int get txs with height >= the given height (optional)
maxHeight int get txs with height <= the given height (optional)
isOutgoing boolean get txs with an outgoing transfer or not (optional)
isIncoming boolean get txs with an incoming transfer or not (optional)
transferQuery MoneroTransferQuery get txs that have a transfer that meets this query (optional)
includeOutputs boolean specifies that tx outputs should be returned with tx results (optional)
missingTxHashes Array.<string> populated with hashes of unfound or unmet transactions that were queried by hash (throws error if undefined and queried transaction hashes are unfound or unmet)
Implements:
Source:
Returns:
wallet transactions per the configuration
Type
Array.<MoneroTxWallet>

(async) getUnlockedBalance(accountIdx, subaddressIdx) → {BigInteger}

Get the unlocked balance of the wallet, account, or subaddress.
Parameters:
Name Type Description
accountIdx int index of the account to get the unlocked balance of (optional)
subaddressIdx int index of the subaddress to get the unlocked balance of (optional)
Implements:
Source:
Returns:
the unlocked balance of the wallet, account, or subaddress
Type
BigInteger

(async) getVersion() → {MoneroVersion}

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

(async) importKeyImages(keyImages) → {MoneroKeyImageImportResult}

Import signed key images and verify their spent status.
Parameters:
Name Type Description
keyImages Array.<MoneroKeyImage> images to import and verify (requires hex and signature)
Implements:
Source:
Returns:
results of the import
Type
MoneroKeyImageImportResult

(async) importMultisigHex(multisigHexes) → {int}

Import multisig info as hex from other participants.
Parameters:
Name Type Description
multisigHexes Array.<string> multisig hex from each participant
Implements:
Source:
Returns:
the number of outputs signed with the given multisig hex
Type
int

(async) importOutputs(outputsHex) → {int}

Import outputs in hex format.
Parameters:
Name Type Description
outputsHex string outputs in hex format
Implements:
Source:
Returns:
the number of outputs imported
Type
int

(async) isClosed() → {boolean}

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

(async) isConnectedToDaemon() → {boolean}

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

(async) isDaemonSynced() → {boolean}

Indicates if the wallet's daemon is synced with the network.
Source:
Returns:
true if the daemon is synced with the network, false otherwise
Type
boolean

(async) isMultisig() → {boolean}

Indicates if this wallet is a multisig wallet.
Implements:
Source:
Returns:
true if this is a multisig wallet, false otherwise
Type
boolean

(async) isMultisigImportNeeded() → {boolean}

Indicates if importing multisig data is needed for returning a correct balance.
Implements:
Source:
Returns:
true if importing multisig data is needed for returning a correct balance, false otherwise
Type
boolean

(async) isOutputFrozen(keyImage) → {boolean}

Check if an output is frozen.
Parameters:
Name Type Description
keyImage string key image of the output to check if frozen
Implements:
Source:
Returns:
true if the output is frozen, false otherwise
Type
boolean

(async) isSynced() → {boolean}

Indicates if the wallet is synced with the daemon.
Source:
Returns:
true if the wallet is synced with the 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.
Overrides:
Implements:
Source:
Returns:
true if the wallet is view-only, false otherwise
Type
bool

(async) makeMultisig(multisigHexes, threshold, password) → {string}

Make this wallet multisig by importing multisig hex from participants.
Parameters:
Name Type Description
multisigHexes Array.<String> multisig hex from each participant
threshold int number of signatures needed to sign transfers
password string wallet password
Implements:
Source:
Returns:
this wallet's multisig hex to share with participants
Type
string

(async) moveTo(path)

Move the wallet from its current path to the given path.
Parameters:
Name Type Description
path string the wallet's destination path
Source:

(async) parsePaymentUri(uri) → {MoneroTxConfig}

Parses a payment URI to a tx config.
Parameters:
Name Type Description
uri string payment uri to parse
Implements:
Source:
Returns:
the send configuration parsed from the uri
Type
MoneroTxConfig

(async) prepareMultisig() → {string}

Get multisig info as hex to share with participants to begin creating a multisig wallet.
Implements:
Source:
Returns:
this wallet's multisig hex to share with participants
Type
string

(async) relayTx(txOrMetadata) → {string}

Relay a previously created transaction.
Parameters:
Name Type Description
txOrMetadata MoneroTxWallet | string transaction or its metadata to relay
Implements:
Source:
Returns:
the hash of the relayed tx
Type
string

(async) relayTxs(txsOrMetadatas) → {Array.<string>}

Relay previously created transactions.
Parameters:
Name Type Description
txsOrMetadatas Array.<MoneroTxWallet> | Array.<string> transactions or their metadata to relay
Implements:
Source:
Returns:
the hashes of the relayed txs
Type
Array.<string>

(async) removeListener(listener)

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

(async) rescanBlockchain()

Rescan the blockchain from scratch, losing any information which cannot be recovered from the blockchain itself.

WARNING: This method discards local wallet data like destination addresses, tx secret keys, tx notes, etc.

Implements:
Source:

(async) rescanSpent()

Rescan the blockchain for spent outputs.

Note: this can only be called with a trusted daemon.

Example use case: peer multisig hex is import when connected to an untrusted daemon, so the wallet will not rescan spent outputs. Then the wallet connects to a trusted daemon. This method should be manually invoked to rescan outputs.

Implements:
Source:

(async) save()

Save the wallet at its current path.
Implements:
Source:

(async) scanTxs(txHashes)

Scan transactions by their hash/id.
Parameters:
Name Type Description
txHashes Array.<string> tx hashes to scan
Implements:
Source:

(async) setAccountTagLabel(tag, label)

Sets a human-readable description for a tag.
Parameters:
Name Type Description
tag string tag to set a description for
label string label to set for the tag
Implements:
Source:

(async) setAttribute(key, val)

Set an arbitrary attribute.
Parameters:
Name Type Description
key string attribute key
val string attribute value
Implements:
Source:

(async) setDaemonConnection(uriOrConnection, username, password)

Set the wallet's daemon connection.
Parameters:
Name Type Description
uriOrConnection string | MoneroRpcConnection daemon's URI or connection (defaults to offline)
username string username to authenticate with the daemon (optional)
password string password to authenticate with the daemon (optional)
Implements:
Source:

(async) setSyncHeight(syncHeight)

Set the height of the first block that the wallet scans.
Parameters:
Name Type Description
syncHeight number height of the first block that the wallet scans
Source:

(async) setTxNote(txHash, note)

Set a note for a specific transaction.
Parameters:
Name Type Description
txHash string hash of the transaction to set a note for
note string the transaction note
Implements:
Source:

(async) setTxNotes(txHashes, notes)

Set notes for multiple transactions.
Parameters:
Name Type Description
txHashes Array.<string> transactions to set notes for
notes Array.<string> notes to set for the transactions
Implements:
Source:

(async) signMessage(message, signatureType, accountIdx, subaddressIdx) → {string}

Sign a message.
Parameters:
Name Type Description
message string the message to sign
signatureType MoneroMessageSignatureType sign with spend key or view key (default spend key)
accountIdx int the account index of the message signature (default 0)
subaddressIdx int the subaddress index of the message signature (default 0)
Implements:
Source:
Returns:
the signature
Type
string

(async) signMultisigTxHex(multisigTxHex) → {MoneroMultisigSignResult}

Sign multisig transactions from a multisig wallet.
Parameters:
Name Type Description
multisigTxHex string unsigned multisig transactions as hex
Implements:
Source:
Returns:
the result of signing the multisig transactions
Type
MoneroMultisigSignResult

(async) signTxs(unsignedTxHex) → {string}

Sign unsigned transactions from a view-only wallet.
Parameters:
Name Type Description
unsignedTxHex string unsigned transaction hex from when the transactions were created
Implements:
Source:
Returns:
the signed transaction hex
Type
string

(async) startMining(numThreads, backgroundMining, ignoreBattery)

Start mining.
Parameters:
Name Type Description
numThreads int number of threads created for mining (optional)
backgroundMining boolean specifies if mining should occur in the background (optional)
ignoreBattery boolean specifies if the battery should be ignored for mining (optional)
Implements:
Source:

(async) startSyncing(syncPeriodInMs)

Start background synchronizing with a maximum period between syncs.
Parameters:
Name Type Description
syncPeriodInMs int maximum period between syncs in milliseconds (default is wallet-specific)
Implements:
Source:

(async) stopMining()

Stop mining.
Implements:
Source:

(async) stopSyncing()

Stop synchronizing the wallet with the daemon.
Implements:
Source:

(async) submitMultisigTxHex(signedMultisigTxHex) → {Array.<string>}

Submit signed multisig transactions from a multisig wallet.
Parameters:
Name Type Description
signedMultisigTxHex string signed multisig hex returned from signMultisigTxHex()
Implements:
Source:
Returns:
the resulting transaction hashes
Type
Array.<string>

(async) submitTxs(signedTxHex) → {Array.<string>}

Submit signed transactions from a view-only wallet.
Parameters:
Name Type Description
signedTxHex string signed transaction hex from signTxs()
Implements:
Source:
Returns:
the resulting transaction hashes
Type
Array.<string>

(async) sweepDust(relay) → {Array.<MoneroTxWallet>}

Sweep all unmixable dust outputs back to the wallet to make them easier to spend and mix.

NOTE: Dust only exists pre RCT, so this method will throw "no dust to sweep" on new wallets.

Parameters:
Name Type Description
relay boolean specifies if the resulting transaction should be relayed (default false)
Implements:
Source:
Returns:
the created transactions
Type
Array.<MoneroTxWallet>

(async) sweepOutput(config) → {MoneroTxWallet}

Sweep an output by key image.
Parameters:
Name Type Description
config MoneroTxConfig configures the transaction to create (required)
Properties
Name Type Description
address string single destination address (required)
keyImage string key image to sweep (required)
relay boolean relay the transaction to peers to commit to the blockchain (default false)
unlockHeight int minimum height for the transaction to unlock (default 0)
priority MoneroTxPriority transaction priority (default MoneroTxPriority.NORMAL)
Implements:
Source:
Returns:
the created transaction
Type
MoneroTxWallet

(async) sweepUnlocked(config) → {Array.<MoneroTxWallet>}

Sweep all unlocked funds according to the given configuration.
Parameters:
Name Type Description
config MoneroTxConfig | object configures the transactions to create (required)
Properties
Name Type Description
address string single destination address (required)
accountIndex int source account index to sweep from (optional, defaults to all accounts)
subaddressIndex int source subaddress index to sweep from (optional, defaults to all subaddresses)
subaddressIndices Array.<int> source subaddress indices to sweep from (optional)
relay boolean relay the transactions to peers to commit to the blockchain (default false)
priority MoneroTxPriority transaction priority (default MoneroTxPriority.NORMAL)
unlockHeight int minimum height for the transactions to unlock (default 0)
sweepEachSubaddress boolean sweep each subaddress individually if true (default false)
Implements:
Source:
Returns:
the created transactions
Type
Array.<MoneroTxWallet>

(async) sync(listenerOrStartHeight, startHeight, allowConcurrentCalls)

Synchronize the wallet with the daemon as a one-time synchronous process.
Parameters:
Name Type Description
listenerOrStartHeight MoneroWalletListener | number listener xor start height (defaults to no sync listener, the last synced block)
startHeight number startHeight if not given in first arg (defaults to last synced block)
allowConcurrentCalls bool allow other wallet methods to be processed simultaneously during sync (default false)

WARNING: enabling this option will crash wallet execution if another call makes a simultaneous network request. TODO: possible to sync wasm network requests in http_client_wasm.cpp?
Implements:
Source:

(async) tagAccounts(tag, accountIndices)

Tag accounts.
Parameters:
Name Type Description
tag string tag to apply to the specified accounts
accountIndices Array.<int> indices of the accounts to tag
Implements:
Source:

(async) thawOutput(keyImage)

Thaw a frozen output.
Parameters:
Name Type Description
keyImage string key image of the output to thaw
Implements:
Source:

(async) untagAccounts(accountIndices)

Untag accounts.
Parameters:
Name Type Description
accountIndices Array.<int> indices of the accounts to untag
Implements:
Source:

(async) verifyMessage(message, address, signature) → {MoneroMessageSignatureResult}

Verify a signature on a message.
Parameters:
Name Type Description
message string signed message
address string signing address
signature string signature
Implements:
Source:
Returns:
true if the signature is good, false otherwise
Type
MoneroMessageSignatureResult