dexalot

package
v0.0.0-...-8fb26ab Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 ConvertFromAPIAsset(asset string) instr.Asset

func ConvertFromAPIOrderStatus

func ConvertFromAPIOrderStatus(status OrderStatus) (ordstatus.OrderStatus, error)

func ConvertFromAPIOrderType

func ConvertFromAPIOrderType(orderType OrderType) (ordtypes.OrderType, error)

func ConvertFromAPITimeInForce

func ConvertFromAPITimeInForce(timeInForce TimeInForce) (tif.TimeInForce, error)

func ConvertSideToAPI

func ConvertSideToAPI(s side.OrderSide) int64

func ConvertSpotToAPIInstrument

func ConvertSpotToAPIInstrument(instrument instr.Spot) (string, error)

func ConvertToAPIAsset

func ConvertToAPIAsset(asset instr.Asset) (string, error)

func ConvertToSide

func ConvertToSide(s uint8) (side.OrderSide, error)

func ConvertToSpot

func ConvertToSpot(name string) (instr.Spot, error)

func CreateSpotHash

func CreateSpotHash(instrument instr.Spot) (common.Hash, error)

func GetPairConfigs

func GetPairConfigs(apiKey string, env Network) (map[instr.Spot]PairConfig, error)

func GetTokenConfig

func GetTokenConfig(apiKey string, env Network) (map[instr.Asset]TokenConfig, error)

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 Contract

type Contract string

type ContractData

type ContractData struct {
	Address common.Address
	ABI     abi.ABI
}

type Method

type Method string

type Network

type Network int

type OrderStatus

type OrderStatus int

type OrderType

type OrderType int

func ConvertToAPIOrderType

func ConvertToAPIOrderType(orderType ordtypes.OrderType) (OrderType, error)

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)

type TokenConfig

type TokenConfig struct {
	Env         string `json:"env"`
	Symbol      string `json:"symbol"`
	Name        string `json:"name"`
	IsNative    bool   `json:"isnative"`
	Address     string `json:"address"`
	EVMDecimals int    `json:"evmdecimals"`
	Status      string `json:"status"`
	AuctionMode int    `json:"auctionmode"`
}

Jump to

Keyboard shortcuts

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