Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIncorrectId = errors.New("incorrect id")
Functions ¶
func NewClient ¶
func NewClient(cfg *WebsocketConfig) *client.XRPLClient
Types ¶
type ErrorWebsocketClientXrplResponse ¶
func (*ErrorWebsocketClientXrplResponse) Error ¶
func (e *ErrorWebsocketClientXrplResponse) Error() string
type WebSocketClientXrplResponse ¶
type WebSocketClientXrplResponse struct {
ID int `json:"id"`
Status string `json:"status"`
Type string `json:"type"`
Error string `json:"error,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
Value map[string]any `json:"value,omitempty"`
Warning string `json:"warning,omitempty"`
Warnings []client.XRPLResponseWarning `json:"warnings,omitempty"`
Forwarded bool `json:"forwarded,omitempty"`
}
func (*WebSocketClientXrplResponse) GetError ¶
func (r *WebSocketClientXrplResponse) GetError() error
func (*WebSocketClientXrplResponse) GetResult ¶
func (r *WebSocketClientXrplResponse) GetResult(v any) error
type WebsocketClient ¶
type WebsocketClient struct {
// contains filtered or unexported fields
}
func NewWebsocketClient ¶
func NewWebsocketClient(cfg *WebsocketConfig) *WebsocketClient
Creates a new websocket client with cfg.
This client will open and close a websocket connection for each request.
func (*WebsocketClient) Address ¶
func (c *WebsocketClient) Address() string
func (*WebsocketClient) Faucet ¶
func (c *WebsocketClient) Faucet() string
func (*WebsocketClient) SendRequest ¶
func (c *WebsocketClient) SendRequest(req client.XRPLRequest) (client.XRPLResponse, error)
type WebsocketConfig ¶
func NewWebsocketConfig ¶
func NewWebsocketConfig(url string, opts ...WebsocketConfigOpt) (*WebsocketConfig, error)
type WebsocketConfigOpt ¶
type WebsocketConfigOpt func(c *WebsocketConfig)
Click to show internal directories.
Click to hide internal directories.