Documentation ¶
Index ¶
- func SubscribeTicker(ctx context.Context, endpoint, market, channel string, ...) error
- type ChannelRequest
- type ChannelResponse
- type ChannelResponseHeader
- type Client
- type HistoricalPrices
- type Logger
- type NewOrder
- type NewOrderResponse
- type NewTriggerOrder
- type NewTriggerOrderResponse
- type OpenOrders
- type OpenTriggerOrders
- type Order
- type OrderHistory
- type Positions
- type Subaccount
- type SubaccountBalances
- type SubaccountsList
- type TickerChannelUpdate
- type Trades
- type TransferSubaccounts
- type TriggerOrder
- type TriggerOrderHistory
- type Triggers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SubscribeTicker ¶
func SubscribeTicker(ctx context.Context, endpoint, market, channel string, outputChan chan<- *ChannelResponse[TickerChannelUpdate]) error
Types ¶
type ChannelRequest ¶
type ChannelResponse ¶
type ChannelResponse[T any] struct { ChannelResponseHeader Data *T `json:"data,omitempty"` }
type ChannelResponseHeader ¶
type HistoricalPrices ¶
type HistoricalPrices struct { Success bool `json:"success"` Result []struct { Close decimal.Decimal `json:"close"` High decimal.Decimal `json:"high"` Low decimal.Decimal `json:"low"` Open decimal.Decimal `json:"open"` StartTime time.Time `json:"startTime"` Volume decimal.Decimal `json:"volume"` } `json:"result"` }
type Logger ¶
type Logger interface { Debugf(string, ...any) Infof(string, ...any) Warnf(string, ...any) Errorf(string, ...any) Fatalf(string, ...any) }
Logger defines an interface to log. By default this is uber's zap.
func SetupLogger ¶
type NewOrder ¶
type NewOrder struct { Market string `json:"market"` Side string `json:"side"` Price decimal.Decimal `json:"price"` Type string `json:"type"` Size decimal.Decimal `json:"size"` ReduceOnly bool `json:"reduceOnly"` Ioc bool `json:"ioc"` PostOnly bool `json:"postOnly"` ExternalReferralProgram string `json:"externalReferralProgram"` }
type NewOrderResponse ¶
type NewTriggerOrder ¶
type NewTriggerOrder struct { Market string `json:"market"` Side string `json:"side"` Size decimal.Decimal `json:"size"` Type string `json:"type"` ReduceOnly bool `json:"reduceOnly"` RetryUntilFilled bool `json:"retryUntilFilled"` TriggerPrice decimal.Decimal `json:"triggerPrice,omitempty"` OrderPrice decimal.Decimal `json:"orderPrice,omitempty"` TrailValue decimal.Decimal `json:"trailValue,omitempty"` }
type NewTriggerOrderResponse ¶
type NewTriggerOrderResponse struct { Success bool `json:"success"` Result TriggerOrder `json:"result"` }
type OpenOrders ¶
type OpenTriggerOrders ¶
type OpenTriggerOrders struct { Success bool `json:"success"` Result []TriggerOrder `json:"result"` }
type Order ¶
type Order struct { CreatedAt time.Time `json:"createdAt"` FilledSize decimal.Decimal `json:"filledSize"` Future string `json:"future"` ID int64 `json:"id"` Market string `json:"market"` Price decimal.Decimal `json:"price"` AvgFillPrice decimal.Decimal `json:"avgFillPrice"` RemainingSize decimal.Decimal `json:"remainingSize"` Side string `json:"side"` Size decimal.Decimal `json:"size"` Status string `json:"status"` Type string `json:"type"` ReduceOnly bool `json:"reduceOnly"` Ioc bool `json:"ioc"` PostOnly bool `json:"postOnly"` ClientID string `json:"clientId"` }
type OrderHistory ¶
type Positions ¶
type Positions struct { Success bool `json:"success"` Result []struct { Cost decimal.Decimal `json:"cost"` EntryPrice decimal.Decimal `json:"entryPrice"` EstimatedLiquidationPrice decimal.Decimal `json:"estimatedLiquidationPrice"` Future string `json:"future"` InitialMarginRequirement decimal.Decimal `json:"initialMarginRequirement"` LongOrderSize decimal.Decimal `json:"longOrderSize"` MaintenanceMarginRequirement decimal.Decimal `json:"maintenanceMarginRequirement"` NetSize decimal.Decimal `json:"netSize"` OpenSize decimal.Decimal `json:"openSize"` RealizedPnl decimal.Decimal `json:"realizedPnl"` ShortOrderSize decimal.Decimal `json:"shortOrderSize"` Side string `json:"side"` Size decimal.Decimal `json:"size"` UnrealizedPnl decimal.Decimal `json:"unrealizedPnl"` } `json:"result"` }
type Subaccount ¶
type SubaccountBalances ¶
type SubaccountsList ¶
type TickerChannelUpdate ¶
type TransferSubaccounts ¶
type TriggerOrder ¶
type TriggerOrder struct { CreatedAt time.Time `json:"createdAt"` Error string `json:"error"` Future string `json:"future"` ID int64 `json:"id"` Market string `json:"market"` OrderID int64 `json:"orderId"` OrderPrice decimal.Decimal `json:"orderPrice"` ReduceOnly bool `json:"reduceOnly"` Side string `json:"side"` Size decimal.Decimal `json:"size"` Status string `json:"status"` TrailStart decimal.Decimal `json:"trailStart"` TrailValue decimal.Decimal `json:"trailValue"` TriggerPrice decimal.Decimal `json:"triggerPrice"` TriggeredAt string `json:"triggeredAt"` Type string `json:"type"` OrderType string `json:"orderType"` FilledSize decimal.Decimal `json:"filledSize"` AvgFillPrice decimal.Decimal `json:"avgFillPrice"` OrderStatus string `json:"orderStatus"` RetryUntilFilled bool `json:"retryUntilFilled"` }
type TriggerOrderHistory ¶
type TriggerOrderHistory struct { Success bool `json:"success"` Result []TriggerOrder `json:"result"` HasMoreData bool `json:"hasMoreData"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.