bitgetapi

package
v1.56.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const KLinesArrayLen = 8
View Source
const (
	PrivateWebSocketURL = "wss://ws.bitget.com/v2/ws/private"
)

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 AssetType added in v1.56.0

type AssetType string
const (
	AssetTypeHoldOnly AssetType = "hold_only"
	AssetTypeHAll     AssetType = "all"
)

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

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 (*GetAccountAssetsRequest) Coin added in v1.56.0

func (*GetAccountAssetsRequest) Do added in v1.56.0

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

Do generates the request object and send the request object to the API endpoint

func (*GetHistoryOrdersRequest) EndTime

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 (*GetHistoryOrdersRequest) OrderId

func (*GetHistoryOrdersRequest) StartTime

func (g *GetHistoryOrdersRequest) StartTime(startTime time.Time) *GetHistoryOrdersRequest

func (*GetHistoryOrdersRequest) Symbol

type GetKLineRequest added in v1.54.0

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

func (*GetKLineRequest) Do added in v1.54.0

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

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 (*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

type GetUnfilledOrdersRequest

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

func (*GetUnfilledOrdersRequest) Do

Do generates the request object and send the request object to the API endpoint

func (*GetUnfilledOrdersRequest) EndTime

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 (*GetUnfilledOrdersRequest) OrderId

func (*GetUnfilledOrdersRequest) StartTime

func (*GetUnfilledOrdersRequest) Symbol

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

func (k *KLine) UnmarshalJSON(data []byte) error

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 OrderType

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

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 (*PlaceOrderRequest) Force added in v1.54.0

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 (*PlaceOrderRequest) Size added in v1.54.0

func (*PlaceOrderRequest) Symbol added in v1.54.0

func (p *PlaceOrderRequest) Symbol(symbol string) *PlaceOrderRequest

type PlaceOrderResponse added in v1.54.0

type PlaceOrderResponse struct {
	OrderId       string `json:"orderId"`
	ClientOrderId string `json:"clientOrderId"`
}

type SideType

type SideType string
const (
	SideTypeBuy  SideType = "buy"
	SideTypeSell SideType = "sell"
)

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"`
}

Jump to

Keyboard shortcuts

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