Documentation ¶
Index ¶
- Constants
- func ConvertFromAPIAsset(asset string) instr.Asset
- func ConvertFromAPIOrderStatus(status OrderStatus) (ordstatus.OrderStatus, error)
- func ConvertFromAPIOrderType(orderType OrderType) (ordtypes.OrderType, error)
- func ConvertFromAPITimeInForce(timeInForce TimeInForce) (tif.TimeInForce, error)
- func ConvertSideToAPI(s side.OrderSide) int64
- func ConvertSpotToAPIInstrument(instrument instr.Spot) (string, error)
- func ConvertToAPIAsset(asset instr.Asset) (string, error)
- func ConvertToSide(s uint8) (side.OrderSide, error)
- func ConvertToSpot(name string) (instr.Spot, error)
- func CreateSpotHash(instrument instr.Spot) (common.Hash, error)
- func GetPairConfigs(apiKey string, env Network) (map[instr.Spot]PairConfig, error)
- func GetTokenConfig(apiKey string, env Network) (map[instr.Asset]TokenConfig, error)
- func PairConfigToReferenceData(config *PairConfig) (*refdata.Composite, error)
- type Contract
- type ContractData
- type Method
- type Network
- type OrderStatus
- type OrderType
- type PairConfig
- type RESTHelper
- type SocketDataType
- type TimeInForce
- type TokenConfig
Constants ¶
View Source
const ( Subscribe = Method("subscribe") ChartSubscribe = Method("chartsubscribe") MarketDataSnapshotSubscribe = Method("marketsnapshotsubscribe") )
View Source
const ( OrderBooks = SocketDataType("orderBooks") LastTrades = SocketDataType("lastTrades") MarketSnapshot = SocketDataType("marketSnapShot") ChartSnapshot = SocketDataType("chartSnapShot") Prices = SocketDataType("prices") AuctionData = SocketDataType("auctionData") )
View Source
const ( New = OrderStatus(iota) Rejected PartiallyFilled Filled Canceled Expired Killed CancelReject )
View Source
const ( Market = iota Limit Stop StopLimit )
View Source
const ( GTC = iota FOK IOC PO )
View Source
const ( MAINNET = Network(iota + 1) TESTNET )
View Source
const ( PortfolioSub = Contract("PortfolioSub") TradePairs = Contract("TradePairs") )
Variables ¶
This section is empty.
Functions ¶
func ConvertFromAPIAsset ¶
func ConvertFromAPIOrderStatus ¶
func ConvertFromAPIOrderStatus(status OrderStatus) (ordstatus.OrderStatus, error)
func ConvertFromAPIOrderType ¶
func ConvertFromAPITimeInForce ¶
func ConvertFromAPITimeInForce(timeInForce TimeInForce) (tif.TimeInForce, error)
func ConvertSideToAPI ¶
func GetPairConfigs ¶
func GetTokenConfig ¶
func PairConfigToReferenceData ¶
func PairConfigToReferenceData(config *PairConfig) (*refdata.Composite, error)
TODO - feel free to extract min quote time, post only, and replenishment rate as configs
Types ¶
type OrderStatus ¶
type OrderStatus int
type PairConfig ¶
type PairConfig struct { Env string `json:"env"` Pair string `json:"pair"` Base string `json:"base"` Quote string `json:"quote"` BaseDisplayDecimals int `json:"basedisplaydecimals"` QuoteDisplayDecimals int `json:"quotedisplaydecimals"` BaseEVMDecimals int `json:"base_evmdecimals"` QuoteEVMDecimals int `json:"quote_evmdecimals"` MinTradeAmount string `json:"mintrade_amnt"` MaxTradeAmount string `json:"maxtrade_amnt"` Status string `json:"status"` }
type RESTHelper ¶
type RESTHelper struct {
// contains filtered or unexported fields
}
TODO - add signing functionality so we can support requesting open orders
func NewRESTHelper ¶
func NewRESTHelper(apiKey string, env Network) *RESTHelper
func (*RESTHelper) GetContractData ¶
func (r *RESTHelper) GetContractData(contract Contract) (*ContractData, error)
type SocketDataType ¶
type SocketDataType string
type TimeInForce ¶
type TimeInForce int
func ConvertToAPITimeInForce ¶
func ConvertToAPITimeInForce(timeInForce tif.TimeInForce) (TimeInForce, error)
Click to show internal directories.
Click to hide internal directories.