okex

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package okex okex rest api package

Index

Constants

View Source
const (
	RestHost = "www.okex.com"
	ApiVer   = "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	URL        url.URL
	HTTPClient *http.Client
	AccessKey  string
	SecretKey  string
}

Client OkEx client

func New

func New(accessKey string, secretKey string) *Client

New creates a new OkEx Client

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context) ([]model.Balance, error)

GetAccount 获取用户信息, for POST https://www.okex.com/api/v1/userinfo.do

func (*Client) GetDepth

func (c *Client) GetDepth(ctx context.Context, quote string, base string) (*model.OrderBook, error)

GetDepth 获取币币市场深度, for Get /api/v1/depth

func (*Client) GetRecords

func (c *Client) GetRecords(ctx context.Context, quote string, base string, interval string, since int64, limit int64) ([]model.Record, error)

GetRecords 获取币币K线数据, for GET https://www.okex.com/api/v1/kline.do

func (*Client) GetTicker

func (c *Client) GetTicker(ctx context.Context, quote string, base string) (*model.Ticker, error)

GetTicker 获取OKEx最新币币行情数据, for Get /api/v1/ticker.do

func (*Client) GetTrades

func (c *Client) GetTrades(ctx context.Context, quote string, base string) ([]model.Trade, error)

GetTrades 获取币币交易信息, for GET https://www.okex.com/api/v1/trades.do

func (*Client) SignParams

func (c *Client) SignParams(values *url.Values) error

Jump to

Keyboard shortcuts

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