XRPL Transaction Models¶
Use these models to prepare or process XRP Ledger transactions.
Base Transaction Model¶
- class xrpl.models.transactions.transaction.Transaction(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
BaseModel
The base class for all transaction types. Represents fields common to all transaction types.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType | PseudoTransactionType = <object object>¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
Specific Transaction Types¶
Model objects for specific types of Transactions in the XRP Ledger.
- class xrpl.models.transactions.AMMBid(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Bid on an Automated Market Maker’s (AMM’s) auction slot.
If you win, you can trade against the AMM at a discounted fee until you are outbid or 24 hours have passed. If you are outbid before 24 hours have passed, you are refunded part of the cost of your bid based on how much time remains. You bid using the AMM’s LP Tokens; the amount of a winning bid is returned to the AMM, decreasing the outstanding balance of LP Tokens.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- asset: Currency = <object object>¶
The definition for one of the assets in the AMM’s pool. This field is required.
- asset2: Currency = <object object>¶
The definition for the other asset in the AMM’s pool. This field is required.
- auth_accounts: List[AuthAccount] | None = None¶
A list of up to 4 additional accounts that you allow to trade at the discounted fee. This cannot include the address of the transaction sender.
- bid_max: IssuedCurrencyAmount | None = None¶
Pay at most this LPToken amount for the slot. If the cost to win the bid is higher than this amount, the transaction fails. If omitted, pay as much as necessary to win the bid.
- bid_min: IssuedCurrencyAmount | None = None¶
Pay at least this LPToken amount for the slot. Setting this value higher makes it harder for others to outbid you. If omitted, pay the minimum necessary to win the bid.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'AMMBid'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AMMCreate(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Create a new Automated Market Maker (AMM) instance for trading a pair of assets (fungible tokens or XRP).
Creates both an AMM object and a special AccountRoot object to represent the AMM. Also transfers ownership of the starting balance of both assets from the sender to the created AccountRoot and issues an initial balance of liquidity provider tokens (LP Tokens) from the AMM account to the sender.
Caution: When you create the AMM, you should fund it with (approximately) equal-value amounts of each asset. Otherwise, other users can profit at your expense by trading with this AMM (performing arbitrage). The currency risk that liquidity providers take on increases with the volatility (potential for imbalance) of the asset pair. The higher the trading fee, the more it offsets this risk, so it’s best to set the trading fee based on the volatility of the asset pair.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- amount: Amount = <object object>¶
The first of the two assets to fund this AMM with. This must be a positive amount. This field is required.
- amount2: Amount = <object object>¶
The second of the two assets to fund this AMM with. This must be a positive amount. This field is required.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- trading_fee: int = <object object>¶
The fee to charge for trades against this AMM instance, in units of 1/100,000; a value of 1 is equivalent to 0.001%. The maximum value is 1000, indicating a 1% fee. The minimum value is 0.
- transaction_type: TransactionType = 'AMMCreate'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AMMDelete(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Delete an empty Automated Market Maker (AMM) instance that could not be fully deleted automatically.
Tip: The AMMWithdraw transaction automatically tries to delete an AMM, along with associated ledger entries such as empty trust lines, if it withdrew all the assets from the AMM’s pool. However, if there are too many trust lines to the AMM account to remove in one transaction, it may stop before fully removing the AMM. Similarly, an AMMDelete transaction removes up to a maximum number of trust lines; in extreme cases, it may take several AMMDelete transactions to fully delete the trust lines and the associated AMM. In all cases, the AMM ledger entry and AMM account are deleted by the last such transaction.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- asset: Currency = <object object>¶
The definition for one of the assets in the AMM’s pool. This field is required.
- asset2: Currency = <object object>¶
The definition for the other asset in the AMM’s pool. This field is required.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'AMMDelete'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AMMDeposit(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Deposit funds into an Automated Market Maker (AMM) instance and receive the AMM’s liquidity provider tokens (LP Tokens) in exchange.
You can deposit one or both of the assets in the AMM’s pool. If successful, this transaction creates a trust line to the AMM Account (limit 0) to hold the LP Tokens.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- amount: Amount | None = None¶
The amount of one asset to deposit to the AMM. If present, this must match the type of one of the assets (tokens or XRP) in the AMM’s pool.
- amount2: Amount | None = None¶
The amount of another asset to add to the AMM. If present, this must match the type of the other asset in the AMM’s pool and cannot be the same asset as Amount.
- asset: Currency = <object object>¶
The definition for one of the assets in the AMM’s pool. This field is required.
- asset2: Currency = <object object>¶
The definition for the other asset in the AMM’s pool. This field is required.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- e_price: Amount | None = None¶
The maximum effective price, in the deposit asset, to pay for each LP Token received.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- lp_token_out: IssuedCurrencyAmount | None = None¶
How many of the AMM’s LP Tokens to buy.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'AMMDeposit'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AMMDepositFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
int
,Enum
Transactions of the AMMDeposit type support additional values in the Flags field. This enum represents those options.
- TF_LIMIT_LP_TOKEN = 4194304¶
- TF_LP_TOKEN = 65536¶
- TF_ONE_ASSET_LP_TOKEN = 2097152¶
- TF_SINGLE_ASSET = 524288¶
- TF_TWO_ASSET = 1048576¶
- as_integer_ratio()¶
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()¶
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()¶
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()¶
Returns self, the complex conjugate of any int.
- denominator¶
the denominator of a rational number in lowest terms
- from_bytes(byteorder='big', *, signed=False)¶
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag¶
the imaginary part of a complex number
- numerator¶
the numerator of a rational number in lowest terms
- real¶
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)¶
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class xrpl.models.transactions.AMMDepositFlagInterface¶
Bases:
FlagInterface
Transactions of the AMMDeposit type support additional values in the Flags field. This TypedDict represents those options.
- TF_LIMIT_LP_TOKEN: bool¶
- TF_LP_TOKEN: bool¶
- TF_ONE_ASSET_LP_TOKEN: bool¶
- TF_SINGLE_ASSET: bool¶
- TF_TWO_ASSET: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.AMMVote(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Vote on the trading fee for an Automated Market Maker (AMM) instance.
Up to 8 accounts can vote in proportion to the amount of the AMM’s LP Tokens they hold. Each new vote re-calculates the AMM’s trading fee based on a weighted average of the votes.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- asset: Currency = <object object>¶
The definition for one of the assets in the AMM’s pool. This field is required.
- asset2: Currency = <object object>¶
The definition for the other asset in the AMM’s pool. This field is required.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- trading_fee: int = <object object>¶
The proposed fee to vote for, in units of 1/100,000; a value of 1 is equivalent to 0.001%. The maximum value is 1000, indicating a 1% fee. This field is required.
- transaction_type: TransactionType = 'AMMVote'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AMMWithdraw(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Withdraw assets from an Automated Market Maker (AMM) instance by returning the AMM’s liquidity provider tokens (LP Tokens).
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- amount: Amount | None = None¶
The amount of one asset to withdraw from the AMM. This must match the type of one of the assets (tokens or XRP) in the AMM’s pool.
- amount2: Amount | None = None¶
The amount of another asset to withdraw from the AMM. If present, this must match the type of the other asset in the AMM’s pool and cannot be the same type as Amount.
- asset: Currency = <object object>¶
The definition for one of the assets in the AMM’s pool. This field is required.
- asset2: Currency = <object object>¶
The definition for the other asset in the AMM’s pool. This field is required.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- e_price: Amount | None = None¶
The minimum effective price, in LP Token returned, to pay per unit of the asset to withdraw.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- lp_token_in: IssuedCurrencyAmount | None = None¶
How many of the AMM’s LP Tokens to redeem.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'AMMWithdraw'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AMMWithdrawFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
int
,Enum
Transactions of the AMMWithdraw type support additional values in the Flags field. This enum represents those options.
- TF_LIMIT_LP_TOKEN = 4194304¶
- TF_LP_TOKEN = 65536¶
- TF_ONE_ASSET_LP_TOKEN = 2097152¶
- TF_ONE_ASSET_WITHDRAW_ALL = 262144¶
- TF_SINGLE_ASSET = 524288¶
- TF_TWO_ASSET = 1048576¶
- TF_WITHDRAW_ALL = 131072¶
- as_integer_ratio()¶
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()¶
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()¶
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()¶
Returns self, the complex conjugate of any int.
- denominator¶
the denominator of a rational number in lowest terms
- from_bytes(byteorder='big', *, signed=False)¶
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag¶
the imaginary part of a complex number
- numerator¶
the numerator of a rational number in lowest terms
- real¶
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)¶
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class xrpl.models.transactions.AMMWithdrawFlagInterface¶
Bases:
FlagInterface
Transactions of the AMMWithdraw type support additional values in the Flags field. This TypedDict represents those options.
- TF_LIMIT_LP_TOKEN: bool¶
- TF_LP_TOKEN: bool¶
- TF_ONE_ASSET_LP_TOKEN: bool¶
- TF_ONE_ASSET_WITHDRAW_ALL: bool¶
- TF_SINGLE_ASSET: bool¶
- TF_TWO_ASSET: bool¶
- TF_WITHDRAW_ALL: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.AccountDelete(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an AccountDelete transaction, which deletes an account and any objects it owns in the XRP Ledger, if possible, sending the account’s remaining XRP to a specified destination account.
See Deletion of Accounts for the requirements to delete an account.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- destination: str¶
The address of the account to which to send any remaining XRP. This field is required.
- destination_tag: int | None = None¶
The destination tag at the
destination
account where funds should be sent.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'AccountDelete'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AccountSet(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an AccountSet transaction, which modifies the properties of an account in the XRP Ledger.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- clear_flag: AccountSetAsfFlag | None = None¶
Disable a specific AccountSet Flag
- domain: str | None = None¶
Set the DNS domain of the account owner. Must be hex-encoded. You can use xrpl.utils.str_to_hex to convert a UTF-8 string to hex.
- email_hash: str | None = None¶
Set the MD5 Hash to be used for generating an avatar image for this account.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- message_key: str | None = None¶
Set a public key for sending encrypted messages to this account.
- network_id: int | None = None¶
The network id of the transaction.
- nftoken_minter: str | None = None¶
Sets an alternate account that is allowed to mint NFTokens on this account’s behalf using NFTokenMint’s Issuer field. If set, you must also set the AccountSetAsfFlag.ASF_AUTHORIZED_NFTOKEN_MINTER flag.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- set_flag: AccountSetAsfFlag | None = None¶
Enable a specific AccountSet Flag
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- tick_size: int | None = None¶
Set the tick size to use when trading tokens issued by this account in the decentralized exchange. See Tick Size for details.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'AccountSet'¶
- transfer_rate: int | None = None¶
Set the transfer fee to use for tokens issued by this account. See TransferRate for details.
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AccountSetAsfFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
int
,Enum
Enum for AccountSet Flags.
There are several options which can be either enabled or disabled for an account. Account options are represented by different types of flags depending on the situation. The AccountSet transaction type has several “AccountSet Flags” (prefixed asf) that can enable an option when passed as the SetFlag parameter, or disable an option when passed as the ClearFlag parameter. This enum represents those options.
- ASF_ACCOUNT_TXN_ID = 5¶
Track the ID of this account’s most recent transaction. Required for AccountTxnID
- ASF_ALLOW_TRUSTLINE_CLAWBACK = 16¶
Allow trustline clawback feature
- ASF_AUTHORIZED_NFTOKEN_MINTER = 10¶
Allow another account to mint and burn tokens on behalf of this account.
- ASF_DEPOSIT_AUTH = 9¶
Enable Deposit Authorization on this account.
- ASF_DISABLE_INCOMING_CHECK = 13¶
Disallow other accounts from creating Checks directed at this account.
- ASF_DISABLE_INCOMING_NFTOKEN_OFFER = 12¶
Disallow other accounts from creating NFTokenOffers directed at this account.
- ASF_DISABLE_INCOMING_PAYCHAN = 14¶
Disallow other accounts from creating PayChannels directed at this account.
- ASF_DISABLE_INCOMING_TRUSTLINE = 15¶
Disallow other accounts from creating Trustlines directed at this account.
- ASF_DISABLE_MASTER = 4¶
Disallow use of the master key pair. Can only be enabled if the account has configured another way to sign transactions, such as a Regular Key or a Signer List.
- ASF_DISALLOW_XRP = 3¶
XRP should not be sent to this account. (Enforced by client applications)
- ASF_NO_FREEZE = 6¶
Permanently give up the ability to freeze individual trust lines or disable Global Freeze. This flag can never be disabled after being enabled.
- ASF_REQUIRE_AUTH = 2¶
Require authorization for users to hold balances issued by this address. Can only be enabled if the address has no trust lines connected to it.
- ASF_REQUIRE_DEST = 1¶
Require a destination tag to send transactions to this account.
- as_integer_ratio()¶
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()¶
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()¶
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()¶
Returns self, the complex conjugate of any int.
- denominator¶
the denominator of a rational number in lowest terms
- from_bytes(byteorder='big', *, signed=False)¶
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag¶
the imaginary part of a complex number
- numerator¶
the numerator of a rational number in lowest terms
- real¶
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)¶
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class xrpl.models.transactions.AccountSetFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
int
,Enum
Enum for AccountSet Transaction Flags.
Transactions of the AccountSet type support additional values in the Flags field. This enum represents those options.
- TF_ALLOW_XRP = 2097152¶
asfDisallowXRP.
- Type:
The same as ClearFlag
- TF_DISALLOW_XRP = 1048576¶
asfDisallowXRP.
- Type:
The same as SetFlag
- TF_OPTIONAL_AUTH = 524288¶
asfRequireAuth.
- Type:
The same as ClearFlag
- TF_OPTIONAL_DEST_TAG = 131072¶
asfRequireDest.
- Type:
The same as ClearFlag
- TF_REQUIRE_AUTH = 262144¶
asfRequireAuth.
- Type:
The same as SetFlag
- TF_REQUIRE_DEST_TAG = 65536¶
asfRequireDest.
- Type:
The same as SetFlag
- as_integer_ratio()¶
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()¶
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()¶
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()¶
Returns self, the complex conjugate of any int.
- denominator¶
the denominator of a rational number in lowest terms
- from_bytes(byteorder='big', *, signed=False)¶
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag¶
the imaginary part of a complex number
- numerator¶
the numerator of a rational number in lowest terms
- real¶
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)¶
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class xrpl.models.transactions.AccountSetFlagInterface¶
Bases:
FlagInterface
Transactions of the AccountSet type support additional values in the Flags field. This TypedDict represents those options.
- TF_ALLOW_XRP: bool¶
- TF_DISALLOW_XRP: bool¶
- TF_OPTIONAL_AUTH: bool¶
- TF_OPTIONAL_DEST_TAG: bool¶
- TF_REQUIRE_AUTH: bool¶
- TF_REQUIRE_DEST_TAG: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.AuthAccount(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
NestedModel
Represents one entry in a list of AuthAccounts used in AMMBid transaction.
- account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) NM ¶
Construct a new NestedModel from a dictionary of parameters.
- Parameters:
value – The value to construct the NestedModel from.
- Returns:
A new NestedModel object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Returns True if the input dictionary was derived by the to_dict method of an instance of this class. In other words, True if this is a dictionary representation of an instance of this class.
NOTE: does not account for model inheritance, IE will only return True if dictionary represents an instance of this class, but not if dictionary represents an instance of a subclass of this class.
- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a dict representation of an instance of this class.
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a NestedModel.
- Returns:
The dictionary representation of a NestedModel.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.CheckCancel(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a CheckCancel transaction, which cancels an unredeemed Check, removing it from the ledger without sending any money. The source or the destination of the check can cancel a Check at any time using this transaction type. If the Check has expired, any address can cancel it.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- check_id: str¶
The ID of the Check ledger object to cancel, as a 64-character hexadecimal string. This field is required.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'CheckCancel'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.CheckCash(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a CheckCash transaction, which redeems a Check object to receive up to the amount authorized by the corresponding CheckCreate transaction. Only the Destination address of a Check can cash it.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- amount: Amount | None = None¶
Redeem the Check for exactly this amount, if possible. The currency must match that of the SendMax of the corresponding CheckCreate transaction. You must provide either this field or
DeliverMin
.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- check_id: str¶
The ID of the Check ledger object to cash, as a 64-character hexadecimal string. This field is required.
- deliver_min: Amount | None = None¶
Redeem the Check for at least this amount and for as much as possible. The currency must match that of the
SendMax
of the corresponding CheckCreate transaction. You must provide either this field orAmount
.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'CheckCash'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.CheckCreate(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a CheckCreate transaction, which creates a Check object. A Check object is a deferred payment that can be cashed by its intended destination. The sender of this transaction is the sender of the Check.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- destination_tag: int | None = None¶
An arbitrary destination tag that identifies the reason for the Check, or a hosted recipient to pay.
- expiration: int | None = None¶
Time after which the Check is no longer valid, in seconds since the Ripple Epoch.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- invoice_id: str | None = None¶
Arbitrary 256-bit hash representing a specific reason or identifier for this Check.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- send_max: IssuedCurrencyAmount | str¶
Maximum amount of source token the Check is allowed to debit the sender, including transfer fees on non-XRP tokens. The Check can only credit the destination with the same token (from the same issuer, for non-XRP tokens). This field is required.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'CheckCreate'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.Clawback(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The clawback transaction claws back issued funds from token holders.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- amount: IssuedCurrencyAmount¶
The amount of currency to claw back. The issuer field is used for the token holder’s address, from whom the tokens will be clawed back.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'Clawback'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.DepositPreauth(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a DepositPreauth transaction, which gives another account pre-approval to deliver payments to the sender of this transaction, if this account is using Deposit Authorization.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- authorize: str | None = None¶
Grant preauthorization to this address. You must provide this OR
unauthorize
but not both.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'DepositPreauth'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- unauthorize: str | None = None¶
Revoke preauthorization from this address. You must provide this OR
authorize
but not both.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.EscrowCancel(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an EscrowCancel transaction, which returns escrowed XRP to the sender after the Escrow has expired.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- offer_sequence: int¶
Transaction sequence (or Ticket number) of the EscrowCreate transaction that created the Escrow. This field is required.
- owner: str¶
The address of the account that funded the Escrow. This field is required.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'EscrowCancel'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.EscrowCreate(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an EscrowCreate transaction, which locks up XRP until a specific time or condition is met.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- amount: Amount¶
Amount of XRP, in drops, to deduct from the sender’s balance and set aside in escrow. This field is required.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- cancel_after: int | None = None¶
The time, in seconds since the Ripple Epoch, when this escrow expires. This value is immutable; the funds can only be returned the sender after this time.
- condition: str | None = None¶
Hex value representing a PREIMAGE-SHA-256 crypto-condition The funds can only be delivered to the recipient if this condition is fulfilled.
- destination: str¶
The address that should receive the escrowed XRP when the time or condition is met. This field is required.
- destination_tag: int | None = None¶
An arbitrary destination tag that identifies the reason for the Escrow, or a hosted recipient to pay.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- finish_after: int | None = None¶
The time, in seconds since the Ripple Epoch, when the escrowed XRP can be released to the recipient. This value is immutable; the funds cannot move until this time is reached.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'EscrowCreate'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.EscrowFinish(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an EscrowFinish transaction, delivers XRP from a held payment to the recipient.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- condition: str | None = None¶
The previously-supplied PREIMAGE-SHA-256 crypto-condition of the Escrow, if any, as hexadecimal.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- fulfillment: str | None = None¶
The PREIMAGE-SHA-256 crypto-condition fulfillment matching the Escrow’s condition, if any, as hexadecimal.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- offer_sequence: int¶
Transaction sequence (or Ticket number) of the EscrowCreate transaction that created the Escrow. This field is required.
- owner: str¶
The source account that funded the Escrow. This field is required.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'EscrowFinish'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.Memo(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
NestedModel
An arbitrary piece of data attached to a transaction. A transaction can have multiple Memo objects as an array in the Memos field. Must contain one or more of
memo_data
,memo_format
, andmemo_type
.- classmethod from_dict(value: Dict[str, Any]) NM ¶
Construct a new NestedModel from a dictionary of parameters.
- Parameters:
value – The value to construct the NestedModel from.
- Returns:
A new NestedModel object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Returns True if the input dictionary was derived by the to_dict method of an instance of this class. In other words, True if this is a dictionary representation of an instance of this class.
NOTE: does not account for model inheritance, IE will only return True if dictionary represents an instance of this class, but not if dictionary represents an instance of a subclass of this class.
- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a dict representation of an instance of this class.
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- memo_data: str | None = None¶
The data of the memo, as a hexadecimal string.
- memo_format: str | None = None¶
The format of the memo, as a hexadecimal string. Conventionally, this should be the MIME type of the memo data.
- memo_type: str | None = None¶
The type of the memo, as a hexadecimal string. Conventionally, this should be an RFC 5988 relation defining the format of the memo data.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a NestedModel.
- Returns:
The dictionary representation of a NestedModel.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenAcceptOffer(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenOfferAccept transaction is used to accept offers to buy or sell an NFToken. It can either:
Allow one offer to be accepted. This is called direct mode.
Allow two distinct offers, one offering to buy a given NFToken and the other offering to sell the same NFToken, to be accepted in an atomic fashion. This is called brokered mode.
To indicate direct mode, use either the nftoken_sell_offer or nftoken_buy_offer fields, but not both. To indicate brokered mode, use both the nftoken_sell_offer and nftoken_buy_offer fields. If you use neither nftoken_sell_offer nor nftoken_buy_offer, the transaction is invalid.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- nftoken_broker_fee: Amount | None = None¶
This field is only valid in brokered mode. It specifies the amount that the broker will keep as part of their fee for bringing the two offers together; the remaining amount will be sent to the seller of the NFToken being bought. If specified, the fee must be such that, prior to accounting for the transfer fee charged by the issuer, the amount that the seller would receive is at least as much as the amount indicated in the sell offer.
This functionality is intended to allow the owner of an NFToken to offer their token for sale to a third party broker, who may then attempt to sell the NFToken on for a larger amount, without the broker having to own the NFToken or custody funds.
Note: in brokered mode, the offers referenced by NFTokenBuyOffer and NFTokenSellOffer must both specify the same TokenID; that is, both must be for the same NFToken.
- nftoken_buy_offer: str | None = None¶
Identifies the NFTokenOffer that offers to buy the NFToken.
In direct mode this field is optional, but either NFTokenSellOffer or NFTokenBuyOffer must be specified. In brokered mode, both NFTokenSellOffer and NFTokenBuyOffer must be specified.
- nftoken_sell_offer: str | None = None¶
Identifies the NFTokenOffer that offers to sell the NFToken.
In direct mode this field is optional, but either NFTokenSellOffer or NFTokenBuyOffer must be specified. In brokered mode, both NFTokenSellOffer and NFTokenBuyOffer must be specified.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'NFTokenAcceptOffer'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenBurn(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenBurn transaction is used to remove an NFToken object from the NFTokenPage in which it is being held, effectively removing the token from the ledger (“burning” it).
If this operation succeeds, the corresponding NFToken is removed. If this operation empties the NFTokenPage holding the NFToken or results in the consolidation, thus removing an NFTokenPage, the owner’s reserve requirement is reduced by one.
- account: str¶
Identifies the AccountID that submitted this transaction. The account must be the present owner of the token or, if the lsfBurnable flag is set on the NFToken, either the issuer account or an account authorized by the issuer (i.e. MintAccount). This field is required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- nftoken_id: str¶
Identifies the NFToken to be burned. This field is required.
- owner: str | None = None¶
Indicates which account currently owns the token if it is different than Account. Only used to burn tokens which have the lsfBurnable flag enabled and are not owned by the signing account.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'NFTokenBurn'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenCancelOffer(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenCancelOffer transaction deletes existing NFTokenOffer objects. It is useful if you want to free up space on your account to lower your reserve requirement.
The transaction can be executed by the account that originally created the NFTokenOffer, the account in the Recipient field of the NFTokenOffer (if present), or any account if the NFTokenOffer has an Expiration and the NFTokenOffer has already expired.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- nftoken_offers: List[str]¶
An array of identifiers of NFTokenOffer objects that should be cancelled by this transaction.
It is an error if an entry in this list points to an object that is not an NFTokenOffer object. It is not an error if an entry in this list points to an object that does not exist. This field is required.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'NFTokenCancelOffer'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenCreateOffer(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenCreateOffer transaction creates either an offer to buy an NFT the submitting account does not own, or an offer to sell an NFT the submitting account does own.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- amount: Amount¶
Indicates the amount expected or offered for the Token.
The amount must be non-zero, except when this is a sell offer and the asset is XRP. This would indicate that the current owner of the token is giving it away free, either to anyone at all, or to the account identified by the Destination field. This field is required.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- destination: str | None = None¶
If present, indicates that this offer may only be accepted by the specified account. Attempts by other accounts to accept this offer MUST fail.
- expiration: int | None = None¶
Indicates the time after which the offer will no longer be valid. The value is the number of seconds since the Ripple Epoch.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- nftoken_id: str¶
Identifies the TokenID of the NFToken object that the offer references. This field is required.
- owner: str | None = None¶
Indicates the AccountID of the account that owns the corresponding NFToken.
If the offer is to buy a token, this field must be present and it must be different than Account (since an offer to buy a token one already holds is meaningless).
If the offer is to sell a token, this field must not be present, as the owner is, implicitly, the same as Account (since an offer to sell a token one doesn’t already hold is meaningless).
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'NFTokenCreateOffer'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenCreateOfferFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
int
,Enum
Transaction Flags for an NFTokenCreateOffer Transaction.
- TF_SELL_NFTOKEN = 1¶
If set, indicates that the offer is a sell offer. Otherwise, it is a buy offer.
- as_integer_ratio()¶
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()¶
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()¶
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()¶
Returns self, the complex conjugate of any int.
- denominator¶
the denominator of a rational number in lowest terms
- from_bytes(byteorder='big', *, signed=False)¶
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag¶
the imaginary part of a complex number
- numerator¶
the numerator of a rational number in lowest terms
- real¶
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)¶
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class xrpl.models.transactions.NFTokenCreateOfferFlagInterface¶
Bases:
FlagInterface
Transaction Flags for an NFTokenCreateOffer Transaction.
- TF_SELL_NFTOKEN: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.NFTokenMint(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenMint transaction creates an NFToken object and adds it to the relevant NFTokenPage object of the minter. If the transaction is successful, the newly minted token will be owned by the minter account specified by the transaction.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- issuer: str | None = None¶
Indicates the account that should be the issuer of this token. This value is optional and should only be specified if the account executing the transaction is not the Issuer of the NFToken object. If it is present, the MintAccount field in the AccountRoot of the Issuer field must match the Account, otherwise the transaction will fail.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- nftoken_taxon: int¶
Indicates the taxon associated with this token. The taxon is generally a value chosen by the minter of the token and a given taxon may be used for multiple tokens. The implementation reserves taxon identifiers greater than or equal to 2147483648 (0x80000000). If you have no use for this field, set it to 0.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'NFTokenMint'¶
- transfer_fee: int | None = None¶
Specifies the fee charged by the issuer for secondary sales of the Token, if such sales are allowed. Valid values for this field are between 0 and 50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. This field must NOT be present if the tfTransferable flag is not set.
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- uri: str | None = None¶
URI that points to the data and/or metadata associated with the NFT. This field need not be an HTTP or HTTPS URL; it could be an IPFS URI, a magnet link, immediate data encoded as an RFC2379 “data” URL, or even an opaque issuer-specific encoding. The URI is not checked for validity.
This field must be hex-encoded. You can use xrpl.utils.str_to_hex to convert a UTF-8 string to hex.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenMintFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
int
,Enum
Transaction Flags for an NFTokenMint Transaction.
- TF_BURNABLE = 1¶
If set, indicates that the minted token may be burned by the issuer even if the issuer does not currently hold the token. The current holder of the token may always burn it.
- TF_ONLY_XRP = 2¶
If set, indicates that the token may only be offered or sold for XRP.
- TF_TRANSFERABLE = 8¶
If set, indicates that this NFT can be transferred. This flag has no effect if the token is being transferred from the issuer or to the issuer.
- TF_TRUSTLINE = 4¶
If set, indicates that the issuer wants a trustline to be automatically created.
- as_integer_ratio()¶
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()¶
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()¶
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()¶
Returns self, the complex conjugate of any int.
- denominator¶
the denominator of a rational number in lowest terms
- from_bytes(byteorder='big', *, signed=False)¶
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag¶
the imaginary part of a complex number
- numerator¶
the numerator of a rational number in lowest terms
- real¶
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)¶
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class xrpl.models.transactions.NFTokenMintFlagInterface¶
Bases:
FlagInterface
Transaction Flags for an NFTokenMint Transaction.
- TF_BURNABLE: bool¶
- TF_ONLY_XRP: bool¶
- TF_TRANSFERABLE: bool¶
- TF_TRUSTLINE: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.OfferCancel(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an OfferCancel transaction, which removes an Offer object from the decentralized exchange.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- offer_sequence: int = <object object>¶
The Sequence number (or Ticket number) of a previous OfferCreate transaction. If specified, cancel any Offer object in the ledger that was created by that transaction. It is not considered an error if the Offer specified does not exist.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'OfferCancel'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.OfferCreate(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an OfferCreate transaction, which executes a limit order in the decentralized exchange. If the specified exchange cannot be completely fulfilled, it creates an Offer object for the remainder. Offers can be partially fulfilled.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- expiration: int | None = None¶
Time after which the offer is no longer active, in seconds since the Ripple Epoch.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str, Any]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_signed() bool ¶
Checks if a transaction has been signed.
- Returns:
Whether the transaction has been signed
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- last_ledger_sequence: int | None = None¶
The highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected. See Reliable Transaction Submission for details.
- network_id: int | None = None¶
The network id of the transaction.
- offer_sequence: int | None = None¶
The Sequence number (or Ticket number) of a previous OfferCreate to cancel when placing this Offer.
- sequence: int | None = None¶
(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.
- signers: List[Signer] | None = None¶
Signing data authorizing a multi-signed transaction. Added during multi-signing.
- signing_pub_key: str = ''¶
The public key authorizing a single-signed transaction. Automatically added during signing.
- source_tag: int | None = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- taker_gets: IssuedCurrencyAmount | str¶
The amount and type of currency being provided by the sender of this transaction. This field is required.
- taker_pays: IssuedCurrencyAmount | str¶
The amount and type of currency the sender of this transaction wants in exchange for the full
taker_gets
amount. This field is required.
- ticket_sequence: int | None = None¶
The sequence number of the ticket to use in place of a Sequence number. If this is provided, sequence must be 0. Cannot be used with account_txn_id.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a Transaction.
- Returns:
The dictionary representation of a Transaction.
- to_xrpl() Dict[str, Any] ¶
Creates a JSON-like dictionary in the JSON format used by the binary codec based on the Transaction object.
- Returns:
A JSON-like dictionary in the JSON format used by the binary codec.
- transaction_type: TransactionType = 'OfferCreate'¶
- txn_signature: str | None = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.OfferCreateFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
int
,Enum
Transactions of the OfferCreate type support additional values in the Flags field. This enum represents those options.
- TF_FILL_OR_KILL = 262144¶
Treat the offer as a Fill or Kill order. Only try to match existing offers in the ledger, and only do so if the entire TakerPays quantity can be obtained. If the fix1578 amendment is enabled and the offer cannot be executed when placed, the transaction has the result code tecKILLED; otherwise, the transaction uses the result code tesSUCCESS even when it was killed without trading any currency.
- TF_IMMEDIATE_OR_CANCEL = 131072¶
Treat the offer as an Immediate or Cancel order. If enabled, the offer never becomes a ledger object: it only tries to match existing offers in the ledger. If the offer cannot match any offers immediately, it executes “successfully” without trading any currency. In this case, the transaction has the result code tesSUCCESS, but creates no Offer objects in the ledger.
- TF_PASSIVE = 65536¶
If enabled, the offer does not consume offers that exactly match it, and instead becomes an Offer object in the ledger. It still consumes offers that cross it.
- TF_SELL = 524288¶
Exchange the entire TakerGets amount, even if it means obtaining more than the TakerPays amount in exchange.
- as_integer_ratio()¶
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()¶
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()¶
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()¶
Returns self, the complex conjugate of any int.
- denominator¶
the denominator of a rational number in lowest terms
- from_bytes(byteorder='big', *, signed=False)¶
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag¶
the imaginary part of a complex number
- numerator¶
the numerator of a rational number in lowest terms
- real¶
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)¶
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class xrpl.models.transactions.OfferCreateFlagInterface¶
Bases:
FlagInterface
Transactions of the OfferCreate type support additional values in the Flags field. This TypedDict represents those options.
- TF_FILL_OR_KILL: bool¶
- TF_IMMEDIATE_OR_CANCEL: bool¶
- TF_PASSIVE: bool¶
- TF_SELL: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.Payment(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a Payment <https://xrpl.org/payment.html>`_ transaction, which sends value from one account to another. (Depending on the path taken, this can involve additional exchanges of value, which occur atomically.) This transaction type can be used for several types of payments.
Payments are also the only way to create accounts.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: str | None = None¶
A hash value identifying a previous transaction from the same sender. If provided, this transaction is only considered valid if the identified transaction is the most recent transaction sent by this address. See AccountTxnID for details.
- amount: Amount¶
The amount of currency to deliver. If the Partial Payment flag is set, deliver up to this amount instead. This field is required.
- blob() str ¶
Creates the canonical binary format of the Transaction object.
- Returns:
The binary-encoded object, as a hexadecimal string.
- deliver_min: Amount | None = None¶
Minimum amount of destination currency this transaction should deliver. Only valid if this is a partial payment. If omitted, any positive amount is considered a success.
- destination: str¶
The address of the account receiving the payment. This field is required.
- destination_tag: int | None = None¶
An arbitrary destination tag that identifies the reason for the Payment, or a hosted recipient to pay.
- fee: str | None = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Dict[str, bool] | int | List[int] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- static from_blob(tx_blob: str) Transaction ¶
Decodes a transaction blob.
- Parameters:
tx_blob – the tx blob to decode.
- Returns:
The formatted transaction.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: str | Dict[str,