Skip to content

Transactions, Transfers and Outputs

Class What it is From
MoneroTxWallet a transaction of the wallet: its incoming_transfers, its outgoing_transfer, its outputs, and its tx_set when it is not signed or relayed get_txs, create_tx
MoneroTransfer, MoneroIncomingTransfer, MoneroOutgoingTransfer what a transaction moved for the wallet: in, to a subaddress, or out, from an account to its destinations; each has its tx get_transfers, get_incoming_transfers, get_outgoing_transfers
MoneroOutputWallet an output of the wallet: its amount, whether it is spent or frozen, its account and subaddress get_outputs
MoneroTxSet transactions to sign or to submit elsewhere: unsigned, signed, or of a multisig wallet describe_tx_set, sign_txs

A transaction links to its transfers and outputs, and they link back to it: one query returns the graph, from any of its ends.

MoneroTxWallet

Bases: MoneroTx

Models a Monero transaction in the context of a wallet.

change_address instance-attribute

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

change_amount instance-attribute

Change amount of the transaction.

extra_hex instance-attribute

Extra information about the transaction in hexadecimal format.

incoming_transfers instance-attribute

List of incoming transfer.

input_sum instance-attribute

Total input sum.

is_incoming instance-attribute

Indicates if the transaction has incoming transfers.

is_outgoing instance-attribute

Indicated if the transaction has outgoing transfer.

note instance-attribute

Transaction note.

num_dummy_outputs instance-attribute

Number of decoys of the transactions.

outgoing_transfer instance-attribute

The outgoing transfer related to this transaction.

output_sum instance-attribute

The total output amount sum originated from this transaction.

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

deserialize(json) staticmethod

Deserialize a MoneroTxWallet from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroTxWallet in JSON format.

required

Returns:

Type Description
MoneroTxWallet

deserialized instance.

filter_inputs_wallet(query)

Filter this tx's inputs in place, keeping only those that meet the query.

Parameters:

Name Type Description Default
query MoneroOutputQuery

query to filter inputs with.

required

Returns:

Type Description
list[MoneroOutputWallet]

inputs that meet all criteria defined in query.

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(*args, **kwargs)

get_inputs_wallet() -> list[MoneroOutputWallet]
get_inputs_wallet(
    query: MoneroOutputQuery,
) -> list[MoneroOutputWallet]
  • get_inputs_wallet(): Get wallet inputs from current wallet tx.
  • get_inputs_wallet(query): Get wallet inputs filtered by query.

Parameters:

Name Type Description Default
query MoneroOutputQuery

query to filter inputs with.

required

Returns:

Type Description
list[MoneroOutputWallet]

wallet inputs defined in current tx.

get_outgoing_amount()

Get total amount spent in current tx.

Returns:

Type Description
int

total amount spent in current wallet tx.

get_outputs_wallet(*args, **kwargs)

get_outputs_wallet() -> list[MoneroOutputWallet]
get_outputs_wallet(
    query: MoneroOutputQuery,
) -> list[MoneroOutputWallet]
  • get_outputs_wallet(): Get wallet outputs from current wallet tx.
  • get_outputs_wallet(query): Get wallet outputs filtered by query.

Parameters:

Name Type Description Default
query MoneroOutputQuery

query to filter outputs with.

required

Returns:

Type Description
list[MoneroOutputWallet]

wallet outputs defined in current tx.

get_transfers(*args, **kwargs)

get_transfers() -> list[MoneroTransfer]
get_transfers(
    query: MoneroTransferQuery,
) -> list[MoneroTransfer]
  • get_transfers(): Get all transfers defined in current wallet tx.
  • get_transfers(query): Get wallet transfers filtered by query.

Parameters:

Name Type Description Default
query MoneroTransferQuery

query to filter transfers with.

required

Returns:

Type Description
list[MoneroTransfer]

transfers from tx.

merge(*args, **kwargs)

merge(tgt: MoneroTxWallet) -> None
merge(tgt: MoneroTx) -> None
  • merge(tgt): Merge current wallet tx with another one.
  • merge(tgt): Merge current wallet tx with another tx.

Parameters:

Name Type Description Default
tgt MoneroTxWallet

another wallet tx to merge with.

required

MoneroTransfer

Bases: SerializableStruct

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

account_index instance-attribute

Index of the account related to this transfer.

amount instance-attribute

Transfer amount in atomic-units.

tx 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 unknown.

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

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 instance-attribute

The address that received funds within this transfer.

num_suggested_confirmations instance-attribute

The number of suggested confirmations before moving funds.

subaddress_index instance-attribute

The subaddress index that received funds within this transfer.

__init__()

Initialize a Monero incoming transfer.

__lt__(other)

Compare this incoming transfer to another by ascending tx height, then account index, then subaddress index (see IncomingTransferComparator).

Parameters:

Name Type Description Default
other MoneroIncomingTransfer

transfer to compare against.

required

Returns:

Type Description
bool

True if this transfer sorts before other.

copy()

Copy current incoming transfer.

Returns:

Type Description
MoneroIncomingTransfer

incoming transfer copy.

deserialize(json) staticmethod

Deserialize a MoneroIncomingTransfer from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroIncomingTransfer in JSON format.

required

Returns:

Type Description
MoneroIncomingTransfer

deserialized instance.

merge(*args, **kwargs)

merge(other: MoneroIncomingTransfer) -> None
merge(other: MoneroTransfer) -> None
  • merge(other): Merge current incoming transfer with another one.
  • merge(other): Merge current incoming transfer with another transfer.

Parameters:

Name Type Description Default
other MoneroIncomingTransfer

other incoming transfer to merge with.

required

MoneroOutgoingTransfer

Bases: MoneroTransfer

Models an outgoing transfer of funds from the wallet.

addresses instance-attribute

Addresses from which the transfer originated.

destinations instance-attribute

Outgoing transfer destinations.

subaddress_indices instance-attribute

Subaddresses from which the transfer originated.

__init__()

Initialize a Monero outgoing transfer.

copy()

Copy current outgoing transfer.

Returns:

Type Description
MoneroOutgoingTransfer

outgoing transfer copy.

deserialize(json) staticmethod

Deserialize a MoneroOutgoingTransfer from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroOutgoingTransfer in JSON format.

required

Returns:

Type Description
MoneroOutgoingTransfer

deserialized instance.

merge(*args, **kwargs)

merge(other: MoneroOutgoingTransfer) -> None
merge(other: MoneroTransfer) -> None
  • merge(other): Merge current outgoing transfer with another one.
  • merge(other): Merge current outgoing transfer with another transfer.

Parameters:

Name Type Description Default
other MoneroOutgoingTransfer

other outgoing transfer to merge with.

required

MoneroOutputWallet

Bases: MoneroOutput

Models a Monero output with wallet extensions.

account_index instance-attribute

The index of the account that owns this output.

is_frozen instance-attribute

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

is_spent instance-attribute

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

subaddress_index instance-attribute

The index of the subaddress that owns this output.

__init__()

Initialize a Monero wallet output.

__lt__(other)

Compare this output to another by ascending tx height, then account index, subaddress index, output index and key image hex (see OutputComparator).

Parameters:

Name Type Description Default
other MoneroOutputWallet

output to compare against.

required

Returns:

Type Description
bool

True if this output sorts before other.

copy()

Copy current output wallet.

Returns:

Type Description
MoneroOutputWallet

output wallet copy.

deserialize(json) staticmethod

Deserialize a MoneroOutputWallet from a JSON string.

Parameters:

Name Type Description Default
json str

MoneroOutputWallet in JSON format.

required

Returns:

Type Description
MoneroOutputWallet

deserialized instance.

merge(*args, **kwargs)

merge(other: MoneroOutputWallet) -> None
merge(other: MoneroOutput) -> None
  • merge(other): Merge current output wallet with another one.
  • merge(other): Merge current output wallet with another output.

Parameters:

Name Type Description Default
other MoneroOutputWallet

other output wallet to merge with.

required

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 instance-attribute

Serialized multisig transaction data produced when a multisig wallet creates transactions; passed to the other cosigners' MoneroWallet.sign_multisig_tx_hex() and finally to submit_multisig_tx_hex() once enough signatures are collected.

signed_tx_hex instance-attribute

Serialized fully-signed transaction data returned by MoneroWallet.sign_txs() on the offline spend wallet; pass it to submit_txs() on an online wallet to broadcast.

txs instance-attribute

The structured transactions in this set (populated when the set is created locally or by describe_tx_set()).

unsigned_tx_hex instance-attribute

Serialized unsigned transaction data produced by a view-only wallet's create_tx() / create_txs(); transfer it to the offline spend wallet and call MoneroWallet.sign_txs().

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