ndau

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

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

README

go-ndau

Golang Ndau API Client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	CurrencySeatDate time.Time `json:"CurrencySeatDate"`
	Id               string    `json:"id"`
	Balance          int       `json:"balance"`
}

Account ...

type AccountListReq

type AccountListReq struct {
	Limit int    `json:"limit"`
	After string `json:"after"`
}

type AccountListResp

type AccountListResp struct {
	NumAccounts int      `json:"NumAccounts"`
	FirstIndex  int      `json:"FirstIndex"`
	After       string   `json:"After"`
	NextAfter   string   `json:NextAfter"`
	Accounts    []string `json:Accounts"`
}

AccountListResp

type AccountResp

type AccountResp map[string]Account

AccountResp

type CurrentPriceResp

type CurrentPriceResp struct {
	MarketPrice   int `json:"marketPrice"`
	TargetPrice   int `json:"targetPrice"`
	FloorPrice    int `json:"floorPrice"`
	TotalReleased int `json:"totalReleased"`
	TotalIssued   int `json:"totalIssued"`
	TotalNdau     int `json:"totalNdau"`
	TotalBurned   int `json:"totalBurned"`
	SIB           int `json:"sib"`
}

CurrentPriceResp

type HttpClient

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

type Ndau

type Ndau struct {
	Config *NdauConfig
	Client HttpClient
	Log    logger.Logger
}

func New

func New(client HttpClient, config *NdauConfig, loggers ...logger.Logger) (*Ndau, error)

New creates a new Ndau client

func (*Ndau) DoWithContext

func (n *Ndau) DoWithContext(ctx context.Context, method, api string, params interface{}) ([]byte, error)

DoWithContext is a general-purpose http POST/GET helper

func (*Ndau) GetData

func (n *Ndau) GetData(api string, params interface{}) ([]byte, error)

GetData is a general-purpose query helper

func (*Ndau) GetDataWithContext

func (n *Ndau) GetDataWithContext(ctx context.Context, api string, params interface{}) ([]byte, error)

GetDataWithContext is a general-purpose query helper

func (*Ndau) PostData

func (n *Ndau) PostData(api string, params interface{}) ([]byte, error)

GetData is a general-purpose query helper

func (*Ndau) PostDataWithContext

func (n *Ndau) PostDataWithContext(ctx context.Context, api string, params interface{}) ([]byte, error)

PostDataWithContexts is a general-purpose query helper

type NdauConfig

type NdauConfig struct {
	Network string
	NodeAPI string
}

Jump to

Keyboard shortcuts

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