Documentation ¶
Index ¶
- Constants
- Variables
- type ANX
- func (a *ANX) AuthenticateWebsocket() error
- func (a *ANX) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error)
- func (a *ANX) CancelOrder(order *exchange.OrderCancellation) error
- func (a *ANX) CancelOrderByIDs(orderIds []string) (OrderCancelResponse, error)
- func (a *ANX) CheckAPIWithdrawPermission() (bool, error)
- func (a *ANX) CreateNewSubAccount(currency, name string) (string, error)
- func (a *ANX) GetAPIKey(username, password, otp, deviceID string) (apiKey, apiSecret string, err error)
- func (a *ANX) GetAccountInfo() (exchange.AccountInfo, error)
- func (a *ANX) GetAccountInformation() (AccountInformation, error)
- func (a *ANX) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
- func (a *ANX) GetCurrencies() (CurrenciesStore, error)
- func (a *ANX) GetDataToken() (string, error)
- func (a *ANX) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, error)
- func (a *ANX) GetDepositAddressByCurrency(currency, name string, newAddr bool) (string, error)
- func (a *ANX) GetDepth(currency string) (Depth, error)
- func (a *ANX) GetExchangeHistory(p currency.Pair, assetType string) ([]exchange.TradeHistory, error)
- func (a *ANX) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (a *ANX) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (a *ANX) GetFundingHistory() ([]exchange.FundHistory, error)
- func (a *ANX) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
- func (a *ANX) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
- func (a *ANX) GetOrderList(isActiveOrdersOnly bool) ([]OrderResponse, error)
- func (a *ANX) GetOrderbookEx(p currency.Pair, assetType string) (orderbook.Base, error)
- func (a *ANX) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)
- func (a *ANX) GetTicker(currency string) (Ticker, error)
- func (a *ANX) GetTickerPrice(p currency.Pair, assetType string) (ticker.Price, error)
- func (a *ANX) GetTradablePairs() ([]string, error)
- func (a *ANX) GetWebsocket() (*wshandler.Websocket, error)
- func (a *ANX) ModifyOrder(action *exchange.ModifyOrder) (string, error)
- func (a *ANX) NewOrder(orderType string, buy bool, tradedCurrency string, ...) (string, 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) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, ...) (exchange.SubmitOrderResponse, error)
- func (a *ANX) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
- func (a *ANX) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
- func (a *ANX) UpdateOrderbook(p currency.Pair, assetType string) (orderbook.Base, error)
- func (a *ANX) UpdateTicker(p currency.Pair, assetType string) (ticker.Price, error)
- func (a *ANX) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (a *ANX) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (a *ANX) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)
- type AccountInformation
- type Amount
- type Currencies
- type CurrenciesStaticResponse
- type CurrenciesStore
- type CurrencyData
- type CurrencyPairData
- type CurrencyPairs
- type Depth
- type DepthItem
- type Order
- type OrderCancelResponse
- type OrderCancellationResponse
- type OrderResponse
- type Ticker
- type TickerComponent
Constants ¶
const ( CancelOrderNotFound string = "ORDER_NOT_FOUND" CancelRequestSubmitted string = "CANCEL_REQUEST_SUBMITTED" CancelOrderWrongState string = "ORDER_CANCEL_WRONG_STATE" )
List of strings
Variables ¶
var WithdrawalFees = map[currency.Code]float64{ currency.BTC: 0.002, currency.DOGE: 0.1, currency.ETH: 0.005, currency.GNT: 0.001, currency.LTC: 0.02, currency.OAX: 0.001, currency.XRP: 1, currency.HKD: 0.01, }
WithdrawalFees the large list of predefined withdrawal fees Prone to change
Functions ¶
This section is empty.
Types ¶
type ANX ¶
ANX is the overarching type across the alphapoint package
func (*ANX) AuthenticateWebsocket ¶
AuthenticateWebsocket sends an authentication message to the websocket
func (*ANX) CancelAllOrders ¶
func (a *ANX) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*ANX) CancelOrder ¶
func (a *ANX) CancelOrder(order *exchange.OrderCancellation) error
CancelOrder cancels an order by its corresponding ID number
func (*ANX) CancelOrderByIDs ¶
func (a *ANX) CancelOrderByIDs(orderIds []string) (OrderCancelResponse, error)
CancelOrderByIDs cancels orders, requires already knowing order IDs There is no existing API call to retrieve orderIds
func (*ANX) CheckAPIWithdrawPermission ¶
CheckAPIWithdrawPermission checks if the API key is allowed to withdraw
func (*ANX) CreateNewSubAccount ¶
CreateNewSubAccount generates a new sub account
func (*ANX) GetAPIKey ¶
func (a *ANX) GetAPIKey(username, password, otp, deviceID string) (apiKey, apiSecret string, err error)
GetAPIKey returns a new generated API key set.
func (*ANX) GetAccountInfo ¶
func (a *ANX) GetAccountInfo() (exchange.AccountInfo, error)
GetAccountInfo retrieves balances for all enabled currencies on the exchange
func (*ANX) GetAccountInformation ¶
func (a *ANX) GetAccountInformation() (AccountInformation, error)
GetAccountInformation retrieves details including API permissions
func (*ANX) GetActiveOrders ¶
func (a *ANX) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
GetActiveOrders retrieves any orders that are active/open
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 specified currency
func (*ANX) GetDepositAddressByCurrency ¶
GetDepositAddressByCurrency returns a deposit address for a specific currency
func (*ANX) GetExchangeHistory ¶
func (a *ANX) GetExchangeHistory(p currency.Pair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*ANX) GetFee ¶
func (a *ANX) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*ANX) GetFeeByType ¶
func (a *ANX) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*ANX) GetFundingHistory ¶
func (a *ANX) GetFundingHistory() ([]exchange.FundHistory, error)
GetFundingHistory returns funding history, deposits and withdrawals
func (*ANX) GetOrderHistory ¶
func (a *ANX) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*ANX) GetOrderInfo ¶
func (a *ANX) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
GetOrderInfo returns information on a current open order
func (*ANX) GetOrderList ¶
func (a *ANX) GetOrderList(isActiveOrdersOnly bool) ([]OrderResponse, error)
GetOrderList retrieves orders from the exchange
func (*ANX) GetOrderbookEx ¶
GetOrderbookEx returns the orderbook for a currency pair
func (*ANX) GetSubscriptions ¶
func (a *ANX) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)
GetSubscriptions returns a copied list of subscriptions
func (*ANX) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*ANX) GetTradablePairs ¶
GetTradablePairs returns a list of available
func (*ANX) GetWebsocket ¶
GetWebsocket returns a pointer to the exchange websocket
func (*ANX) ModifyOrder ¶
func (a *ANX) ModifyOrder(action *exchange.ModifyOrder) (string, error)
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*ANX) NewOrder ¶
func (a *ANX) NewOrder(orderType string, buy bool, tradedCurrency string, tradedCurrencyAmount float64, settlementCurrency string, settlementCurrencyAmount, limitPriceSettlement float64, replace bool, replaceUUID string, replaceIfActive bool) (string, 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) SubmitOrder ¶
func (a *ANX) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, _ string) (exchange.SubmitOrderResponse, error)
SubmitOrder submits a new order
func (*ANX) SubscribeToWebsocketChannels ¶
func (a *ANX) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
SubscribeToWebsocketChannels appends to ChannelsToSubscribe which lets websocket.manageSubscriptions handle subscribing
func (*ANX) UnsubscribeToWebsocketChannels ¶
func (a *ANX) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
UnsubscribeToWebsocketChannels removes from ChannelsToSubscribe which lets websocket.manageSubscriptions handle unsubscribing
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) WithdrawCryptocurrencyFunds ¶
func (a *ANX) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*ANX) WithdrawFiatFunds ¶
func (a *ANX) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*ANX) WithdrawFiatFundsToInternationalBank ¶
func (a *ANX) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
type AccountInformation ¶
type AccountInformation struct { UserUUID string `json:"userUuid"` Rights []string `json:"Rights"` ResultCode string `json:"resultCode"` Wallets map[string]struct { Balance Amount `json:"Balance"` AvailableBalance Amount `json:"Available_Balance"` DailyWithdrawalLimit Amount `json:"Daily_Withdrawal_Limit"` MaxWithdraw Amount `json:"Max_Withdraw"` } `json:"Wallets"` }
AccountInformation Used by Get account information Retrieves details of the account and api's
type Amount ¶
type Amount struct { DisplayShort string `json:"displayShort"` ValueInt int64 `json:"valueInt"` Currency string `json:"currency"` Display string `json:"display"` Value float64 `json:"value"` }
Amount basic storage of wallet details
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 CurrencyData ¶
type CurrencyData 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"` }
CurrencyData holds the currency information
type CurrencyPairData ¶
type CurrencyPairData 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"` }
CurrencyPairData holds the currency information
type CurrencyPairs ¶
type CurrencyPairs map[string]CurrencyPairData
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 float64 `json:"tradedCurrencyAmount,string"` SettlementCurrencyAmount float64 `json:"settlementCurrencyAmount,string"` LimitPriceInSettlementCurrency float64 `json:"limitPriceInSettlementCurrency,string"` ReplaceExistingOrderUUID string `json:"replaceExistingOrderUuid"` ReplaceOnlyIfActive bool `json:"replaceOnlyIfActive"` }
Order holds order information
type OrderCancelResponse ¶
type OrderCancelResponse struct { OrderCancellationResponses []OrderCancellationResponse `json:"orderIds"` ResultCode string `json:"resultCode"` UUID int64 `json:"uuid"` ErrorCode int64 `json:"errorCode"` }
OrderCancelResponse returned when cancelling multiple orders
type OrderCancellationResponse ¶
OrderCancellationResponse contains the orderID and error when cancelling multiple orders
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 float64 `json:"settlementCurrencyAmount,string"` SettlementCurrencyOutstanding string `json:"settlementCurrencyOutstanding"` Timestamp int64 `json:"timestamp"` TradedCurrency string `json:"tradedCurrency"` TradedCurrencyAmount float64 `json:"tradedCurrencyAmount,string"` 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