okex

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PairStateLive    = "live"
	PairStateSuspend = "suspend"
	PairStatePreopen = "preopen"
)
View Source
const (
	Endpoint = "https://aws.okex.com/api"
)
View Source
const (
	QuoteSymbol = "USDC"
)

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 string `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
}

func (*Error) Error

func (err *Error) Error() string

type Pair

type Pair struct {
	Symbol        string    `json:"instId,omitempty"`
	BaseCurrency  string    `json:"baseCcy,omitempty"`
	QuoteCurrency string    `json:"quoteCcy,omitempty"`
	Type          string    `json:"instType,omitempty"`
	Status        PairState `json:"state,omitempty"`
}

func (Pair) IsOnline added in v1.0.6

func (pair Pair) IsOnline() bool

type PairState

type PairState string

type Pairs added in v1.0.6

type Pairs []*Pair

type Ticker

type Ticker struct {
	Type   string          `json:"instType"`
	Symbol string          `json:"instId"`
	Last   decimal.Decimal `json:"last"`
	Ask    decimal.Decimal `json:"askPx"`
	Bid    decimal.Decimal `json:"bidPx"`
}

Jump to

Keyboard shortcuts

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