XRPL Network Clients

Public interface for network clients for interacting with the XRPL.

class xrpl.clients.Client(url: str)

Bases: abc.ABC

Interface for all network clients to follow.

abstract request(request_object: xrpl.models.requests.request.Request)xrpl.models.response.Response

Submit the request represented by the request_object to the rippled node specified by this client’s URL.

Parameters

request_object – An object representing information about a rippled request.

Raises

NotImplementedError – Always.

class xrpl.clients.JsonRpcClient(url: str)

Bases: xrpl.clients.client.Client

A client for interacting with the rippled JSON RPC.

request(request_object: xrpl.models.requests.request.Request)xrpl.models.response.Response

Submit the request represented by the request_object to the rippled node specified by this client’s URL.

Parameters

request_object – An object representing information about a rippled request.

Returns

The response from the server, as a Response object.

exception xrpl.clients.XRPLRequestFailureException(result: Dict[str, Any])

Bases: xrpl.constants.XRPLException

XRPL Request Exception, when the request fails.

xrpl.clients.json_to_response(json: Dict[str, Any])xrpl.models.response.Response

Converts a JSON response from the rippled server into a Response object.

Parameters

json – A dictionary representing the contents of the json response from the rippled server.

Returns

A Response object containing the information in the rippled server’s response.

xrpl.clients.request_to_json_rpc(request_object: xrpl.models.requests.request.Request)Dict[str, Any]

Converts a request model object to the appropriate JSON format for interacting with the rippled API.

Parameters

request_object – A Request object representing the parameters of a request to the rippled JSON RPC.

Returns

A dictionary containing the attributes of this Request object formatted for submission to the rippled JSON RPC.