Documentation ¶
Index ¶
- Constants
- type APIResponse
- type AccountAsset
- type AssetType
- type CancelOrder
- type CancelOrderRequest
- func (c *CancelOrderRequest) ClientOrderId(clientOrderId string) *CancelOrderRequest
- func (c *CancelOrderRequest) Do(ctx context.Context) (*CancelOrder, 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) OrderId(orderId string) *CancelOrderRequest
- func (c *CancelOrderRequest) Symbol(symbol string) *CancelOrderRequest
- type Client
- func (c *Client) NewCancelOrderRequest() *CancelOrderRequest
- func (c *Client) NewGetAccountAssetsRequest() *GetAccountAssetsRequest
- func (c *Client) NewGetHistoryOrdersRequest() *GetHistoryOrdersRequest
- func (s *Client) NewGetKLineRequest() *GetKLineRequest
- func (c *Client) NewGetSymbolsRequest() *GetSymbolsRequest
- func (s *Client) NewGetTickersRequest() *GetTickersRequest
- func (s *Client) NewGetTradeFillsRequest() *GetTradeFillsRequest
- func (c *Client) NewGetUnfilledOrdersRequest() *GetUnfilledOrdersRequest
- func (c *Client) NewPlaceOrderRequest() *PlaceOrderRequest
- type DiscountStatus
- type FeeDetail
- type GetAccountAssetsRequest
- func (c *GetAccountAssetsRequest) AssetType(assetType AssetType) *GetAccountAssetsRequest
- func (c *GetAccountAssetsRequest) Coin(coin string) *GetAccountAssetsRequest
- func (c *GetAccountAssetsRequest) Do(ctx context.Context) ([]AccountAsset, error)
- func (c *GetAccountAssetsRequest) GetParameters() (map[string]interface{}, error)
- func (c *GetAccountAssetsRequest) GetParametersJSON() ([]byte, error)
- func (c *GetAccountAssetsRequest) GetParametersQuery() (url.Values, error)
- func (c *GetAccountAssetsRequest) GetPath() string
- func (c *GetAccountAssetsRequest) GetQueryParameters() (url.Values, error)
- func (c *GetAccountAssetsRequest) GetSlugParameters() (map[string]interface{}, error)
- func (c *GetAccountAssetsRequest) GetSlugsMap() (map[string]string, error)
- type GetHistoryOrdersRequest
- func (g *GetHistoryOrdersRequest) Do(ctx context.Context) ([]OrderDetail, error)
- func (g *GetHistoryOrdersRequest) EndTime(endTime time.Time) *GetHistoryOrdersRequest
- func (g *GetHistoryOrdersRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetHistoryOrdersRequest) GetParametersJSON() ([]byte, error)
- func (g *GetHistoryOrdersRequest) GetParametersQuery() (url.Values, error)
- func (g *GetHistoryOrdersRequest) GetPath() string
- func (g *GetHistoryOrdersRequest) GetQueryParameters() (url.Values, error)
- func (g *GetHistoryOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetHistoryOrdersRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetHistoryOrdersRequest) IdLessThan(idLessThan string) *GetHistoryOrdersRequest
- func (g *GetHistoryOrdersRequest) Limit(limit string) *GetHistoryOrdersRequest
- func (g *GetHistoryOrdersRequest) OrderId(orderId string) *GetHistoryOrdersRequest
- func (g *GetHistoryOrdersRequest) StartTime(startTime time.Time) *GetHistoryOrdersRequest
- func (g *GetHistoryOrdersRequest) Symbol(symbol string) *GetHistoryOrdersRequest
- type GetKLineRequest
- func (g *GetKLineRequest) Do(ctx context.Context) (KLineResponse, error)
- func (g *GetKLineRequest) EndTime(endTime time.Time) *GetKLineRequest
- func (g *GetKLineRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetKLineRequest) GetParametersJSON() ([]byte, error)
- func (g *GetKLineRequest) GetParametersQuery() (url.Values, error)
- func (g *GetKLineRequest) GetPath() string
- func (g *GetKLineRequest) GetQueryParameters() (url.Values, error)
- func (g *GetKLineRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetKLineRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetKLineRequest) Granularity(granularity string) *GetKLineRequest
- func (g *GetKLineRequest) Limit(limit string) *GetKLineRequest
- func (g *GetKLineRequest) StartTime(startTime time.Time) *GetKLineRequest
- func (g *GetKLineRequest) Symbol(symbol string) *GetKLineRequest
- type GetSymbolsRequest
- func (g *GetSymbolsRequest) Do(ctx context.Context) ([]Symbol, error)
- func (g *GetSymbolsRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetSymbolsRequest) GetParametersJSON() ([]byte, error)
- func (g *GetSymbolsRequest) GetParametersQuery() (url.Values, error)
- func (g *GetSymbolsRequest) GetPath() string
- func (g *GetSymbolsRequest) GetQueryParameters() (url.Values, error)
- func (g *GetSymbolsRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetSymbolsRequest) GetSlugsMap() (map[string]string, error)
- type GetTickersRequest
- func (g *GetTickersRequest) Do(ctx context.Context) ([]Ticker, 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) Symbol(symbol string) *GetTickersRequest
- type GetTradeFillsRequest
- func (s *GetTradeFillsRequest) Do(ctx context.Context) ([]Trade, error)
- func (s *GetTradeFillsRequest) EndTime(endTime time.Time) *GetTradeFillsRequest
- func (s *GetTradeFillsRequest) GetParameters() (map[string]interface{}, error)
- func (s *GetTradeFillsRequest) GetParametersJSON() ([]byte, error)
- func (s *GetTradeFillsRequest) GetParametersQuery() (url.Values, error)
- func (s *GetTradeFillsRequest) GetPath() string
- func (s *GetTradeFillsRequest) GetQueryParameters() (url.Values, error)
- func (s *GetTradeFillsRequest) GetSlugParameters() (map[string]interface{}, error)
- func (s *GetTradeFillsRequest) GetSlugsMap() (map[string]string, error)
- func (s *GetTradeFillsRequest) IdLessThan(idLessThan string) *GetTradeFillsRequest
- func (s *GetTradeFillsRequest) Limit(limit string) *GetTradeFillsRequest
- func (s *GetTradeFillsRequest) OrderId(orderId string) *GetTradeFillsRequest
- func (s *GetTradeFillsRequest) StartTime(startTime time.Time) *GetTradeFillsRequest
- func (s *GetTradeFillsRequest) Symbol(symbol string) *GetTradeFillsRequest
- type GetUnfilledOrdersRequest
- func (g *GetUnfilledOrdersRequest) Do(ctx context.Context) ([]UnfilledOrder, error)
- func (g *GetUnfilledOrdersRequest) EndTime(endTime time.Time) *GetUnfilledOrdersRequest
- func (g *GetUnfilledOrdersRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetUnfilledOrdersRequest) GetParametersJSON() ([]byte, error)
- func (g *GetUnfilledOrdersRequest) GetParametersQuery() (url.Values, error)
- func (g *GetUnfilledOrdersRequest) GetPath() string
- func (g *GetUnfilledOrdersRequest) GetQueryParameters() (url.Values, error)
- func (g *GetUnfilledOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetUnfilledOrdersRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetUnfilledOrdersRequest) IdLessThan(idLessThan string) *GetUnfilledOrdersRequest
- func (g *GetUnfilledOrdersRequest) Limit(limit string) *GetUnfilledOrdersRequest
- func (g *GetUnfilledOrdersRequest) OrderId(orderId string) *GetUnfilledOrdersRequest
- func (g *GetUnfilledOrdersRequest) StartTime(startTime time.Time) *GetUnfilledOrdersRequest
- func (g *GetUnfilledOrdersRequest) Symbol(symbol string) *GetUnfilledOrdersRequest
- type KLine
- type KLineResponse
- type OrderDetail
- type OrderForce
- type OrderStatus
- type OrderType
- type PlaceOrderRequest
- func (p *PlaceOrderRequest) ClientOrderId(clientOrderId string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Do(ctx context.Context) (*PlaceOrderResponse, error)
- func (p *PlaceOrderRequest) Force(force OrderForce) *PlaceOrderRequest
- func (p *PlaceOrderRequest) GetParameters() (map[string]interface{}, error)
- func (p *PlaceOrderRequest) GetParametersJSON() ([]byte, error)
- func (p *PlaceOrderRequest) GetParametersQuery() (url.Values, error)
- func (p *PlaceOrderRequest) GetQueryParameters() (url.Values, error)
- func (p *PlaceOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (p *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)
- func (p *PlaceOrderRequest) OrderType(orderType OrderType) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Price(price string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Side(side SideType) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Size(size string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Symbol(symbol string) *PlaceOrderRequest
- type PlaceOrderResponse
- type SideType
- type Symbol
- type SymbolStatus
- type Ticker
- type Trade
- type TradeFee
- type TradeScope
- type UnfilledOrder
Constants ¶
const ( PrivateWebSocketURL = "wss://ws.bitget.com/v2/ws/private" PublicWebSocketURL = "wss://ws.bitget.com/v2/ws/public" )
const KLinesArrayLen = 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse = bitgetapi.APIResponse
type AccountAsset ¶ added in v1.56.0
type AccountAsset struct { Coin string `json:"coin"` Available fixedpoint.Value `json:"available"` Frozen fixedpoint.Value `json:"frozen"` Locked fixedpoint.Value `json:"locked"` LimitAvailable fixedpoint.Value `json:"limitAvailable"` UpdatedTime types.MillisecondTimestamp `json:"uTime"` }
type CancelOrder ¶ added in v1.54.0
type CancelOrder struct { // OrderId are always numeric. It's confirmed with official customer service. https://t.me/bitgetOpenapi/24172 OrderId types.StrInt64 `json:"orderId"` ClientOrderId string `json:"clientOid"` }
type CancelOrderRequest ¶ added in v1.54.0
type CancelOrderRequest struct {
// contains filtered or unexported fields
}
func (*CancelOrderRequest) ClientOrderId ¶ added in v1.54.0
func (c *CancelOrderRequest) ClientOrderId(clientOrderId string) *CancelOrderRequest
func (*CancelOrderRequest) Do ¶ added in v1.54.0
func (c *CancelOrderRequest) Do(ctx context.Context) (*CancelOrder, error)
Do generates the request object and send the request object to the API endpoint
func (*CancelOrderRequest) GetParameters ¶ added in v1.54.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.54.0
func (c *CancelOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*CancelOrderRequest) GetParametersQuery ¶ added in v1.54.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.54.0
func (c *CancelOrderRequest) GetPath() string
GetPath returns the request path of the API
func (*CancelOrderRequest) GetQueryParameters ¶ added in v1.54.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.54.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.54.0
func (c *CancelOrderRequest) GetSlugsMap() (map[string]string, error)
func (*CancelOrderRequest) OrderId ¶ added in v1.54.0
func (c *CancelOrderRequest) OrderId(orderId string) *CancelOrderRequest
func (*CancelOrderRequest) Symbol ¶ added in v1.54.0
func (c *CancelOrderRequest) Symbol(symbol string) *CancelOrderRequest
type Client ¶
type Client struct {
Client requestgen.AuthenticatedAPIClient
}
func NewClient ¶
func NewClient(client *bitgetapi.RestClient) *Client
func (*Client) NewCancelOrderRequest ¶ added in v1.54.0
func (c *Client) NewCancelOrderRequest() *CancelOrderRequest
func (*Client) NewGetAccountAssetsRequest ¶ added in v1.56.0
func (c *Client) NewGetAccountAssetsRequest() *GetAccountAssetsRequest
func (*Client) NewGetHistoryOrdersRequest ¶
func (c *Client) NewGetHistoryOrdersRequest() *GetHistoryOrdersRequest
func (*Client) NewGetKLineRequest ¶ added in v1.54.0
func (s *Client) NewGetKLineRequest() *GetKLineRequest
func (*Client) NewGetSymbolsRequest ¶ added in v1.54.0
func (c *Client) NewGetSymbolsRequest() *GetSymbolsRequest
func (*Client) NewGetTickersRequest ¶ added in v1.54.0
func (s *Client) NewGetTickersRequest() *GetTickersRequest
func (*Client) NewGetTradeFillsRequest ¶ added in v1.54.0
func (s *Client) NewGetTradeFillsRequest() *GetTradeFillsRequest
func (*Client) NewGetUnfilledOrdersRequest ¶
func (c *Client) NewGetUnfilledOrdersRequest() *GetUnfilledOrdersRequest
func (*Client) NewPlaceOrderRequest ¶ added in v1.54.0
func (c *Client) NewPlaceOrderRequest() *PlaceOrderRequest
type DiscountStatus ¶ added in v1.54.0
type DiscountStatus string
const ( DiscountYes DiscountStatus = "yes" DiscountNo DiscountStatus = "no" )
type FeeDetail ¶
type FeeDetail struct { // NewFees should have a value because when I was integrating, it already prompted, // "If there is no 'newFees' field, this data represents earlier historical data." NewFees struct { // Amount deducted by coupons, unit:currency obtained from the transaction. DeductedByCoupon fixedpoint.Value `json:"c"` // Amount deducted in BGB (Bitget Coin), unit:BGB DeductedInBGB fixedpoint.Value `json:"d"` // If the BGB balance is insufficient to cover the fees, the remaining amount is deducted from the //currency obtained from the transaction. DeductedFromCurrency fixedpoint.Value `json:"r"` // The total fee amount to be paid, unit :currency obtained from the transaction. ToBePaid fixedpoint.Value `json:"t"` // ignored Deduction bool `json:"deduction"` // ignored TotalDeductionFee fixedpoint.Value `json:"totalDeductionFee"` } `json:"newFees"` }
type GetAccountAssetsRequest ¶ added in v1.56.0
type GetAccountAssetsRequest struct {
// contains filtered or unexported fields
}
func (*GetAccountAssetsRequest) AssetType ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) AssetType(assetType AssetType) *GetAccountAssetsRequest
func (*GetAccountAssetsRequest) Coin ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) Coin(coin string) *GetAccountAssetsRequest
func (*GetAccountAssetsRequest) Do ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) Do(ctx context.Context) ([]AccountAsset, error)
Do generates the request object and send the request object to the API endpoint
func (*GetAccountAssetsRequest) GetParameters ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetAccountAssetsRequest) GetParametersJSON ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetAccountAssetsRequest) GetParametersQuery ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetAccountAssetsRequest) GetPath ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) GetPath() string
GetPath returns the request path of the API
func (*GetAccountAssetsRequest) GetQueryParameters ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetAccountAssetsRequest) GetSlugParameters ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetAccountAssetsRequest) GetSlugsMap ¶ added in v1.56.0
func (c *GetAccountAssetsRequest) GetSlugsMap() (map[string]string, error)
type GetHistoryOrdersRequest ¶
type GetHistoryOrdersRequest struct {
// contains filtered or unexported fields
}
func (*GetHistoryOrdersRequest) Do ¶
func (g *GetHistoryOrdersRequest) Do(ctx context.Context) ([]OrderDetail, error)
Do generates the request object and send the request object to the API endpoint
func (*GetHistoryOrdersRequest) EndTime ¶
func (g *GetHistoryOrdersRequest) EndTime(endTime time.Time) *GetHistoryOrdersRequest
func (*GetHistoryOrdersRequest) GetParameters ¶
func (g *GetHistoryOrdersRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetHistoryOrdersRequest) GetParametersJSON ¶
func (g *GetHistoryOrdersRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetHistoryOrdersRequest) GetParametersQuery ¶
func (g *GetHistoryOrdersRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetHistoryOrdersRequest) GetPath ¶ added in v1.54.0
func (g *GetHistoryOrdersRequest) GetPath() string
GetPath returns the request path of the API
func (*GetHistoryOrdersRequest) GetQueryParameters ¶
func (g *GetHistoryOrdersRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetHistoryOrdersRequest) GetSlugParameters ¶
func (g *GetHistoryOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetHistoryOrdersRequest) GetSlugsMap ¶
func (g *GetHistoryOrdersRequest) GetSlugsMap() (map[string]string, error)
func (*GetHistoryOrdersRequest) IdLessThan ¶
func (g *GetHistoryOrdersRequest) IdLessThan(idLessThan string) *GetHistoryOrdersRequest
func (*GetHistoryOrdersRequest) Limit ¶
func (g *GetHistoryOrdersRequest) Limit(limit string) *GetHistoryOrdersRequest
func (*GetHistoryOrdersRequest) OrderId ¶
func (g *GetHistoryOrdersRequest) OrderId(orderId string) *GetHistoryOrdersRequest
func (*GetHistoryOrdersRequest) StartTime ¶
func (g *GetHistoryOrdersRequest) StartTime(startTime time.Time) *GetHistoryOrdersRequest
func (*GetHistoryOrdersRequest) Symbol ¶
func (g *GetHistoryOrdersRequest) Symbol(symbol string) *GetHistoryOrdersRequest
type GetKLineRequest ¶ added in v1.54.0
type GetKLineRequest struct {
// contains filtered or unexported fields
}
func (*GetKLineRequest) Do ¶ added in v1.54.0
func (g *GetKLineRequest) Do(ctx context.Context) (KLineResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*GetKLineRequest) EndTime ¶ added in v1.54.0
func (g *GetKLineRequest) EndTime(endTime time.Time) *GetKLineRequest
func (*GetKLineRequest) GetParameters ¶ added in v1.54.0
func (g *GetKLineRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetKLineRequest) GetParametersJSON ¶ added in v1.54.0
func (g *GetKLineRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetKLineRequest) GetParametersQuery ¶ added in v1.54.0
func (g *GetKLineRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetKLineRequest) GetPath ¶ added in v1.54.0
func (g *GetKLineRequest) GetPath() string
GetPath returns the request path of the API
func (*GetKLineRequest) GetQueryParameters ¶ added in v1.54.0
func (g *GetKLineRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetKLineRequest) GetSlugParameters ¶ added in v1.54.0
func (g *GetKLineRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetKLineRequest) GetSlugsMap ¶ added in v1.54.0
func (g *GetKLineRequest) GetSlugsMap() (map[string]string, error)
func (*GetKLineRequest) Granularity ¶ added in v1.54.0
func (g *GetKLineRequest) Granularity(granularity string) *GetKLineRequest
func (*GetKLineRequest) Limit ¶ added in v1.54.0
func (g *GetKLineRequest) Limit(limit string) *GetKLineRequest
func (*GetKLineRequest) StartTime ¶ added in v1.54.0
func (g *GetKLineRequest) StartTime(startTime time.Time) *GetKLineRequest
func (*GetKLineRequest) Symbol ¶ added in v1.54.0
func (g *GetKLineRequest) Symbol(symbol string) *GetKLineRequest
type GetSymbolsRequest ¶ added in v1.54.0
type GetSymbolsRequest struct {
// contains filtered or unexported fields
}
func (*GetSymbolsRequest) Do ¶ added in v1.54.0
func (g *GetSymbolsRequest) Do(ctx context.Context) ([]Symbol, error)
Do generates the request object and send the request object to the API endpoint
func (*GetSymbolsRequest) GetParameters ¶ added in v1.54.0
func (g *GetSymbolsRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetSymbolsRequest) GetParametersJSON ¶ added in v1.54.0
func (g *GetSymbolsRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetSymbolsRequest) GetParametersQuery ¶ added in v1.54.0
func (g *GetSymbolsRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetSymbolsRequest) GetPath ¶ added in v1.54.0
func (g *GetSymbolsRequest) GetPath() string
GetPath returns the request path of the API
func (*GetSymbolsRequest) GetQueryParameters ¶ added in v1.54.0
func (g *GetSymbolsRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetSymbolsRequest) GetSlugParameters ¶ added in v1.54.0
func (g *GetSymbolsRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetSymbolsRequest) GetSlugsMap ¶ added in v1.54.0
func (g *GetSymbolsRequest) GetSlugsMap() (map[string]string, error)
type GetTickersRequest ¶ added in v1.54.0
type GetTickersRequest struct {
// contains filtered or unexported fields
}
func (*GetTickersRequest) Do ¶ added in v1.54.0
func (g *GetTickersRequest) Do(ctx context.Context) ([]Ticker, error)
Do generates the request object and send the request object to the API endpoint
func (*GetTickersRequest) GetParameters ¶ added in v1.54.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.54.0
func (g *GetTickersRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetTickersRequest) GetParametersQuery ¶ added in v1.54.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.54.0
func (g *GetTickersRequest) GetPath() string
GetPath returns the request path of the API
func (*GetTickersRequest) GetQueryParameters ¶ added in v1.54.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.54.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.54.0
func (g *GetTickersRequest) GetSlugsMap() (map[string]string, error)
func (*GetTickersRequest) Symbol ¶ added in v1.54.0
func (g *GetTickersRequest) Symbol(symbol string) *GetTickersRequest
type GetTradeFillsRequest ¶ added in v1.54.0
type GetTradeFillsRequest struct {
// contains filtered or unexported fields
}
func (*GetTradeFillsRequest) Do ¶ added in v1.54.0
func (s *GetTradeFillsRequest) Do(ctx context.Context) ([]Trade, error)
Do generates the request object and send the request object to the API endpoint
func (*GetTradeFillsRequest) EndTime ¶ added in v1.54.0
func (s *GetTradeFillsRequest) EndTime(endTime time.Time) *GetTradeFillsRequest
func (*GetTradeFillsRequest) GetParameters ¶ added in v1.54.0
func (s *GetTradeFillsRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetTradeFillsRequest) GetParametersJSON ¶ added in v1.54.0
func (s *GetTradeFillsRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetTradeFillsRequest) GetParametersQuery ¶ added in v1.54.0
func (s *GetTradeFillsRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetTradeFillsRequest) GetPath ¶ added in v1.54.0
func (s *GetTradeFillsRequest) GetPath() string
GetPath returns the request path of the API
func (*GetTradeFillsRequest) GetQueryParameters ¶ added in v1.54.0
func (s *GetTradeFillsRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetTradeFillsRequest) GetSlugParameters ¶ added in v1.54.0
func (s *GetTradeFillsRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetTradeFillsRequest) GetSlugsMap ¶ added in v1.54.0
func (s *GetTradeFillsRequest) GetSlugsMap() (map[string]string, error)
func (*GetTradeFillsRequest) IdLessThan ¶ added in v1.54.0
func (s *GetTradeFillsRequest) IdLessThan(idLessThan string) *GetTradeFillsRequest
func (*GetTradeFillsRequest) Limit ¶ added in v1.54.0
func (s *GetTradeFillsRequest) Limit(limit string) *GetTradeFillsRequest
func (*GetTradeFillsRequest) OrderId ¶ added in v1.54.0
func (s *GetTradeFillsRequest) OrderId(orderId string) *GetTradeFillsRequest
func (*GetTradeFillsRequest) StartTime ¶ added in v1.54.0
func (s *GetTradeFillsRequest) StartTime(startTime time.Time) *GetTradeFillsRequest
func (*GetTradeFillsRequest) Symbol ¶ added in v1.54.0
func (s *GetTradeFillsRequest) Symbol(symbol string) *GetTradeFillsRequest
type GetUnfilledOrdersRequest ¶
type GetUnfilledOrdersRequest struct {
// contains filtered or unexported fields
}
func (*GetUnfilledOrdersRequest) Do ¶
func (g *GetUnfilledOrdersRequest) Do(ctx context.Context) ([]UnfilledOrder, error)
Do generates the request object and send the request object to the API endpoint
func (*GetUnfilledOrdersRequest) EndTime ¶
func (g *GetUnfilledOrdersRequest) EndTime(endTime time.Time) *GetUnfilledOrdersRequest
func (*GetUnfilledOrdersRequest) GetParameters ¶
func (g *GetUnfilledOrdersRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetUnfilledOrdersRequest) GetParametersJSON ¶
func (g *GetUnfilledOrdersRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetUnfilledOrdersRequest) GetParametersQuery ¶
func (g *GetUnfilledOrdersRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetUnfilledOrdersRequest) GetPath ¶ added in v1.54.0
func (g *GetUnfilledOrdersRequest) GetPath() string
GetPath returns the request path of the API
func (*GetUnfilledOrdersRequest) GetQueryParameters ¶
func (g *GetUnfilledOrdersRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetUnfilledOrdersRequest) GetSlugParameters ¶
func (g *GetUnfilledOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetUnfilledOrdersRequest) GetSlugsMap ¶
func (g *GetUnfilledOrdersRequest) GetSlugsMap() (map[string]string, error)
func (*GetUnfilledOrdersRequest) IdLessThan ¶
func (g *GetUnfilledOrdersRequest) IdLessThan(idLessThan string) *GetUnfilledOrdersRequest
func (*GetUnfilledOrdersRequest) Limit ¶
func (g *GetUnfilledOrdersRequest) Limit(limit string) *GetUnfilledOrdersRequest
func (*GetUnfilledOrdersRequest) OrderId ¶
func (g *GetUnfilledOrdersRequest) OrderId(orderId string) *GetUnfilledOrdersRequest
func (*GetUnfilledOrdersRequest) StartTime ¶
func (g *GetUnfilledOrdersRequest) StartTime(startTime time.Time) *GetUnfilledOrdersRequest
func (*GetUnfilledOrdersRequest) Symbol ¶
func (g *GetUnfilledOrdersRequest) Symbol(symbol string) *GetUnfilledOrdersRequest
type KLine ¶ added in v1.54.0
type KLine struct { // System timestamp, Unix millisecond timestamp, e.g. 1690196141868 Ts types.MillisecondTimestamp Open fixedpoint.Value High fixedpoint.Value Low fixedpoint.Value Close fixedpoint.Value // Trading volume in base currency, e.g. "BTC" in the "BTCUSD" pair. Volume fixedpoint.Value // Trading volume in quote currency, e.g. "USD" in the "BTCUSD" pair. QuoteVolume fixedpoint.Value // Trading volume in USDT UsdtVolume fixedpoint.Value }
func (*KLine) UnmarshalJSON ¶ added in v1.54.0
type KLineResponse ¶ added in v1.54.0
type KLineResponse []KLine
type OrderDetail ¶
type OrderDetail struct { UserId types.StrInt64 `json:"userId"` Symbol string `json:"symbol"` // OrderId are always numeric. It's confirmed with official customer service. https://t.me/bitgetOpenapi/24172 OrderId types.StrInt64 `json:"orderId"` ClientOrderId string `json:"clientOid"` Price fixedpoint.Value `json:"price"` // Size is base coin when orderType=limit; quote coin when orderType=market Size fixedpoint.Value `json:"size"` OrderType OrderType `json:"orderType"` Side SideType `json:"side"` Status OrderStatus `json:"status"` PriceAvg fixedpoint.Value `json:"priceAvg"` BaseVolume fixedpoint.Value `json:"baseVolume"` QuoteVolume fixedpoint.Value `json:"quoteVolume"` EnterPointSource string `json:"enterPointSource"` // The value is json string, so we unmarshal it after unmarshal OrderDetail FeeDetailRaw string `json:"feeDetail"` OrderSource string `json:"orderSource"` CreatedTime types.MillisecondTimestamp `json:"cTime"` UpdatedTime types.MillisecondTimestamp `json:"uTime"` FeeDetail FeeDetail }
func (*OrderDetail) UnmarshalJSON ¶
func (o *OrderDetail) UnmarshalJSON(data []byte) error
type OrderForce ¶
type OrderForce string
const ( OrderForceGTC OrderForce = "gtc" OrderForcePostOnly OrderForce = "post_only" OrderForceFOK OrderForce = "fok" OrderForceIOC OrderForce = "ioc" )
type OrderStatus ¶
type OrderStatus string
const ( OrderStatusInit OrderStatus = "init" OrderStatusNew OrderStatus = "new" OrderStatusLive OrderStatus = "live" OrderStatusPartialFilled OrderStatus = "partially_filled" OrderStatusFilled OrderStatus = "filled" OrderStatusCancelled OrderStatus = "cancelled" )
func (OrderStatus) IsWorking ¶
func (o OrderStatus) IsWorking() bool
type PlaceOrderRequest ¶ added in v1.54.0
type PlaceOrderRequest struct {
// contains filtered or unexported fields
}
func (*PlaceOrderRequest) ClientOrderId ¶ added in v1.54.0
func (p *PlaceOrderRequest) ClientOrderId(clientOrderId string) *PlaceOrderRequest
func (*PlaceOrderRequest) Do ¶ added in v1.54.0
func (p *PlaceOrderRequest) Do(ctx context.Context) (*PlaceOrderResponse, error)
func (*PlaceOrderRequest) Force ¶ added in v1.54.0
func (p *PlaceOrderRequest) Force(force OrderForce) *PlaceOrderRequest
func (*PlaceOrderRequest) GetParameters ¶ added in v1.54.0
func (p *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.54.0
func (p *PlaceOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*PlaceOrderRequest) GetParametersQuery ¶ added in v1.54.0
func (p *PlaceOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*PlaceOrderRequest) GetQueryParameters ¶ added in v1.54.0
func (p *PlaceOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*PlaceOrderRequest) GetSlugParameters ¶ added in v1.54.0
func (p *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.54.0
func (p *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)
func (*PlaceOrderRequest) OrderType ¶ added in v1.54.0
func (p *PlaceOrderRequest) OrderType(orderType OrderType) *PlaceOrderRequest
func (*PlaceOrderRequest) Price ¶ added in v1.54.0
func (p *PlaceOrderRequest) Price(price string) *PlaceOrderRequest
func (*PlaceOrderRequest) Side ¶ added in v1.54.0
func (p *PlaceOrderRequest) Side(side SideType) *PlaceOrderRequest
func (*PlaceOrderRequest) Size ¶ added in v1.54.0
func (p *PlaceOrderRequest) Size(size string) *PlaceOrderRequest
func (*PlaceOrderRequest) Symbol ¶ added in v1.54.0
func (p *PlaceOrderRequest) Symbol(symbol string) *PlaceOrderRequest
type PlaceOrderResponse ¶ added in v1.54.0
type Symbol ¶ added in v1.54.0
type Symbol struct { Symbol string `json:"symbol"` BaseCoin string `json:"baseCoin"` QuoteCoin string `json:"quoteCoin"` MinTradeAmount fixedpoint.Value `json:"minTradeAmount"` MaxTradeAmount fixedpoint.Value `json:"maxTradeAmount"` TakerFeeRate fixedpoint.Value `json:"takerFeeRate"` MakerFeeRate fixedpoint.Value `json:"makerFeeRate"` PricePrecision fixedpoint.Value `json:"pricePrecision"` QuantityPrecision fixedpoint.Value `json:"quantityPrecision"` QuotePrecision fixedpoint.Value `json:"quotePrecision"` MinTradeUSDT fixedpoint.Value `json:"minTradeUSDT"` Status SymbolStatus `json:"status"` BuyLimitPriceRatio fixedpoint.Value `json:"buyLimitPriceRatio"` SellLimitPriceRatio fixedpoint.Value `json:"sellLimitPriceRatio"` }
type SymbolStatus ¶ added in v1.54.0
type SymbolStatus string
const ( // SymbolStatusOffline represent market is suspended, users cannot trade. SymbolStatusOffline SymbolStatus = "offline" // SymbolStatusGray represents market is online, but user trading is not available. SymbolStatusGray SymbolStatus = "gray" // SymbolStatusOnline trading begins, users can trade. SymbolStatusOnline SymbolStatus = "online" )
type Ticker ¶ added in v1.54.0
type Ticker struct { Symbol string `json:"symbol"` High24H fixedpoint.Value `json:"high24h"` Open fixedpoint.Value `json:"open"` Low24H fixedpoint.Value `json:"low24h"` LastPr fixedpoint.Value `json:"lastPr"` QuoteVolume fixedpoint.Value `json:"quoteVolume"` BaseVolume fixedpoint.Value `json:"baseVolume"` UsdtVolume fixedpoint.Value `json:"usdtVolume"` BidPr fixedpoint.Value `json:"bidPr"` AskPr fixedpoint.Value `json:"askPr"` BidSz fixedpoint.Value `json:"bidSz"` AskSz fixedpoint.Value `json:"askSz"` OpenUtc fixedpoint.Value `json:"openUtc"` Ts types.MillisecondTimestamp `json:"ts"` ChangeUtc24H fixedpoint.Value `json:"changeUtc24h"` Change24H fixedpoint.Value `json:"change24h"` }
type Trade ¶ added in v1.54.0
type Trade struct { UserId types.StrInt64 `json:"userId"` Symbol string `json:"symbol"` OrderId types.StrInt64 `json:"orderId"` TradeId types.StrInt64 `json:"tradeId"` OrderType OrderType `json:"orderType"` Side SideType `json:"side"` PriceAvg fixedpoint.Value `json:"priceAvg"` Size fixedpoint.Value `json:"size"` Amount fixedpoint.Value `json:"amount"` FeeDetail TradeFee `json:"feeDetail"` TradeScope TradeScope `json:"tradeScope"` CreatedTime types.MillisecondTimestamp `json:"cTime"` UpdatedTime types.MillisecondTimestamp `json:"uTime"` }
type TradeFee ¶ added in v1.54.0
type TradeFee struct { // Discount or not Deduction DiscountStatus `json:"deduction"` // Transaction fee coin FeeCoin string `json:"feeCoin"` // Total transaction fee discount TotalDeductionFee fixedpoint.Value `json:"totalDeductionFee"` // Total transaction fee TotalFee fixedpoint.Value `json:"totalFee"` }
type TradeScope ¶ added in v1.54.0
type TradeScope string
const ( TradeMaker TradeScope = "maker" TradeTaker TradeScope = "taker" )
type UnfilledOrder ¶
type UnfilledOrder struct { UserId types.StrInt64 `json:"userId"` Symbol string `json:"symbol"` // OrderId are always numeric. It's confirmed with official customer service. https://t.me/bitgetOpenapi/24172 OrderId types.StrInt64 `json:"orderId"` ClientOrderId string `json:"clientOid"` PriceAvg fixedpoint.Value `json:"priceAvg"` // Size is base coin when orderType=limit; quote coin when orderType=market Size fixedpoint.Value `json:"size"` OrderType OrderType `json:"orderType"` Side SideType `json:"side"` Status OrderStatus `json:"status"` BasePrice fixedpoint.Value `json:"basePrice"` BaseVolume fixedpoint.Value `json:"baseVolume"` QuoteVolume fixedpoint.Value `json:"quoteVolume"` EnterPointSource string `json:"enterPointSource"` OrderSource string `json:"orderSource"` CreatedTime types.MillisecondTimestamp `json:"cTime"` UpdatedTime types.MillisecondTimestamp `json:"uTime"` }
Source Files ¶
- cancel_order_request.go
- cancel_order_request_requestgen.go
- client.go
- get_account_assets_request.go
- get_account_assets_request_requestgen.go
- get_history_orders_request.go
- get_history_orders_request_requestgen.go
- get_k_line.go
- get_k_line_request_requestgen.go
- get_symbols_request.go
- get_symbols_request_requestgen.go
- get_tickers_request.go
- get_tickers_request_requestgen.go
- get_trade_fills.go
- get_trade_fills_request_requestgen.go
- get_unfilled_orders_request.go
- get_unfilled_orders_request_requestgen.go
- place_order_request.go
- place_order_request_requestgen.go
- types.go