Configurations and Queries¶
| Class | What it is | For |
|---|---|---|
MoneroWalletConfig | how to create or open a wallet: path, password, network, seed or keys, daemon | MoneroWalletFull.create_wallet, MoneroWalletRpc.create_wallet, the functions of MoneroWalletKeys |
MoneroTxConfig, MoneroDestination, MoneroTxPriority | a payment to make: its destinations, each an address and an amount, the account to pay from, the priority of its fee, whether to relay it | create_tx, create_txs, sweep_unlocked |
MoneroTxQuery, MoneroTransferQuery, MoneroOutputQuery | which transactions, transfers or outputs to get: each is the class that it selects, with the fields to match, and can hold the query of the others (tx_query, transfer_query, output_query) | get_txs, get_transfers, get_outputs |
MoneroMessageSignatureType | which key signs a message | sign_message |
MoneroWalletConfig ¶
Bases: SerializableStruct
Configures a wallet to create.
account_lookahead instance-attribute ¶
Account index look ahead.
is_multisig instance-attribute ¶
Indicates if the wallet is a multisignature wallet.
is_trusted_daemon instance-attribute ¶
Indicates whether the configured daemon connection should be treated as trusted.
language instance-attribute ¶
The wallet language.
network_type instance-attribute ¶
The wallet network type.
password instance-attribute ¶
The wallet password.
path instance-attribute ¶
The wallet path on file system.
primary_address instance-attribute ¶
The wallet standard address.
private_spend_key instance-attribute ¶
The wallet private spend key.
private_view_key instance-attribute ¶
The wallet private view key.
regtest instance-attribute ¶
Indicates if wallet is regtest.
restore_height instance-attribute ¶
The wallet restore height.
save_current instance-attribute ¶
Save the wallet.
seed instance-attribute ¶
The wallet mnemonic.
seed_offset instance-attribute ¶
The wallet custom seed offset.
server instance-attribute ¶
The wallet RPC connection.
subaddress_lookahead instance-attribute ¶
Subaddress index look ahead.
__init__(*args, **kwargs) ¶
__init__() -> None
__init__(config: MoneroWalletConfig) -> None
__init__(): Initialize an empty Monero wallet config.__init__(config): Initialize a Monero wallet config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config | MoneroWalletConfig | Config to copy. | required |
copy() ¶
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. |
MoneroTxConfig ¶
Bases: SerializableStruct
Configures a transaction to send, sweep, or create a payment URI.
account_index instance-attribute ¶
Account index to send funds from.
address instance-attribute ¶
Transaction address destination.
amount instance-attribute ¶
Transaction amount.
below_amount instance-attribute ¶
Ignore output amount below.
can_split instance-attribute ¶
Indicates if transaction can be split in multiple transactions.
destinations instance-attribute ¶
Transaction outgoing destinations.
fee instance-attribute ¶
Transaction fee.
key_image instance-attribute ¶
Use a particular key image as input for transaction.
note instance-attribute ¶
Transaction note.
payment_id instance-attribute ¶
Transaction payment id.
priority instance-attribute ¶
Transaction priority.
recipient_name instance-attribute ¶
Recipient name.
relay instance-attribute ¶
Indicates if transaction should be relayed (True) or not (False).
ring_size instance-attribute ¶
Transaction ring size
subaddress_indices instance-attribute ¶
Account subaddresses indices to send funds from.
subtract_fee_from instance-attribute ¶
Subtract fee from outputs.
sweep_each_subaddress instance-attribute ¶
Sweep each wallet subbaddress.
__init__(*args, **kwargs) ¶
__init__() -> None
__init__(config: MoneroTxConfig) -> None
Initialize a new tx config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config | MoneroTxConfig | tx config to copy. | required |
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 |
MoneroDestination ¶
Bases: SerializableStruct
Models an outgoing transfer destination.
address instance-attribute ¶
Address of the receiver.
amount instance-attribute ¶
Amount sent to this destination.
__init__(*args, **kwargs) ¶
__init__() -> None
__init__(address: str) -> None
__init__(address: str, amount: int) -> None
Initialize a Monero outgoing transfer destination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address | str | Address of the destination. | required |
amount | int | Amount sent to the destination. | required |
copy() ¶
Copy current outgoing transfer destination.
Returns:
| Type | Description |
|---|---|
MoneroDestination | outgoing transfer destination copy. |
deserialize(json) staticmethod ¶
Deserialize a MoneroDestination from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroDestination in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroDestination | deserialized instance. |
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.
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 instance-attribute ¶
Get transactions that have a payment id.
hashes instance-attribute ¶
Get transactions by hashes.
height instance-attribute ¶
Get transactions by height.
include_outputs instance-attribute ¶
Include outputs in transaction data.
input_query instance-attribute ¶
Query to apply on transaction inputs.
is_incoming instance-attribute ¶
Include incoming transactions.
is_outgoing instance-attribute ¶
Include outgoing transactions.
max_height instance-attribute ¶
Get transactions below max height.
min_height instance-attribute ¶
Get transactions above max height.
output_query instance-attribute ¶
Query to apply on transaction outputs.
payment_ids instance-attribute ¶
Get transactions with specific payment ids.
transfer_query instance-attribute ¶
Query to apply on transaction wallet transfer.
__init__() ¶
Initialize a new Monero transaction query.
copy() ¶
decontextualize(query) staticmethod ¶
Remove query criteria which require looking up other transfers/outputs to fulfill the query.
Clears is_incoming, is_outgoing, transfer_query, input_query and output_query. Mutates query in place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query | MoneroTxQuery | the query to decontextualize. | required |
Returns:
| Type | Description |
|---|---|
MoneroTxQuery | a reference to |
deserialize(json) staticmethod ¶
Deserialize a MoneroTxQuery from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroTxQuery in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroTxQuery | deserialized instance. |
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=True) ¶
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. | True |
Returns:
| Type | Description |
|---|---|
bool |
|
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 instance-attribute ¶
Select transfers involving particular address. Empty for all.
addresses instance-attribute ¶
Select transfers involving particular addresses. Empty for all.
destinations instance-attribute ¶
Select transfers involving particular destinations. Empty for all.
has_destinations instance-attribute ¶
Filter transfers with or without destinations. None for all.
incoming instance-attribute ¶
Filter incoming or outgoing transfers. None for all.
outgoing instance-attribute ¶
Filter incoming or outgoing transfers. None for all.
subaddress_index instance-attribute ¶
Filter by subaddress index. None for all.
subaddress_indices instance-attribute ¶
Select transfers involving particular subaddresses. Empty for all.
tx_query instance-attribute ¶
Related transaction query.
__init__() ¶
Initialize a Monero transfer query.
copy() ¶
deserialize(json) staticmethod ¶
Deserialize a MoneroTransferQuery from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroTransferQuery in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroTransferQuery | deserialized instance. |
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 |
Returns:
| Type | Description |
|---|---|
bool |
|
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 instance-attribute ¶
Filter outputs above this amount.
min_amount instance-attribute ¶
Filter outputs below this amount.
subaddress_indices instance-attribute ¶
Subadress indices to select (empty for all).
tx_query property ¶
Related transaction query.
__init__() ¶
Initialize a Monero output query.
copy() ¶
deserialize(json) staticmethod ¶
Deserialize a MoneroOutputQuery from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroOutputQuery in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroOutputQuery | deserialized instance. |
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 |
|
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 | required |
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.
SIGN_WITH_VIEW_KEY = 1 class-attribute instance-attribute ¶
1 Indicates that the message verification was signed with the wallet private view key.