XRPL Transaction Models

Use these models to prepare or process XRP Ledger transactions.

Base Transaction Model

class xrpl.models.transactions.transaction.Transaction(*, account: str = <object object>, transaction_type: ~xrpl.models.transactions.types.transaction_type.TransactionType | ~xrpl.models.transactions.types.pseudo_transaction_type.PseudoTransactionType = <object object>, fee: str | None = None, sequence: int | None = None, account_txn_id: str | None = None, flags: ~typing.Dict[str, bool] | int | ~typing.List[int] | None = None, last_ledger_sequence: int | None = None, memos: ~typing.List[~xrpl.models.transactions.transaction.Memo] | None = None, signers: ~typing.List[~xrpl.models.transactions.transaction.Signer] | None = None, source_tag: int | None = None, signing_pub_key: str = '', ticket_sequence: int | None = None, txn_signature: str | None = None, network_id: int | None = None, delegate: str | None = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, asset: Currency = <object object>, asset2: Currency = <object object>, bid_min: Optional[IssuedCurrencyAmount] = None, bid_max: Optional[IssuedCurrencyAmount] = None, auth_accounts: Optional[List[AuthAccount]] = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.AMMClawback(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, holder: str = <object object>, asset: IssuedCurrency = <object object>, asset2: Currency = <object object>, amount: Optional[IssuedCurrencyAmount] = None)

Bases: Transaction

Claw back tokens from a holder who has deposited your issued tokens into an AMM pool.

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 | None = None

The maximum amount to claw back from the AMM account. The currency and issuer subfields should match the Asset subfields. If this field isn’t specified, or the value subfield exceeds the holder’s available tokens in the AMM, all of the holder’s tokens are clawed back.

asset: IssuedCurrency = <object object>

Specifies the asset that the issuer wants to claw back from the AMM pool. In JSON, this is an object with currency and issuer fields. The issuer field must match with Account.

asset2: Currency = <object object>

Specifies the other asset in the AMM’s pool. In JSON, this is an object with currency and issuer fields (omit issuer for XRP).

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

holder: str = <object object>

The account holding the asset to be clawed back.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'AMMClawback'
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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, amount: Amount = <object object>, amount2: Amount = <object object>, trading_fee: int = <object object>)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, asset: Currency = <object object>, asset2: Currency = <object object>)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, asset: Currency = <object object>, asset2: Currency = <object object>, amount: Optional[Amount] = None, amount2: Optional[Amount] = None, e_price: Optional[Amount] = None, lp_token_out: Optional[IssuedCurrencyAmount] = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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
TF_TWO_ASSET_IF_EMPTY = 8388608
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: TransactionFlagInterface

Transactions of the AMMDeposit type support additional values in the Flags field. This TypedDict represents those options.

TF_INNER_BATCH_TXN: bool
TF_LIMIT_LP_TOKEN: bool
TF_LP_TOKEN: bool
TF_ONE_ASSET_LP_TOKEN: bool
TF_SINGLE_ASSET: bool
TF_TWO_ASSET: bool
TF_TWO_ASSET_IF_EMPTY: 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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, asset: Currency = <object object>, asset2: Currency = <object object>, trading_fee: int = <object object>)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, asset: Currency = <object object>, asset2: Currency = <object object>, amount: Optional[Amount] = None, amount2: Optional[Amount] = None, e_price: Optional[Amount] = None, lp_token_in: Optional[IssuedCurrencyAmount] = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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: TransactionFlagInterface

Transactions of the AMMWithdraw type support additional values in the Flags field. This TypedDict represents those options.

TF_INNER_BATCH_TXN: bool
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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, destination: str = <object object>, destination_tag: int | None = None, credential_ids: ~typing.List[str] | None = None)

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.

credential_ids: List[str] | None = None

Credentials associated with sender of this transaction. The credentials included must not be expired. The list must not be empty when specified and cannot contain more than 8 credentials.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, clear_flag: Optional[AccountSetAsfFlag] = None, domain: Optional[str] = None, email_hash: Optional[str] = None, message_key: Optional[str] = None, set_flag: Optional[AccountSetAsfFlag] = None, transfer_rate: Optional[int] = None, tick_size: Optional[int] = None, nftoken_minter: Optional[str] = None)

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

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.

See AccountSet asf Flags

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_ALLOW_TRUSTLINE_LOCKING = 17

If this account is an Issuer of IOU tokens, this flag allows such tokens to be used in Escrow.

ASF_AUTHORIZED_NFTOKEN_MINTER = 10

Allow another account to mint and burn tokens on behalf of this account.

ASF_DEFAULT_RIPPLE = 8

Enable rippling on this account’s trust lines by default.

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_GLOBAL_FREEZE = 7

Freeze all assets issued by this account.

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.

See AccountSet tf Flags

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: TransactionFlagInterface

Transactions of the AccountSet type support additional values in the Flags field. This TypedDict represents those options.

See AccountSet tf Flags

TF_ALLOW_XRP: bool
TF_DISALLOW_XRP: bool
TF_INNER_BATCH_TXN: 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(*, account: str = <object object>)

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]) Self

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]) Self

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.Batch(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, raw_transactions: List[Transaction] = <object object>, batch_signers: Optional[List[BatchSigner]] = None)

Bases: Transaction

Represents a Batch 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.

batch_signers: List[BatchSigner] | None = None
blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

Construct a new Batch from a dictionary of parameters.

Parameters:

value – The value to construct the Batch from.

Returns:

A new Batch object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

classmethod from_xrpl(value: str | Dict[str, Any]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

raw_transactions: List[Transaction] = <object object>
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 Batch.

Returns:

The dictionary representation of a Batch.

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 = 'Batch'
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.BatchFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the Batch type support additional values in the Flags field. This enum represents those options.

TF_ALL_OR_NOTHING = 65536
TF_INDEPENDENT = 524288
TF_ONLY_ONE = 131072
TF_UNTIL_FAILURE = 262144
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.BatchFlagInterface

Bases: TransactionFlagInterface

Transactions of the Batch type support additional values in the Flags field. This TypedDict represents those options.

TF_ALL_OR_NOTHING: bool
TF_INDEPENDENT: bool
TF_INNER_BATCH_TXN: bool
TF_ONLY_ONE: bool
TF_UNTIL_FAILURE: 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.CheckCancel(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, check_id: str = <object object>)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, check_id: str = <object object>, amount: Optional[Amount] = None, deliver_min: Optional[Amount] = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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 or Amount.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, destination: str = <object object>, send_max: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str = <object object>, destination_tag: int | None = None, expiration: int | None = None, invoice_id: str | None = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

destination: str

The address of the account that can cash the Check. This field is required.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

send_max: IssuedCurrencyAmount | MPTAmount | 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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, amount: ClawbackAmount = <object object>, holder: Optional[str] = None)

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: ClawbackAmount

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

holder: str | None = None

Indicates the AccountID that the issuer wants to clawback. This field is only valid for clawing back MPTs.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.CredentialAccept(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, issuer: str = <object object>, credential_type: str = <object object>)

Bases: Transaction

This transaction accepts a credential issued to the Account (i.e. the Account is the Subject of the Credential object). The credential is not considered valid until it has been transferred/accepted.

account: str = <object object>

The subject of the credential.

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.

credential_type: str = <object object>

A hex-encoded value to identify the type of credential from the issuer.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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 = <object object>

The issuer of the credential.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'CredentialAccept'
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.CredentialCreate(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, subject: str = <object object>, credential_type: str = <object object>, expiration: int | None = None, uri: str | None = None)

Bases: Transaction

This transaction creates a Credential object. It must be sent by the issuer.

account: str = <object object>

The issuer of the credential.

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.

credential_type: str = <object object>

A hex-encoded value to identify the type of credential from the issuer.

delegate: str | None = None

The delegate account that is sending the transaction.

expiration: int | None = None

The credential expiration.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.

subject: str = <object object>

The subject of the credential.

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 = 'CredentialCreate'
txn_signature: str | None = None

The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.

uri: str | None = None

Additional data about the credential (such as a link to the Verifiable Credential document).

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.transactions.CredentialDelete(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, subject: str | None = None, issuer: str | None = None, credential_type: str = <object object>)

Bases: Transaction

This transaction deletes a Credential object.

account: str = <object object>

The transaction submitter.

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.

credential_type: str = <object object>

A hex-encoded value to identify the type of credential from the issuer.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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

The issuer of the credential. If omitted, Account is assumed to be the issuer.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.

subject: str | None = None

The person that the credential is for. If omitted, Account is assumed to be the subject.

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 = 'CredentialDelete'
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.DIDDelete(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None)

Bases: Transaction

Represents a DIDDelete 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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'DIDDelete'
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.DIDSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, did_document: Optional[str] = None, data: Optional[str] = None, uri: Optional[str] = None)

Bases: Transaction

Represents a DIDSet 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.

data: str | None = None

The public attestations of identity credentials associated with the DID. To delete the Data, DIDDocument, or URI field from an existing DID ledger entry, add the field as an empty string.

delegate: str | None = None

The delegate account that is sending the transaction.

did_document: str | None = None

The DID document associated with the DID.

To delete the Data, DIDDocument, or URI field from an existing DID ledger entry, add the field as an empty 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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'DIDSet'
txn_signature: str | None = None

The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.

uri: str | None = None

The Universal Resource Identifier associated with the DID. To delete the Data, DIDDocument, or URI field from an existing DID ledger entry, add the field as an empty string.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.transactions.DelegateSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, authorize: str = <object object>, permissions: List[Permission] = <object object>)

Bases: Transaction

DelegateSet allows an account to delegate a set of permissions to another 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.

authorize: str = <object object>

The authorized account.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

permissions: List[Permission] = <object object>

The transaction permissions that the authorized account has been granted.

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 = 'DelegateSet'

The transaction type (DelegateSet).

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, authorize: Optional[str] = None, unauthorize: Optional[str] = None, authorize_credentials: Optional[List[Credential]] = None, unauthorize_credentials: Optional[List[Credential]] = None)

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.

authorize_credentials: List[Credential] | None = None

The credential(s) that received the preauthorization. (Any account with these credentials can send preauthorized payments).

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.

unauthorize_credentials: List[Credential] | None = None

The credential(s) whose preauthorization should be revoked.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.transactions.EscrowCancel(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, owner: str = <object object>, offer_sequence: int = <object object>)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, amount: Amount = <object object>, destination: str = <object object>, destination_tag: Optional[int] = None, cancel_after: Optional[int] = None, finish_after: Optional[int] = None, condition: Optional[str] = None)

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

The amount to deduct from the sender’s balance and set aside in escrow. Can represent XRP in drops, an IOU token, or MPT. This field is required and must be positive.

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

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, owner: str = <object object>, offer_sequence: int = <object object>, condition: Optional[str] = None, fulfillment: Optional[str] = None, credential_ids: Optional[List[str]] = None)

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.

credential_ids: List[str] | None = None

Credentials associated with sender of this transaction. The credentials included must not be expired.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.GranularPermission(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, Enum

These permissions would support control over some smaller portion of a transaction, rather than being able to do all of the functionality that the transaction allows.

ACCOUNT_DOMAIN_SET = 'AccountDomainSet'

Modify the domain of an account.

ACCOUNT_EMAIL_HASH_SET = 'AccountEmailHashSet'

Modify the EmailHash of an account.

ACCOUNT_MESSAGE_KEY_SET = 'AccountMessageKeySet'

Modify the MessageKey of an account.

ACCOUNT_TICK_SIZE_SET = 'AccountTickSizeSet'

Modify the tick size of an account.

ACCOUNT_TRANSFER_RATE_SET = 'AccountTransferRateSet'

Modify the transfer rate of an account.

MPTOKEN_ISSUANCE_LOCK = 'MPTokenIssuanceLock'

Use the MPTIssuanceSet transaction to lock (freeze) a holder.

MPTOKEN_ISSUANCE_UNLOCK = 'MPTokenIssuanceUnlock'

Use the MPTIssuanceSet transaction to unlock (unfreeze) a holder.

PAYMENT_BURN = 'PaymentBurn'

Send a payment for a currency where the destination account is the issuer.

PAYMENT_MINT = 'PaymentMint'

Send a payment for a currency where the sending account is the issuer.

TRUSTLINE_AUTHORIZE = 'TrustlineAuthorize'

Authorize a trustline.

TRUSTLINE_FREEZE = 'TrustlineFreeze'

Freeze a trustline.

TRUSTLINE_UNFREEZE = 'TrustlineUnfreeze'

Unfreeze a trustline.

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class xrpl.models.transactions.LoanBrokerCoverClawback(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, loan_broker_id: Optional[str] = None, amount: Optional[Union[IssuedCurrencyAmount, MPTAmount]] = None)

Bases: Transaction

This transaction claws back First-Loss Capital from a Loan Broker

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 | MPTAmount | None = None

The First-Loss Capital amount to clawback. If the amount is 0 or not provided, clawback funds up to LoanBroker.DebtTotal * LoanBroker.CoverRateMinimum.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

loan_broker_id: str | None = None

The Loan Broker ID from which to claw back First-Loss Capital. Must be provided if the Amount is an MPT, or Amount is an IOU and issuer is specified as the Account submitting the transaction.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'LoanBrokerCoverClawback'
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.LoanBrokerCoverDeposit(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, loan_broker_id: str = <object object>, amount: Amount = <object object>)

Bases: Transaction

This transaction deposits First-Loss Capital into a Loan Broker

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-Loss Capital amount to deposit.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

loan_broker_id: str = <object object>

The Loan Broker ID to deposit First-Loss Capital.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'LoanBrokerCoverDeposit'
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.LoanBrokerCoverWithdraw(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, loan_broker_id: str = <object object>, amount: Amount = <object object>, destination: Optional[str] = None, destination_tag: Optional[int] = None)

Bases: Transaction

This transaction withdraws First-Loss Capital from a Loan Broker

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-Loss Capital amount to withdraw.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

destination: str | None = None

An account to receive the assets. It must be able to receive the asset.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

loan_broker_id: str = <object object>

The Loan Broker ID from which to withdraw First-Loss Capital.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'LoanBrokerCoverWithdraw'
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.LoanBrokerDelete(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, loan_broker_id: str = <object object>)

Bases: Transaction

This transaction deletes a Loan Broker

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

loan_broker_id: str = <object object>

The Loan Broker ID that the transaction is deleting. This field is required.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'LoanBrokerDelete'
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.LoanBrokerSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, vault_id: str = <object object>, loan_broker_id: Optional[str] = None, data: Optional[str] = None, management_fee_rate: Optional[int] = None, debt_maximum: Optional[str] = None, cover_rate_minimum: Optional[int] = None, cover_rate_liquidation: Optional[int] = None)

Bases: Transaction

This transaction creates and updates a Loan Broker

MAX_COVER_RATE_LIQUIDATION = 100000
MAX_COVER_RATE_MINIMUM = 100000
MAX_DATA_PAYLOAD_LENGTH = 512
MAX_DEBT_MAXIMUM = 9223372036854775807
MAX_MANAGEMENT_FEE_RATE = 10000
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.

cover_rate_liquidation: int | None = None

The 1/10th basis point of minimum required first loss capital liquidated to cover a Loan default. Valid values are between 0 and 100000 inclusive.

cover_rate_minimum: int | None = None

The 1/10th basis point DebtTotal that the first loss capital must cover. Valid values are between 0 and 100000 inclusive.

data: str | None = None

Arbitrary metadata in hex format. The field is limited to 256 bytes.

debt_maximum: str | None = None

The maximum amount the protocol can owe the Vault. The default value of 0 means there is no limit to the debt. Must not be negative.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

loan_broker_id: str | None = None

The Loan Broker ID that the transaction is modifying.

management_fee_rate: int | None = None

The 1/10th basis point fee charged by the Lending Protocol Owner. Valid values are between 0 and 10000 inclusive.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'LoanBrokerSet'
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.

vault_id: str = <object object>

The Vault ID that the Lending Protocol will use to access liquidity. This field is required.

class xrpl.models.transactions.LoanDelete(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, loan_id: str = <object object>)

Bases: Transaction

The transaction deletes an existing Loan object.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

loan_id: str = <object object>

The ID of the Loan object to be deleted. This field is required.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'LoanDelete'
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.LoanManage(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, loan_id: str = <object object>)

Bases: Transaction

The transaction updates an existing Loan object.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

loan_id: str = <object object>

The ID of the Loan object to be updated. This field is required.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'LoanManage'
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.LoanPay(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, loan_id: str = <object object>, amount: Amount = <object object>)

Bases: Transaction

The Borrower submits a LoanPay transaction to make a Payment on the Loan.

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 amount of funds to pay. This field is required.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

loan_id: str = <object object>

The ID of the Loan object to be paid to. This field is required.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'LoanPay'
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.LoanPayFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Enum for LoanPay Transaction Flags.

Transactions of the LoanPay type support additional values in the flags field

TF_LOAN_FULL_PAYMENT = 131072

Indicates that the borrower is making a full early repayment.

TF_LOAN_LATE_PAYMENT = 262144

Indicates that the borrower is making a late loan payment.

TF_LOAN_OVERPAYMENT = 65536

Indicates that the remaining payment amount should be treated as an overpayment.

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

Bases: TransactionFlagInterface

Transactions of the LoanPay type support additional values in the Flags field. This TypedDict represents those options.

TF_INNER_BATCH_TXN: bool
TF_LOAN_FULL_PAYMENT: bool
TF_LOAN_LATE_PAYMENT: bool
TF_LOAN_OVERPAYMENT: 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.LoanSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, loan_broker_id: str = <object object>, data: Optional[str] = None, counterparty: Optional[str] = None, counterparty_signature: Optional[CounterpartySignature] = None, loan_origination_fee: Optional[str] = None, loan_service_fee: Optional[str] = None, late_payment_fee: Optional[str] = None, close_payment_fee: Optional[str] = None, overpayment_fee: Optional[int] = None, interest_rate: Optional[int] = None, late_interest_rate: Optional[int] = None, close_interest_rate: Optional[int] = None, overpayment_interest_rate: Optional[int] = None, principal_requested: str = <object object>, payment_total: Optional[int] = None, payment_interval: Optional[int] = None, grace_period: Optional[int] = None)

Bases: Transaction

This transaction creates a Loan

MAX_CLOSE_INTEREST_RATE = 100000
MAX_DATA_LENGTH = 512
MAX_INTEREST_RATE = 100000
MAX_LATE_INTEREST_RATE = 100000
MAX_OVER_PAYMENT_FEE_RATE = 100000
MAX_OVER_PAYMENT_INTEREST_RATE = 100000
MIN_PAYMENT_INTERVAL = 60
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.

close_interest_rate: int | None = None

A Fee Rate charged for repaying the Loan early in 1/10th basis points. Valid values are between 0 and 100000 inclusive. (0 - 100%)

close_payment_fee: str | None = None

A nominal funds amount paid to the LoanBroker.Owner when an early full repayment is made.

counterparty: str | None = None

The address of the counterparty of the Loan.

counterparty_signature: CounterpartySignature | None = None

The signature of the counterparty over the transaction.

data: str | None = None

Arbitrary metadata in hex format. The field is limited to 256 bytes.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

grace_period: int | None = None

The number of seconds after the Loan’s Payment Due Date can be Defaulted.

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.

Raises:

XRPLModelException – if self.flags is invalid.

interest_rate: int | None = None

Annualized interest rate of the Loan in 1/10th basis points. Valid values are between 0 and 100000 inclusive. (0 - 100%)

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

late_interest_rate: int | None = None

A premium added to the interest rate for late payments in 1/10th basis points. Valid values are between 0 and 100000 inclusive. (0 - 100%)

late_payment_fee: str | None = None

A nominal funds amount paid to the LoanBroker.Owner when a payment is late.

loan_broker_id: str = <object object>

The Loan Broker ID associated with the loan.

loan_origination_fee: str | None = None

A nominal funds amount paid to the LoanBroker.Owner when the Loan is created.

loan_service_fee: str | None = None

A nominal amount paid to the LoanBroker.Owner with every Loan payment.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

overpayment_fee: int | None = None

A fee charged on overpayments in 1/10th basis points. Valid values are between 0 and 100000 inclusive. (0 - 100%)

overpayment_interest_rate: int | None = None

An interest rate charged on overpayments in 1/10th basis points. Valid values are between 0 and 100000 inclusive. (0 - 100%)

payment_interval: int | None = None

Number of seconds between Loan payments.

payment_total: int | None = None

The total number of payments to be made against the Loan.

principal_requested: str = <object object>

The principal amount requested by the Borrower.

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 = 'LoanSet'
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.MPTokenAuthorize(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, mptoken_issuance_id: str = <object object>, holder: Optional[str] = None)

Bases: Transaction

The MPTokenAuthorize transaction is used to globally lock/unlock a MPTokenIssuance, or lock/unlock an individual’s MPToken.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

holder: str | None = None

An optional XRPL Address of an individual token holder balance to lock/unlock. If omitted, this transaction will apply to all any accounts holding MPTs.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

mptoken_issuance_id: str = <object object>

Identifies the MPTokenIssuance

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 = 'MPTokenAuthorize'
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.MPTokenAuthorizeFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the MPTokenAuthorize type support additional values in the Flags field. This enum represents those options.

TF_MPT_UNAUTHORIZE = 1

If set and transaction is submitted by a holder, it indicates that the holder no longer wants to hold the MPToken, which will be deleted as a result. If the holder’s MPToken has non-zero balance while trying to set this flag, the transaction will fail. On the other hand, if set and transaction is submitted by an issuer, it would mean that the issuer wants to unauthorize the holder (only applicable for allow-listing), which would unset the lsfMPTAuthorized flag on the MPToken.

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

Bases: TransactionFlagInterface

Transactions of the MPTokenAuthorize type support additional values in the Flags field. This TypedDict represents those options.

TF_INNER_BATCH_TXN: bool
TF_MPT_UNAUTHORIZE: 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.MPTokenIssuanceCreate(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, asset_scale: Optional[int] = None, maximum_amount: Optional[str] = None, transfer_fee: Optional[int] = None, mptoken_metadata: Optional[str] = None)

Bases: Transaction

The MPTokenIssuanceCreate transaction creates a MPTokenIssuance object and adds it to the relevant directory node of the creator account. This transaction is the only opportunity an issuer has to specify any token fields that are defined as immutable (e.g., MPT Flags). If the transaction is successful, the newly created token will be owned by the account (the creator account) which executed 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.

asset_scale: int | None = None

An asset scale is the difference, in orders of magnitude, between a standard unit and a corresponding fractional unit. More formally, the asset scale is a non-negative integer (0, 1, 2, …) such that one standard unit equals 10^(-scale) of a corresponding fractional unit. If the fractional unit equals the standard unit, then the asset scale is 0. Note that this value is optional, and will default to 0 if not supplied.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

maximum_amount: str | None = None

Specifies the maximum asset amount of this token that should ever be issued. It is a non-negative integer string that can store a range of up to 63 bits. If not set, the max amount will default to the largest unsigned 63-bit integer (0x7FFFFFFFFFFFFFFF)

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

mptoken_metadata: str | None = None

Arbitrary metadata about this issuance, in hex format, limited to 1024 bytes. Use encode_mptoken_metadata to convert from a JSON object to this format. Use decode_mptoken_metadata to convert from this format to a JSON object.

While adherence to the XLS-89d format is not mandatory, non-compliant metadata may not be discoverable by ecosystem tools such as explorers and indexers.

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 = 'MPTokenIssuanceCreate'
transfer_fee: int | None = None

Specifies the fee to charged by the issuer for secondary sales of the Token, if such sales are allowed. Valid values for this field are between 0 and 50,000 inclusive, allowing transfer rates of between 0.000% and 50.000% in increments of 0.001. The field must NOT be present if the tfMPTCanTransfer flag is not set.

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.MPTokenIssuanceCreateFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the MPTokenIssuanceCreate type support additional values in the Flags field. This enum represents those options.

TF_MPT_CAN_CLAWBACK = 64
TF_MPT_CAN_ESCROW = 8
TF_MPT_CAN_LOCK = 2
TF_MPT_CAN_TRADE = 16
TF_MPT_CAN_TRANSFER = 32
TF_MPT_REQUIRE_AUTH = 4
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.MPTokenIssuanceCreateFlagInterface

Bases: TransactionFlagInterface

Transactions of the MPTokenIssuanceCreate type support additional values in the Flags field. This TypedDict represents those options.

TF_INNER_BATCH_TXN: bool
TF_MPT_CAN_CLAWBACK: bool
TF_MPT_CAN_ESCROW: bool
TF_MPT_CAN_LOCK: bool
TF_MPT_CAN_TRADE: bool
TF_MPT_CAN_TRANSFER: bool
TF_MPT_REQUIRE_AUTH: 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.MPTokenIssuanceDestroy(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, mptoken_issuance_id: str = <object object>)

Bases: Transaction

The MPTokenIssuanceDestroy transaction is used to remove an MPTokenIssuance object from the directory node in which it is being held, effectively removing the token from the ledger. If this operation succeeds, the corresponding MPTokenIssuance is removed and the owner’s reserve requirement is reduced by one. This operation must fail if there are any holders who have non-zero balances.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

mptoken_issuance_id: str = <object object>

Identifies the MPTokenIssuance object to be removed by the transaction.

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 = 'MPTokenIssuanceDestroy'
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.MPTokenIssuanceSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, mptoken_issuance_id: str = <object object>, holder: Optional[str] = None)

Bases: Transaction

The MPTokenIssuanceSet transaction is used to globally lock/unlock a MPTokenIssuance, or lock/unlock an individual’s MPToken.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

holder: str | None = None

An optional XRPL Address of an individual token holder balance to lock/unlock. If omitted, this transaction will apply to all any accounts holding MPTs.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

mptoken_issuance_id: str = <object object>

Identifies the MPTokenIssuance

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 = 'MPTokenIssuanceSet'
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.MPTokenIssuanceSetFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the MPTokenIssuanceSet type support additional values in the Flags field. This enum represents those options.

TF_MPT_LOCK = 1

If set, indicates that the MPT can be locked both individually and globally. If not set, the MPT cannot be locked in any way.

TF_MPT_UNLOCK = 2

If set, indicates that the MPT can be unlocked both individually and globally. If not set, the MPT cannot be unlocked in any way.

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

Bases: TransactionFlagInterface

Transactions of the MPTokenIssuanceSet type support additional values in the Flags field. This TypedDict represents those options.

TF_INNER_BATCH_TXN: bool
TF_MPT_LOCK: bool
TF_MPT_UNLOCK: 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.Memo(*, memo_data: str | None = None, memo_format: str | None = None, memo_type: str | None = None)

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, and memo_type.

classmethod from_dict(value: Dict[str, Any]) Self

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]) Self

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, nftoken_sell_offer: Optional[str] = None, nftoken_buy_offer: Optional[str] = None, nftoken_broker_fee: Optional[Amount] = None)

Bases: Transaction

The NFTokenOfferAccept transaction is used to accept offers to buy or sell an NFToken. It can either:

  1. Allow one offer to be accepted. This is called direct mode.

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

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, nftoken_id: str = <object object>, owner: str | None = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, nftoken_offers: List[str] = <object object>)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, nftoken_id: str = <object object>, amount: Amount = <object object>, owner: Optional[str] = None, expiration: Optional[int] = None, destination: Optional[str] = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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: TransactionFlagInterface

Transaction Flags for an NFTokenCreateOffer Transaction.

TF_INNER_BATCH_TXN: bool
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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, nftoken_taxon: int = <object object>, issuer: Optional[str] = None, transfer_fee: Optional[int] = None, uri: Optional[str] = None, amount: Optional[Amount] = None, destination: Optional[str] = None, expiration: Optional[int] = None)

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.

amount: Amount | None = None

Indicates the amount expected for the Token. The amount can be zero. This would indicate that the account is giving the token away free, either to anyone at all, or to the account identified by the Destination field.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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_MUTABLE = 16

If set, indicates that this NFT’s URI can be modified.

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: TransactionFlagInterface

Transaction Flags for an NFTokenMint Transaction.

TF_BURNABLE: bool
TF_INNER_BATCH_TXN: bool
TF_MUTABLE: 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.NFTokenModify(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, nftoken_id: str = <object object>, owner: Optional[str] = None, uri: Optional[str] = None)

Bases: Transaction

The NFTokenModify transaction modifies an NFToken’s URI if its tfMutable is set to true.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

nftoken_id: str = <object object>

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.

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 = 'NFTokenModify'
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.OfferCancel(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, offer_sequence: int = <object object>)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, taker_gets: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str = <object object>, taker_pays: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str = <object object>, expiration: int | None = None, offer_sequence: int | None = None, domain_id: str | None = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

domain_id: str | None = None

The domain that the offer must be a part of.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 | MPTAmount | str

The amount and type of currency being provided by the sender of this transaction. This field is required.

taker_pays: IssuedCurrencyAmount | MPTAmount | 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.

See OfferCreate Flags

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_HYBRID = 1048576

Indicates the offer is hybrid. This flag cannot be set if the offer doesn’t have a DomainID.

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: TransactionFlagInterface

Transactions of the OfferCreate type support additional values in the Flags field. This TypedDict represents those options.

See OfferCreate Flags

TF_FILL_OR_KILL: bool
TF_HYBRID: bool
TF_IMMEDIATE_OR_CANCEL: bool
TF_INNER_BATCH_TXN: 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.OracleDelete(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, oracle_document_id: int = <object object>)

Bases: Transaction

Delete an Oracle ledger entry.

account: str = <object object>

This account must match the account in the Owner field of the Oracle object.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

oracle_document_id: int = <object object>

A unique identifier of the price oracle for the 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 = 'OracleDelete'
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.OracleSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, oracle_document_id: int = <object object>, provider: Optional[str] = None, uri: Optional[str] = None, asset_class: Optional[str] = None, last_update_time: int = <object object>, price_data_series: List[PriceData] = <object object>)

Bases: Transaction

Creates a new Oracle ledger entry or updates the fields of an existing one, using the Oracle ID.

The oracle provider must complete these steps before submitting this transaction:

Create or own the XRPL account in the Owner field and have enough XRP to meet the reserve and transaction fee requirements. Publish the XRPL account public key, so it can be used for verification by dApps. Publish a registry of available price oracles with their unique OracleDocumentID .

account: str = <object object>

This account must match the account in the Owner field of the Oracle object.

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_class: str | None = None

This field must be hex-encoded. You can use xrpl.utils.str_to_hex to convert a UTF-8 string to hex.

Describes the type of asset, such as “currency”, “commodity”, or “index”. This field is a string, up to 16 ASCII hex encoded characters (0x20-0x7E). This field is required when creating a new Oracle ledger entry, but is optional for updates.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

last_update_time: int = <object object>

LastUpdateTime is the specific point in time when the data was last updated. The LastUpdateTime is represented as Unix Time - the number of seconds since January 1, 1970 (00:00 UTC).

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

oracle_document_id: int = <object object>

A unique identifier of the price oracle for the Account.

price_data_series: List[PriceData] = <object object>

An array of up to 10 PriceData objects, each representing the price information for a token pair. More than five PriceData objects require two owner reserves.

provider: str | None = None

This field must be hex-encoded. You can use xrpl.utils.str_to_hex to convert a UTF-8 string to hex.

An arbitrary value that identifies an oracle provider, such as Chainlink, Band, or DIA. This field is a string, up to 256 ASCII hex encoded characters (0x20-0x7E). This field is required when creating a new Oracle ledger entry, but is optional for updates.

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 = 'OracleSet'
txn_signature: str | None = None

The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.

uri: str | None = None

This field must be hex-encoded. You can use xrpl.utils.str_to_hex to convert a UTF-8 string to hex.

An optional Universal Resource Identifier to reference price data off-chain. This field is limited to 256 bytes.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.transactions.Payment(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, amount: Amount = <object object>, destination: str = <object object>, destination_tag: Optional[int] = None, invoice_id: Optional[str] = None, paths: Optional[List[Path]] = None, send_max: Optional[Amount] = None, deliver_min: Optional[Amount] = None, domain_id: Optional[str] = None, credential_ids: Optional[List[str]] = None)

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.

credential_ids: List[str] | None = None

Credentials associated with sender of this transaction. The credentials included must not be expired.

delegate: str | None = None

The delegate account that is sending the transaction.

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.

domain_id: str | None = None

The domain the sender intends to use. Both the sender and destination must be part of this domain.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

paths: List[Path] | None = None

Array of payment paths to be used (for a cross-currency payment). Must be omitted for XRP-to-XRP transactions.

send_max: Amount | None = None

Maximum amount of source currency this transaction is allowed to cost, including transfer fees, exchange rates, and slippage. Does not include the XRP destroyed as a cost for submitting the transaction. Must be supplied for cross-currency or cross-issue payments. Must be omitted for XRP-to-XRP payments.

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 = 'Payment'
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.PaymentChannelClaim(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, channel: str = <object object>, balance: str | None = None, amount: str | None = None, signature: str | None = None, public_key: str | None = None, credential_ids: ~typing.List[str] | None = None)

Bases: Transaction

Represents a PaymentChannelClaim transaction, which claims XRP from a payment channel, adjusts channel’s expiration, or both. This transaction can be used differently depending on the transaction sender’s role in the specified channel.

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: str | None = None

The cumulative amount of XRP that has been authorized to deliver by the attached claim signature. Required unless closing the channel.

balance: str | None = None

The cumulative amount of XRP to have delivered through this channel after processing this claim. Required unless closing the channel.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

channel: str

The unique ID of the payment channel, as a 64-character hexadecimal string. This field is required.

credential_ids: List[str] | None = None

Credentials associated with sender of this transaction. The credentials included must not be expired.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

public_key: str | None = None

The public key that should be used to verify the attached signature. Must match the PublicKey that was provided when the channel was created. Required if signature is provided.

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.

signature: str | None = None

The signature of the claim, as hexadecimal. This signature must be verifiable for the this channel and the given public_key and amount values. May be omitted if closing the channel or if the sender of this transaction is the source address of the channel; required otherwise.

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 = 'PaymentChannelClaim'
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.PaymentChannelClaimFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the PaymentChannelClaim type support additional values in the Flags field. This enum represents those options.

See PaymentChannelClaim Flags

TF_CLOSE = 131072

Request to close the channel. Only the channel source and destination addresses can use this flag. This flag closes the channel immediately if it has no more XRP allocated to it after processing the current claim, or if the destination address uses it. If the source address uses this flag when the channel still holds XRP, this schedules the channel to close after SettleDelay seconds have passed. (Specifically, this sets the Expiration of the channel to the close time of the previous ledger plus the channel’s SettleDelay time, unless the channel already has an earlier Expiration time.) If the destination address uses this flag when the channel still holds XRP, any XRP that remains after processing the claim is returned to the source address.

TF_RENEW = 65536

Clear the channel’s Expiration time. (Expiration is different from the channel’s immutable CancelAfter time.) Only the source address of the payment channel can use this flag.

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

Bases: TransactionFlagInterface

Transactions of the PaymentChannelClaim type support additional values in the Flags field. This TypedDict represents those options.

See PaymentChannelClaim Flags

TF_CLOSE: bool
TF_INNER_BATCH_TXN: bool
TF_RENEW: 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.PaymentChannelCreate(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, amount: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str = <object object>, destination: str = <object object>, settle_delay: int = <object object>, public_key: str = <object object>, cancel_after: int | None = None, destination_tag: int | None = None)

Bases: Transaction

Represents a PaymentChannelCreate transaction, which creates a payment channel and funds it with XRP. The sender of this transaction is the “source address” of the payment channel.

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 | MPTAmount | str

The amount of XRP, in drops, to set aside in this channel. 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

An immutable expiration time for the channel, in seconds since the Ripple Epoch. The channel can be closed sooner than this but cannot remain open later than this time.

delegate: str | None = None

The delegate account that is sending the transaction.

destination: str

The account that can receive XRP from this channel, also known as the “destination address” of the channel. Cannot be the same as the sender. This field is required.

destination_tag: int | None = None

An arbitrary destination tag that identifies the reason for the Payment Channel, 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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

public_key: str

The public key of the key pair that the source will use to authorize claims against this channel, as hexadecimal. This can be any valid secp256k1 or Ed25519 public key. 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.

settle_delay: int

The amount of time, in seconds, the source address must wait between requesting to close the channel and fully closing it. This field is required.

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 = 'PaymentChannelCreate'
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.PaymentChannelFund(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, channel: str = <object object>, amount: str = <object object>, expiration: int | None = None)

Bases: Transaction

Represents a PaymentChannelFund transaction, adds additional XRP to an open payment channel, and optionally updates the expiration time of the channel. Only the source address of the channel can use this 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.

amount: str

The amount of XRP, in drops, to add to the channel. This field is required.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

channel: str

The unique ID of the payment channel, as a 64-character hexadecimal string. This field is required.

delegate: str | None = None

The delegate account that is sending the transaction.

expiration: int | None = None

A new mutable expiration time to set for the channel, in seconds since the Ripple Epoch. This must be later than the existing expiration time of the channel or later than the current time plus the settle delay of the channel. This is separate from the immutable cancel_after time.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'PaymentChannelFund'
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.PaymentFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the Payment type support additional values in the Flags field. This enum represents those options.

See Payment Flags

TF_LIMIT_QUALITY = 262144

output ratio that is equal or better than the ratio of Amount:SendMax. See Limit Quality for details.

Type:

Only take paths where all the conversions have an input

TF_NO_RIPPLE_DIRECT = 65536

Do not use the default path; only use paths included in the Paths field. This is intended to force the transaction to take arbitrage opportunities. Most clients do not need this.

TF_PARTIAL_PAYMENT = 131072

If the specified Amount cannot be sent without spending more than SendMax, reduce the received amount instead of failing outright. See Partial Payments for more details.

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

Bases: TransactionFlagInterface

Transactions of the Payment type support additional values in the Flags field. This TypedDict represents those options.

See Payment Flags

TF_INNER_BATCH_TXN: bool
TF_LIMIT_QUALITY: bool
TF_NO_RIPPLE_DIRECT: bool
TF_PARTIAL_PAYMENT: 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.PermissionedDomainDelete(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, domain_id: str = <object object>)

Bases: Transaction

This transaction deletes a PermissionedDomain object.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

domain_id: str = <object object>

The domain to delete.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'PermissionedDomainDelete'

The transaction type (PermissionedDomainDelete).

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.PermissionedDomainSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, domain_id: str | None = None, accepted_credentials: ~typing.List[~xrpl.models.transactions.deposit_preauth.Credential] = <object object>)

Bases: Transaction

This transaction creates or modifies a PermissionedDomain object.

accepted_credentials: List[Credential] = <object object>

The credentials that are accepted by the domain. Ownership of one of these credentials automatically makes you a member of the domain. An empty array means deleting the field.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

domain_id: str | None = None

The domain to modify. Must be included if modifying an existing domain.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'PermissionedDomainSet'

The transaction type (PermissionedDomainSet).

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.SetRegularKey(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, regular_key: str | None = None)

Bases: Transaction

Represents a SetRegularKey transaction, which assigns, changes, or removes a secondary “regular” key pair associated with 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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

regular_key: str | None = None

The classic address derived from the key pair to authorize for this account. If omitted, removes any existing regular key pair from the account. Must not match the account’s master key pair.

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 = 'SetRegularKey'
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.Signer(*, account: str = <object object>, txn_signature: str = <object object>, signing_pub_key: str = <object object>)

Bases: NestedModel

One Signer in a multi-signature. A multi-signed transaction can have an array of up to 8 Signers, each contributing a signature, in the Signers field.

account: str

The address of the Signer. This can be a funded account in the XRP Ledger or an unfunded address. This field is required.

classmethod from_dict(value: Dict[str, Any]) Self

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]) Self

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.

signing_pub_key: str

The public key that should be used to verify this Signer’s signature. This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a NestedModel.

Returns:

The dictionary representation of a NestedModel.

txn_signature: str

The signature that this Signer provided for this transaction. This field is required.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.transactions.SignerEntry(*, account: str = <object object>, signer_weight: int = <object object>, wallet_locator: str | None = None)

Bases: NestedModel

Represents one entry in a list of multi-signers authorized to an account.

account: str

This field is required.

classmethod from_dict(value: Dict[str, Any]) Self

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]) Self

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.

signer_weight: int

This field is required.

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.

wallet_locator: str | None = None

An arbitrary 256-bit (32-byte) field that can be used to identify the signer, which may be useful for smart contracts, or for identifying who controls a key in a large organization.

class xrpl.models.transactions.SignerListSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, signer_quorum: int = <object object>, signer_entries: Optional[List[SignerEntry]] = None)

Bases: Transaction

Represents a SignerListSet transaction, which creates, replaces, or removes a list of signers that can be used to multi-sign a 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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.

signer_entries: List[SignerEntry] | None = None
signer_quorum: int

This field is required.

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 = 'SignerListSet'
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.TicketCreate(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, ticket_count: int = <object object>)

Bases: Transaction

A TicketCreate transaction sets aside one or more sequence numbers as Tickets.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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_count: int = <object object>

How many Tickets to create. This must be a positive number and cannot cause the account to own more than 250 Tickets after executing this transaction. :meta hide-value:

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 = 'TicketCreate'
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.Transaction(*, account: str = <object object>, transaction_type: ~xrpl.models.transactions.types.transaction_type.TransactionType | ~xrpl.models.transactions.types.pseudo_transaction_type.PseudoTransactionType = <object object>, fee: str | None = None, sequence: int | None = None, account_txn_id: str | None = None, flags: ~typing.Dict[str, bool] | int | ~typing.List[int] | None = None, last_ledger_sequence: int | None = None, memos: ~typing.List[~xrpl.models.transactions.transaction.Memo] | None = None, signers: ~typing.List[~xrpl.models.transactions.transaction.Signer] | None = None, source_tag: int | None = None, signing_pub_key: str = '', ticket_sequence: int | None = None, txn_signature: str | None = None, network_id: int | None = None, delegate: str | None = None)

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.

class xrpl.models.transactions.TransactionFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the Transaction type support additional values in the Flags field. This enum represents those options.

TF_INNER_BATCH_TXN = 1073741824
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.TransactionFlagInterface

Bases: FlagInterface

Transactions support additional values in the Flags field. This TypedDict represents those options.

TF_INNER_BATCH_TXN: 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.TransactionMetadata

Bases: TypedDict

A model for a transaction’s metadata.

AffectedNodes: List[CreatedNode | ModifiedNode | DeletedNode]
DeliveredAmount: NotRequired[IssuedCurrencyAmount | MPTAmount | str]
TransactionIndex: int
TransactionResult: str
clear() None.  Remove all items from D.
copy() a shallow copy of D
delivered_amount: NotRequired[IssuedCurrencyAmount | MPTAmount | str | Literal['unavailable']]
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.TrustSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, limit_amount: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount = <object object>, quality_in: int | None = None, quality_out: int | None = None)

Bases: Transaction

Represents a TrustSet transaction on the XRP Ledger. Creates or modifies a trust line linking two accounts.

See TrustSet

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

limit_amount: IssuedCurrencyAmount

This field is required.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

quality_in: int | None = None
quality_out: int | None = None
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 = 'TrustSet'
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.TrustSetFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the TrustSet type support additional values in the Flags field. This enum represents those options.

TF_CLEAR_DEEP_FREEZE = 8388608

Clear the deep freeze on the trust line.

TF_CLEAR_FREEZE = 2097152

Unfreeze the trust line.

TF_CLEAR_NO_RIPPLE = 262144

Disable the No Ripple flag, allowing rippling on this trust line.

TF_SET_AUTH = 65536

Authorize the other party to hold currency issued by this account. (No effect unless using the asfRequireAuth AccountSet flag.) Cannot be unset.

TF_SET_DEEP_FREEZE = 4194304

Deep freeze the trust line. Allowed only if the trustline is already regularly frozen, or if tfSetFreeze is set in the same transaction.

TF_SET_FREEZE = 1048576

Freeze the trust line.

TF_SET_NO_RIPPLE = 131072

Enable the No Ripple flag, which blocks rippling between two trust lines of the same currency if this flag is enabled on both.

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

Bases: TransactionFlagInterface

Transactions of the TrustSet type support additional values in the Flags field. This TypedDict represents those options.

TF_CLEAR_DEEP_FREEZE: bool
TF_CLEAR_FREEZE: bool
TF_CLEAR_NO_RIPPLE: bool
TF_INNER_BATCH_TXN: bool
TF_SET_AUTH: bool
TF_SET_DEEP_FREEZE: bool
TF_SET_FREEZE: bool
TF_SET_NO_RIPPLE: 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.VaultClawback(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, vault_id: str = <object object>, holder: str = <object object>, amount: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | None = None)

Bases: Transaction

The VaultClawback transaction performs a Clawback from the Vault, exchanging the shares of an account. Conceptually, the transaction performs VaultWithdraw on behalf of the Holder, sending the funds to the Issuer account of the asset.

In case there are insufficient funds for the entire Amount the transaction will perform a partial Clawback, up to the Vault.AssetAvailable.

The Clawback transaction must respect any future fees or penalties.

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 | MPTAmount | None = None

The asset amount to clawback. When Amount is 0 clawback all funds, up to the total shares the Holder owns.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

holder: str = <object object>

The account ID from which to clawback the assets.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'VaultClawback'
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.

vault_id: str = <object object>

The ID of the vault from which assets are withdrawn.

class xrpl.models.transactions.VaultCreate(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, asset: ~xrpl.models.currencies.issued_currency.IssuedCurrency | ~xrpl.models.currencies.mpt_currency.MPTCurrency | ~xrpl.models.currencies.xrp.XRP = <object object>, data: str | None = None, assets_maximum: str | None = None, mptoken_metadata: str | None = None, domain_id: str | None = None, scale: int | None = None, withdrawal_policy: int | ~xrpl.models.transactions.vault_create.WithdrawalPolicy | None = None)

Bases: Transaction

The VaultCreate transaction creates a new Vault object.

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: IssuedCurrency | MPTCurrency | XRP = <object object>

The asset (XRP, IOU or MPT) of the Vault.

assets_maximum: str | None = None

The maximum asset amount that can be held in a vault.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

data: str | None = None

Arbitrary Vault metadata, limited to 256 bytes.

delegate: str | None = None

The delegate account that is sending the transaction.

domain_id: str | None = None

The PermissionedDomain object ID associated with the shares of this Vault.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

mptoken_metadata: str | None = None

Arbitrary metadata about this issuance, in hex format, limited to 1024 bytes. Use encode_mptoken_metadata to convert from a JSON object to this format. Use decode_mptoken_metadata to convert from this format to a JSON object.

While adherence to the XLS-89d format is not mandatory, non-compliant metadata may not be discoverable by ecosystem tools such as explorers and indexers.

network_id: int | None = None

The network id of the transaction.

scale: int | None = None

(Trust line tokens only) Specifies decimal precision for share calculations. Assets are multiplied by 10^Scale to convert fractional amounts into whole number shares. For example, with a Scale of 6, depositing 20.3 units creates 20,300,000 shares (20.3 × 10^Scale). For trust line tokens this can be configured at vault creation, and valid values are between 0-18, with the default being 6. For XRP and MPTs, this is fixed at 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 = 'VaultCreate'
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.

withdrawal_policy: int | WithdrawalPolicy | None = None

Indicates the withdrawal strategy used by the Vault. The below withdrawal policy is supported:

Strategy Name Value Description vaultStrategyFirstComeFirstServe 1 Requests are processed on a first-

come-first-serve basis.

class xrpl.models.transactions.VaultDelete(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, vault_id: str = <object object>)

Bases: Transaction

The VaultDelete transaction deletes an existing vault object.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'VaultDelete'
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.

vault_id: str = <object object>

The ID of the vault to be deleted.

class xrpl.models.transactions.VaultDeposit(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, vault_id: str = <object object>, amount: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str = <object object>)

Bases: Transaction

The VaultDeposit transaction adds Liqudity in exchange for vault shares.

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 | MPTAmount | str = <object object>

Asset amount to deposit.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'VaultDeposit'
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.

vault_id: str = <object object>

The ID of the vault to which the assets are deposited.

class xrpl.models.transactions.VaultSet(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, vault_id: str = <object object>, domain_id: str | None = None, data: str | None = None, assets_maximum: str | None = None)

Bases: Transaction

The VaultSet updates an existing Vault ledger object.

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.

assets_maximum: str | None = None

The maximum asset amount that can be held in a vault. The value cannot be lower than the current AssetTotal unless the value is 0.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

data: str | None = None

Arbitrary Vault metadata, limited to 256 bytes.

delegate: str | None = None

The delegate account that is sending the transaction.

domain_id: str | None = None

The PermissionedDomain object ID associated with the shares of this Vault.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'VaultSet'
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.

vault_id: str = <object object>

The ID of the Vault to be modified. Must be included when updating the Vault.

class xrpl.models.transactions.VaultWithdraw(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, vault_id: str = <object object>, amount: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str = <object object>, destination: str | None = None, destination_tag: int | None = None)

Bases: Transaction

The VaultWithdraw transaction withdraws assets in exchange for the vault’s shares.

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 | MPTAmount | str = <object object>

The exact amount of Vault asset to withdraw.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

destination: str | None = None

An account to receive the assets. It must be able to receive the asset.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'VaultWithdraw'
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.

vault_id: str = <object object>

The ID of the vault from which assets are withdrawn.

class xrpl.models.transactions.XChainAccountCreateCommit(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, xchain_bridge: XChainBridge = <object object>, signature_reward: str = <object object>, destination: str = <object object>, amount: str = <object object>)

Bases: Transaction

Represents a XChainAccountCreateCommit transaction on the XRP Ledger. The XChainAccountCreateCommit transaction creates a new account on one of the chains a bridge connects, which serves as the bridge entrance for that chain.

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: str

The amount, in XRP, to use for account creation. This must be greater than or equal to the MinAccountCreateAmount specified in the Bridge ledger object. This field is required.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

destination: str

The destination account on the destination chain. 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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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.

signature_reward: str

The amount, in XRP, to be used to reward the witness servers for providing signatures. This must match the amount on the Bridge ledger object. This field is required.

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 = 'XChainAccountCreateCommit'
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.

xchain_bridge: XChainBridge

The bridge to create accounts for. This field is required.

class xrpl.models.transactions.XChainAddAccountCreateAttestation(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, xchain_bridge: XChainBridge = <object object>, public_key: str = <object object>, signature: str = <object object>, other_chain_source: str = <object object>, amount: Amount = <object object>, attestation_reward_account: str = <object object>, attestation_signer_account: str = <object object>, was_locking_chain_send: Union[Literal[0], Literal[1]] = <object object>, xchain_account_create_count: Union[str, int] = <object object>, destination: str = <object object>, signature_reward: Amount = <object object>)

Bases: Transaction

Represents a XChainAddAccountCreateAttestation transaction. The XChainAddAccountCreateAttestation transaction provides an attestation from a witness server that a XChainAccountCreateCommit transaction occurred on the other chain.

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 committed by the XChainAccountCreateCommit transaction on the source chain. This field is required.

attestation_reward_account: str

The account that should receive this signer’s share of the SignatureReward. This field is required.

attestation_signer_account: str

The account on the door account’s signer list that is signing the transaction. This field is required.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

destination: str

The destination account for the funds on the destination chain. 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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

other_chain_source: str

The account on the source chain that submitted the XChainAccountCreateCommit transaction that triggered the event associated with the attestation. This field is required.

public_key: str

The public key used to verify the signature. 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.

signature: str

The signature attesting to the event on the other chain. This field is required.

signature_reward: Amount

The signature reward paid in the XChainAccountCreateCommit transaction. This field is required.

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 = 'XChainAddAccountCreateAttestation'
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.

was_locking_chain_send: Literal[0] | Literal[1]

A boolean representing the chain where the event occurred. This field is required.

xchain_account_create_count: str | int

The counter that represents the order that the claims must be processed in. This field is required.

xchain_bridge: XChainBridge

The bridge associated with the attestation. This field is required.

class xrpl.models.transactions.XChainAddClaimAttestation(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, xchain_bridge: XChainBridge = <object object>, public_key: str = <object object>, signature: str = <object object>, other_chain_source: str = <object object>, amount: Amount = <object object>, attestation_reward_account: str = <object object>, attestation_signer_account: str = <object object>, was_locking_chain_send: Union[Literal[0], Literal[1]] = <object object>, xchain_claim_id: Union[str, int] = <object object>, destination: Optional[str] = None)

Bases: Transaction

Represents a XChainAddClaimAttestation transaction. The XChainAddClaimAttestation transaction provides proof from a witness server, attesting to an XChainCommit 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.

amount: Amount

The amount committed by the XChainCommit transaction on the source chain. This field is required.

attestation_reward_account: str

The account that should receive this signer’s share of the SignatureReward. This field is required.

attestation_signer_account: str

The account on the door account’s signer list that is signing the transaction. This field is required.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

destination: str | None

The destination account for the funds on the destination chain (taken from the XChainCommit transaction).

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

other_chain_source: str

The account on the source chain that submitted the XChainCommit transaction that triggered the event associated with the attestation. This field is required.

public_key: str

The public key used to verify the signature. 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.

signature: str

The signature attesting to the event on the other chain. This field is required.

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 = 'XChainAddClaimAttestation'
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.

was_locking_chain_send: Literal[0] | Literal[1]

A boolean representing the chain where the event occurred. This field is required.

xchain_bridge: XChainBridge

The bridge to use to transfer funds. This field is required.

xchain_claim_id: str | int

The XChainClaimID associated with the transfer, which was included in the XChainCommit transaction. This field is required.

class xrpl.models.transactions.XChainClaim(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, xchain_bridge: XChainBridge = <object object>, xchain_claim_id: Union[int, str] = <object object>, destination: str = <object object>, destination_tag: Optional[int] = None, amount: Amount = <object object>)

Bases: Transaction

Represents a XChainClaim transaction. The XChainClaim transaction completes a cross-chain transfer of value. It allows a user to claim the value on the destination chain - the equivalent of the value locked on the source chain.

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 to claim on the destination chain. This must match the amount attested to on the attestations associated with this XChainClaimID. This field is required.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

destination: str

The destination account on the destination chain. It must exist or the transaction will fail. However, if the transaction fails in this case, the sequence number and collected signatures won’t be destroyed, and the transaction can be rerun with a different destination. This field is required.

destination_tag: int | None

An integer destination tag.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

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 = 'XChainClaim'
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.

xchain_bridge: XChainBridge

The bridge to use for the transfer. This field is required.

xchain_claim_id: int | str

The unique integer ID for the cross-chain transfer that was referenced in the corresponding XChainCommit transaction. This field is required.

class xrpl.models.transactions.XChainCommit(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, xchain_bridge: ~xrpl.models.xchain_bridge.XChainBridge = <object object>, xchain_claim_id: int | str = <object object>, amount: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str = <object object>, other_chain_destination: str | None = None)

Bases: Transaction

Represents a XChainCommit transaction. The XChainCommit transaction is the second step in a cross-chain transfer. It puts assets into trust on the locking chain so that they can be wrapped on the issuing chain, or burns wrapped assets on the issuing chain so that they can be returned on the locking chain.

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 | MPTAmount | str

The asset to commit, and the quantity. This must match the door account’s LockingChainIssue (if on the locking chain) or the door account’s IssuingChainIssue (if on the issuing chain). This field is required.

blob() str

Creates the canonical binary format of the Transaction object.

Returns:

The binary-encoded object, as a hexadecimal string.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

other_chain_destination: str | None

The destination account on the destination chain. If this is not specified, the account that submitted the XChainCreateClaimID transaction on the destination chain will need to submit a XChainClaim transaction to claim the funds.

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 = 'XChainCommit'
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.

xchain_bridge: XChainBridge

The bridge to use to transfer funds. This field is required.

xchain_claim_id: int | str

The unique integer ID for a cross-chain transfer. This must be acquired on the destination chain (via a XChainCreateClaimID transaction) and checked from a validated ledger before submitting this transaction. If an incorrect sequence number is specified, the funds will be lost. This field is required.

class xrpl.models.transactions.XChainCreateBridge(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, xchain_bridge: XChainBridge = <object object>, signature_reward: str = <object object>, min_account_create_amount: Optional[str] = None)

Bases: Transaction

Represents a XChainCreateBridge transaction. The XChainCreateBridge transaction creates a new Bridge ledger object and defines a new cross-chain bridge entrance on the chain that the transaction is submitted on. It includes information about door accounts and assets for the bridge.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

min_account_create_amount: str | None

The minimum amount, in XRP, required for a XChainAccountCreateCommit transaction. If this isn’t present, the XChainAccountCreateCommit transaction will fail. This field can only be present on XRP-XRP bridges.

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.

signature_reward: str

The total amount to pay the witness servers for their signatures. This amount will be split among the signers. This field is required.

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 = 'XChainCreateBridge'
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.

xchain_bridge: XChainBridge

The bridge (door accounts and assets) to create. This field is required.

class xrpl.models.transactions.XChainCreateClaimID(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, xchain_bridge: XChainBridge = <object object>, signature_reward: str = <object object>, other_chain_source: str = <object object>)

Bases: Transaction

Represents a XChainCreateClaimID transaction. The XChainCreateClaimID transaction creates a new cross-chain claim ID that is used for a cross-chain transfer. A cross-chain claim ID represents one cross-chain transfer of value.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

network_id: int | None = None

The network id of the transaction.

other_chain_source: str

The account that must send the corresponding XChainCommit transaction on the source chain. 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.

signature_reward: str

The amount, in XRP, to reward the witness servers for providing signatures. This must match the amount on the Bridge ledger object. This field is required.

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 = 'XChainCreateClaimID'
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.

xchain_bridge: XChainBridge

The bridge to create the claim ID for. This field is required.

class xrpl.models.transactions.XChainModifyBridge(*, account: str = <object object>, fee: Optional[str] = None, sequence: Optional[int] = None, account_txn_id: Optional[str] = None, flags: Optional[Union[Dict[str, bool], int, List[int]]] = None, last_ledger_sequence: Optional[int] = None, memos: Optional[List[Memo]] = None, signers: Optional[List[Signer]] = None, source_tag: Optional[int] = None, signing_pub_key: str = '', ticket_sequence: Optional[int] = None, txn_signature: Optional[str] = None, network_id: Optional[int] = None, delegate: Optional[str] = None, xchain_bridge: XChainBridge = <object object>, signature_reward: Optional[str] = None, min_account_create_amount: Optional[str] = None)

Bases: Transaction

Represents a XChainModifyBridge transaction. The XChainModifyBridge transaction allows bridge managers to modify the parameters of the bridge.

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.

delegate: str | None = None

The delegate account that is sending the transaction.

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] | None = None

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]) Self

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]) Self

Creates a Transaction object based on a JSON or JSON-string representation of data

In Payment transactions, the DeliverMax field is renamed to the Amount field.

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A Transaction object instantiated from the input.

Raises:

XRPLModelException – If Payment transactions have different values for amount and deliver_max fields

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.

Raises:

XRPLModelException – if self.flags is invalid.

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. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

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.

memos: List[Memo] | None = None

Additional arbitrary information attached to this transaction.

min_account_create_amount: str | None

The minimum amount, in XRP, required for a XChainAccountCreateCommit transaction. If this is not present, the XChainAccountCreateCommit transaction will fail. This field can only be present on XRP-XRP bridges.

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.

signature_reward: str | None

The signature reward split between the witnesses for submitting attestations.

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 = 'XChainModifyBridge'
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.

xchain_bridge: XChainBridge

The bridge to modify. This field is required.

class xrpl.models.transactions.XChainModifyBridgeFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: int, Enum

Transactions of the XChainModifyBridge type support additional values in the Flags field. This enum represents those options.

TF_CLEAR_ACCOUNT_CREATE_AMOUNT = 65536
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.XChainModifyBridgeFlagInterface

Bases: TransactionFlagInterface

Transactions of the XChainModifyBridge type support additional values in the Flags field. This TypedDict represents those options.

TF_CLEAR_ACCOUNT_CREATE_AMOUNT: bool
TF_INNER_BATCH_TXN: 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