alphapoint

package
v0.0.0-...-77ca9cc Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALPHAPOINT_DEFAULT_API_URL   = "https://sim3.alphapoint.com:8400"
	ALPHAPOINT_API_VERSION       = "1"
	ALPHAPOINT_TICKER            = "GetTicker"
	ALPHAPOINT_TRADES            = "GetTrades"
	ALPHAPOINT_TRADESBYDATE      = "GetTradesByDate"
	ALPHAPOINT_ORDERBOOK         = "GetOrderBook"
	ALPHAPOINT_PRODUCT_PAIRS     = "GetProductPairs"
	ALPHAPOINT_PRODUCTS          = "GetProducts"
	ALPHAPOINT_CREATE_ACCOUNT    = "CreateAccount"
	ALPHAPOINT_USERINFO          = "GetUserInfo"
	ALPHAPOINT_ACCOUNT_INFO      = "GetAccountInfo"
	ALPHAPOINT_ACCOUNT_TRADES    = "GetAccountTrades"
	ALPHAPOINT_DEPOSIT_ADDRESSES = "GetDepositAddresses"
	ALPHAPOINT_WITHDRAW          = "Withdraw"
	ALPHAPOINT_CREATE_ORDER      = "CreateOrder"
	ALPHAPOINT_MODIFY_ORDER      = "ModifyOrder"
	ALPHAPOINT_CANCEL_ORDER      = "CancelOrder"
	ALPHAPOINT_CANCEALLORDERS    = "CancelAllOrders"
	ALPHAPOINT_OPEN_ORDERS       = "GetAccountOpenOrders"
	ALPHAPOINT_ORDER_FEE         = "GetOrderFee"
)
View Source
const (
	ALPHAPOINT_DEFAULT_WEBSOCKET_URL = "wss://sim3.alphapoint.com:8401/v1/GetTicker/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alphapoint

type Alphapoint struct {
	exchange.ExchangeBase
	WebsocketConn *websocket.Conn
}

func (*Alphapoint) CancelAllOrders

func (a *Alphapoint) CancelAllOrders(symbol string) error

func (*Alphapoint) CancelOrder

func (a *Alphapoint) CancelOrder(symbol string, OrderID int64) (int64, error)

func (*Alphapoint) CreateAccount

func (a *Alphapoint) CreateAccount(firstName, lastName, email, phone, password string) error

func (*Alphapoint) CreateOrder

func (a *Alphapoint) CreateOrder(symbol, side string, orderType int, quantity, price float64) (int64, error)

func (*Alphapoint) GetAccountInfo

func (a *Alphapoint) GetAccountInfo() (AlphapointAccountInfo, error)

func (*Alphapoint) GetAccountTrades

func (a *Alphapoint) GetAccountTrades(symbol string, startIndex, count int) (AlphapointTrades, error)

func (*Alphapoint) GetDepositAddresses

func (a *Alphapoint) GetDepositAddresses() ([]AlphapointDepositAddresses, error)

func (*Alphapoint) GetExchangeAccountInfo

func (e *Alphapoint) GetExchangeAccountInfo() (exchange.ExchangeAccountInfo, error)

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

func (*Alphapoint) GetOrderFee

func (a *Alphapoint) GetOrderFee(symbol, side string, quantity, price float64) (float64, error)

func (*Alphapoint) GetOrderbook

func (a *Alphapoint) GetOrderbook(symbol string) (AlphapointOrderbook, error)

func (*Alphapoint) GetOrderbookEx

func (a *Alphapoint) GetOrderbookEx(p pair.CurrencyPair) (orderbook.OrderbookBase, error)

func (*Alphapoint) GetOrders

func (a *Alphapoint) GetOrders() ([]AlphapointOpenOrders, error)

func (*Alphapoint) GetProductPairs

func (a *Alphapoint) GetProductPairs() (AlphapointProductPairs, error)

func (*Alphapoint) GetProducts

func (a *Alphapoint) GetProducts() (AlphapointProducts, error)

func (*Alphapoint) GetTicker

func (a *Alphapoint) GetTicker(symbol string) (AlphapointTicker, error)

func (*Alphapoint) GetTickerPrice

func (a *Alphapoint) GetTickerPrice(p pair.CurrencyPair) ticker.TickerPrice

func (*Alphapoint) GetTrades

func (a *Alphapoint) GetTrades(symbol string, startIndex, count int) (AlphapointTrades, error)

func (*Alphapoint) GetTradesByDate

func (a *Alphapoint) GetTradesByDate(symbol string, startDate, endDate int64) (AlphapointTradesByDate, error)

func (*Alphapoint) GetUserInfo

func (a *Alphapoint) GetUserInfo() (AlphapointUserInfo, error)

func (*Alphapoint) ModifyOrder

func (a *Alphapoint) ModifyOrder(symbol string, OrderID, action int64) (int64, error)

func (*Alphapoint) SendAuthenticatedHTTPRequest

func (a *Alphapoint) SendAuthenticatedHTTPRequest(method, path string, data map[string]interface{}, result interface{}) error

func (*Alphapoint) SendRequest

func (a *Alphapoint) SendRequest(method, path string, data map[string]interface{}, result interface{}) error

func (*Alphapoint) SetDefaults

func (a *Alphapoint) SetDefaults()

func (*Alphapoint) WebsocketClient

func (a *Alphapoint) WebsocketClient()

func (*Alphapoint) WithdrawCoins

func (a *Alphapoint) WithdrawCoins(symbol, product string, amount float64, address string) error

type AlphapointAccountInfo

type AlphapointAccountInfo struct {
	Currencies []struct {
		Name    string `json:"name"`
		Balance int    `json:"balance"`
		Hold    int    `json:"hold"`
	} `json:"currencies"`
	ProductPairs []struct {
		ProductPairName string `json:"productPairName"`
		ProductPairCode int    `json:"productPairCode"`
		TradeCount      int    `json:"tradeCount"`
		TradeVolume     int    `json:"tradeVolume"`
	} `json:"productPairs"`
	IsAccepted   bool   `json:"isAccepted"`
	RejectReason string `json:"rejectReason"`
}

type AlphapointDepositAddresses

type AlphapointDepositAddresses struct {
	Name           string `json:"name"`
	DepositAddress string `json:"depositAddress"`
}

type AlphapointOpenOrders

type AlphapointOpenOrders struct {
	Instrument string            `json:"ins"`
	Openorders []AlphapointOrder `json:"openOrders"`
}

type AlphapointOrder

type AlphapointOrder struct {
	Serverorderid int   `json:"ServerOrderId"`
	AccountID     int   `json:"AccountId"`
	Price         int   `json:"Price"`
	QtyTotal      int   `json:"QtyTotal"`
	QtyRemaining  int   `json:"QtyRemaining"`
	ReceiveTime   int64 `json:"ReceiveTime"`
	Side          int   `json:"Side"`
}

type AlphapointOrderInfo

type AlphapointOrderInfo struct {
	OpenOrders   []AlphapointOpenOrders `json:"openOrdersInfo"`
	IsAccepted   bool                   `json:"isAccepted"`
	DateTimeUTC  int64                  `json:"dateTimeUtc"`
	RejectReason string                 `json:"rejectReason"`
}

type AlphapointOrderbook

type AlphapointOrderbook struct {
	Bids         []AlphapointOrderbookEntry `json:"bids"`
	Asks         []AlphapointOrderbookEntry `json:"asks"`
	IsAccepted   bool                       `json:"isAccepted"`
	RejectReason string                     `json:"rejectReason"`
}

type AlphapointOrderbookEntry

type AlphapointOrderbookEntry struct {
	Quantity float64 `json:"qty"`
	Price    float64 `json:"px"`
}

type AlphapointProduct

type AlphapointProduct struct {
	Name          string `json:"name"`
	IsDigital     bool   `json:"isDigital"`
	ProductCode   int    `json:"productCode"`
	DecimalPlaces int    `json:"decimalPlaces"`
	FullName      string `json:"fullName"`
}

type AlphapointProductPair

type AlphapointProductPair struct {
	Name                  string `json:"name"`
	Productpaircode       int    `json:"productPairCode"`
	Product1Label         string `json:"product1Label"`
	Product1Decimalplaces int    `json:"product1DecimalPlaces"`
	Product2Label         string `json:"product2Label"`
	Product2Decimalplaces int    `json:"product2DecimalPlaces"`
}

type AlphapointProductPairs

type AlphapointProductPairs struct {
	ProductPairs []AlphapointProductPair `json:"productPairs"`
	IsAccepted   bool                    `json:"isAccepted"`
	RejectReason string                  `json:"rejectReason"`
}

type AlphapointProducts

type AlphapointProducts struct {
	Products     []AlphapointProduct `json:"products"`
	IsAccepted   bool                `json:"isAccepted"`
	RejectReason string              `json:"rejectReason"`
}

type AlphapointTicker

type AlphapointTicker struct {
	High               float64 `json:"high"`
	Last               float64 `json:"last"`
	Bid                float64 `json:"bid"`
	Volume             float64 `json:"volume"`
	Low                float64 `json:"low"`
	Ask                float64 `json:"ask"`
	Total24HrQtyTraded float64 `json:"Total24HrQtyTraded"`
	Total24HrNumTrades float64 `json:"Total24HrNumTrades"`
	SellOrderCount     float64 `json:"sellOrderCount"`
	BuyOrderCount      float64 `json:"buyOrderCount"`
	NumOfCreateOrders  float64 `json:"numOfCreateOrders"`
	IsAccepted         bool    `json:"isAccepted"`
	RejectReason       string  `json:"rejectReason"`
}

type AlphapointTrade

type AlphapointTrade struct {
	TID                   int64   `json:"tid"`
	Price                 float64 `json:"px"`
	Quantity              float64 `json:"qty"`
	Unixtime              int     `json:"unixtime"`
	UTCTicks              int64   `json:"utcticks"`
	IncomingOrderSide     int     `json:"incomingOrderSide"`
	IncomingServerOrderID int     `json:"incomingServerOrderId"`
	BookServerOrderID     int     `json:"bookServerOrderId"`
}

type AlphapointTrades

type AlphapointTrades struct {
	IsAccepted   bool              `json:"isAccepted"`
	RejectReason string            `json:"rejectReason"`
	DateTimeUTC  int64             `json:"dateTimeUtc"`
	Instrument   string            `json:"ins"`
	StartIndex   int               `json:"startIndex"`
	Count        int               `json:"count"`
	Trades       []AlphapointTrade `json:"trades"`
}

type AlphapointTradesByDate

type AlphapointTradesByDate struct {
	IsAccepted   bool              `json:"isAccepted"`
	RejectReason string            `json:"rejectReason"`
	DateTimeUTC  int64             `json:"dateTimeUtc"`
	Instrument   string            `json:"ins"`
	StartDate    int64             `json:"startDate"`
	EndDate      int64             `json:"endDate"`
	Trades       []AlphapointTrade `json:"trades"`
}

type AlphapointUserInfo

type AlphapointUserInfo struct {
	UserInfoKVP []struct {
		Key   string `json:"key"`
		Value string `json:"value"`
	} `json:"userInfoKVP"`
	IsAccepted   bool   `json:"isAccepted"`
	RejectReason string `json:"rejectReason"`
}

type AlphapointWebsocketTicker

type AlphapointWebsocketTicker struct {
	MessageType             string  `json:"messageType"`
	ProductPair             string  `json:"prodPair"`
	High                    float64 `json:"high"`
	Low                     float64 `json:"low"`
	Last                    float64 `json:"last"`
	Volume                  float64 `json:"volume"`
	Volume24Hrs             float64 `json:"volume24hrs"`
	Volume24HrsProduct2     float64 `json:"volume24hrsProduct2"`
	Total24HrQtyTraded      float64 `json:"Total24HrQtyTraded"`
	Total24HrProduct2Traded float64 `json:"Total24HrProduct2Traded"`
	Total24HrNumTrades      float64 `json:"Total24HrNumTrades"`
	Bid                     float64 `json:"bid"`
	Ask                     float64 `json:"ask"`
	BuyOrderCount           int     `json:"buyOrderCount"`
	SellOrderCount          int     `json:"sellOrderCount"`
}

Jump to

Keyboard shortcuts

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