sdk

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 20

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, apiKey api.ExchangeAPIKey) (*Ccxt, error)

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

func (*Ccxt) CancelOrder added in v1.3.0

func (c *Ccxt) CancelOrder(orderID string, tradingPair string) (*CcxtOpenOrder, error)

CancelOrder calls the /cancelOrder endpoint on CCXT with the orderID and tradingPair

func (*Ccxt) CreateLimitOrder added in v1.3.0

func (c *Ccxt) CreateLimitOrder(tradingPair string, side string, amount float64, price float64) (*CcxtOpenOrder, error)

CreateLimitOrder calls the /createOrder endpoint on CCXT with a limit price and the order type set to "limit"

func (*Ccxt) FetchBalance added in v1.3.0

func (c *Ccxt) FetchBalance() (map[string]CcxtBalance, error)

FetchBalance calls the /fetchBalance endpoint on CCXT

func (*Ccxt) FetchMyTrades added in v1.3.0

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

func (*Ccxt) FetchOpenOrders added in v1.3.0

func (c *Ccxt) FetchOpenOrders(tradingPairs []string) (map[string][]CcxtOpenOrder, error)

FetchOpenOrders calls the /fetchOpenOrders endpoint on CCXT

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 CcxtBalance added in v1.3.0

type CcxtBalance struct {
	Total float64
	Used  float64
	Free  float64
}

CcxtBalance represents the balance for an asset

type CcxtOpenOrder added in v1.3.0

type CcxtOpenOrder struct {
	Amount    float64
	Cost      float64
	Filled    float64
	ID        string
	Price     float64
	Side      string
	Status    string
	Symbol    string
	Type      string
	Timestamp int64
}

CcxtOpenOrder represents an open order

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