{"modulePath":"github.com/QuantProcessing/exchanges","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sdk\n\n## Types\n\n```go\ntype AccountAsset struct {\n\tCoin      string `json:\"coin\"`\n\tAvailable string `json:\"available\"`\n\tFrozen    string `json:\"frozen\"`\n\tLocked    string `json:\"locked\"`\n\tEquity    string `json:\"equity\"`\n\tUSDTValue string `json:\"usdtValue\"`\n\tBonus     string `json:\"bonus\"`\n}\n```\n\n```go\ntype AccountAssets struct {\n\tAccountEquity    string         `json:\"accountEquity\"`\n\tUsdtEquity       string         `json:\"usdtEquity\"`\n\tAvailable        string         `json:\"available\"`\n\tUnrealizedPL     string         `json:\"unrealizedPL\"`\n\tCoupon           string         `json:\"coupon\"`\n\tUnionTotalMargin string         `json:\"unionTotalMargin\"`\n\tAssets           []AccountAsset `json:\"assets\"`\n}\n```\n\n```go\ntype AccountFeeRate struct {\n\tMakerFeeRate string `json:\"makerFeeRate\"`\n\tTakerFeeRate string `json:\"takerFeeRate\"`\n}\n```\n\n```go\ntype AccountInfo struct {\n\tUserID      string   `json:\"userId\"`\n\tInviterID   string   `json:\"inviterId\"`\n\tParentID    string   `json:\"parentId\"`\n\tChannelCode string   `json:\"channelCode\"`\n\tChannel     string   `json:\"channel\"`\n\tIPs         string   `json:\"ips\"`\n\tPermType    string   `json:\"permType\"`\n\tPermissions []string `json:\"permissions\"`\n\tRegisTime   string   `json:\"regisTime\"`\n}\n```\n\n```go\ntype CancelAllOrdersRequest struct {\n\tCategory string `json:\"category\"`\n\tSymbol   string `json:\"symbol\"`\n}\n```\n\n```go\ntype CancelOrderRequest struct {\n\tCategory  string `json:\"category\"`\n\tSymbol    string `json:\"symbol\"`\n\tOrderID   string `json:\"orderId,omitempty\"`\n\tClientOID string `json:\"clientOid,omitempty\"`\n}\n```\n\n```go\ntype CancelOrderResponse struct {\n\tOrderID   string `json:\"orderId\"`\n\tClientOID string `json:\"clientOid\"`\n}\n```\n\n```go\ntype Candle [7]NumberString\n```\n\n```go\nfunc (c *Candle) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ClassicFillFeeDetail struct {\n\tFeeCoin           string `json:\"feeCoin\"`\n\tDeduction         string `json:\"deduction\"`\n\tTotalDeductionFee string `json:\"totalDeductionFee\"`\n\tTotalFee          string `json:\"totalFee\"`\n}\n```\n\n```go\ntype ClassicMixAccount struct {\n\tMarginCoin            string       `json:\"marginCoin\"`\n\tLocked                string       `json:\"locked\"`\n\tAvailable             string       `json:\"available\"`\n\tCrossedMaxAvailable   string       `json:\"crossedMaxAvailable\"`\n\tIsolatedMaxAvailable  string       `json:\"isolatedMaxAvailable\"`\n\tMaxTransferOut        string       `json:\"maxTransferOut\"`\n\tAccountEquity         string       `json:\"accountEquity\"`\n\tUsdtEquity            string       `json:\"usdtEquity\"`\n\tBtcEquity             string       `json:\"btcEquity\"`\n\tCrossedRiskRate       string       `json:\"crossedRiskRate\"`\n\tCrossedMarginLeverage NumberString `json:\"crossedMarginLeverage\"`\n\tIsolatedLongLever     NumberString `json:\"isolatedLongLever\"`\n\tIsolatedShortLever    NumberString `json:\"isolatedShortLever\"`\n\tMarginMode            string       `json:\"marginMode\"`\n\tPosMode               string       `json:\"posMode\"`\n\tUnrealizedPL          string       `json:\"unrealizedPL\"`\n\tCoupon                string       `json:\"coupon\"`\n\tCrossedUnrealizedPL   string       `json:\"crossedUnrealizedPL\"`\n\tIsolatedUnrealizedPL  string       `json:\"isolatedUnrealizedPL\"`\n\tGrant                 string       `json:\"grant\"`\n\tAssetMode             string       `json:\"assetMode\"`\n}\n```\n\n```go\ntype ClassicMixFillRecord struct {\n\tOrderID     string                 `json:\"orderId\"`\n\tClientOID   string                 `json:\"clientOid\"`\n\tTradeID     string                 `json:\"tradeId\"`\n\tSymbol      string                 `json:\"symbol\"`\n\tInstID      string                 `json:\"instId\"`\n\tSide        string                 `json:\"side\"`\n\tOrderType   string                 `json:\"orderType\"`\n\tPosMode     string                 `json:\"posMode\"`\n\tPrice       string                 `json:\"price\"`\n\tBaseVolume  string                 `json:\"baseVolume\"`\n\tQuoteVolume string                 `json:\"quoteVolume\"`\n\tProfit      string                 `json:\"profit\"`\n\tTradeSide   string                 `json:\"tradeSide\"`\n\tTradeScope  string                 `json:\"tradeScope\"`\n\tFeeDetail   []ClassicFillFeeDetail `json:\"feeDetail\"`\n\tCTime       string                 `json:\"cTime\"`\n\tUTime       string                 `json:\"uTime\"`\n}\n```\n\n```go\ntype ClassicMixOrderList struct {\n\tEntrustedList []ClassicMixOrderRecord `json:\"entrustedList\"`\n\tEndID         string                  `json:\"endId\"`\n}\n```\n\n```go\ntype ClassicMixOrderRecord struct {\n\tSymbol                        string      `json:\"symbol\"`\n\tInstID                        string      `json:\"instId\"`\n\tSize                          string      `json:\"size\"`\n\tOrderID                       string      `json:\"orderId\"`\n\tClientOID                     string      `json:\"clientOid\"`\n\tBaseVolume                    string      `json:\"baseVolume\"`\n\tAccBaseVolume                 string      `json:\"accBaseVolume\"`\n\tFee                           string      `json:\"fee\"`\n\tPrice                         string      `json:\"price\"`\n\tPriceAvg                      string      `json:\"priceAvg\"`\n\tStatus                        string      `json:\"status\"`\n\tSide                          string      `json:\"side\"`\n\tForce                         string      `json:\"force\"`\n\tTotalProfits                  string      `json:\"totalProfits\"`\n\tPosSide                       string      `json:\"posSide\"`\n\tMarginCoin                    string      `json:\"marginCoin\"`\n\tQuoteVolume                   string      `json:\"quoteVolume\"`\n\tLeverage                      string      `json:\"leverage\"`\n\tMarginMode                    string      `json:\"marginMode\"`\n\tReduceOnly                    string      `json:\"reduceOnly\"`\n\tEnterPointSource              string      `json:\"enterPointSource\"`\n\tTradeSide                     string      `json:\"tradeSide\"`\n\tPosMode                       string      `json:\"posMode\"`\n\tOrderType                     string      `json:\"orderType\"`\n\tOrderSource                   string      `json:\"orderSource\"`\n\tCTime                         string      `json:\"cTime\"`\n\tUTime                         string      `json:\"uTime\"`\n\tPresetStopSurplusPrice        string      `json:\"presetStopSurplusPrice\"`\n\tPresetStopSurplusType         string      `json:\"presetStopSurplusType\"`\n\tPresetStopSurplusExecutePrice string      `json:\"presetStopSurplusExecutePrice\"`\n\tPresetStopLossPrice           string      `json:\"presetStopLossPrice\"`\n\tPresetStopLossType            string      `json:\"presetStopLossType\"`\n\tPresetStopLossExecutePrice    string      `json:\"presetStopLossExecutePrice\"`\n\tFeeDetail                     []FeeDetail `json:\"feeDetail\"`\n}\n```\n\n```go\ntype ClassicMixPositionRecord struct {\n\tPosID            string `json:\"posId\"`\n\tSymbol           string `json:\"symbol\"`\n\tInstID           string `json:\"instId\"`\n\tMarginCoin       string `json:\"marginCoin\"`\n\tMarginSize       string `json:\"marginSize\"`\n\tMarginMode       string `json:\"marginMode\"`\n\tHoldSide         string `json:\"holdSide\"`\n\tPosMode          string `json:\"posMode\"`\n\tTotal            string `json:\"total\"`\n\tAvailable        string `json:\"available\"`\n\tFrozen           string `json:\"frozen\"`\n\tOpenPriceAvg     string `json:\"openPriceAvg\"`\n\tLeverage         string `json:\"leverage\"`\n\tAchievedProfits  string `json:\"achievedProfits\"`\n\tUnrealizedPL     string `json:\"unrealizedPL\"`\n\tLiquidationPrice string `json:\"liquidationPrice\"`\n\tKeepMarginRate   string `json:\"keepMarginRate\"`\n\tMarkPrice        string `json:\"markPrice\"`\n\tMarginRate       string `json:\"marginRate\"`\n\tBreakEvenPrice   string `json:\"breakEvenPrice\"`\n\tTotalFee         string `json:\"totalFee\"`\n\tDeductedFee      string `json:\"deductedFee\"`\n\tAssetMode        string `json:\"assetMode\"`\n\tAutoMargin       string `json:\"autoMargin\"`\n\tCTime            string `json:\"cTime\"`\n\tUTime            string `json:\"uTime\"`\n}\n```\n\n```go\ntype ClassicSpotAsset struct {\n\tCoin           string `json:\"coin\"`\n\tAvailable      string `json:\"available\"`\n\tFrozen         string `json:\"frozen\"`\n\tLocked         string `json:\"locked\"`\n\tLimitAvailable string `json:\"limitAvailable\"`\n\tUTime          string `json:\"uTime\"`\n}\n```\n\n```go\ntype ClassicSpotFillRecord struct {\n\tOrderID    string                 `json:\"orderId\"`\n\tClientOID  string                 `json:\"clientOid\"`\n\tTradeID    string                 `json:\"tradeId\"`\n\tSymbol     string                 `json:\"symbol\"`\n\tInstID     string                 `json:\"instId\"`\n\tOrderType  string                 `json:\"orderType\"`\n\tSide       string                 `json:\"side\"`\n\tPriceAvg   string                 `json:\"priceAvg\"`\n\tSize       string                 `json:\"size\"`\n\tAmount     string                 `json:\"amount\"`\n\tTradeScope string                 `json:\"tradeScope\"`\n\tFeeDetail  []ClassicFillFeeDetail `json:\"feeDetail\"`\n\tCTime      string                 `json:\"cTime\"`\n\tUTime      string                 `json:\"uTime\"`\n}\n```\n\n```go\ntype ClassicSpotOrderRecord struct {\n\tUserID           string             `json:\"userId\"`\n\tSymbol           string             `json:\"symbol\"`\n\tInstID           string             `json:\"instId\"`\n\tOrderID          string             `json:\"orderId\"`\n\tClientOID        string             `json:\"clientOid\"`\n\tPrice            string             `json:\"price\"`\n\tSize             string             `json:\"size\"`\n\tNewSize          string             `json:\"newSize\"`\n\tOrderType        string             `json:\"orderType\"`\n\tForce            string             `json:\"force\"`\n\tSide             string             `json:\"side\"`\n\tStatus           string             `json:\"status\"`\n\tFillPrice        string             `json:\"fillPrice\"`\n\tFillFee          string             `json:\"fillFee\"`\n\tFillFeeCoin      string             `json:\"fillFeeCoin\"`\n\tPriceAvg         string             `json:\"priceAvg\"`\n\tBasePrice        string             `json:\"basePrice\"`\n\tBaseVolume       string             `json:\"baseVolume\"`\n\tAccBaseVolume    string             `json:\"accBaseVolume\"`\n\tQuoteVolume      string             `json:\"quoteVolume\"`\n\tEnterPointSource string             `json:\"enterPointSource\"`\n\tFeeDetail        FlexibleFeeDetails `json:\"feeDetail\"`\n\tOrderSource      string             `json:\"orderSource\"`\n\tCancelReason     string             `json:\"cancelReason\"`\n\tCTime            string             `json:\"cTime\"`\n\tUTime            string             `json:\"uTime\"`\n}\n```\n\n```go\ntype ClassicWSFillMessage struct {\n\tArg    WSArg                  `json:\"arg\"`\n\tAction string                 `json:\"action\"`\n\tData   []ClassicMixFillRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeClassicWSFillMessage(payload []byte) (*ClassicWSFillMessage, error)\n```\n\n```go\ntype ClassicWSOrderMessage struct {\n\tArg    WSArg                   `json:\"arg\"`\n\tAction string                  `json:\"action\"`\n\tData   []ClassicMixOrderRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeClassicWSOrderMessage(payload []byte) (*ClassicWSOrderMessage, error)\n```\n\n```go\ntype ClassicWSPositionMessage struct {\n\tArg    WSArg                      `json:\"arg\"`\n\tAction string                     `json:\"action\"`\n\tData   []ClassicMixPositionRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeClassicWSPositionMessage(payload []byte) (*ClassicWSPositionMessage, error)\n```\n\n```go\ntype ClassicWSSpotFillMessage struct {\n\tArg    WSArg                   `json:\"arg\"`\n\tAction string                  `json:\"action\"`\n\tData   []ClassicSpotFillRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeClassicWSSpotFillMessage(payload []byte) (*ClassicWSSpotFillMessage, error)\n```\n\n```go\ntype ClassicWSSpotOrderMessage struct {\n\tArg    WSArg                    `json:\"arg\"`\n\tAction string                   `json:\"action\"`\n\tData   []ClassicSpotOrderRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeClassicWSSpotOrderMessage(payload []byte) (*ClassicWSSpotOrderMessage, error)\n```\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewClient() *Client\n```\n\n```go\nfunc (c *Client) CancelAllClassicMixOrders(ctx context.Context, productType, symbol, marginCoin string) error\n```\n\n```go\nfunc (c *Client) CancelAllClassicSpotOrders(ctx context.Context, symbol string) error\n```\n\n```go\nfunc (c *Client) CancelAllOrders(ctx context.Context, req *CancelAllOrdersRequest) error\n```\n\n```go\nfunc (c *Client) CancelClassicMixOrder(ctx context.Context, symbol, productType, marginCoin, orderID, clientOID string) (*CancelOrderResponse, error)\n```\n\n```go\nfunc (c *Client) CancelClassicSpotOrder(ctx context.Context, symbol, orderID, clientOID string) (*CancelOrderResponse, error)\n```\n\n```go\nfunc (c *Client) CancelOrder(ctx context.Context, req *CancelOrderRequest) (*CancelOrderResponse, error)\n```\n\n```go\nfunc (c *Client) GetAccountAssets(ctx context.Context) (*AccountAssets, error)\n```\n\n```go\nfunc (c *Client) GetAccountFeeRate(ctx context.Context, category, symbol string) (*AccountFeeRate, error)\n```\n\n```go\nfunc (c *Client) GetAccountInfo(ctx context.Context) (*AccountInfo, error)\n```\n\n```go\nfunc (c *Client) GetCandles(ctx context.Context, category, symbol, interval, candleType string, startTime, endTime int64, limit int) ([]Candle, error)\n```\n\n```go\nfunc (c *Client) GetClassicMixAccount(ctx context.Context, symbol, productType, marginCoin string) (*ClassicMixAccount, error)\n```\n\n```go\nfunc (c *Client) GetClassicMixOpenOrders(ctx context.Context, productType, symbol string) ([]ClassicMixOrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetClassicMixOrder(ctx context.Context, symbol, productType, orderID, clientOID string) (*ClassicMixOrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetClassicMixOrderHistory(ctx context.Context, productType, symbol string) ([]ClassicMixOrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetClassicMixPositions(ctx context.Context, productType, marginCoin string) ([]ClassicMixPositionRecord, error)\n```\n\n```go\nfunc (c *Client) GetClassicSpotAssets(ctx context.Context, coin string) ([]ClassicSpotAsset, error)\n```\n\n```go\nfunc (c *Client) GetClassicSpotOpenOrders(ctx context.Context, symbol string) ([]ClassicSpotOrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetClassicSpotOrder(ctx context.Context, orderID, clientOID string) (*ClassicSpotOrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetClassicSpotOrderHistory(ctx context.Context, symbol string) ([]ClassicSpotOrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetCurrentPositions(ctx context.Context, category, symbol string) ([]PositionRecord, error)\n```\n\n```go\nfunc (c *Client) GetFinancialRecords(ctx context.Context, req FinancialRecordsRequest) (*FinancialRecords, error)\n```\n\n```go\nfunc (c *Client) GetFundingAssets(ctx context.Context, coin string) ([]FundingAsset, error)\n```\n\n```go\nfunc (c *Client) GetHistoryFundRate(ctx context.Context, symbol, productType string, pageSize, pageNo int) ([]HistoryFundRateEntry, error)\n```\nGetHistoryFundRate retrieves historical funding rates. pageSize max 100; pageNo 1-based. Docs: [https://www.bitget.com/api-doc/contract/market/Get-History-Funding-Rate](https://www.bitget.com/api-doc/contract/market/Get-History-Funding-Rate)\n\n```go\nfunc (c *Client) GetInstruments(ctx context.Context, category, symbol string) ([]Instrument, error)\n```\n\n```go\nfunc (c *Client) GetMaxTransferable(ctx context.Context, coin string) (*MaxTransferable, error)\n```\n\n```go\nfunc (c *Client) GetOpenInterest(ctx context.Context, symbol, productType string) (*OpenInterest, error)\n```\nGetOpenInterest retrieves current open interest for a perp symbol. productType: \"USDT-FUTURES\" | \"COIN-FUTURES\" | \"USDC-FUTURES\" Docs: [https://www.bitget.com/api-doc/contract/market/Get-Open-Interest](https://www.bitget.com/api-doc/contract/market/Get-Open-Interest)\n\n```go\nfunc (c *Client) GetOpenInterestLimit(ctx context.Context, category, symbol string) (*OpenInterestLimit, error)\n```\n\n```go\nfunc (c *Client) GetOpenOrders(ctx context.Context, category, symbol string) ([]OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetOrder(ctx context.Context, category, symbol, orderID, clientOID string) (*OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetOrderBook(ctx context.Context, category, symbol string, limit int) (*OrderBook, error)\n```\n\n```go\nfunc (c *Client) GetOrderHistory(ctx context.Context, category, symbol string) ([]OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetPrivateRaw(ctx context.Context, path string, query map[string]string, out any) error\n```\nGetPrivateRaw executes an authenticated GET request for official Bitget endpoints that are SDK-covered by the raw fallback before a typed method is introduced.\n\n```go\nfunc (c *Client) GetRecentFills(ctx context.Context, category, symbol string, limit int) ([]PublicFill, error)\n```\n\n```go\nfunc (c *Client) GetSwitchStatus(ctx context.Context) (*SwitchStatus, error)\n```\n\n```go\nfunc (c *Client) GetTicker(ctx context.Context, category, symbol string) (*Ticker, error)\n```\n\n```go\nfunc (c *Client) HasCredentials() bool\n```\n\n```go\nfunc (c *Client) ModifyClassicMixOrder(ctx context.Context, req *ModifyOrderRequest, productType, marginCoin string) (*CancelOrderResponse, error)\n```\n\n```go\nfunc (c *Client) ModifyOrder(ctx context.Context, req *ModifyOrderRequest) (*CancelOrderResponse, error)\n```\n\n```go\nfunc (c *Client) PlaceClassicMixOrder(ctx context.Context, req *PlaceOrderRequest, productType, marginCoin string) (*PlaceOrderResponse, error)\n```\n\n```go\nfunc (c *Client) PlaceClassicSpotOrder(ctx context.Context, req *PlaceOrderRequest) (*PlaceOrderResponse, error)\n```\n\n```go\nfunc (c *Client) PlaceOrder(ctx context.Context, req *PlaceOrderRequest) (*PlaceOrderResponse, error)\n```\n\n```go\nfunc (c *Client) PostPrivateRaw(ctx context.Context, path string, body any, out any) error\n```\nPostPrivateRaw executes an authenticated POST request for official Bitget endpoints that are SDK-covered by the raw fallback before a typed method is introduced.\n\n```go\nfunc (c *Client) SetClassicMixLeverage(ctx context.Context, symbol, productType, marginCoin, leverage string) error\n```\n\n```go\nfunc (c *Client) SetHoldMode(ctx context.Context, holdMode string) error\n```\n\n```go\nfunc (c *Client) SetLeverage(ctx context.Context, req *SetLeverageRequest) error\n```\n\n```go\nfunc (c *Client) WithBaseURL(baseURL string) *Client\n```\n\n```go\nfunc (c *Client) WithCredentials(apiKey, secretKey, passphrase string) *Client\n```\n\n```go\nfunc (c *Client) WithHTTPClient(httpClient *http.Client) *Client\n```\n\n```go\ntype FeeDetail struct {\n\tFeeCoin string `json:\"feeCoin\"`\n\tFee     string `json:\"fee\"`\n}\n```\n\n```go\ntype FillRecord struct {\n\tCategory    string      `json:\"category\"`\n\tOrderID     string      `json:\"orderId\"`\n\tClientOID   string      `json:\"clientOid\"`\n\tExecID      string      `json:\"execId\"`\n\tExecLinkID  string      `json:\"execLinkId\"`\n\tSymbol      string      `json:\"symbol\"`\n\tOrderType   string      `json:\"orderType\"`\n\tSide        string      `json:\"side\"`\n\tHoldSide    string      `json:\"holdSide\"`\n\tTradeSide   string      `json:\"tradeSide\"`\n\tExecPrice   string      `json:\"execPrice\"`\n\tExecQty     string      `json:\"execQty\"`\n\tExecValue   string      `json:\"execValue\"`\n\tExecPnl     string      `json:\"execPnl\"`\n\tTradeScope  string      `json:\"tradeScope\"`\n\tFeeDetail   []FeeDetail `json:\"feeDetail\"`\n\tExecTime    string      `json:\"execTime\"`\n\tUpdatedTime string      `json:\"updatedTime\"`\n\tIsRPI       string      `json:\"isRPI\"`\n}\n```\n\n```go\ntype FinancialRecord struct {\n\tCategory string `json:\"category\"`\n\tID       string `json:\"id\"`\n\tSymbol   string `json:\"symbol\"`\n\tCoin     string `json:\"coin\"`\n\tType     string `json:\"type\"`\n\tAmount   string `json:\"amount\"`\n\tFee      string `json:\"fee\"`\n\tBalance  string `json:\"balance\"`\n\tTS       string `json:\"ts\"`\n}\n```\n\n```go\ntype FinancialRecords struct {\n\tList   []FinancialRecord `json:\"list\"`\n\tCursor string            `json:\"cursor\"`\n}\n```\n\n```go\ntype FinancialRecordsRequest struct {\n\tCategory  string\n\tCoin      string\n\tType      string\n\tStartTime string\n\tEndTime   string\n\tLimit     string\n\tCursor    string\n}\n```\n\n```go\ntype FlexibleFeeDetails []FeeDetail\n```\n\n```go\nfunc (f *FlexibleFeeDetails) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype FundingAsset struct {\n\tCoin      string `json:\"coin\"`\n\tAvailable string `json:\"available\"`\n\tFrozen    string `json:\"frozen\"`\n\tBalance   string `json:\"balance\"`\n}\n```\n\n```go\ntype HistoryFundRateEntry struct {\n\tSymbol      string `json:\"symbol\"`\n\tFundingRate string `json:\"fundingRate\"`\n\tFundingTime string `json:\"fundingTime\"`\n}\n```\nHistoryFundRateEntry matches one element of /api/v2/mix/market/history-fund-rate.\n\n```go\ntype Instrument struct {\n\tSymbol             string `json:\"symbol\"`\n\tCategory           string `json:\"category\"`\n\tBaseCoin           string `json:\"baseCoin\"`\n\tQuoteCoin          string `json:\"quoteCoin\"`\n\tMinOrderQty        string `json:\"minOrderQty\"`\n\tMaxOrderQty        string `json:\"maxOrderQty\"`\n\tMinOrderAmount     string `json:\"minOrderAmount\"`\n\tPricePrecision     string `json:\"pricePrecision\"`\n\tQuantityPrecision  string `json:\"quantityPrecision\"`\n\tQuotePrecision     string `json:\"quotePrecision\"`\n\tPriceMultiplier    string `json:\"priceMultiplier\"`\n\tQuantityMultiplier string `json:\"quantityMultiplier\"`\n\tMakerFeeRate       string `json:\"makerFeeRate\"`\n\tTakerFeeRate       string `json:\"takerFeeRate\"`\n\tFundInterval       string `json:\"fundInterval\"`\n\tStatus             string `json:\"status\"`\n}\n```\n\n```go\ntype MaxTransferable struct {\n\tCoin              string `json:\"coin\"`\n\tMaxTransfer       string `json:\"maxTransfer\"`\n\tBorrowMaxTransfer string `json:\"borrowMaxTransfer\"`\n}\n```\n\n```go\ntype ModifyOrderRequest struct {\n\tCategory    string `json:\"category\"`\n\tSymbol      string `json:\"symbol\"`\n\tOrderID     string `json:\"orderId,omitempty\"`\n\tClientOID   string `json:\"clientOid,omitempty\"`\n\tNewQty      string `json:\"newQty,omitempty\"`\n\tNewPrice    string `json:\"newPrice,omitempty\"`\n\tNewClientID string `json:\"newClientOid,omitempty\"`\n}\n```\n\n```go\ntype NumberString string\n```\n\n```go\nfunc (n *NumberString) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype OpenInterest struct {\n\tList []OpenInterestEntry `json:\"openInterestList\"`\n\tTS   string              `json:\"ts\"`\n}\n```\nOpenInterest matches /api/v2/mix/market/open-interest data.\n\n```go\ntype OpenInterestEntry struct {\n\tSymbol string `json:\"symbol\"`\n\tSize   string `json:\"size\"` // base-asset units\n}\n```\n\n```go\ntype OpenInterestLimit struct {\n\tSymbol           string `json:\"symbol\"`\n\tSingleUserLimit  string `json:\"singleUserLimit\"`\n\tMasterSubLimit   string `json:\"masterSubLimit\"`\n\tMarketMakerLimit string `json:\"marketMakerLimit\"`\n}\n```\n\n```go\ntype OrderBook struct {\n\tAsks [][]NumberString `json:\"a\"`\n\tBids [][]NumberString `json:\"b\"`\n\tTS   string           `json:\"ts\"`\n}\n```\n\n```go\ntype OrderList struct {\n\tList  []OrderRecord `json:\"list\"`\n\tEndID string        `json:\"endId\"`\n}\n```\n\n```go\ntype OrderRecord struct {\n\tOrderID      string      `json:\"orderId\"`\n\tClientOID    string      `json:\"clientOid\"`\n\tSymbol       string      `json:\"symbol\"`\n\tCategory     string      `json:\"category\"`\n\tSide         string      `json:\"side\"`\n\tOrderType    string      `json:\"orderType\"`\n\tTimeInForce  string      `json:\"timeInForce\"`\n\tPrice        string      `json:\"price\"`\n\tQty          string      `json:\"qty\"`\n\tAmount       string      `json:\"amount\"`\n\tBaseVolume   string      `json:\"baseVolume\"`\n\tFilledQty    string      `json:\"filledQty\"`\n\tFilledVolume string      `json:\"filledVolume\"`\n\tCumExecQty   string      `json:\"cumExecQty\"`\n\tCumExecValue string      `json:\"cumExecValue\"`\n\tOrderStatus  string      `json:\"orderStatus\"`\n\tReduceOnly   string      `json:\"reduceOnly\"`\n\tPosSide      string      `json:\"posSide\"`\n\tHoldSide     string      `json:\"holdSide\"`\n\tHoldMode     string      `json:\"holdMode\"`\n\tTradeSide    string      `json:\"tradeSide\"`\n\tMarginMode   string      `json:\"marginMode\"`\n\tMarginCoin   string      `json:\"marginCoin\"`\n\tAvgPrice     string      `json:\"avgPrice\"`\n\tFee          string      `json:\"fee\"`\n\tTotalProfit  string      `json:\"totalProfit\"`\n\tCreatedTime  string      `json:\"cTime\"`\n\tUpdatedTime  string      `json:\"uTime\"`\n\tDelegateType string      `json:\"delegateType\"`\n\tStpMode      string      `json:\"stpMode\"`\n\tFeeDetail    []FeeDetail `json:\"feeDetail\"`\n}\n```\n\n```go\ntype PlaceOrderRequest struct {\n\tCategory    string `json:\"category\"`\n\tSymbol      string `json:\"symbol\"`\n\tQty         string `json:\"qty\"`\n\tPrice       string `json:\"price,omitempty\"`\n\tSide        string `json:\"side\"`\n\tTradeSide   string `json:\"tradeSide,omitempty\"`\n\tOrderType   string `json:\"orderType\"`\n\tTimeInForce string `json:\"timeInForce,omitempty\"`\n\tMarginMode  string `json:\"marginMode,omitempty\"`\n\tMarginCoin  string `json:\"marginCoin,omitempty\"`\n\tClientOID   string `json:\"clientOid,omitempty\"`\n\tReduceOnly  string `json:\"reduceOnly,omitempty\"`\n}\n```\n\n```go\ntype PlaceOrderResponse struct {\n\tOrderID   string `json:\"orderId\"`\n\tClientOID string `json:\"clientOid\"`\n}\n```\n\n```go\ntype PositionList struct {\n\tList []PositionRecord `json:\"list\"`\n}\n```\n\n```go\ntype PositionRecord struct {\n\tSymbol           string `json:\"symbol\"`\n\tCategory         string `json:\"category\"`\n\tPosSide          string `json:\"posSide\"`\n\tHoldSide         string `json:\"holdSide\"`\n\tQty              string `json:\"qty\"`\n\tTotal            string `json:\"total\"`\n\tSize             string `json:\"size\"`\n\tAvailable        string `json:\"available\"`\n\tFrozen           string `json:\"frozen\"`\n\tAverageOpenPrice string `json:\"averageOpenPrice\"`\n\tOpenPriceAvg     string `json:\"openPriceAvg\"`\n\tAvgPrice         string `json:\"avgPrice\"`\n\tMarkPrice        string `json:\"markPrice\"`\n\tLiquidationPrice string `json:\"liquidationPrice\"`\n\tLiqPrice         string `json:\"liqPrice\"`\n\tLeverage         string `json:\"leverage\"`\n\tMarginMode       string `json:\"marginMode\"`\n\tUnrealizedPL     string `json:\"unrealizedPL\"`\n\tAchievedProfits  string `json:\"achievedProfits\"`\n\tCurRealisedPnl   string `json:\"curRealisedPnl\"`\n\tPositionStatus   string `json:\"positionStatus\"`\n\tCreatedTime      string `json:\"createdTime\"`\n\tUpdatedTime      string `json:\"updatedTime\"`\n}\n```\n\n```go\ntype PrivateWSClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPrivateWSClient() *PrivateWSClient\n```\n\n```go\nfunc (c *PrivateWSClient) CancelClassicPerpOrderWS(symbol, instType, marginCoin, orderID, clientOID string) (*CancelOrderResponse, error)\n```\n\n```go\nfunc (c *PrivateWSClient) CancelClassicSpotOrderWS(symbol, orderID, clientOID string) (*CancelOrderResponse, error)\n```\n\n```go\nfunc (c *PrivateWSClient) CancelUTAOrderWS(req *CancelOrderRequest) (*CancelOrderResponse, error)\n```\n\n```go\nfunc (c *PrivateWSClient) Close() error\n```\n\n```go\nfunc (c *PrivateWSClient) Connect(ctx context.Context) error\n```\n\n```go\nfunc (c *PrivateWSClient) PlaceClassicPerpOrderWS(req *PlaceOrderRequest, instType, marginCoin string) (*PlaceOrderResponse, error)\n```\n\n```go\nfunc (c *PrivateWSClient) PlaceClassicSpotOrderWS(req *PlaceOrderRequest) (*PlaceOrderResponse, error)\n```\n\n```go\nfunc (c *PrivateWSClient) PlaceUTAOrderWS(req *PlaceOrderRequest) (*PlaceOrderResponse, error)\n```\n\n```go\nfunc (c *PrivateWSClient) Subscribe(ctx context.Context, arg WSArg, handler func(json.RawMessage)) error\n```\n\n```go\nfunc (c *PrivateWSClient) Unsubscribe(ctx context.Context, arg WSArg) error\n```\n\n```go\nfunc (c *PrivateWSClient) WithClassicMode() *PrivateWSClient\n```\n\n```go\nfunc (c *PrivateWSClient) WithCredentials(apiKey, secretKey, passphrase string) *PrivateWSClient\n```\n\n```go\ntype PublicFill struct {\n\tExecID     string `json:\"execId\"`\n\tExecLinkID string `json:\"execLinkId\"`\n\tPrice      string `json:\"price\"`\n\tSize       string `json:\"size\"`\n\tSide       string `json:\"side\"`\n\tTimestamp  string `json:\"ts\"`\n}\n```\n\n```go\ntype PublicWSClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPublicWSClient() *PublicWSClient\n```\n\n```go\nfunc (c *PublicWSClient) Close() error\n```\n\n```go\nfunc (c *PublicWSClient) Connect(ctx context.Context) error\n```\n\n```go\nfunc (c *PublicWSClient) Subscribe(ctx context.Context, arg WSArg, handler func(json.RawMessage)) error\n```\n\n```go\nfunc (c *PublicWSClient) Unsubscribe(ctx context.Context, arg WSArg) error\n```\n\n```go\ntype SetLeverageRequest struct {\n\tSymbol   string `json:\"symbol\"`\n\tCategory string `json:\"category\"`\n\tLeverage string `json:\"leverage\"`\n}\n```\n\n```go\ntype SwitchStatus struct {\n\tStatus string `json:\"status\"`\n\tReason string `json:\"reason\"`\n}\n```\n\n```go\ntype Ticker struct {\n\tCategory     string `json:\"category\"`\n\tSymbol       string `json:\"symbol\"`\n\tTimestamp    string `json:\"ts\"`\n\tLastPrice    string `json:\"lastPrice\"`\n\tOpenPrice24h string `json:\"openPrice24h\"`\n\tHighPrice24h string `json:\"highPrice24h\"`\n\tLowPrice24h  string `json:\"lowPrice24h\"`\n\tAsk1Price    string `json:\"ask1Price\"`\n\tBid1Price    string `json:\"bid1Price\"`\n\tAsk1Size     string `json:\"ask1Size\"`\n\tBid1Size     string `json:\"bid1Size\"`\n\tVolume24h    string `json:\"volume24h\"`\n\tTurnover24h  string `json:\"turnover24h\"`\n\tIndexPrice   string `json:\"indexPrice\"`\n\tMarkPrice    string `json:\"markPrice\"`\n\tFundingRate  string `json:\"fundingRate\"`\n}\n```\n\n```go\ntype WSArg struct {\n\tInstType string `json:\"instType\"`\n\tTopic    string `json:\"topic,omitempty\"`\n\tSymbol   string `json:\"symbol,omitempty\"`\n\tChannel  string `json:\"channel,omitempty\"`\n\tInstID   string `json:\"instId,omitempty\"`\n}\n```\n\n```go\ntype WSEnvelope struct {\n\tEvent  string          `json:\"event\"`\n\tCode   NumberString    `json:\"code\"`\n\tMsg    string          `json:\"msg\"`\n\tArg    WSArg           `json:\"arg\"`\n\tAction string          `json:\"action\"`\n\tData   json.RawMessage `json:\"data\"`\n}\n```\n\n```go\ntype WSFillMessage struct {\n\tArg    WSArg        `json:\"arg\"`\n\tAction string       `json:\"action\"`\n\tData   []FillRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeFillMessage(payload []byte) (*WSFillMessage, error)\n```\n\n```go\ntype WSOrderBookData struct {\n\tAsks     [][]NumberString `json:\"a\"`\n\tBids     [][]NumberString `json:\"b\"`\n\tChecksum int64            `json:\"checksum\"`\n\tPSeq     int64            `json:\"pseq\"`\n\tSeq      int64            `json:\"seq\"`\n\tTS       string           `json:\"ts\"`\n}\n```\n\n```go\ntype WSOrderBookMessage struct {\n\tArg    WSArg             `json:\"arg\"`\n\tAction string            `json:\"action\"`\n\tData   []WSOrderBookData `json:\"data\"`\n\tTS     int64             `json:\"ts\"`\n}\n```\n\n```go\nfunc DecodeOrderBookMessage(payload []byte) (*WSOrderBookMessage, error)\n```\n\n```go\ntype WSOrderMessage struct {\n\tArg    WSArg         `json:\"arg\"`\n\tAction string        `json:\"action\"`\n\tData   []OrderRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeOrderMessage(payload []byte) (*WSOrderMessage, error)\n```\n\n```go\ntype WSPositionMessage struct {\n\tArg    WSArg            `json:\"arg\"`\n\tAction string           `json:\"action\"`\n\tData   []PositionRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodePositionMessage(payload []byte) (*WSPositionMessage, error)\n```\n\n","path":"github.com/QuantProcessing/exchanges/sdk/bitget","name":"sdk","synopsis":"","isRedistributable":true}
