Documentation
¶
Index ¶
- type Balance
- type CancelOrderRequest
- type Candle
- type CandleSnapshotRequest
- type Client
- func (c *Client) AllMids(ctx context.Context) (map[string]string, error)
- func (c *Client) CandleSnapshot(ctx context.Context, coin string, interval string, startTime, endTime int64) ([]Candle, error)
- func (c *Client) GetBalance() (*Balance, error)
- func (c *Client) GetSpotMeta(ctx context.Context) (*SpotMeta, error)
- func (c *Client) L2Book(ctx context.Context, coin string) (*L2BookResponse, error)
- type L2BookResponse
- type L2Level
- type ModifyOrderRequest
- type OrderType
- type OrderTypeLimit
- type OrderTypeTrigger
- type PlaceOrderRequest
- type SpotMeta
- type WebsocketClient
- func (c *WebsocketClient) CancelOrder(ctx context.Context, req CancelOrderRequest) (chan hyperliquid.PostResult, error)
- func (c *WebsocketClient) ModifyOrder(ctx context.Context, req ModifyOrderRequest) (chan hyperliquid.PostResult, error)
- func (c *WebsocketClient) PlaceOrder(ctx context.Context, req PlaceOrderRequest) (chan hyperliquid.PostResult, error)
- func (c *WebsocketClient) SubscribeBbo(coin string, handler func(hyperliquid.WsBbo)) error
- func (c *WebsocketClient) SubscribeL2Book(coin string, handler func(hyperliquid.WsL2Book)) error
- func (c *WebsocketClient) SubscribeOrderUpdates(user string, handler func([]hyperliquid.WsOrderUpdate)) error
- func (c *WebsocketClient) SubscribeTrades(coin string, handler func([]hyperliquid.WsTrade)) error
- func (c *WebsocketClient) SubscribeUserEvents(user string, handler func(hyperliquid.WsUserEvent)) error
- func (c *WebsocketClient) SubscribeUserFills(user string, handler func(hyperliquid.WsUserFills)) error
- func (c *WebsocketClient) UnsubscribeBbo(coin string) error
- func (c *WebsocketClient) UnsubscribeL2Book(coin string) error
- func (c *WebsocketClient) UnsubscribeTrades(coin string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelOrderRequest ¶
type Candle ¶
type Candle struct {
T int64 `json:"t"` // Open time
TClose int64 `json:"T"` // Close time
S string `json:"s"` // Symbol
I string `json:"i"` // Interval
O string `json:"o"` // Open
C string `json:"c"` // Close
H string `json:"h"` // High
L string `json:"l"` // Low
V string `json:"v"` // Volume
N int64 `json:"n"` // Number of trades
}
type CandleSnapshotRequest ¶
type Client ¶
type Client struct {
*hyperliquid.Client
}
func (*Client) CandleSnapshot ¶
func (*Client) GetBalance ¶
type L2BookResponse ¶
type ModifyOrderRequest ¶
type ModifyOrderRequest struct {
Oid *int64
Cloid *string
Order PlaceOrderRequest
}
type OrderType ¶
type OrderType struct {
Limit *OrderTypeLimit
Trigger *OrderTypeTrigger
}
type OrderTypeLimit ¶
type OrderTypeLimit struct {
Tif hyperliquid.Tif
}
type OrderTypeTrigger ¶
type PlaceOrderRequest ¶
type SpotMeta ¶
type SpotMeta struct {
Tokens []struct {
Name string `json:"name"`
SzDecimals int `json:"szDecimals"`
WeiDecimals int `json:"weiDecimals"`
Index int `json:"index"`
TokenId string `json:"tokenId"`
IsCanonical bool `json:"isCanonical"`
FullName string `json:"fullName,omitempty"`
}
Universe []struct {
Name string `json:"name"`
Index int `json:"index"`
Tokens []int `json:"tokens"`
IsCanonical bool `json:"isCanonical"`
}
}
type WebsocketClient ¶
type WebsocketClient struct {
*hyperliquid.WebsocketClient
}
func NewWebsocketClient ¶
func NewWebsocketClient(base *hyperliquid.WebsocketClient) *WebsocketClient
func (*WebsocketClient) CancelOrder ¶
func (c *WebsocketClient) CancelOrder(ctx context.Context, req CancelOrderRequest) (chan hyperliquid.PostResult, error)
CancelOrder via WS
func (*WebsocketClient) ModifyOrder ¶
func (c *WebsocketClient) ModifyOrder(ctx context.Context, req ModifyOrderRequest) (chan hyperliquid.PostResult, error)
ModifyOrder via WS
func (*WebsocketClient) PlaceOrder ¶
func (c *WebsocketClient) PlaceOrder(ctx context.Context, req PlaceOrderRequest) (chan hyperliquid.PostResult, error)
PlaceOrder via WS
func (*WebsocketClient) SubscribeBbo ¶
func (c *WebsocketClient) SubscribeBbo(coin string, handler func(hyperliquid.WsBbo)) error
func (*WebsocketClient) SubscribeL2Book ¶
func (c *WebsocketClient) SubscribeL2Book(coin string, handler func(hyperliquid.WsL2Book)) error
Helper to subscribe to L2Book
func (*WebsocketClient) SubscribeOrderUpdates ¶
func (c *WebsocketClient) SubscribeOrderUpdates(user string, handler func([]hyperliquid.WsOrderUpdate)) error
SubscribeOrderUpdates
func (*WebsocketClient) SubscribeTrades ¶
func (c *WebsocketClient) SubscribeTrades(coin string, handler func([]hyperliquid.WsTrade)) error
SubscribeTrades
func (*WebsocketClient) SubscribeUserEvents ¶
func (c *WebsocketClient) SubscribeUserEvents(user string, handler func(hyperliquid.WsUserEvent)) error
SubscribeUserEvents
func (*WebsocketClient) SubscribeUserFills ¶
func (c *WebsocketClient) SubscribeUserFills(user string, handler func(hyperliquid.WsUserFills)) error
SubscribeUserFills
func (*WebsocketClient) UnsubscribeBbo ¶
func (c *WebsocketClient) UnsubscribeBbo(coin string) error
func (*WebsocketClient) UnsubscribeL2Book ¶
func (c *WebsocketClient) UnsubscribeL2Book(coin string) error
func (*WebsocketClient) UnsubscribeTrades ¶
func (c *WebsocketClient) UnsubscribeTrades(coin string) error
Click to show internal directories.
Click to hide internal directories.