liqui

package
v0.0.0-...-3240a16 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIQUI_API_PUBLIC_URL      = "https://api.Liqui.io/api"
	LIQUI_API_PRIVATE_URL     = "https://api.Liqui.io/tapi"
	LIQUI_API_PUBLIC_VERSION  = "3"
	LIQUI_API_PRIVATE_VERSION = "1"
	LIQUI_INFO                = "info"
	LIQUI_TICKER              = "ticker"
	LIQUI_DEPTH               = "depth"
	LIQUI_TRADES              = "trades"
	LIQUI_ACCOUNT_INFO        = "getInfo"
	LIQUI_TRADE               = "Trade"
	LIQUI_ACTIVE_ORDERS       = "ActiveOrders"
	LIQUI_ORDER_INFO          = "OrderInfo"
	LIQUI_CANCEL_ORDER        = "CancelOrder"
	LIQUI_TRADE_HISTORY       = "TradeHistory"
	LIQUI_WITHDRAW_COIN       = "WithdrawCoin"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Liqui

type Liqui struct {
	exchange.Base
	Ticker map[string]LiquiTicker
	Info   LiquiInfo
}

func (*Liqui) CancelOrder

func (l *Liqui) CancelOrder(OrderID int64) (bool, error)

func (*Liqui) GetAccountInfo

func (l *Liqui) GetAccountInfo() (LiquiAccountInfo, error)

func (*Liqui) GetActiveOrders

func (l *Liqui) GetActiveOrders(pair string) (map[string]LiquiActiveOrders, error)

func (*Liqui) GetAvailablePairs

func (l *Liqui) GetAvailablePairs(nonHidden bool) []string

func (*Liqui) GetDepth

func (l *Liqui) GetDepth(symbol string) (LiquiOrderbook, error)

func (*Liqui) GetExchangeAccountInfo

func (l *Liqui) GetExchangeAccountInfo() (exchange.AccountInfo, error)

GetExchangeAccountInfo retrieves balances for all enabled currencies for the Liqui exchange

func (*Liqui) GetFee

func (l *Liqui) GetFee(currency string) (float64, error)

func (*Liqui) GetInfo

func (l *Liqui) GetInfo() (LiquiInfo, error)

func (*Liqui) GetOrderInfo

func (l *Liqui) GetOrderInfo(OrderID int64) (map[string]LiquiOrderInfo, error)

func (*Liqui) GetOrderbookEx

func (l *Liqui) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)

GetOrderbookEx returns orderbook base on the currency pair

func (*Liqui) GetTicker

func (l *Liqui) GetTicker(symbol string) (map[string]LiquiTicker, error)

func (*Liqui) GetTickerPrice

func (l *Liqui) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)

GetTickerPrice returns the ticker for a currency pair

func (*Liqui) GetTradeHistory

func (l *Liqui) GetTradeHistory(vals url.Values, pair string) (map[string]LiquiTradeHistory, error)

func (*Liqui) GetTrades

func (l *Liqui) GetTrades(symbol string) ([]LiquiTrades, error)

func (*Liqui) Run

func (l *Liqui) Run()

Run implements the Liqui wrapper

func (*Liqui) SendAuthenticatedHTTPRequest

func (l *Liqui) SendAuthenticatedHTTPRequest(method string, values url.Values, result interface{}) (err error)

func (*Liqui) SetDefaults

func (l *Liqui) SetDefaults()

func (*Liqui) Setup

func (l *Liqui) Setup(exch config.ExchangeConfig)

func (*Liqui) Start

func (l *Liqui) Start()

Start starts the Liqui go routine

func (*Liqui) Trade

func (l *Liqui) Trade(pair, orderType string, amount, price float64) (float64, error)

to-do: convert orderid to int64

func (*Liqui) UpdateOrderbook

func (l *Liqui) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)

UpdateOrderbook updates and returns the orderbook for a currency pair

func (*Liqui) UpdateTicker

func (l *Liqui) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)

UpdateTicker updates and returns the ticker for a currency pair

func (*Liqui) WithdrawCoins

func (l *Liqui) WithdrawCoins(coin string, amount float64, address string) (LiquiWithdrawCoins, error)

API mentions that this isn't active now, but will be soon - you must provide the first 8 characters of the key in your ticket to support.

type LiquiAccountInfo

type LiquiAccountInfo struct {
	Funds  map[string]float64 `json:"funds"`
	Rights struct {
		Info     bool `json:"info"`
		Trade    bool `json:"trade"`
		Withdraw bool `json:"withdraw"`
	} `json:"rights"`
	ServerTime       float64 `json:"server_time"`
	TransactionCount int     `json:"transaction_count"`
	OpenOrders       int     `json:"open_orders"`
}

type LiquiActiveOrders

type LiquiActiveOrders struct {
	Pair             string  `json:"pair"`
	Type             string  `json:"sell"`
	Amount           float64 `json:"amount"`
	Rate             float64 `json:"rate"`
	TimestampCreated float64 `json:"time_created"`
	Status           int     `json:"status"`
}

type LiquiCancelOrder

type LiquiCancelOrder struct {
	OrderID float64            `json:"order_id"`
	Funds   map[string]float64 `json:"funds"`
}

type LiquiInfo

type LiquiInfo struct {
	ServerTime int64                `json:"server_time"`
	Pairs      map[string]LiquiPair `json:"pairs"`
}

type LiquiOrderInfo

type LiquiOrderInfo struct {
	Pair             string  `json:"pair"`
	Type             string  `json:"sell"`
	StartAmount      float64 `json:"start_amount"`
	Amount           float64 `json:"amount"`
	Rate             float64 `json:"rate"`
	TimestampCreated float64 `json:"time_created"`
	Status           int     `json:"status"`
}

type LiquiOrderbook

type LiquiOrderbook struct {
	Asks [][]float64 `json:"asks"`
	Bids [][]float64 `json:"bids"`
}

type LiquiPair

type LiquiPair struct {
	DecimalPlaces int     `json:"decimal_places"`
	MinPrice      float64 `json:"min_price"`
	MaxPrice      float64 `json:"max_price"`
	MinAmount     float64 `json:"min_amount"`
	Hidden        int     `json:"hidden"`
	Fee           float64 `json:"fee"`
}

type LiquiResponse

type LiquiResponse struct {
	Return  interface{} `json:"return"`
	Success int         `json:"success"`
	Error   string      `json:"error"`
}

type LiquiTicker

type LiquiTicker struct {
	High    float64
	Low     float64
	Avg     float64
	Vol     float64
	Vol_cur float64
	Last    float64
	Buy     float64
	Sell    float64
	Updated int64
}

type LiquiTrade

type LiquiTrade struct {
	Received float64            `json:"received"`
	Remains  float64            `json:"remains"`
	OrderID  float64            `json:"order_id"`
	Funds    map[string]float64 `json:"funds"`
}

type LiquiTradeHistory

type LiquiTradeHistory struct {
	Pair      string  `json:"pair"`
	Type      string  `json:"type"`
	Amount    float64 `json:"amount"`
	Rate      float64 `json:"rate"`
	OrderID   float64 `json:"order_id"`
	MyOrder   int     `json:"is_your_order"`
	Timestamp float64 `json:"timestamp"`
}

type LiquiTrades

type LiquiTrades struct {
	Type      string  `json:"type"`
	Price     float64 `json:"bid"`
	Amount    float64 `json:"amount"`
	TID       int64   `json:"tid"`
	Timestamp int64   `json:"timestamp"`
}

type LiquiWithdrawCoins

type LiquiWithdrawCoins struct {
	TID        int64              `json:"tId"`
	AmountSent float64            `json:"amountSent"`
	Funds      map[string]float64 `json:"funds"`
}

Jump to

Keyboard shortcuts

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