bitgetapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: AGPL-3.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

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

type CancelOrder

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

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

func (*CancelOrderRequest) ClientOrderId

func (c *CancelOrderRequest) ClientOrderId(clientOrderId string) *CancelOrderRequest

func (*CancelOrderRequest) Do

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

func (*CancelOrderRequest) GetParameters

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

func (c *CancelOrderRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*CancelOrderRequest) GetParametersQuery

func (c *CancelOrderRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*CancelOrderRequest) GetPath

func (c *CancelOrderRequest) GetPath() string

GetPath returns the request path of the API

func (*CancelOrderRequest) GetQueryParameters

func (c *CancelOrderRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*CancelOrderRequest) GetSlugParameters

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

func (c *CancelOrderRequest) GetSlugsMap() (map[string]string, error)

func (*CancelOrderRequest) OrderId

func (c *CancelOrderRequest) OrderId(orderId string) *CancelOrderRequest

func (*CancelOrderRequest) Symbol

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

func (c *Client) NewCancelOrderRequest() *CancelOrderRequest

func (*Client) NewGetAccountAssetsRequest

func (c *Client) NewGetAccountAssetsRequest() *GetAccountAssetsRequest

func (*Client) NewGetHistoryOrdersRequest

func (c *Client) NewGetHistoryOrdersRequest() *GetHistoryOrdersRequest

func (*Client) NewGetKLineRequest

func (s *Client) NewGetKLineRequest() *GetKLineRequest

func (*Client) NewGetSymbolsRequest

func (c *Client) NewGetSymbolsRequest() *GetSymbolsRequest

func (*Client) NewGetTickersRequest

func (s *Client) NewGetTickersRequest() *GetTickersRequest

func (*Client) NewGetTradeFillsRequest

func (s *Client) NewGetTradeFillsRequest() *GetTradeFillsRequest

func (*Client) NewGetUnfilledOrdersRequest

func (c *Client) NewGetUnfilledOrdersRequest() *GetUnfilledOrdersRequest

func (*Client) NewPlaceOrderRequest

func (c *Client) NewPlaceOrderRequest() *PlaceOrderRequest

type DiscountStatus

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

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

func (*GetAccountAssetsRequest) AssetType

func (*GetAccountAssetsRequest) Coin

func (*GetAccountAssetsRequest) Do

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

func (*GetAccountAssetsRequest) GetParameters

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

func (c *GetAccountAssetsRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*GetAccountAssetsRequest) GetParametersQuery

func (c *GetAccountAssetsRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*GetAccountAssetsRequest) GetPath

func (c *GetAccountAssetsRequest) GetPath() string

GetPath returns the request path of the API

func (*GetAccountAssetsRequest) GetQueryParameters

func (c *GetAccountAssetsRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*GetAccountAssetsRequest) GetSlugParameters

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

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

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

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

func (*GetKLineRequest) Do

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

func (*GetKLineRequest) EndTime

func (g *GetKLineRequest) EndTime(endTime time.Time) *GetKLineRequest

func (*GetKLineRequest) GetParameters

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

func (g *GetKLineRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*GetKLineRequest) GetParametersQuery

func (g *GetKLineRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*GetKLineRequest) GetPath

func (g *GetKLineRequest) GetPath() string

GetPath returns the request path of the API

func (*GetKLineRequest) GetQueryParameters

func (g *GetKLineRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*GetKLineRequest) GetSlugParameters

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

func (g *GetKLineRequest) GetSlugsMap() (map[string]string, error)

func (*GetKLineRequest) Granularity

func (g *GetKLineRequest) Granularity(granularity string) *GetKLineRequest

func (*GetKLineRequest) Limit

func (g *GetKLineRequest) Limit(limit string) *GetKLineRequest

func (*GetKLineRequest) StartTime

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

func (*GetKLineRequest) Symbol

func (g *GetKLineRequest) Symbol(symbol string) *GetKLineRequest

type GetSymbolsRequest

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

func (*GetSymbolsRequest) Do

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

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

func (g *GetSymbolsRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*GetSymbolsRequest) GetParametersQuery

func (g *GetSymbolsRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*GetSymbolsRequest) GetPath

func (g *GetSymbolsRequest) GetPath() string

GetPath returns the request path of the API

func (*GetSymbolsRequest) GetQueryParameters

func (g *GetSymbolsRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*GetSymbolsRequest) GetSlugParameters

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

func (g *GetSymbolsRequest) GetSlugsMap() (map[string]string, error)

type GetTickersRequest

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

func (*GetTickersRequest) Do

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

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

func (g *GetTickersRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*GetTickersRequest) GetParametersQuery

func (g *GetTickersRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*GetTickersRequest) GetPath

func (g *GetTickersRequest) GetPath() string

GetPath returns the request path of the API

func (*GetTickersRequest) GetQueryParameters

func (g *GetTickersRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*GetTickersRequest) GetSlugParameters

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

func (g *GetTickersRequest) GetSlugsMap() (map[string]string, error)

func (*GetTickersRequest) Symbol

func (g *GetTickersRequest) Symbol(symbol string) *GetTickersRequest

type GetTradeFillsRequest

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

func (*GetTradeFillsRequest) Do

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

func (*GetTradeFillsRequest) EndTime

func (s *GetTradeFillsRequest) EndTime(endTime time.Time) *GetTradeFillsRequest

func (*GetTradeFillsRequest) GetParameters

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

func (s *GetTradeFillsRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*GetTradeFillsRequest) GetParametersQuery

func (s *GetTradeFillsRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*GetTradeFillsRequest) GetPath

func (s *GetTradeFillsRequest) GetPath() string

GetPath returns the request path of the API

func (*GetTradeFillsRequest) GetQueryParameters

func (s *GetTradeFillsRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*GetTradeFillsRequest) GetSlugParameters

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

func (s *GetTradeFillsRequest) GetSlugsMap() (map[string]string, error)

func (*GetTradeFillsRequest) IdLessThan

func (s *GetTradeFillsRequest) IdLessThan(idLessThan string) *GetTradeFillsRequest

func (*GetTradeFillsRequest) Limit

func (*GetTradeFillsRequest) OrderId

func (s *GetTradeFillsRequest) OrderId(orderId string) *GetTradeFillsRequest

func (*GetTradeFillsRequest) StartTime

func (s *GetTradeFillsRequest) StartTime(startTime time.Time) *GetTradeFillsRequest

func (*GetTradeFillsRequest) Symbol

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

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

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

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

type KLineResponse

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

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

func (*PlaceOrderRequest) ClientOrderId

func (p *PlaceOrderRequest) ClientOrderId(clientOrderId string) *PlaceOrderRequest

func (*PlaceOrderRequest) Do

func (*PlaceOrderRequest) Force

func (*PlaceOrderRequest) GetParameters

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

func (p *PlaceOrderRequest) GetParametersJSON() ([]byte, error)

GetParametersJSON converts the parameters from GetParameters into the JSON format

func (*PlaceOrderRequest) GetParametersQuery

func (p *PlaceOrderRequest) GetParametersQuery() (url.Values, error)

GetParametersQuery converts the parameters from GetParameters into the url.Values format

func (*PlaceOrderRequest) GetQueryParameters

func (p *PlaceOrderRequest) GetQueryParameters() (url.Values, error)

GetQueryParameters builds and checks the query parameters and returns url.Values

func (*PlaceOrderRequest) GetSlugParameters

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

func (p *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)

func (*PlaceOrderRequest) OrderType

func (p *PlaceOrderRequest) OrderType(orderType OrderType) *PlaceOrderRequest

func (*PlaceOrderRequest) Price

func (p *PlaceOrderRequest) Price(price string) *PlaceOrderRequest

func (*PlaceOrderRequest) Side

func (*PlaceOrderRequest) Size

func (*PlaceOrderRequest) Symbol

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

type PlaceOrderResponse

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

type SideType

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

type Symbol

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

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

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

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

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

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