sdk

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ccxt

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

Ccxt Rest SDK (https://github.com/franz-see/ccxt-rest, https://github.com/ccxt/ccxt/)

func MakeInitializedCcxtExchange

func MakeInitializedCcxtExchange(ccxtBaseURL string, exchangeName string) (*Ccxt, error)

MakeInitializedCcxtExchange constructs an instance of Ccxt that is bound to a specific exchange instance on the CCXT REST server

func (*Ccxt) FetchOrderBook

func (c *Ccxt) FetchOrderBook(tradingPair string, limit *int) (map[string][]CcxtOrder, error)

FetchOrderBook calls the /fetchOrderBook endpoint on CCXT, trading pair is the CCXT version of the trading pair

func (*Ccxt) FetchTicker

func (c *Ccxt) FetchTicker(tradingPair string) (map[string]interface{}, error)

FetchTicker calls the /fetchTicker endpoint on CCXT, trading pair is the CCXT version of the trading pair

func (*Ccxt) FetchTrades

func (c *Ccxt) FetchTrades(tradingPair string) ([]CcxtTrade, error)

FetchTrades calls the /fetchTrades endpoint on CCXT, trading pair is the CCXT version of the trading pair TODO take in since and limit values to match CCXT's API

type CcxtOrder

type CcxtOrder struct {
	Price  float64
	Amount float64
}

CcxtOrder represents an order in the orderbook

type CcxtTrade

type CcxtTrade struct {
	Amount    float64 `json:"amount"`
	Cost      float64 `json:"cost"`
	Datetime  string  `json:"datetime"`
	ID        string  `json:"id"`
	Price     float64 `json:"price"`
	Side      string  `json:"side"`
	Symbol    string  `json:"symbol"`
	Timestamp int64   `json:"timestamp"`
}

CcxtTrade represents a trade

Jump to

Keyboard shortcuts

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