client

package module
v0.0.0-...-faf87da Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: ISC Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateServerSignature

func ValidateServerSignature(resp *http.Response, body []byte, serverPubkey []byte) error

Types

type Client

type Client struct {
	http.Client
	URL    string
	PubKey []byte
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string, pub []byte, s Signer, log slog.Logger) *Client

func (*Client) FeeAddress

func (c *Client) FeeAddress(ctx context.Context, req types.FeeAddressRequest,
	commitmentAddr stdaddr.Address) (*types.FeeAddressResponse, error)

func (*Client) PayFee

func (c *Client) PayFee(ctx context.Context, req types.PayFeeRequest,
	commitmentAddr stdaddr.Address) (*types.PayFeeResponse, error)

func (*Client) SetVoteChoices

func (c *Client) SetVoteChoices(ctx context.Context, req types.SetVoteChoicesRequest,
	commitmentAddr stdaddr.Address) (*types.SetVoteChoicesResponse, error)

func (*Client) TicketStatus

func (c *Client) TicketStatus(ctx context.Context, req types.TicketStatusRequest,
	commitmentAddr stdaddr.Address) (*types.TicketStatusResponse, error)

func (*Client) VspInfo

func (c *Client) VspInfo(ctx context.Context) (*types.VspInfoResponse, error)

type Signer

type Signer interface {
	SignMessage(ctx context.Context, message string, address stdaddr.Address) ([]byte, error)
}

Jump to

Keyboard shortcuts

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