ftxapi

package module
v0.0.0-...-3bdd229 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 16 Imported by: 3

README

ftx-api

REST & WebSocket APIs for FTX exchange

How to use

package main

import (
	"context"
	"time"

	"github.com/aibotsoft/ftx-api"
	"go.uber.org/zap"
)

var sugar = zap.NewExample().Sugar()

func main() {
	l, _ := zap.NewDevelopment()
	zap.ReplaceGlobals(l)
	sugar = l.Sugar()

	c := ftxapi.NewClient("your api key", "your api secret", ftxapi.RestAPIEndpoint, l.Sugar())
	futureStat, err := c.NewGetFutureStatsService().FutureName("1INCH-PERP").Do(context.Background())
	if err != nil {
		sugar.Errorw("err", "err", err)
		return
	}
	sugar.Infow("data", "futureStat", futureStat)

	res, err := c.NewPlaceOrderService().Params(ftxapi.PlaceOrderParams{
		Market: "SOL/USDT",
		Side:   ftxapi.SideBuy,
		Price:  150,
		Type:   ftxapi.OrderTypeLimit,
		Size:   0.1,
	}).Do(context.Background())

	if err != nil {
		sugar.Errorw("err", "err", err)
		return
	}

	sugar.Infow("data", "res", res)

	err = c.NewCancelOrderService().OrderID(res.ID).Do(context.Background())
	sugar.Infow("err cancel order", "err", err)

	s := ftxapi.NewWebsocketService("your api key", "your api secret", ftxapi.WebsocketEndpoint, l.Sugar()).AutoReconnect()
	err = s.Connect(handler, errHandler)
	if err != nil {
		sugar.Errorw("err", "err", err)
		return
	}
	err = s.Subscribe(ftxapi.Subscription{
		Channel: ftxapi.WsChannelOrders,
	})
	if err != nil {
		sugar.Errorw("err sub", "err", err)
		return
	}
	for {
		time.Sleep(1 * time.Second)
	}
}

func handler(res ftxapi.WsReponse) {
	sugar.Infow("data", "data", res)
}

func errHandler(err error) {
	sugar.Errorw("err", "err", err)
}

Documentation

Index

Constants

View Source
const (
	OptionTypeCall = "call"
	OptionTypePut  = "put"
)
View Source
const (
	DefaultRestAPIEndpoint = "https://ftx.com/api"
)
View Source
const (
	WebsocketEndpoint string = "wss://ftx.com/ws/"
)

Variables

View Source
var ErrorRateLimit = errors.New("error_rate_limit")
View Source
var OrderAlreadyClosed = errors.New("order_already_closed")
View Source
var OrderAlreadyQueued = errors.New("order_already_queued_for_cancellation")

Functions

func BoolPointer

func BoolPointer(i bool) *bool

func BoolToString

func BoolToString(b bool) string

func Float64ToString

func Float64ToString(f float64) string

func Int64Pointer

func Int64Pointer(i int64) *int64

func Int64ToString

func Int64ToString(i int64) string

func IntPointer

func IntPointer(i int) *int

func IntToString

func IntToString(i int) string

func StringPointer

func StringPointer(s string) *string

Types

type AcceptOptionsQuoteResponse

type AcceptOptionsQuoteResponse struct {
	Result *OptionQuote `json:"result"`
	// contains filtered or unexported fields
}

type AcceptOptionsQuoteService

type AcceptOptionsQuoteService struct {
	// contains filtered or unexported fields
}

func (*AcceptOptionsQuoteService) Do

func (*AcceptOptionsQuoteService) QuoteID

type Account

type Account struct {
	BackstopProvider             bool       `json:"backstopProvider"`
	Collateral                   float64    `json:"collateral"`
	FreeCollateral               float64    `json:"freeCollateral"`
	InitialMarginRequirement     float64    `json:"initialMarginRequirement"`
	Leverage                     float64    `json:"leverage"`
	Liquidating                  bool       `json:"liquidating"`
	MaintenanceMarginRequirement float64    `json:"maintenanceMarginRequirement"`
	MakerFee                     float64    `json:"makerFee"`
	MarginFraction               float64    `json:"marginFraction"`
	OpenMarginFraction           float64    `json:"openMarginFraction"`
	TakerFee                     float64    `json:"takerFee"`
	TotalAccountValue            float64    `json:"totalAccountValue"`
	TotalPositionSize            float64    `json:"totalPositionSize"`
	Username                     string     `json:"username"`
	Positions                    []Position `json:"positions"`
}

type AccountOptionsInfo

type AccountOptionsInfo struct {
	UsdBalance                   float64 `json:"usdBalance"`
	LiquidationPrice             float64 `json:"liquidationPrice"`
	Liquidating                  bool    `json:"liquidating"`
	MaintenanceMarginRequirement float64 `json:"maintenanceMarginRequirement"`
	InitialMarginRequirement     float64 `json:"initialMarginRequirement"`
}

type AccountResponse

type AccountResponse struct {
	Result *Account `json:"result"`
	// contains filtered or unexported fields
}

type Airdrop

type Airdrop struct {
	Coin   string    `json:"coin"`
	ID     int       `json:"id"`
	Size   float64   `json:"size"`
	Time   time.Time `json:"time"`
	Status string    `json:"status"`
}

type AirdropsResponse

type AirdropsResponse struct {
	Result []Airdrop `json:"result"`
	// contains filtered or unexported fields
}

type AllBalance

type AllBalance map[string]Balance

type AllBalancesResponse

type AllBalancesResponse struct {
	Result AllBalance `json:"result"`
	// contains filtered or unexported fields
}

type Balance

type Balance struct {
	Coin                   string  `json:"coin"`
	Free                   float64 `json:"free"`
	SpotBorrow             float64 `json:"spotBorrow"`
	Total                  float64 `json:"total"`
	UsdValue               float64 `json:"usdValue"`
	AvailableWithoutBorrow float64 `json:"availableWithoutBorrow"`
}

type BalancesResponse

type BalancesResponse struct {
	Result []Balance `json:"result"`
	// contains filtered or unexported fields
}

type Basket

type Basket map[string]float64

type BorrowHistory

type BorrowHistory struct {
	Coin string    `json:"coin"`
	Cost float64   `json:"cost"`
	Rate float64   `json:"rate"`
	Size float64   `json:"size"`
	Time time.Time `json:"time"`
}

type BorrowRate

type BorrowRate struct {
	Coin     string  `json:"coin"`
	Estimate float64 `json:"estimate"`
	Previous float64 `json:"previous"`
}

type CancelAllOrderParams

type CancelAllOrderParams struct {
	Market                *string `json:"market,omitempty"`
	Side                  *Side   `json:"side,omitempty"`
	ConditionalOrdersOnly *bool   `json:"conditionalOrdersOnly,omitempty"`
	LimitOrdersOnly       *bool   `json:"limitOrdersOnly,omitempty"`
}

type CancelAllOrderResponse

type CancelAllOrderResponse struct {
	// contains filtered or unexported fields
}

type CancelAllOrderService

type CancelAllOrderService struct {
	// contains filtered or unexported fields
}

func (*CancelAllOrderService) Do

func (*CancelAllOrderService) Params

type CancelOrderByClientIDResponse

type CancelOrderByClientIDResponse struct {
	// contains filtered or unexported fields
}

type CancelOrderByClientIDService

type CancelOrderByClientIDService struct {
	// contains filtered or unexported fields
}

func (*CancelOrderByClientIDService) ClientID

func (*CancelOrderByClientIDService) Do

type CancelOrderResponse

type CancelOrderResponse struct {
	// contains filtered or unexported fields
}

type CancelOrderService

type CancelOrderService struct {
	// contains filtered or unexported fields
}

func (*CancelOrderService) Do

func (*CancelOrderService) OrderID

func (s *CancelOrderService) OrderID(orderID int64) *CancelOrderService

type CancelQuoteRequest

type CancelQuoteRequest struct {
	ID            int64             `json:"id"`
	Option        Option            `json:"option"`
	RequestExpiry time.Time         `json:"requestExpiry"`
	Side          Side              `json:"side"`
	Size          float64           `json:"size"`
	Status        OptionQuoteStatus `json:"status"`
	Time          time.Time         `json:"time"`
}

type CancelQuoteRequestResponse

type CancelQuoteRequestResponse struct {
	Result *CancelQuoteRequest `json:"result"`
	// contains filtered or unexported fields
}

type CancelQuoteRequestService

type CancelQuoteRequestService struct {
	// contains filtered or unexported fields
}

func (*CancelQuoteRequestService) Do

func (*CancelQuoteRequestService) RequestID

type CancelQuoteResponse

type CancelQuoteResponse struct {
	Result *OptionQuote `json:"result"`
	// contains filtered or unexported fields
}

type CancelQuoteService

type CancelQuoteService struct {
	// contains filtered or unexported fields
}

func (*CancelQuoteService) Do

func (*CancelQuoteService) QuoteID

func (s *CancelQuoteService) QuoteID(quoteID int64) *CancelQuoteService

type CancelTriggerOrderResponse

type CancelTriggerOrderResponse struct {
	// contains filtered or unexported fields
}

type CancelTriggerOrderService

type CancelTriggerOrderService struct {
	// contains filtered or unexported fields
}

func (*CancelTriggerOrderService) Do

func (*CancelTriggerOrderService) OrderID

type ChangeAccountLeverageResponse

type ChangeAccountLeverageResponse struct {
	// contains filtered or unexported fields
}

type ChangeAccountLeverageService

type ChangeAccountLeverageService struct {
	// contains filtered or unexported fields
}

func (*ChangeAccountLeverageService) Do

func (*ChangeAccountLeverageService) Params

type ChangeSubAccountNameParams

type ChangeSubAccountNameParams struct {
	Nickname    string `json:"nickname"`
	NewNickName string `json:"newNickname"`
}

type ChangeSubAccountNameResponse

type ChangeSubAccountNameResponse struct {
	// contains filtered or unexported fields
}

type ChangeSubAccountNameService

type ChangeSubAccountNameService struct {
	// contains filtered or unexported fields
}

func (*ChangeSubAccountNameService) Do

func (*ChangeSubAccountNameService) Params

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg Config) *Client

func (*Client) NewAcceptOptionsQuoteService

func (c *Client) NewAcceptOptionsQuoteService() *AcceptOptionsQuoteService

func (*Client) NewCancelAllOrderService

func (c *Client) NewCancelAllOrderService() *CancelAllOrderService

func (*Client) NewCancelOrderByClientIDService

func (c *Client) NewCancelOrderByClientIDService() *CancelOrderByClientIDService

func (*Client) NewCancelOrderService

func (c *Client) NewCancelOrderService() *CancelOrderService

func (*Client) NewCancelQuoteRequestService

func (c *Client) NewCancelQuoteRequestService() *CancelQuoteRequestService

func (*Client) NewCancelQuoteService

func (c *Client) NewCancelQuoteService() *CancelQuoteService

func (*Client) NewCancelTriggerOrderService

func (c *Client) NewCancelTriggerOrderService() *CancelTriggerOrderService

func (*Client) NewChangeAccountLeverageService

func (c *Client) NewChangeAccountLeverageService() *ChangeAccountLeverageService

func (*Client) NewChangeSubAccountNameService

func (c *Client) NewChangeSubAccountNameService() *ChangeSubAccountNameService

func (*Client) NewCreateQuoteRequestService

func (c *Client) NewCreateQuoteRequestService() *CreateQuoteRequestService

func (*Client) NewCreateQuoteService

func (c *Client) NewCreateQuoteService() *CreateQuoteService

func (*Client) NewCreateSaveAddressesService

func (c *Client) NewCreateSaveAddressesService() *CreateSaveAddressesService

func (*Client) NewCreateSubAccountService

func (c *Client) NewCreateSubAccountService() *CreateSubAccountService

func (*Client) NewDeleteSaveAddressesService

func (c *Client) NewDeleteSaveAddressesService() *DeleteSaveAddressesService

func (*Client) NewDeleteSubAccountService

func (c *Client) NewDeleteSubAccountService() *DeleteSubAccountService

func (*Client) NewFundingPaymentsService

func (c *Client) NewFundingPaymentsService() *FundingPaymentsService

func (*Client) NewGet24HOptionVolumeService

func (c *Client) NewGet24HOptionVolumeService() *Get24HOptionVolumeService

func (*Client) NewGetAccountOptionsInfoService

func (c *Client) NewGetAccountOptionsInfoService() *GetAccountOptionsInfoService

func (*Client) NewGetAccountService

func (c *Client) NewGetAccountService() *GetAccountService

func (*Client) NewGetAirdropsService

func (c *Client) NewGetAirdropsService() *GetAirdropsService

func (*Client) NewGetAllBalancesService

func (c *Client) NewGetAllBalancesService() *GetAllBalancesService

func (*Client) NewGetAllSubAccountsService

func (c *Client) NewGetAllSubAccountsService() *GetAllSubAccountsService

func (*Client) NewGetBalancesService

func (c *Client) NewGetBalancesService() *GetBalancesService

func (*Client) NewGetBorrowRatesService

func (c *Client) NewGetBorrowRatesService() *GetBorrowRatesService

func (*Client) NewGetCoinsService

func (c *Client) NewGetCoinsService() *GetCoinsService

func (*Client) NewGetDailyBorrowedAmountsService

func (c *Client) NewGetDailyBorrowedAmountsService() *GetDailyBorrowedAmountsService

func (*Client) NewGetDepositAddressListService

func (c *Client) NewGetDepositAddressListService() *GetDepositAddressListService

func (*Client) NewGetDepositAddressService

func (c *Client) NewGetDepositAddressService() *GetDepositAddressService

func (*Client) NewGetDepositHistoryService

func (c *Client) NewGetDepositHistoryService() *GetDepositHistoryService

func (*Client) NewGetExpiredFuturesService

func (c *Client) NewGetExpiredFuturesService() *GetExpiredFuturesService

func (*Client) NewGetFutureFundingRateService

func (c *Client) NewGetFutureFundingRateService() *GetFutureFundingRateService

func (*Client) NewGetFutureIndexWeightsService

func (c *Client) NewGetFutureIndexWeightsService() *GetFutureIndexWeightsService

func (*Client) NewGetFutureService

func (c *Client) NewGetFutureService() *GetFutureService

func (*Client) NewGetFutureStatsService

func (c *Client) NewGetFutureStatsService() *GetFutureStatsService

func (*Client) NewGetHistorical24HOptionVolumeService

func (c *Client) NewGetHistorical24HOptionVolumeService() *GetHistorical24HOptionVolumeService

func (*Client) NewGetHistoricalIndexService

func (c *Client) NewGetHistoricalIndexService() *GetHistoricalIndexService

func (*Client) NewGetHistoricalOpenInterestService

func (c *Client) NewGetHistoricalOpenInterestService() *GetHistoricalOpenInterestService

func (*Client) NewGetHistoricalPricesService

func (c *Client) NewGetHistoricalPricesService() *GetHistoricalPricesService

func (*Client) NewGetLendingHistoryService

func (c *Client) NewGetLendingHistoryService() *GetLendingHistoryService

func (*Client) NewGetLendingInfoService

func (c *Client) NewGetLendingInfoService() *GetLendingInfoService

func (*Client) NewGetLendingOffersService

func (c *Client) NewGetLendingOffersService() *GetLendingOffersService

func (*Client) NewGetLendingRatesService

func (c *Client) NewGetLendingRatesService() *GetLendingRatesService

func (*Client) NewGetLeveragedTokenBalancesService

func (c *Client) NewGetLeveragedTokenBalancesService() *GetLeveragedTokenBalancesService

func (*Client) NewGetLeveragedTokenInfoService

func (c *Client) NewGetLeveragedTokenInfoService() *GetLeveragedTokenInfoService

func (*Client) NewGetListFutureService

func (c *Client) NewGetListFutureService() *GetListFutureService

func (*Client) NewGetMarketsService

func (c *Client) NewGetMarketsService() *GetMarketsService

func (*Client) NewGetMyBorrowHistoryService

func (c *Client) NewGetMyBorrowHistoryService() *GetMyBorrowHistoryService

func (*Client) NewGetMyLendingHistoryService

func (c *Client) NewGetMyLendingHistoryService() *GetMyLendingHistoryService

func (*Client) NewGetMyQuotesService

func (c *Client) NewGetMyQuotesService() *GetMyQuotesService

func (*Client) NewGetOpenOrdersService

func (c *Client) NewGetOpenOrdersService() *GetOpenOrdersService

func (*Client) NewGetOpenTriggerOrdersService

func (c *Client) NewGetOpenTriggerOrdersService() *GetOpenTriggerOrdersService

func (*Client) NewGetOptionOpenInterestService

func (c *Client) NewGetOptionOpenInterestService() *GetOptionOpenInterestService

func (*Client) NewGetOrderBookService

func (c *Client) NewGetOrderBookService() *GetOrderBookService

func (*Client) NewGetOrderHistoryService

func (c *Client) NewGetOrderHistoryService() *GetOrderHistoryService

func (*Client) NewGetOrderStatusByClientIDService

func (c *Client) NewGetOrderStatusByClientIDService() *GetOrderStatusByClientIDService

func (*Client) NewGetOrderStatusService

func (c *Client) NewGetOrderStatusService() *GetOrderStatusService

func (*Client) NewGetPositionsService

func (c *Client) NewGetPositionsService() *GetPositionsService

func (*Client) NewGetPublicOptionsTradesService

func (c *Client) NewGetPublicOptionsTradesService() *GetPublicOptionsTradesService

func (*Client) NewGetQuotesForYourQuoteRequestService

func (c *Client) NewGetQuotesForYourQuoteRequestService() *GetQuotesForYourQuoteRequestService

func (*Client) NewGetSaveAddressesService

func (c *Client) NewGetSaveAddressesService() *GetSaveAddressesService

func (*Client) NewGetSingleMarketsService

func (c *Client) NewGetSingleMarketsService() *GetSingleMarketService

func (*Client) NewGetSpotMarginMarketInfoService

func (c *Client) NewGetSpotMarginMarketInfoService() *GetSpotMarginMarketInfoService

func (*Client) NewGetTradesService

func (c *Client) NewGetTradesService() *GetTradesService

func (*Client) NewGetTriggerOrderHistoryService

func (c *Client) NewGetTriggerOrderHistoryService() *GetTriggerOrderHistoryService

func (*Client) NewGetWithdrawHistoryService

func (c *Client) NewGetWithdrawHistoryService() *GetWithdrawHistoryService

func (*Client) NewGetWithdrawalFeesService

func (c *Client) NewGetWithdrawalFeesService() *GetWithdrawalFeesService

func (*Client) NewListLeveragedTokenCreationRequestsService

func (c *Client) NewListLeveragedTokenCreationRequestsService() *ListLeveragedTokenCreationRequestsService

func (*Client) NewListLeveragedTokenRedemptionRequestsService

func (c *Client) NewListLeveragedTokenRedemptionRequestsService() *ListLeveragedTokenRedemptionRequestsService

func (*Client) NewListLeveragedTokensService

func (c *Client) NewListLeveragedTokensService() *ListLeveragedTokensService

func (*Client) NewListQuoteRequestsService

func (c *Client) NewListQuoteRequestsService() *ListQuoteRequestsService

func (*Client) NewModifyOrderByClientIDService

func (c *Client) NewModifyOrderByClientIDService() *ModifyOrderByClientIDService

func (*Client) NewModifyOrderService

func (c *Client) NewModifyOrderService() *ModifyOrderService

func (*Client) NewModifyTriggerOrderService

func (c *Client) NewModifyTriggerOrderService() *ModifyTriggerOrderService

func (*Client) NewPlaceOrderService

func (c *Client) NewPlaceOrderService() *PlaceOrderService

func (*Client) NewPlaceTriggerOrderService

func (c *Client) NewPlaceTriggerOrderService() *PlaceTriggerOrderService

func (*Client) NewRequestETFRebalanceInfoService

func (c *Client) NewRequestETFRebalanceInfoService() *RequestETFRebalanceInfoService

func (*Client) NewRequestLeveragedTokenCreationService

func (c *Client) NewRequestLeveragedTokenCreationService() *RequestLeveragedTokenCreationService

func (*Client) NewRequestLeveragedTokenRedemptionService

func (c *Client) NewRequestLeveragedTokenRedemptionService() *RequestLeveragedTokenRedemptionService

func (*Client) NewSubmitLendingOfferService

func (c *Client) NewSubmitLendingOfferService() *SubmitLendingOfferService

func (*Client) NewTransferBetweenSubAccountsService

func (c *Client) NewTransferBetweenSubAccountsService() *TransferBetweenSubAccountsService

func (*Client) NewWithdrawService

func (c *Client) NewWithdrawService() *WithdrawService

func (*Client) NewYourQuoteRequestsService

func (c *Client) NewYourQuoteRequestsService() *YourQuoteRequestsService

func (*Client) SubAccount

func (c *Client) SubAccount(subaccount *string) *Client

type Coin

type Coin struct {
	Bep2Asset        *string  `json:"bep2Asset"`
	CanConvert       bool     `json:"canConvert"`
	CanDeposit       bool     `json:"canDeposit"`
	CanWithdraw      bool     `json:"canWithdraw"`
	Collateral       bool     `json:"collateral"`
	CollateralWeight float64  `json:"collateralWeight"`
	CreditTo         *string  `json:"creditTo"`
	Erc20Contract    string   `json:"erc20Contract"`
	Fiat             bool     `json:"fiat"`
	HasTag           bool     `json:"hasTag"`
	ID               string   `json:"id"`
	IsToken          bool     `json:"isToken"`
	Methods          []string `json:"methods"`
	Name             string   `json:"name"`
	SplMint          string   `json:"splMint"`
	Trc20Contract    string   `json:"trc20Contract"`
	UsdFungible      bool     `json:"usdFungible"`
}

type CoinSpotMarginInfo

type CoinSpotMarginInfo struct {
	Coin          string  `json:"coin"`
	Borrowed      float64 `json:"borrowed"`
	Free          float64 `json:"free"`
	EstimatedRate float64 `json:"estimatedRate"`
	PreviousRate  float64 `json:"previousRate"`
}

type CoinsResponse

type CoinsResponse struct {
	Result []Coin `json:"result"`
	// contains filtered or unexported fields
}

type Config

type Config struct {
	ApiKey          string
	ApiSecret       string
	RestAPIEndpoint string
	Logger          *zap.SugaredLogger
	HttpClient      *http.Client
	SubAccount      *string
}

type CreateAddressesResponse

type CreateAddressesResponse struct {
	Result *SaveAddress `json:"result"`
	// contains filtered or unexported fields
}

type CreateQuoteParams

type CreateQuoteParams struct {
	Price float64 `json:"price"`
}

type CreateQuoteRequest

type CreateQuoteRequest struct {
	ID            int64       `json:"id"`
	Option        Option      `json:"option"`
	Expiry        time.Time   `json:"expiry"`
	Strike        float64     `json:"strike"`
	Type          OptionType  `json:"type"`
	Underlying    string      `json:"underlying"`
	RequestExpiry time.Time   `json:"requestExpiry"`
	Side          Side        `json:"side"`
	Size          float64     `json:"size"`
	Status        OrderStatus `json:"status"`
	Time          time.Time   `json:"time"`
}

type CreateQuoteRequestParams

type CreateQuoteRequestParams struct {
	Underlying     string   `json:"underlying"`
	Type           string   `json:"type"`
	Strike         float64  `json:"strike"`
	Expiry         int64    `json:"expiry"`
	Side           Side     `json:"side"`
	Size           float64  `json:"size"`
	LimitPrice     *float64 `json:"limitPrice,omitempty"`
	HideLimitPrice bool     `json:"hideLimitPrice"`
	RequestExpiry  *float64 `json:"requestExpiry,omitempty"`
	CounterpartyId *int64   `json:"counterpartyId,omitempty"`
}

type CreateQuoteRequestResponse

type CreateQuoteRequestResponse struct {
	Result *CreateQuoteRequest `json:"result"`
	// contains filtered or unexported fields
}

type CreateQuoteRequestService

type CreateQuoteRequestService struct {
	// contains filtered or unexported fields
}

func (*CreateQuoteRequestService) Do

func (*CreateQuoteRequestService) Params

type CreateQuoteResponse

type CreateQuoteResponse struct {
	Result *OptionQuote `json:"result"`
	// contains filtered or unexported fields
}

type CreateQuoteService

type CreateQuoteService struct {
	// contains filtered or unexported fields
}

func (*CreateQuoteService) Do

func (*CreateQuoteService) Params

func (*CreateQuoteService) RequestID

func (s *CreateQuoteService) RequestID(requestID int64) *CreateQuoteService

type CreateSaveAddressParams

type CreateSaveAddressParams struct {
	Coin         string  `json:"coin"`
	Address      string  `json:"address"`
	AddressName  string  `json:"addressName"`
	IsPrimetrust bool    `json:"isPrimetrust"`
	Tag          *string `json:"tag"`
}

type CreateSaveAddressesService

type CreateSaveAddressesService struct {
	// contains filtered or unexported fields
}

func (*CreateSaveAddressesService) Do

func (*CreateSaveAddressesService) Params

type CreateSubAccountParams

type CreateSubAccountParams struct {
	Nickname string `json:"nickname"`
}

type CreateSubAccountResponse

type CreateSubAccountResponse struct {
	Result *SubAccount `json:"result"`
	// contains filtered or unexported fields
}

type CreateSubAccountService

type CreateSubAccountService struct {
	// contains filtered or unexported fields
}

func (*CreateSubAccountService) Do

func (*CreateSubAccountService) Params

type DailyBorrowedAmounts

type DailyBorrowedAmounts struct {
	Coin string  `json:"coin"`
	Size float64 `json:"size"`
}

type DeleteAddressesResponse

type DeleteAddressesResponse struct {
	Result *string `json:"result"`
	// contains filtered or unexported fields
}

type DeleteSaveAddressesService

type DeleteSaveAddressesService struct {
	// contains filtered or unexported fields
}

func (*DeleteSaveAddressesService) Do

func (*DeleteSaveAddressesService) SaveAddressID

func (s *DeleteSaveAddressesService) SaveAddressID(saveAddressID int64) *DeleteSaveAddressesService

type DeleteSubAccountParams

type DeleteSubAccountParams struct {
	Nickname string `json:"nickname"`
}

type DeleteSubAccountResponse

type DeleteSubAccountResponse struct {
	// contains filtered or unexported fields
}

type DeleteSubAccountService

type DeleteSubAccountService struct {
	// contains filtered or unexported fields
}

func (*DeleteSubAccountService) Do

func (*DeleteSubAccountService) Params

type DepositAddress

type DepositAddress struct {
	Address string  `json:"address"`
	Tag     *string `json:"tag"`
}

type DepositAddressList

type DepositAddressList struct {
	Coin    string  `json:"coin"`
	Address string  `json:"address"`
	Tag     *string `json:"tag"`
}

type DepositAddressResponse

type DepositAddressResponse struct {
	Result *DepositAddress `json:"result"`
	// contains filtered or unexported fields
}

type DepositHistory

type DepositHistory struct {
	Coin          string    `json:"coin"`
	Confirmations int       `json:"confirmations"`
	ConfirmedTime time.Time `json:"confirmedTime"`
	Fee           float64   `json:"fee"`
	ID            int64     `json:"id"`
	SentTime      time.Time `json:"sentTime"`
	Size          float64   `json:"size"`
	Status        string    `json:"status"`
	Time          time.Time `json:"time"`
	Txid          string    `json:"txid"`
}

type DepositHistoryResponse

type DepositHistoryResponse struct {
	Result []DepositHistory `json:"result"`
	// contains filtered or unexported fields
}

type ETFRebalanceInfo

type ETFRebalanceInfo struct {
	OrderSizeList []string `json:"orderSizeList"`
	Side          string   `json:"side"`
	Time          string   `json:"time"`
}

type ExpiredFuture

type ExpiredFuture struct {
	Ask                   *float64    `json:"ask"`
	Bid                   *float64    `json:"bid"`
	Description           string      `json:"description"`
	Enabled               bool        `json:"enabled"`
	Expired               bool        `json:"expired"`
	Expiry                time.Time   `json:"expiry"`
	ExpiryDescription     string      `json:"expiryDescription"`
	Group                 string      `json:"group"`
	ImfFactor             float64     `json:"imfFactor"`
	Index                 float64     `json:"index"`
	Last                  float64     `json:"last"`
	LowerBound            float64     `json:"lowerBound"`
	MarginPrice           float64     `json:"marginPrice"`
	Mark                  float64     `json:"mark"`
	MoveStart             interface{} `json:"moveStart"`
	Name                  string      `json:"name"`
	Perpetual             bool        `json:"perpetual"`
	PositionLimitWeight   float64     `json:"positionLimitWeight"`
	PostOnly              bool        `json:"postOnly"`
	PriceIncrement        float64     `json:"priceIncrement"`
	SizeIncrement         float64     `json:"sizeIncrement"`
	Type                  string      `json:"type"`
	Underlying            string      `json:"underlying"`
	UnderlyingDescription string      `json:"underlyingDescription"`
	UpperBound            float64     `json:"upperBound"`
}

type ExpiredFuturesResponse

type ExpiredFuturesResponse struct {
	Result []ExpiredFuture `json:"result"`
	// contains filtered or unexported fields
}

type Feed

type Feed struct {
	Price float64 `json:"price"`
	Size  float64 `json:"size"`
}

func (*Feed) UnmarshalJSON

func (f *Feed) UnmarshalJSON(buf []byte) error

type Fill

type Fill struct {
	Fee           float64     `json:"fee"`
	FeeCurrency   string      `json:"feeCurrency"`
	FeeRate       float64     `json:"feeRate"`
	Future        string      `json:"future"`
	ID            int         `json:"id"`
	Liquidity     string      `json:"liquidity"`
	Market        string      `json:"market"`
	BaseCurrency  interface{} `json:"baseCurrency"`
	QuoteCurrency interface{} `json:"quoteCurrency"`
	OrderID       int         `json:"orderId"`
	TradeID       int         `json:"tradeId"`
	Price         float64     `json:"price"`
	Side          string      `json:"side"`
	Size          int         `json:"size"`
	Time          time.Time   `json:"time"`
	Type          string      `json:"type"`
}

type FillResponse

type FillResponse struct {
	Result []Fill `json:"result"`
	// contains filtered or unexported fields
}

type FillsService

type FillsService struct {
	// contains filtered or unexported fields
}

func (*FillsService) Do

func (s *FillsService) Do(ctx context.Context) ([]Fill, error)

func (*FillsService) EndTime

func (s *FillsService) EndTime(endTime int64) *FillsService

func (*FillsService) Market

func (s *FillsService) Market(market string) *FillsService

func (*FillsService) Order

func (s *FillsService) Order(order OrderBy) *FillsService

func (*FillsService) OrderID

func (s *FillsService) OrderID(orderID int64) *FillsService

func (*FillsService) StartTime

func (s *FillsService) StartTime(startTime int64) *FillsService

type FundingPayment

type FundingPayment struct {
	Future  string    `json:"future"`
	ID      int       `json:"id"`
	Payment float64   `json:"payment"`
	Time    time.Time `json:"time"`
	Rate    float64   `json:"rate"`
}

type FundingPaymentsResponse

type FundingPaymentsResponse struct {
	Result []FundingPayment `json:"result"`
	// contains filtered or unexported fields
}

type FundingPaymentsService

type FundingPaymentsService struct {
	// contains filtered or unexported fields
}

func (*FundingPaymentsService) Do

func (*FundingPaymentsService) EndTime

func (*FundingPaymentsService) Future

func (*FundingPaymentsService) StartTime

func (s *FundingPaymentsService) StartTime(startTime int64) *FundingPaymentsService

type Future

type Future struct {
	Ask                 float64   `json:"ask"`
	Bid                 float64   `json:"bid"`
	Change1H            float64   `json:"change1h"`
	Change24H           float64   `json:"change24h"`
	ChangeBod           float64   `json:"changeBod"`
	VolumeUsd24H        float64   `json:"volumeUsd24h"`
	Volume              float64   `json:"volume"`
	Description         string    `json:"description"`
	Enabled             bool      `json:"enabled"`
	Expired             bool      `json:"expired"`
	Expiry              time.Time `json:"expiry"`
	Index               float64   `json:"index"`
	ImfFactor           float64   `json:"imfFactor"`
	Last                float64   `json:"last"`
	LowerBound          float64   `json:"lowerBound"`
	Mark                float64   `json:"mark"`
	Name                string    `json:"name"`
	OpenInterest        float64   `json:"openInterest"`
	OpenInterestUsd     float64   `json:"openInterestUsd"`
	Perpetual           bool      `json:"perpetual"`
	PositionLimitWeight float64   `json:"positionLimitWeight"`
	PostOnly            bool      `json:"postOnly"`
	PriceIncrement      float64   `json:"priceIncrement"`
	SizeIncrement       float64   `json:"sizeIncrement"`
	Underlying          string    `json:"underlying"`
	UpperBound          float64   `json:"upperBound"`
	Type                string    `json:"type"`
}

type FutureFundingRate

type FutureFundingRate struct {
	Future string    `json:"future"`
	Rate   float64   `json:"rate"`
	Time   time.Time `json:"time"`
}

type FutureFundingRateResponse

type FutureFundingRateResponse struct {
	Result []FutureFundingRate `json:"result"`
	// contains filtered or unexported fields
}

type FutureIndexWeights

type FutureIndexWeights map[string]float64

type FutureIndexWeightsResponse

type FutureIndexWeightsResponse struct {
	Result FutureIndexWeights `json:"result"`
	// contains filtered or unexported fields
}

type FutureResponse

type FutureResponse struct {
	Result *Future `json:"result"`
	// contains filtered or unexported fields
}

type FutureStats

type FutureStats struct {
	Volume                   float64   `json:"volume"`
	NextFundingRate          float64   `json:"nextFundingRate"`
	NextFundingTime          time.Time `json:"nextFundingTime"`
	ExpirationPrice          float64   `json:"expirationPrice"`
	PredictedExpirationPrice float64   `json:"predictedExpirationPrice"`
	StrikePrice              float64   `json:"strikePrice"`
	OpenInterest             float64   `json:"openInterest"`
}

type FutureStatsResponse

type FutureStatsResponse struct {
	Result *FutureStats `json:"result"`
	// contains filtered or unexported fields
}

type Get24HOptionVolumeResponse

type Get24HOptionVolumeResponse struct {
	Result *OptionVolume24H `json:"result"`
	// contains filtered or unexported fields
}

type Get24HOptionVolumeService

type Get24HOptionVolumeService struct {
	// contains filtered or unexported fields
}

func (*Get24HOptionVolumeService) Do

type GetAccountOptionsInfoResponse

type GetAccountOptionsInfoResponse struct {
	Result *AccountOptionsInfo `json:"result"`
	// contains filtered or unexported fields
}

type GetAccountOptionsInfoService

type GetAccountOptionsInfoService struct {
	// contains filtered or unexported fields
}

func (*GetAccountOptionsInfoService) Do

type GetAccountService

type GetAccountService struct {
	// contains filtered or unexported fields
}

func (*GetAccountService) Do

type GetAirdropsService

type GetAirdropsService struct {
	// contains filtered or unexported fields
}

func (*GetAirdropsService) Do

func (*GetAirdropsService) EndTime

func (s *GetAirdropsService) EndTime(endTime int64) *GetAirdropsService

func (*GetAirdropsService) StartTime

func (s *GetAirdropsService) StartTime(startTime int64) *GetAirdropsService

type GetAllBalancesService

type GetAllBalancesService struct {
	// contains filtered or unexported fields
}

func (*GetAllBalancesService) Do

type GetAllSubAccountsResponse

type GetAllSubAccountsResponse struct {
	Result []SubAccount `json:"result"`
	// contains filtered or unexported fields
}

type GetAllSubAccountsService

type GetAllSubAccountsService struct {
	// contains filtered or unexported fields
}

func (*GetAllSubAccountsService) Do

type GetBalancesService

type GetBalancesService struct {
	// contains filtered or unexported fields
}

func (*GetBalancesService) Do

type GetBorrowRatesResponse

type GetBorrowRatesResponse struct {
	Result []BorrowRate `json:"result"`
	// contains filtered or unexported fields
}

type GetBorrowRatesService

type GetBorrowRatesService struct {
	// contains filtered or unexported fields
}

func (*GetBorrowRatesService) Do

type GetCoinsService

type GetCoinsService struct {
	// contains filtered or unexported fields
}

func (*GetCoinsService) Do

func (s *GetCoinsService) Do(ctx context.Context) ([]Coin, error)

type GetDailyBorrowedAmountsResponse

type GetDailyBorrowedAmountsResponse struct {
	Result []DailyBorrowedAmounts `json:"result"`
	// contains filtered or unexported fields
}

type GetDailyBorrowedAmountsService

type GetDailyBorrowedAmountsService struct {
	// contains filtered or unexported fields
}

func (*GetDailyBorrowedAmountsService) Do

type GetDepositAddressListResponse

type GetDepositAddressListResponse struct {
	Result *DepositAddressList `json:"result"`
	// contains filtered or unexported fields
}

type GetDepositAddressListService

type GetDepositAddressListService struct {
	// contains filtered or unexported fields
}

func (*GetDepositAddressListService) Do

type GetDepositAddressService

type GetDepositAddressService struct {
	// contains filtered or unexported fields
}

func (*GetDepositAddressService) Coin

func (*GetDepositAddressService) Do

func (*GetDepositAddressService) Method

type GetDepositHistoryService

type GetDepositHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetDepositHistoryService) Do

func (*GetDepositHistoryService) EndTime

func (*GetDepositHistoryService) StartTime

func (s *GetDepositHistoryService) StartTime(startTime int64) *GetDepositHistoryService

type GetExpiredFuturesService

type GetExpiredFuturesService struct {
	// contains filtered or unexported fields
}

func (*GetExpiredFuturesService) Do

type GetFutureFundingRateService

type GetFutureFundingRateService struct {
	// contains filtered or unexported fields
}

func (*GetFutureFundingRateService) Do

func (*GetFutureFundingRateService) EndTime

func (*GetFutureFundingRateService) Future

func (*GetFutureFundingRateService) StartTime

type GetFutureIndexWeightsService

type GetFutureIndexWeightsService struct {
	// contains filtered or unexported fields
}

func (*GetFutureIndexWeightsService) Do

type GetFutureService

type GetFutureService struct {
	// contains filtered or unexported fields
}

func (*GetFutureService) Do

func (s *GetFutureService) Do(ctx context.Context) (*Future, error)

func (*GetFutureService) FutureName

func (s *GetFutureService) FutureName(futureName string) *GetFutureService

type GetFutureStatsService

type GetFutureStatsService struct {
	// contains filtered or unexported fields
}

func (*GetFutureStatsService) Do

func (*GetFutureStatsService) FutureName

func (s *GetFutureStatsService) FutureName(futureName string) *GetFutureStatsService

type GetHistorical24HOptionVolumeService

type GetHistorical24HOptionVolumeService struct {
	// contains filtered or unexported fields
}

func (*GetHistorical24HOptionVolumeService) Do

func (*GetHistorical24HOptionVolumeService) EndTime

func (*GetHistorical24HOptionVolumeService) StartTime

type GetHistoricalIndexService

type GetHistoricalIndexService struct {
	// contains filtered or unexported fields
}

func (*GetHistoricalIndexService) Do

func (*GetHistoricalIndexService) EndTime

func (*GetHistoricalIndexService) MarketName

func (s *GetHistoricalIndexService) MarketName(marketName string) *GetHistoricalIndexService

func (*GetHistoricalIndexService) Resolution

func (s *GetHistoricalIndexService) Resolution(resolution int64) *GetHistoricalIndexService

func (*GetHistoricalIndexService) StartTime

type GetHistoricalOpenInterestResponse

type GetHistoricalOpenInterestResponse struct {
	Result []HistoricalOpenInterest `json:"result"`
	// contains filtered or unexported fields
}

type GetHistoricalOpenInterestService

type GetHistoricalOpenInterestService struct {
	// contains filtered or unexported fields
}

func (*GetHistoricalOpenInterestService) Do

func (*GetHistoricalOpenInterestService) EndTime

func (*GetHistoricalOpenInterestService) StartTime

type GetHistoricalOptionVolumeResponse

type GetHistoricalOptionVolumeResponse struct {
	Result []Historical24HVolume `json:"result"`
	// contains filtered or unexported fields
}

type GetHistoricalPricesService

type GetHistoricalPricesService struct {
	// contains filtered or unexported fields
}

func (*GetHistoricalPricesService) Do

func (*GetHistoricalPricesService) EndTime

func (*GetHistoricalPricesService) MarketName

func (*GetHistoricalPricesService) Resolution

func (s *GetHistoricalPricesService) Resolution(resolution int64) *GetHistoricalPricesService

func (*GetHistoricalPricesService) StartTime

type GetLendingHistoryResponse

type GetLendingHistoryResponse struct {
	Result []LendingHistory `json:"result"`
	// contains filtered or unexported fields
}

type GetLendingHistoryService

type GetLendingHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetLendingHistoryService) Do

func (*GetLendingHistoryService) EndTime

func (*GetLendingHistoryService) StartTime

func (s *GetLendingHistoryService) StartTime(startTime int64) *GetLendingHistoryService

type GetLendingInfoResponse

type GetLendingInfoResponse struct {
	Result []LendingInfo `json:"result"`
	// contains filtered or unexported fields
}

type GetLendingInfoService

type GetLendingInfoService struct {
	// contains filtered or unexported fields
}

func (*GetLendingInfoService) Do

type GetLendingOffersResponse

type GetLendingOffersResponse struct {
	Result []LendingOffer `json:"result"`
	// contains filtered or unexported fields
}

type GetLendingOffersService

type GetLendingOffersService struct {
	// contains filtered or unexported fields
}

func (*GetLendingOffersService) Do

type GetLendingRatesResponse

type GetLendingRatesResponse struct {
	Result []LendingRate `json:"result"`
	// contains filtered or unexported fields
}

type GetLendingRatesService

type GetLendingRatesService struct {
	// contains filtered or unexported fields
}

func (*GetLendingRatesService) Do

type GetLeveragedTokenBalancesResponse

type GetLeveragedTokenBalancesResponse struct {
	Result []LeveragedTokenBalance `json:"result"`
	// contains filtered or unexported fields
}

type GetLeveragedTokenBalancesService

type GetLeveragedTokenBalancesService struct {
	// contains filtered or unexported fields
}

func (*GetLeveragedTokenBalancesService) Do

type GetLeveragedTokenInfoResponse

type GetLeveragedTokenInfoResponse struct {
	Result *LeveragedToken `json:"result"`
	// contains filtered or unexported fields
}

type GetLeveragedTokenInfoService

type GetLeveragedTokenInfoService struct {
	// contains filtered or unexported fields
}

func (*GetLeveragedTokenInfoService) Do

func (*GetLeveragedTokenInfoService) Token

type GetListFutureService

type GetListFutureService struct {
	// contains filtered or unexported fields
}

func (*GetListFutureService) Do

type GetMarketInfoResponse

type GetMarketInfoResponse struct {
	Result []CoinSpotMarginInfo `json:"result"`
	// contains filtered or unexported fields
}

type GetMarketsService

type GetMarketsService struct {
	// contains filtered or unexported fields
}

func (*GetMarketsService) Do

func (s *GetMarketsService) Do(ctx context.Context) ([]Market, error)

type GetMyBorrowHistoryResponse

type GetMyBorrowHistoryResponse struct {
	Result []BorrowHistory `json:"result"`
	// contains filtered or unexported fields
}

type GetMyBorrowHistoryService

type GetMyBorrowHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetMyBorrowHistoryService) Do

func (*GetMyBorrowHistoryService) EndTime

func (*GetMyBorrowHistoryService) StartTime

type GetMyLendingHistoryResponse

type GetMyLendingHistoryResponse struct {
	Result []UserLendingHistory `json:"result"`
	// contains filtered or unexported fields
}

type GetMyLendingHistoryService

type GetMyLendingHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetMyLendingHistoryService) Do

func (*GetMyLendingHistoryService) EndTime

func (*GetMyLendingHistoryService) StartTime

type GetMyQuotesResponse

type GetMyQuotesResponse struct {
	Result []OptionQuote `json:"result"`
	// contains filtered or unexported fields
}

type GetMyQuotesService

type GetMyQuotesService struct {
	// contains filtered or unexported fields
}

func (*GetMyQuotesService) Do

type GetOpenOrdersService

type GetOpenOrdersService struct {
	// contains filtered or unexported fields
}

func (*GetOpenOrdersService) Do

func (*GetOpenOrdersService) Market

type GetOpenTriggerOrdersService

type GetOpenTriggerOrdersService struct {
	// contains filtered or unexported fields
}

func (*GetOpenTriggerOrdersService) Do

func (*GetOpenTriggerOrdersService) Market

func (*GetOpenTriggerOrdersService) TriggerType

type GetOptionOpenInterestResponse

type GetOptionOpenInterestResponse struct {
	Result *OptionOpenInterest `json:"result"`
	// contains filtered or unexported fields
}

type GetOptionOpenInterestService

type GetOptionOpenInterestService struct {
	// contains filtered or unexported fields
}

func (*GetOptionOpenInterestService) Do

type GetOptionsFillsResponse

type GetOptionsFillsResponse struct {
	Result []OptionFill `json:"result"`
	// contains filtered or unexported fields
}

type GetOptionsFillsService

type GetOptionsFillsService struct {
	// contains filtered or unexported fields
}

func (*GetOptionsFillsService) Do

func (*GetOptionsFillsService) EndTime

func (*GetOptionsFillsService) StartTime

func (s *GetOptionsFillsService) StartTime(startTime int64) *GetOptionsFillsService

type GetOptionsPositionsResponse

type GetOptionsPositionsResponse struct {
	Result []OptionPosition `json:"result"`
	// contains filtered or unexported fields
}

type GetOptionsPositionsService

type GetOptionsPositionsService struct {
	// contains filtered or unexported fields
}

func (*GetOptionsPositionsService) Do

type GetOrderBookService

type GetOrderBookService struct {
	// contains filtered or unexported fields
}

func (*GetOrderBookService) Depth

func (s *GetOrderBookService) Depth(depth int) *GetOrderBookService

func (*GetOrderBookService) Do

func (*GetOrderBookService) MarketName

func (s *GetOrderBookService) MarketName(marketName string) *GetOrderBookService

type GetOrderHistoryService

type GetOrderHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetOrderHistoryService) Do

func (*GetOrderHistoryService) EndTime

func (*GetOrderHistoryService) Market

func (*GetOrderHistoryService) StartTime

func (s *GetOrderHistoryService) StartTime(startTime int64) *GetOrderHistoryService

type GetOrderStatusByClientIDResponse

type GetOrderStatusByClientIDResponse struct {
	Result *Order `json:"result"`
	// contains filtered or unexported fields
}

type GetOrderStatusByClientIDService

type GetOrderStatusByClientIDService struct {
	// contains filtered or unexported fields
}

func (*GetOrderStatusByClientIDService) ClientID

func (*GetOrderStatusByClientIDService) Do

type GetOrderStatusResponse

type GetOrderStatusResponse struct {
	Result *Order `json:"result"`
	// contains filtered or unexported fields
}

type GetOrderStatusService

type GetOrderStatusService struct {
	// contains filtered or unexported fields
}

func (*GetOrderStatusService) Do

func (*GetOrderStatusService) OrderID

func (s *GetOrderStatusService) OrderID(orderID int64) *GetOrderStatusService

type GetPositionsService

type GetPositionsService struct {
	// contains filtered or unexported fields
}

func (*GetPositionsService) Do

func (*GetPositionsService) ShowAvgPrice

func (s *GetPositionsService) ShowAvgPrice(sap bool) *GetPositionsService

type GetPublicOptionsTradesResponse

type GetPublicOptionsTradesResponse struct {
	Result []PublicOptionTrade `json:"result"`
	// contains filtered or unexported fields
}

type GetPublicOptionsTradesService

type GetPublicOptionsTradesService struct {
	// contains filtered or unexported fields
}

func (*GetPublicOptionsTradesService) Do

func (*GetPublicOptionsTradesService) EndTime

func (*GetPublicOptionsTradesService) StartTime

type GetQuotesForYourQuoteRequestResponse

type GetQuotesForYourQuoteRequestResponse struct {
	Result []YourQuoteRequest `json:"result"`
	// contains filtered or unexported fields
}

type GetQuotesForYourQuoteRequestService

type GetQuotesForYourQuoteRequestService struct {
	// contains filtered or unexported fields
}

func (*GetQuotesForYourQuoteRequestService) Do

func (*GetQuotesForYourQuoteRequestService) RequestID

type GetSaveAddressesService

type GetSaveAddressesService struct {
	// contains filtered or unexported fields
}

func (*GetSaveAddressesService) Do

type GetSingleMarketService

type GetSingleMarketService struct {
	// contains filtered or unexported fields
}

func (*GetSingleMarketService) Do

func (*GetSingleMarketService) MarketName

func (s *GetSingleMarketService) MarketName(marketName string) *GetSingleMarketService

type GetSpotMarginMarketInfoService

type GetSpotMarginMarketInfoService struct {
	// contains filtered or unexported fields
}

func (*GetSpotMarginMarketInfoService) Do

func (*GetSpotMarginMarketInfoService) Market

type GetSubAccountBalanceResponse

type GetSubAccountBalanceResponse struct {
	Result []Balance `json:"result"`
	// contains filtered or unexported fields
}

type GetSubAccountBalanceService

type GetSubAccountBalanceService struct {
	// contains filtered or unexported fields
}

func (*GetSubAccountBalanceService) Do

func (*GetSubAccountBalanceService) NickName

type GetTradesService

type GetTradesService struct {
	// contains filtered or unexported fields
}

func (*GetTradesService) Do

func (s *GetTradesService) Do(ctx context.Context) ([]Trade, error)

func (*GetTradesService) EndTime

func (s *GetTradesService) EndTime(endTime int64) *GetTradesService

func (*GetTradesService) MarketName

func (s *GetTradesService) MarketName(marketName string) *GetTradesService

func (*GetTradesService) StartTime

func (s *GetTradesService) StartTime(startTime int64) *GetTradesService

type GetTriggerOrderHistoryService

type GetTriggerOrderHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetTriggerOrderHistoryService) Do

func (*GetTriggerOrderHistoryService) EndTime

func (*GetTriggerOrderHistoryService) Market

func (*GetTriggerOrderHistoryService) OrderType

func (*GetTriggerOrderHistoryService) Side

func (*GetTriggerOrderHistoryService) StartTime

func (*GetTriggerOrderHistoryService) TriggerType

type GetTriggerOrderTriggersService

type GetTriggerOrderTriggersService struct {
	// contains filtered or unexported fields
}

func (*GetTriggerOrderTriggersService) Do

type GetWithdrawHistoryService

type GetWithdrawHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetWithdrawHistoryService) Do

func (*GetWithdrawHistoryService) EndTime

func (*GetWithdrawHistoryService) StartTime

type GetWithdrawalFeesService

type GetWithdrawalFeesService struct {
	// contains filtered or unexported fields
}

func (*GetWithdrawalFeesService) Address

func (*GetWithdrawalFeesService) Coin

func (*GetWithdrawalFeesService) Do

func (*GetWithdrawalFeesService) Size

func (*GetWithdrawalFeesService) Tag

type Historical24HVolume

type Historical24HVolume struct {
	StartTime    time.Time `json:"startTime"`
	EndTime      time.Time `json:"endTime"`
	NumContracts float64   `json:"numContracts"`
}

type HistoricalIndex

type HistoricalIndex struct {
	Close     float64   `json:"close"`
	High      float64   `json:"high"`
	Low       float64   `json:"low"`
	Open      float64   `json:"open"`
	StartTime time.Time `json:"startTime"`
	Volume    *float64  `json:"volume"`
}

type HistoricalIndexResponse

type HistoricalIndexResponse struct {
	Result []HistoricalIndex `json:"result"`
	// contains filtered or unexported fields
}

type HistoricalOpenInterest

type HistoricalOpenInterest struct {
	Time         time.Time `json:"time"`
	NumContracts float64   `json:"numContracts"`
}

type HistoricalPrice

type HistoricalPrice struct {
	Close     float64   `json:"close"`
	High      float64   `json:"high"`
	Low       float64   `json:"low"`
	Open      float64   `json:"open"`
	StartTime time.Time `json:"startTime"`
	Volume    float64   `json:"volume"`
}

type HistoricalPricesResponse

type HistoricalPricesResponse struct {
	Result []HistoricalPrice `json:"result"`
	// contains filtered or unexported fields
}

type LendingHistory

type LendingHistory struct {
	Coin string    `json:"coin"`
	Time time.Time `json:"time"`
	Rate float64   `json:"rate"`
	Size float64   `json:"size"`
}

type LendingInfo

type LendingInfo struct {
	Coin     string  `json:"coin"`
	Lendable float64 `json:"lendable"`
	Locked   float64 `json:"locked"`
	MinRate  float64 `json:"minRate"`
	Offered  float64 `json:"offered"`
}

type LendingOffer

type LendingOffer struct {
	Coin string  `json:"coin"`
	Rate float64 `json:"rate"`
	Size float64 `json:"size"`
}

type LendingRate

type LendingRate struct {
	Coin     string  `json:"coin"`
	Estimate float64 `json:"estimate"`
	Previous float64 `json:"previous"`
}

type LeverageParams

type LeverageParams struct {
	Leverage float64 `json:"leverage"`
}

type LeveragedToken

type LeveragedToken struct {
	Name              string            `json:"name"`
	Description       string            `json:"description"`
	Underlying        string            `json:"underlying"`
	Leverage          int               `json:"leverage"`
	Outstanding       float64           `json:"outstanding"`
	PricePerShare     float64           `json:"pricePerShare"`
	PositionPerShare  float64           `json:"positionPerShare"`
	PositionsPerShare PositionsPerShare `json:"positionsPerShare"`
	Basket            Basket            `json:"basket"`
	TargetComponents  []string          `json:"targetComponents"`
	UnderlyingMark    float64           `json:"underlyingMark"`
	TotalNav          float64           `json:"totalNav"`
	TotalCollateral   float64           `json:"totalCollateral"`
	ContractAddress   string            `json:"contractAddress"`
	CurrentLeverage   float64           `json:"currentLeverage"`
	Change1H          float64           `json:"change1h"`
	Change24H         float64           `json:"change24h"`
	ChangeBod         float64           `json:"changeBod"`
}

type LeveragedTokenBalance

type LeveragedTokenBalance struct {
	Token   string  `json:"token"`
	Balance float64 `json:"balance"`
}

type LeveragedTokenCreationRequest

type LeveragedTokenCreationRequest struct {
	ID            int64     `json:"id"`
	Token         string    `json:"token"`
	RequestedSize float64   `json:"requestedSize"`
	Pending       bool      `json:"pending"`
	CreatedSize   float64   `json:"createdSize"`
	Price         float64   `json:"price"`
	Cost          float64   `json:"cost"`
	Fee           float64   `json:"fee"`
	RequestedAt   time.Time `json:"requestedAt"`
	FulfilledAt   time.Time `json:"fulfilledAt"`
}

type LeveragedTokenRedemptionRequest

type LeveragedTokenRedemptionRequest struct {
	ID          int64     `json:"id"`
	Token       string    `json:"token"`
	Size        float64   `json:"size"`
	Pending     bool      `json:"pending"`
	Price       float64   `json:"price"`
	Proceeds    float64   `json:"proceeds"`
	Fee         float64   `json:"fee"`
	RequestedAt time.Time `json:"requestedAt"`
	FulfilledAt time.Time `json:"fulfilledAt"`
}

type ListFutureResponse

type ListFutureResponse struct {
	Result []Future `json:"result"`
	// contains filtered or unexported fields
}

type ListLeveragedTokenCreationRequestsResponse

type ListLeveragedTokenCreationRequestsResponse struct {
	Result []LeveragedTokenCreationRequest `json:"result"`
	// contains filtered or unexported fields
}

type ListLeveragedTokenCreationRequestsService

type ListLeveragedTokenCreationRequestsService struct {
	// contains filtered or unexported fields
}

func (*ListLeveragedTokenCreationRequestsService) Do

type ListLeveragedTokenRedemptionRequestsResponse

type ListLeveragedTokenRedemptionRequestsResponse struct {
	Result []LeveragedTokenCreationRequest `json:"result"`
	// contains filtered or unexported fields
}

type ListLeveragedTokenRedemptionRequestsService

type ListLeveragedTokenRedemptionRequestsService struct {
	// contains filtered or unexported fields
}

func (*ListLeveragedTokenRedemptionRequestsService) Do

type ListLeveragedTokensResponse

type ListLeveragedTokensResponse struct {
	Result []LeveragedToken `json:"result"`
	// contains filtered or unexported fields
}

type ListLeveragedTokensService

type ListLeveragedTokensService struct {
	// contains filtered or unexported fields
}

func (*ListLeveragedTokensService) Do

type ListQuoteRequestsResponse

type ListQuoteRequestsResponse struct {
	Result []QuoteRequest `json:"result"`
	// contains filtered or unexported fields
}

type ListQuoteRequestsService

type ListQuoteRequestsService struct {
	// contains filtered or unexported fields
}

func (*ListQuoteRequestsService) Do

type Market

type Market struct {
	Name                  string  `json:"name"`
	BaseCurrency          *string `json:"baseCurrency"`
	QuoteCurrency         *string `json:"quoteCurrency"`
	QuoteVolume24H        float64 `json:"quoteVolume24h"`
	Change1H              float64 `json:"change1h"`
	Change24H             float64 `json:"change24h"`
	ChangeBod             float64 `json:"changeBod"`
	HighLeverageFeeExempt bool    `json:"highLeverageFeeExempt"`
	MinProvideSize        float64 `json:"minProvideSize"`
	Type                  string  `json:"type"`
	Underlying            string  `json:"underlying"`
	Enabled               bool    `json:"enabled"`
	Ask                   float64 `json:"ask"`
	Bid                   float64 `json:"bid"`
	Last                  float64 `json:"last"`
	PostOnly              bool    `json:"postOnly"`
	Price                 float64 `json:"price"`
	PriceIncrement        float64 `json:"priceIncrement"`
	SizeIncrement         float64 `json:"sizeIncrement"`
	Restricted            bool    `json:"restricted"`
	VolumeUsd24H          float64 `json:"volumeUsd24h"`
}

type MarketsResponse

type MarketsResponse struct {
	Result []Market `json:"result"`
	// contains filtered or unexported fields
}

type ModifyOrderByClientIDParams

type ModifyOrderByClientIDParams struct {
	Price *float64 `json:"price,omitempty"`
	Size  *float64 `json:"size,omitempty"`
}

type ModifyOrderByClientIDResponse

type ModifyOrderByClientIDResponse struct {
	Result *Order `json:"result"`
	// contains filtered or unexported fields
}

type ModifyOrderByClientIDService

type ModifyOrderByClientIDService struct {
	// contains filtered or unexported fields
}

func (*ModifyOrderByClientIDService) ClientID

func (*ModifyOrderByClientIDService) Do

func (*ModifyOrderByClientIDService) Params

type ModifyOrderParams

type ModifyOrderParams struct {
	Price    *float64 `json:"price,omitempty"`
	Size     *float64 `json:"size,omitempty"`
	ClientID *string  `json:"clientID,omitempty"`
}

type ModifyOrderResponse

type ModifyOrderResponse struct {
	Result *Order `json:"result"`
	// contains filtered or unexported fields
}

type ModifyOrderService

type ModifyOrderService struct {
	// contains filtered or unexported fields
}

func (*ModifyOrderService) Do

func (s *ModifyOrderService) Do(ctx context.Context) (*Order, error)

func (*ModifyOrderService) OrderID

func (s *ModifyOrderService) OrderID(orderID int64) *ModifyOrderService

func (*ModifyOrderService) Params

type ModifyTriggerOrderParams

type ModifyTriggerOrderParams struct {
	Size         float64  `json:"size"`
	TrailValue   *float64 `json:"trailValue,omitempty"`
	TriggerPrice *float64 `json:"triggerPrice,omitempty"`
	OrderPrice   *float64 `json:"orderPrice,omitempty"`
}

type ModifyTriggerOrderResponse

type ModifyTriggerOrderResponse struct {
	Result *TriggerOrder `json:"result"`
	// contains filtered or unexported fields
}

type ModifyTriggerOrderService

type ModifyTriggerOrderService struct {
	// contains filtered or unexported fields
}

func (*ModifyTriggerOrderService) Do

func (*ModifyTriggerOrderService) OrderID

func (*ModifyTriggerOrderService) Params

type OpenTriggerOrdersResponse

type OpenTriggerOrdersResponse struct {
	Result []Order `json:"result"`
	// contains filtered or unexported fields
}

type Option

type Option struct {
	Underlying string     `json:"underlying"`
	Type       OptionType `json:"type"`
	Strike     float64    `json:"strike"`
	Expiry     time.Time  `json:"expiry"`
}

type OptionFill

type OptionFill struct {
	Fee       float64   `json:"fee"`
	FeeRate   float64   `json:"feeRate"`
	ID        int64     `json:"id"`
	Liquidity string    `json:"liquidity"`
	Option    Option    `json:"option"`
	Price     float64   `json:"price"`
	QuoteID   float64   `json:"quoteId"`
	Side      string    `json:"side"`
	Size      float64   `json:"size"`
	Time      time.Time `json:"time"`
}

type OptionOpenInterest

type OptionOpenInterest struct {
	OpenInterest float64 `json:"openInterest"`
}

type OptionPosition

type OptionPosition struct {
	EntryPrice            float64  `json:"entryPrice"`
	NetSize               float64  `json:"netSize"`
	Option                Option   `json:"option"`
	Side                  Side     `json:"side"`
	Size                  float64  `json:"size"`
	PessimisticValuation  *float64 `json:"pessimisticValuation"`
	PessimisticIndexPrice *float64 `json:"pessimisticIndexPrice"`
	PessimisticVol        *float64 `json:"pessimisticVol"`
}

type OptionQuote

type OptionQuote struct {
	Collateral  float64           `json:"collateral"`
	ID          int64             `json:"id"`
	Option      Option            `json:"option"`
	Price       float64           `json:"price"`
	QuoteExpiry *string           `json:"quoteExpiry"`
	QuoterSide  Side              `json:"quoterSide"`
	RequestID   int64             `json:"requestId"`
	RequestSide Side              `json:"requestSide"`
	Size        float64           `json:"size"`
	Status      OptionQuoteStatus `json:"status"`
	Time        time.Time         `json:"time"`
}

type OptionQuoteStatus

type OptionQuoteStatus string
const (
	OptionQuoteStatusOpen      OptionQuoteStatus = "open"
	OptionQuoteStatusFilled    OptionQuoteStatus = "filled"
	OptionQuoteStatusCancelled OptionQuoteStatus = "cancelled"
)

type OptionType

type OptionType string

type OptionVolume24H

type OptionVolume24H struct {
	Contracts       float64 `json:"contracts"`
	UnderlyingTotal float64 `json:"underlying_total"`
}

type Order

type Order struct {
	CreatedAt     time.Time   `json:"createdAt"`
	FilledSize    float64     `json:"filledSize"`
	Future        string      `json:"future"`
	ID            int64       `json:"id"`
	Market        string      `json:"market"`
	Price         float64     `json:"price"`
	AvgFillPrice  float64     `json:"avgFillPrice"`
	RemainingSize float64     `json:"remainingSize"`
	Side          Side        `json:"side"`
	Size          float64     `json:"size"`
	Status        OrderStatus `json:"status"`
	Type          OrderType   `json:"type"`
	ReduceOnly    bool        `json:"reduceOnly"`
	Ioc           bool        `json:"ioc"`
	PostOnly      bool        `json:"postOnly"`
	ClientID      *string     `json:"clientId"`
}

type OrderBook

type OrderBook struct {
	Asks []Feed `json:"asks"`
	Bids []Feed `json:"bids"`
}

type OrderBookResponse

type OrderBookResponse struct {
	Result OrderBook `json:"result"`
	// contains filtered or unexported fields
}

type OrderBy

type OrderBy string
const (
	OrderByASC  OrderBy = "asc"
	OrderByDESC OrderBy = "desc"
)

type OrderHistoryResponse

type OrderHistoryResponse struct {
	Result      []Order `json:"result"`
	HasMoreData bool    `json:"hasMoreData"`
	// contains filtered or unexported fields
}

type OrderStatus

type OrderStatus string
const (
	OrderStatusNew       OrderStatus = "new"
	OrderStatusOpen      OrderStatus = "open"
	OrderStatusFilled    OrderStatus = "filled"
	OrderStatusCancelled OrderStatus = "cancelled"
	OrderStatusClosed    OrderStatus = "closed"
	OrderStatusTriggered OrderStatus = "triggered"
)

type OrderTrigger

type OrderTrigger struct {
	Error      error     `json:"error"`
	FilledSize *float64  `json:"filledSize"`
	OrderSize  *float64  `json:"orderSize"`
	OrderID    *int64    `json:"orderId"`
	Time       time.Time `json:"time"`
}

type OrderType

type OrderType string
const (
	OrderTypeLimit  OrderType = "limit"
	OrderTypeMarket OrderType = "market"
)

type OrdersResponse

type OrdersResponse struct {
	Result []Order `json:"result"`
	// contains filtered or unexported fields
}

type PlaceOrderParams

type PlaceOrderParams struct {
	Market string    `json:"market"`
	Side   Side      `json:"side"`
	Price  float64   `json:"price"`
	Type   OrderType `json:"type"`
	Size   float64   `json:"size"`
	//https://help.ftx.com/hc/en-us/articles/360030802012
	//Reduce-only orders will only reduce your overall position. They will never increase your position size or open a position in the opposite direction
	ReduceOnly *bool `json:"reduceOnly,omitempty"`
	//Immediate or cancel orders are guaranteed to be the taker order when executed. If you send an IOC order that does not immediately trade, it will be cancelled
	Ioc *bool `json:"ioc,omitempty"`
	//Post only orders are guaranteed to be the maker order when executed. If a post only order would instead cross the book and take, it will be cancelled
	PostOnly *bool `json:"postOnly,omitempty"`
	//client order id
	ClientID *string `json:"clientId,omitempty"`

	RejectOnPriceBand *bool  `json:"rejectOnPriceBand,omitempty"`
	RejectAfterTs     *int64 `json:"rejectAfterTs,omitempty"`
}

type PlaceOrderResponse

type PlaceOrderResponse struct {
	Result *Order `json:"result"`
	// contains filtered or unexported fields
}

type PlaceOrderService

type PlaceOrderService struct {
	// contains filtered or unexported fields
}

func (*PlaceOrderService) Do

func (s *PlaceOrderService) Do(ctx context.Context) (*Order, error)

func (*PlaceOrderService) Params

type PlaceTriggerOrderParams

type PlaceTriggerOrderParams struct {
	Market           string      `json:"market"`
	Side             Side        `json:"side"`
	Size             float64     `json:"size"`
	Type             TriggerType `json:"type"`
	TrailValue       *float64    `json:"trailValue,omitempty"`
	TriggerPrice     *float64    `json:"triggerPrice,omitempty"`
	OrderPrice       *float64    `json:"orderPrice,omitempty"`
	ReduceOnly       *bool       `json:"reduceOnly,omitempty"`
	RetryUntilFilled *bool       `json:"retryUntilFilled,omitempty"`
}

type PlaceTriggerOrderResponse

type PlaceTriggerOrderResponse struct {
	Result *TriggerOrder `json:"result"`
	// contains filtered or unexported fields
}

type PlaceTriggerOrderService

type PlaceTriggerOrderService struct {
	// contains filtered or unexported fields
}

func (*PlaceTriggerOrderService) Do

func (*PlaceTriggerOrderService) Params

type Position

type Position struct {
	Cost                         float64 `json:"cost"`
	CumulativeBuySize            float64 `json:"cumulativeBuySize"`
	CumulativeSellSize           float64 `json:"cumulativeSellSize"`
	EntryPrice                   float64 `json:"entryPrice"`
	EstimatedLiquidationPrice    float64 `json:"estimatedLiquidationPrice"`
	Future                       string  `json:"future"`
	InitialMarginRequirement     float64 `json:"initialMarginRequirement"`
	LongOrderSize                float64 `json:"longOrderSize"`
	MaintenanceMarginRequirement float64 `json:"maintenanceMarginRequirement"`
	NetSize                      float64 `json:"netSize"`
	OpenSize                     float64 `json:"openSize"`
	RealizedPnl                  float64 `json:"realizedPnl"`
	RecentAverageOpenPrice       float64 `json:"recentAverageOpenPrice"`
	RecentBreakEvenPrice         float64 `json:"recentBreakEvenPrice"`
	RecentPnl                    float64 `json:"recentPnl"`
	ShortOrderSize               float64 `json:"shortOrderSize"`
	Side                         string  `json:"side"`
	Size                         float64 `json:"size"`
	UnrealizedPnl                int     `json:"unrealizedPnl"`
	CollateralUsed               float64 `json:"collateralUsed"`
}

type PositionsPerShare

type PositionsPerShare map[string]float64

type PositionsResponse

type PositionsResponse struct {
	Result []Position `json:"result"`
	// contains filtered or unexported fields
}

type PublicOptionTrade

type PublicOptionTrade struct {
	ID     float64   `json:"id"`
	Option Option    `json:"option"`
	Price  float64   `json:"price"`
	Size   float64   `json:"size"`
	Time   time.Time `json:"time"`
}

type QuoteRequest

type QuoteRequest struct {
	ID            int64             `json:"id"`
	Option        Option            `json:"option"`
	Side          Side              `json:"side"`
	Size          float64           `json:"size"`
	Time          time.Time         `json:"time"`
	RequestExpiry time.Time         `json:"requestExpiry"`
	Status        OptionQuoteStatus `json:"status"`
	LimitPrice    *float64          `json:"limitPrice"`
}

type QuotesForYourQuoteRequest

type QuotesForYourQuoteRequest struct {
	Collateral  float64           `json:"collateral"`
	ID          int64             `json:"id"` // quote id
	Option      Option            `json:"option"`
	Price       float64           `json:"price"`
	QuoteExpiry *string           `json:"quoteExpiry"`
	QuoterSide  Side              `json:"quoterSide"`
	RequestID   int64             `json:"requestId"` // quote request id
	RequestSide Side              `json:"requestSide"`
	Size        float64           `json:"size"`
	Status      OptionQuoteStatus `json:"status"`
	Time        time.Time         `json:"time"`
}

type RequestETFRebalanceInfoResponse

type RequestETFRebalanceInfoResponse struct {
	Result map[string]ETFRebalanceInfo `json:"result"`
	// contains filtered or unexported fields
}

type RequestETFRebalanceInfoService

type RequestETFRebalanceInfoService struct {
	// contains filtered or unexported fields
}

func (*RequestETFRebalanceInfoService) Do

type RequestLeveragedTokenCreation

type RequestLeveragedTokenCreation struct {
	ID            int64     `json:"id"`
	Token         string    `json:"token"`
	RequestedSize float64   `json:"requestedSize"`
	Cost          float64   `json:"cost"`
	Pending       bool      `json:"pending"`
	RequestedAt   time.Time `json:"requestedAt"`
}

type RequestLeveragedTokenCreationParams

type RequestLeveragedTokenCreationParams struct {
	Size string `json:"size"`
}

type RequestLeveragedTokenCreationResponse

type RequestLeveragedTokenCreationResponse struct {
	Result *RequestLeveragedTokenCreation `json:"result"`
	// contains filtered or unexported fields
}

type RequestLeveragedTokenCreationService

type RequestLeveragedTokenCreationService struct {
	// contains filtered or unexported fields
}

func (*RequestLeveragedTokenCreationService) Do

func (*RequestLeveragedTokenCreationService) Params

type RequestLeveragedTokenRedemption

type RequestLeveragedTokenRedemption struct {
	ID            int64     `json:"id"`
	Token         string    `json:"token"`
	RequestedSize float64   `json:"requestedSize"`
	Cost          float64   `json:"cost"`
	Pending       bool      `json:"pending"`
	RequestedAt   time.Time `json:"requestedAt"`
}

type RequestLeveragedTokenRedemptionParams

type RequestLeveragedTokenRedemptionParams struct {
	Size string `json:"size"`
}

type RequestLeveragedTokenRedemptionResponse

type RequestLeveragedTokenRedemptionResponse struct {
	Result *RequestLeveragedTokenRedemption `json:"result"`
	// contains filtered or unexported fields
}

type RequestLeveragedTokenRedemptionService

type RequestLeveragedTokenRedemptionService struct {
	// contains filtered or unexported fields
}

func (*RequestLeveragedTokenRedemptionService) Do

type RequestMsg

type RequestMsg struct {
	OP       string                 `json:"op"`
	Channel  *string                `json:"channel,omitempty"`
	Market   *string                `json:"market,omitempty"`
	Grouping *int64                 `json:"grouping,omitempty"`
	Args     map[string]interface{} `json:"args,omitempty"`
}

type SaveAddress

type SaveAddress struct {
	Address          string     `json:"address"`
	Coin             string     `json:"coin"`
	Fiat             bool       `json:"fiat"`
	ID               int64      `json:"id"`
	IsPrimetrust     bool       `json:"isPrimetrust"`
	LastUsedAt       time.Time  `json:"lastUsedAt"`
	Name             string     `json:"name"`
	Tag              *string    `json:"tag"`
	Whitelisted      *bool      `json:"whitelisted"`
	WhitelistedAfter *time.Time `json:"whitelistedAfter"`
}

type SaveAddressesResponse

type SaveAddressesResponse struct {
	Result []SaveAddress `json:"result"`
	// contains filtered or unexported fields
}

type Side

type Side string
const (
	SideBuy  Side = "buy"
	SideSell Side = "sell"
)

type SingleMarketResponse

type SingleMarketResponse struct {
	Result *Market `json:"result"`
	// contains filtered or unexported fields
}

type SubAccount

type SubAccount struct {
	Nickname    string `json:"nickname"`
	Deletable   bool   `json:"deletable"`
	Editable    bool   `json:"editable"`
	Competition *bool  `json:"competition,omitempty"`
}

type SubmitLendingOfferParams

type SubmitLendingOfferParams struct {
	Coin string  `json:"coin"`
	Size float64 `json:"size"`
	Rate float64 `json:"rate"`
}

type SubmitLendingOfferResponse

type SubmitLendingOfferResponse struct {
	Result interface{} `json:"result"`
	// contains filtered or unexported fields
}

type SubmitLendingOfferService

type SubmitLendingOfferService struct {
	// contains filtered or unexported fields
}

func (*SubmitLendingOfferService) Do

func (s *SubmitLendingOfferService) Do(ctx context.Context) (interface{}, error)

func (*SubmitLendingOfferService) Params

type Subscription

type Subscription struct {
	Channel  WsChannel
	Market   *string
	Grouping *int64
}

type Trade

type Trade struct {
	ID          int       `json:"id"`
	Liquidation bool      `json:"liquidation"`
	Price       float64   `json:"price"`
	Side        string    `json:"side"`
	Size        float64   `json:"size"`
	Time        time.Time `json:"time"`
}

type TradesResponse

type TradesResponse struct {
	Result []Trade `json:"result"`
	// contains filtered or unexported fields
}

type TransferBetweenSubAccounts

type TransferBetweenSubAccounts struct {
	ID     int64     `json:"id"`
	Coin   string    `json:"coin"`
	Size   float64   `json:"size"`
	Time   time.Time `json:"time"`
	Notes  string    `json:"notes"`
	Status string    `json:"status"`
}

type TransferBetweenSubAccountsParams

type TransferBetweenSubAccountsParams struct {
	Coin        string  `json:"coin"`
	Size        float64 `json:"size"`
	Source      *string `json:"source"`      // nil or "main" for main account
	Destination *string `json:"destination"` // nil or "main" for main account
}

type TransferBetweenSubAccountsResponse

type TransferBetweenSubAccountsResponse struct {
	Result *TransferBetweenSubAccounts `json:"result"`
	// contains filtered or unexported fields
}

type TransferBetweenSubAccountsService

type TransferBetweenSubAccountsService struct {
	// contains filtered or unexported fields
}

func (*TransferBetweenSubAccountsService) Do

func (*TransferBetweenSubAccountsService) Params

type TriggerOrder

type TriggerOrder struct {
	CreatedAt        time.Time   `json:"createdAt"`
	Future           string      `json:"future"`
	ID               int         `json:"id"`
	Market           string      `json:"market"`
	OrderPrice       *float64    `json:"orderPrice"`
	ReduceOnly       bool        `json:"reduceOnly"`
	Side             Side        `json:"side"`
	Size             float64     `json:"size"`
	Status           OrderStatus `json:"status"`
	TrailStart       *float64    `json:"trailStart"`
	TrailValue       *float64    `json:"trailValue"`
	TriggerPrice     float64     `json:"triggerPrice"`
	TriggeredAt      *string     `json:"triggeredAt"`
	Type             TriggerType `json:"type"`
	OrderType        OrderType   `json:"orderType"`
	FilledSize       float64     `json:"filledSize"`
	AvgFillPrice     *float64    `json:"avgFillPrice"`
	RetryUntilFilled bool        `json:"retryUntilFilled"`
}

type TriggerOrderHistoryResponse

type TriggerOrderHistoryResponse struct {
	Result      []TriggerOrder `json:"result"`
	HasMoreData bool           `json:"hasMoreData"`
	// contains filtered or unexported fields
}

type TriggerOrderTriggersResponse

type TriggerOrderTriggersResponse struct {
	Result []OrderTrigger `json:"result"`
	// contains filtered or unexported fields
}

type TriggerType

type TriggerType string
const (
	TriggerTypeStop         TriggerType = "stop"
	TriggerTypeTrailingStop TriggerType = "trailing_stop"
	TriggerTypeTakeProfit   TriggerType = "take_profit"
)

type UserLendingHistory

type UserLendingHistory struct {
	Coin     string    `json:"coin"`
	Proceeds float64   `json:"proceeds"`
	Rate     float64   `json:"rate"`
	Size     float64   `json:"size"`
	Time     time.Time `json:"time"`
}

type WebsocketService

type WebsocketService struct {
	// contains filtered or unexported fields
}

func NewWebsocketService

func NewWebsocketService(apiKey, apiSecret, wsEndpoint string, l *zap.SugaredLogger) *WebsocketService

func (*WebsocketService) AutoReconnect

func (s *WebsocketService) AutoReconnect() *WebsocketService

func (*WebsocketService) Close

func (s *WebsocketService) Close()

func (*WebsocketService) Connect

func (s *WebsocketService) Connect(dataHandler WsDataHandler, errHandler WsErrorHandler) error

func (*WebsocketService) ResetConnection

func (s *WebsocketService) ResetConnection()

func (*WebsocketService) SubAccount

func (s *WebsocketService) SubAccount(sa string) *WebsocketService

func (*WebsocketService) Subscribe

func (s *WebsocketService) Subscribe(sub Subscription) error

func (*WebsocketService) Unsubscribe

func (s *WebsocketService) Unsubscribe(sub Subscription) error

type Withdraw

type Withdraw struct {
	Coin    string    `json:"coin"`
	Address string    `json:"address"`
	Tag     *string   `json:"tag"`
	Fee     float64   `json:"fee"`
	ID      int64     `json:"id"`
	Size    float64   `json:"size"`
	Status  string    `json:"status"`
	Time    time.Time `json:"time"`
	Txid    string    `json:"txid"`
}

type WithdrawHistoryResponse

type WithdrawHistoryResponse struct {
	Result []Withdraw `json:"result"`
	// contains filtered or unexported fields
}

type WithdrawParams

type WithdrawParams struct {
	Coin     string  `json:"coin"`
	Size     float64 `json:"size"`
	Address  string  `json:"address"`
	Tag      *string `json:"tag,omitempty"`
	Method   *string `json:"method,omitempty"`
	Password *string `json:"password,omitempty"`
	Code     *string `json:"code,omitempty"`
}

type WithdrawResponse

type WithdrawResponse struct {
	Result *Withdraw `json:"result"`
	// contains filtered or unexported fields
}

type WithdrawService

type WithdrawService struct {
	// contains filtered or unexported fields
}

func (*WithdrawService) Do

func (s *WithdrawService) Do(ctx context.Context) (*Withdraw, error)

func (*WithdrawService) Params

func (s *WithdrawService) Params(params WithdrawParams) *WithdrawService

type WithdrawalFee

type WithdrawalFee struct {
	Method    string  `json:"method"`
	Address   string  `json:"address"`
	Fee       float64 `json:"fee"`
	Congested bool    `json:"congested"`
}

type WithdrawalFeesResponse

type WithdrawalFeesResponse struct {
	Result *WithdrawalFee `json:"result"`
	// contains filtered or unexported fields
}

type WsChannel

type WsChannel string
const (
	// public channels
	WsChannelTicker           WsChannel = "ticker"
	WsChannelMarkets          WsChannel = "markets"
	WsChannelTrades           WsChannel = "trades"
	WsChannelOrderBook        WsChannel = "orderbook"
	WsChannelOrderbookGrouped WsChannel = "orderbookGrouped"

	// private channels
	WsChannelFills  WsChannel = "fills"
	WsChannelOrders WsChannel = "orders"
	WsChannelFTXPay WsChannel = "ftxpay"
)

type WsDataAction

type WsDataAction string
const (
	PartialWsDataAction WsDataAction = "partial"
	UpdateWsDataAction  WsDataAction = "update"
)

type WsDataHandler

type WsDataHandler func(res WsReponse)

type WsErrorHandler

type WsErrorHandler func(err error)

type WsFTXPay

type WsFTXPay struct {
	App     string `json:"app"`
	Payment string `json:"payment"`
	Status  string `json:"status"`
}

type WsFTXPayEvent

type WsFTXPayEvent struct {
	Data WsFTXPay `json:"data"`
	// contains filtered or unexported fields
}

type WsFills

type WsFills struct {
	BaseCurrency  *string   `json:"baseCurrency"`
	Fee           float64   `json:"fee"`
	FeeCurrency   string    `json:"feeCurrency"`
	FeeRate       float64   `json:"feeRate"`
	Future        *string   `json:"future"`
	ID            int64     `json:"id"`
	Liquidity     string    `json:"liquidity"`
	Market        string    `json:"market"`
	OrderID       int64     `json:"orderId"`
	Price         float64   `json:"price"`
	QuoteCurrency string    `json:"quoteCurrency"`
	Side          Side      `json:"side"`
	Size          float64   `json:"size"`
	Time          time.Time `json:"time"`
	TradeID       int64     `json:"tradeId"`
	Type          string    `json:"type"`
}

type WsFillsEvent

type WsFillsEvent struct {
	Data WsFills `json:"data"`
	// contains filtered or unexported fields
}

type WsFuture

type WsFuture struct {
	Description           string      `json:"description"`
	Enabled               bool        `json:"enabled"`
	Expired               bool        `json:"expired"`
	Expiry                *time.Time  `json:"expiry"`
	ExpiryDescription     string      `json:"expiryDescription"`
	Group                 string      `json:"group"`
	ImfFactor             float64     `json:"imfFactor"`
	MoveStart             interface{} `json:"moveStart"`
	Name                  string      `json:"name"`
	Perpetual             bool        `json:"perpetual"`
	PositionLimitWeight   int         `json:"positionLimitWeight"`
	PostOnly              bool        `json:"postOnly"`
	Type                  string      `json:"type"`
	Underlying            string      `json:"underlying"`
	UnderlyingDescription string      `json:"underlyingDescription"`
}

type WsGroupedOrderBook

type WsGroupedOrderBook struct {
	Asks []Feed `json:"asks"`
	Bids []Feed `json:"bids"`
}

type WsGroupedOrderBookEvent

type WsGroupedOrderBookEvent struct {
	Grouping float64            `json:"grouping"`
	Data     WsGroupedOrderBook `json:"data"`
	// contains filtered or unexported fields
}

type WsMarket

type WsMarket struct {
	BaseCurrency          *string   `json:"baseCurrency"`
	QuoteCurrency         *string   `json:"quoteCurrency"`
	Enabled               bool      `json:"enabled"`
	Future                *WsFuture `json:"future"`
	HighLeverageFeeExempt bool      `json:"highLeverageFeeExempt"`
	Name                  string    `json:"name"`
	PostOnly              bool      `json:"postOnly"`
	PriceIncrement        float64   `json:"priceIncrement"`
	Restricted            bool      `json:"restricted"`
	SizeIncrement         float64   `json:"sizeIncrement"`
	Type                  string    `json:"type"`
	Underlying            *string   `json:"underlying"`
}

type WsMarketsData

type WsMarketsData struct {
	Action WsDataAction `json:"action"`
	Data   map[string]WsMarket
}

type WsMarketsEvent

type WsMarketsEvent struct {
	Data WsMarketsData `json:"data"`
	// contains filtered or unexported fields
}

type WsOrderBook

type WsOrderBook struct {
	Action   WsDataAction `json:"action"`
	Asks     []Feed       `json:"asks"`
	Bids     []Feed       `json:"bids"`
	Checksum int64        `json:"checksum"`
	Time     float64      `json:"time"`
}

type WsOrderBookEvent

type WsOrderBookEvent struct {
	Data WsOrderBook `json:"data"`
	// contains filtered or unexported fields
}

type WsOrders

type WsOrders struct {
	AvgFillPrice  float64     `json:"avgFillPrice"`
	ClientID      *string     `json:"clientId"`
	CreatedAt     time.Time   `json:"createdAt"`
	FilledSize    float64     `json:"filledSize"`
	ID            int64       `json:"id"`
	Ioc           bool        `json:"ioc"`
	Liquidation   bool        `json:"liquidation"`
	Market        string      `json:"market"`
	PostOnly      bool        `json:"postOnly"`
	Price         float64     `json:"price"`
	ReduceOnly    bool        `json:"reduceOnly"`
	RemainingSize float64     `json:"remainingSize"`
	Side          Side        `json:"side"`
	Size          float64     `json:"size"`
	Status        OrderStatus `json:"status"`
	Type          OrderType   `json:"type"`
}

type WsOrdersEvent

type WsOrdersEvent struct {
	Data WsOrders `json:"data"`
	// contains filtered or unexported fields
}

type WsReponse

type WsReponse struct {
	OrderBookEvent        *WsOrderBookEvent
	GroupedOrderBookEvent *WsGroupedOrderBookEvent
	Ticker                *WsTickerEvent
	Markets               *WsMarketsEvent
	Trades                *WsTradesEvent
	Fills                 *WsFillsEvent
	Orders                *WsOrdersEvent
	FTXPay                *WsFTXPayEvent
}

type WsTicker

type WsTicker struct {
	Ask     *float64 `json:"ask"`
	AskSize *float64 `json:"askSize"`
	Bid     *float64 `json:"bid"`
	BidSize *float64 `json:"bidSize"`
	Last    *float64 `json:"last"`
	Time    float64  `json:"time"`
}

type WsTickerEvent

type WsTickerEvent struct {
	Data WsTicker `json:"data"`
	// contains filtered or unexported fields
}

type WsTrade

type WsTrade struct {
	Price       float64   `json:"price"`
	Size        float64   `json:"size"`
	Side        Side      `json:"side"`
	Liquidation bool      `json:"liquidation"`
	Time        time.Time `json:"time"`
}

type WsTradesEvent

type WsTradesEvent struct {
	Data []WsTrade `json:"data"`
	// contains filtered or unexported fields
}

type YourQuote

type YourQuote struct {
	Collateral  float64           `json:"collateral"`
	ID          int64             `json:"id"`
	Price       float64           `json:"price"`
	QuoteExpiry *string           `json:"quoteExpiry"`
	Status      OptionQuoteStatus `json:"status"`
	Time        time.Time         `json:"time"`
}

type YourQuoteRequest

type YourQuoteRequest struct {
	ID             int64             `json:"id"`
	Option         Option            `json:"option"`
	Side           Side              `json:"side"`
	Size           float64           `json:"size"`
	Time           time.Time         `json:"time"`
	RequestExpiry  time.Time         `json:"requestExpiry"`
	Status         OptionQuoteStatus `json:"status"`
	HideLimitPrice bool              `json:"hideLimitPrice"`
	LimitPrice     float64           `json:"limitPrice"`
	Quotes         []YourQuote       `json:"quotes"`
}

type YourQuoteRequestsResponse

type YourQuoteRequestsResponse struct {
	Result []YourQuoteRequest `json:"result"`
	// contains filtered or unexported fields
}

type YourQuoteRequestsService

type YourQuoteRequestsService struct {
	// contains filtered or unexported fields
}

func (*YourQuoteRequestsService) Do

Source Files

Jump to

Keyboard shortcuts

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