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, api_version: int = 2)

Bases: BaseModel

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: str | int | None = None, api_version: int = 2, amm_account: str | None = None, asset: Currency | None = None, asset2: Currency | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, destination_account: str | None = None, limit: int = 200, marker: ~typing.Any | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, strict: bool = False)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, queue: bool = False, signer_lists: bool = False, strict: bool = False)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, peer: str | None = None, limit: int | None = None, marker: ~typing.Any | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, limit: int | None = None, marker: ~typing.Any | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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'
CREDENTIAL = 'credential'
DELEGATE = 'delegate'
DEPOSIT_PREAUTH = 'deposit_preauth'
DID = 'did'
ESCROW = 'escrow'
LOAN = 'loan'
LOAN_BROKER = 'loan_broker'
MPTOKEN = 'mptoken'
MPT_ISSUANCE = 'mpt_issuance'
NFT_OFFER = 'nft_offer'
NFT_PAGE = 'nft_page'
OFFER = 'offer'
ORACLE = 'oracle'
PAYMENT_CHANNEL = 'payment_channel'
PERMISSIONED_DOMAIN = 'permissioned_domain'
SIGNER_LIST = 'signer_list'
STATE = 'state'
TICKET = 'ticket'
VAULT = 'vault'
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. -1 (the default value) means no limit.

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.AccountObjects(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, type: ~xrpl.models.requests.account_objects.AccountObjectType | None = None, deletion_blockers_only: bool = False, limit: int | None = None, marker: ~typing.Any | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, limit: int | None = None, marker: ~typing.Any | None = None, strict: bool = False)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, ledger_index_min: int | None = None, ledger_index_max: int | None = None, binary: bool = False, forward: bool = False, limit: int | None = None, marker: ~typing.Any | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, account: str = <object object>)

Bases: NestedModel

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

account: str

This field is required.

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

Construct a new NestedModel from a dictionary of parameters.

Parameters:

value – The value to construct the NestedModel from.

Returns:

A new NestedModel object, constructed using the given parameters.

Raises:

XRPLModelException – If the dictionary provided is invalid.

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod is_dict_of_model(dictionary: Any) bool

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

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

Parameters:

dictionary – The dictionary to check.

Returns:

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

is_valid() bool

Returns whether this BaseModel is valid.

Returns:

Whether this BaseModel is valid.

to_dict() Dict[str, Any]

Returns the dictionary representation of a NestedModel.

Returns:

The dictionary representation of a NestedModel.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.BookOffers(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, taker_gets: ~xrpl.models.currencies.issued_currency.IssuedCurrency | ~xrpl.models.currencies.mpt_currency.MPTCurrency | ~xrpl.models.currencies.xrp.XRP = <object object>, taker_pays: ~xrpl.models.currencies.issued_currency.IssuedCurrency | ~xrpl.models.currencies.mpt_currency.MPTCurrency | ~xrpl.models.currencies.xrp.XRP = <object object>, limit: int | None = None, taker: str | None = None, domain: str | None = None)

Bases: Request, LookupByLedgerRequest

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

domain: str | None = None
classmethod from_dict(value: Dict[str, Any]) Self

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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 | MPTCurrency | XRP

This field is required.

taker_pays: IssuedCurrency | MPTCurrency | 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(*, id: Optional[Union[str, int]] = None, api_version: int = 2, channel_id: str = <object object>, amount: str = <object object>, secret: Optional[str] = None, seed: Optional[str] = None, seed_hex: Optional[str] = None, passphrase: Optional[str] = None, key_type: Optional[CryptoAlgorithm] = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

channel_id: str

This field is required.

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: Optional[Union[str, int]] = None, api_version: int = 2, channel_id: str = <object object>, amount: str = <object object>, public_key: str = <object object>, signature: str = <object object>)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

channel_id: str

This field is required.

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, source_account: str = <object object>, destination_account: str = <object object>, credentials: ~typing.List[str] | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

credentials: List[str] | None = None

List of Credential ID strings. If this field is included, then the credential will be taken into account when analyzing whether the sender can send funds to the destination.

destination_account: str

This field is required.

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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.Feature(*, id: str | int | None = None, api_version: int = 2, feature: str | None = None)

Bases: Request

The feature method gets information about a network’s amendments.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

feature: str | None = None

The hex-encoded feature hash.

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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.Fee(*, id: str | int | None = None, api_version: int = 2)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: str | None = None, ledger_index: int | str | None = None, id: int | str | None = None, api_version: int = 2, account: str = <object object>, strict: bool = False, hotwallet: str | ~typing.List[str] | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(**kwargs: Any)

Bases: Request

A request object representing all unsupported requests.

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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.GetAggregatePrice(*, id: Optional[Union[str, int]] = None, api_version: int = 2, base_asset: str = <object object>, quote_asset: str = <object object>, oracles: List[Oracle] = <object object>, trim: Optional[int] = None, time_threshold: Optional[int] = None)

Bases: Request

The get_aggregate_price method retrieves the aggregate price of specified Oracle objects, returning three price statistics: mean, median, and trimmed mean.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

base_asset: str = <object object>

The currency code of the asset to be priced

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_valid() bool

Returns whether this BaseModel is valid.

Returns:

Whether this BaseModel is valid.

method: RequestMethod

This field is required.

oracles: List[Oracle] = <object object>

The oracle identifier

quote_asset: str = <object object>

The currency code of the asset to quote the price of the base asset

time_threshold: int | None = None

Defines a time range in seconds for filtering out older price data. Default value is 0, which doesn’t filter any data

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

trim: int | None = None

The percentage of outliers to trim. Valid trim range is 1-25. If included, the API returns statistics for the trimmed mean

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Ledger(*, ledger_hash: str | None = None, ledger_index: str | int | None = None, id: str | int | None = None, api_version: int = 2, transactions: bool = False, expand: bool = False, owner_funds: bool = False, binary: bool = False, queue: bool = False)

Bases: Request, LookupByLedgerRequest

Retrieve information about the public ledger. See ledger

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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
validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.LedgerClosed(*, id: str | int | None = None, api_version: int = 2)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: str | int | None = None, api_version: int = 2)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: str | None = None, ledger_index: str | int | None = None, id: str | int | None = None, api_version: int = 2, binary: bool = False, limit: int | None = None, marker: Any | None = None, type: LedgerEntryType | None = None)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: str | None = None, ledger_index: int | str | None = None, id: int | str | None = None, api_version: int = 2, index: str | None = None, account_root: str | None = None, check: str | None = None, credential: str | Credential | None = None, delegate: str | Delegate | None = None, deposit_preauth: str | DepositPreauth | None = None, did: str | None = None, directory: str | Directory | None = None, escrow: str | Escrow | None = None, mpt_issuance: str | None = None, mptoken: MPToken | str | None = None, offer: str | Offer | None = None, oracle: Oracle | None = None, payment_channel: str | None = None, permissioned_domain: str | PermissionedDomain | None = None, ripple_state: RippleState | None = None, vault: str | Vault | None = None, ticket: str | Ticket | None = None, bridge_account: str | None = None, bridge: XChainBridge | None = None, xchain_claim_id: int | str | XChainClaimID | None = None, xchain_create_account_claim_id: int | str | XChainCreateAccountClaimID | None = None, binary: bool = False, nft_page: str | None = None, include_deleted: bool | None = None)

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
api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

binary: bool = False
bridge: XChainBridge | None = None
bridge_account: str | None = None
check: str | None = None
credential: str | Credential | None = None
delegate: str | Delegate | None = None
deposit_preauth: str | DepositPreauth | None = None
did: str | None = None
directory: str | Directory | None = None
escrow: str | Escrow | None = None
classmethod from_dict(value: Dict[str, Any]) Self

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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 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
include_deleted: bool | None = None

This parameter is supported only by Clio servers

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

Returns:

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

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

mpt_issuance: str | None = None
mptoken: MPToken | str | None = None
nft_page: str | None = None

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

offer: str | Offer | None = None
oracle: Oracle | None = None
payment_channel: str | None = None
permissioned_domain: str | PermissionedDomain | 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.

vault: str | Vault | None = None
xchain_claim_id: int | str | XChainClaimID | None = None
xchain_create_account_claim_id: int | 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'
BRIDGE = 'bridge'
CHECK = 'check'
CREDENTIAL = 'credential'
DELEGATE = 'delegate'
DEPOSIT_PREAUTH = 'deposit_preauth'
DID = 'did'
DIRECTORY = 'directory'
ESCROW = 'escrow'
FEE = 'fee'
HASHES = 'hashes'
MPTOKEN = 'mptoken'
MPT_ISSUANCE = 'mpt_issuance'
NFT_OFFER = 'nft_offer'
OFFER = 'offer'
ORACLE = 'oracle'
PAYMENT_CHANNEL = 'payment_channel'
PERMISSIONED_DOMAIN = 'permissioned_domain'
SIGNER_LIST = 'signer_list'
SINGLE_ASSET_VAULT = 'vault'
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. -1 (the default value) means no limit.

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.Manifest(*, id: Optional[Union[str, int]] = None, api_version: int = 2, public_key: str = <object object>)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, nft_id: str = <object object>)

Bases: Request, LookupByLedgerRequest

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, nft_id: str = <object object>, ledger_index_min: int | None = None, ledger_index_max: int | None = None, binary: bool = False, forward: bool = False, limit: int | None = None, marker: ~typing.Any | None = None)

Bases: Request, LookupByLedgerRequest

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, nft_id: str = <object object>)

Bases: Request, LookupByLedgerRequest

The nft_info method retrieves all the information about the NFToken

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, nft_id: str = <object object>)

Bases: Request, LookupByLedgerRequest

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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.NFTsByIssuer(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, issuer: str = <object object>, marker: ~typing.Any | None = None, nft_taxon: int | None = None, limit: int | None = None)

Bases: Request, LookupByLedgerRequest

The nfts_by_issuer method retrieves all of the NFTokens issued by an account

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_valid() bool

Returns whether this BaseModel is valid.

Returns:

Whether this BaseModel is valid.

issuer: str

The unique identifier for an account that issues NFTokens The request returns NFTokens issued by this account. This field is required

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.

nft_taxon: int | 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.NoRippleCheck(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, role: ~xrpl.models.requests.no_ripple_check.NoRippleCheckRole = <object object>, transactions: bool = False, limit: int | None = 300)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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. -1 (the default value) means no limit.

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.PathFind(*, id: Optional[Union[str, int]] = None, api_version: int = 2, subcommand: PathFindSubcommand = <object object>, source_account: str = <object object>, destination_account: str = <object object>, destination_amount: Amount = <object object>, send_max: Optional[Amount] = None, paths: Optional[List[Path]] = None, domain: Optional[str] = None)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

destination_account: str

This field is required.

destination_amount: Amount

This field is required.

domain: str | None = None
classmethod from_dict(value: Dict[str, Any]) Self

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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. -1 (the default value) means no limit.

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.PathStep(*, account: str | None = None, currency: str | None = None, issuer: str | None = None, type: int | None = None, type_hex: str | None = None)

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

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod is_dict_of_model(dictionary: Any) bool

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

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

Parameters:

dictionary – The dictionary to check. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

Returns:

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

is_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(*, id: str | int | None = None, api_version: int = 2)

Bases: Request

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: str | int | None = None, api_version: int = 2)

Bases: Request

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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, api_version: int = 2)

Bases: BaseModel

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, source_account: str = <object object>, destination_account: str = <object object>, destination_amount: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str = <object object>, send_max: ~xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount | ~xrpl.models.amounts.mpt_amount.MPTAmount | str | None = None, source_currencies: ~typing.List[~xrpl.models.currencies.issued_currency.IssuedCurrency | ~xrpl.models.currencies.mpt_currency.MPTCurrency | ~xrpl.models.currencies.xrp.XRP] | None = None, domain: str | None = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

destination_account: str

This field is required.

destination_amount: IssuedCurrencyAmount | MPTAmount | str

This field is required.

domain: str | None = None
classmethod from_dict(value: Dict[str, Any]) Self

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

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

This field is required.

source_currencies: List[IssuedCurrency | MPTCurrency | 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.ServerDefinitions(*, id: str | int | None = None, api_version: int = 2, hash: str | None = None)

Bases: Request

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

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

Returns:

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

is_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.ServerInfo(*, id: str | int | None = None, api_version: int = 2)

Bases: Request

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: str | int | None = None, api_version: int = 2)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: Optional[Union[str, int]] = None, api_version: int = 2, transaction: Transaction = <object object>, secret: Optional[str] = None, seed: Optional[str] = None, seed_hex: Optional[str] = None, passphrase: Optional[str] = None, key_type: Optional[CryptoAlgorithm] = None, offline: bool = False, build_path: Optional[bool] = None, fee_mult_max: int = 10, fee_div_max: int = 1, signature_target: Optional[str] = None)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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
signature_target: 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(*, id: Optional[Union[str, int]] = None, api_version: int = 2, transaction: Transaction = <object object>, secret: Optional[str] = None, seed: Optional[str] = None, seed_hex: Optional[str] = None, passphrase: Optional[str] = None, key_type: Optional[CryptoAlgorithm] = None, offline: bool = False, build_path: Optional[bool] = None, fee_mult_max: int = 10, fee_div_max: int = 1)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: Optional[Union[str, int]] = None, api_version: int = 2, account: str = <object object>, transaction: Transaction = <object object>, secret: Optional[str] = None, seed: Optional[str] = None, seed_hex: Optional[str] = None, passphrase: Optional[str] = None, key_type: Optional[CryptoAlgorithm] = None)

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.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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.Simulate(*, id: str | int | None = None, api_version: int = 2, tx_blob: str | None = None, transaction: Transaction | None = None, binary: bool | None = None)

Bases: Request

The simulate method simulates a transaction without submitting it to the network.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

binary: bool | None = None
classmethod from_dict(value: Dict[str, Any]) Self

Construct a new Simulate from a dictionary of parameters.

Parameters:

value – The value to construct the Simulate from.

Returns:

A new Simulate object, constructed using the given parameters.

Raises:

XRPLModelException – If the tx_json value provided is not a valid transaction.

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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 Simulate.

Returns:

The dictionary representation of a Simulate.

transaction: Transaction | None = None

The default value is false, which returns data and metadata in JSON format. If true, returns data and metadata in binary format, serialized to a hexadecimal string.

tx_blob: str | None = None

The transaction to simulate, in JSON format. If you include this field, do not also include tx_blob.

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. -1 (the default value) means no limit.

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

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

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

split(sep=None, maxsplit=-1)

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

sep

The separator used to split the string.

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

maxsplit

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

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

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

splitlines(keepends=False)

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

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

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

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

strip(chars=None, /)

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

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

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

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

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

translate(table, /)

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

table

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

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

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

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

The string is never truncated.

class xrpl.models.requests.Submit(*, id: str | int | None = None, api_version: int = 2)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: Optional[Union[str, int]] = None, api_version: int = 2, tx_json: Transaction = <object object>, fail_hard: bool = False)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

fail_hard: bool = False
classmethod from_dict(value: Dict[str, Any]) Self

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: Optional[Union[str, int]] = None, api_version: int = 2, tx_blob: str = <object object>, fail_hard: bool = False)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

fail_hard: bool = False
classmethod from_dict(value: Dict[str, Any]) Self

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: str | int | None = None, api_version: int = 2, streams: List[StreamParameter] | None = None, accounts: List[str] | None = None, accounts_proposed: List[str] | None = None, books: List[SubscribeBook] | None = None, url: str | None = None, url_username: str | None = None, url_password: str | None = None)

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
api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

books: List[SubscribeBook] | None = None
classmethod from_dict(value: Dict[str, Any]) Self

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, taker_gets: ~xrpl.models.currencies.issued_currency.IssuedCurrency | ~xrpl.models.currencies.mpt_currency.MPTCurrency | ~xrpl.models.currencies.xrp.XRP = <object object>, taker_pays: ~xrpl.models.currencies.issued_currency.IssuedCurrency | ~xrpl.models.currencies.mpt_currency.MPTCurrency | ~xrpl.models.currencies.xrp.XRP = <object object>, taker: str = <object object>, snapshot: bool = False, both: bool = False, domain: str | None = None)

Bases: BaseModel

Format for elements in the books array for Subscribe only.

both: bool = False
domain: str | None = None
classmethod from_dict(value: Dict[str, str | int | List[Any] | Dict[str, Any]]) Self

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

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

Parameters:

value – The dictionary or JSON string to be instantiated.

Returns:

A BaseModel object instantiated from the input.

classmethod is_dict_of_model(dictionary: Any) bool

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

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

Parameters:

dictionary – The dictionary to check. Note: The input dictionary can be of non-dict type. For instance, a str representation of JSON.

Returns:

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

is_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 | MPTCurrency | XRP

This field is required.

taker_pays: IssuedCurrency | MPTCurrency | 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(*, ledger_hash: Optional[str] = None, ledger_index: Optional[Union[str, int]] = None, id: Optional[Union[str, int]] = None, api_version: int = 2, tx_hash: str = <object object>)

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

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_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(*, id: str | int | None = None, api_version: int = 2, ctid: str | None = None, transaction: str | None = None, binary: bool = False, min_ledger: int | None = None, max_ledger: int | None = None)

Bases: Request

The tx method retrieves information on a single transaction. The Request must contain either transaction or CTID parameter, but not both.

See tx

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

binary: bool = False

This field is optional.

If true, return transaction data and metadata as binary serialized to hexadecimal strings. If false, return transaction data and metadata as JSON. The default is false.

ctid: str | None = None

This field is optional.

The compact transaction identifier of the transaction to look up. Must use uppercase hexadecimal only. New in: rippled 1.12.0 (Not supported in Clio v2.0 and earlier)

The tx request accepts either ctid or transaction parameter, but not both.

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

is_valid() bool

Returns whether this BaseModel is valid.

Returns:

Whether this BaseModel is valid.

max_ledger: int | None = None

This field is optional.

Use this with min_ledger to specify a range of up to 1000 ledger indexes, ending with this ledger (inclusive). If the server cannot find the transaction, it confirms whether it was able to search all the ledgers in the requested range.

method: RequestMethod

This field is required.

min_ledger: int | None = None

This field is optional.

Use this with max_ledger to specify a range of up to 1000 ledger indexes, starting with this ledger (inclusive). If the server cannot find the transaction, it confirms whether it was able to search all the ledgers in this range.

to_dict() Dict[str, Any]

Returns the dictionary representation of a Request.

Returns:

The dictionary representation of a Request.

transaction: str | None = None

This field is optional.

The 256-bit hash of the transaction to look up, as hexadecimal.

The tx request accepts either ctid or transaction parameter, but not both.

validate() None

Raises if this object is invalid.

Raises:

XRPLModelException – if this object is invalid.

class xrpl.models.requests.Unsubscribe(*, id: str | int | None = None, api_version: int = 2, streams: List[StreamParameter] | None = None, accounts: List[str] | None = None, accounts_proposed: List[str] | None = None, books: List[UnsubscribeBook] | None = None)

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
api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

books: List[UnsubscribeBook] | None = None
classmethod from_dict(value: Dict[str, Any]) Self

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

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

class xrpl.models.requests.VaultInfo(*, ledger_hash: str | None = None, ledger_index: str | int | None = None, id: str | int | None = None, api_version: int = 2, vault_id: str | None = None, owner: str | None = None, seq: int | None = None)

Bases: Request, LookupByLedgerRequest

This request retrieves information about a Single Asset Vault.

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

Information about a vault ledger-object can be fetched by providing either the vault_id or both owner and seq values. Please check the documentation for more details.

api_version: int = 2

2 is used. Docs: https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#api-versioning

Type:

The API version to use for the said Request. By default, api_version

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

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

Construct a new Request from a dictionary of parameters. Alias of from_dict.

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

Returns:

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

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

The account address of the Vault Owner.

seq: int | None = None

The transaction sequence number that created the vault.

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.

vault_id: str | None = None

The object ID of the Vault to be returned.