# Class: MoneroWalletListener

## MoneroWalletListener()

Default wallet listener which takes no action on notifications.

## Constructor

#### new MoneroWalletListener()

Source:
  - src/main/js/wallet/model/MoneroWalletListener.js, line 4

### Methods

#### (async) onBalancesChanged(newBalance, newUnlockedBalance)

Invoked when the wallet's balances change.

##### Parameters:

Name | Type | Description
--- | --- | ---
`newBalance` | BigInteger | new wallet balance
`newUnlockedBalance` | BigInteger | new unlocked wallet balance

Source:
  - src/main/js/wallet/model/MoneroWalletListener.js, line 30

#### (async) onNewBlock(height)

Invoked when a new block is added to the chain.

##### Parameters:

Name | Type | Description
--- | --- | ---
`height` | int | the height of the new block (i.e. the number of blocks before it).

Source:
  - src/main/js/wallet/model/MoneroWalletListener.js, line 22

#### (async) onOutputReceived(output)

Invoked 3 times per received output: once when unconfirmed, once when confirmed, and once when unlocked. The notified output includes basic fields only, so the output or its transaction should be fetched to get all available fields.

##### Parameters:

Name | Type | Description
--- | --- | ---
`output` | MoneroOutputWallet | the received output

Source:
  - src/main/js/wallet/model/MoneroWalletListener.js, line 40

#### (async) onOutputSpent(output)

Invoked twice per spent output: once when confirmed and once when unlocked. The notified output includes basic fields only, so the output or its transaction should be fetched to get all available fields.

##### Parameters:

Name | Type | Description
--- | --- | ---
`output` | MoneroOutputWallet | the spent output

Source:
  - src/main/js/wallet/model/MoneroWalletListener.js, line 49

#### (async) onSyncProgress(height, startHeight, endHeight, percentDone, message)

Invoked as the wallet is synchronized.

##### Parameters:

Name | Type | Description
--- | --- | ---
`height` | number | height of the synced block
`startHeight` | number | starting height of the sync request
`endHeight` | number | ending height of the sync request
`percentDone` | number | sync progress as a percentage
`message` | string | human-readable description of the current progress

Source:
  - src/main/js/wallet/model/MoneroWalletListener.js, line 15