ftx

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrimLowerString added in v1.14.0

func TrimLowerString(original string) string

func TrimUpperString added in v1.14.0

func TrimUpperString(original string) string

Types

type Candle added in v1.15.3

type Candle struct {
	Close     float64  `json:"close"`
	High      float64  `json:"high"`
	Low       float64  `json:"low"`
	Open      float64  `json:"open"`
	StartTime datetime `json:"startTime"`
	Volume    float64  `json:"volume"`
}

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 NewExchange(key, secret string, subAccount string) *Exchange

func (*Exchange) CancelOrders

func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) error

func (*Exchange) Name

func (e *Exchange) Name() types.ExchangeName

func (*Exchange) NewStream

func (e *Exchange) NewStream() types.Stream

func (*Exchange) PlatformFeeCurrency

func (e *Exchange) PlatformFeeCurrency() string

func (*Exchange) QueryAccount

func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error)

func (*Exchange) QueryAccountBalances

func (e *Exchange) QueryAccountBalances(ctx context.Context) (types.BalanceMap, error)

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 (e *Exchange) QueryDepositHistory(ctx context.Context, asset string, since, until time.Time) (allDeposits []types.Deposit, err error)

func (*Exchange) QueryKLines

func (e *Exchange) QueryKLines(ctx context.Context, symbol string, interval types.Interval, options types.KLineQueryOptions) ([]types.KLine, error)

func (*Exchange) QueryMarkets

func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error)

func (*Exchange) QueryOpenOrders

func (e *Exchange) QueryOpenOrders(ctx context.Context, symbol string) (orders []types.Order, err error)

func (*Exchange) QueryTicker added in v1.13.0

func (e *Exchange) QueryTicker(ctx context.Context, symbol string) (*types.Ticker, error)

func (*Exchange) QueryTickers added in v1.13.0

func (e *Exchange) QueryTickers(ctx context.Context, symbol ...string) (map[string]types.Ticker, error)

func (*Exchange) QueryTrades

func (e *Exchange) QueryTrades(ctx context.Context, symbol string, options *types.TradeQueryOptions) ([]types.Trade, error)

func (*Exchange) SubmitOrders

func (e *Exchange) SubmitOrders(ctx context.Context, orders ...types.SubmitOrder) (types.OrderSlice, error)

type HistoricalPricesResponse added in v1.15.3

type HistoricalPricesResponse struct {
	Success bool     `json:"success"`
	Result  []Candle `json:"result"`
}
{
  "success": true,
  "result": [
    {
      "close": 11055.25,
      "high": 11089.0,
      "low": 11043.5,
      "open": 11059.25,
      "startTime": "2019-06-24T17:15:00+00:00",
      "volume": 464193.95725
    }
  ]
}

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 NewStream added in v1.13.0

func NewStream(key, secret string) *Stream

func (*Stream) Close added in v1.13.0

func (s *Stream) Close() error

func (*Stream) Connect added in v1.13.0

func (s *Stream) Connect(ctx context.Context) error

func (*Stream) SetPublicOnly added in v1.13.0

func (s *Stream) SetPublicOnly()

func (*Stream) Subscribe added in v1.13.0

func (s *Stream) Subscribe(channel types.Channel, symbol string, _ types.SubscribeOptions)

Jump to

Keyboard shortcuts

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