# Interface: MoneroWallet

## MoneroWallet

Monero wallet interface and default implementations.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 38

### Methods

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

Add an address book entry.

##### Parameters:

Name | Type | Description
--- | --- | ---
`address` | string | entry address
`description` | string | entry description (optional)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1034

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 45

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1263

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 973

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 939

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 891

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 916

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1279

#### (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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 414

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 459

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 705

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 729

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 227

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1056

#### (async) describeMultisigTxSet(multisigTxHex) → {MoneroTxSet}

Describe a tx set from multisig tx hex.

##### Parameters:

Name | Type | Description
--- | --- | ---
`multisigTxHex` | string | multisig tx hex

Source:
  - src/main/js/wallet/MoneroWallet.js, line 814

##### Returns:

the tx set containing structured transactions

Type
  MoneroTxSet

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 824

##### Returns:

the tx set containing structured transactions

Type
  MoneroTxSet

#### (async) describeUnsignedTxSet(unsignedTxHex) → {MoneroTxSet}

Describe a tx set from unsigned tx hex.

##### Parameters:

Name | Type | Description
--- | --- | ---
`unsignedTxHex` | string | unsigned tx hex

Source:
  - src/main/js/wallet/MoneroWallet.js, line 804

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1047

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1214

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 638

##### Returns:

the wallet's signed key images

Type
  Array.<MoneroKeyImage>

#### (async) exportMultisigHex() → {string}

Export this wallet's multisig info as hex for other participants.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1223

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 618

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 666

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 404

##### Returns:

the retrieved account

Type
  MoneroAccount

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

Return all account tags.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1084

##### Returns:

the wallet's account tags

Type
  Array.<MoneroAccountTag>

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 393

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 194

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1023

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 204

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1124

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 327

##### Returns:

the balance of the wallet, account, or subaddress

Type
  BigInteger

#### (async) getDaemonConnection() → {MoneroRpcConnection}

Get the wallet's daemon connection.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 93

##### Returns:

the wallet's daemon connection

Type
  MoneroRpcConnection

#### (async) getDaemonHeight() → {int}

Get the blockchain's height.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 245

##### Returns:

the blockchain's height

Type
  int

#### (async) getHeight() → {int}

Get the block height that the wallet is synced to.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 236

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 257

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 559

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 217

##### Returns:

the integrated address

Type
  MoneroIntegratedAddress

#### getListeners() → {Array.<MoneroWalletListener>}

Get the listeners registered with the wallet.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 63

##### Returns:

the registered listeners

Type
  Array.<MoneroWalletListener>

#### (async) getMnemonic() → {string}

Get the wallet's mnemonic phrase derived from the seed.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 129

##### Returns:

the wallet's mnemonic phrase

Type
  string

#### (async) getMnemonicLanguage() → {string}

Get the language of the wallet's mnemonic phrase.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 138

##### Returns:

the language of the wallet's mnemonic phrase

Type
  string

#### (async) getMultisigInfo() → {MoneroMultisigInfo}

Get multisig info about this wallet.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1179

##### Returns:

multisig info about this wallet

Type
  MoneroMultisigInfo

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

Get new key images from the last imported outputs.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 657

##### 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.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 347

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 580

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 608

##### Returns:

the queried outputs

Type
  Array.<MoneroOutputWallet>

#### (async) getPath() → {string}

Get the wallet's path.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 120

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1104

##### Returns:

the payment uri

Type
  string

#### (async) getPrimaryAddress() → {string}

Get the wallet's primary address.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 183

##### Returns:

the wallet's primary address

Type
  string

#### (async) getPrivateSpendKey() → {string}

Get the wallet's private spend key.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 156

##### Returns:

the wallet's private spend key

Type
  string

#### (async) getPrivateViewKey() → {string}

Get the wallet's private view key.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 147

##### Returns:

the wallet's private view key

Type
  string

#### (async) getPublicSpendKey() → {string}

Get the wallet's public spend key.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 174

##### Returns:

the wallet's public spend key

Type
  string

#### (async) getPublicViewKey() → {string}

Get the wallet's public view key.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 165

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 961

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 949

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 927

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 446

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 435

##### Returns:

the retrieved subaddresses

Type
  Array.<MoneroSubaddress>

#### (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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 543

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 481

##### Throws:

if the transaction is not found

Type
  MoneroError

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 879

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 983

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 993

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 903

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 514

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 338

##### Returns:

the unlocked balance of the wallet, account, or subaddress

Type
  BigInteger

#### (async) getVersion() → {MoneroVersion}

Gets the version of the wallet.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 111

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 648

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1233

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 628

##### Returns:

the number of outputs imported

Type
  int

#### (async) isClosed() → {boolean}

Indicates if this wallet is closed or not.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1288

##### Returns:

true if the wallet is closed, false otherwise

Type
  boolean

#### (async) isConnectedToDaemon() → {boolean}

Indicates if the wallet is connected to daemon.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 102

##### Returns:

true if the wallet is connected to a daemon, false otherwise

Type
  boolean

#### (async) isMultisig() → {boolean}

Indicates if this wallet is a multisig wallet.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1170

##### 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.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1161

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 685

##### Returns:

true if the output is frozen, 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.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 73

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1201

##### Returns:

this wallet's multisig hex to share with participants

Type
  string

#### (async) parsePaymentUri(uri) → {MoneroTxConfig}

Parses a payment URI to a tx config.

##### Parameters:

Name | Type | Description
--- | --- | ---
`uri` | string | payment uri to parse

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1114

##### 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.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1189

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 784

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 794

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 54

#### (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.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 316

#### (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.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 305

#### save()

Save the wallet at its current path.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1270

#### (async) scanTxs(txHashes)

Scan transactions by their hash/id.

##### Parameters:

Name | Type | Description
--- | --- | ---
`txHashes` | Array.<string> | tx hashes to scan

Source:
  - src/main/js/wallet/MoneroWallet.js, line 292

#### (async) setAccountLabel(accountIdx, label)

Set an account label.

##### Parameters:

Name | Type | Description
--- | --- | ---
`accountIdx` | number | index of the account to set the label for
`label` | string | the label to set

Source:
  - src/main/js/wallet/MoneroWallet.js, line 424

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1094

#### (async) setAttribute(key, val)

Set an arbitrary attribute.

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | string | attribute key
`val` | string | attribute value

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1134

#### (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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 84

#### (async) setSubaddressLabel(accountIdx, subaddressIdx, label)

Set a subaddress label.

##### Parameters:

Name | Type | Description
--- | --- | ---
`accountIdx` | number | index of the account to set the label for
`subaddressIdx` | number | index of the subaddress to set the label for
`label` | string | the label to set

Source:
  - src/main/js/wallet/MoneroWallet.js, line 470

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1003

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1013

#### (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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 857

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1243

##### 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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 834

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1145

#### (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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 276

#### (async) stopMining()

Stop mining.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1152

#### (async) stopSyncing()

Stop synchronizing the wallet with the daemon.

Source:
  - src/main/js/wallet/MoneroWallet.js, line 283

#### (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()

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1253

##### 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()

Source:
  - src/main/js/wallet/MoneroWallet.js, line 844

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 774

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 744

##### 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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 762

##### Returns:

the created transactions

Type
  Array.<MoneroTxWallet>

#### (async) sync(listenerOrStartHeight, startHeight)

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)

Source:
  - src/main/js/wallet/MoneroWallet.js, line 267

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1066

#### (async) thawOutput(keyImage)

Thaw a frozen output.

##### Parameters:

Name | Type | Description
--- | --- | ---
`keyImage` | string | key image of the output to thaw

Source:
  - src/main/js/wallet/MoneroWallet.js, line 675

#### (async) untagAccounts(accountIndices)

Untag accounts.

##### Parameters:

Name | Type | Description
--- | --- | ---
`accountIndices` | Array.<int> | indices of the accounts to untag

Source:
  - src/main/js/wallet/MoneroWallet.js, line 1075

#### (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

Source:
  - src/main/js/wallet/MoneroWallet.js, line 869

##### Returns:

true if the signature is good, false otherwise

Type
  MoneroMessageSignatureResult