Documentation
¶
Index ¶
- type AuthResponse
- type CancelledOrder
- type EXMO
- func (e *EXMO) CancelAllExchangeOrders(p pair.CurrencyPair) error
- func (e *EXMO) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error)
- func (e *EXMO) CancelOrder(orderID int64) error
- func (e *EXMO) CreateOrder(pair, orderType string, price, amount float64) (int64, error)
- func (e *EXMO) ExcodeCreate(currency string, amount float64) (ExcodeCreate, error)
- func (e *EXMO) ExcodeLoad(excode string) (ExcodeLoad, error)
- func (e *EXMO) GetCancelledOrders(offset, limit string) ([]CancelledOrder, error)
- func (e *EXMO) GetCurrency() ([]string, error)
- func (e *EXMO) GetDepositAddress() (map[string]string, error)
- func (e *EXMO) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (e *EXMO) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
- func (e *EXMO) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (e *EXMO) GetExchangeOrderInfo(orderID int64) (float64, error)
- func (e *EXMO) GetOpenOrders() (map[string]OpenOrders, error)
- func (e *EXMO) GetOrderTrades(orderID int64) (OrderTrades, error)
- func (e *EXMO) GetOrderbook(symbol string) (map[string]Orderbook, error)
- func (e *EXMO) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (e *EXMO) GetPairSettings() (map[string]PairSettings, error)
- func (e *EXMO) GetRequiredAmount(pair string, amount float64) (RequiredAmount, error)
- func (e *EXMO) GetTicker(symbol string) (map[string]Ticker, error)
- func (e *EXMO) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (e *EXMO) GetTrades(symbol string) (map[string][]Trades, error)
- func (e *EXMO) GetUserInfo() (UserInfo, error)
- func (e *EXMO) GetUserTrades(pair, offset, limit string) (map[string][]UserTrades, error)
- func (e *EXMO) GetWalletHistory(date int64) (WalletHistory, error)
- func (e *EXMO) GetWithdrawTXID(taskID int64) (string, error)
- func (e *EXMO) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error)
- func (e *EXMO) Run()
- func (e *EXMO) SendAuthenticatedHTTPRequest(method, endpoint string, vals url.Values, result interface{}) error
- func (e *EXMO) SendHTTPRequest(path string, result interface{}) error
- func (e *EXMO) SetDefaults()
- func (e *EXMO) Setup(exch config.ExchangeConfig)
- func (e *EXMO) Start(wg *sync.WaitGroup)
- func (e *EXMO) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
- func (e *EXMO) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (e *EXMO) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (e *EXMO) WithdrawCryptocurrency(currency, address, invoice string, amount float64) (int64, error)
- func (e *EXMO) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
- type ExcodeCreate
- type ExcodeLoad
- type OpenOrders
- type OrderTrades
- type Orderbook
- type PairSettings
- type RequiredAmount
- type Ticker
- type Trades
- type UserInfo
- type UserTrades
- type WalletHistory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
AuthResponse stores the auth response
type CancelledOrder ¶
type CancelledOrder struct {
Date int64 `json:"date"`
OrderID int64 `json:"order_id,string"`
Type string `json:"type"`
Pair string `json:"pair"`
Price float64 `json:"price,string"`
Quantity float64 `json:"quantity,string"`
Amount float64 `json:"amount,string"`
}
CancelledOrder stores cancelled order data
type EXMO ¶
EXMO exchange struct
func (*EXMO) CancelAllExchangeOrders ¶
func (e *EXMO) CancelAllExchangeOrders(p pair.CurrencyPair) error
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*EXMO) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*EXMO) CancelOrder ¶
CancelOrder cancels an order by the orderID
func (*EXMO) CreateOrder ¶
CreateOrder creates an order Params: pair, quantity, price and type Type can be buy, sell, market_buy, market_sell, market_buy_total and market_sell_total
func (*EXMO) ExcodeCreate ¶
func (e *EXMO) ExcodeCreate(currency string, amount float64) (ExcodeCreate, error)
ExcodeCreate creates an EXMO coupon
func (*EXMO) ExcodeLoad ¶
func (e *EXMO) ExcodeLoad(excode string) (ExcodeLoad, error)
ExcodeLoad loads an EXMO coupon
func (*EXMO) GetCancelledOrders ¶
func (e *EXMO) GetCancelledOrders(offset, limit string) ([]CancelledOrder, error)
GetCancelledOrders returns a list of cancelled orders
func (*EXMO) GetCurrency ¶
GetCurrency returns a list of currencies
func (*EXMO) GetDepositAddress ¶
GetDepositAddress returns a list of addresses for cryptocurrency deposits
func (*EXMO) GetExchangeAccountInfo ¶
func (e *EXMO) GetExchangeAccountInfo() (exchange.AccountInfo, error)
GetExchangeAccountInfo retrieves balances for all enabled currencies for the Exmo exchange
func (*EXMO) GetExchangeDepositAddress ¶
func (e *EXMO) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*EXMO) GetExchangeHistory ¶
func (e *EXMO) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*EXMO) GetExchangeOrderInfo ¶
GetExchangeOrderInfo returns information on a current open order
func (*EXMO) GetOpenOrders ¶
func (e *EXMO) GetOpenOrders() (map[string]OpenOrders, error)
GetOpenOrders returns the users open orders
func (*EXMO) GetOrderTrades ¶
func (e *EXMO) GetOrderTrades(orderID int64) (OrderTrades, error)
GetOrderTrades returns a history of order trade details for the specific orderID
func (*EXMO) GetOrderbook ¶
GetOrderbook returns the orderbook for a symbol or symbols
func (*EXMO) GetOrderbookEx ¶
GetOrderbookEx returns the orderbook for a currency pair
func (*EXMO) GetPairSettings ¶
func (e *EXMO) GetPairSettings() (map[string]PairSettings, error)
GetPairSettings returns the pair settings for a symbol or symbols
func (*EXMO) GetRequiredAmount ¶
func (e *EXMO) GetRequiredAmount(pair string, amount float64) (RequiredAmount, error)
GetRequiredAmount calculates the sum of buying a certain amount of currency for the particular currency pair
func (*EXMO) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*EXMO) GetUserInfo ¶
GetUserInfo returns the user info
func (*EXMO) GetUserTrades ¶
func (e *EXMO) GetUserTrades(pair, offset, limit string) (map[string][]UserTrades, error)
GetUserTrades returns the user trades
func (*EXMO) GetWalletHistory ¶
func (e *EXMO) GetWalletHistory(date int64) (WalletHistory, error)
GetWalletHistory returns the users deposit/withdrawal history
func (*EXMO) GetWithdrawTXID ¶
GetWithdrawTXID gets the result of a withdrawal request
func (*EXMO) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*EXMO) SendAuthenticatedHTTPRequest ¶
func (e *EXMO) SendAuthenticatedHTTPRequest(method, endpoint string, vals url.Values, result interface{}) error
SendAuthenticatedHTTPRequest sends an authenticated HTTP request
func (*EXMO) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
func (*EXMO) SetDefaults ¶
func (e *EXMO) SetDefaults()
SetDefaults sets the basic defaults for exmo
func (*EXMO) Setup ¶
func (e *EXMO) Setup(exch config.ExchangeConfig)
Setup takes in the supplied exchange configuration details and sets params
func (*EXMO) SubmitExchangeOrder ¶
func (e *EXMO) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
SubmitExchangeOrder submits a new order
func (*EXMO) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*EXMO) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*EXMO) WithdrawCryptocurrency ¶
func (e *EXMO) WithdrawCryptocurrency(currency, address, invoice string, amount float64) (int64, error)
WithdrawCryptocurrency withdraws a cryptocurrency from the exchange to the desired address NOTE: This API function is available only after request to their tech support team
func (*EXMO) WithdrawExchangeFunds ¶
func (e *EXMO) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
type ExcodeCreate ¶
type ExcodeCreate struct {
TaskID int64 `json:"task_id"`
Code string `json:"code"`
Amount float64 `json:"amount,string"`
Currency string `json:"currency"`
Balances map[string]string `json:"balances"`
}
ExcodeCreate stores the excode create coupon info
type ExcodeLoad ¶
type ExcodeLoad struct {
TaskID int64 `json:"task_id"`
Amount float64 `json:"amount,string"`
Currency string `json:"currency"`
Balances map[string]string `json:"balances"`
}
ExcodeLoad stores the excode load coupon info
type OpenOrders ¶
type OpenOrders struct {
OrderID int64 `json:"order_id,string"`
Created int64 `json:"created,string"`
Type string `json:"type"`
Pair string `json:"pair"`
Price float64 `json:"price,string"`
Quantity float64 `json:"quantity,string"`
Amount float64 `json:"amount,string"`
}
OpenOrders stores the order info
type OrderTrades ¶
type OrderTrades struct {
Type string `json:"type"`
InCurrency string `json:"in_currency"`
InAmount float64 `json:"in_amount,string"`
OutCurrency string `json:"out_currency"`
OutAmount float64 `json:"out_amount,string"`
Trades []UserTrades `json:"trades"`
}
OrderTrades stores order trade information
type Orderbook ¶
type Orderbook struct {
AskQuantity float64 `json:"ask_quantity,string"`
AskAmount float64 `json:"ask_amount,string"`
AskTop float64 `json:"ask_top,string"`
BidQuantity float64 `json:"bid_quantity,string"`
BidTop float64 `json:"bid_top,string"`
Ask [][]string `json:"ask"`
Bid [][]string `json:"bid"`
}
Orderbook holds the orderbook data
type PairSettings ¶
type PairSettings struct {
MinQuantity float64 `json:"min_quantity,string"`
MaxQuantity float64 `json:"max_quantity,string"`
MinPrice float64 `json:"min_price,string"`
MaxPrice float64 `json:"max_price,string"`
MaxAmount float64 `json:"max_amount,string"`
MinAmount float64 `json:"min_amount,string"`
}
PairSettings holds the pair settings
type RequiredAmount ¶
type RequiredAmount struct {
Quantity float64 `json:"quantity,string"`
Amount float64 `json:"amount,string"`
AvgPrice float64 `json:"avg_price,string"`
}
RequiredAmount stores the calculation for buying a certain amount of currency for a particular currency
type Ticker ¶
type Ticker struct {
Buy float64 `json:"buy_price,string"`
Sell float64 `json:"sell_price,string"`
Last float64 `json:"last_trade,string"`
High float64 `json:"high,string"`
Low float64 `json:"low,string"`
Average float64 `json:"average,string"`
Volume float64 `json:"vol,string"`
VolumeCurrent float64 `json:"vol_curr,string"`
Updated int64 `json:"updated"`
}
Ticker holds the ticker data
type Trades ¶
type Trades struct {
TradeID int64 `json:"trade_id"`
Type string `json:"string"`
Quantity float64 `json:"quantity,string"`
Price float64 `json:"price,string"`
Amount float64 `json:"amount,string"`
Date int64 `json:"date"`
}
Trades holds trade data
type UserInfo ¶
type UserInfo struct {
AuthResponse
UID int `json:"uid"`
ServerDate int `json:"server_date"`
Balances map[string]string `json:"balances"`
Reserved map[string]string `json:"reserved"`
}
UserInfo stores the user info
type UserTrades ¶
type UserTrades struct {
TradeID int64 `json:"trade_id"`
Date int64 `json:"date"`
Type string `json:"type"`
Pair string `json:"pair"`
OrderID int64 `json:"order_id"`
Quantity float64 `json:"quantity"`
Price float64 `json:"price"`
Amount float64 `json:"amount"`
}
UserTrades stores the users trade info
type WalletHistory ¶
type WalletHistory struct {
Begin int64 `json:"begin,string"`
End int64 `json:"end,string"`
History []struct {
Timestamp int64 `json:"dt"`
Type string `json:"string"`
Currency string `json:"curr"`
Status string `json:"status"`
Provider string `json:"provider"`
Amount float64 `json:"amount,string"`
Account string `json:"account,string"`
}
}
WalletHistory stores the users wallet history