poloniexclient

package
v0.0.0-...-54bf965 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoanOrder

type LoanOrder struct {
	Rate     float64
	Amount   float64
	RangeMin int
	RangeMax int
}

LoanOrder is a single an order (offer or demand) for a specific rate

func (*LoanOrder) UnmarshalJSON

func (order *LoanOrder) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON is a custom unmarshaller to convert the strings poloniex returns as Rate and Amount to floats

type LoanOrders

type LoanOrders struct {
	Currency string
	Offers   []LoanOrder
	Demands  []LoanOrder
}

LoanOrders are the loan offers and demands for a specific currency

type OrderBook

type OrderBook struct {
	CurrencyPair string
	Asks         []OrderBookEntry
	Bids         []OrderBookEntry
}

OrderBook is the asks and bids for a currency pair

type OrderBookEntry

type OrderBookEntry struct {
	Price  float64
	Amount float64
}

OrderBookEntry is a value/amount combination representing an entry in an OrderBook

func (*OrderBookEntry) UnmarshalJSON

func (entry *OrderBookEntry) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON is a custom unmarshaller to handle poloniex special json format

type PoloniexClient

type PoloniexClient struct {
	Key    string
	Secret string
	// contains filtered or unexported fields
}

PoloniexClient is a client to the poloniex (https://www.poloniex.com) api

func NewClient

func NewClient(key, secret string) (client *PoloniexClient, err error)

NewClient creates a new poloniex client given the api key and secret

func (*PoloniexClient) ReturnBalances

func (poloniexClient *PoloniexClient) ReturnBalances() (balances *map[string]float64, err error)

ReturnBalances returns the available balances

func (*PoloniexClient) ReturnLoanOrders

func (poloniexClient *PoloniexClient) ReturnLoanOrders(currency string) (loanorders *LoanOrders, err error)

ReturnLoanOrders returns the loan offers and demands for a specific currency

func (*PoloniexClient) ReturnOrderBook

func (poloniexClient *PoloniexClient) ReturnOrderBook(currencypair string, depth int) (orderbook *OrderBook, err error)

ReturnOrderBook returns the orderbook for a specific currencypair up to a certain depth

Jump to

Keyboard shortcuts

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