client

package
v0.0.0-...-cb7fc92 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 20 Imported by: 1

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 Client

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

type Faucet

type Faucet interface {
	FundAccount(*faucet.FundAccountRequest) (*faucet.FundAccountResponse, XRPLResponse, error)
}

type HTTPClient

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

type JsonRpcConfig

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

func NewJsonRpcConfig

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

type JsonRpcConfigOpt

type JsonRpcConfigOpt func(c *JsonRpcConfig)

func WithFaucet

func WithFaucet(faucet string) JsonRpcConfigOpt

func WithHttpClient

func WithHttpClient(cl HTTPClient) JsonRpcConfigOpt

type XRPLClient

type XRPLClient struct {
	Account      Account
	Channel      Channel
	Ledger       Ledger
	Path         Path
	Subscription Subscription
	Transaction  Transaction
	Server       Server
	Clio         Clio
	Faucet       Faucet
	// contains filtered or unexported fields
}

func NewXRPLClient

func NewXRPLClient(cl Client) *XRPLClient

func (*XRPLClient) AutofillTx

func (c *XRPLClient) AutofillTx(acc types.Address, tx transactions.Tx) error

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
	GetError() 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