huobi

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PairStateOnline  = "online"
	PairStateOffline = "offline"
	PairStateSuspend = "suspend"
)
View Source
const (
	Endpoint = "https://api.huobi.pro/"
)

Variables

This section is empty.

Functions

func DecodeResponse

func DecodeResponse(resp *resty.Response) ([]byte, error)

func New

func New() core.Exchange

func Request

func Request(ctx context.Context) *resty.Request

func UnmarshalResponse

func UnmarshalResponse(resp *resty.Response, v interface{}) error

Types

type Error

type Error struct {
	Code int    `json:"code,omitempty"`
	Msg  string `json:"message,omitempty"`
}

func (*Error) Error

func (err *Error) Error() string

type Pair

type Pair struct {
	Symbol     string    `json:"symbol,omitempty"`
	State      PairState `json:"state,omitempty"`
	BaseAsset  string    `json:"base-currency,omitempty"`
	QuoteAsset string    `json:"quote-currency,omitempty"`
}

type PairState

type PairState string

type Ticker

type Ticker struct {
	Symbol string  `json:"symbol"`
	Open   float64 `json:"open"`
	Close  float64 `json:"close"`
	Low    float64 `json:"low"`
	High   float64 `json:"high"`
	Volume float64 `json:"vol"`
}

Jump to

Keyboard shortcuts

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