Documentation ¶
Index ¶
- type Balance
- type CryptoCurrencyDeposit
- type FundHistory
- type FundingRecords
- type GeneralReturn
- type ItBit
- func (i *ItBit) CancelOrder(walletID, orderID string) error
- func (i *ItBit) CreateWallet(walletName string) (Wallet, error)
- func (i *ItBit) GetDepositAddress(walletID, currency string) (CryptoCurrencyDeposit, error)
- func (i *ItBit) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (i *ItBit) GetFee(maker bool) float64
- func (i *ItBit) GetFundingHistory(walletID string, params url.Values) (FundingRecords, error)
- func (i *ItBit) GetOrder(walletID string, params url.Values) (Order, error)
- func (i *ItBit) GetOrderbook(currencyPair string) (OrderbookResponse, error)
- func (i *ItBit) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (i *ItBit) GetTicker(currencyPair string) (Ticker, error)
- func (i *ItBit) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (i *ItBit) GetTradeHistory(currencyPair, timestamp string) (Trades, error)
- func (i *ItBit) GetWallet(walletID string) (Wallet, error)
- func (i *ItBit) GetWalletBalance(walletID, currency string) (Balance, error)
- func (i *ItBit) GetWalletTrades(walletID string, params url.Values) (Records, error)
- func (i *ItBit) GetWallets(params url.Values) ([]Wallet, error)
- func (i *ItBit) PlaceOrder(walletID, side, orderType, currency string, amount, price float64, ...) (Order, error)
- func (i *ItBit) Run()
- func (i *ItBit) SendAuthenticatedHTTPRequest(method string, path string, params map[string]interface{}, result interface{}) error
- func (i *ItBit) SetDefaults()
- func (i *ItBit) Setup(exch config.ExchangeConfig)
- func (i *ItBit) Start()
- func (i *ItBit) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (i *ItBit) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (i *ItBit) WalletTransfer(walletID, sourceWallet, destWallet string, amount float64, currency string) (WalletTransfer, error)
- type Order
- type OrderbookResponse
- type Records
- type Ticker
- type TradeHistory
- type Trades
- type Wallet
- type WalletTransfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balance ¶
type Balance struct { Currency string `json:"currency"` AvailableBalance float64 `json:"availableBalance,string"` TotalBalance float64 `json:"totalBalance,string"` }
Balance is a sub type holding balance information
type CryptoCurrencyDeposit ¶
type CryptoCurrencyDeposit struct { ID int `json:"id"` WalletID string `json:"walletID"` DepositAddress string `json:"depositAddress"` Metadata interface{} `json:"metadata"` }
CryptoCurrencyDeposit holds information about a new wallet
type FundHistory ¶
type FundHistory struct { BankName string `json:"bankName"` WithdrawalID int64 `json:"withdrawalId"` HoldingPeriodCompletionDate string `json:"holdingPeriodCompletionDate"` DestinationAddress string `json:"destinationAddress"` TxnHash string `json:"txnHash"` Time string `json:"time"` Currency string `json:"currency"` TransactionType string `json:"transactionType"` Amount float64 `json:"amount,string"` WalletName string `json:"walletName"` Status string `json:"status"` }
FundHistory stores historic funding transactions
type FundingRecords ¶
type FundingRecords struct { TotalNumberOfRecords int `json:"totalNumberOfRecords,string"` CurrentPageNumber int `json:"currentPageNumber,string"` LatestExecutedID int64 `json:"latestExecutionId,string"` RecordsPerPage int `json:"recordsPerPage,string"` FundingHistory []FundHistory `json:"fundingHistory"` }
FundingRecords embodies records of fund history information
type GeneralReturn ¶
type GeneralReturn struct { Code int `json:"code"` Description string `json:"description"` RequestID string `json:"requestId"` }
GeneralReturn is a generalized return type to capture any errors
type ItBit ¶
type ItBit struct {
exchange.Base
}
ItBit is the overarching type across the ItBit package
func (*ItBit) CancelOrder ¶
CancelOrder cancels and open order. *This is not a guarantee that the order has been cancelled!*
func (*ItBit) CreateWallet ¶
CreateWallet creates a new wallet with a specified name.
func (*ItBit) GetDepositAddress ¶
func (i *ItBit) GetDepositAddress(walletID, currency string) (CryptoCurrencyDeposit, error)
GetDepositAddress returns a deposit address to send cryptocurrency to.
func (*ItBit) GetExchangeAccountInfo ¶
GetExchangeAccountInfo retrieves balances for all enabled currencies for the ItBit exchange - to-do
func (*ItBit) GetFundingHistory ¶
GetFundingHistory returns all funding history for a specified wallet.
func (*ItBit) GetOrderbook ¶
func (i *ItBit) GetOrderbook(currencyPair string) (OrderbookResponse, error)
GetOrderbook returns full order book for the specified market. currencyPair - example "XBTUSD" "XBTSGD" "XBTEUR"
func (*ItBit) GetOrderbookEx ¶
GetOrderbookEx returns orderbook base on the currency pair
func (*ItBit) GetTicker ¶
GetTicker returns ticker info for a specified market. currencyPair - example "XBTUSD" "XBTSGD" "XBTEUR"
func (*ItBit) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*ItBit) GetTradeHistory ¶
GetTradeHistory returns recent trades for a specified market.
currencyPair - example "XBTUSD" "XBTSGD" "XBTEUR" timestamp - matchNumber, only executions after this will be returned
func (*ItBit) GetWalletBalance ¶
GetWalletBalance returns balance information for a specific currency in a wallet.
func (*ItBit) GetWalletTrades ¶
GetWalletTrades returns all trades for a specified wallet.
func (*ItBit) GetWallets ¶
GetWallets returns information about all wallets associated with the account.
params --
page - [optional] page to return example 1. default 1 perPage - [optional] items per page example 50, default 50 max 50
func (*ItBit) PlaceOrder ¶
func (i *ItBit) PlaceOrder(walletID, side, orderType, currency string, amount, price float64, instrument, clientRef string) (Order, error)
PlaceOrder places a new order
func (*ItBit) SendAuthenticatedHTTPRequest ¶
func (i *ItBit) SendAuthenticatedHTTPRequest(method string, path string, params map[string]interface{}, result interface{}) error
SendAuthenticatedHTTPRequest sends an authenticated request to itBit
func (*ItBit) SetDefaults ¶
func (i *ItBit) SetDefaults()
SetDefaults sets the defaults for the exchange
func (*ItBit) Setup ¶
func (i *ItBit) Setup(exch config.ExchangeConfig)
Setup sets the exchange parameters from exchange config
func (*ItBit) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*ItBit) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*ItBit) WalletTransfer ¶
func (i *ItBit) WalletTransfer(walletID, sourceWallet, destWallet string, amount float64, currency string) (WalletTransfer, error)
WalletTransfer transfers funds between wallets.
type Order ¶
type Order struct { ID string `json:"id"` WalletID string `json:"walletId"` Side string `json:"side"` Instrument string `json:"instrument"` Type string `json:"type"` Currency string `json:"currency"` Amount float64 `json:"amount,string"` Price float64 `json:"price,string"` AmountFilled float64 `json:"amountFilled,string"` VolumeWeightedAveragePrice float64 `json:"volumeWeightedAveragePrice,string"` CreatedTime string `json:"createdTime"` Status string `json:"Status"` Metadata interface{} `json:"metadata"` ClientOrderIdentifier string `json:"clientOrderIdentifier"` }
Order holds order information
type OrderbookResponse ¶
OrderbookResponse contains multi-arrayed strings of bid and ask side information
type Records ¶
type Records struct { TotalNumberOfRecords int `json:"totalNumberOfRecords,string"` CurrentPageNumber int `json:"currentPageNumber,string"` LatestExecutedID int64 `json:"latestExecutionId,string"` RecordsPerPage int `json:"recordsPerPage,string"` TradingHistory []TradeHistory `json:"tradingHistory"` }
Records embodies records of trade history information
type Ticker ¶
type Ticker struct { Pair string `json:"pair"` Bid float64 `json:"bid,string"` BidAmt float64 `json:"bidAmt,string"` Ask float64 `json:"ask,string"` AskAmt float64 `json:"askAmt,string"` LastPrice float64 `json:"lastPrice,string"` LastAmt float64 `json:"lastAmt,string"` Volume24h float64 `json:"volume24h,string"` VolumeToday float64 `json:"volumeToday,string"` High24h float64 `json:"high24h,string"` Low24h float64 `json:"low24h,string"` HighToday float64 `json:"highToday,string"` LowToday float64 `json:"lowToday,string"` OpenToday float64 `json:"openToday,string"` VwapToday float64 `json:"vwapToday,string"` Vwap24h float64 `json:"vwap24h,string"` ServertimeUTC string `json:"serverTimeUTC"` }
Ticker holds returned ticker information
type TradeHistory ¶
type TradeHistory struct { OrderID string `json:"orderId"` Timestamp string `json:"timestamp"` Instrument string `json:"instrument"` Direction string `json:"direction"` CurrencyOne string `json:"currency1"` CurrencyOneAmount float64 `json:"currency1Amount,string"` CurrencyTwo string `json:"currency2"` CurrencyTwoAmount float64 `json:"currency2Amount"` Rate float64 `json:"rate,string"` CommissionPaid float64 `json:"commissionPaid,string"` CommissionCurrency string `json:"commissionCurrency"` RebatesApplied float64 `json:"rebatesApplied,string"` RebateCurrency string `json:"rebateCurrency"` }
TradeHistory stores historic trade values
type Trades ¶
type Trades struct { RecentTrades []struct { Timestamp string `json:"timestamp"` MatchNumber int64 `json:"matchNumber"` Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` } `json:"recentTrades"` }
Trades holds recent trades with associated information