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: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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