Documentation ¶
Index ¶
- type ANX
- func (a *ANX) CancelAllExchangeOrders(p pair.CurrencyPair) error
- func (a *ANX) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error)
- func (a *ANX) CreateNewSubAccount(currency, name string) (string, error)
- func (a *ANX) GetAPIKey(username, password, otp, deviceID string) (string, string, error)
- func (a *ANX) GetCurrencies() (CurrenciesStore, error)
- func (a *ANX) GetDataToken() (string, error)
- func (a *ANX) GetDepositAddress(currency, name string, new bool) (string, error)
- func (a *ANX) GetDepth(currency string) (Depth, error)
- func (a *ANX) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (a *ANX) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
- func (a *ANX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (a *ANX) GetExchangeOrderInfo(orderID int64) (float64, error)
- func (a *ANX) GetFee(maker bool) float64
- func (a *ANX) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (a *ANX) GetTicker(currency string) (Ticker, error)
- func (a *ANX) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (a *ANX) GetTradablePairs() ([]string, error)
- func (a *ANX) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error)
- func (a *ANX) NewOrder(orderType string, buy bool, ...) error
- func (a *ANX) OrderInfo(orderID string) (OrderResponse, error)
- func (a *ANX) Run()
- func (a *ANX) Send(currency, address, otp, amount string) (string, error)
- func (a *ANX) SendAuthenticatedHTTPRequest(path string, params map[string]interface{}, result interface{}) error
- func (a *ANX) SendHTTPRequest(path string, result interface{}) error
- func (a *ANX) SetDefaults()
- func (a *ANX) Setup(exch config.ExchangeConfig)
- func (a *ANX) Start(wg *sync.WaitGroup)
- func (a *ANX) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
- func (a *ANX) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (a *ANX) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (a *ANX) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
- type Currencies
- type CurrenciesStaticResponse
- type CurrenciesStore
- type Currency
- type CurrencyPair
- type CurrencyPairs
- type Depth
- type DepthItem
- type Order
- type OrderResponse
- type Ticker
- type TickerComponent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ANX ¶
type ANX struct {
exchange.Base
}
ANX is the overarching type across the alphapoint package
func (*ANX) CancelAllExchangeOrders ¶
func (a *ANX) CancelAllExchangeOrders(p pair.CurrencyPair) error
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*ANX) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*ANX) CreateNewSubAccount ¶
CreateNewSubAccount generates a new sub account
func (*ANX) GetCurrencies ¶
func (a *ANX) GetCurrencies() (CurrenciesStore, error)
GetCurrencies returns a list of supported currencies (both fiat and cryptocurrencies)
func (*ANX) GetDataToken ¶
GetDataToken returns token data
func (*ANX) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specific currency
func (*ANX) GetExchangeAccountInfo ¶
GetExchangeAccountInfo : Retrieves balances for all enabled currencies for the ANX exchange
func (*ANX) GetExchangeDepositAddress ¶
func (a *ANX) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*ANX) GetExchangeHistory ¶
func (a *ANX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*ANX) GetExchangeOrderInfo ¶
GetExchangeOrderInfo returns information on a current open order
func (*ANX) GetOrderbookEx ¶
GetOrderbookEx returns the orderbook for a currency pair
func (*ANX) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*ANX) GetTradablePairs ¶
GetTradablePairs returns a list of available
func (*ANX) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*ANX) NewOrder ¶
func (a *ANX) NewOrder(orderType string, buy bool, tradedCurrency, tradedCurrencyAmount, settlementCurrency, settlementCurrencyAmount, limitPriceSettlement string, replace bool, replaceUUID string, replaceIfActive bool) error
NewOrder sends a new order request to the exchange.
func (*ANX) OrderInfo ¶
func (a *ANX) OrderInfo(orderID string) (OrderResponse, error)
OrderInfo returns information about a specific order
func (*ANX) SendAuthenticatedHTTPRequest ¶
func (a *ANX) SendAuthenticatedHTTPRequest(path string, params map[string]interface{}, result interface{}) error
SendAuthenticatedHTTPRequest sends a authenticated HTTP request
func (*ANX) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
func (*ANX) Setup ¶
func (a *ANX) Setup(exch config.ExchangeConfig)
Setup is run on startup to setup exchange with config values
func (*ANX) SubmitExchangeOrder ¶
func (a *ANX) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
SubmitExchangeOrder submits a new order
func (*ANX) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*ANX) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*ANX) WithdrawExchangeFunds ¶
func (a *ANX) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
type CurrenciesStaticResponse ¶
type CurrenciesStaticResponse struct {
CurrenciesResponse CurrenciesStore `json:"CurrencyStatic"`
}
CurrenciesStaticResponse stores the currencyStatic response
type CurrenciesStore ¶
type CurrenciesStore struct { Currencies Currencies `json:"currencies"` CurrencyPairs CurrencyPairs `json:"currencyPairs"` Timestamp string `json:"timestamp"` ResultCode string `json:"resultCode"` }
CurrenciesStore stores the available cryptocurrencies and fiat currencies
type Currency ¶
type Currency struct { Decimals int `json:"decimals"` MinOrderSize float64 `json:"minOrderSize"` MaxOrderSize float64 `json:"maxOrderSize"` DisplayDenominator float64 `json:"displayDenominator"` SummaryDecimals int `json:"summaryDecimals"` DisplayUnit string `json:"displayUnit"` Symbol string `json:"symbol"` Type string `json:"type"` ConfirmationThresholds []struct { ConfosRequired int `json:"confosRequired"` } `json:"confirmationThresholds"` NetworkFee float64 `json:"networkFee"` EngineSettings struct { DepositsEnabled bool `json:"depositsEnabled"` WithdrawalsEnabled bool `json:"withdrawalsEnabled"` DisplayEnabled bool `json:"displayEnabled"` MobileAccessEnabled bool `json:"mobileAccessEnabled"` } `json:"engineSettings"` MinOrderValue float64 `json:"minOrderValue"` MaxOrderValue float64 `json:"maxOrderValue"` MaxMarketOrderValue float64 `json:"maxMarketOrderValue"` MaxMarketOrderSize float64 `json:"maxMarketOrderSize"` DigitalCurrencyType string `json:"digitalCurrencyType"` AssetName string `json:"assetName"` AssetDivisibility int `json:"assetDivisibility"` AssetIcon string `json:"assetIcon"` AssetIssueQuantity string `json:"assetIssueQuantity"` }
Currency holds the currency information
type CurrencyPair ¶
type CurrencyPair struct { PriceDecimals int `json:"priceDecimals"` EngineSettings struct { TradingEnabled bool `json:"tradingEnabled"` DisplayEnabled bool `json:"displayEnabled"` CancelOnly bool `json:"cancelOnly"` VerifyRequired bool `json:"verifyRequired"` RestrictedBuy bool `json:"restrictedBuy"` RestrictedSell bool `json:"restrictedSell"` } `json:"engineSettings"` MinOrderRate float64 `json:"minOrderRate"` MaxOrderRate float64 `json:"maxOrderRate"` DisplayPriceDecimals int `json:"displayPriceDecimals"` TradedCcy string `json:"tradedCcy"` SettlementCcy string `json:"settlementCcy"` PreferredMarket string `json:"preferredMarket"` ChartEnabled bool `json:"chartEnabled"` SimpleTradeEnabled bool `json:"simpleTradeEnabled"` }
CurrencyPair holds the currency information
type CurrencyPairs ¶
type CurrencyPairs map[string]CurrencyPair
CurrencyPairs stores currency pair info
type Depth ¶
type Depth struct { Result string `json:"result"` Data struct { Now string `json:"now"` DataUpdateTime string `json:"dataUpdateTime"` Asks []DepthItem `json:"asks"` Bids []DepthItem `json:"bids"` } `json:"data"` }
Depth contains full depth information
type DepthItem ¶
type DepthItem struct { Price float64 `json:"price,string"` PriceInt float64 `json:"price_int,string"` Amount float64 `json:"amount,string"` AmountInt int64 `json:"amount_int,string"` }
DepthItem contains depth information
type Order ¶
type Order struct { OrderType string `json:"orderType"` BuyTradedCurrency bool `json:"buyTradedCurrency"` TradedCurrency string `json:"tradedCurrency"` SettlementCurrency string `json:"settlementCurrency"` TradedCurrencyAmount string `json:"tradedCurrencyAmount"` SettlementCurrencyAmount string `json:"settlementCurrencyAmount"` LimitPriceInSettlementCurrency string `json:"limitPriceInSettlementCurrency"` ReplaceExistingOrderUUID string `json:"replaceExistingOrderUuid"` ReplaceOnlyIfActive bool `json:"replaceOnlyIfActive"` }
Order holds order information
type OrderResponse ¶
type OrderResponse struct { BuyTradedCurrency bool `json:"buyTradedCurrency"` ExecutedAverageRate string `json:"executedAverageRate"` LimitPriceInSettlementCurrency string `json:"limitPriceInSettlementCurrency"` OrderID string `json:"orderId"` OrderStatus string `json:"orderStatus"` OrderType string `json:"orderType"` ReplaceExistingOrderUUID string `json:"replaceExistingOrderId"` SettlementCurrency string `json:"settlementCurrency"` SettlementCurrencyAmount string `json:"settlementCurrencyAmount"` SettlementCurrencyOutstanding string `json:"settlementCurrencyOutstanding"` Timestamp int64 `json:"timestamp"` TradedCurrency string `json:"tradedCurrency"` TradedCurrencyAmount string `json:"tradedCurrencyAmount"` TradedCurrencyOutstanding string `json:"tradedCurrencyOutstanding"` }
OrderResponse holds order response data
type Ticker ¶
type Ticker struct { Result string `json:"result"` Data struct { High TickerComponent `json:"high"` Low TickerComponent `json:"low"` Avg TickerComponent `json:"avg"` Vwap TickerComponent `json:"vwap"` Vol TickerComponent `json:"vol"` Last TickerComponent `json:"last"` Buy TickerComponent `json:"buy"` Sell TickerComponent `json:"sell"` Now string `json:"now"` UpdateTime string `json:"dataUpdateTime"` } `json:"data"` }
Ticker contains ticker data