Documentation ¶
Index ¶
- func TrimLowerString(original string) string
- func TrimUpperString(original string) string
- type ErrorResponse
- type Exchange
- func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) error
- func (e *Exchange) Name() types.ExchangeName
- func (e *Exchange) NewStream() types.Stream
- func (e *Exchange) PlatformFeeCurrency() string
- func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error)
- func (e *Exchange) QueryAccountBalances(ctx context.Context) (types.BalanceMap, error)
- func (e *Exchange) QueryClosedOrders(ctx context.Context, symbol string, since, until time.Time, lastOrderID uint64) (orders []types.Order, err error)
- func (e *Exchange) QueryDepositHistory(ctx context.Context, asset string, since, until time.Time) (allDeposits []types.Deposit, err error)
- func (e *Exchange) QueryKLines(ctx context.Context, symbol string, interval types.Interval, ...) ([]types.KLine, error)
- func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error)
- func (e *Exchange) QueryOpenOrders(ctx context.Context, symbol string) (orders []types.Order, err error)
- func (e *Exchange) QueryTicker(ctx context.Context, symbol string) (*types.Ticker, error)
- func (e *Exchange) QueryTickers(ctx context.Context, symbol ...string) (map[string]types.Ticker, error)
- func (e *Exchange) QueryTrades(ctx context.Context, symbol string, options *types.TradeQueryOptions) ([]types.Trade, error)
- func (e *Exchange) QueryWithdrawHistory(ctx context.Context, asset string, since, until time.Time) (allWithdraws []types.Withdraw, err error)
- func (e *Exchange) SubmitOrders(ctx context.Context, orders ...types.SubmitOrder) (types.OrderSlice, error)
- type PlaceOrderPayload
- type Stream
- type SubscribeRequest
- type WebsocketService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrimLowerString ¶ added in v1.14.0
func TrimUpperString ¶ added in v1.14.0
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { *util.Response IsSuccess bool `json:"Success"` ErrorString string `json:"error,omitempty"` }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
func NewExchange ¶
func (*Exchange) CancelOrders ¶
func (*Exchange) Name ¶
func (e *Exchange) Name() types.ExchangeName
func (*Exchange) PlatformFeeCurrency ¶
func (*Exchange) QueryAccount ¶
func (*Exchange) QueryAccountBalances ¶
func (*Exchange) QueryClosedOrders ¶
func (e *Exchange) QueryClosedOrders(ctx context.Context, symbol string, since, until time.Time, lastOrderID uint64) (orders []types.Order, err error)
symbol, since and until are all optional. FTX can only query by order created time, not updated time. FTX doesn't support lastOrderID, so we will query by the time range first, and filter by the lastOrderID.
func (*Exchange) QueryDepositHistory ¶
func (*Exchange) QueryKLines ¶
func (*Exchange) QueryMarkets ¶
func (*Exchange) QueryOpenOrders ¶
func (*Exchange) QueryTicker ¶ added in v1.13.0
func (*Exchange) QueryTickers ¶ added in v1.13.0
func (*Exchange) QueryTrades ¶
func (*Exchange) QueryWithdrawHistory ¶
func (*Exchange) SubmitOrders ¶
func (e *Exchange) SubmitOrders(ctx context.Context, orders ...types.SubmitOrder) (types.OrderSlice, error)
type PlaceOrderPayload ¶ added in v1.14.0
type PlaceOrderPayload struct { Market string Side string Price float64 Type string Size float64 ReduceOnly bool IOC bool PostOnly bool ClientID string }
{ "market": "XRP-PERP", "side": "sell", "price": 0.306525, "type": "limit", "size": 31431.0, "reduceOnly": false, "ioc": false, "postOnly": false, "clientId": null }
type Stream ¶ added in v1.13.0
type Stream struct { *types.StandardStream // contains filtered or unexported fields }
func (*Stream) SetPublicOnly ¶ added in v1.13.0
func (s *Stream) SetPublicOnly()
type SubscribeRequest ¶ added in v1.13.0
type SubscribeRequest struct { Operation operation `json:"op"` Channel channel `json:"channel"` Market string `json:"market"` }
{'op': 'subscribe', 'channel': 'trades', 'market': 'BTC-PERP'}
type WebsocketService ¶ added in v1.13.0
type WebsocketService struct { *service.WebsocketClientBase // contains filtered or unexported fields }
func NewWebsocketService ¶ added in v1.13.0
func NewWebsocketService(key string, secret string) *WebsocketService
func (*WebsocketService) Close ¶ added in v1.13.0
func (w *WebsocketService) Close() error
Click to show internal directories.
Click to hide internal directories.