XRPL Pseudo-Transaction Models

Model objects for specific types of Pseudo-Transactions in the XRP Ledger.

class xrpl.models.transactions.pseudo_transactions.EnableAmendment(*args: List[Any], **kwargs: Dict[str, Any])

Bases: xrpl.models.transactions.pseudo_transactions.pseudo_transaction.PseudoTransaction

An EnableAmendment pseudo-transaction marks a change in status of an amendment to the XRP Ledger protocol, including:

  • A proposed amendment gained supermajority approval from validators.

  • A proposed amendment lost supermajority approval.

  • A proposed amendment has been enabled.

account: str

The address of the sender of the transaction. Required.

account_txn_id: Optional[str] = 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.

amendment: str

A unique identifier for the amendment. This is not intended to be a human-readable name. See Amendments for a list of known amendments. This field is required.

fee: str = '0'

(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.

flags: Union[int, List[int]] = 0

The Flags value of the EnableAmendment pseudo-transaction indicates the status of the amendment at the time of the ledger including the pseudo-transaction. A Flags value of 0 (no flags) or an omitted Flags field indicates that the amendment has been enabled, and applies to all ledgers afterward.

classmethod from_dict(value: Dict[str, Any]) xrpl.models.transactions.transaction.Transaction

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: Union[str, Dict[str, Any]]) xrpl.models.base_model.BaseModel

Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.

Parameters

value – The dictionary or JSON string to be instantiated.

Returns

A BaseModel object instantiated from the input.

get_hash() str

Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.

Returns

The hash of the Transaction object.

Raises

XRPLModelException – if the Transaction is unsigned.

classmethod get_transaction_type(transaction_type: str) Type[xrpl.models.transactions.transaction.Transaction]

Returns the correct transaction type based on the string name.

Parameters

transaction_type – The String name of the Transaction object.

Returns

The transaction class with the given name.

Raises

XRPLModelException – If transaction_type is not a valid Transaction type.

has_flag(flag: int) bool

Returns whether the transaction has the given flag value set.

Parameters

flag – The given flag value for which the function will determine whether it is set.

Returns

Whether the transaction has the given flag value set.

classmethod is_dict_of_model(dictionary: Dict[str, Any]) bool

Checks whether the provided dictionary is a dictionary representation of this class.

Note: This only checks the exact model, and does not count model inheritance. This method returns False if the dictionary represents a subclass of this class.

Parameters

dictionary – The dictionary to check.

Returns

True if dictionary is a dict representation of an instance of this class; False if not.

is_valid() bool

Returns whether this BaseModel is valid.

Returns

Whether this BaseModel is valid.

last_ledger_sequence: Optional[int] = 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.

ledger_sequence: int

The ledger index where this pseudo-transaction appears. This distinguishes the pseudo-transaction from other occurrences of the same change. This field is required.

memos: Optional[List[Memo]] = None

Additional arbitrary information attached to this transaction.

sequence: int = 0

(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.

signers: Optional[List[Signer]] = 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: None = None

An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.

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: xrpl.models.transactions.types.pseudo_transaction_type.PseudoTransactionType = 'EnableAmendment'
txn_signature: str = ''

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.pseudo_transactions.EnableAmendmentFlag(value)

Bases: int, enum.Enum

The Flags value of the EnableAmendment pseudo-transaction indicates the status of the amendment at the time of the ledger including the pseudo-transaction.

A Flags value of 0 (no flags) or an omitted Flags field indicates that the amendment has been enabled, and applies to all ledgers afterward.

See EnableAmendment Flags

TF_GOT_MAJORITY = 65536

Support for this amendment increased to at least 80% of trusted validators starting with this ledger version.

TF_LOST_MAJORITY = 131072

Support for this amendment decreased to less than 80% of trusted validators starting with this ledger version.

class xrpl.models.transactions.pseudo_transactions.SetFee(*args: List[Any], **kwargs: Dict[str, Any])

Bases: xrpl.models.transactions.pseudo_transactions.pseudo_transaction.PseudoTransaction

A SetFee pseudo-transaction marks a change in transaction cost or reserve requirements as a result of Fee Voting.

account: str

The address of the sender of the transaction. Required.

account_txn_id: Optional[str] = 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.

base_fee: str

The charge, in drops of XRP, for the reference transaction, as hex. (This is the transaction cost before scaling for load.) This field is required.

fee: str = '0'

(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.

flags: Union[int, List[int]] = 0

A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.

classmethod from_dict(value: Dict[str, Any]) xrpl.models.transactions.transaction.Transaction

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: Union[str, Dict[str, Any]]) xrpl.models.base_model.BaseModel

Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.

Parameters

value – The dictionary or JSON string to be instantiated.

Returns

A BaseModel object instantiated from the input.

get_hash() str

Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.

Returns

The hash of the Transaction object.

Raises

XRPLModelException – if the Transaction is unsigned.

classmethod get_transaction_type(transaction_type: str) Type[xrpl.models.transactions.transaction.Transaction]

Returns the correct transaction type based on the string name.

Parameters

transaction_type – The String name of the Transaction object.

Returns

The transaction class with the given name.

Raises

XRPLModelException – If transaction_type is not a valid Transaction type.

has_flag(flag: int) bool

Returns whether the transaction has the given flag value set.

Parameters

flag – The given flag value for which the function will determine whether it is set.

Returns

Whether the transaction has the given flag value set.

classmethod is_dict_of_model(dictionary: Dict[str, Any]) bool

Checks whether the provided dictionary is a dictionary representation of this class.

Note: This only checks the exact model, and does not count model inheritance. This method returns False if the dictionary represents a subclass of this class.

Parameters

dictionary – The dictionary to check.

Returns

True if dictionary is a dict representation of an instance of this class; False if not.

is_valid() bool

Returns whether this BaseModel is valid.

Returns

Whether this BaseModel is valid.

last_ledger_sequence: Optional[int] = 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.

ledger_sequence: Optional[int] = None

The index of the ledger version where this pseudo-transaction appears. This distinguishes the pseudo-transaction from other occurrences of the same change. This field is omitted for some historical SetFee pseudo-transactions.

memos: Optional[List[Memo]] = None

Additional arbitrary information attached to this transaction.

reference_fee_units: int

The cost, in fee units, of the reference transaction. This field is required.

reserve_base: int

The base reserve, in drops. This field is required.

reserve_increment: int

The incremental reserve, in drops. This field is required.

sequence: int = 0

(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.

signers: Optional[List[Signer]] = 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: None = None

An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.

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: xrpl.models.transactions.types.pseudo_transaction_type.PseudoTransactionType = 'SetFee'
txn_signature: str = ''

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.pseudo_transactions.UNLModify(*args: List[Any], **kwargs: Dict[str, Any])

Bases: xrpl.models.transactions.pseudo_transactions.pseudo_transaction.PseudoTransaction

A UNLModify pseudo-transaction marks a change to the Negative UNL, indicating that a trusted validator has gone offline or come back online.

account: str

The address of the sender of the transaction. Required.

account_txn_id: Optional[str] = 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.

fee: str = '0'

(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.

flags: int = 0

The Flags value of the EnableAmendment pseudo-transaction indicates the status of the amendment at the time of the ledger including the pseudo-transaction. A Flags value of 0 (no flags) or an omitted Flags field indicates that the amendment has been enabled, and applies to all ledgers afterward.

classmethod from_dict(value: Dict[str, Any]) xrpl.models.transactions.transaction.Transaction

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: Union[str, Dict[str, Any]]) xrpl.models.base_model.BaseModel

Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.

Parameters

value – The dictionary or JSON string to be instantiated.

Returns

A BaseModel object instantiated from the input.

get_hash() str

Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.

Returns

The hash of the Transaction object.

Raises

XRPLModelException – if the Transaction is unsigned.

classmethod get_transaction_type(transaction_type: str) Type[xrpl.models.transactions.transaction.Transaction]

Returns the correct transaction type based on the string name.

Parameters

transaction_type – The String name of the Transaction object.

Returns

The transaction class with the given name.

Raises

XRPLModelException – If transaction_type is not a valid Transaction type.

has_flag(flag: int) bool

Returns whether the transaction has the given flag value set.

Parameters

flag – The given flag value for which the function will determine whether it is set.

Returns

Whether the transaction has the given flag value set.

classmethod is_dict_of_model(dictionary: Dict[str, Any]) bool

Checks whether the provided dictionary is a dictionary representation of this class.

Note: This only checks the exact model, and does not count model inheritance. This method returns False if the dictionary represents a subclass of this class.

Parameters

dictionary – The dictionary to check.

Returns

True if dictionary is a dict representation of an instance of this class; False if not.

is_valid() bool

Returns whether this BaseModel is valid.

Returns

Whether this BaseModel is valid.

last_ledger_sequence: Optional[int] = 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.

ledger_sequence: int

The ledger index where this pseudo-transaction appears. This distinguishes the pseudo-transaction from other occurrences of the same change. This field is required.

memos: Optional[List[Memo]] = None

Additional arbitrary information attached to this transaction.

sequence: int = 0

(Auto-fillable) The sequence number of the transaction. Must match the sending account’s next unused sequence number. See Account Sequence for details.

signers: Optional[List[Signer]] = 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: None = None

An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.

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: PseudoTransactionType = 'UNLModify'
txn_signature: str = ''

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

unl_modify_disabling: int

If 1, this change represents adding a validator to the Negative UNL. If 0, this change represents removing a validator from the Negative UNL. (No other values are allowed.) This field is required.

unl_modify_validator: str

The validator to add or remove, as identified by its master public key. This field is required.

validate() None

Raises if this object is invalid.

Raises

XRPLModelException – if this object is invalid.