XRPL Request Models¶
Base Request Model¶
- class xrpl.models.requests.request.Request(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.base_model.BaseModel
The base class for all network request types. Represents fields common to all request types.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.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.AccountChannels(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
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.
- account: str¶
This field is required.
- destination_account: Optional[str] = None¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- limit: int = 200¶
- marker: Optional[Any] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.AccountCurrencies(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
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.
- account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- strict: bool = False¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.AccountInfo(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
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.
- account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- queue: bool = False¶
- signer_lists: bool = False¶
- strict: bool = False¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.AccountLines(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
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.
- account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- limit: Optional[int] = None¶
- marker: Optional[Any] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- peer: Optional[str] = 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.AccountObjectType(value)¶
Bases:
str
,enum.Enum
Represents the object types that an AccountObjectsRequest can ask for.
- CHECK = 'check'¶
- DEPOSIT_PREAUTH = 'deposit_preauth'¶
- ESCROW = 'escrow'¶
- OFFER = 'offer'¶
- PAYMENT_CHANNEL = 'payment_channel'¶
- SIGNER_LIST = 'signer_list'¶
- STATE = 'state'¶
- TICKET = 'ticket'¶
- class xrpl.models.requests.AccountObjects(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
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.
- account: str¶
This field is required.
- deletion_blockers_only: bool = False¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- limit: Optional[int] = None¶
- marker: Optional[Any] = None¶
- method: xrpl.models.requests.request.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: Optional[xrpl.models.requests.account_objects.AccountObjectType] = None¶
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.AccountOffers(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
This request retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.
- account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- limit: Optional[int] = None¶
- marker: Optional[Any] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- strict: bool = False¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.AccountTx(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
This request retrieves from the ledger a list of transactions that involved the specified account.
- account: str¶
This field is required.
- binary: bool = False¶
- forward: bool = False¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- ledger_index_max: Optional[int] = None¶
- ledger_index_min: Optional[int] = None¶
- limit: Optional[int] = None¶
- marker: Optional[Any] = None¶
- method: xrpl.models.requests.request.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.BookOffers(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The book_offers method retrieves a list of offers, also known as the order book, between two currencies.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- limit: Optional[int] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- taker: Optional[str] = None¶
- taker_gets: Union[xrpl.models.currencies.issued_currency.IssuedCurrency, xrpl.models.currencies.xrp.XRP]¶
This field is required.
- taker_pays: Union[xrpl.models.currencies.issued_currency.IssuedCurrency, xrpl.models.currencies.xrp.XRP]¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.ChannelAuthorize(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.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.
- amount: str¶
This field is required.
- channel_id: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- key_type: Optional[CryptoAlgorithm] = None¶
- method: RequestMethod¶
This field is required.
- passphrase: Optional[str] = None¶
- secret: Optional[str] = None¶
- seed: Optional[str] = None¶
- seed_hex: Optional[str] = None¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.ChannelVerify(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The channel_verify method checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel.
- amount: str¶
This field is required.
- channel_id: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- public_key: str¶
This field is required.
- signature: str¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.DepositAuthorized(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The deposit_authorized command indicates whether one account is authorized to send payments directly to another. See Deposit Authorization for information on how to require authorization to deliver money to your account.
- destination_account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[str] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- source_account: str¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.Fee(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The fee command reports the current state of the open-ledger requirements for the transaction cost. This requires the FeeEscalation amendment to be enabled.
This is a public command available to unprivileged users.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.GatewayBalances(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
This request calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses.
- account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- hotwallet: Optional[Union[str, List[str]]] = None¶
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- method: xrpl.models.requests.request.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.Ledger(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
Retrieve information about the public ledger. See ledger
- accounts: bool = False¶
- binary: bool = False¶
- expand: bool = False¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- full: bool = False¶
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- method: xrpl.models.requests.request.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(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The ledger_closed method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: str¶
This field is required.
- ledger_index: int¶
This field is required.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.LedgerCurrent(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The ledger_current method returns the unique identifiers of the current in-progress ledger. This command is mostly useful for testing, because the ledger returned is still in flux.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.LedgerData(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The ledger_data method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version. See ledger data
- binary: bool = False¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- limit: Optional[int] = None¶
- marker: Optional[Any] = None¶
- method: xrpl.models.requests.request.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.LedgerEntry(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
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: Optional[str] = None¶
- binary: bool = False¶
- check: Optional[str] = None¶
- deposit_preauth: Optional[Union[str, xrpl.models.requests.ledger_entry.DepositPreauth]] = None¶
- directory: Optional[Union[str, xrpl.models.requests.ledger_entry.Directory]] = None¶
- escrow: Optional[Union[str, xrpl.models.requests.ledger_entry.Escrow]] = None¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- index: Optional[str] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- offer: Optional[Union[str, xrpl.models.requests.ledger_entry.Offer]] = None¶
- payment_channel: Optional[str] = None¶
- ripple_state: Optional[xrpl.models.requests.ledger_entry.RippleState] = None¶
- ticket: Optional[Union[str, xrpl.models.requests.ledger_entry.Ticket]] = 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.Manifest(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The manifest method reports the current “manifest” information for a given validator public key. The “manifest” is the public portion of that validator’s configured token.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.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.NoRippleCheck(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
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.
- account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- limit: Optional[int] = 300¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- role: xrpl.models.requests.no_ripple_check.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)¶
Bases:
str
,enum.Enum
Represents the options for the address role in a NoRippleCheckRequest.
- GATEWAY = 'gateway'¶
- USER = 'user'¶
- class xrpl.models.requests.PathFind(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
WebSocket API only! The path_find method searches for a path along which a transaction can possibly be made, and periodically sends updates when the path changes over time. For a simpler version that is supported by JSON-RPC, see the ripple_path_find method. For payments occurring strictly in XRP, it is not necessary to find a path, because XRP can be sent directly to any account.
Although the rippled server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths. Due to server load, pathfinding may not find the best results. Additionally, you should be careful with the pathfinding results from untrusted servers. A server could be modified to return less-than-optimal paths to earn money for its operators. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results. (Note: A server returning less-than-optimal results is not necessarily proof of malicious behavior; it could also be a symptom of heavy server load.)
- destination_account: str¶
This field is required.
- destination_amount: Amount¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: RequestMethod¶
This field is required.
- paths: Optional[List[Path]] = None¶
- send_max: Optional[Amount] = 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)¶
Bases:
str
,enum.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'¶
- class xrpl.models.requests.PathStep(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.base_model.BaseModel
A path is an array. Each member of a path is an object that specifies the step. A step has the following fields.
- account: Optional[str] = None¶
- currency: Optional[str] = None¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.base_model.BaseModel¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- issuer: Optional[str] = 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: Optional[int] = None¶
- type_hex: Optional[str] = None¶
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.Ping(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The ping command returns an acknowledgement, so that clients can test the connection status and latency.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.Random(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The random command provides a random number to be used as a source of entropy for random number generation by clients.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.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(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.base_model.BaseModel
The base class for all network request types. Represents fields common to all request types.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.RipplePathFind(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The ripple_path_find method is a simplified version of the path_find method that provides a single response with a payment path you can use right away. It is available in both the WebSocket and JSON-RPC APIs. However, the results tend to become outdated as time passes. Instead of making multiple calls to stay updated, you should instead use the path_find method to subscribe to continued updates where possible.
Although the rippled server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths.
- destination_account: str¶
This field is required.
- destination_amount: Union[xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount, str]¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- send_max: Optional[Union[xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount, str]] = None¶
- source_account: str¶
This field is required.
- source_currencies: Optional[List[Union[xrpl.models.currencies.issued_currency.IssuedCurrency, xrpl.models.currencies.xrp.XRP]]] = None¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.ServerInfo(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The server_info command asks the server for a human-readable version of various information about the rippled server being queried.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.ServerState(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The server_state command asks the server for various machine-readable information about the rippled server’s current state. The response is almost the same as the server_info method, but uses units that are easier to process instead of easier to read. (For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds.)
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.Sign(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.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.
- build_path: Optional[bool] = None¶
- fee_div_max: int = 1¶
- fee_mult_max: int = 10¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.sign.Sign¶
Construct a new Sign from a dictionary of parameters.
- Parameters
value – The value to construct the Sign from.
- Returns
A new Sign object, constructed using the given parameters.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- key_type: Optional[CryptoAlgorithm] = None¶
- method: RequestMethod¶
This field is required.
- offline: bool = False¶
- passphrase: Optional[str] = None¶
- secret: Optional[str] = None¶
- seed: Optional[str] = None¶
- seed_hex: Optional[str] = None¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Sign.
- Returns
The dictionary representation of a Sign.
- transaction: Transaction¶
This field is required.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.SignAndSubmit(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.submit.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.
- build_path: Optional[bool] = None¶
- fee_div_max: int = 1¶
- fee_mult_max: int = 10¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.sign_and_submit.SignAndSubmit¶
Construct a new SignAndSubmit from a dictionary of parameters.
- Parameters
value – The value to construct the SignAndSubmit from.
- Returns
A new SignAndSubmit object, constructed using the given parameters.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- key_type: Optional[CryptoAlgorithm] = None¶
- method: RequestMethod¶
This field is required.
- offline: bool = False¶
- passphrase: Optional[str] = None¶
- secret: Optional[str] = None¶
- seed: Optional[str] = None¶
- seed_hex: Optional[str] = None¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a SignAndSubmit.
- Returns
The dictionary representation of a SignAndSubmit.
- transaction: Transaction¶
This field is required.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.SignFor(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.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.
- account: str¶
This field is required.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.sign_for.SignFor¶
Construct a new SignFor from a dictionary of parameters.
- Parameters
value – The value to construct the SignFor from.
- Returns
A new SignFor object, constructed using the given parameters.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- key_type: Optional[CryptoAlgorithm] = None¶
- method: RequestMethod¶
This field is required.
- passphrase: Optional[str] = None¶
- secret: Optional[str] = None¶
- seed: Optional[str] = None¶
- seed_hex: Optional[str] = None¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a SignFor.
- Returns
The dictionary representation of a SignFor.
- transaction: Transaction¶
This field is required.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.StreamParameter(value)¶
Bases:
str
,enum.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'¶
- class xrpl.models.requests.Submit(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.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.
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.submit.Submit¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.SubmitMultisigned(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.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.
- fail_hard: bool = False¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.submit_multisigned.SubmitMultisigned¶
Construct a new SubmitMultisigned object from a dictionary of parameters.
- Parameters
value – The value to construct the SubmitMultisigned from.
- Returns
A new SubmitMultisigned object, constructed using the given parameters.
- classmethod from_xrpl(value: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a SubmitMultisigned object.
- Returns
The dictionary representation of a SubmitMultisigned object.
- tx_json: Transaction¶
This field is required.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.SubmitOnly(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.submit.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.
- fail_hard: bool = False¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.submit.Submit¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- tx_blob: str¶
This field is required.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.Subscribe(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The subscribe method requests periodic notifications from the server when certain events happen.
WebSocket API only.
- accounts: Optional[List[str]] = None¶
- accounts_proposed: Optional[List[str]] = None¶
- books: Optional[List[xrpl.models.requests.subscribe.SubscribeBook]] = None¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- streams: Optional[List[xrpl.models.requests.subscribe.StreamParameter]] = None¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- url: Optional[str] = None¶
- url_password: Optional[str] = None¶
- url_username: Optional[str] = None¶
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.TransactionEntry(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
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.)
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- ledger_hash: Optional[str] = None¶
- ledger_index: Optional[Union[str, int]] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- tx_hash: str¶
This field is required.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.Tx(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The tx method retrieves information on a single transaction.
- binary: bool = False¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- max_ledger: Optional[int] = None¶
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- min_ledger: Optional[int] = None¶
- to_dict() → Dict[str, Any]¶
Returns the dictionary representation of a Request.
- Returns
The dictionary representation of a Request.
- transaction: str¶
This field is required.
- validate() → None¶
Raises if this object is invalid.
- Raises
XRPLModelException – if this object is invalid.
- class xrpl.models.requests.Unsubscribe(*args: List[Any], **kwargs: Dict[str, Any])¶
Bases:
xrpl.models.requests.request.Request
The unsubscribe command tells the server to stop sending messages for a particular subscription or set of subscriptions.
WebSocket API only.
- accounts: Optional[List[str]] = None¶
- accounts_proposed: Optional[List[str]] = None¶
- books: Optional[List[xrpl.models.requests.unsubscribe.UnsubscribeBook]] = None¶
- classmethod from_dict(value: Dict[str, Any]) → xrpl.models.requests.request.Request¶
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: Union[str, Dict[str, Any]]) → xrpl.models.base_model.BaseModel¶
Creates a BaseModel object based on a JSON-like dictionary of keys in the JSON format used by the binary codec, or an actual JSON string representing the same data.
- Parameters
value – The dictionary or JSON string to be instantiated.
- Returns
A BaseModel object instantiated from the input.
- classmethod get_method(method: str) → Type[xrpl.models.requests.request.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.
- Raises
XRPLModelException – If method is not a valid Request method.
- id: Optional[Union[str, int]] = None¶
- classmethod is_dict_of_model(dictionary: Dict[str, Any]) → bool¶
Checks whether the provided
dictionary
is a dictionary representation of this class.Note: This only checks the exact model, and does not count model inheritance. This method returns
False
if the dictionary represents a subclass of this class.- Parameters
dictionary – The dictionary to check.
- Returns
True if dictionary is a
dict
representation of an instance of this class; False if not.
- is_valid() → bool¶
Returns whether this BaseModel is valid.
- Returns
Whether this BaseModel is valid.
- method: xrpl.models.requests.request.RequestMethod¶
This field is required.
- streams: Optional[List[xrpl.models.requests.subscribe.StreamParameter]] = 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.