Documentation
¶
Index ¶
- type APIResponse
- type Client
- type FeeDetail
- type GetHistoryOrdersRequest
- func (g *GetHistoryOrdersRequest) Do(ctx context.Context) ([]OrderDetail, error)
- func (g *GetHistoryOrdersRequest) EndTime(endTime int64) *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) 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 int64) *GetHistoryOrdersRequest
- func (g *GetHistoryOrdersRequest) Symbol(symbol string) *GetHistoryOrdersRequest
- type GetUnfilledOrdersRequest
- func (g *GetUnfilledOrdersRequest) Do(ctx context.Context) ([]UnfilledOrder, error)
- func (g *GetUnfilledOrdersRequest) EndTime(endTime int64) *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) 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 int64) *GetUnfilledOrdersRequest
- func (g *GetUnfilledOrdersRequest) Symbol(symbol string) *GetUnfilledOrdersRequest
- type OrderDetail
- type OrderForce
- type OrderStatus
- type OrderType
- type SideType
- type UnfilledOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse = bitgetapi.APIResponse
type Client ¶
type Client struct {
Client requestgen.AuthenticatedAPIClient
}
func NewClient ¶
func NewClient(client *bitgetapi.RestClient) *Client
func (*Client) NewGetHistoryOrdersRequest ¶
func (c *Client) NewGetHistoryOrdersRequest() *GetHistoryOrdersRequest
func (*Client) NewGetUnfilledOrdersRequest ¶
func (c *Client) NewGetUnfilledOrdersRequest() *GetUnfilledOrdersRequest
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 GetHistoryOrdersRequest ¶
type GetHistoryOrdersRequest struct {
// contains filtered or unexported fields
}
func (*GetHistoryOrdersRequest) Do ¶
func (g *GetHistoryOrdersRequest) Do(ctx context.Context) ([]OrderDetail, error)
func (*GetHistoryOrdersRequest) EndTime ¶
func (g *GetHistoryOrdersRequest) EndTime(endTime int64) *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) 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 int64) *GetHistoryOrdersRequest
func (*GetHistoryOrdersRequest) Symbol ¶
func (g *GetHistoryOrdersRequest) Symbol(symbol string) *GetHistoryOrdersRequest
type GetUnfilledOrdersRequest ¶
type GetUnfilledOrdersRequest struct {
// contains filtered or unexported fields
}
func (*GetUnfilledOrdersRequest) Do ¶
func (g *GetUnfilledOrdersRequest) Do(ctx context.Context) ([]UnfilledOrder, error)
func (*GetUnfilledOrdersRequest) EndTime ¶
func (g *GetUnfilledOrdersRequest) EndTime(endTime int64) *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) 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 int64) *GetUnfilledOrdersRequest
func (*GetUnfilledOrdersRequest) Symbol ¶
func (g *GetUnfilledOrdersRequest) Symbol(symbol string) *GetUnfilledOrdersRequest
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"` CTime types.MillisecondTimestamp `json:"cTime"` UTime 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 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"` CTime types.MillisecondTimestamp `json:"cTime"` UTime types.MillisecondTimestamp `json:"uTime"` }