Documentation ¶
Index ¶
- Constants
- Variables
- func Sign(payload string, secret string) string
- type APIResponse
- type Account
- type AssetBalance
- type AssetBalanceList
- type AssetCurrency
- type BalanceDetail
- type BatchCancelOrderRequest
- type BatchPlaceOrderRequest
- type CancelOrderRequest
- func (c *CancelOrderRequest) ClientOrderID(clientOrderID string) *CancelOrderRequest
- func (c *CancelOrderRequest) Do(ctx context.Context) ([]OrderResponse, error)
- func (c *CancelOrderRequest) GetParameters() (map[string]interface{}, error)
- func (c *CancelOrderRequest) GetParametersJSON() ([]byte, error)
- func (c *CancelOrderRequest) GetParametersQuery() (url.Values, error)
- func (c *CancelOrderRequest) GetPath() string
- func (c *CancelOrderRequest) GetQueryParameters() (url.Values, error)
- func (c *CancelOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (c *CancelOrderRequest) GetSlugsMap() (map[string]string, error)
- func (c *CancelOrderRequest) InstrumentID(instrumentID string) *CancelOrderRequest
- func (c *CancelOrderRequest) OrderID(orderID string) *CancelOrderRequest
- type FundingRate
- type GetAccountInfoRequest
- func (g *GetAccountInfoRequest) Do(ctx context.Context) ([]Account, error)
- func (g *GetAccountInfoRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetAccountInfoRequest) GetParametersJSON() ([]byte, error)
- func (g *GetAccountInfoRequest) GetParametersQuery() (url.Values, error)
- func (g *GetAccountInfoRequest) GetPath() string
- func (g *GetAccountInfoRequest) GetQueryParameters() (url.Values, error)
- func (g *GetAccountInfoRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetAccountInfoRequest) GetSlugsMap() (map[string]string, error)
- type GetCandlesRequest
- func (g *GetCandlesRequest) After(after time.Time) *GetCandlesRequest
- func (g *GetCandlesRequest) Bar(bar string) *GetCandlesRequest
- func (g *GetCandlesRequest) Before(before time.Time) *GetCandlesRequest
- func (g *GetCandlesRequest) Do(ctx context.Context) (KLineSlice, error)
- func (g *GetCandlesRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetCandlesRequest) GetParametersJSON() ([]byte, error)
- func (g *GetCandlesRequest) GetParametersQuery() (url.Values, error)
- func (g *GetCandlesRequest) GetPath() string
- func (g *GetCandlesRequest) GetQueryParameters() (url.Values, error)
- func (g *GetCandlesRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetCandlesRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetCandlesRequest) InstrumentID(instrumentID string) *GetCandlesRequest
- func (g *GetCandlesRequest) Limit(limit int) *GetCandlesRequest
- type GetFundingRateRequest
- type GetInstrumentsInfoRequest
- func (g *GetInstrumentsInfoRequest) Do(ctx context.Context) ([]InstrumentInfo, error)
- func (g *GetInstrumentsInfoRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetInstrumentsInfoRequest) GetParametersJSON() ([]byte, error)
- func (g *GetInstrumentsInfoRequest) GetParametersQuery() (url.Values, error)
- func (g *GetInstrumentsInfoRequest) GetPath() string
- func (g *GetInstrumentsInfoRequest) GetQueryParameters() (url.Values, error)
- func (g *GetInstrumentsInfoRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetInstrumentsInfoRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetInstrumentsInfoRequest) InstId(instId string) *GetInstrumentsInfoRequest
- func (g *GetInstrumentsInfoRequest) InstType(instType InstrumentType) *GetInstrumentsInfoRequest
- type GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) After(after string) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) Before(before string) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) Begin(begin time.Time) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) Category(category string) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) Do(ctx context.Context) ([]OpenOrder, error)
- func (g *GetOpenOrdersRequest) End(end time.Time) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetOpenOrdersRequest) GetParametersJSON() ([]byte, error)
- func (g *GetOpenOrdersRequest) GetParametersQuery() (url.Values, error)
- func (g *GetOpenOrdersRequest) GetPath() string
- func (g *GetOpenOrdersRequest) GetQueryParameters() (url.Values, error)
- func (g *GetOpenOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetOpenOrdersRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetOpenOrdersRequest) InstrumentID(instrumentID string) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) InstrumentType(instrumentType InstrumentType) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) Limit(limit string) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) OrderType(orderType OrderType) *GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) State(state OrderState) *GetOpenOrdersRequest
- type GetOrderDetailsRequest
- func (r *GetOrderDetailsRequest) ClientOrderID(clientOrderID string) *GetOrderDetailsRequest
- func (r *GetOrderDetailsRequest) Do(ctx context.Context) (*OrderDetails, error)
- func (r *GetOrderDetailsRequest) InstrumentID(instId string) *GetOrderDetailsRequest
- func (r *GetOrderDetailsRequest) OrderID(orderID string) *GetOrderDetailsRequest
- func (r *GetOrderDetailsRequest) QueryParameters() url.Values
- type GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) After(after string) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) Before(before string) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) Do(ctx context.Context) ([]OrderDetail, error)
- func (g *GetOrderHistoryRequest) EndTime(endTime time.Time) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetOrderHistoryRequest) GetParametersJSON() ([]byte, error)
- func (g *GetOrderHistoryRequest) GetParametersQuery() (url.Values, error)
- func (g *GetOrderHistoryRequest) GetPath() string
- func (g *GetOrderHistoryRequest) GetQueryParameters() (url.Values, error)
- func (g *GetOrderHistoryRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetOrderHistoryRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetOrderHistoryRequest) InstrumentFamily(instrumentFamily string) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) InstrumentID(instrumentID string) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) InstrumentType(instrumentType InstrumentType) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) Limit(limit uint64) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) OrderType(orderType OrderType) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) StartTime(startTime time.Time) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) State(state OrderState) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) Underlying(underlying string) *GetOrderHistoryRequest
- type GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) After(after string) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) Before(before string) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) Do(ctx context.Context) ([]Trade, error)
- func (g *GetThreeDaysTransactionHistoryRequest) EndTime(endTime time.Time) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetThreeDaysTransactionHistoryRequest) GetParametersJSON() ([]byte, error)
- func (g *GetThreeDaysTransactionHistoryRequest) GetParametersQuery() (url.Values, error)
- func (g *GetThreeDaysTransactionHistoryRequest) GetPath() string
- func (g *GetThreeDaysTransactionHistoryRequest) GetQueryParameters() (url.Values, error)
- func (g *GetThreeDaysTransactionHistoryRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetThreeDaysTransactionHistoryRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetThreeDaysTransactionHistoryRequest) InstrumentFamily(instrumentFamily string) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) InstrumentID(instrumentID string) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) InstrumentType(instrumentType InstrumentType) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) Limit(limit uint64) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) OrderID(orderID string) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) StartTime(startTime time.Time) *GetThreeDaysTransactionHistoryRequest
- func (g *GetThreeDaysTransactionHistoryRequest) Underlying(underlying string) *GetThreeDaysTransactionHistoryRequest
- type GetTickerRequest
- func (g *GetTickerRequest) Do(ctx context.Context) ([]MarketTicker, error)
- func (g *GetTickerRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetTickerRequest) GetParametersJSON() ([]byte, error)
- func (g *GetTickerRequest) GetParametersQuery() (url.Values, error)
- func (g *GetTickerRequest) GetPath() string
- func (g *GetTickerRequest) GetQueryParameters() (url.Values, error)
- func (g *GetTickerRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetTickerRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetTickerRequest) InstId(instId string) *GetTickerRequest
- type GetTickersRequest
- func (g *GetTickersRequest) Do(ctx context.Context) ([]MarketTicker, error)
- func (g *GetTickersRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetTickersRequest) GetParametersJSON() ([]byte, error)
- func (g *GetTickersRequest) GetParametersQuery() (url.Values, error)
- func (g *GetTickersRequest) GetPath() string
- func (g *GetTickersRequest) GetQueryParameters() (url.Values, error)
- func (g *GetTickersRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetTickersRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetTickersRequest) InstType(instType InstrumentType) *GetTickersRequest
- type GetTransactionDetailsRequest
- func (r *GetTransactionDetailsRequest) Do(ctx context.Context) ([]OrderDetails, error)
- func (r *GetTransactionDetailsRequest) InstrumentID(instId string) *GetTransactionDetailsRequest
- func (r *GetTransactionDetailsRequest) InstrumentType(instType InstrumentType) *GetTransactionDetailsRequest
- func (r *GetTransactionDetailsRequest) OrderID(orderID string) *GetTransactionDetailsRequest
- func (r *GetTransactionDetailsRequest) Parameters() map[string]interface{}
- type GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) After(after string) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) Before(before string) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) Do(ctx context.Context) ([]Trade, error)
- func (g *GetTransactionHistoryRequest) EndTime(endTime time.Time) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetTransactionHistoryRequest) GetParametersJSON() ([]byte, error)
- func (g *GetTransactionHistoryRequest) GetParametersQuery() (url.Values, error)
- func (g *GetTransactionHistoryRequest) GetPath() string
- func (g *GetTransactionHistoryRequest) GetQueryParameters() (url.Values, error)
- func (g *GetTransactionHistoryRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetTransactionHistoryRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetTransactionHistoryRequest) InstrumentFamily(instrumentFamily string) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) InstrumentID(instrumentID string) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) InstrumentType(instrumentType InstrumentType) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) Limit(limit uint64) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) OrderID(orderID string) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) StartTime(startTime time.Time) *GetTransactionHistoryRequest
- func (g *GetTransactionHistoryRequest) Underlying(underlying string) *GetTransactionHistoryRequest
- type InstrumentInfo
- type InstrumentType
- type KLine
- type KLineSlice
- type LiquidityType
- type MarketTicker
- type MarketTickerRequest
- type MarketTickersRequest
- type OpenOrder
- type OrderDetail
- type OrderDetails
- type OrderList
- type OrderResponse
- type OrderState
- type OrderType
- type PlaceOrderRequest
- func (r *PlaceOrderRequest) ClientOrderID(clientOrderID string) *PlaceOrderRequest
- func (r *PlaceOrderRequest) Do(ctx context.Context) ([]OrderResponse, error)
- func (r *PlaceOrderRequest) GetParameters() (map[string]interface{}, error)
- func (r *PlaceOrderRequest) GetParametersJSON() ([]byte, error)
- func (r *PlaceOrderRequest) GetParametersQuery() (url.Values, error)
- func (r *PlaceOrderRequest) GetPath() string
- func (r *PlaceOrderRequest) GetQueryParameters() (url.Values, error)
- func (r *PlaceOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (r *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)
- func (r *PlaceOrderRequest) InstrumentID(instrumentID string) *PlaceOrderRequest
- func (r *PlaceOrderRequest) OrderType(orderType OrderType) *PlaceOrderRequest
- func (r *PlaceOrderRequest) Parameters() map[string]interface{}
- func (r *PlaceOrderRequest) Price(price string) *PlaceOrderRequest
- func (r *PlaceOrderRequest) Side(side SideType) *PlaceOrderRequest
- func (r *PlaceOrderRequest) Size(size string) *PlaceOrderRequest
- func (r *PlaceOrderRequest) Tag(tag string) *PlaceOrderRequest
- func (r *PlaceOrderRequest) TargetCurrency(targetCurrency TargetCurrency) *PlaceOrderRequest
- func (r *PlaceOrderRequest) TradeMode(tradeMode TradeMode) *PlaceOrderRequest
- type RestClient
- func (c *RestClient) AssetBalances(ctx context.Context) (AssetBalanceList, error)
- func (c *RestClient) AssetCurrencies(ctx context.Context) ([]AssetCurrency, error)
- func (c *RestClient) Auth(key, secret, passphrase string)
- func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, ...) (*http.Request, error)
- func (c *RestClient) NewBatchCancelOrderRequest() *BatchCancelOrderRequest
- func (c *RestClient) NewBatchPlaceOrderRequest() *BatchPlaceOrderRequest
- func (c *RestClient) NewCancelOrderRequest() *CancelOrderRequest
- func (c *RestClient) NewGetAccountInfoRequest() *GetAccountInfoRequest
- func (c *RestClient) NewGetCandlesRequest() *GetCandlesRequest
- func (s *RestClient) NewGetFundingRate() *GetFundingRateRequest
- func (c *RestClient) NewGetInstrumentsInfoRequest() *GetInstrumentsInfoRequest
- func (c *RestClient) NewGetOpenOrdersRequest() *GetOpenOrdersRequest
- func (c *RestClient) NewGetOrderDetailsRequest() *GetOrderDetailsRequest
- func (c *RestClient) NewGetOrderHistoryRequest() *GetOrderHistoryRequest
- func (c *RestClient) NewGetThreeDaysTransactionHistoryRequest() *GetThreeDaysTransactionHistoryRequest
- func (c *RestClient) NewGetTickerRequest() *GetTickerRequest
- func (c *RestClient) NewGetTickersRequest() *GetTickersRequest
- func (c *RestClient) NewGetTransactionDetailsRequest() *GetTransactionDetailsRequest
- func (c *RestClient) NewGetTransactionHistoryRequest() *GetTransactionHistoryRequest
- func (c *RestClient) NewMarketTickerRequest(instId string) *MarketTickerRequest
- func (c *RestClient) NewMarketTickersRequest(instType string) *MarketTickersRequest
- func (c *RestClient) NewPlaceOrderRequest() *PlaceOrderRequest
- type SideType
- type TargetCurrency
- type Trade
- type TradeMode
Constants ¶
const ( LiquidityTypeMaker = "M" LiquidityTypeTaker = "T" )
const PrivateWebSocketURL = "wss://wsaws.okx.com:8443/ws/v5/private"
const PublicBusinessWebSocketURL = "wss://wsaws.okx.com:8443/ws/v5/business"
const PublicWebSocketURL = "wss://wsaws.okx.com:8443/ws/v5/public"
const RestBaseURL = "https://aws.okx.com/"
Variables ¶
var GetThreeDaysTransactionHistoryRequestLimiter = rate.NewLimiter(30.000000300000004, 1)
var GetTransactionHistoryRequestLimiter = rate.NewLimiter(5, 1)
Functions ¶
Types ¶
type APIResponse ¶ added in v1.52.0
type APIResponse struct { Code string `json:"code"` Message string `json:"msg"` Data json.RawMessage `json:"data"` }
func (APIResponse) Error ¶ added in v1.57.0
func (a APIResponse) Error() error
func (APIResponse) Validate ¶ added in v1.57.0
func (a APIResponse) Validate() error
type Account ¶
type Account struct { TotalEquityInUSD fixedpoint.Value `json:"totalEq"` UpdateTime types.MillisecondTimestamp `json:"uTime"` Details []BalanceDetail `json:"details"` }
type AssetBalance ¶
type AssetBalance struct { Currency string `json:"ccy"` Balance fixedpoint.Value `json:"bal"` Frozen fixedpoint.Value `json:"frozenBal,omitempty"` Available fixedpoint.Value `json:"availBal,omitempty"` }
type AssetBalanceList ¶
type AssetBalanceList []AssetBalance
type AssetCurrency ¶
type AssetCurrency struct { Currency string `json:"ccy"` Name string `json:"name"` Chain string `json:"chain"` CanDeposit bool `json:"canDep"` CanWithdraw bool `json:"canWd"` CanInternal bool `json:"canInternal"` MinWithdrawalFee fixedpoint.Value `json:"minFee"` MaxWithdrawalFee fixedpoint.Value `json:"maxFee"` MinWithdrawalThreshold fixedpoint.Value `json:"minWd"` }
type BalanceDetail ¶
type BalanceDetail struct { Currency string `json:"ccy"` Available fixedpoint.Value `json:"availEq"` CashBalance fixedpoint.Value `json:"cashBal"` OrderFrozen fixedpoint.Value `json:"ordFrozen"` Frozen fixedpoint.Value `json:"frozenBal"` Equity fixedpoint.Value `json:"eq"` EquityInUSD fixedpoint.Value `json:"eqUsd"` UpdateTime types.MillisecondTimestamp `json:"uTime"` UnrealizedProfitAndLoss fixedpoint.Value `json:"upl"` }
type BatchCancelOrderRequest ¶
type BatchCancelOrderRequest struct {
// contains filtered or unexported fields
}
func (*BatchCancelOrderRequest) Add ¶
func (r *BatchCancelOrderRequest) Add(reqs ...*CancelOrderRequest) *BatchCancelOrderRequest
func (*BatchCancelOrderRequest) Do ¶
func (r *BatchCancelOrderRequest) Do(ctx context.Context) ([]OrderResponse, error)
type BatchPlaceOrderRequest ¶
type BatchPlaceOrderRequest struct {
// contains filtered or unexported fields
}
func (*BatchPlaceOrderRequest) Add ¶
func (r *BatchPlaceOrderRequest) Add(reqs ...*PlaceOrderRequest) *BatchPlaceOrderRequest
func (*BatchPlaceOrderRequest) Do ¶
func (r *BatchPlaceOrderRequest) Do(ctx context.Context) ([]OrderResponse, error)
type CancelOrderRequest ¶
type CancelOrderRequest struct {
// contains filtered or unexported fields
}
func (*CancelOrderRequest) ClientOrderID ¶
func (c *CancelOrderRequest) ClientOrderID(clientOrderID string) *CancelOrderRequest
func (*CancelOrderRequest) Do ¶
func (c *CancelOrderRequest) Do(ctx context.Context) ([]OrderResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*CancelOrderRequest) GetParameters ¶ added in v1.21.0
func (c *CancelOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*CancelOrderRequest) GetParametersJSON ¶ added in v1.21.0
func (c *CancelOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*CancelOrderRequest) GetParametersQuery ¶ added in v1.21.0
func (c *CancelOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*CancelOrderRequest) GetPath ¶ added in v1.56.0
func (c *CancelOrderRequest) GetPath() string
GetPath returns the request path of the API
func (*CancelOrderRequest) GetQueryParameters ¶ added in v1.56.0
func (c *CancelOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*CancelOrderRequest) GetSlugParameters ¶ added in v1.56.0
func (c *CancelOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*CancelOrderRequest) GetSlugsMap ¶ added in v1.56.0
func (c *CancelOrderRequest) GetSlugsMap() (map[string]string, error)
func (*CancelOrderRequest) InstrumentID ¶
func (c *CancelOrderRequest) InstrumentID(instrumentID string) *CancelOrderRequest
func (*CancelOrderRequest) OrderID ¶
func (c *CancelOrderRequest) OrderID(orderID string) *CancelOrderRequest
type FundingRate ¶
type FundingRate struct { InstrumentType string `json:"instType"` InstrumentID string `json:"instId"` FundingRate fixedpoint.Value `json:"fundingRate"` NextFundingRate fixedpoint.Value `json:"nextFundingRate"` FundingTime types.MillisecondTimestamp `json:"fundingTime"` }
type GetAccountInfoRequest ¶ added in v1.56.0
type GetAccountInfoRequest struct {
// contains filtered or unexported fields
}
func (*GetAccountInfoRequest) Do ¶ added in v1.56.0
func (g *GetAccountInfoRequest) Do(ctx context.Context) ([]Account, error)
Do generates the request object and send the request object to the API endpoint
func (*GetAccountInfoRequest) GetParameters ¶ added in v1.56.0
func (g *GetAccountInfoRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetAccountInfoRequest) GetParametersJSON ¶ added in v1.56.0
func (g *GetAccountInfoRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetAccountInfoRequest) GetParametersQuery ¶ added in v1.56.0
func (g *GetAccountInfoRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetAccountInfoRequest) GetPath ¶ added in v1.56.0
func (g *GetAccountInfoRequest) GetPath() string
GetPath returns the request path of the API
func (*GetAccountInfoRequest) GetQueryParameters ¶ added in v1.56.0
func (g *GetAccountInfoRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetAccountInfoRequest) GetSlugParameters ¶ added in v1.56.0
func (g *GetAccountInfoRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetAccountInfoRequest) GetSlugsMap ¶ added in v1.56.0
func (g *GetAccountInfoRequest) GetSlugsMap() (map[string]string, error)
type GetCandlesRequest ¶ added in v1.57.0
type GetCandlesRequest struct {
// contains filtered or unexported fields
}
func (*GetCandlesRequest) After ¶ added in v1.57.0
func (g *GetCandlesRequest) After(after time.Time) *GetCandlesRequest
func (*GetCandlesRequest) Bar ¶ added in v1.57.0
func (g *GetCandlesRequest) Bar(bar string) *GetCandlesRequest
func (*GetCandlesRequest) Before ¶ added in v1.57.0
func (g *GetCandlesRequest) Before(before time.Time) *GetCandlesRequest
func (*GetCandlesRequest) Do ¶ added in v1.57.0
func (g *GetCandlesRequest) Do(ctx context.Context) (KLineSlice, error)
Do generates the request object and send the request object to the API endpoint
func (*GetCandlesRequest) GetParameters ¶ added in v1.57.0
func (g *GetCandlesRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetCandlesRequest) GetParametersJSON ¶ added in v1.57.0
func (g *GetCandlesRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetCandlesRequest) GetParametersQuery ¶ added in v1.57.0
func (g *GetCandlesRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetCandlesRequest) GetPath ¶ added in v1.57.0
func (g *GetCandlesRequest) GetPath() string
GetPath returns the request path of the API
func (*GetCandlesRequest) GetQueryParameters ¶ added in v1.57.0
func (g *GetCandlesRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetCandlesRequest) GetSlugParameters ¶ added in v1.57.0
func (g *GetCandlesRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetCandlesRequest) GetSlugsMap ¶ added in v1.57.0
func (g *GetCandlesRequest) GetSlugsMap() (map[string]string, error)
func (*GetCandlesRequest) InstrumentID ¶ added in v1.57.0
func (g *GetCandlesRequest) InstrumentID(instrumentID string) *GetCandlesRequest
func (*GetCandlesRequest) Limit ¶ added in v1.57.0
func (g *GetCandlesRequest) Limit(limit int) *GetCandlesRequest
type GetFundingRateRequest ¶
type GetFundingRateRequest struct {
// contains filtered or unexported fields
}
func (*GetFundingRateRequest) Do ¶
func (r *GetFundingRateRequest) Do(ctx context.Context) (*FundingRate, error)
func (*GetFundingRateRequest) InstrumentID ¶
func (r *GetFundingRateRequest) InstrumentID(instId string) *GetFundingRateRequest
type GetInstrumentsInfoRequest ¶ added in v1.56.0
type GetInstrumentsInfoRequest struct {
// contains filtered or unexported fields
}
func (*GetInstrumentsInfoRequest) Do ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) Do(ctx context.Context) ([]InstrumentInfo, error)
Do generates the request object and send the request object to the API endpoint
func (*GetInstrumentsInfoRequest) GetParameters ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetInstrumentsInfoRequest) GetParametersJSON ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetInstrumentsInfoRequest) GetParametersQuery ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetInstrumentsInfoRequest) GetPath ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) GetPath() string
GetPath returns the request path of the API
func (*GetInstrumentsInfoRequest) GetQueryParameters ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetInstrumentsInfoRequest) GetSlugParameters ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetInstrumentsInfoRequest) GetSlugsMap ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) GetSlugsMap() (map[string]string, error)
func (*GetInstrumentsInfoRequest) InstId ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) InstId(instId string) *GetInstrumentsInfoRequest
func (*GetInstrumentsInfoRequest) InstType ¶ added in v1.56.0
func (g *GetInstrumentsInfoRequest) InstType(instType InstrumentType) *GetInstrumentsInfoRequest
type GetOpenOrdersRequest ¶ added in v1.56.0
type GetOpenOrdersRequest struct {
// contains filtered or unexported fields
}
func (*GetOpenOrdersRequest) After ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) After(after string) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) Before ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) Before(before string) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) Begin ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) Begin(begin time.Time) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) Category ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) Category(category string) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) Do ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) Do(ctx context.Context) ([]OpenOrder, error)
Do generates the request object and send the request object to the API endpoint
func (*GetOpenOrdersRequest) End ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) End(end time.Time) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) GetParameters ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetOpenOrdersRequest) GetParametersJSON ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetOpenOrdersRequest) GetParametersQuery ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetOpenOrdersRequest) GetPath ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) GetPath() string
GetPath returns the request path of the API
func (*GetOpenOrdersRequest) GetQueryParameters ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetOpenOrdersRequest) GetSlugParameters ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetOpenOrdersRequest) GetSlugsMap ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) GetSlugsMap() (map[string]string, error)
func (*GetOpenOrdersRequest) InstrumentID ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) InstrumentID(instrumentID string) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) InstrumentType ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) InstrumentType(instrumentType InstrumentType) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) Limit ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) Limit(limit string) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) OrderType ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) OrderType(orderType OrderType) *GetOpenOrdersRequest
func (*GetOpenOrdersRequest) State ¶ added in v1.56.0
func (g *GetOpenOrdersRequest) State(state OrderState) *GetOpenOrdersRequest
type GetOrderDetailsRequest ¶
type GetOrderDetailsRequest struct {
// contains filtered or unexported fields
}
func (*GetOrderDetailsRequest) ClientOrderID ¶
func (r *GetOrderDetailsRequest) ClientOrderID(clientOrderID string) *GetOrderDetailsRequest
func (*GetOrderDetailsRequest) Do ¶
func (r *GetOrderDetailsRequest) Do(ctx context.Context) (*OrderDetails, error)
func (*GetOrderDetailsRequest) InstrumentID ¶
func (r *GetOrderDetailsRequest) InstrumentID(instId string) *GetOrderDetailsRequest
func (*GetOrderDetailsRequest) OrderID ¶
func (r *GetOrderDetailsRequest) OrderID(orderID string) *GetOrderDetailsRequest
func (*GetOrderDetailsRequest) QueryParameters ¶
func (r *GetOrderDetailsRequest) QueryParameters() url.Values
type GetOrderHistoryRequest ¶ added in v1.53.0
type GetOrderHistoryRequest struct {
// contains filtered or unexported fields
}
func (*GetOrderHistoryRequest) After ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) After(after string) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) Before ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) Before(before string) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) Do ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) Do(ctx context.Context) ([]OrderDetail, error)
Do generates the request object and send the request object to the API endpoint
func (*GetOrderHistoryRequest) EndTime ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) EndTime(endTime time.Time) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) GetParameters ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetOrderHistoryRequest) GetParametersJSON ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetOrderHistoryRequest) GetParametersQuery ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetOrderHistoryRequest) GetPath ¶ added in v1.56.0
func (g *GetOrderHistoryRequest) GetPath() string
GetPath returns the request path of the API
func (*GetOrderHistoryRequest) GetQueryParameters ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetOrderHistoryRequest) GetSlugParameters ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetOrderHistoryRequest) GetSlugsMap ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) GetSlugsMap() (map[string]string, error)
func (*GetOrderHistoryRequest) InstrumentFamily ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) InstrumentFamily(instrumentFamily string) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) InstrumentID ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) InstrumentID(instrumentID string) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) InstrumentType ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) InstrumentType(instrumentType InstrumentType) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) Limit ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) Limit(limit uint64) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) OrderType ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) OrderType(orderType OrderType) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) StartTime ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) StartTime(startTime time.Time) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) State ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) State(state OrderState) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) Underlying ¶ added in v1.53.0
func (g *GetOrderHistoryRequest) Underlying(underlying string) *GetOrderHistoryRequest
type GetThreeDaysTransactionHistoryRequest ¶ added in v1.58.0
type GetThreeDaysTransactionHistoryRequest struct {
// contains filtered or unexported fields
}
func (*GetThreeDaysTransactionHistoryRequest) After ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) After(after string) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) Before ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) Before(before string) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) Do ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) Do(ctx context.Context) ([]Trade, error)
Do generates the request object and send the request object to the API endpoint
func (*GetThreeDaysTransactionHistoryRequest) EndTime ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) EndTime(endTime time.Time) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) GetParameters ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetThreeDaysTransactionHistoryRequest) GetParametersJSON ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetThreeDaysTransactionHistoryRequest) GetParametersQuery ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetThreeDaysTransactionHistoryRequest) GetPath ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) GetPath() string
GetPath returns the request path of the API
func (*GetThreeDaysTransactionHistoryRequest) GetQueryParameters ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetThreeDaysTransactionHistoryRequest) GetSlugParameters ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetThreeDaysTransactionHistoryRequest) GetSlugsMap ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) GetSlugsMap() (map[string]string, error)
func (*GetThreeDaysTransactionHistoryRequest) InstrumentFamily ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) InstrumentFamily(instrumentFamily string) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) InstrumentID ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) InstrumentID(instrumentID string) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) InstrumentType ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) InstrumentType(instrumentType InstrumentType) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) Limit ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) Limit(limit uint64) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) OrderID ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) OrderID(orderID string) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) StartTime ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) StartTime(startTime time.Time) *GetThreeDaysTransactionHistoryRequest
func (*GetThreeDaysTransactionHistoryRequest) Underlying ¶ added in v1.58.0
func (g *GetThreeDaysTransactionHistoryRequest) Underlying(underlying string) *GetThreeDaysTransactionHistoryRequest
type GetTickerRequest ¶ added in v1.56.0
type GetTickerRequest struct {
// contains filtered or unexported fields
}
func (*GetTickerRequest) Do ¶ added in v1.56.0
func (g *GetTickerRequest) Do(ctx context.Context) ([]MarketTicker, error)
Do generates the request object and send the request object to the API endpoint
func (*GetTickerRequest) GetParameters ¶ added in v1.56.0
func (g *GetTickerRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetTickerRequest) GetParametersJSON ¶ added in v1.56.0
func (g *GetTickerRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetTickerRequest) GetParametersQuery ¶ added in v1.56.0
func (g *GetTickerRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetTickerRequest) GetPath ¶ added in v1.56.0
func (g *GetTickerRequest) GetPath() string
GetPath returns the request path of the API
func (*GetTickerRequest) GetQueryParameters ¶ added in v1.56.0
func (g *GetTickerRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetTickerRequest) GetSlugParameters ¶ added in v1.56.0
func (g *GetTickerRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetTickerRequest) GetSlugsMap ¶ added in v1.56.0
func (g *GetTickerRequest) GetSlugsMap() (map[string]string, error)
func (*GetTickerRequest) InstId ¶ added in v1.56.0
func (g *GetTickerRequest) InstId(instId string) *GetTickerRequest
type GetTickersRequest ¶ added in v1.56.0
type GetTickersRequest struct {
// contains filtered or unexported fields
}
func (*GetTickersRequest) Do ¶ added in v1.56.0
func (g *GetTickersRequest) Do(ctx context.Context) ([]MarketTicker, error)
Do generates the request object and send the request object to the API endpoint
func (*GetTickersRequest) GetParameters ¶ added in v1.56.0
func (g *GetTickersRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetTickersRequest) GetParametersJSON ¶ added in v1.56.0
func (g *GetTickersRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetTickersRequest) GetParametersQuery ¶ added in v1.56.0
func (g *GetTickersRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetTickersRequest) GetPath ¶ added in v1.56.0
func (g *GetTickersRequest) GetPath() string
GetPath returns the request path of the API
func (*GetTickersRequest) GetQueryParameters ¶ added in v1.56.0
func (g *GetTickersRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetTickersRequest) GetSlugParameters ¶ added in v1.56.0
func (g *GetTickersRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetTickersRequest) GetSlugsMap ¶ added in v1.56.0
func (g *GetTickersRequest) GetSlugsMap() (map[string]string, error)
func (*GetTickersRequest) InstType ¶ added in v1.56.0
func (g *GetTickersRequest) InstType(instType InstrumentType) *GetTickersRequest
type GetTransactionDetailsRequest ¶
type GetTransactionDetailsRequest struct {
// contains filtered or unexported fields
}
func (*GetTransactionDetailsRequest) Do ¶
func (r *GetTransactionDetailsRequest) Do(ctx context.Context) ([]OrderDetails, error)
func (*GetTransactionDetailsRequest) InstrumentID ¶
func (r *GetTransactionDetailsRequest) InstrumentID(instId string) *GetTransactionDetailsRequest
func (*GetTransactionDetailsRequest) InstrumentType ¶
func (r *GetTransactionDetailsRequest) InstrumentType(instType InstrumentType) *GetTransactionDetailsRequest
func (*GetTransactionDetailsRequest) OrderID ¶
func (r *GetTransactionDetailsRequest) OrderID(orderID string) *GetTransactionDetailsRequest
func (*GetTransactionDetailsRequest) Parameters ¶
func (r *GetTransactionDetailsRequest) Parameters() map[string]interface{}
type GetTransactionHistoryRequest ¶ added in v1.53.0
type GetTransactionHistoryRequest struct {
// contains filtered or unexported fields
}
func (*GetTransactionHistoryRequest) After ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) After(after string) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) Before ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) Before(before string) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) Do ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) Do(ctx context.Context) ([]Trade, error)
Do generates the request object and send the request object to the API endpoint
func (*GetTransactionHistoryRequest) EndTime ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) EndTime(endTime time.Time) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) GetParameters ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetTransactionHistoryRequest) GetParametersJSON ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetTransactionHistoryRequest) GetParametersQuery ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetTransactionHistoryRequest) GetPath ¶ added in v1.56.0
func (g *GetTransactionHistoryRequest) GetPath() string
GetPath returns the request path of the API
func (*GetTransactionHistoryRequest) GetQueryParameters ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetTransactionHistoryRequest) GetSlugParameters ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetTransactionHistoryRequest) GetSlugsMap ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) GetSlugsMap() (map[string]string, error)
func (*GetTransactionHistoryRequest) InstrumentFamily ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) InstrumentFamily(instrumentFamily string) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) InstrumentID ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) InstrumentID(instrumentID string) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) InstrumentType ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) InstrumentType(instrumentType InstrumentType) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) Limit ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) Limit(limit uint64) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) OrderID ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) OrderID(orderID string) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) StartTime ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) StartTime(startTime time.Time) *GetTransactionHistoryRequest
func (*GetTransactionHistoryRequest) Underlying ¶ added in v1.53.0
func (g *GetTransactionHistoryRequest) Underlying(underlying string) *GetTransactionHistoryRequest
type InstrumentInfo ¶ added in v1.56.0
type InstrumentInfo struct { InstrumentType string `json:"instType"` InstrumentID string `json:"instId"` BaseCurrency string `json:"baseCcy"` QuoteCurrency string `json:"quoteCcy"` SettleCurrency string `json:"settleCcy"` ContractValue string `json:"ctVal"` ContractMultiplier string `json:"ctMult"` ContractValueCurrency string `json:"ctValCcy"` ListTime types.MillisecondTimestamp `json:"listTime"` ExpiryTime types.MillisecondTimestamp `json:"expTime"` TickSize fixedpoint.Value `json:"tickSz"` LotSize fixedpoint.Value `json:"lotSz"` // MinSize = min order size MinSize fixedpoint.Value `json:"minSz"` // instrument status State string `json:"state"` }
type InstrumentType ¶
type InstrumentType string
const ( InstrumentTypeSpot InstrumentType = "SPOT" InstrumentTypeSwap InstrumentType = "SWAP" InstrumentTypeFutures InstrumentType = "FUTURES" InstrumentTypeOption InstrumentType = "OPTION" InstrumentTypeMARGIN InstrumentType = "MARGIN" )
type KLine ¶ added in v1.57.0
type KLine struct { StartTime types.MillisecondTimestamp OpenPrice fixedpoint.Value HighestPrice fixedpoint.Value LowestPrice fixedpoint.Value ClosePrice fixedpoint.Value // If it is a derivatives contract, the value is the number of contracts. // If it is SPOT/MARGIN, the value is the quantity in base currency. Volume fixedpoint.Value // VolumeInCurrency trading volume, with a unit of currency. // If it is a derivatives contract, the value is the number of base currency. // If it is SPOT/MARGIN, the value is the quantity in quote currency. VolumeInCurrency fixedpoint.Value // VolumeInCurrencyQuote Trading volume, the value is the quantity in quote currency // e.g. The unit is USDT for BTC-USDT and BTC-USDT-SWAP; // The unit is USD for BTC-USD-SWAP // ** REMARK: To prevent overflow, we need to avoid unmarshaling it. ** //VolumeInCurrencyQuote fixedpoint.Value // The state of candlesticks. // 0 represents that it is uncompleted, 1 represents that it is completed. Confirm fixedpoint.Value }
type KLineSlice ¶ added in v1.57.0
type KLineSlice []KLine
func (*KLineSlice) UnmarshalJSON ¶ added in v1.57.0
func (m *KLineSlice) UnmarshalJSON(b []byte) error
type LiquidityType ¶ added in v1.56.0
type LiquidityType string
type MarketTicker ¶
type MarketTicker struct { InstrumentType string `json:"instType"` InstrumentID string `json:"instId"` // last traded price Last fixedpoint.Value `json:"last"` // last traded size LastSize fixedpoint.Value `json:"lastSz"` AskPrice fixedpoint.Value `json:"askPx"` AskSize fixedpoint.Value `json:"askSz"` BidPrice fixedpoint.Value `json:"bidPx"` BidSize fixedpoint.Value `json:"bidSz"` Open24H fixedpoint.Value `json:"open24h"` High24H fixedpoint.Value `json:"high24H"` Low24H fixedpoint.Value `json:"low24H"` Volume24H fixedpoint.Value `json:"vol24h"` VolumeCurrency24H fixedpoint.Value `json:"volCcy24h"` // Millisecond timestamp Timestamp types.MillisecondTimestamp `json:"ts"` }
type MarketTickerRequest ¶
type MarketTickerRequest struct {
// contains filtered or unexported fields
}
func (*MarketTickerRequest) Do ¶
func (r *MarketTickerRequest) Do(ctx context.Context) (*MarketTicker, error)
func (*MarketTickerRequest) InstrumentID ¶
func (r *MarketTickerRequest) InstrumentID(instId string) *MarketTickerRequest
type MarketTickersRequest ¶
type MarketTickersRequest struct {
// contains filtered or unexported fields
}
func (*MarketTickersRequest) Do ¶
func (r *MarketTickersRequest) Do(ctx context.Context) ([]MarketTicker, error)
func (*MarketTickersRequest) InstrumentType ¶
func (r *MarketTickersRequest) InstrumentType(instType string) *MarketTickersRequest
type OpenOrder ¶ added in v1.56.0
type OpenOrder struct { OrderDetail QuickMgnType string `json:"quickMgnType"` }
type OrderDetail ¶ added in v1.56.0
type OrderDetail struct { AccumulatedFillSize fixedpoint.Value `json:"accFillSz"` // If none is filled, it will return "". AvgPrice fixedpoint.Value `json:"avgPx"` CreatedTime types.MillisecondTimestamp `json:"cTime"` Category string `json:"category"` ClientOrderId string `json:"clOrdId"` Fee fixedpoint.Value `json:"fee"` FeeCurrency string `json:"feeCcy"` // Last filled time FillTime types.MillisecondTimestamp `json:"fillTime"` InstrumentID string `json:"instId"` InstrumentType InstrumentType `json:"instType"` OrderId types.StrInt64 `json:"ordId"` OrderType OrderType `json:"ordType"` Price fixedpoint.Value `json:"px"` Side SideType `json:"side"` State OrderState `json:"state"` Size fixedpoint.Value `json:"sz"` TargetCurrency TargetCurrency `json:"tgtCcy"` UpdatedTime types.MillisecondTimestamp `json:"uTime"` // Margin currency // Only applicable to cross MARGIN orders in Single-currency margin. Currency string `json:"ccy"` TradeId string `json:"tradeId"` // Last filled price FillPrice fixedpoint.Value `json:"fillPx"` // Last filled quantity FillSize fixedpoint.Value `json:"fillSz"` // Leverage, from 0.01 to 125. // Only applicable to MARGIN/FUTURES/SWAP Lever string `json:"lever"` // Profit and loss, Applicable to orders which have a trade and aim to close position. It always is 0 in other conditions Pnl fixedpoint.Value `json:"pnl"` PositionSide string `json:"posSide"` // Options price in USDOnly applicable to options; return "" for other instrument types PriceUsd fixedpoint.Value `json:"pxUsd"` // Implied volatility of the options orderOnly applicable to options; return "" for other instrument types PriceVol fixedpoint.Value `json:"pxVol"` // Price type of options PriceType string `json:"pxType"` // Rebate amount, only applicable to spot and margin, the reward of placing orders from the platform (rebate) // given to user who has reached the specified trading level. If there is no rebate, this field is "". Rebate fixedpoint.Value `json:"rebate"` RebateCcy string `json:"rebateCcy"` // Client-supplied Algo ID when placing order attaching TP/SL. AttachAlgoClOrdId string `json:"attachAlgoClOrdId"` SlOrdPx fixedpoint.Value `json:"slOrdPx"` SlTriggerPx fixedpoint.Value `json:"slTriggerPx"` SlTriggerPxType string `json:"slTriggerPxType"` AttachAlgoOrds []interface{} `json:"attachAlgoOrds"` Source string `json:"source"` // Self trade prevention ID. Return "" if self trade prevention is not applicable StpId string `json:"stpId"` // Self trade prevention mode. Return "" if self trade prevention is not applicable StpMode string `json:"stpMode"` Tag string `json:"tag"` TradeMode TradeMode `json:"tdMode"` TpOrdPx fixedpoint.Value `json:"tpOrdPx"` TpTriggerPx fixedpoint.Value `json:"tpTriggerPx"` TpTriggerPxType string `json:"tpTriggerPxType"` ReduceOnly string `json:"reduceOnly"` AlgoClOrdId string `json:"algoClOrdId"` AlgoId string `json:"algoId"` }
type OrderDetails ¶
type OrderDetails struct { InstrumentType InstrumentType `json:"instType"` InstrumentID string `json:"instId"` Tag string `json:"tag"` Price fixedpoint.Value `json:"px"` Quantity fixedpoint.Value `json:"sz"` OrderID string `json:"ordId"` ClientOrderID string `json:"clOrdId"` OrderType OrderType `json:"ordType"` Side SideType `json:"side"` // Accumulated fill quantity FilledQuantity fixedpoint.Value `json:"accFillSz"` FeeCurrency string `json:"feeCcy"` Fee fixedpoint.Value `json:"fee"` // trade related fields LastTradeID string `json:"tradeId,omitempty"` LastFilledPrice fixedpoint.Value `json:"fillPx"` LastFilledQuantity fixedpoint.Value `json:"fillSz"` LastFilledTime types.MillisecondTimestamp `json:"fillTime"` LastFilledFee fixedpoint.Value `json:"fillFee"` LastFilledFeeCurrency string `json:"fillFeeCcy"` LastFilledPnl fixedpoint.Value `json:"fillPnl"` BillID types.StrInt64 `json:"billId"` // ExecutionType = liquidity (M = maker or T = taker) ExecutionType string `json:"execType"` // Average filled price. If none is filled, it will return 0. AveragePrice fixedpoint.Value `json:"avgPx"` // Currency = Margin currency // Only applicable to cross MARGIN orders in Single-currency margin. Currency string `json:"ccy"` // Leverage = from 0.01 to 125. // Only applicable to MARGIN/FUTURES/SWAP Leverage fixedpoint.Value `json:"lever"` RebateCurrency string `json:"rebateCcy"` Rebate fixedpoint.Value `json:"rebate"` PnL fixedpoint.Value `json:"pnl"` UpdateTime types.MillisecondTimestamp `json:"uTime"` CreationTime types.MillisecondTimestamp `json:"cTime"` State OrderState `json:"state"` }
type OrderList ¶ added in v1.52.0
type OrderList []OrderDetails
type OrderResponse ¶
type OrderState ¶
type OrderState string
const ( OrderStateCanceled OrderState = "canceled" OrderStateLive OrderState = "live" OrderStatePartiallyFilled OrderState = "partially_filled" OrderStateFilled OrderState = "filled" )
func (OrderState) IsWorking ¶ added in v1.56.0
func (o OrderState) IsWorking() bool
type PlaceOrderRequest ¶
type PlaceOrderRequest struct {
// contains filtered or unexported fields
}
func (*PlaceOrderRequest) ClientOrderID ¶
func (r *PlaceOrderRequest) ClientOrderID(clientOrderID string) *PlaceOrderRequest
func (*PlaceOrderRequest) Do ¶
func (r *PlaceOrderRequest) Do(ctx context.Context) ([]OrderResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*PlaceOrderRequest) GetParameters ¶ added in v1.21.0
func (r *PlaceOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*PlaceOrderRequest) GetParametersJSON ¶ added in v1.21.0
func (r *PlaceOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*PlaceOrderRequest) GetParametersQuery ¶ added in v1.21.0
func (r *PlaceOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*PlaceOrderRequest) GetPath ¶ added in v1.56.0
func (r *PlaceOrderRequest) GetPath() string
GetPath returns the request path of the API
func (*PlaceOrderRequest) GetQueryParameters ¶ added in v1.56.0
func (r *PlaceOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*PlaceOrderRequest) GetSlugParameters ¶ added in v1.56.0
func (r *PlaceOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*PlaceOrderRequest) GetSlugsMap ¶ added in v1.56.0
func (r *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)
func (*PlaceOrderRequest) InstrumentID ¶
func (r *PlaceOrderRequest) InstrumentID(instrumentID string) *PlaceOrderRequest
func (*PlaceOrderRequest) OrderType ¶
func (r *PlaceOrderRequest) OrderType(orderType OrderType) *PlaceOrderRequest
func (*PlaceOrderRequest) Parameters ¶
func (r *PlaceOrderRequest) Parameters() map[string]interface{}
func (*PlaceOrderRequest) Price ¶
func (r *PlaceOrderRequest) Price(price string) *PlaceOrderRequest
func (*PlaceOrderRequest) Side ¶
func (r *PlaceOrderRequest) Side(side SideType) *PlaceOrderRequest
func (*PlaceOrderRequest) Size ¶ added in v1.56.0
func (r *PlaceOrderRequest) Size(size string) *PlaceOrderRequest
func (*PlaceOrderRequest) Tag ¶ added in v1.21.0
func (r *PlaceOrderRequest) Tag(tag string) *PlaceOrderRequest
func (*PlaceOrderRequest) TargetCurrency ¶ added in v1.56.0
func (r *PlaceOrderRequest) TargetCurrency(targetCurrency TargetCurrency) *PlaceOrderRequest
func (*PlaceOrderRequest) TradeMode ¶
func (r *PlaceOrderRequest) TradeMode(tradeMode TradeMode) *PlaceOrderRequest
type RestClient ¶
type RestClient struct { requestgen.BaseAPIClient Key, Secret, Passphrase string }
func NewClient ¶
func NewClient() *RestClient
func (*RestClient) AssetBalances ¶
func (c *RestClient) AssetBalances(ctx context.Context) (AssetBalanceList, error)
func (*RestClient) AssetCurrencies ¶
func (c *RestClient) AssetCurrencies(ctx context.Context) ([]AssetCurrency, error)
func (*RestClient) Auth ¶
func (c *RestClient) Auth(key, secret, passphrase string)
func (*RestClient) NewAuthenticatedRequest ¶ added in v1.52.0
func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, payload interface{}) (*http.Request, error)
NewAuthenticatedRequest creates new http request for authenticated routes.
func (*RestClient) NewBatchCancelOrderRequest ¶ added in v1.52.0
func (c *RestClient) NewBatchCancelOrderRequest() *BatchCancelOrderRequest
func (*RestClient) NewBatchPlaceOrderRequest ¶ added in v1.52.0
func (c *RestClient) NewBatchPlaceOrderRequest() *BatchPlaceOrderRequest
func (*RestClient) NewCancelOrderRequest ¶ added in v1.52.0
func (c *RestClient) NewCancelOrderRequest() *CancelOrderRequest
func (*RestClient) NewGetAccountInfoRequest ¶ added in v1.56.0
func (c *RestClient) NewGetAccountInfoRequest() *GetAccountInfoRequest
func (*RestClient) NewGetCandlesRequest ¶ added in v1.57.0
func (c *RestClient) NewGetCandlesRequest() *GetCandlesRequest
func (*RestClient) NewGetFundingRate ¶ added in v1.52.0
func (s *RestClient) NewGetFundingRate() *GetFundingRateRequest
func (*RestClient) NewGetInstrumentsInfoRequest ¶ added in v1.56.0
func (c *RestClient) NewGetInstrumentsInfoRequest() *GetInstrumentsInfoRequest
func (*RestClient) NewGetOpenOrdersRequest ¶ added in v1.56.0
func (c *RestClient) NewGetOpenOrdersRequest() *GetOpenOrdersRequest
func (*RestClient) NewGetOrderDetailsRequest ¶ added in v1.52.0
func (c *RestClient) NewGetOrderDetailsRequest() *GetOrderDetailsRequest
func (*RestClient) NewGetOrderHistoryRequest ¶ added in v1.53.0
func (c *RestClient) NewGetOrderHistoryRequest() *GetOrderHistoryRequest
NewGetOrderHistoryRequest is descending order by createdTime
func (*RestClient) NewGetThreeDaysTransactionHistoryRequest ¶ added in v1.58.0
func (c *RestClient) NewGetThreeDaysTransactionHistoryRequest() *GetThreeDaysTransactionHistoryRequest
func (*RestClient) NewGetTickerRequest ¶ added in v1.56.0
func (c *RestClient) NewGetTickerRequest() *GetTickerRequest
func (*RestClient) NewGetTickersRequest ¶ added in v1.56.0
func (c *RestClient) NewGetTickersRequest() *GetTickersRequest
func (*RestClient) NewGetTransactionDetailsRequest ¶ added in v1.52.0
func (c *RestClient) NewGetTransactionDetailsRequest() *GetTransactionDetailsRequest
func (*RestClient) NewGetTransactionHistoryRequest ¶ added in v1.53.0
func (c *RestClient) NewGetTransactionHistoryRequest() *GetTransactionHistoryRequest
func (*RestClient) NewMarketTickerRequest ¶ added in v1.52.0
func (c *RestClient) NewMarketTickerRequest(instId string) *MarketTickerRequest
func (*RestClient) NewMarketTickersRequest ¶ added in v1.52.0
func (c *RestClient) NewMarketTickersRequest(instType string) *MarketTickersRequest
func (*RestClient) NewPlaceOrderRequest ¶ added in v1.52.0
func (c *RestClient) NewPlaceOrderRequest() *PlaceOrderRequest
type TargetCurrency ¶ added in v1.56.0
type TargetCurrency string
const ( TargetCurrencyBase TargetCurrency = "base_ccy" TargetCurrencyQuote TargetCurrency = "quote_ccy" )
type Trade ¶ added in v1.56.0
type Trade struct { InstrumentType InstrumentType `json:"instType"` InstrumentId string `json:"instId"` TradeId types.StrInt64 `json:"tradeId"` OrderId types.StrInt64 `json:"ordId"` ClientOrderId string `json:"clOrdId"` // Data generation time, Unix timestamp format in milliseconds, e.g. 1597026383085. Timestamp types.MillisecondTimestamp `json:"ts"` FillTime types.MillisecondTimestamp `json:"fillTime"` FeeCurrency string `json:"feeCcy"` Fee fixedpoint.Value `json:"fee"` BillId types.StrInt64 `json:"billId"` Side SideType `json:"side"` ExecutionType LiquidityType `json:"execType"` Tag string `json:"tag"` // Last filled price FillPrice fixedpoint.Value `json:"fillPx"` // Last filled quantity FillSize fixedpoint.Value `json:"fillSz"` // Index price at the moment of trade execution //For cross currency spot pairs, it returns baseCcy-USDT index price. For example, for LTC-ETH, this field returns the index price of LTC-USDT. FillIndexPrice fixedpoint.Value `json:"fillIdxPx"` FillPnl string `json:"fillPnl"` // Only applicable to options; return "" for other instrument types FillPriceVolume fixedpoint.Value `json:"fillPxVol"` FillPriceUsd fixedpoint.Value `json:"fillPxUsd"` FillMarkVolume fixedpoint.Value `json:"fillMarkVol"` FillForwardPrice fixedpoint.Value `json:"fillFwdPx"` FillMarkPrice fixedpoint.Value `json:"fillMarkPx"` PosSide string `json:"posSide"` }
Source Files ¶
- cancel_order_request.go
- cancel_order_request_requestgen.go
- client.go
- get_account_info_request.go
- get_account_info_request_requestgen.go
- get_candles_request.go
- get_candles_request_requestgen.go
- get_instruments_info_request.go
- get_instruments_info_request_requestgen.go
- get_open_orders_request.go
- get_open_orders_request_requestgen.go
- get_order_history_request.go
- get_order_history_request_requestgen.go
- get_three_days_transaction_history_request.go
- get_three_days_transaction_history_request_requestgen.go
- get_ticker_request.go
- get_ticker_request_requestgen.go
- get_tickers_request.go
- get_tickers_request_requestgen.go
- get_transaction_history_request.go
- get_transaction_history_request_requestgen.go
- market.go
- place_order_request.go
- place_order_request_requestgen.go
- public.go
- trade.go