Transactions and Outputs¶
| Class | What it is | From |
|---|---|---|
MoneroTx | a transaction: its hash, its fee, its inputs and outputs, its block once it is in one | get_tx, get_txs, get_tx_pool |
MoneroOutput | an output of a transaction, with its tx | get_outputs |
MoneroKeyImage, MoneroKeyImageSpentStatus | the key image of a spent output, and whether it is spent, in a block or in the pool | get_key_image_spent_status |
MoneroSubmitTxResult | what the daemon said of a transaction submitted: relayed, or why not | submit_tx_hex |
MoneroTxPoolStats, MoneroTxBacklogEntry | the transactions of the pool, in numbers | get_tx_pool_stats, get_tx_pool_backlog |
MoneroFeeEstimate | the fee per byte to pay, by priority | get_fee_estimate |
MoneroOutputDistributionEntry, MoneroOutputHistogramEntry | how the outputs of the chain are distributed, by height and by amount | get_output_distribution, get_output_histogram |
MoneroTx ¶
Bases: SerializableStruct
Models a Monero transaction on the blockchain.
DEFAULT_PAYMENT_ID instance-attribute ¶
Default tx payment id
block instance-attribute ¶
Block including the transaction.
common_tx_sets instance-attribute ¶
A hexadecimal string representing a set of unsigned transactions, or a set of signing keys used in a multisig transaction.
extra instance-attribute ¶
Usually called the payment ID but can be used to include any random 32 bytes.
fee instance-attribute ¶
The amount of the mining fee included in the transaction, in atomic-units.
full_hex instance-attribute ¶
Full transaction information as a hex string.
hash instance-attribute ¶
The transaction hash.
in_tx_pool instance-attribute ¶
States if the transaction is in pool (True) or included in a block (False).
inputs instance-attribute ¶
List of inputs into transaction.
is_confirmed instance-attribute ¶
States if the transaction included in a block (True) or is in pool (False).
is_double_spend_seen instance-attribute ¶
States if the transaction is a double-spend (True) or not (False).
is_failed instance-attribute ¶
Indicates if the transaction validation has previously failed.
is_kept_by_block instance-attribute ¶
States if the transaction was included in a block at least once (True) or not (False).
is_locked instance-attribute ¶
Indicates if the transaction is locked.
is_miner_tx instance-attribute ¶
States if the transaction is a coinbase-transaction (True) or not (False).
is_relayed instance-attribute ¶
States if the transaction was relayed (True) or not (False).
key instance-attribute ¶
The transaction key.
last_failed_hash instance-attribute ¶
If the transaction validation has previously failed, this tells the previous transaction hash.
last_failed_height instance-attribute ¶
If the transaction validation has previously failed, this tells at what height that occurred.
last_relayed_timestamp instance-attribute ¶
Last unix time at which the transaction has been relayed.
max_used_block_hash instance-attribute ¶
Tells the hash of the most recent block with an output used in this transaction.
max_used_block_height instance-attribute ¶
Tells the height of the most recent block with an output used in this transaction.
metadata instance-attribute ¶
Transaction metadata.
num_confirmations instance-attribute ¶
Number of network confirmations.
output_indices instance-attribute ¶
Global (on-chain) output index of each of this transaction's outputs, in order; the indices by which the outputs are referenced as ring members.
outputs instance-attribute ¶
Transaction outputs.
payment_id instance-attribute ¶
Payment ID for this transaction.
prunable_hash instance-attribute ¶
Keccak-256 hash of the prunable portion of the block.
prunable_hex instance-attribute ¶
Prunable block encoded as a hex string.
pruned_hex instance-attribute ¶
Pruned block encoded as hex string.
rct_sig_prunable instance-attribute ¶
Prunable ring signature.
rct_signatures instance-attribute ¶
Signatures used in ring signature to hide the true origin of the transaction.
received_timestamp instance-attribute ¶
Unix time at chich the transaction has been received.
relay instance-attribute ¶
States if this transaction should be relayed (True) or not (False).
ring_size instance-attribute ¶
The ring size of this transaction.
signatures instance-attribute ¶
List of signatures used in ring signature to hide the true origin of the transaction.
size instance-attribute ¶
Backward compatibility, same as weight, use that instead.
unlock_time instance-attribute ¶
If not 0, this tells when the transaction outputs are spendable.
version instance-attribute ¶
Transaction version.
weight instance-attribute ¶
The weight of this transaction in bytes.
__init__() ¶
Initialize a new Monero transaction.
__lt__(other) ¶
Compare this tx to another by height (see TxHeightComparator).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other | MoneroTx | tx to compare against. | required |
Returns:
| Type | Description |
|---|---|
bool |
|
deserialize(json) staticmethod ¶
Deserialize a MoneroTx from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroTx in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroTx | deserialized instance. |
get_height() ¶
Get the transaction height.
Returns:
| Type | Description |
|---|---|
int | None | The height of the transaction, if known. |
MoneroOutput ¶
Bases: SerializableStruct
Models a Monero transaction output.
amount instance-attribute ¶
Output amount in atomic-units.
index instance-attribute ¶
Output index.
key_image instance-attribute ¶
The key image of the output.
mask instance-attribute ¶
The output commitment mask (pseudo-out blinding factor) as a hex string.
ring_output_indices instance-attribute ¶
Indices of ring outputs.
stealth_public_key instance-attribute ¶
The public key of the output.
tx instance-attribute ¶
The transaction related to this output.
__init__() ¶
Initialize a Monero output.
copy() ¶
deserialize(json) staticmethod ¶
Deserialize a MoneroOutput from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroOutput in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroOutput | deserialized instance. |
merge(other) ¶
Merge current output wallet with another output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other | MoneroOutput | other output to merge with. | required |
MoneroKeyImage ¶
Bases: SerializableStruct
Models a Monero key image.
hex instance-attribute ¶
The key image in hexadecimal format.
signature instance-attribute ¶
The key image signature. None if not known.
__init__() ¶
Initialize a Monero key image.
copy() ¶
deserialize(json) staticmethod ¶
Deserialize a MoneroKeyImage from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroKeyImage in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroKeyImage | deserialized instance. |
deserialize_key_images(key_images_json) staticmethod ¶
Deserialize key images from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key_images_json | str | JSON string with serialized key images. | required |
Returns:
| Type | Description |
|---|---|
list[MoneroKeyImage] | Deserialized key images. |
merge(other) ¶
Merge current key image with another one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other | MoneroKeyImage | other key image to merge with. | required |
MoneroKeyImageSpentStatus ¶
Bases: IntEnum
Enumerates the spent status of a key image.
MoneroSubmitTxResult ¶
Bases: MoneroRpcPaymentInfo
Models the result from submitting a tx to a daemon.
has_invalid_input instance-attribute ¶
Indicates if the transaction has an invalid input.
has_invalid_output instance-attribute ¶
Indicates if the transaction has an invalid output.
has_too_few_outputs instance-attribute ¶
Indicates if the transaction has too few outputs.
is_double_spend instance-attribute ¶
Indicates if the transaction is double spend.
is_fee_too_low instance-attribute ¶
Indicates if the transaction fee is too low.
is_good instance-attribute ¶
Indicates if the submission of the transaction was successful.
is_mixin_too_low instance-attribute ¶
Indicates if the transaction mixin count is too low.
is_nonzero_unlock_time instance-attribute ¶
Indicates if the transaction was rejected for carrying a non-zero per-transaction unlock time, which the daemon no longer accepts into the pool.
is_overspend instance-attribute ¶
Indicates if the transaction uses more money than available
is_relayed instance-attribute ¶
Indicates if the transaction has been relayed.
is_too_big instance-attribute ¶
Indicates if the transaction size is too big.
is_tx_extra_too_big instance-attribute ¶
Indicates if the transaction extra size is too big.
reason instance-attribute ¶
Additional information. Currently empty or Not relayed if transaction was accepted but not relayed.
sanity_check_failed instance-attribute ¶
Indicates if the transaction sanity check has failed.
__init__() ¶
Initialize a new submit transaction result.
deserialize(json) staticmethod ¶
Deserialize a MoneroSubmitTxResult from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroSubmitTxResult in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroSubmitTxResult | deserialized instance. |
MoneroTxPoolStats ¶
Bases: SerializableStruct
Models transaction pool statistics.
bytes_max instance-attribute ¶
Max transaction size in pool.
bytes_med instance-attribute ¶
Median transaction size in pool.
bytes_min instance-attribute ¶
Min transaction size in pool.
bytes_total instance-attribute ¶
Total size of all transactions in pool.
fee_total instance-attribute ¶
The sum of the fees for all transactions currently in the transaction pool atomic-units.
histo instance-attribute ¶
Txs histogram (key for bytes, value for txs).
histo98pc instance-attribute ¶
The time 98% of txes are younger than.
num10m instance-attribute ¶
Number of transactions in pool for more than 10 minutes.
num_double_spends instance-attribute ¶
Number of double spend transactions.
num_failing instance-attribute ¶
Number of failing transactions.
num_not_relayed instance-attribute ¶
Number of non-relayed transactions.
num_txs instance-attribute ¶
Total number of transactions.
oldest_timestamp instance-attribute ¶
Unix time of the oldest transaction in the pool.
__init__() ¶
Initialize a Monero transaction pool statistics.
deserialize(json) staticmethod ¶
Deserialize a MoneroTxPoolStats from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroTxPoolStats in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroTxPoolStats | deserialized instance. |
MoneroFeeEstimate ¶
Bases: SerializableStruct
Models a Monero fee estimate.
fee instance-attribute ¶
Amount of fees estimated per byte in atomic-units.
fees instance-attribute ¶
Represents the base fees at different priorities [slow, normal, fast, fastest].
quantization_mask instance-attribute ¶
Final fee should be rounded up to an even multiple of this value.
__init__() ¶
Initialize a Monero fee estimate.
deserialize(json) staticmethod ¶
Deserialize a MoneroFeeEstimate from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroFeeEstimate in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroFeeEstimate | deserialized instance. |
MoneroOutputDistributionEntry ¶
Bases: SerializableStruct
Models a Monero output distribution entry.
amount instance-attribute ¶
Output amount in atomic-units.
base instance-attribute ¶
The total number of outputs of amount in the chain before, not including, the block at start_height.
distribution instance-attribute ¶
Per-block counts of outputs of amount starting at start_height: element i is the number created in block start_height + i, or the running total up to that block when the distribution was requested as cumulative. Wallets use this to weight decoy selection by output age.
start_height instance-attribute ¶
Not necessarily equal to the start_height parameter, especially for amount = 0 where it will be no less than the height of the v4 hard fork.
__init__() ¶
Initialize a Monero output distribution entry.
deserialize(json) staticmethod ¶
Deserialize a MoneroOutputDistributionEntry from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroOutputDistributionEntry in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroOutputDistributionEntry | deserialized instance. |
MoneroOutputHistogramEntry ¶
Bases: SerializableStruct
Models a Monero output histogram entry.
amount instance-attribute ¶
Output amount in atomic-units.
num_instances instance-attribute ¶
Number of outputs.
recent_instances instance-attribute ¶
Number of recent outputs.
unlocked_instances instance-attribute ¶
Number of unlocked outputs.
__init__() ¶
Initialize a Monero output histogram entry.
deserialize(json) staticmethod ¶
Deserialize a MoneroOutputHistogramEntry from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroOutputHistogramEntry in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroOutputHistogramEntry | deserialized instance. |