{"modulePath":"github.com/QuantProcessing/exchanges","version":"v0.2.20","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sdk\n\n## Types\n\n```go\ntype AmendOrderRequest struct {\n\tCategory    string `json:\"category\"`\n\tSymbol      string `json:\"symbol\"`\n\tOrderID     string `json:\"orderId,omitempty\"`\n\tOrderLinkID string `json:\"orderLinkId,omitempty\"`\n\tQty         string `json:\"qty,omitempty\"`\n\tPrice       string `json:\"price,omitempty\"`\n}\n```\n\n```go\ntype CancelAllOrdersRequest struct {\n\tCategory   string `json:\"category\"`\n\tSymbol     string `json:\"symbol,omitempty\"`\n\tBaseCoin   string `json:\"baseCoin,omitempty\"`\n\tSettleCoin string `json:\"settleCoin,omitempty\"`\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\tOrderLinkID string `json:\"orderLinkId,omitempty\"`\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 Client struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewClient() *Client\n```\n\n```go\nfunc (c *Client) AmendOrder(ctx context.Context, req AmendOrderRequest) (*OrderActionResponse, error)\n```\n\n```go\nfunc (c *Client) CancelAllOrders(ctx context.Context, req CancelAllOrdersRequest) error\n```\n\n```go\nfunc (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*OrderActionResponse, error)\n```\n\n```go\nfunc (c *Client) GetFeeRates(ctx context.Context, category, symbol string) ([]FeeRateRecord, error)\n```\n\n```go\nfunc (c *Client) GetInstruments(ctx context.Context, category string) ([]Instrument, error)\n```\n\n```go\nfunc (c *Client) GetInstrumentsForBase(ctx context.Context, category, baseCoin string) ([]Instrument, error)\n```\n\n```go\nfunc (c *Client) GetKlines(ctx context.Context, category, symbol, interval string, start, end int64, limit int) ([]Candle, error)\n```\n\n```go\nfunc (c *Client) GetOpenOrders(ctx context.Context, category, symbol 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) GetOrderHistoryFiltered(ctx context.Context, category, symbol, orderID, orderLinkID string) ([]OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetPositions(ctx context.Context, category, symbol, settleCoin string) ([]PositionRecord, error)\n```\n\n```go\nfunc (c *Client) GetRealtimeOrders(ctx context.Context, category, symbol, settleCoin, orderID, orderLinkID string, openOnly int) ([]OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetRecentTrades(ctx context.Context, category, symbol string, limit int) ([]PublicTrade, error)\n```\n\n```go\nfunc (c *Client) GetTicker(ctx context.Context, category, symbol string) (*Ticker, error)\n```\n\n```go\nfunc (c *Client) GetWalletBalance(ctx context.Context, accountType, coin string) (*WalletBalanceResult, error)\n```\n\n```go\nfunc (c *Client) HasCredentials() bool\n```\n\n```go\nfunc (c *Client) PlaceOrder(ctx context.Context, req PlaceOrderRequest) (*OrderActionResponse, 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 string) *Client\n```\n\n```go\nfunc (c *Client) WithHTTPClient(httpClient *http.Client) *Client\n```\n\n```go\ntype ExecutionRecord struct {\n\tExecID      string `json:\"execId\"`\n\tOrderID     string `json:\"orderId\"`\n\tOrderLinkID string `json:\"orderLinkId\"`\n\tSymbol      string `json:\"symbol\"`\n\tSide        string `json:\"side\"`\n\tExecPrice   string `json:\"execPrice\"`\n\tExecQty     string `json:\"execQty\"`\n\tExecFee     string `json:\"execFee\"`\n\tFeeCurrency string `json:\"feeCurrency\"`\n\tIsMaker     bool   `json:\"isMaker\"`\n\tExecTime    string `json:\"execTime\"`\n}\n```\n\n```go\ntype FeeRateRecord struct {\n\tSymbol       string `json:\"symbol\"`\n\tMakerFeeRate string `json:\"makerFeeRate\"`\n\tTakerFeeRate string `json:\"takerFeeRate\"`\n\tBaseCoin     string `json:\"baseCoin\"`\n}\n```\n\n```go\ntype FeeRatesResult struct {\n\tList []FeeRateRecord `json:\"list\"`\n}\n```\n\n```go\ntype Instrument struct {\n\tSymbol        string        `json:\"symbol\"`\n\tBaseCoin      string        `json:\"baseCoin\"`\n\tQuoteCoin     string        `json:\"quoteCoin\"`\n\tSettleCoin    string        `json:\"settleCoin\"`\n\tStatus        string        `json:\"status\"`\n\tOptionsType   string        `json:\"optionsType\"`\n\tLaunchTime    string        `json:\"launchTime\"`\n\tDeliveryTime  string        `json:\"deliveryTime\"`\n\tDisplayName   string        `json:\"displayName\"`\n\tPriceScale    string        `json:\"priceScale\"`\n\tPriceFilter   PriceFilter   `json:\"priceFilter\"`\n\tLotSizeFilter LotSizeFilter `json:\"lotSizeFilter\"`\n}\n```\n\n```go\ntype InstrumentsResult struct {\n\tCategory       string       `json:\"category\"`\n\tList           []Instrument `json:\"list\"`\n\tNextPageCursor string       `json:\"nextPageCursor\"`\n}\n```\n\n```go\ntype KlinesResult struct {\n\tCategory string   `json:\"category\"`\n\tSymbol   string   `json:\"symbol\"`\n\tList     []Candle `json:\"list\"`\n}\n```\n\n```go\ntype LotSizeFilter struct {\n\tBasePrecision    string `json:\"basePrecision\"`\n\tQtyStep          string `json:\"qtyStep\"`\n\tMinOrderQty      string `json:\"minOrderQty\"`\n\tMinOrderAmt      string `json:\"minOrderAmt\"`\n\tMinNotionalValue string `json:\"minNotionalValue\"`\n}\n```\n\n```go\ntype NumberString string\n```\n\n```go\nfunc (n *NumberString) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype OrderActionResponse struct {\n\tOrderID     string `json:\"orderId\"`\n\tOrderLinkID string `json:\"orderLinkId\"`\n}\n```\n\n```go\ntype OrderBook struct {\n\tSymbol string           `json:\"s\"`\n\tBids   [][]NumberString `json:\"b\"`\n\tAsks   [][]NumberString `json:\"a\"`\n\tTS     int64            `json:\"ts\"`\n\tU      int64            `json:\"u\"`\n}\n```\n\n```go\ntype OrderRecord struct {\n\tOrderID            string `json:\"orderId\"`\n\tOrderLinkID        string `json:\"orderLinkId\"`\n\tSymbol             string `json:\"symbol\"`\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\tCumExecQty         string `json:\"cumExecQty\"`\n\tAvgPrice           string `json:\"avgPrice\"`\n\tOrderStatus        string `json:\"orderStatus\"`\n\tReduceOnly         bool   `json:\"reduceOnly\"`\n\tCreatedTime        string `json:\"createdTime\"`\n\tUpdatedTime        string `json:\"updatedTime\"`\n\tCumExecFee         string `json:\"cumExecFee\"`\n\tClosedPnl          string `json:\"closedPnl\"`\n\tTriggerPrice       string `json:\"triggerPrice\"`\n\tLastPriceOnCreated string `json:\"lastPriceOnCreated\"`\n}\n```\n\n```go\ntype OrdersResult struct {\n\tList           []OrderRecord `json:\"list\"`\n\tNextPageCursor string        `json:\"nextPageCursor\"`\n}\n```\n\n```go\ntype PlaceOrderRequest struct {\n\tCategory              string `json:\"category\"`\n\tSymbol                string `json:\"symbol\"`\n\tSide                  string `json:\"side\"`\n\tOrderType             string `json:\"orderType\"`\n\tQty                   string `json:\"qty\"`\n\tPrice                 string `json:\"price,omitempty\"`\n\tTimeInForce           string `json:\"timeInForce,omitempty\"`\n\tReduceOnly            bool   `json:\"reduceOnly,omitempty\"`\n\tOrderLinkID           string `json:\"orderLinkId,omitempty\"`\n\tMarketUnit            string `json:\"marketUnit,omitempty\"`\n\tSlippageToleranceType string `json:\"slippageToleranceType,omitempty\"`\n\tSlippageTolerance     string `json:\"slippageTolerance,omitempty\"`\n}\n```\n\n```go\ntype PositionRecord struct {\n\tSymbol         string `json:\"symbol\"`\n\tSide           string `json:\"side\"`\n\tSize           string `json:\"size\"`\n\tAvgPrice       string `json:\"avgPrice\"`\n\tLeverage       string `json:\"leverage\"`\n\tUnrealisedPnl  string `json:\"unrealisedPnl\"`\n\tCumRealisedPnl string `json:\"cumRealisedPnl\"`\n\tLiqPrice       string `json:\"liqPrice\"`\n}\n```\n\n```go\ntype PositionsResult struct {\n\tNextPageCursor string           `json:\"nextPageCursor\"`\n\tList           []PositionRecord `json:\"list\"`\n}\n```\n\n```go\ntype PriceFilter struct {\n\tTickSize string `json:\"tickSize\"`\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) Close() error\n```\n\n```go\nfunc (c *PrivateWSClient) Connect(ctx context.Context) error\n```\n\n```go\nfunc (c *PrivateWSClient) Subscribe(ctx context.Context, topic string, handler func(json.RawMessage)) error\n```\n\n```go\nfunc (c *PrivateWSClient) Unsubscribe(ctx context.Context, topic string) error\n```\n\n```go\nfunc (c *PrivateWSClient) WithCredentials(apiKey, secretKey string) *PrivateWSClient\n```\n\n```go\ntype PublicTrade struct {\n\tExecID string `json:\"execId\"`\n\tSymbol string `json:\"symbol\"`\n\tPrice  string `json:\"price\"`\n\tSize   string `json:\"size\"`\n\tSide   string `json:\"side\"`\n\tTime   string `json:\"time\"`\n}\n```\n\n```go\ntype PublicTradesResult struct {\n\tCategory string        `json:\"category\"`\n\tList     []PublicTrade `json:\"list\"`\n}\n```\n\n```go\ntype PublicWSClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPublicWSClient(category string) *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, topic string, handler func(json.RawMessage)) error\n```\n\n```go\nfunc (c *PublicWSClient) Unsubscribe(ctx context.Context, topic string) error\n```\n\n```go\ntype SetLeverageRequest struct {\n\tCategory     string `json:\"category\"`\n\tSymbol       string `json:\"symbol\"`\n\tBuyLeverage  string `json:\"buyLeverage\"`\n\tSellLeverage string `json:\"sellLeverage\"`\n}\n```\n\n```go\ntype Ticker struct {\n\tSymbol       string `json:\"symbol\"`\n\tLastPrice    string `json:\"lastPrice\"`\n\tBid1Price    string `json:\"bid1Price\"`\n\tAsk1Price    string `json:\"ask1Price\"`\n\tVolume24h    string `json:\"volume24h\"`\n\tTurnover24h  string `json:\"turnover24h\"`\n\tHighPrice24h string `json:\"highPrice24h\"`\n\tLowPrice24h  string `json:\"lowPrice24h\"`\n\tIndexPrice   string `json:\"indexPrice\"`\n\tMarkPrice    string `json:\"markPrice\"`\n\tTime         string `json:\"time\"`\n\tTS           string `json:\"ts\"`\n}\n```\n\n```go\ntype TickersResult struct {\n\tCategory string   `json:\"category\"`\n\tList     []Ticker `json:\"list\"`\n}\n```\n\n```go\ntype TradeWSClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewTradeWSClient() *TradeWSClient\n```\n\n```go\nfunc (c *TradeWSClient) AmendOrder(ctx context.Context, req AmendOrderRequest) error\n```\n\n```go\nfunc (c *TradeWSClient) CancelOrder(ctx context.Context, req CancelOrderRequest) error\n```\n\n```go\nfunc (c *TradeWSClient) Close() error\n```\n\n```go\nfunc (c *TradeWSClient) Connect(ctx context.Context) error\n```\n\n```go\nfunc (c *TradeWSClient) PlaceOrder(ctx context.Context, req PlaceOrderRequest) error\n```\n\n```go\nfunc (c *TradeWSClient) WithCredentials(apiKey, secretKey string) *TradeWSClient\n```\n\n```go\ntype WSEnvelope struct {\n\tTopic string          `json:\"topic\"`\n\tType  string          `json:\"type\"`\n\tTS    int64           `json:\"ts\"`\n\tData  json.RawMessage `json:\"data\"`\n}\n```\n\n```go\ntype WSExecutionMessage struct {\n\tTopic string            `json:\"topic\"`\n\tData  []ExecutionRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeExecutionMessage(payload []byte) (*WSExecutionMessage, error)\n```\n\n```go\ntype WSOrderBookData struct {\n\tSymbol   string           `json:\"s\"`\n\tBids     [][]NumberString `json:\"b\"`\n\tAsks     [][]NumberString `json:\"a\"`\n\tUpdateID int64            `json:\"u\"`\n\tSeq      int64            `json:\"seq\"`\n\tCTS      int64            `json:\"cts\"`\n}\n```\n\n```go\ntype WSOrderBookMessage struct {\n\tTopic string          `json:\"topic\"`\n\tType  string          `json:\"type\"`\n\tTS    int64           `json:\"ts\"`\n\tData  WSOrderBookData `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeOrderBookMessage(payload []byte) (*WSOrderBookMessage, error)\n```\n\n```go\ntype WSOrderMessage struct {\n\tTopic string        `json:\"topic\"`\n\tData  []OrderRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodeOrderMessage(payload []byte) (*WSOrderMessage, error)\n```\n\n```go\ntype WSPositionMessage struct {\n\tTopic string           `json:\"topic\"`\n\tData  []PositionRecord `json:\"data\"`\n}\n```\n\n```go\nfunc DecodePositionMessage(payload []byte) (*WSPositionMessage, error)\n```\n\n```go\ntype WalletAccount struct {\n\tAccountType           string       `json:\"accountType\"`\n\tTotalEquity           string       `json:\"totalEquity\"`\n\tTotalAvailableBalance string       `json:\"totalAvailableBalance\"`\n\tTotalPerpUPL          string       `json:\"totalPerpUPL\"`\n\tTotalWalletBalance    string       `json:\"totalWalletBalance\"`\n\tCoin                  []WalletCoin `json:\"coin\"`\n}\n```\n\n```go\ntype WalletBalanceResult struct {\n\tList []WalletAccount `json:\"list\"`\n}\n```\n\n```go\ntype WalletCoin struct {\n\tCoin           string `json:\"coin\"`\n\tEquity         string `json:\"equity\"`\n\tWalletBalance  string `json:\"walletBalance\"`\n\tLocked         string `json:\"locked\"`\n\tUnrealisedPnl  string `json:\"unrealisedPnl\"`\n\tCumRealisedPnl string `json:\"cumRealisedPnl\"`\n\tUsdValue       string `json:\"usdValue\"`\n}\n```\n\n","path":"github.com/QuantProcessing/exchanges/bybit/sdk","name":"sdk","synopsis":"","isRedistributable":true}
