Documentation ¶
Index ¶
- func GetBaseURL() string
- func GetExchangeList() []string
- func SetBaseURL(baseURL string) error
- type Ccxt
- func (c *Ccxt) CancelOrder(orderID string, tradingPair string) (*CcxtOpenOrder, error)
- func (c *Ccxt) CreateLimitOrder(tradingPair string, side string, amount float64, price float64, ...) (*CcxtOpenOrder, error)
- func (c *Ccxt) FetchBalance() (map[string]CcxtBalance, error)
- func (c *Ccxt) FetchMyTrades(tradingPair string, limit int, maybeCursorStart interface{}) ([]CcxtTrade, error)
- func (c *Ccxt) FetchOpenOrders(tradingPairs []string) (map[string][]CcxtOpenOrder, error)
- func (c *Ccxt) FetchOrderBook(tradingPair string, limit *int) (map[string][]CcxtOrder, error)
- func (c *Ccxt) FetchTicker(tradingPair string) (map[string]interface{}, error)
- func (c *Ccxt) FetchTrades(tradingPair string) ([]CcxtTrade, error)
- func (c *Ccxt) GetMarket(tradingPair string) *CcxtMarket
- func (c *Ccxt) GetMarkets() map[string]CcxtMarket
- type CcxtBalance
- type CcxtMarket
- type CcxtOpenOrder
- type CcxtOrder
- type CcxtTrade
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExchangeList ¶ added in v1.6.0
func GetExchangeList() []string
GetExchangeList gets a list of all supported exchanges
func SetBaseURL ¶ added in v1.7.0
SetBaseURL allows setting the base URL for ccxt
Types ¶
type Ccxt ¶
type Ccxt struct {
// contains filtered or unexported fields
}
Ccxt Rest SDK (https://github.com/franz-see/ccxt-rest, https://github.com/ccxt/ccxt/)
func MakeInitializedCcxtExchange ¶
func MakeInitializedCcxtExchange(exchangeName string, apiKey api.ExchangeAPIKey, params []api.ExchangeParam, headers []api.ExchangeHeader) (*Ccxt, error)
MakeInitializedCcxtExchange constructs an instance of Ccxt that is bound to a specific exchange instance on the CCXT REST server
func (*Ccxt) CancelOrder ¶ added in v1.3.0
func (c *Ccxt) CancelOrder(orderID string, tradingPair string) (*CcxtOpenOrder, error)
CancelOrder calls the /cancelOrder endpoint on CCXT with the orderID and tradingPair
func (*Ccxt) CreateLimitOrder ¶ added in v1.3.0
func (c *Ccxt) CreateLimitOrder(tradingPair string, side string, amount float64, price float64, maybeExchangeSpecificParams interface{}) (*CcxtOpenOrder, error)
CreateLimitOrder calls the /createOrder endpoint on CCXT with a limit price and the order type set to "limit"
func (*Ccxt) FetchBalance ¶ added in v1.3.0
func (c *Ccxt) FetchBalance() (map[string]CcxtBalance, error)
FetchBalance calls the /fetchBalance endpoint on CCXT
func (*Ccxt) FetchMyTrades ¶ added in v1.3.0
func (c *Ccxt) FetchMyTrades(tradingPair string, limit int, maybeCursorStart interface{}) ([]CcxtTrade, error)
FetchMyTrades calls the /fetchMyTrades endpoint on CCXT, trading pair is the CCXT version of the trading pair
func (*Ccxt) FetchOpenOrders ¶ added in v1.3.0
func (c *Ccxt) FetchOpenOrders(tradingPairs []string) (map[string][]CcxtOpenOrder, error)
FetchOpenOrders calls the /fetchOpenOrders endpoint on CCXT
func (*Ccxt) FetchOrderBook ¶
FetchOrderBook calls the /fetchOrderBook endpoint on CCXT, trading pair is the CCXT version of the trading pair
func (*Ccxt) FetchTicker ¶
FetchTicker calls the /fetchTicker endpoint on CCXT, trading pair is the CCXT version of the trading pair
func (*Ccxt) FetchTrades ¶
FetchTrades calls the /fetchTrades endpoint on CCXT, trading pair is the CCXT version of the trading pair TODO take in since and limit values to match CCXT's API
func (*Ccxt) GetMarket ¶ added in v1.5.0
func (c *Ccxt) GetMarket(tradingPair string) *CcxtMarket
GetMarket returns the CcxtMarket instance
func (*Ccxt) GetMarkets ¶ added in v1.8.0
func (c *Ccxt) GetMarkets() map[string]CcxtMarket
GetMarkets returns all the markets
type CcxtBalance ¶ added in v1.3.0
CcxtBalance represents the balance for an asset
type CcxtMarket ¶ added in v1.5.0
type CcxtMarket struct { // only contains currently needed data Symbol string `json:"symbol"` Base string `json:"base"` Quote string `json:"quote"` Limits struct { Amount struct { Min float64 `json:"min"` } `json:"amount"` Price struct { Min float64 `json:"min"` } `json:"price"` Cost struct { Min float64 `json:"min"` } `json:"cost"` } `json:"limits"` Precision struct { Amount int8 `json:"amount"` Price int8 `json:"price"` } `json:"precision"` }
CcxtMarket represents the result of a LoadMarkets call
type CcxtOpenOrder ¶ added in v1.3.0
type CcxtOpenOrder struct { Amount float64 Cost float64 Filled float64 ID string Price float64 Side string Status string Symbol string Type string Timestamp int64 }
CcxtOpenOrder represents an open order
type CcxtTrade ¶
type CcxtTrade struct { Amount float64 `json:"amount"` Cost float64 `json:"cost"` Datetime string `json:"datetime"` ID string `json:"id"` // tradeID Info interface{} `json:"info"` // raw trade response gotten from the exchange site's API Price float64 `json:"price"` Side string `json:"side"` Symbol string `json:"symbol"` Timestamp int64 `json:"timestamp"` Fee struct { Cost float64 `json:"cost"` Currency string `json:"currency"` } `json:"fee"` }
CcxtTrade represents a trade