XRPL Transaction Models¶
Use these models to prepare or process XRP Ledger transactions.
Base Transaction Model¶
- class xrpl.models.transactions.transaction.Transaction(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
BaseModel
The base class for all transaction types. Represents fields common to all transaction types.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Union[TransactionType, PseudoTransactionType] = <object object>¶
- txn_signature: Optional[str] = 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.AccountDelete(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an AccountDelete transaction, which deletes an account and any objects it owns in the XRP Ledger, if possible, sending the account’s remaining XRP to a specified destination account.
See Deletion of Accounts for the requirements to delete an account.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- destination: str¶
The address of the account to which to send any remaining XRP. This field is required.
- destination_tag: Optional[int] = None¶
The destination tag at the
destination
account where funds should be sent.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.AccountSet(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an AccountSet transaction, which modifies the properties of an account in the XRP Ledger.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- clear_flag: Optional[int] = None¶
Disable a specific AccountSet Flag
- domain: Optional[str] = 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: Optional[str] = None¶
Set the MD5 Hash to be used for generating an avatar image for this account.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- message_key: Optional[str] = None¶
Set a public key for sending encrypted messages to this account.
- nftoken_minter: Optional[str] = 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 AccountSetFlag.ASF_AUTHORIZED_NFTOKEN_MINTER flag.
- sequence: Optional[int] = 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: Optional[int] = None¶
Enable a specific AccountSet Flag
- 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- tick_size: Optional[int] = 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: Optional[int] = 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: Optional[int] = None¶
Set the transfer fee to use for tokens issued by this account. See TransferRate for details.
- txn_signature: Optional[str] = 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.AccountSetFlag(value)¶
Bases:
int
,Enum
There are several options which can be either enabled or disabled for an account. Account options are represented by different types of flags depending on the situation. The AccountSet transaction type has several “AccountSet Flags” (prefixed asf) that can enable an option when passed as the SetFlag parameter, or disable an option when passed as the ClearFlag parameter. This enum represents those options.
- ASF_ACCOUNT_TXN_ID = 5¶
Track the ID of this account’s most recent transaction. Required for AccountTxnID
- ASF_AUTHORIZED_NFTOKEN_MINTER = 10¶
Allow another account to mint and burn tokens on behalf of this account.
- ASF_DEPOSIT_AUTH = 9¶
Enable Deposit Authorization on this account.
- ASF_DISABLE_INCOMING_CHECK = 13¶
Disallow other accounts from creating Checks directed at this account.
- ASF_DISABLE_INCOMING_NFTOKEN_OFFER = 12¶
Disallow other accounts from creating NFTokenOffers directed at this account.
- ASF_DISABLE_INCOMING_PAYCHAN = 14¶
Disallow other accounts from creating PayChannels directed at this account.
- ASF_DISABLE_INCOMING_TRUSTLINE = 15¶
Disallow other accounts from creating Trustlines directed at this account.
- ASF_DISABLE_MASTER = 4¶
Disallow use of the master key pair. Can only be enabled if the account has configured another way to sign transactions, such as a Regular Key or a Signer List.
- ASF_DISALLOW_XRP = 3¶
XRP should not be sent to this account. (Enforced by client applications)
- ASF_NO_FREEZE = 6¶
Permanently give up the ability to freeze individual trust lines or disable Global Freeze. This flag can never be disabled after being enabled.
- ASF_REQUIRE_AUTH = 2¶
Require authorization for users to hold balances issued by this address. Can only be enabled if the address has no trust lines connected to it.
- ASF_REQUIRE_DEST = 1¶
Require a destination tag to send transactions to this account.
- class xrpl.models.transactions.AccountSetFlagInterface(**kwargs)¶
Bases:
dict
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 TypedDict represents those options.
- ASF_ACCOUNT_TXN_ID: bool¶
- ASF_AUTHORIZED_NFTOKEN_MINTER: bool¶
- ASF_DEFAULT_RIPPLE: bool¶
- ASF_DEPOSIT_AUTH: bool¶
- ASF_DISABLE_INCOMING_CHECK: bool¶
- ASF_DISABLE_INCOMING_NFTOKEN_OFFER: bool¶
- ASF_DISABLE_INCOMING_PAYCHAN: bool¶
- ASF_DISABLE_INCOMING_TRUSTLINE: bool¶
- ASF_DISABLE_MASTER: bool¶
- ASF_DISALLOW_XRP: bool¶
- ASF_GLOBAL_FREEZE: bool¶
- ASF_NO_FREEZE: bool¶
- ASF_REQUIRE_AUTH: bool¶
- ASF_REQUIRE_DEST: 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 key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D 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(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a CheckCancel transaction, which cancels an unredeemed Check, removing it from the ledger without sending any money. The source or the destination of the check can cancel a Check at any time using this transaction type. If the Check has expired, any address can cancel it.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- check_id: str¶
The ID of the Check ledger object to cancel, as a 64-character hexadecimal string. This field is required.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.CheckCash(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a CheckCash transaction, which redeems a Check object to receive up to the amount authorized by the corresponding CheckCreate transaction. Only the Destination address of a Check can cash it.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- amount: Optional[Amount] = 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
.
- check_id: str¶
The ID of the Check ledger object to cash, as a 64-character hexadecimal string. This field is required.
- deliver_min: Optional[Amount] = None¶
Redeem the Check for at least this amount and for as much as possible. The currency must match that of the
SendMax
of the corresponding CheckCreate transaction. You must provide either this field orAmount
.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.CheckCreate(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a CheckCreate transaction, which creates a Check object. A Check object is a deferred payment that can be cashed by its intended destination. The sender of this transaction is the sender of the Check.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- destination_tag: Optional[int] = None¶
An arbitrary destination tag that identifies the reason for the Check, or a hosted recipient to pay.
- expiration: Optional[int] = None¶
Time after which the Check is no longer valid, in seconds since the Ripple Epoch.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- invoice_id: Optional[str] = None¶
Arbitrary 256-bit hash representing a specific reason or identifier for this Check.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- send_max: Union[IssuedCurrencyAmount, str]¶
Maximum amount of source token the Check is allowed to debit the sender, including transfer fees on non-XRP tokens. The Check can only credit the destination with the same token (from the same issuer, for non-XRP tokens). This field is required.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.DepositPreauth(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a DepositPreauth transaction, which gives another account pre-approval to deliver payments to the sender of this transaction, if this account is using Deposit Authorization.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- authorize: Optional[str] = None¶
Grant preauthorization to this address. You must provide this OR
unauthorize
but not both.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- unauthorize: Optional[str] = None¶
Revoke preauthorization from this address. You must provide this OR
authorize
but not both.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.EscrowCancel(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an EscrowCancel transaction, which returns escrowed XRP to the sender after the Escrow has expired.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.EscrowCreate(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an EscrowCreate transaction, which locks up XRP until a specific time or condition is met.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- amount: Amount¶
Amount of XRP, in drops, to deduct from the sender’s balance and set aside in escrow. This field is required.
- cancel_after: Optional[int] = None¶
The time, in seconds since the Ripple Epoch, when this escrow expires. This value is immutable; the funds can only be returned the sender after this time.
- condition: Optional[str] = None¶
Hex value representing a PREIMAGE-SHA-256 crypto-condition The funds can only be delivered to the recipient if this condition is fulfilled.
- destination: str¶
The address that should receive the escrowed XRP when the time or condition is met. This field is required.
- destination_tag: Optional[int] = None¶
An arbitrary destination tag that identifies the reason for the Escrow, or a hosted recipient to pay.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- finish_after: Optional[int] = 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: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.EscrowFinish(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an EscrowFinish transaction, delivers XRP from a held payment to the recipient.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- condition: Optional[str] = None¶
The previously-supplied PREIMAGE-SHA-256 crypto-condition of the Escrow, if any, as hexadecimal.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- fulfillment: Optional[str] = None¶
The PREIMAGE-SHA-256 crypto-condition fulfillment matching the Escrow’s condition, if any, as hexadecimal.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.Memo(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
NestedModel
An arbitrary piece of data attached to a transaction. A transaction can have multiple Memo objects as an array in the Memos field. Must contain one or more of
memo_data
,memo_format
, andmemo_type
.- classmethod from_dict(value: Dict[str, Any]) NM ¶
Construct a new NestedModel from a dictionary of parameters.
- Parameters:
value – The value to construct the NestedModel from.
- Returns:
A new NestedModel object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Returns True if the input dictionary was derived by the to_dict method of an instance of this class. In other words, True if this is a dictionary representation of an instance of this class.
NOTE: does not account for model inheritance, IE will only return True if dictionary represents an instance of this class, but not if dictionary represents an instance of a subclass of this class.
- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a dict representation of an instance of this class.
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- memo_data: Optional[str] = None¶
The data of the memo, as a hexadecimal string.
- memo_format: Optional[str] = None¶
The format of the memo, as a hexadecimal string. Conventionally, this should be the MIME type of the memo data.
- memo_type: Optional[str] = None¶
The type of the memo, as a hexadecimal string. Conventionally, this should be an RFC 5988 relation defining the format of the memo data.
- to_dict() Dict[str, Any] ¶
Returns the dictionary representation of a NestedModel.
- Returns:
The dictionary representation of a NestedModel.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenAcceptOffer(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenOfferAccept transaction is used to accept offers to buy or sell an NFToken. It can either:
Allow one offer to be accepted. This is called direct mode.
Allow two distinct offers, one offering to buy a given NFToken and the other offering to sell the same NFToken, to be accepted in an atomic fashion. This is called brokered mode.
To indicate direct mode, use either the nftoken_sell_offer or nftoken_buy_offer fields, but not both. To indicate brokered mode, use both the nftoken_sell_offer and nftoken_buy_offer fields. If you use neither nftoken_sell_offer nor nftoken_buy_offer, the transaction is invalid.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- nftoken_broker_fee: Optional[Amount] = 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: Optional[str] = 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: Optional[str] = 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenBurn(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenBurn transaction is used to remove an NFToken object from the NFTokenPage in which it is being held, effectively removing the token from the ledger (“burning” it).
If this operation succeeds, the corresponding NFToken is removed. If this operation empties the NFTokenPage holding the NFToken or results in the consolidation, thus removing an NFTokenPage, the owner’s reserve requirement is reduced by one.
- account: str¶
Identifies the AccountID that submitted this transaction. The account must be the present owner of the token or, if the lsfBurnable flag is set on the NFToken, either the issuer account or an account authorized by the issuer (i.e. MintAccount). This field is required.
- account_txn_id: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- nftoken_id: str¶
Identifies the NFToken to be burned. This field is required.
- owner: Optional[str] = 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenCancelOffer(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenCancelOffer transaction deletes existing NFTokenOffer objects. It is useful if you want to free up space on your account to lower your reserve requirement.
The transaction can be executed by the account that originally created the NFTokenOffer, the account in the Recipient field of the NFTokenOffer (if present), or any account if the NFTokenOffer has an Expiration and the NFTokenOffer has already expired.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.NFTokenCreateOffer(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenCreateOffer transaction creates either an offer to buy an NFT the submitting account does not own, or an offer to sell an NFT the submitting account does own.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- 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.
- destination: Optional[str] = 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: Optional[int] = 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- nftoken_id: str¶
Identifies the TokenID of the NFToken object that the offer references. This field is required.
- owner: Optional[str] = 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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)¶
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.
- class xrpl.models.transactions.NFTokenCreateOfferFlagInterface(**kwargs)¶
Bases:
dict
Transaction Flags for an NFTokenCreateOffer Transaction.
- TF_SELL_NFTOKEN: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.NFTokenMint(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
The NFTokenMint transaction creates an NFToken object and adds it to the relevant NFTokenPage object of the minter. If the transaction is successful, the newly minted token will be owned by the minter account specified by the transaction.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- issuer: Optional[str] = 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: 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.
- 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- uri: Optional[str] = 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)¶
Bases:
int
,Enum
Transaction Flags for an NFTokenMint Transaction.
- TF_BURNABLE = 1¶
If set, indicates that the minted token may be burned by the issuer even if the issuer does not currently hold the token. The current holder of the token may always burn it.
- TF_ONLY_XRP = 2¶
If set, indicates that the token may only be offered or sold for XRP.
- TF_TRANSFERABLE = 8¶
If set, indicates that this NFT can be transferred. This flag has no effect if the token is being transferred from the issuer or to the issuer.
- TF_TRUSTLINE = 4¶
If set, indicates that the issuer wants a trustline to be automatically created.
- class xrpl.models.transactions.NFTokenMintFlagInterface(**kwargs)¶
Bases:
dict
Transaction Flags for an NFTokenMint Transaction.
- TF_BURNABLE: bool¶
- TF_ONLY_XRP: bool¶
- TF_TRANSFERABLE: bool¶
- TF_TRUSTLINE: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.OfferCancel(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an OfferCancel transaction, which removes an Offer object from the decentralized exchange.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = None¶
The cryptographic signature from the sender that authorizes this transaction. Automatically added during signing.
- validate() None ¶
Raises if this object is invalid.
- Raises:
XRPLModelException – if this object is invalid.
- class xrpl.models.transactions.OfferCreate(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents an OfferCreate transaction, which executes a limit order in the decentralized exchange. If the specified exchange cannot be completely fulfilled, it creates an Offer object for the remainder. Offers can be partially fulfilled.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- expiration: Optional[int] = None¶
Time after which the offer is no longer active, in seconds since the Ripple Epoch.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- offer_sequence: Optional[int] = None¶
The Sequence number (or Ticket number) of a previous OfferCreate to cancel when placing this Offer.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- taker_gets: Union[IssuedCurrencyAmount, str]¶
The amount and type of currency being provided by the sender of this transaction. This field is required.
- taker_pays: Union[IssuedCurrencyAmount, str]¶
The amount and type of currency the sender of this transaction wants in exchange for the full
taker_gets
amount. This field is required.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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)¶
Bases:
int
,Enum
Transactions of the OfferCreate type support additional values in the Flags field. This enum represents those options.
- TF_FILL_OR_KILL = 262144¶
Treat the offer as a Fill or Kill order. Only try to match existing offers in the ledger, and only do so if the entire TakerPays quantity can be obtained. If the fix1578 amendment is enabled and the offer cannot be executed when placed, the transaction has the result code tecKILLED; otherwise, the transaction uses the result code tesSUCCESS even when it was killed without trading any currency.
- TF_IMMEDIATE_OR_CANCEL = 131072¶
Treat the offer as an Immediate or Cancel order. If enabled, the offer never becomes a ledger object: it only tries to match existing offers in the ledger. If the offer cannot match any offers immediately, it executes “successfully” without trading any currency. In this case, the transaction has the result code tesSUCCESS, but creates no Offer objects in the ledger.
- TF_PASSIVE = 65536¶
If enabled, the offer does not consume offers that exactly match it, and instead becomes an Offer object in the ledger. It still consumes offers that cross it.
- TF_SELL = 524288¶
Exchange the entire TakerGets amount, even if it means obtaining more than the TakerPays amount in exchange.
- class xrpl.models.transactions.OfferCreateFlagInterface(**kwargs)¶
Bases:
dict
Transactions of the OfferCreate type support additional values in the Flags field. This TypedDict represents those options.
- TF_FILL_OR_KILL: bool¶
- TF_IMMEDIATE_OR_CANCEL: bool¶
- TF_PASSIVE: bool¶
- TF_SELL: bool¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D is empty.
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values ¶
- class xrpl.models.transactions.Payment(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a Payment <https://xrpl.org/payment.html>`_ transaction, which sends value from one account to another. (Depending on the path taken, this can involve additional exchanges of value, which occur atomically.) This transaction type can be used for several types of payments.
Payments are also the only way to create accounts.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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.
- 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.
- deliver_min: Optional[Amount] = 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: Optional[int] = None¶
An arbitrary destination tag that identifies the reason for the Payment, or a hosted recipient to pay.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- invoice_id: Optional[str] = None¶
Arbitrary 256-bit hash representing a specific reason or identifier for this Check.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- paths: Optional[List[Path]] = None¶
Array of payment paths to be used (for a cross-currency payment). Must be omitted for XRP-to-XRP transactions.
- send_max: Optional[Amount] = 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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(*args: List[Any], **kwargs: Dict[str, Any])¶
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: 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.
- amount: Optional[str] = None¶
The cumulative amount of XRP that has been authorized to deliver by the attached claim signature. Required unless closing the channel.
- balance: Optional[str] = None¶
The cumulative amount of XRP to have delivered through this channel after processing this claim. Required unless closing the channel.
- channel: str¶
The unique ID of the payment channel, as a 64-character hexadecimal string. This field is required.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- public_key: Optional[str] = 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: Optional[int] = 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: Optional[str] = None¶
The signature of the claim, as hexadecimal. This signature must be verifiable for the this channel and the given
public_key
andamount
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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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)¶
Bases:
int
,Enum
Transactions of the PaymentChannelClaim type support additional values in the Flags field. This enum represents those options.
- 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.
- class xrpl.models.transactions.PaymentChannelClaimFlagInterface(**kwargs)¶
Bases:
dict
Transactions of the PaymentChannelClaim type support additional values in the Flags field. This TypedDict represents those options.
- TF_CLOSE: 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 key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D 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(*args: List[Any], **kwargs: Dict[str, Any])¶
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: 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.
- amount: Union[IssuedCurrencyAmount, str]¶
The amount of XRP, in drops, to set aside in this channel. This field is required.
- cancel_after: Optional[int] = 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.
- 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: Optional[int] = None¶
An arbitrary destination tag that identifies the reason for the Payment Channel, or a hosted recipient to pay.
- fee: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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(*args: List[Any], **kwargs: Dict[str, Any])¶
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: 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.
- amount: str¶
The amount of XRP, in drops, to add to the channel. This field is required.
- channel: str¶
The unique ID of the payment channel, as a 64-character hexadecimal string. This field is required.
- expiration: Optional[int] = 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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)¶
Bases:
int
,Enum
Transactions of the Payment type support additional values in the Flags field. This enum represents those options.
- 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_DIRECT_RIPPLE = 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.
- class xrpl.models.transactions.PaymentFlagInterface(**kwargs)¶
Bases:
dict
Transactions of the Payment type support additional values in the Flags field. This TypedDict represents those options.
- TF_LIMIT_QUALITY: bool¶
- TF_NO_DIRECT_RIPPLE: 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 key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D 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.SetRegularKey(*args: List[Any], **kwargs: Dict[str, Any])¶
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: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- regular_key: Optional[str] = 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: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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(*args: List[Any], **kwargs: Dict[str, Any])¶
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]) NM ¶
Construct a new NestedModel from a dictionary of parameters.
- Parameters:
value – The value to construct the NestedModel from.
- Returns:
A new NestedModel object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Returns True if the input dictionary was derived by the to_dict method of an instance of this class. In other words, True if this is a dictionary representation of an instance of this class.
NOTE: does not account for model inheritance, IE will only return True if dictionary represents an instance of this class, but not if dictionary represents an instance of a subclass of this class.
- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a dict representation of an instance of this class.
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- 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(*args: List[Any], **kwargs: Dict[str, Any])¶
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]) NM ¶
Construct a new NestedModel from a dictionary of parameters.
- Parameters:
value – The value to construct the NestedModel from.
- Returns:
A new NestedModel object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Returns True if the input dictionary was derived by the to_dict method of an instance of this class. In other words, True if this is a dictionary representation of an instance of this class.
NOTE: does not account for model inheritance, IE will only return True if dictionary represents an instance of this class, but not if dictionary represents an instance of a subclass of this class.
- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a dict representation of an instance of this class.
- is_valid() bool ¶
Returns whether this BaseModel is valid.
- Returns:
Whether this BaseModel is valid.
- 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: Optional[str] = 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(*args: List[Any], **kwargs: Dict[str, Any])¶
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: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: Optional[List[SignerEntry]] = None¶
- signer_quorum: int¶
This field is required.
- 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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(*args: List[Any], **kwargs: Dict[str, Any])¶
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: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = 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: Optional[int] = 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: Optional[str] = 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(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
BaseModel
The base class for all transaction types. Represents fields common to all transaction types.
- account: str¶
The address of the sender of the transaction. Required.
- account_txn_id: 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Union[TransactionType, PseudoTransactionType] = <object object>¶
- txn_signature: Optional[str] = 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.TransactionMetadata(**kwargs)¶
Bases:
dict
A model for a transaction’s metadata.
- AffectedNodes: List[Union[CreatedNode, ModifiedNode, DeletedNode]]¶
- DeliveredAmount: typing_extensions.NotRequired[Union[IssuedCurrencyAmount, str]]¶
- TransactionIndex: int¶
- TransactionResult: str¶
- clear() None. Remove all items from D. ¶
- copy() a shallow copy of D ¶
- delivered_amount: typing_extensions.NotRequired[Union[IssuedCurrencyAmount, str, typing_extensions.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 key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D 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(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
Transaction
Represents a TrustSet transaction on the XRP Ledger. Creates or modifies a trust line linking two accounts.
- 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: Optional[str] = None¶
(Auto-fillable) The amount of XRP to destroy as a cost to send this transaction. See Transaction Cost for details.
- flags: Union[Dict[str, bool], int, List[int]] = 0¶
A List of flags, or a bitwise map of flags, modifying this transaction’s behavior. See Flags Field for more details.
- classmethod from_dict(value: Dict[str, Any]) T ¶
Construct a new Transaction from a dictionary of parameters.
- Parameters:
value – The value to construct the Transaction from.
- Returns:
A new Transaction object, constructed using the given parameters.
- Raises:
XRPLModelException – If the dictionary provided is invalid.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) BM ¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters:
value – The dictionary or JSON string to be instantiated.
- Returns:
A BaseModel object instantiated from the input.
- get_hash() str ¶
Hashes the Transaction object as the ledger does. Only valid for signed Transaction objects.
- Returns:
The hash of the Transaction object.
- Raises:
XRPLModelException – if the Transaction is unsigned.
- classmethod get_transaction_type(transaction_type: str) Type[Transaction] ¶
Returns the correct transaction type based on the string name.
- Parameters:
transaction_type – The String name of the Transaction object.
- Returns:
The transaction class with the given name.
- Raises:
XRPLModelException – If transaction_type is not a valid Transaction type.
- has_flag(flag: int) bool ¶
Returns whether the transaction has the given flag value set.
- Parameters:
flag – The given flag value for which the function will determine whether it is set.
- Returns:
Whether the transaction has the given flag value set.
- classmethod is_dict_of_model(dictionary: Any) bool ¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters:
dictionary – The dictionary to check.
- Returns:
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_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.
- limit_amount: IssuedCurrencyAmount¶
This field is required.
- quality_in: Optional[int] = None¶
- quality_out: Optional[int] = None¶
- sequence: Optional[int] = 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: 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: Optional[int] = None¶
An arbitrary source tag representing a hosted user or specific purpose at the sending account where this transaction comes from.
- ticket_sequence: Optional[int] = 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: Optional[str] = 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)¶
Bases:
int
,Enum
Transactions of the TrustSet type support additional values in the Flags field. This enum represents those options.
- 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_FREEZE = 1048576¶
Freeze the trust line.
- class xrpl.models.transactions.TrustSetFlagInterface(**kwargs)¶
Bases:
dict
Transactions of the TrustSet type support additional values in the Flags field. This TypedDict represents those options.
- TF_CLEAR_FREEZE: bool¶
- TF_CLEAR_NO_RIPPLE: bool¶
- TF_SET_AUTH: 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 key is not found, d is returned if given, otherwise KeyError is raised
- popitem() (k, v), remove and return some (key, value) pair as a ¶
2-tuple; but raise KeyError if D 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 ¶