okex

package
v0.0.0-...-a58d1de Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 15 Imported by: 3

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