client

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(endpoint *url.URL, opts ...Option) (*Client, error)

New constructs an admin API client.

func NewFromConfig

func NewFromConfig(cfg config.Client) (*Client, error)

NewFromConfig builds a client using repository config defaults.

func (*Client) EstimateSettlement added in v0.2.2

func (c *Client) EstimateSettlement(ctx context.Context, railID string) (*httpapi.EstimateSettlementResponse, error)

EstimateSettlement returns estimated gas and fees for settling a rail.

func (*Client) EstimateWithdraw added in v0.2.2

func (c *Client) EstimateWithdraw(ctx context.Context, recipient, amount string) (*httpapi.EstimateWithdrawResponse, error)

EstimateWithdraw returns estimated gas and fees for a withdrawal.

func (*Client) GetAccountInfo added in v0.2.2

func (c *Client) GetAccountInfo(ctx context.Context) (*httpapi.GetAccountInfoResponse, error)

GetAccountInfo fetches the payment account information for the storage operator.

func (*Client) GetSettlementStatus added in v0.2.2

func (c *Client) GetSettlementStatus(ctx context.Context, railID string) (*httpapi.SettlementStatusResponse, error)

GetSettlementStatus returns the status of a pending settlement for a rail.

func (*Client) GetWithdrawalStatus added in v0.2.2

func (c *Client) GetWithdrawalStatus(ctx context.Context) (*httpapi.WithdrawalStatusResponse, error)

GetWithdrawalStatus returns the status of a pending withdrawal.

func (*Client) ListLogLevels

func (c *Client) ListLogLevels(ctx context.Context) (map[string]string, error)

ListLogLevels fetches the list of configured loggers and their levels.

func (*Client) SetLogLevel

func (c *Client) SetLogLevel(ctx context.Context, system, level string) error

SetLogLevel sets the log level for a specific subsystem.

func (*Client) SetLogLevelRegex

func (c *Client) SetLogLevelRegex(ctx context.Context, expression, level string) error

SetLogLevelRegex sets the log level for all subsystems matching the expression.

func (*Client) SettleRail added in v0.2.2

func (c *Client) SettleRail(ctx context.Context, railID string) (*httpapi.SettleRailResponse, error)

SettleRail submits a settlement transaction for a rail.

func (*Client) Withdraw added in v0.2.2

func (c *Client) Withdraw(ctx context.Context, recipient, amount string) (*httpapi.WithdrawResponse, error)

Withdraw submits a withdrawal transaction.

type ErrFailedResponse

type ErrFailedResponse struct {
	StatusCode int
	Body       string
}

func (ErrFailedResponse) Error

func (e ErrFailedResponse) Error() string

type Option

type Option func(*Client) error

func WithBearerFromSigner

func WithBearerFromSigner(id principal.Signer) Option

WithBearerFromSigner configures the Authorization header using a JWT signed by the provided signer.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient replaces the underlying HTTP client (for custom timeouts, tracing, etc.).

Jump to

Keyboard shortcuts

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