Documentation
¶
Index ¶
- type AccountInfo
- type AuthenticatedTradeHistory
- type ExternalAccounts
- type LakeBTC
- func (l *LakeBTC) CancelAllOrders(_ *order.Cancel) (order.CancelAllResponse, error)
- func (l *LakeBTC) CancelExistingOrder(orderID int64) error
- func (l *LakeBTC) CancelExistingOrders(orderIDs []string) error
- func (l *LakeBTC) CancelOrder(order *order.Cancel) error
- func (l *LakeBTC) CreateWithdraw(amount float64, accountID string) (Withdraw, error)
- func (l *LakeBTC) FetchAccountInfo() (account.Holdings, error)
- func (l *LakeBTC) FetchOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (l *LakeBTC) FetchTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (l *LakeBTC) FetchTradablePairs(asset asset.Item) ([]string, error)
- func (l *LakeBTC) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
- func (l *LakeBTC) GetAccountInformation() (AccountInfo, error)
- func (l *LakeBTC) GetActiveOrders(req *order.GetOrdersRequest) ([]order.Detail, error)
- func (l *LakeBTC) GetDefaultConfig() (*config.ExchangeConfig, error)
- func (l *LakeBTC) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, error)
- func (l *LakeBTC) GetExchangeHistory(p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]exchange.TradeHistory, error)
- func (l *LakeBTC) GetExternalAccounts() ([]ExternalAccounts, error)
- func (l *LakeBTC) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (l *LakeBTC) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (l *LakeBTC) GetFundingHistory() ([]exchange.FundHistory, error)
- func (l *LakeBTC) GetHistoricCandles(pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (l *LakeBTC) GetHistoricCandlesExtended(pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (l *LakeBTC) GetOpenOrders() ([]OpenOrders, error)
- func (l *LakeBTC) GetOrderBook(currency string) (Orderbook, error)
- func (l *LakeBTC) GetOrderHistory(req *order.GetOrdersRequest) ([]order.Detail, error)
- func (b *LakeBTC) GetOrderHistoryById(getOrdersRequest string) ([]order.Detail, error)
- func (l *LakeBTC) GetOrderInfo(orderID string) (order.Detail, error)
- func (l *LakeBTC) GetOrders(orders []int64) ([]Orders, error)
- func (l *LakeBTC) GetTicker() (map[string]Ticker, error)
- func (l *LakeBTC) GetTradeHistory(currency string, start int64) ([]TradeHistory, error)
- func (l *LakeBTC) GetTrades(timestamp int64) ([]AuthenticatedTradeHistory, error)
- func (l *LakeBTC) ModifyOrder(action *order.Modify) (string, error)
- func (l *LakeBTC) Run()
- func (l *LakeBTC) SendAuthenticatedHTTPRequest(method, params string, result interface{}) (err error)
- func (l *LakeBTC) SendHTTPRequest(path string, result interface{}) error
- func (l *LakeBTC) SetDefaults()
- func (l *LakeBTC) Setup(exch *config.ExchangeConfig) error
- func (l *LakeBTC) Start(wg *sync.WaitGroup)
- func (l *LakeBTC) SubmitOrder(s *order.Submit) (order.SubmitResponse, error)
- func (l *LakeBTC) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
- func (l *LakeBTC) Trade(isBuyOrder bool, amount, price float64, currency string) (Trade, error)
- func (l *LakeBTC) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription) error
- func (l *LakeBTC) UpdateAccountInfo() (account.Holdings, error)
- func (l *LakeBTC) UpdateOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (l *LakeBTC) UpdateTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (l *LakeBTC) UpdateTradablePairs(forceUpdate bool) error
- func (l *LakeBTC) ValidateCredentials() error
- func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (l *LakeBTC) WithdrawFiatFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (l *LakeBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (l *LakeBTC) WsConnect() error
- type OpenOrders
- type Orderbook
- type OrderbookStructure
- type Orders
- type Ticker
- type TickerResponse
- type Trade
- type TradeHistory
- type WebsocketConn
- type Withdraw
- type WsOrderbookUpdate
- type WsTrade
- type WsTrades
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountInfo ¶
type AccountInfo 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"` // nolint // API misspelling
} `json:"profile"`
}
AccountInfo contains account information
type AuthenticatedTradeHistory ¶
type AuthenticatedTradeHistory struct {
Type string `json:"type"`
Symbol string `json:"symbol"`
Amount float64 `json:"amount,string"`
Total float64 `json:"total,string"`
At int64 `json:"at"`
}
AuthenticatedTradeHistory is a store of personalised auth trade history
type ExternalAccounts ¶
type ExternalAccounts 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"`
}
ExternalAccounts holds external account information
type LakeBTC ¶
type LakeBTC struct {
exchange.Base
WebsocketConn
}
LakeBTC is the overarching type across the LakeBTC package
func (*LakeBTC) CancelAllOrders ¶
CancelAllOrders cancels all orders associated with a currency pair
func (*LakeBTC) CancelExistingOrder ¶
CancelExistingOrder cancels an order by ID number and returns an error
func (*LakeBTC) CancelExistingOrders ¶
CancelExistingOrders cancels an order by ID number and returns an error
func (*LakeBTC) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*LakeBTC) CreateWithdraw ¶
CreateWithdraw allows your to withdraw to external account WARNING: Only for BTC!
func (*LakeBTC) FetchAccountInfo ¶
FetchAccountInfo retrieves balances for all enabled currencies
func (*LakeBTC) FetchOrderbook ¶
FetchOrderbook returns orderbook base on the currency pair
func (*LakeBTC) FetchTicker ¶
FetchTicker returns the ticker for a currency pair
func (*LakeBTC) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*LakeBTC) GenerateDefaultSubscriptions ¶
func (l *LakeBTC) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
GenerateDefaultSubscriptions Adds default subscriptions to websocket to be handled by ManageSubscriptions()
func (*LakeBTC) GetAccountInformation ¶
func (l *LakeBTC) GetAccountInformation() (AccountInfo, error)
GetAccountInformation returns your current account information
func (*LakeBTC) GetActiveOrders ¶
GetActiveOrders retrieves any orders that are active/open
func (*LakeBTC) GetDefaultConfig ¶
func (l *LakeBTC) GetDefaultConfig() (*config.ExchangeConfig, error)
GetDefaultConfig returns a default exchange config
func (*LakeBTC) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specified currency
func (*LakeBTC) GetExchangeHistory ¶
func (l *LakeBTC) GetExchangeHistory(p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data within the timeframe provided.
func (*LakeBTC) GetExternalAccounts ¶
func (l *LakeBTC) GetExternalAccounts() ([]ExternalAccounts, error)
GetExternalAccounts returns your external accounts WARNING: Only for BTC!
func (*LakeBTC) GetFee ¶
func (l *LakeBTC) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*LakeBTC) GetFeeByType ¶
func (l *LakeBTC) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*LakeBTC) GetFundingHistory ¶
func (l *LakeBTC) GetFundingHistory() ([]exchange.FundHistory, error)
GetFundingHistory returns funding history, deposits and withdrawals
func (*LakeBTC) GetHistoricCandles ¶
func (l *LakeBTC) GetHistoricCandles(pair currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*LakeBTC) GetHistoricCandlesExtended ¶
func (l *LakeBTC) GetHistoricCandlesExtended(pair currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*LakeBTC) GetOpenOrders ¶
func (l *LakeBTC) GetOpenOrders() ([]OpenOrders, error)
GetOpenOrders returns all open orders associated with your account
func (*LakeBTC) GetOrderBook ¶
GetOrderBook returns the order book from LakeBTC
func (*LakeBTC) GetOrderHistory ¶
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*LakeBTC) GetOrderHistoryById ¶
GetOrderHistoryById retrieves specified closed order information Can Limit response to specific order status
func (*LakeBTC) GetOrderInfo ¶
GetOrderInfo returns information on a current open order
func (*LakeBTC) GetTradeHistory ¶
func (l *LakeBTC) GetTradeHistory(currency string, start int64) ([]TradeHistory, error)
GetTradeHistory returns the trade history for a given currency pair
func (*LakeBTC) GetTrades ¶
func (l *LakeBTC) GetTrades(timestamp int64) ([]AuthenticatedTradeHistory, error)
GetTrades returns trades associated with your account by timestamp
func (*LakeBTC) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*LakeBTC) SendAuthenticatedHTTPRequest ¶
func (l *LakeBTC) SendAuthenticatedHTTPRequest(method, params string, result interface{}) (err error)
SendAuthenticatedHTTPRequest sends an autheticated HTTP request to a LakeBTC
func (*LakeBTC) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated http request
func (*LakeBTC) Setup ¶
func (l *LakeBTC) Setup(exch *config.ExchangeConfig) error
Setup sets exchange configuration profile
func (*LakeBTC) SubmitOrder ¶
SubmitOrder submits a new order
func (*LakeBTC) Subscribe ¶
func (l *LakeBTC) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
Subscribe sends a websocket message to receive data from the channel
func (*LakeBTC) Trade ¶
Trade executes an order on the exchange and returns trade inforamtion or an error
func (*LakeBTC) Unsubscribe ¶
func (l *LakeBTC) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription) error
Unsubscribe sends a websocket message to unsubscribe from the channel
func (*LakeBTC) UpdateAccountInfo ¶
UpdateAccountInfo retrieves balances for all enabled currencies for the LakeBTC exchange
func (*LakeBTC) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*LakeBTC) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*LakeBTC) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*LakeBTC) ValidateCredentials ¶
ValidateCredentials validates current credentials used for wrapper functionality
func (*LakeBTC) WithdrawCryptocurrencyFunds ¶
func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*LakeBTC) WithdrawFiatFunds ¶
func (l *LakeBTC) WithdrawFiatFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*LakeBTC) WithdrawFiatFundsToInternationalBank ¶
func (l *LakeBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
type OpenOrders ¶
type OpenOrders 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"`
}
OpenOrders stores full information on your open orders
type Orderbook ¶
type Orderbook struct {
Bids []OrderbookStructure `json:"bids"`
Asks []OrderbookStructure `json:"asks"`
}
Orderbook contains arrays of orderbook information
type OrderbookStructure ¶
OrderbookStructure stores price and amount for order books
type Orders ¶
type Orders 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"`
}
Orders holds current order information
type TickerResponse ¶
type TickerResponse struct {
Last interface{}
Bid interface{}
Ask interface{}
High interface{}
Low interface{}
Volume interface{}
}
TickerResponse stores temp response Silly hack due to API returning null instead of strings
type TradeHistory ¶
type TradeHistory struct {
Date int64 `json:"data"`
Price float64 `json:"price,string"`
Amount float64 `json:"amount,string"`
TID int64 `json:"tid"`
}
TradeHistory holds trade history data
type WebsocketConn ¶
type WebsocketConn struct {
Client *pusher.Client
Ticker chan *pusher.Event
Orderbook chan *pusher.Event
Trade chan *pusher.Event
}
WebsocketConn defines a pusher websocket connection
type Withdraw ¶
type Withdraw 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"`
Error string `json:"error"`
}
Withdraw holds withdrawal information
type WsOrderbookUpdate ¶
WsOrderbookUpdate contains orderbook data from websocket