future

package
v0.3.0-pre2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContractStatusOnline = 1
)
View Source
const (
	FutureHost = "api.hbdm.com"
)
View Source
const (
	FutureWSAddr = "wss://api.hbdm.com/ws"
)

Variables

This section is empty.

Functions

func TypeString added in v0.3.0

func TypeString(ft exchange.FutureType) string

Types

type CodeC

type CodeC struct {
	*huobi.CodeC
	// contains filtered or unexported fields
}

func NewCodeC

func NewCodeC(cm map[string]string) *CodeC

func (*CodeC) Decode

func (cc *CodeC) Decode(raw []byte) (rpc.Response, error)

type FSymbol

type FSymbol struct {
	Symbol         string `json:"symbol"`
	ContractCode   string `json:"contract_code"`
	DeliveryDate   string `json:"delivery_date"`
	ContractType   string `json:"contract_type"`
	ContractStatus int    `json:"contract_status"`
}

type FutureSymbol

type FutureSymbol struct {
	*exchange.BaseFutureSymbol
}

func (*FutureSymbol) String

func (fs *FutureSymbol) String() string

func (*FutureSymbol) WSSub

func (fs *FutureSymbol) WSSub() string

WSSub return symbol which used by websocket subscribe

type FutureSymbolResp

type FutureSymbolResp struct {
	Status string    `json:"status"`
	Data   []FSymbol `json:"data"`
}

type RestClient

type RestClient struct {
	*huobi.RestClient
	// contains filtered or unexported fields
}

func NewRestClient

func NewRestClient(key, secret string) *RestClient

func (*RestClient) GetFutureSymbols

func (rc *RestClient) GetFutureSymbols(index string) []*FutureSymbol

func (*RestClient) Init

func (rc *RestClient) Init(ctx context.Context) error

type WSClient

type WSClient struct {
	*WSClientDeriv
}

func NewWSClient

func NewWSClient(codeMap map[string]string, data chan interface{}) *WSClient

func (*WSClient) Subscribe

func (ws *WSClient) Subscribe(ctx context.Context, typ exchange.SubType, syms ...exchange.Symbol) error

type WSClientDeriv

type WSClientDeriv struct {
	*exchange.WSClient
	// contains filtered or unexported fields
}

WSClientDeriv define common logic used by huobi future swap ws

func NewWSClientDeriv

func NewWSClientDeriv(addr string, codec rpc.Codec, data chan interface{}) *WSClientDeriv

func (*WSClientDeriv) DoSubscribe

func (ws *WSClientDeriv) DoSubscribe(ctx context.Context, channels []string) error

func (*WSClientDeriv) Handle

func (ws *WSClientDeriv) Handle(ctx context.Context, notify *rpc.Notify)

Jump to

Keyboard shortcuts

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