websocket

package
v0.0.0-...-498254e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 7 Imported by: 0

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

type ErrorWebsocketClientXrplResponse struct {
	Type    string
	Request map[string]any
}

func (*ErrorWebsocketClientXrplResponse) Error

type WebSocketClientXrplResponse

type WebSocketClientXrplResponse struct {
	ID        int                          `json:"id"`
	Status    string                       `json:"status"`
	Type      string                       `json:"type"`
	Error     string                       `json:"error,omitempty"`
	Result    map[string]any               `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) CheckError

func (r *WebSocketClientXrplResponse) CheckError() 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) SendRequest

func (c *WebsocketClient) SendRequest(req client.XRPLRequest) (client.XRPLResponse, error)

type WebsocketConfig

type WebsocketConfig struct {
	URL string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址