Skip to content

Wallet Data Model

MoneroWalletConfig

Configures a wallet to create.

account_lookahead: int | None instance-attribute

Account index look ahead.

is_multisig: bool | None instance-attribute

Indicates if the wallet is a multisignature wallet.

language: str | None instance-attribute

The wallet language.

network_type: MoneroNetworkType | None instance-attribute

The wallet network type.

password: str | None instance-attribute

The wallet password.

path: str | None instance-attribute

The wallet path on file system.

primary_address: str | None instance-attribute

The wallet standard address.

private_spend_key: str | None instance-attribute

The wallet private spend key.

private_view_key: str | None instance-attribute

The wallet private view key.

restore_height: int | None instance-attribute

The wallet restore height.

save_current: bool | None instance-attribute

Save the wallet.

seed: str | None instance-attribute

The wallet mnemonic.

seed_offset: str | None instance-attribute

The wallet custom seed offset.

server: MoneroRpcConnection | None instance-attribute

The wallet RPC connection.

subaddress_lookahead: int | None instance-attribute

Subaddress index look ahead.

copy()

Copy this wallet config.

Returns:

Type Description
MoneroWalletConfig

Copy of the wallet config.

deserialize(config_json) staticmethod

Deserialize a Monero wallet config from a JSON string.

Parameters:

Name Type Description Default
config_json str

JSON string.

required

Returns:

Type Description
MoneroWalletConfig

The deserialized wallet config.

MoneroSyncResult

Bases: SerializableStruct

Models a result of syncing a wallet.

num_blocks_fetched: int instance-attribute

Number of blocks fetched.

received_money: bool instance-attribute

Indicates if money was received.

MoneroSubaddress

Bases: SerializableStruct

Models a Monero subaddress.

account_index: int | None instance-attribute

The subaddress account index.

address: str | None instance-attribute

Public address.

balance: int | None instance-attribute

The subaddress balance.

index: int | None instance-attribute

The subaddress index.

is_used: bool | None instance-attribute

Indicates if subaddress has been used in receiving funds.

label: str | None instance-attribute

The subaddress label.

num_blocks_to_unlock: int | None instance-attribute

Number of blocks to unlock receveid outputs.

num_unspent_outputs: int | None instance-attribute

The number of unspent outputs in this subaddress.

unlocked_balance: int | None instance-attribute

The subaddress unlocked balance.

__init__()

Initialize a Monero subaddress.

MoneroAccount

Bases: SerializableStruct

Models a Monero account.

balance: int | None instance-attribute

The account balance.

index: int | None instance-attribute

The account index.

primary_address: str | None instance-attribute

The account primary address.

subaddresses: list[MoneroSubaddress] instance-attribute

List of account subaddresses.

tag: str | None instance-attribute

The account tag.

unlocked_balance: int | None instance-attribute

The account unlocked balance.

__init__()

Initialize a Monero account.

MoneroDestination

Models an outgoing transfer destination.

address: str | None instance-attribute

Address of the receiver.

amount: int | None instance-attribute

Amount sent to this destination.

copy()

Copy current outgoing transfer destination.

Returns:

Type Description
MoneroDestination

outgoing transfer destination copy.

MoneroTransfer

Bases: SerializableStruct

Models a base transfer of funds to or from the wallet.

account_index: int | None instance-attribute

Index of the account related to this transfer.

amount: int | None instance-attribute

Transfer amount in atomic-units.

tx: MoneroTxWallet instance-attribute

Related wallet transaction.

__init__()

Initialize a Monero transfer.

copy()

Copy current transfer.

Returns:

Type Description
MoneroTransfer

transfer copy.

is_incoming()

Indicates if it is an incoming transfer (True) or not (False). Default None.

Returns:

Type Description
bool | None

True if current transfer is incoming, False if outgoing, None if unkown.

is_outgoing()

Indicates if it is an outgoing transfer (True) or not (False). Default None.

Returns:

Type Description
bool | None

True if current transfer is outgoing, False if incoming, None if unkown.

merge(other)

Merge current transfer with another one.

Parameters:

Name Type Description Default
other MoneroTransfer

other transfer to merge with.

required

MoneroIncomingTransfer

Bases: MoneroTransfer

Models an incoming transfer of funds to the wallet.

address: str | None instance-attribute

The address that received funds within this transfer.

num_suggested_confirmations: int | None instance-attribute

The number of suggested confirmations before moving funds.

subaddress_index: int | None instance-attribute

The subaddress index that received funds within this transfer.

__init__()

Initialize a Monero incoming transfer.

copy()

Copy current incoming transfer.

Returns:

Type Description
MoneroIncomingTransfer

incoming transfer copy.

MoneroOutgoingTransfer

Bases: MoneroTransfer

Models an outgoing transfer of funds from the wallet.

addresses: list[str] instance-attribute

Addresses from which the transfer originated.

destinations: list[MoneroDestination] instance-attribute

Outgoing transfer destinations.

subaddress_indices: list[int] instance-attribute

Subaddresses from which the transfer originated.

copy()

Copy current outgoing transfer.

Returns:

Type Description
MoneroOutgoingTransfer

outgoing transfer copy.

MoneroTransferQuery

Bases: MoneroTransfer

Configures a query to retrieve transfers.

All transfers are returned except those that do not meet the criteria defined in this query.

address: str | None instance-attribute

Select transfers involving particular address. Empty for all.

addresses: list[str] instance-attribute

Select transfers involving particular addresses. Empty for all.

destinations: list[MoneroDestination] instance-attribute

Select transfers involving particular destinations. Empty for all.

has_destinations: bool | None instance-attribute

Filter transfers with or without destinations. None for all.

incoming: bool | None instance-attribute

Filter incoming or outgoing transfers. None for all.

outgoing: bool | None instance-attribute

Filter incoming or outgoing transfers. None for all.

subaddress_index: int | None instance-attribute

Filter by subaddress index. None for all.

subaddress_indices: list[int] instance-attribute

Select transfers involving particular subaddresses. Empty for all.

tx_query: MoneroTxQuery | None instance-attribute

Related transaction query.

__init__()

Initialize a Monero transfer query.

copy()

Copy current transfer query.

Returns:

Type Description
MoneroTransferQuery

transfer query copy.

deserialize_from_block(transfer_query_json) staticmethod

Deserialize transfer query from json block.

Parameters:

Name Type Description Default
transfer_query_json str

json block with serialized transfer query.

required

Returns:

Type Description
MoneroTransferQuery

deserialized transfer query.

meets_criteria(transfer, query_parent=True)

Check if transfer meets all the criteria defined in this query.

Parameters:

Name Type Description Default
transfer MoneroTransfer

transfer to check if meets criteria.

required
query_parent bool

query parent tx query (default True).

True

Returns:

Type Description
bool

True if transfer meets all criteria defined in this query, False otherwise.

MoneroOutputWallet

Bases: MoneroOutput

Models a Monero output with wallet extensions.

account_index: int | None instance-attribute

The index of the account that owns this output.

is_frozen: bool | None instance-attribute

Indicates if the output is frozen (True) or not (False).

is_spent: bool | None instance-attribute

Indicates if the output is spent (True) or not (False).

subaddress_index: int | None instance-attribute

The index of the subaddress that owns this output.

__init__()

Initialize a Monero wallet output.

copy()

Copy current output wallet.

Returns:

Type Description
MoneroOutputWallet

output wallet copy.

MoneroOutputQuery

Bases: MoneroOutputWallet

Configures a query to retrieve wallet outputs (i.e. outputs that the wallet has or had the ability to spend).

All outputs are returned except those that do not meet the criteria defined in this query.

max_amount: int | None instance-attribute

Filter outputs above this amount.

min_amount: int | None instance-attribute

Filter outputs below this amount.

subaddress_indices: list[int] instance-attribute

Subadress indices to select (empty for all).

tx_query: MoneroTxQuery | None property

Related transaction query.

__init__()

Initialize a Monero output query.

copy()

Copy current output query.

Returns:

Type Description
MoneroOutputQuery

output query copy.

deserialize_from_block(output_query_json) staticmethod

Deserialize output query from block.

Parameters:

Name Type Description Default
output_query_json str

json query block.

required

Returns:

Type Description
MoneroOutputQuery

deserialized output query.

meets_criteria(output, query_parent=True)

Indicates if the output meets all the criteria defined within this query.

Parameters:

Name Type Description Default
output MoneroOutputWallet

Output to check.

required
query_parent bool

Query also parent.

True

Returns:

Type Description
bool

True if output meets all the criteria defined in this query, False otherwise.

set_tx_query(tx_query, output_query)

Set related transaction query.

This method sets query references constitutively.

Parameters:

Name Type Description Default
tx_query Optional[MoneroTxQuery]

Tx query to set.

required
output_query bool

If True sets outputs query in tx_query, otherwise inputs query.

required

MoneroTxWallet

Bases: MoneroTx

Models a Monero transaction in the context of a wallet.

change_address: str | None instance-attribute

Address to which the change amount of the transaction was sent.

change_amount: int | None instance-attribute

Change amount of the transaction.

extra_hex: str | None instance-attribute

Extra information about the transaction in hexadecimal format.

incoming_transfers: list[MoneroIncomingTransfer] instance-attribute

List of incoming transfer.

input_sum: int | None instance-attribute

Total input sum.

is_incoming: bool | None instance-attribute

Indicates if the transaction has incoming transfers.

is_locked: bool | None instance-attribute

Indicates if the transaction is locked.

is_outgoing: bool | None instance-attribute

Indicated if the transaction has outgoing transfer.

note: str | None instance-attribute

Transaction note.

num_dummy_outputs: int | None instance-attribute

Number of decoys of the transactions.

outgoing_transfer: MoneroOutgoingTransfer | None instance-attribute

The outgoing transfer related to this transaction.

output_sum: int | None instance-attribute

The total output amount sum originated from this transaction.

tx_set: MoneroTxSet | None instance-attribute

Set of transactions related to current tx.

__init__()

Initialize a new Monero tx wallet.

copy()

Copy current tx wallet.

Returns:

Type Description
MoneroTxWallet

tx wallet copy.

filter_outputs_wallet(query)

Get outputs filtered by query.

Parameters:

Name Type Description Default
query MoneroOutputQuery

query to filter outputs with.

required

Returns:

Type Description
list[MoneroOutputWallet]

outputs that meets all criteria defined in query.

filter_transfers(query)

Get transfers filtered by query.

Parameters:

Name Type Description Default
query MoneroTransferQuery

query to filter transfers with.

required

Returns:

Type Description
list[MoneroTransfer]

transfers that meets all criteria defined in query.

get_incoming_amount()

Get total amount received in current tx.

Returns:

Type Description
int

total amount received in current wallet tx.

get_inputs_wallet(query=None)

Get wallet inputs filtered by query.

Parameters:

Name Type Description Default
query MoneroOutputQuery

query to filter outputs with.

None

Returns:

Type Description
list[MoneroOutputWallet]

wallet outputs filtered by query.

get_outgoing_amount()

Get total amount spent in current tx.

Returns:

Type Description
int

total amount spent in current wallet tx.

MoneroTxQuery

Bases: MoneroTxWallet

Configures a query to retrieve transactions.

All transactions are returned except those that do not meet the criteria defined in this query.

has_payment_id: bool | None instance-attribute

Get transactions that have a payment id.

hashes: list[str] instance-attribute

Get transactions by hashes.

height: int | None instance-attribute

Get transactions by height.

include_outputs: int | None instance-attribute

Include outputs in transaction data.

input_query: MoneroOutputQuery | None instance-attribute

Query to apply on transaction inputs.

is_incoming: bool | None instance-attribute

Include incoming transactions.

is_outgoing: bool | None instance-attribute

Include outgoing transactions.

max_height: int | None instance-attribute

Get transactions below max height.

min_height: int | None instance-attribute

Get transactions above max height.

output_query: MoneroOutputQuery | None instance-attribute

Query to apply on transaction outputs.

payment_ids: list[str] instance-attribute

Get transactions with specific payment ids.

transfer_query: MoneroTransferQuery | None instance-attribute

Query to apply on transaction wallet transfer.

__init__()

Initiliaze a new Monero transaction query.

copy()

Copy current transaction query.

Returns:

Type Description
MoneroTxQuery

tx query copy.

deserialize_from_block(tx_query_json) staticmethod

Deserialize transaction query from JSON string.

Parameters:

Name Type Description Default
tx_query_json str

tx query as JSON string.

required

Returns:

Type Description
MoneroTxQuery

deserialized tx query.

meets_criteria(tx, query_children=False)

Check if transaction wallet meets all criteria defined in this query.

Parameters:

Name Type Description Default
tx MoneroTxWallet

Tx to check if meets criteria defined in this query.

required
query_children bool

Query child data.

False

Returns:

Type Description
bool

True if tx meets all criteria defined in this query, False otherwise.

MoneroTxSet

Bases: SerializableStruct

Groups transactions who share common hex data which is needed in order to sign and submit the transactions.

For example, multisig transactions created from create_txs() share a common hex string which is needed in order to sign and submit the multisig transactions.

multisig_tx_hex: str | None instance-attribute

Multisignature transaction hex.

signed_tx_hex: str | None instance-attribute

Signed transaction hex.

txs: list[MoneroTxWallet] instance-attribute

List of transactions defined in this set.

unsigned_tx_hex: str | None instance-attribute

Unsigned transaction hex.

__init__()

Initialize a Monero transaction set.

deserialize(tx_set_json) staticmethod

Deserialize a Monero transaction set from a JSON string.

Parameters:

Name Type Description Default
tx_set_json str

tx set as JSON string.

required

Returns:

Type Description
MoneroTxSet

The deseriliazed transaction set.

MoneroIntegratedAddress

Bases: SerializableStruct

Models a Monero integrated address.

integrated_address: str instance-attribute

The integrated address.

payment_id: str instance-attribute

The payment id related to this integrated address.

standard_address: str instance-attribute

The standard address related to this integrated address.

__init__()

Initialize a Monero integrated address.

MoneroTxPriority

Bases: IntEnum

Enumerates Monero transaction priorities.

DEFAULT = 0 class-attribute instance-attribute

0 Default transaction priority.

ELEVATED = 3 class-attribute instance-attribute

3 Elevated transaction priority.

NORMAL = 2 class-attribute instance-attribute

2 Normal transaction priority.

UNIMPORTANT = 1 class-attribute instance-attribute

1 Unimportant transaction priority.

MoneroTxConfig

Bases: SerializableStruct

Configures a transaction to send, sweep, or create a payment URI.

account_index: int | None instance-attribute

Account index to send funds from.

address: str | None instance-attribute

Transaction address destination.

amount: int | None instance-attribute

Transaction amount.

below_amount: int | None instance-attribute

Ignore output amount below.

can_split: bool | None instance-attribute

Indicates if transaction can be splitted in multiple transactions.

destinations: list[MoneroDestination] instance-attribute

Transaction outgoing destinations.

fee: int | None instance-attribute

Transaction fee.

key_image: str | None instance-attribute

Use a particular key image as input for transaction.

note: str | None instance-attribute

Transaction note.

payment_id: str | None instance-attribute

Transaction payment id.

priority: MoneroTxPriority | None instance-attribute

Transaction priority.

recipient_name: str | None instance-attribute

Recipient name.

relay: bool | None instance-attribute

Indicates if transaction should be relayed (True) or not (False).

ring_size: int | None instance-attribute

Transaction ring size

subaddress_indices: list[int] instance-attribute

Account subaddresses indices to send funds from.

subtract_fee_from: list[int] instance-attribute

Subtract fee from outputs.

sweep_each_subaddress: bool | None instance-attribute

Sweep each wallet subbaddress.

copy()

Copy current tx config.

Returns:

Type Description
MoneroTxConfig

tx config copy.

deserialize(config_json) staticmethod

Deserialize tx config from JSON string.

Parameters:

Name Type Description Default
config_json str

tx config in JSON format.

required

Returns:

Type Description
MoneroTxConfig

deserialized tx config.

get_normalized_destinations()

Get all destinations set in current tx config.

Returns:

Type Description
list[MoneroDestination]

normalized tx config destinations.

set_address(address)

Set the address of a single-destination configuration.

Parameters:

Name Type Description Default
address str

the address to set for the single destination.

required

MoneroKeyImageImportResult

Bases: SerializableStruct

Models results from importing key images.

height: int | None instance-attribute

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

spent_amount: int | None instance-attribute

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

unspent_amount: int | None instance-attribute

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

__init__()

Initialize a Monero key image import result.

MoneroMessageSignatureType

Bases: IntEnum

Enumerates the type of a Monero message signature.

SIGN_WITH_SPEND_KEY = 0 class-attribute instance-attribute

0 Indicates that the message verification was signed with the wallet private spend key_.

.. _private spend key: https://docs.getmonero.org/cryptography/asymmetric/private-key/#private-spend-key

SIGN_WITH_VIEW_KEY = 1 class-attribute instance-attribute

1 Indicates that the message verification was signed with the wallet private view key_.

.. _private view key: https://docs.getmonero.org/cryptography/asymmetric/private-key/#private-spend-key

MoneroMessageSignatureResult

Bases: SerializableStruct

Models results from message verification.

is_good: bool instance-attribute

Indicates if the message verification was successful.

is_old: bool instance-attribute

Indicates if the message verification used old monero software.

signature_type: MoneroMessageSignatureType instance-attribute

Signature type used in the message verification.

version: int instance-attribute

Message signature version.

__init__()

Initialize a Monero message signature result.

MoneroCheck

Bases: SerializableStruct

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

is_good: bool instance-attribute

Indicates if check was successfull.

__init__()

Initialize a Monero check.

MoneroCheckTx

Bases: MoneroCheck

Models the results from checking a transaction key.

in_tx_pool: bool | None instance-attribute

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

num_confirmations: int | None instance-attribute

Transaction network confirmations.

received_amount: int | None instance-attribute

Amount received in the transaction.

__init__()

Initialize a Monero transaction check.

MoneroCheckReserve

Bases: MoneroCheck

Models the results from checking a reserve proof.

total_amount: int | None instance-attribute

The reserve total amount.

unconfirmed_spent_amount: int | None instance-attribute

The reserve unconfirmed spent amount.

__init__()

Initialize a Monero reserve check.

MoneroMultisigInfo

Models information about a multisig wallet.

is_multisig: bool instance-attribute

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

is_ready: bool instance-attribute

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

num_participants: int instance-attribute

Number of participants of the multisignature wallet.

threshold: int instance-attribute

Number of participants need in order to sign a transaction.

__init__()

Initialize a Monero multisignature info.

MoneroMultisigInitResult

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: str | None instance-attribute

The multisignature wallet address.

multisig_hex: str | None instance-attribute

The multisignature hex to share with other participants.

__init__()

Initialize a Monero multisignature initializing result.

MoneroMultisigSignResult

Models the result of signing multisig tx hex.

signed_multisig_tx_hex: str | None instance-attribute

Multisig transaction in hex format.

tx_hashes: list[str] instance-attribute

List of transaction hash.

__init__()

Initialize a Monero multisignature signature result.

MoneroAddressBookEntry

Bases: SerializableStruct

Monero address book entry model.

address: str | None instance-attribute

The book entry address.

description: str | None instance-attribute

The book entry description.

index: int | None instance-attribute

The book entry index.

payment_id: str | None instance-attribute

The book entry payment id.

MoneroAddressType

Bases: IntEnum

Models a Monero public address type_.

.. _Monero public address type: https://docs.getmonero.org/public-address/

INTEGRATED_ADDRESS = 1 class-attribute instance-attribute

1 Indicates that the Monero address format is integrated_.

.. _integrated: https://docs.getmonero.org/public-address/integrated-address/

PRIMARY_ADDRESS = 0 class-attribute instance-attribute

0 Indicates that the Monero address format is standard_, also known as primary.

.. _standard: https://docs.getmonero.org/public-address/standard-address/

SUBADDRESS = 2 class-attribute instance-attribute

2 Indicates that the Monero address format is subaddress_.

.. _subaddress: https://docs.getmonero.org/public-address/subaddress/

MoneroDecodedAddress

Maintains metadata for a decoded address.

address: str instance-attribute

The decoded address.

address_type: MoneroAddressType instance-attribute

Type of the decoded address.

network_type: MoneroNetworkType instance-attribute

Network type of the decoded address.

__init__(address, address_type, network_type)

Initialize a Monero decoded address.

Parameters:

Name Type Description Default
address str

The decoded address.

required
address_type MoneroAddressType

The type of the decoded address.

required
network_type MoneroNetworkType

Network type of the decoded address.

required

MoneroAccountTag

Bases: SerializableStruct

Models a Monero account tag.

account_indices: list[int] instance-attribute

Account indices with this tag.

label: str | None instance-attribute

The account tag label.

tag: str | None instance-attribute

The account tag.

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