RPC

RPC

class RPC(**kwargs)

Implements the rpc api endpoints.

call_by_name(command: str, **kwargs) RPCCommandResponseModel

Calls the specified RPC command.

Parameters
  • command (str) – The complete RPC command.

  • **kwargs – Extra keyword arguments.

Returns

The command output.

Return type

The RPCCommandResponse

Raises

APIError – Error thrown by node API. See message for details.

list_methods(**kwargs) List[RPCCommandListModel]

List available RPC call methods on this node.

Parameters

**kwargs – Extra keyword arguments.

Returns

A list of valid RPC commands.

Return type

List[RPCCommandListModel]

Raises

APIError – Error thrown by node API. See message for details.

RPCCommandListModel

class RPCCommandListModel(*, command: str, description: str)

A pydantic model for a RPC command.

command: str

The RPC command.

description: str

The command description.

RPCCommandResponseModel

class RPCCommandResponseModel(*, value: dict)

A pydantic model for a RPC response.

value: dict

The response.