{"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 AccountSettings struct {\n\tFuturesMakerFee string `json:\"futuresMakerFee\"`\n\tFuturesTakerFee string `json:\"futuresTakerFee\"`\n\tSpotMakerFee    string `json:\"spotMakerFee\"`\n\tSpotTakerFee    string `json:\"spotTakerFee\"`\n}\n```\n\n```go\ntype CancelOrderRequest struct {\n\tOrderID string `json:\"orderId\"`\n\tSymbol  string `json:\"symbol\"`\n}\n```\n\n```go\ntype CapitalBalance struct {\n\tAvailable string `json:\"available\"`\n\tLocked    string `json:\"locked\"`\n\tStaked    string `json:\"staked\"`\n}\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) CancelOpenOrders(ctx context.Context, symbol, marketType string) error\n```\n\n```go\nfunc (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*Order, error)\n```\n\n```go\nfunc (c *Client) ExecuteOrder(ctx context.Context, req CreateOrderRequest) (*Order, error)\n```\nExecuteOrder is a compatibility wrapper for the preferred PlaceOrder name.\n\n```go\nfunc (c *Client) GetAccount(ctx context.Context) (*AccountSettings, error)\n```\n\n```go\nfunc (c *Client) GetBalances(ctx context.Context) (map[string]CapitalBalance, error)\n```\n\n```go\nfunc (c *Client) GetDepth(ctx context.Context, symbol string, limit int) (*Depth, error)\n```\nGetDepth is a compatibility wrapper for the preferred GetOrderBook name.\n\n```go\nfunc (c *Client) GetFundingRates(ctx context.Context) ([]FundingRate, error)\n```\n\n```go\nfunc (c *Client) GetKlines(ctx context.Context, symbol, interval string, startTime, endTime int64, priceType string) ([]Kline, error)\n```\n\n```go\nfunc (c *Client) GetMarkets(ctx context.Context) ([]Market, error)\n```\n\n```go\nfunc (c *Client) GetOpenOrders(ctx context.Context, marketType, symbol string) ([]Order, error)\n```\n\n```go\nfunc (c *Client) GetOpenPositions(ctx context.Context, symbol string) ([]Position, error)\n```\n\n```go\nfunc (c *Client) GetOrderBook(ctx context.Context, symbol string, limit int) (*Depth, error)\n```\n\n```go\nfunc (c *Client) GetTicker(ctx context.Context, symbol string) (*Ticker, error)\n```\n\n```go\nfunc (c *Client) GetTrades(ctx context.Context, symbol string, limit int) ([]Trade, error)\n```\n\n```go\nfunc (c *Client) PlaceOrder(ctx context.Context, req CreateOrderRequest) (*Order, error)\n```\n\n```go\nfunc (c *Client) WithCredentials(apiKey, privateKey string) *Client\n```\n\n```go\ntype CreateOrderRequest struct {\n\tSymbol      string `json:\"symbol\"`\n\tSide        string `json:\"side\"`\n\tOrderType   string `json:\"orderType\"`\n\tQuantity    string `json:\"quantity\"`\n\tPrice       string `json:\"price,omitempty\"`\n\tTimeInForce string `json:\"timeInForce,omitempty\"`\n\tReduceOnly  bool   `json:\"reduceOnly,omitempty\"`\n\tClientID    uint32 `json:\"clientId,omitempty\"`\n}\n```\n\n```go\ntype Depth struct {\n\tAsks         [][]string `json:\"asks\"`\n\tBids         [][]string `json:\"bids\"`\n\tLastUpdateID string     `json:\"lastUpdateId\"`\n\tTimestamp    int64      `json:\"timestamp\"`\n}\n```\n\n```go\ntype DepthEvent struct {\n\tEventType       string     `json:\"e\"`\n\tEventTime       int64      `json:\"E\"`\n\tSymbol          string     `json:\"s\"`\n\tAsks            [][]string `json:\"a\"`\n\tBids            [][]string `json:\"b\"`\n\tFirstUpdateID   int64      `json:\"U\"`\n\tFinalUpdateID   int64      `json:\"u\"`\n\tEngineTimestamp int64      `json:\"T\"`\n}\n```\n\n```go\ntype FundingRate struct {\n\tSymbol               string `json:\"symbol\"`\n\tFundingRate          string `json:\"fundingRate\"`\n\tMarkPrice            string `json:\"markPrice\"`\n\tIndexPrice           string `json:\"indexPrice\"`\n\tNextFundingTimestamp int64  `json:\"nextFundingTimestamp\"`\n}\n```\n\n```go\ntype Kline struct {\n\tStart       string `json:\"start\"`\n\tEnd         string `json:\"end\"`\n\tOpen        string `json:\"open\"`\n\tHigh        string `json:\"high\"`\n\tLow         string `json:\"low\"`\n\tClose       string `json:\"close\"`\n\tVolume      string `json:\"volume\"`\n\tQuoteVolume string `json:\"quoteVolume\"`\n\tTrades      string `json:\"trades\"`\n}\n```\n\n```go\ntype Market struct {\n\tSymbol      string        `json:\"symbol\"`\n\tBaseSymbol  string        `json:\"baseSymbol\"`\n\tQuoteSymbol string        `json:\"quoteSymbol\"`\n\tMarketType  string        `json:\"marketType\"`\n\tFilters     MarketFilters `json:\"filters\"`\n\tVisible     bool          `json:\"visible\"`\n}\n```\n\n```go\ntype MarketFilters struct {\n\tPrice    PriceFilter    `json:\"price\"`\n\tQuantity QuantityFilter `json:\"quantity\"`\n}\n```\n\n```go\ntype Order struct {\n\tOrderType             string `json:\"orderType\"`\n\tID                    string `json:\"id\"`\n\tClientID              uint32 `json:\"clientId\"`\n\tCreatedAt             int64  `json:\"createdAt\"`\n\tExecutedQuantity      string `json:\"executedQuantity\"`\n\tExecutedQuoteQuantity string `json:\"executedQuoteQuantity\"`\n\tQuantity              string `json:\"quantity\"`\n\tQuoteQuantity         string `json:\"quoteQuantity\"`\n\tPrice                 string `json:\"price\"`\n\tReduceOnly            bool   `json:\"reduceOnly\"`\n\tTimeInForce           string `json:\"timeInForce\"`\n\tSide                  string `json:\"side\"`\n\tStatus                string `json:\"status\"`\n\tSymbol                string `json:\"symbol\"`\n}\n```\n\n```go\ntype OrderUpdateEvent struct {\n\tEventType             string      `json:\"e\"`\n\tEventTime             int64       `json:\"E\"`\n\tSymbol                string      `json:\"s\"`\n\tClientID              StringValue `json:\"c\"`\n\tSide                  string      `json:\"S\"`\n\tOrderType             string      `json:\"o\"`\n\tTimeInForce           string      `json:\"f\"`\n\tQuantity              string      `json:\"q\"`\n\tQuoteQuantity         string      `json:\"Q\"`\n\tPrice                 string      `json:\"p\"`\n\tOrderState            string      `json:\"X\"`\n\tOrderID               string      `json:\"i\"`\n\tTradeID               StringValue `json:\"t\"`\n\tFillQuantity          string      `json:\"l\"`\n\tExecutedQuantity      string      `json:\"z\"`\n\tExecutedQuoteQuantity string      `json:\"Z\"`\n\tFillPrice             string      `json:\"L\"`\n\tIsMaker               bool        `json:\"m\"`\n\tFee                   string      `json:\"n\"`\n\tFeeSymbol             string      `json:\"N\"`\n\tEngineTimestamp       int64       `json:\"T\"`\n\tPostOnly              bool        `json:\"y\"`\n}\n```\n\n```go\ntype Position struct {\n\tBreakEvenPrice      string `json:\"breakEvenPrice\"`\n\tEntryPrice          string `json:\"entryPrice\"`\n\tEstLiquidationPrice string `json:\"estLiquidationPrice\"`\n\tNetCost             string `json:\"netCost\"`\n\tNetQuantity         string `json:\"netQuantity\"`\n\tNetExposureQuantity string `json:\"netExposureQuantity\"`\n\tNetExposureNotional string `json:\"netExposureNotional\"`\n\tPnlRealized         string `json:\"pnlRealized\"`\n\tPnlUnrealized       string `json:\"pnlUnrealized\"`\n\tSymbol              string `json:\"symbol\"`\n\tPositionID          string `json:\"positionId\"`\n}\n```\n\n```go\ntype PositionUpdateEvent struct {\n\tEventType        string      `json:\"e\"`\n\tEventTime        int64       `json:\"E\"`\n\tSymbol           string      `json:\"s\"`\n\tBreakEvenPrice   StringValue `json:\"b\"`\n\tEntryPrice       StringValue `json:\"B\"`\n\tMarkPrice        StringValue `json:\"M\"`\n\tNetQuantity      StringValue `json:\"q\"`\n\tExposureQuantity StringValue `json:\"Q\"`\n\tExposureNotional StringValue `json:\"n\"`\n\tPositionID       string      `json:\"i\"`\n\tPnlRealized      StringValue `json:\"p\"`\n\tPnlUnrealized    StringValue `json:\"P\"`\n\tEngineTimestamp  int64       `json:\"T\"`\n}\n```\n\n```go\ntype PriceFilter struct {\n\tMinPrice string `json:\"minPrice\"`\n\tTickSize string `json:\"tickSize\"`\n}\n```\n\n```go\ntype QuantityFilter struct {\n\tMinQuantity string `json:\"minQuantity\"`\n\tStepSize    string `json:\"stepSize\"`\n}\n```\n\n```go\ntype StreamEnvelope struct {\n\tStream string          `json:\"stream\"`\n\tData   json.RawMessage `json:\"data\"`\n}\n```\n\n```go\ntype StringValue string\n```\n\n```go\nfunc (v StringValue) String() string\n```\n\n```go\nfunc (v *StringValue) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype Ticker struct {\n\tSymbol             string `json:\"symbol\"`\n\tFirstPrice         string `json:\"firstPrice\"`\n\tLastPrice          string `json:\"lastPrice\"`\n\tPriceChange        string `json:\"priceChange\"`\n\tPriceChangePercent string `json:\"priceChangePercent\"`\n\tHigh               string `json:\"high\"`\n\tLow                string `json:\"low\"`\n\tVolume             string `json:\"volume\"`\n\tQuoteVolume        string `json:\"quoteVolume\"`\n\tTrades             string `json:\"trades\"`\n}\n```\n\n```go\ntype Trade struct {\n\tID            int64  `json:\"id\"`\n\tPrice         string `json:\"price\"`\n\tQuantity      string `json:\"quantity\"`\n\tQuoteQuantity string `json:\"quoteQuantity\"`\n\tTimestamp     int64  `json:\"timestamp\"`\n\tIsBuyerMaker  bool   `json:\"isBuyerMaker\"`\n}\n```\n\n```go\ntype WSClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWSClient() *WSClient\n```\n\n```go\nfunc (c *WSClient) Close() error\n```\n\n```go\nfunc (c *WSClient) Connect(ctx context.Context) error\n```\n\n```go\nfunc (c *WSClient) Subscribe(ctx context.Context, stream string, private bool, handler func(json.RawMessage)) error\n```\n\n```go\nfunc (c *WSClient) Unsubscribe(ctx context.Context, stream string) error\n```\n\n```go\nfunc (c *WSClient) WithCredentials(apiKey, privateKey string) *WSClient\n```\n\n","path":"github.com/QuantProcessing/exchanges/sdk/backpack","name":"sdk","synopsis":"","isRedistributable":true}
