anx

package
v0.0.0-...-cf2d4bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANX_API_URL         = "https://anxpro.com/"
	ANX_API_VERSION     = "3"
	ANX_APIKEY          = "apiKey"
	ANX_DATA_TOKEN      = "dataToken"
	ANX_ORDER_NEW       = "order/new"
	ANX_ORDER_INFO      = "order/info"
	ANX_SEND            = "send"
	ANX_SUBACCOUNT_NEW  = "subaccount/new"
	ANX_RECEIVE_ADDRESS = "receive"
	ANX_CREATE_ADDRESS  = "receive/create"
	ANX_TICKER          = "money/ticker"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ANX

type ANX struct {
	exchange.Base
}

func (*ANX) CreateNewSubAccount

func (a *ANX) CreateNewSubAccount(currency, name string) (string, error)

func (*ANX) GetAPIKey

func (a *ANX) GetAPIKey(username, password, otp, deviceID string) (string, string, error)

func (*ANX) GetDataToken

func (a *ANX) GetDataToken() (string, error)

func (*ANX) GetDepositAddress

func (a *ANX) GetDepositAddress(currency, name string, new bool) (string, error)

func (*ANX) GetExchangeAccountInfo

func (a *ANX) GetExchangeAccountInfo() (exchange.AccountInfo, error)

GetExchangeAccountInfo : Retrieves balances for all enabled currencies for the ANX exchange

func (*ANX) GetFee

func (a *ANX) GetFee(maker bool) float64

func (*ANX) GetOrderbookEx

func (a *ANX) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)

GetOrderbookEx returns the orderbook for a currency pair

func (*ANX) GetTicker

func (a *ANX) GetTicker(currency string) (ANXTicker, error)

func (*ANX) GetTickerPrice

func (a *ANX) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)

GetTickerPrice returns the ticker for a currency pair

func (*ANX) NewOrder

func (a *ANX) NewOrder(orderType string, buy bool, tradedCurrency, tradedCurrencyAmount, settlementCurrency, settlementCurrencyAmount, limitPriceSettlement string,
	replace bool, replaceUUID string, replaceIfActive bool) error

func (*ANX) OrderInfo

func (a *ANX) OrderInfo(orderID string) (ANXOrderResponse, error)

func (*ANX) Run

func (a *ANX) Run()

Run implements the ANX wrapper

func (*ANX) Send

func (a *ANX) Send(currency, address, otp, amount string) (string, error)

func (*ANX) SendAuthenticatedHTTPRequest

func (a *ANX) SendAuthenticatedHTTPRequest(path string, params map[string]interface{}, result interface{}) error

func (*ANX) SetDefaults

func (a *ANX) SetDefaults()

func (*ANX) Setup

func (a *ANX) Setup(exch config.ExchangeConfig)

Setup is run on startup to setup exchange with config values

func (*ANX) Start

func (a *ANX) Start()

Start starts the ANX go routine

func (*ANX) UpdateOrderbook

func (a *ANX) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)

UpdateOrderbook updates and returns the orderbook for a currency pair

func (*ANX) UpdateTicker

func (a *ANX) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)

UpdateTicker updates and returns the ticker for a currency pair

type ANXOrder

type ANXOrder 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"`
}

type ANXOrderResponse

type ANXOrderResponse 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"`
}

type ANXTicker

type ANXTicker struct {
	Result string `json:"result"`
	Data   struct {
		High       ANXTickerComponent `json:"high"`
		Low        ANXTickerComponent `json:"low"`
		Avg        ANXTickerComponent `json:"avg"`
		Vwap       ANXTickerComponent `json:"vwap"`
		Vol        ANXTickerComponent `json:"vol"`
		Last       ANXTickerComponent `json:"last"`
		Buy        ANXTickerComponent `json:"buy"`
		Sell       ANXTickerComponent `json:"sell"`
		Now        string             `json:"now"`
		UpdateTime string             `json:"dataUpdateTime"`
	} `json:"data"`
}

type ANXTickerComponent

type ANXTickerComponent struct {
	Currency     string `json:"currency"`
	Display      string `json:"display"`
	DisplayShort string `json:"display_short"`
	Value        string `json:"value"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL