Skip to content

Results and Notifications

Class From
MoneroSyncResult sync: the blocks fetched, and whether money was received
MoneroKeyImageExportResult, MoneroKeyImageImportResult export_key_images, import_key_images
MoneroMessageSignatureResult verify_message
MoneroCheck, MoneroCheckTx, MoneroCheckReserve the checks of the proofs: check_tx_key, check_tx_proof, check_reserve_proof
MoneroMultisigInfo, MoneroMultisigInitResult, MoneroMultisigSignResult the steps of a multisig wallet: get_multisig_info, exchange_multisig_keys, sign_multisig_tx_hex

MoneroWalletListener is told what a sync finds: Listening to a Wallet.

MoneroSyncResult

Bases: SerializableStruct

Models a result of syncing a wallet.

num_blocks_fetched instance-attribute

Number of blocks fetched.

received_money instance-attribute

Indicates if money was received.

__init__(*args, **kwargs)

__init__() -> None
__init__(
    num_blocks_fetched: int, received_money: bool
) -> None

Initialize a Monero sync result.

Parameters:

Name Type Description Default
num_blocks_fetched int

Number of blocks fetched.

required
received_money bool

Indicates if wallet received money during last sync.

required

deserialize(json) staticmethod

Deserialize a MoneroSyncResult from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroSyncResult in JSON format.

required

Returns:

Type Description
MoneroSyncResult

deserialized instance.

MoneroKeyImageExportResult

Bases: SerializableStruct

Models results from exporting key images.

key_images instance-attribute

The exported key images, one per owned output starting at offset.

offset instance-attribute

Index of the first exported key image within the wallet's list of owned outputs.

On an incremental export (all=False) the wallet skips outputs whose key images were already exported, so this offset tells the importing wallet where in its own output list the returned key images begin. Pass it back as the offset argument of MoneroWallet.import_key_images().

__init__()

Initialize a Monero key image export result.

deserialize(json) staticmethod

Deserialize a MoneroKeyImageExportResult from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroKeyImageExportResult in JSON format.

required

Returns:

Type Description
MoneroKeyImageExportResult

deserialized instance.

MoneroKeyImageImportResult

Bases: SerializableStruct

Models results from importing key images.

height instance-attribute

Height at which the last key image was imported. Can be 0 if blockchain height is not known.

spent_amount instance-attribute

Amount (in atomic-units) spent from those key images.

unspent_amount instance-attribute

Amount (in atomic-units) still available from those key images.

__init__()

Initialize a Monero key image import result.

deserialize(json) staticmethod

Deserialize a MoneroKeyImageImportResult from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroKeyImageImportResult in JSON format.

required

Returns:

Type Description
MoneroKeyImageImportResult

deserialized instance.

MoneroMessageSignatureResult

Bases: SerializableStruct

Models results from message verification.

is_good instance-attribute

Indicates if the message verification was successful.

is_old instance-attribute

Indicates if the message verification used old monero software.

signature_type instance-attribute

Signature type used in the message verification.

version instance-attribute

Message signature version.

__init__()

Initialize a Monero message signature result.

deserialize(json) staticmethod

Deserialize a MoneroMessageSignatureResult from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroMessageSignatureResult in JSON format.

required

Returns:

Type Description
MoneroMessageSignatureResult

deserialized instance.

MoneroCheck

Bases: SerializableStruct

Base model for results from checking a transaction or reserve proof.

is_good instance-attribute

Indicates if check was successful.

__init__()

Initialize a Monero check.

deserialize(json) staticmethod

Deserialize a MoneroCheck from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroCheck in JSON format.

required

Returns:

Type Description
MoneroCheck

deserialized instance.

MoneroCheckTx

Bases: MoneroCheck

Models the results from checking a transaction key.

in_tx_pool instance-attribute

States if the transaction is in pool (True) or included in a block (False)

num_confirmations instance-attribute

Transaction network confirmations.

received_amount instance-attribute

Amount received in the transaction.

__init__()

Initialize a Monero transaction check.

deserialize(json) staticmethod

Deserialize a MoneroCheckTx from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroCheckTx in JSON format.

required

Returns:

Type Description
MoneroCheckTx

deserialized instance.

MoneroCheckReserve

Bases: MoneroCheck

Models the results from checking a reserve proof.

total_amount instance-attribute

The reserve total amount.

unconfirmed_spent_amount instance-attribute

The reserve unconfirmed spent amount.

__init__()

Initialize a Monero reserve check.

deserialize(json) staticmethod

Deserialize a MoneroCheckReserve from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroCheckReserve in JSON format.

required

Returns:

Type Description
MoneroCheckReserve

deserialized instance.

MoneroMultisigInfo

Bases: SerializableStruct

Models information about a multisig wallet.

is_multisig instance-attribute

Indicates if the wallet is multisignature (True), or not (False).

is_ready instance-attribute

Indicates if the wallet is ready to support multisignature operations (True) or not (False).

num_participants instance-attribute

Number of participants of the multisignature wallet.

threshold instance-attribute

Number of participants need in order to sign a transaction.

__init__()

Initialize a Monero multisignature info.

deserialize(json) staticmethod

Deserialize a MoneroMultisigInfo from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroMultisigInfo in JSON format.

required

Returns:

Type Description
MoneroMultisigInfo

deserialized instance.

MoneroMultisigInitResult

Bases: SerializableStruct

Models the result of initializing a multisig wallet which results in the multisig wallet's address xor another multisig hex to share with participants to create the wallet.

address instance-attribute

The multisignature wallet address.

multisig_hex instance-attribute

The multisignature hex to share with other participants.

__init__()

Initialize a Monero multisignature initializing result.

deserialize(json) staticmethod

Deserialize a MoneroMultisigInitResult from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroMultisigInitResult in JSON format.

required

Returns:

Type Description
MoneroMultisigInitResult

deserialized instance.

MoneroMultisigSignResult

Bases: SerializableStruct

Models the result of signing multisig tx hex.

signed_multisig_tx_hex instance-attribute

Multisig transaction in hex format.

tx_hashes instance-attribute

List of transaction hash.

__init__()

Initialize a Monero multisignature signature result.

deserialize(json) staticmethod

Deserialize a MoneroMultisigSignResult from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroMultisigSignResult in JSON format.

required

Returns:

Type Description
MoneroMultisigSignResult

deserialized instance.

MoneroWalletListener

Interface to receive wallet notifications.

__init__()

Initialize a wallet listener.

on_balances_changed(new_balance, new_unlocked_balance)

Invoked when the wallet's balances change.

Parameters:

Name Type Description Default
new_balance int

new balance.

required
new_unlocked_balance int

new unlocked balance.

required

on_new_block(height)

Invoked when a new block is processed.

Parameters:

Name Type Description Default
height int

the newly processed block.

required

on_output_received(output)

Invoked when the wallet receives an output.

Parameters:

Name Type Description Default
output MoneroOutputWallet

the received output.

required

on_output_spent(output)

Invoked when the wallet spends an output.

Parameters:

Name Type Description Default
output MoneroOutputWallet

the spent output.

required

on_sync_progress(height, start_height, end_height, percent_done, message)

Invoked when sync progress is made.

Parameters:

Name Type Description Default
height int

height of the synced block.

required
start_height int

starting height of the sync request.

required
end_height int

ending height of the sync request.

required
percent_done float

sync progress as a percentage.

required
message str

human-readable description of the current progress.

required