{"modulePath":"github.com/QuantProcessing/exchanges","version":"v0.2.20","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package spot\n\n## Types\n\n```go\ntype Balance struct {\n\tBalances []struct {\n\t\tCoin     string `json:\"coin\"`\n\t\tToken    int64  `json:\"token\"`\n\t\tHold     string `json:\"hold\"`\n\t\tTotal    string `json:\"total\"`\n\t\tEntryNtl string `json:\"entryNtl\"`\n\t}\n}\n```\n\n```go\ntype CancelOrderRequest struct {\n\tAssetID int\n\tOrderID int64\n}\n```\n\n```go\ntype CancelOrderResponse struct {\n\tStatuses hyperliquid.MixedArray `json:\"statuses\"`\n}\n```\n\n```go\ntype Candle struct {\n\tT      int64  `json:\"t\"` // Open time\n\tTClose int64  `json:\"T\"` // Close time\n\tS      string `json:\"s\"` // Symbol\n\tI      string `json:\"i\"` // Interval\n\tO      string `json:\"o\"` // Open\n\tC      string `json:\"c\"` // Close\n\tH      string `json:\"h\"` // High\n\tL      string `json:\"l\"` // Low\n\tV      string `json:\"v\"` // Volume\n\tN      int64  `json:\"n\"` // Number of trades\n}\n```\n\n```go\ntype CandleSnapshotRequest struct {\n\tCoin      string `json:\"coin\"`\n\tInterval  string `json:\"interval\"`\n\tStartTime int64  `json:\"startTime\"`\n\tEndTime   int64  `json:\"endTime\"`\n}\n```\n\n```go\ntype Client struct {\n\t*hyperliquid.Client\n}\n```\n\n```go\nfunc NewClient(base *hyperliquid.Client) *Client\n```\n\n```go\nfunc (c *Client) AllMids(ctx context.Context) (map[string]string, error)\n```\n\n```go\nfunc (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*string, error)\n```\n\n```go\nfunc (c *Client) CandleSnapshot(ctx context.Context, coin string, interval string, startTime, endTime int64) ([]Candle, error)\n```\n\n```go\nfunc (c *Client) GetBalance() (*Balance, error)\n```\n\n```go\nfunc (c *Client) GetSpotMeta(ctx context.Context) (*SpotMeta, error)\n```\n\n```go\nfunc (c *Client) L2Book(ctx context.Context, coin string) (*L2BookResponse, error)\n```\n\n```go\nfunc (c *Client) ModifyOrder(ctx context.Context, req ModifyOrderRequest) (*OrderStatus, error)\n```\n\n```go\nfunc (c *Client) PlaceOrder(ctx context.Context, req PlaceOrderRequest) (*OrderStatus, error)\n```\n\n```go\ntype L2BookResponse struct {\n\tCoin   string      `json:\"coin\"`\n\tLevels [][]L2Level `json:\"levels\"`\n\tTime   int64       `json:\"time\"`\n}\n```\n\n```go\ntype L2Level struct {\n\tPx string `json:\"px\"`\n\tSz string `json:\"sz\"`\n\tN  int    `json:\"n\"`\n}\n```\n\n```go\ntype ModifyOrderRequest struct {\n\tOid   *int64\n\tCloid *string\n\tOrder PlaceOrderRequest\n}\n```\n\n```go\ntype ModifyOrderResponse struct {\n\tStatuses []OrderStatus `json:\"statuses\"`\n}\n```\n\n```go\ntype OrderFilled struct {\n\tTotalSz string `json:\"totalSz\"`\n\tAvgPx   string `json:\"avgPx\"`\n\tOid     int    `json:\"oid\"`\n}\n```\n\n```go\ntype OrderResting struct {\n\tOid      int64   `json:\"oid\"`\n\tClientID *string `json:\"cloid\"`\n\tStatus   string  `json:\"status\"`\n}\n```\n\n```go\ntype OrderStatus struct {\n\tResting *OrderResting `json:\"resting,omitempty\"`\n\tFilled  *OrderFilled  `json:\"filled,omitempty\"`\n\tError   *string       `json:\"error,omitempty\"`\n}\n```\n\n```go\ntype OrderType struct {\n\tLimit   *OrderTypeLimit\n\tTrigger *OrderTypeTrigger\n}\n```\n\n```go\ntype OrderTypeLimit struct {\n\tTif hyperliquid.Tif\n}\n```\n\n```go\ntype OrderTypeTrigger struct {\n\tIsMarket  bool\n\tTriggerPx float64\n\tTpsl      hyperliquid.Tpsl\n}\n```\n\n```go\ntype PlaceOrderRequest struct {\n\tAssetID       int\n\tIsBuy         bool\n\tPrice         float64\n\tSize          float64\n\tOrderType     OrderType\n\tClientOrderID *string\n}\n```\n\n```go\ntype PlaceOrderResponse struct {\n\tStatuses []OrderStatus `json:\"statuses\"`\n}\n```\n\n```go\ntype SpotMeta struct {\n\tTokens []struct {\n\t\tName        string `json:\"name\"`\n\t\tSzDecimals  int    `json:\"szDecimals\"`\n\t\tWeiDecimals int    `json:\"weiDecimals\"`\n\t\tIndex       int    `json:\"index\"`\n\t\tTokenId     string `json:\"tokenId\"`\n\t\tIsCanonical bool   `json:\"isCanonical\"`\n\t\tFullName    string `json:\"fullName,omitempty\"`\n\t}\n\tUniverse []struct {\n\t\tName        string `json:\"name\"`\n\t\tIndex       int    `json:\"index\"`\n\t\tTokens      []int  `json:\"tokens\"`\n\t\tIsCanonical bool   `json:\"isCanonical\"`\n\t}\n}\n```\n\n```go\ntype WebsocketClient struct {\n\t*hyperliquid.WebsocketClient\n}\n```\n\n```go\nfunc NewWebsocketClient(base *hyperliquid.WebsocketClient) *WebsocketClient\n```\n\n```go\nfunc (c *WebsocketClient) CancelOrder(ctx context.Context, req CancelOrderRequest) (chan hyperliquid.PostResult, error)\n```\nCancelOrder via WS\n\n```go\nfunc (c *WebsocketClient) ModifyOrder(ctx context.Context, req ModifyOrderRequest) (chan hyperliquid.PostResult, error)\n```\nModifyOrder via WS\n\n```go\nfunc (c *WebsocketClient) PlaceOrder(ctx context.Context, req PlaceOrderRequest) (chan hyperliquid.PostResult, error)\n```\nPlaceOrder via WS\n\n```go\nfunc (c *WebsocketClient) SubscribeBbo(coin string, handler func(hyperliquid.WsBbo)) error\n```\n\n```go\nfunc (c *WebsocketClient) SubscribeL2Book(coin string, handler func(hyperliquid.WsL2Book)) error\n```\nHelper to subscribe to L2Book\n\n```go\nfunc (c *WebsocketClient) SubscribeOrderUpdates(user string, handler func([]hyperliquid.WsOrderUpdate)) error\n```\nSubscribeOrderUpdates\n\n```go\nfunc (c *WebsocketClient) SubscribeTrades(coin string, handler func([]hyperliquid.WsTrade)) error\n```\nSubscribeTrades\n\n```go\nfunc (c *WebsocketClient) SubscribeUserEvents(user string, handler func(hyperliquid.WsUserEvent)) error\n```\nSubscribeUserEvents\n\n```go\nfunc (c *WebsocketClient) SubscribeUserFills(user string, handler func(hyperliquid.WsUserFills)) error\n```\nSubscribeUserFills\n\n```go\nfunc (c *WebsocketClient) UnsubscribeBbo(coin string) error\n```\n\n```go\nfunc (c *WebsocketClient) UnsubscribeL2Book(coin string) error\n```\n\n```go\nfunc (c *WebsocketClient) UnsubscribeTrades(coin string) error\n```\n\n","path":"github.com/QuantProcessing/exchanges/hyperliquid/sdk/spot","name":"spot","synopsis":"","isRedistributable":true}
