cryptopia

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 16 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	API_BASE_URL = "https://www.cryptopia.co.nz/api/"

	TICKERS_URI                = "GetMarkets"
	TICKER_URI                 = "GetMarket/"
	DEPTH_URI                  = "GetMarketOrders"
	CANCEL_URI                 = "CancelTrade"
	SUBMIT_ORDER_URI           = "SubmitTrade"
	DEFAULT_HTTPCLIENT_TIMEOUT = 30 // HTTP client timeout
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cryptopia

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

func New

func New(client *http.Client, accessKey, secretKey string) *Cryptopia

func (*Cryptopia) CancelOrder

func (cta *Cryptopia) CancelOrder(orderId string, currency CurrencyPair) (bool, error)

func (*Cryptopia) GetAccount

func (cta *Cryptopia) GetAccount() (*Account, error)

func (*Cryptopia) GetDepth

func (cta *Cryptopia) GetDepth(size int, currency CurrencyPair) (*Depth, error)

GetDepth get orderbook

func (*Cryptopia) GetExchangeName

func (cta *Cryptopia) GetExchangeName() string

func (*Cryptopia) GetKlineRecords

func (cta *Cryptopia) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error)

func (*Cryptopia) GetOneOrder

func (cta *Cryptopia) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)

func (*Cryptopia) GetOrderHistorys

func (cta *Cryptopia) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error)

func (*Cryptopia) GetTicker

func (cta *Cryptopia) GetTicker(currency CurrencyPair) (*Ticker, error)

func (*Cryptopia) GetTickerInBuf

func (cta *Cryptopia) GetTickerInBuf(currency CurrencyPair) (*Ticker, error)

func (*Cryptopia) GetTickers

func (cta *Cryptopia) GetTickers(currency CurrencyPair) (*Ticker, error)

func (*Cryptopia) GetTrades

func (cta *Cryptopia) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

func (*Cryptopia) GetUnfinishOrders

func (cta *Cryptopia) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)

func (*Cryptopia) LimitBuy

func (cta *Cryptopia) LimitBuy(amount, price string, currency CurrencyPair) (*Order, error)

LimitBuy ...

func (*Cryptopia) LimitSell

func (cta *Cryptopia) LimitSell(amount, price string, currency CurrencyPair) (*Order, error)

LimitSell ...

func (*Cryptopia) MarketBuy

func (cta *Cryptopia) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Cryptopia) MarketSell

func (cta *Cryptopia) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)

func (*Cryptopia) SetDebug

func (cta *Cryptopia) SetDebug(enable bool)

Jump to

Keyboard shortcuts

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