swap

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContractEndPoint = "/swap-api/v1/swap_contract_info"
)
View Source
const (
	SwapHost = "api.hbdm.com"
)
View Source
const (
	SwapWSAddr = "wss://api.hbdm.com/swap-ws"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeC

type CodeC struct {
	*huobi.CodeC
}

func NewCodeC

func NewCodeC() *CodeC

func (*CodeC) Decode

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

type ContractInfo

type ContractInfo struct {
	Status string `json:"status"`
	TS     int    `json:"ts"`
	Data   []Data `json:"data"`
}

type Data

type Data struct {
	Symbol         string  `json:"symbol"`
	ContractCode   string  `json:"contract_code"`
	ContractSize   float64 `json:"contract_size"`
	PriceTick      float64 `json:"price_tick"`
	CreateDate     string  `json:"create_date"`
	ContractStatus int     `json:"contract_status"`
	SettlementDate string  `json:"settlement_date"`
}

type RestClient

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

func NewRestClient

func NewRestClient(key string, secret string) *RestClient

func (*RestClient) GetSwapContract

func (rc *RestClient) GetSwapContract(symbol string) (*Symbol, error)

func (*RestClient) Init

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

type Symbol

type Symbol struct {
	*exchange.BaseSwapSymbol
}

func (*Symbol) String

func (s *Symbol) String() string

type WSClient

type WSClient struct {
	*future.WSClientDeriv
}

func NewWSClient

func NewWSClient(data chan interface{}) *WSClient

func (*WSClient) Subscribe

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

Jump to

Keyboard shortcuts

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