dax

package
v0.0.0-...-77987ee Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package dax provides a trading api sdk and subscribe websocket

Index

Constants

View Source
const (
	API_BASE = "https://api-dax.btcc.com/tradeapi/" // Dax API endpoint
)
View Source
const (
	DAX_WSS_API = "wss://ws-dax.btcc.com/ws/pub"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dax

type Dax struct {
	ApiBase     string
	Credentials *aws.Credentials
	Client      *http.Client
}

func New

func New(apiKey, apiSecret string) *Dax

func (*Dax) CancelOrder

func (d *Dax) CancelOrder(currencyPair, oid string) (*HttpResponse, error)

func (*Dax) GetAccountInfo

func (d *Dax) GetAccountInfo() (*HttpResponse, error)

func (*Dax) GetMyOrders

func (d *Dax) GetMyOrders(currencyPair string) (*HttpResponse, error)

for open orders go to subscribe websocket api

func (*Dax) PlaceOrder

func (d *Dax) PlaceOrder(order Order) (*HttpResponse, error)

func (*Dax) SubscribeExchange

func (d *Dax) SubscribeExchange(market string, dataCh chan<- []byte, stop <-chan struct{})

type HttpResponse

type HttpResponse struct {
	StatusCode int
	Body       []byte
}

type Order

type Order struct {
	CurrencyPair string // currency pair
	Price        string //order price
	Quantity     string // order quantity
	Type         string // "LIMIT"
	BuyOrSell    string //"BUY" "SELL"
}

type SubscribeCmd

type SubscribeCmd struct {
	MsgType   string `json:"MsgType"`   //example "QuoteRequest"
	CRID      string `json:"CRID"`      //example unique id
	Symbol    string `json:"Symbol"`    //example ETH_BTC
	QuoteType int    `json:"QuoteType"` //example 2
}

Jump to

Keyboard shortcuts

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