client

package
v0.0.0-...-9abe75c Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyUrl = errors.New("empty port and IP provided")

Functions

This section is empty.

Types

type Account

type Account interface {
	GetAccountChannels(req *account.AccountChannelsRequest) (*account.AccountChannelsResponse, XRPLResponse, error)
	GetAccountInfo(req *account.AccountInfoRequest) (*account.AccountInfoResponse, XRPLResponse, error)
}

type Client

type Client interface {
	SendRequest(req XRPLRequest) (XRPLResponse, error)
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type JsonRpcConfig

type JsonRpcConfig struct {
	HTTPClient HTTPClient
	Url        string
	Headers    map[string][]string
}

func NewJsonRpcConfig

func NewJsonRpcConfig(url string, opts ...JsonRpcConfigOpt) (*JsonRpcConfig, error)

type JsonRpcConfigOpt

type JsonRpcConfigOpt func(c *JsonRpcConfig)

func WithHttpClient

func WithHttpClient(cl HTTPClient) JsonRpcConfigOpt

type XRPLClient

type XRPLClient struct {
	Account Account
	// contains filtered or unexported fields
}

func NewXRPLClient

func NewXRPLClient(cl Client) *XRPLClient

func (*XRPLClient) Client

func (c *XRPLClient) Client() Client

type XRPLRequest

type XRPLRequest interface {
	Method() string
	Validate() error
}

type XRPLResponse

type XRPLResponse interface {
	GetResult(v any) error
}

type XRPLResponseWarning

type XRPLResponseWarning struct {
	Id      int    `json:"id"`
	Message string `json:"message"`
	Details any    `json:"details,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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