ocx

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_BASE_URL = "https://openapi.ocx.com"
	V2           = "/api/v2/"

	TICKER_API  = "market/ticker/%s"
	TICKERS_API = "market/tickers"
	DEPTH_API   = "depth?market_code=%s"
	SERVER_TIME = "timestamp"

	TRADE_URL       = "orders"
	GET_ACCOUNT_API = "accounts"
	GET_ORDER_API   = "orders/%s"

	CANCEL_ORDER_API     = "orders/:%s/cancel"
	CANCEL_ALL_ORDER_API = "orders/clear"

	PLACE_ORDER_API = "orders"
)

Variables

View Source
var TimeOffset int64 = 0

Functions

This section is empty.

Types

type Ocx

type Ocx struct {
	// contains filtered or unexported fields
}

func New

func New(client *http.Client, apikey, secretkey string) *Ocx

func (*Ocx) CancelOrder

func (o *Ocx) CancelOrder(orderId string, currency CurrencyPair) (bool, error)

func (*Ocx) GetAccount

func (o *Ocx) GetAccount() (*Account, error)

func (*Ocx) GetDepth

func (o *Ocx) GetDepth(size int, currency CurrencyPair) (*Depth, error)

func (*Ocx) GetExchangeName

func (o *Ocx) GetExchangeName() string

func (*Ocx) GetKlineRecords

func (o *Ocx) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error)

func (*Ocx) GetOneOrder

func (o *Ocx) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)

func (*Ocx) GetOrderHistorys

func (o *Ocx) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error)

func (*Ocx) GetOrdersList

func (o *Ocx) GetOrdersList()

func (*Ocx) GetServerTime

func (o *Ocx) GetServerTime() int64

func (*Ocx) GetTicker

func (o *Ocx) GetTicker(currencyPair CurrencyPair) (*Ticker, error)

func (*Ocx) GetTrades

func (o *Ocx) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

非个人,整个交易所的交易记录

func (*Ocx) GetUnfinishOrders

func (o *Ocx) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)

func (*Ocx) LimitBuy

func (o *Ocx) LimitBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Ocx) LimitSell

func (o *Ocx) LimitSell(amount, price string, currency CurrencyPair) (*Order, error)

func (*Ocx) MarketBuy

func (o *Ocx) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Ocx) MarketSell

func (o *Ocx) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)

Jump to

Keyboard shortcuts

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