XRPL Request Models

Base Request Model

class xrpl.models.requests.request.Request(method: ~xrpl.models.requests.request.RequestMethod = <object object>, id: int | str | None = None)

Bases: BaseModel

The base class for all network request types. Represents fields common to all request types.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

Specific Request Types

Request models.

class xrpl.models.requests.AMMInfo(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The amm_info method gets information about an Automated Market Maker (AMM) instance.

amm_account: str | None = None

The address of the AMM pool to look up.

asset: Currency | None = None

One of the assets of the AMM pool to look up.

asset2: Currency | None = None

The other asset of the AMM pool.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.AccountChannels(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request returns information about an account’s Payment Channels. This includes only channels where the specified account is the channel’s source, not the destination. (A channel’s “source” and “owner” are the same.)

All information retrieved is relative to a particular version of the ledger.

See account_channels

account: str

This field is required.

destination_account: str | None = None
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

limit: int = 200
marker: Any | None = None
method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.AccountCurrencies(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request retrieves a list of currencies that an account can send or receive, based on its trust lines.

This is not a thoroughly confirmed list, but it can be used to populate user interfaces.

See account_currencies

account: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

strict: bool = False
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.AccountInfo(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request retrieves information about an account, its activity, and its XRP balance.

All information retrieved is relative to a particular version of the ledger.

See account_info

account: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

queue: bool = False
signer_lists: bool = False
strict: bool = False
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.AccountLines(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request returns information about an account’s trust lines, including balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger.

See account_lines

account: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

limit: int | None = None
marker: Any | None = None
method: RequestMethod

This field is required.

peer: str | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.AccountNFTs(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This method retrieves all of the NFTs currently owned by the specified account.

account: str

The unique identifier of an account, typically the account’s address. The request returns NFTs owned by this account. This value is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

limit: int | None = None

Limit the number of NFTokens to retrieve.

marker: Any | None = None

Value from a previous paginated response. Resume retrieving data where that response left off.

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

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

Bases: str, Enum

Represents the object types that an AccountObjectsRequest can ask for.

AMM = 'amm'
BRIDGE = 'bridge'
CHECK = 'check'
DEPOSIT_PREAUTH = 'deposit_preauth'
ESCROW = 'escrow'
NFT_OFFER = 'nft_offer'
OFFER = 'offer'
PAYMENT_CHANNEL = 'payment_channel'
SIGNER_LIST = 'signer_list'
STATE = 'state'
TICKET = 'ticket'
XCHAIN_OWNED_CLAIM_ID = 'xchain_owned_claim_id'
XCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID = 'xchain_owned_create_account_claim_id'
capitalize()

Return a capitalized version of the string.

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

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

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

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

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

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

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

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

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

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

expandtabs(tabsize=8)

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

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

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

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

Return -1 on failure.

format(*args, **kwargs) str

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

format_map(mapping) str

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

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

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

Raises ValueError when the substring is not found.

isalnum()

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

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

isalpha()

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

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

isascii()

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

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

isdecimal()

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

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

isdigit()

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

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

isidentifier()

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

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

islower()

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

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

isnumeric()

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

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

isprintable()

Return True if the string is printable, False otherwise.

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

isspace()

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

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

istitle()

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

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

isupper()

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

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

join(iterable, /)

Concatenate any number of strings.

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

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

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

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

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

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

static maketrans()

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

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

partition(sep, /)

Partition the string into three parts using the given separator.

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

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

removeprefix(prefix, /)

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

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

removesuffix(suffix, /)

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

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

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

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

count

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

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

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

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

Return -1 on failure.

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

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

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

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

rpartition(sep, /)

Partition the string into three parts using the given separator.

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

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

rsplit(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.AccountObjects(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request returns the raw ledger format for all objects owned by an account.

For a higher-level view of an account’s trust lines and balances, see AccountLinesRequest instead.

See account_objects

account: str

This field is required.

deletion_blockers_only: bool = False
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

limit: int | None = None
marker: Any | None = None
method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

type: AccountObjectType | None = None
validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.AccountOffers(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.

See account_offers

account: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

limit: int | None = None
marker: Any | None = None
method: RequestMethod

This field is required.

strict: bool = False
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.AccountTx(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request retrieves from the ledger a list of transactions that involved the specified account.

See account_tx

account: str

This field is required.

binary: bool = False
forward: bool = False
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

ledger_index_max: int | None = None
ledger_index_min: int | None = None
limit: int | None = None
marker: Any | None = None
method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.AuthAccount(*args: List[Any], **kwargs: Dict[str, Any])

Bases: NestedModel

Represents one entry in a list of AuthAccounts used in AMMBid transaction.

account: str

This field is required.

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

Construct a new NestedModel from a dictionary of parameters.

Parameters:

value – The value to construct the NestedModel from.

Returns:

A new NestedModel object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod is_dict_of_model(dictionary: Any) bool

Returns True if the input dictionary was derived by the to_dict method of an instance of this class. In other words, True if this is a dictionary representation of an instance of this class.

NOTE: does not account for model inheritance, IE will only return True if dictionary represents an instance of this class, but not if dictionary represents an instance of a subclass of this class.

Parameters:

dictionary – The dictionary to check.

Returns:

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

is_valid() bool

Returns whether this BaseModel is valid.

Returns:

Whether this BaseModel is valid.

to_dict() Dict[str, Any]

Returns the dictionary representation of a NestedModel.

Returns:

The dictionary representation of a NestedModel.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.BookOffers(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The book_offers method retrieves a list of offers, also known as the order book, between two currencies.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

limit: int | None = None
method: RequestMethod

This field is required.

taker: str | None = None
taker_gets: IssuedCurrency | XRP

This field is required.

taker_pays: IssuedCurrency | XRP

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.ChannelAuthorize(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The channel_authorize method creates a signature that can be used to redeem a specific amount of XRP from a payment channel.

Warning: Do not send secret keys to untrusted servers or through unsecured network connections. (This includes the secret, seed, seed_hex, or passphrase fields of this request.) You should only use this method on a secure, encrypted network connection to a server you run or fully trust with your funds. Otherwise, eavesdroppers could use your secret key to sign claims and take all the money from this payment channel and anything else using the same key pair. See Set Up Secure Signing for instructions.

See channel_authorize

amount: str

This field is required.

channel_id: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

key_type: CryptoAlgorithm | None = None
method: RequestMethod

This field is required.

passphrase: str | None = None
secret: str | None = None
seed: str | None = None
seed_hex: str | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.ChannelVerify(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The channel_verify method checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel.

amount: str

This field is required.

channel_id: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

public_key: str

This field is required.

signature: str

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.DepositAuthorized(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The deposit_authorized command indicates whether one account is authorized to send payments directly to another. See Deposit Authorization for information on how to require authorization to deliver money to your account.

destination_account: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

source_account: str

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Fee(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The fee command reports the current state of the open-ledger requirements for the transaction cost. This requires the FeeEscalation amendment to be enabled.

This is a public command available to unprivileged users.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.GatewayBalances(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses.

See gateway_balances

account: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

hotwallet: str | List[str] | None = None
id: int | str | None = None
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.

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: int | str | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

strict: bool = False
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.GenericRequest(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

A request object representing all unsupported requests.

There is no analog in rippled - this is an xrpl-py-specific model.

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

Construct a new GenericRequest from a dictionary of parameters. Also converts from JSON and WS formatting.

Parameters:

value – The value to construct the GenericRequest from.

Returns:

A new GenericRequest object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a GenericRequest.

Returns:

The dictionary representation of a GenericRequest.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Ledger(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

Retrieve information about the public ledger. See ledger

accounts: bool = False
binary: bool = False
expand: bool = False
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

full: bool = False
classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

owner_funds: bool = False
queue: bool = False
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

transactions: bool = False
type: LedgerEntryType | None = None
validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.LedgerClosed(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The ledger_closed method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.LedgerCurrent(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The ledger_current method returns the unique identifiers of the current in-progress ledger. This command is mostly useful for testing, because the ledger returned is still in flux.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.LedgerData(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The ledger_data method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version. See ledger data

binary: bool = False
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

limit: int | None = None
marker: Any | None = None
method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

type: LedgerEntryType | None = None
validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.LedgerEntry(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The ledger_entry method returns a single ledger object from the XRP Ledger in its raw format. See ledger format for information on the different types of objects you can retrieve. See ledger entry

account_root: str | None = None
binary: bool = False
bridge: XChainBridge | None = None
bridge_account: str | None = None
check: str | None = None
deposit_preauth: str | DepositPreauth | None = None
directory: str | Directory | None = None
escrow: str | Escrow | None = None
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

id: int | str | None = None
index: str | None = None
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.

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: int | str | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

nft_page: str | None = None

Must be the object ID of the NFToken page, as hexadecimal

offer: str | Offer | None = None
payment_channel: str | None = None
ripple_state: RippleState | None = None
ticket: str | Ticket | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

xchain_claim_id: str | XChainClaimID | None = None
xchain_create_account_claim_id: str | XChainCreateAccountClaimID | None = None
class xrpl.models.requests.LedgerEntryType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, Enum

Identifiers for on-ledger objects.

ACCOUNT = 'account'
AMENDMENTS = 'amendments'
AMM = 'amm'
CHECK = 'check'
DEPOSIT_PREAUTH = 'deposit_preauth'
DIRECTORY = 'directory'
ESCROW = 'escrow'
FEE = 'fee'
HASHES = 'hashes'
NFT_OFFER = 'nft_offer'
OFFER = 'offer'
PAYMENT_CHANNEL = 'payment_channel'
SIGNER_LIST = 'signer_list'
STATE = 'state'
TICKET = 'ticket'
capitalize()

Return a capitalized version of the string.

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

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

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

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

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

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

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

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

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

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

expandtabs(tabsize=8)

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

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

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

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

Return -1 on failure.

format(*args, **kwargs) str

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

format_map(mapping) str

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

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

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

Raises ValueError when the substring is not found.

isalnum()

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

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

isalpha()

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

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

isascii()

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

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

isdecimal()

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

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

isdigit()

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

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

isidentifier()

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

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

islower()

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

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

isnumeric()

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

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

isprintable()

Return True if the string is printable, False otherwise.

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

isspace()

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

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

istitle()

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

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

isupper()

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

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

join(iterable, /)

Concatenate any number of strings.

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

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

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

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

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

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

static maketrans()

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

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

partition(sep, /)

Partition the string into three parts using the given separator.

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

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

removeprefix(prefix, /)

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

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

removesuffix(suffix, /)

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

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

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

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

count

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

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

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

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

Return -1 on failure.

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

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

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

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

rpartition(sep, /)

Partition the string into three parts using the given separator.

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

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

rsplit(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.Manifest(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The manifest method reports the current “manifest” information for a given validator public key. The “manifest” is the public portion of that validator’s configured token.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

public_key: str

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.NFTBuyOffers(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The nft_buy_offers method retrieves all of buy offers for the specified NFToken.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

nft_id: str

The unique identifier of an NFToken. The request returns buy offers for this NFToken. This value is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.NFTHistory(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The nft_history method retreives a list of transactions that involved the specified NFToken.

binary: bool = False
forward: bool = False
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

ledger_index_max: int | None = None
ledger_index_min: int | None = None
limit: int | None = None
marker: Any | None = None
method: RequestMethod

This field is required.

nft_id: str

The unique identifier of an NFToken. The request returns past transactions of this NFToken. This value is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.NFTInfo(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The nft_info method retrieves all the information about the NFToken

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

nft_id: str

The unique identifier of an NFToken. The request returns information of this NFToken. This value is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.NFTSellOffers(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The nft_sell_offers method retrieves all of sell offers for the specified NFToken.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

nft_id: str

The unique identifier of an NFToken. The request returns sell offers for this NFToken. This value is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.NoRippleCheck(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

This request provides a quick way to check the status of the Default Ripple field for an account and the No Ripple flag of its trust lines, compared with the recommended settings.

See noripple_check

account: str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

limit: int | None = 300
method: RequestMethod

This field is required.

role: NoRippleCheckRole

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

transactions: bool = False
validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

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

Bases: str, Enum

Represents the options for the address role in a NoRippleCheckRequest.

GATEWAY = 'gateway'
USER = 'user'
capitalize()

Return a capitalized version of the string.

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

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

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

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

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

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

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

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

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

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

expandtabs(tabsize=8)

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

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

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

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

Return -1 on failure.

format(*args, **kwargs) str

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

format_map(mapping) str

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

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

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

Raises ValueError when the substring is not found.

isalnum()

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

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

isalpha()

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

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

isascii()

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

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

isdecimal()

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

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

isdigit()

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

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

isidentifier()

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

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

islower()

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

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

isnumeric()

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

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

isprintable()

Return True if the string is printable, False otherwise.

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

isspace()

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

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

istitle()

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

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

isupper()

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

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

join(iterable, /)

Concatenate any number of strings.

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

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

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

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

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

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

static maketrans()

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

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

partition(sep, /)

Partition the string into three parts using the given separator.

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

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

removeprefix(prefix, /)

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

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

removesuffix(suffix, /)

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

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

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

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

count

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

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

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

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

Return -1 on failure.

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

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

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

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

rpartition(sep, /)

Partition the string into three parts using the given separator.

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

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

rsplit(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.PathFind(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

WebSocket API only! The path_find method searches for a path along which a transaction can possibly be made, and periodically sends updates when the path changes over time. For a simpler version that is supported by JSON-RPC, see the ripple_path_find method. For payments occurring strictly in XRP, it is not necessary to find a path, because XRP can be sent directly to any account.

Although the rippled server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths. Due to server load, pathfinding may not find the best results. Additionally, you should be careful with the pathfinding results from untrusted servers. A server could be modified to return less-than-optimal paths to earn money for its operators. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results. (Note: A server returning less-than-optimal results is not necessarily proof of malicious behavior; it could also be a symptom of heavy server load.)

destination_account: str

This field is required.

destination_amount: Amount

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

paths: List[Path] | None = None
send_max: Amount | None = None
source_account: str

This field is required.

subcommand: PathFindSubcommand

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

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

Bases: str, Enum

There are three different modes, or sub-commands, of the path_find command. Specify which one you want with the subcommand parameter:

create - Start sending pathfinding information close - Stop sending pathfinding information status - Get the information of the currently-open pathfinding request

CLOSE = 'close'
CREATE = 'create'
STATUS = 'status'
capitalize()

Return a capitalized version of the string.

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

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

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

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

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

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

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

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

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

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

expandtabs(tabsize=8)

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

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

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

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

Return -1 on failure.

format(*args, **kwargs) str

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

format_map(mapping) str

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

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

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

Raises ValueError when the substring is not found.

isalnum()

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

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

isalpha()

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

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

isascii()

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

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

isdecimal()

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

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

isdigit()

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

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

isidentifier()

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

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

islower()

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

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

isnumeric()

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

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

isprintable()

Return True if the string is printable, False otherwise.

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

isspace()

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

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

istitle()

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

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

isupper()

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

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

join(iterable, /)

Concatenate any number of strings.

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

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

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

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

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

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

static maketrans()

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

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

partition(sep, /)

Partition the string into three parts using the given separator.

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

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

removeprefix(prefix, /)

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

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

removesuffix(suffix, /)

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

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

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

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

count

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

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

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

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

Return -1 on failure.

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

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

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

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

rpartition(sep, /)

Partition the string into three parts using the given separator.

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

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

rsplit(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.PathStep(*args: List[Any], **kwargs: Dict[str, Any])

Bases: BaseModel

A PathStep represents an individual step along a Path.

account: str | None = None
currency: str | None = None
classmethod from_dict(value: Dict[str, str | int | List[Any] | Dict[str, Any]]) BM

Construct a new BaseModel from a dictionary of parameters.

Parameters:

value – The value to construct the BaseModel from.

Returns:

A new BaseModel object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod is_dict_of_model(dictionary: Any) bool

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: str | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a BaseModel.

If not overridden, returns the object dict with all non-None values.

Returns:

The dictionary representation of a BaseModel.

type: int | None = None
type_hex: str | None = None
validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Ping(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The ping command returns an acknowledgement, so that clients can test the connection status and latency.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Random(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The random command provides a random number to be used as a source of entropy for random number generation by clients.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Request(method: ~xrpl.models.requests.request.RequestMethod = <object object>, id: int | str | None = None)

Bases: BaseModel

The base class for all network request types. Represents fields common to all request types.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.RipplePathFind(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The ripple_path_find method is a simplified version of the path_find method that provides a single response with a payment path you can use right away. It is available in both the WebSocket and JSON-RPC APIs. However, the results tend to become outdated as time passes. Instead of making multiple calls to stay updated, you should instead use the path_find method to subscribe to continued updates where possible.

Although the rippled server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths.

destination_account: str

This field is required.

destination_amount: IssuedCurrencyAmount | str

This field is required.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

send_max: IssuedCurrencyAmount | str | None = None
source_account: str

This field is required.

source_currencies: List[IssuedCurrency | XRP] | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.ServerInfo(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The server_info command asks the server for a human-readable version of various information about the rippled server being queried.

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.ServerState(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The server_state command asks the server for various machine-readable information about the rippled server’s current state. The response is almost the same as the server_info method, but uses units that are easier to process instead of easier to read. (For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds.)

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Sign(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The sign method takes a transaction in JSON format and a seed value, and returns a signed binary representation of the transaction. To contribute one signature to a multi-signed transaction, use the sign_for method instead.

By default, this method is admin-only. It can be used as a public method if the server has enabled public signing.

Caution: Unless you run the rippled server yourself, you should do local signing with RippleAPI instead of using this command. An untrustworthy server could change the transaction before signing it, or use your secret key to sign additional arbitrary transactions as if they came from you.

See sign

build_path: bool | None = None
fee_div_max: int = 1
fee_mult_max: int = 10
classmethod from_dict(value: Dict[str, Any]) Sign

Construct a new Sign from a dictionary of parameters.

Parameters:

value – The value to construct the Sign from.

Returns:

A new Sign object, constructed using the given parameters.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

key_type: CryptoAlgorithm | None = None
method: RequestMethod

This field is required.

offline: bool = False
passphrase: str | None = None
secret: str | None = None
seed: str | None = None
seed_hex: str | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a Sign.

Returns:

The dictionary representation of a Sign.

transaction: Transaction

This field is required.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.SignAndSubmit(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Submit

The submit method applies a transaction and sends it to the network to be confirmed and included in future ledgers.

This command has two modes: * Submit-only mode takes a signed, serialized transaction as a binary blob, and submits it to the network as-is. Since signed transaction objects are immutable, no part of the transaction can be modified or automatically filled in after submission. * Sign-and-submit mode takes a JSON-formatted Transaction object, completes and signs the transaction in the same manner as the sign method, and then submits the signed transaction. We recommend only using this mode for testing and development.

To send a transaction as robustly as possible, you should construct and sign it in advance, persist it somewhere that you can access even after a power outage, then submit it as a tx_blob. After submission, monitor the network with the tx method command to see if the transaction was successfully applied; if a restart or other problem occurs, you can safely re-submit the tx_blob transaction: it won’t be applied twice since it has the same sequence number as the old transaction.

See submit

build_path: bool | None = None
fee_div_max: int = 1
fee_mult_max: int = 10
classmethod from_dict(value: Dict[str, Any]) SignAndSubmit

Construct a new SignAndSubmit from a dictionary of parameters.

Parameters:

value – The value to construct the SignAndSubmit from.

Returns:

A new SignAndSubmit object, constructed using the given parameters.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

key_type: CryptoAlgorithm | None = None
method: RequestMethod

This field is required.

offline: bool = False
passphrase: str | None = None
secret: str | None = None
seed: str | None = None
seed_hex: str | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a SignAndSubmit.

Returns:

The dictionary representation of a SignAndSubmit.

transaction: Transaction

This field is required.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.SignFor(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The sign_for command provides one signature for a multi-signed transaction.

By default, this method is admin-only. It can be used as a public method if the server has enabled public signing.

This command requires the MultiSign amendment to be enabled.

See sign_for

account: str

This field is required.

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

Construct a new SignFor from a dictionary of parameters.

Parameters:

value – The value to construct the SignFor from.

Returns:

A new SignFor object, constructed using the given parameters.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

key_type: CryptoAlgorithm | None = None
method: RequestMethod

This field is required.

passphrase: str | None = None
secret: str | None = None
seed: str | None = None
seed_hex: str | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a SignFor.

Returns:

The dictionary representation of a SignFor.

transaction: Transaction

This field is required.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

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

Bases: str, Enum

Represents possible values of the streams query param for subscribe.

CONSENSUS = 'consensus'
LEDGER = 'ledger'
MANIFESTS = 'manifests'
PEER_STATUS = 'peer_status'
SERVER = 'server'
TRANSACTIONS = 'transactions'
TRANSACTIONS_PROPOSED = 'transactions_proposed'
VALIDATIONS = 'validations'
capitalize()

Return a capitalized version of the string.

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

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

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

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

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

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

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

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

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

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

expandtabs(tabsize=8)

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

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

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

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

Return -1 on failure.

format(*args, **kwargs) str

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

format_map(mapping) str

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

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

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

Raises ValueError when the substring is not found.

isalnum()

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

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

isalpha()

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

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

isascii()

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

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

isdecimal()

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

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

isdigit()

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

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

isidentifier()

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

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

islower()

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

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

isnumeric()

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

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

isprintable()

Return True if the string is printable, False otherwise.

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

isspace()

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

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

istitle()

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

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

isupper()

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

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

join(iterable, /)

Concatenate any number of strings.

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

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

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

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

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

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

static maketrans()

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

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

partition(sep, /)

Partition the string into three parts using the given separator.

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

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

removeprefix(prefix, /)

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

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

removesuffix(suffix, /)

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

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

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

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

count

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

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

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

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

Return -1 on failure.

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

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

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

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

rpartition(sep, /)

Partition the string into three parts using the given separator.

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

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

rsplit(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.Submit(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

WARNING: This object should never be created. You should create an object of type SignAndSubmit or SubmitOnly instead.

The submit method applies a transaction and sends it to the network to be confirmed and included in future ledgers.

This command has two modes: * Submit-only mode takes a signed, serialized transaction as a binary blob, and submits it to the network as-is. Since signed transaction objects are immutable, no part of the transaction can be modified or automatically filled in after submission. * Sign-and-submit mode takes a JSON-formatted Transaction object, completes and signs the transaction in the same manner as the sign method, and then submits the signed transaction. We recommend only using this mode for testing and development.

To send a transaction as robustly as possible, you should construct and sign it in advance, persist it somewhere that you can access even after a power outage, then submit it as a tx_blob. After submission, monitor the network with the tx method command to see if the transaction was successfully applied; if a restart or other problem occurs, you can safely re-submit the tx_blob transaction: it won’t be applied twice since it has the same sequence number as the old transaction.

See submit

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

Construct a new Submit from a dictionary of parameters.

Parameters:

value – The value to construct the Submit from.

Returns:

A new Submit object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.SubmitMultisigned(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The submit_multisigned command applies a multi-signed transaction and sends it to the network to be included in future ledgers. (You can also submit multi-signed transactions in binary form using the submit command in submit-only mode.)

This command requires the MultiSign amendment to be enabled.

See submit_multisigned

fail_hard: bool = False
classmethod from_dict(value: Dict[str, Any]) SubmitMultisigned

Construct a new SubmitMultisigned object from a dictionary of parameters.

Parameters:

value – The value to construct the SubmitMultisigned from.

Returns:

A new SubmitMultisigned object, constructed using the given parameters.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a SubmitMultisigned object.

Returns:

The dictionary representation of a SubmitMultisigned object.

tx_json: Transaction

This field is required.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.SubmitOnly(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Submit

The submit method applies a transaction and sends it to the network to be confirmed and included in future ledgers.

This command has two modes: * Submit-only mode takes a signed, serialized transaction as a binary blob, and submits it to the network as-is. Since signed transaction objects are immutable, no part of the transaction can be modified or automatically filled in after submission. * Sign-and-submit mode takes a JSON-formatted Transaction object, completes and signs the transaction in the same manner as the sign method, and then submits the signed transaction. We recommend only using this mode for testing and development.

To send a transaction as robustly as possible, you should construct and sign it in advance, persist it somewhere that you can access even after a power outage, then submit it as a tx_blob. After submission, monitor the network with the tx method command to see if the transaction was successfully applied; if a restart or other problem occurs, you can safely re-submit the tx_blob transaction: it won’t be applied twice since it has the same sequence number as the old transaction.

See submit

fail_hard: bool = False
classmethod from_dict(value: Dict[str, Any]) S

Construct a new Submit from a dictionary of parameters.

Parameters:

value – The value to construct the Submit from.

Returns:

A new Submit object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

tx_blob: str

This field is required.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Subscribe(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The subscribe method requests periodic notifications from the server when certain events happen.

WebSocket API only.

See subscribe

accounts: List[str] | None = None
accounts_proposed: List[str] | None = None
books: List[SubscribeBook] | None = None
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

streams: List[StreamParameter] | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

url: str | None = None
url_password: str | None = None
url_username: str | None = None
validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.SubscribeBook(*args: List[Any], **kwargs: Dict[str, Any])

Bases: BaseModel

Format for elements in the books array for Subscribe only.

both: bool = False
classmethod from_dict(value: Dict[str, str | int | List[Any] | Dict[str, Any]]) BM

Construct a new BaseModel from a dictionary of parameters.

Parameters:

value – The value to construct the BaseModel from.

Returns:

A new BaseModel object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod is_dict_of_model(dictionary: Any) bool

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.

snapshot: bool = False
taker: str

This field is required.

taker_gets: IssuedCurrency | XRP

This field is required.

taker_pays: IssuedCurrency | XRP

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a BaseModel.

If not overridden, returns the object dict with all non-None values.

Returns:

The dictionary representation of a BaseModel.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.TransactionEntry(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request, LookupByLedgerRequest

The transaction_entry method retrieves information on a single transaction from a specific ledger version. (The tx method, by contrast, searches all ledgers for the specified transaction. We recommend using that method instead.)

See transaction_entry

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

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

ledger_hash: str | None = None

A 20-byte hex string for the ledger version to use.

ledger_index: str | int | None = None

The ledger index of the ledger to use, or a shortcut string.

method: RequestMethod

This field is required.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

tx_hash: str

This field is required.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Tx(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The tx method retrieves information on a single transaction.

See tx

binary: bool = False
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

max_ledger: int | None = None
method: RequestMethod

This field is required.

min_ledger: int | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

transaction: str

This field is required.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Unsubscribe(*args: List[Any], **kwargs: Dict[str, Any])

Bases: Request

The unsubscribe command tells the server to stop sending messages for a particular subscription or set of subscriptions.

WebSocket API only.

See unsubscribe

accounts: List[str] | None = None
accounts_proposed: List[str] | None = None
books: List[UnsubscribeBook] | None = None
classmethod from_dict(value: Dict[str, Any]) R

Construct a new Request from a dictionary of parameters.

Parameters:

value – The value to construct the Request from.

Returns:

A new Request object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod get_method(method: str) Type[Request]

Returns the correct request method based on the string name.

Parameters:

method – The String name of the Request object.

Returns:

The request class with the given name. If the request doesn’t exist, then it will return a GenericRequest.

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

method: RequestMethod

This field is required.

streams: List[StreamParameter] | None = None
to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.