lakebtc

package
v0.0.0-...-77ca9cc Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LAKEBTC_API_URL               = "https://api.lakebtc.com/api_v2"
	LAKEBTC_API_VERSION           = "2"
	LAKEBTC_TICKER                = "ticker"
	LAKEBTC_ORDERBOOK             = "bcorderbook"
	LAKEBTC_TRADES                = "bctrades"
	LAKEBTC_GET_ACCOUNT_INFO      = "getAccountInfo"
	LAKEBTC_BUY_ORDER             = "buyOrder"
	LAKEBTC_SELL_ORDER            = "sellOrder"
	LAKEBTC_OPEN_ORDERS           = "openOrders"
	LAKEBTC_GET_ORDERS            = "getOrders"
	LAKEBTC_CANCEL_ORDER          = "cancelOrder"
	LAKEBTC_GET_TRADES            = "getTrades"
	LAKEBTC_GET_EXTERNAL_ACCOUNTS = "getExternalAccounts"
	LAKEBTC_CREATE_WITHDRAW       = "createWithdraw"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LakeBTC

type LakeBTC struct {
	exchange.ExchangeBase
}

func (*LakeBTC) CancelOrder

func (l *LakeBTC) CancelOrder(orderID int64) error

func (*LakeBTC) CreateWithdraw

func (l *LakeBTC) CreateWithdraw(amount float64, accountID int64) (LakeBTCWithdraw, error)

Only for BTC

func (*LakeBTC) GetAccountInfo

func (l *LakeBTC) GetAccountInfo() (LakeBTCAccountInfo, error)

func (*LakeBTC) GetExchangeAccountInfo

func (l *LakeBTC) GetExchangeAccountInfo() (exchange.ExchangeAccountInfo, error)

func (*LakeBTC) GetExternalAccounts

func (l *LakeBTC) GetExternalAccounts() ([]LakeBTCExternalAccounts, error)

Only for BTC

func (*LakeBTC) GetFee

func (l *LakeBTC) GetFee(maker bool) float64

func (*LakeBTC) GetOpenOrders

func (l *LakeBTC) GetOpenOrders() ([]LakeBTCOpenOrders, error)

func (*LakeBTC) GetOrderBook

func (l *LakeBTC) GetOrderBook(currency string) (LakeBTCOrderbook, error)

func (*LakeBTC) GetOrderbookEx

func (l *LakeBTC) GetOrderbookEx(p pair.CurrencyPair) (orderbook.OrderbookBase, error)

func (*LakeBTC) GetOrders

func (l *LakeBTC) GetOrders(orders []int64) ([]LakeBTCOrders, error)

func (*LakeBTC) GetTicker

func (l *LakeBTC) GetTicker() (map[string]LakeBTCTicker, error)

func (*LakeBTC) GetTickerPrice

func (l *LakeBTC) GetTickerPrice(p pair.CurrencyPair) (ticker.TickerPrice, error)

func (*LakeBTC) GetTradeHistory

func (l *LakeBTC) GetTradeHistory(currency string) ([]LakeBTCTradeHistory, error)

func (*LakeBTC) GetTrades

func (l *LakeBTC) GetTrades(timestamp int64) ([]LakeBTCAuthenticaltedTradeHistory, error)

func (*LakeBTC) Run

func (l *LakeBTC) Run()

func (*LakeBTC) SendAuthenticatedHTTPRequest

func (l *LakeBTC) SendAuthenticatedHTTPRequest(method, params string, result interface{}) (err error)

func (*LakeBTC) SetDefaults

func (l *LakeBTC) SetDefaults()

func (*LakeBTC) Setup

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

func (*LakeBTC) Start

func (l *LakeBTC) Start()

func (*LakeBTC) Trade

func (l *LakeBTC) Trade(orderType int, amount, price float64, currency string) (LakeBTCTrade, error)

type LakeBTCAccountInfo

type LakeBTCAccountInfo struct {
	Balance map[string]string `json:"balance"`
	Locked  map[string]string `json:"locked"`
	Profile struct {
		Email             string `json:"email"`
		UID               string `json:"uid"`
		BTCDepositAddress string `json:"btc_deposit_addres"`
	} `json:"profile"`
}

type LakeBTCAuthenticaltedTradeHistory

type LakeBTCAuthenticaltedTradeHistory struct {
	Type   string  `json:"type"`
	Symbol string  `json:"symbol"`
	Amount float64 `json:"amount,string"`
	Total  float64 `json:"total,string"`
	At     int64   `json:"at"`
}

type LakeBTCExternalAccounts

type LakeBTCExternalAccounts struct {
	ID         int64       `json:"id,string"`
	Type       string      `json:"type"`
	Address    string      `json:"address"`
	Alias      interface{} `json:"alias"`
	Currencies string      `json:"currencies"`
	State      string      `json:"state"`
	UpdatedAt  int64       `json:"updated_at,string"`
}

type LakeBTCOpenOrders

type LakeBTCOpenOrders struct {
	ID     int64   `json:"id"`
	Amount float64 `json:"amount,string"`
	Price  float64 `json:"price,string"`
	Symbol string  `json:"symbol"`
	Type   string  `json:"type"`
	At     int64   `json:"at"`
}

type LakeBTCOrderbook

type LakeBTCOrderbook struct {
	Bids []LakeBTCOrderbookStructure `json:"bids"`
	Asks []LakeBTCOrderbookStructure `json:"asks"`
}

type LakeBTCOrderbookStructure

type LakeBTCOrderbookStructure struct {
	Price  float64
	Amount float64
}

type LakeBTCOrders

type LakeBTCOrders struct {
	ID             int64   `json:"id"`
	OriginalAmount float64 `json:"original_amount,string"`
	Amount         float64 `json:"amount,string"`
	Price          float64 `json:"price,string"`
	Symbol         string  `json:"symbol"`
	Type           string  `json:"type"`
	State          string  `json:"state"`
	At             int64   `json:"at"`
}

type LakeBTCTicker

type LakeBTCTicker struct {
	Last   float64
	Bid    float64
	Ask    float64
	High   float64
	Low    float64
	Volume float64
}

type LakeBTCTickerResponse

type LakeBTCTickerResponse struct {
	Last   interface{}
	Bid    interface{}
	Ask    interface{}
	High   interface{}
	Low    interface{}
	Volume interface{}
}

Silly hack due to API returning null instead of strings

type LakeBTCTrade

type LakeBTCTrade struct {
	ID     int64  `json:"id"`
	Result string `json:"result"`
}

type LakeBTCTradeHistory

type LakeBTCTradeHistory struct {
	Date   int64   `json:"data"`
	Price  float64 `json:"price,string"`
	Amount float64 `json:"amount,string"`
	TID    int64   `json:"tid"`
}

type LakeBTCWithdraw

type LakeBTCWithdraw struct {
	ID                int64   `json:"id,string"`
	Amount            float64 `json:"amount,string"`
	Currency          string  `json:"currency"`
	Fee               float64 `json:"fee,string"`
	State             string  `json:"state"`
	Source            string  `json:"source"`
	ExternalAccountID int64   `json:"external_account_id,string"`
	At                int64   `json:"at"`
}

Jump to

Keyboard shortcuts

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