Documentation ¶
Index ¶
- Constants
- Variables
- func Float32Pointer(value float32) *float32
- func Float64Pointer(value float64) *float64
- func Int32Pointer(value int32) *int32
- func Int64Pointer(value int64) *int64
- func IntPointer(value int) *int
- func StringPointer(value string) *string
- type Client
- func (c *Client) Auth(ctx context.Context) (result models.AuthResponse, err error)
- func (c *Client) Buy(ctx context.Context, params *models.BuyParams) (result models.BuyResponse, err error)
- func (c *Client) Call(ctx context.Context, method string, params interface{}, result interface{}) (err error)
- func (c *Client) Cancel(ctx context.Context, params *models.CancelParams) (result models.Order, err error)
- func (c *Client) CancelAll(ctx context.Context) (result uint, err error)
- func (c *Client) CancelAllByCurrency(ctx context.Context, params *models.CancelAllByCurrencyParams) (result uint, err error)
- func (c *Client) CancelAllByInstrument(ctx context.Context, params *models.CancelAllByInstrumentParams) (result uint, err error)
- func (c *Client) CancelAllByLabel(ctx context.Context, params *models.CancelAllByInstrumentParams) (result uint, err error)
- func (c *Client) CancelTransferByID(ctx context.Context, params *models.CancelTransferByIDParams) (result models.Transfer, err error)
- func (c *Client) CancelWithdrawal(ctx context.Context, params *models.CancelWithdrawalParams) (result models.Withdrawal, err error)
- func (c *Client) ChangeSubaccountName(ctx context.Context, params *models.ChangeSubaccountNameParams) (result string, err error)
- func (c *Client) ClosePosition(ctx context.Context, params *models.ClosePositionParams) (result models.ClosePositionResponse, err error)
- func (c *Client) CreateDepositAddress(ctx context.Context, params *models.CreateDepositAddressParams) (result models.DepositAddress, err error)
- func (c *Client) CreateSubaccount(ctx context.Context) (result models.Subaccount, err error)
- func (c *Client) DisableCancelOnDisconnect(ctx context.Context, params *models.SessionParams) (result string, err error)
- func (c *Client) DisableHeartbeat(ctx context.Context) (result string, err error)
- func (c *Client) DisableTfaForSubaccount(ctx context.Context, params *models.DisableTfaForSubaccountParams) (result string, err error)
- func (c *Client) Edit(ctx context.Context, params *models.EditParams) (result models.EditResponse, err error)
- func (c *Client) EditByLabel(ctx context.Context, params *models.EditParams) (result models.EditResponse, err error)
- func (c *Client) Emit(event interface{}, arguments ...interface{}) *emission.Emitter
- func (c *Client) EnableCancelOnDisconnect(ctx context.Context, params *models.SessionParams) (result string, err error)
- func (c *Client) GetAccountSummary(ctx context.Context, params *models.GetAccountSummaryParams) (result models.AccountSummary, err error)
- func (c *Client) GetAnnouncements(ctx context.Context) (result []models.Announcement, err error)
- func (c *Client) GetBookSummaryByCurrency(ctx context.Context, params *models.GetBookSummaryByCurrencyParams) (result []models.BookSummary, err error)
- func (c *Client) GetBookSummaryByInstrument(ctx context.Context, params *models.GetBookSummaryByInstrumentParams) (result []models.BookSummary, err error)
- func (c *Client) GetContractSize(ctx context.Context, params *models.GetContractSizeParams) (result models.GetContractSizeResponse, err error)
- func (c *Client) GetCurrencies(ctx context.Context) (result []models.Currency, err error)
- func (c *Client) GetCurrentDepositAddress(ctx context.Context, params *models.GetCurrentDepositAddressParams) (result models.DepositAddress, err error)
- func (c *Client) GetDeposits(ctx context.Context, params *models.GetDepositsParams) (result models.GetDepositsResponse, err error)
- func (c *Client) GetEmailLanguage(ctx context.Context) (result string, err error)
- func (c *Client) GetFundingChartData(ctx context.Context, params *models.GetFundingChartDataParams) (result models.GetFundingChartDataResponse, err error)
- func (c *Client) GetHistoricalVolatility(ctx context.Context, params *models.GetHistoricalVolatilityParams) (result models.GetHistoricalVolatilityResponse, err error)
- func (c *Client) GetIndex(ctx context.Context, params *models.GetIndexParams) (result models.GetIndexResponse, err error)
- func (c *Client) GetInstruments(ctx context.Context, params *models.GetInstrumentsParams) (result []models.Instrument, err error)
- func (c *Client) GetLastSettlementsByCurrency(ctx context.Context, params *models.GetLastSettlementsByCurrencyParams) (result models.GetLastSettlementsResponse, err error)
- func (c *Client) GetLastSettlementsByInstrument(ctx context.Context, params *models.GetLastSettlementsByInstrumentParams) (result models.GetLastSettlementsResponse, err error)
- func (c *Client) GetLastTradesByCurrency(ctx context.Context, params *models.GetLastTradesByCurrencyParams) (result models.GetLastTradesResponse, err error)
- func (c *Client) GetLastTradesByCurrencyAndTime(ctx context.Context, params *models.GetLastTradesByCurrencyAndTimeParams) (result models.GetLastTradesResponse, err error)
- func (c *Client) GetLastTradesByInstrument(ctx context.Context, params *models.GetLastTradesByInstrumentParams) (result models.GetLastTradesResponse, err error)
- func (c *Client) GetLastTradesByInstrumentAndTime(ctx context.Context, params *models.GetLastTradesByInstrumentAndTimeParams) (result models.GetLastTradesResponse, err error)
- func (c *Client) GetMargins(ctx context.Context, params *models.GetMarginsParams) (result models.GetMarginsResponse, err error)
- func (c *Client) GetNewAnnouncements(ctx context.Context) (result []models.Announcement, err error)
- func (c *Client) GetOpenOrdersByCurrency(ctx context.Context, params *models.GetOpenOrdersByCurrencyParams) (result []models.Order, err error)
- func (c *Client) GetOpenOrdersByInstrument(ctx context.Context, params *models.GetOpenOrdersByInstrumentParams) (result []models.Order, err error)
- func (c *Client) GetOrderBook(ctx context.Context, params *models.GetOrderBookParams) (result models.GetOrderBookResponse, err error)
- func (c *Client) GetOrderHistoryByCurrency(ctx context.Context, params *models.GetOrderHistoryByCurrencyParams) (result []models.Order, err error)
- func (c *Client) GetOrderHistoryByInstrument(ctx context.Context, params *models.GetOrderHistoryByInstrumentParams) (result []models.Order, err error)
- func (c *Client) GetOrderMarginByIDs(ctx context.Context, params *models.GetOrderMarginByIDsParams) (result models.GetOrderMarginByIDsResponse, err error)
- func (c *Client) GetOrderState(ctx context.Context, params *models.GetOrderStateParams) (result models.Order, err error)
- func (c *Client) GetPosition(ctx context.Context, params *models.GetPositionParams) (result models.Position, err error)
- func (c *Client) GetPositions(ctx context.Context, params *models.GetPositionsParams) (result []models.Position, err error)
- func (c *Client) GetSettlementHistoryByCurrency(ctx context.Context, params *models.GetSettlementHistoryByCurrencyParams) (result models.GetSettlementHistoryResponse, err error)
- func (c *Client) GetSettlementHistoryByInstrument(ctx context.Context, params *models.GetSettlementHistoryByInstrumentParams) (result models.GetSettlementHistoryResponse, err error)
- func (c *Client) GetSubaccounts(ctx context.Context, params *models.GetSubaccountsParams) (result []models.Subaccount, err error)
- func (c *Client) GetTime(ctx context.Context) (result int64, err error)
- func (c *Client) GetTradeVolumes(ctx context.Context, params *models.GetTradeVolumesParams) (result models.GetTradeVolumesResponse, err error)
- func (c *Client) GetTradingviewChartData(ctx context.Context, params *models.GetTradingviewChartDataParams) (result models.GetTradingviewChartDataResponse, err error)
- func (c *Client) GetTransfers(ctx context.Context, params *models.GetTransfersParams) (result models.GetTransfersResponse, err error)
- func (c *Client) GetUserTradesByCurrency(ctx context.Context, params *models.GetUserTradesByCurrencyParams) (result models.GetUserTradesResponse, err error)
- func (c *Client) GetUserTradesByCurrencyAndTime(ctx context.Context, params *models.GetUserTradesByCurrencyAndTimeParams) (result models.GetUserTradesResponse, err error)
- func (c *Client) GetUserTradesByInstrument(ctx context.Context, params *models.GetUserTradesByInstrumentParams) (result models.GetUserTradesResponse, err error)
- func (c *Client) GetUserTradesByInstrumentAndTime(ctx context.Context, params *models.GetUserTradesByInstrumentAndTimeParams) (result models.GetUserTradesResponse, err error)
- func (c *Client) GetUserTradesByOrder(ctx context.Context, params *models.GetUserTradesByOrderParams) (result models.GetUserTradesResponse, err error)
- func (c *Client) GetWithdrawals(ctx context.Context, params *models.GetWithdrawalsParams) (result []models.Withdrawal, err error)
- func (c *Client) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request)
- func (c *Client) Hello(ctx context.Context, params *models.HelloParams) (result models.HelloResponse, err error)
- func (c *Client) IsConnected() bool
- func (c *Client) Logout(ctx context.Context) (err error)
- func (c *Client) Off(event interface{}, listener interface{}) *emission.Emitter
- func (c *Client) On(event interface{}, listener interface{}) *emission.Emitter
- func (c *Client) PrivateSubscribe(ctx context.Context, params *models.SubscribeParams) (result models.SubscribeResponse, err error)
- func (c *Client) PrivateUnsubscribe(ctx context.Context, params *models.UnsubscribeParams) (result models.UnsubscribeResponse, err error)
- func (c *Client) PublicSubscribe(ctx context.Context, params *models.SubscribeParams) (result models.SubscribeResponse, err error)
- func (c *Client) PublicUnsubscribe(ctx context.Context, params *models.UnsubscribeParams) (result models.UnsubscribeResponse, err error)
- func (c *Client) ResetConnection()
- func (c *Client) Sell(ctx context.Context, params *models.SellParams) (result models.SellResponse, err error)
- func (c *Client) SetAnnouncementAsRead(ctx context.Context, params *models.SetAnnouncementAsReadParams) (result string, err error)
- func (c *Client) SetEmailForSubaccount(ctx context.Context, params *models.SetEmailForSubaccountParams) (result string, err error)
- func (c *Client) SetEmailLanguage(ctx context.Context, params *models.SetEmailLanguageParams) (result string, err error)
- func (c *Client) SetHeartbeat(ctx context.Context, params *models.SetHeartbeatParams) (result string, err error)
- func (c *Client) SetPasswordForSubaccount(ctx context.Context, params *models.SetPasswordForSubaccountParams) (result string, err error)
- func (c *Client) Start() error
- func (c *Client) Stop()
- func (c *Client) Subscribe(channels []string) error
- func (c *Client) Test(ctx context.Context) (result models.TestResponse, err error)
- func (c *Client) Ticker(ctx context.Context, params *models.TickerParams) (result models.TickerResponse, err error)
- func (c *Client) ToggleNotificationsFromSubaccount(ctx context.Context, params *models.ToggleNotificationsFromSubaccountParams) (result string, err error)
- func (c *Client) ToggleSubaccountLogin(ctx context.Context, params *models.ToggleSubaccountLoginParams) (result string, err error)
- func (c *Client) Withdraw(ctx context.Context, params *models.WithdrawParams) (result models.Withdrawal, err error)
- type Configuration
- type Event
Constants ¶
View Source
const ( RealBaseURL = "wss://www.deribit.com/ws/api/v2/" TestBaseURL = "wss://test.deribit.com/ws/api/v2/" )
Variables ¶
View Source
var ( ErrAuthenticationIsRequired = errors.New("authentication is required") ErrNotConnected = errors.New("not connected") )
Functions ¶
func Float32Pointer ¶
func Float64Pointer ¶
func Int32Pointer ¶
func Int64Pointer ¶
func IntPointer ¶
func StringPointer ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(l *zap.SugaredLogger, cfg *Configuration) *Client
func (*Client) Call ¶
func (c *Client) Call(ctx context.Context, method string, params interface{}, result interface{}) (err error)
Call issues JSONRPC v2 calls
func (*Client) CancelAllByCurrency ¶
func (*Client) CancelAllByInstrument ¶
func (*Client) CancelAllByLabel ¶
func (*Client) CancelTransferByID ¶
func (*Client) CancelWithdrawal ¶
func (c *Client) CancelWithdrawal(ctx context.Context, params *models.CancelWithdrawalParams) (result models.Withdrawal, err error)
func (*Client) ChangeSubaccountName ¶
func (*Client) ClosePosition ¶
func (c *Client) ClosePosition(ctx context.Context, params *models.ClosePositionParams) (result models.ClosePositionResponse, err error)
func (*Client) CreateDepositAddress ¶
func (c *Client) CreateDepositAddress(ctx context.Context, params *models.CreateDepositAddressParams) (result models.DepositAddress, err error)
func (*Client) CreateSubaccount ¶
func (*Client) DisableCancelOnDisconnect ¶
func (*Client) DisableHeartbeat ¶
func (*Client) DisableTfaForSubaccount ¶
func (*Client) Edit ¶
func (c *Client) Edit(ctx context.Context, params *models.EditParams) (result models.EditResponse, err error)
func (*Client) EditByLabel ¶
func (c *Client) EditByLabel(ctx context.Context, params *models.EditParams) (result models.EditResponse, err error)
func (*Client) EnableCancelOnDisconnect ¶
func (*Client) GetAccountSummary ¶
func (c *Client) GetAccountSummary(ctx context.Context, params *models.GetAccountSummaryParams) (result models.AccountSummary, err error)
func (*Client) GetAnnouncements ¶
func (*Client) GetBookSummaryByCurrency ¶
func (c *Client) GetBookSummaryByCurrency(ctx context.Context, params *models.GetBookSummaryByCurrencyParams) (result []models.BookSummary, err error)
func (*Client) GetBookSummaryByInstrument ¶
func (c *Client) GetBookSummaryByInstrument(ctx context.Context, params *models.GetBookSummaryByInstrumentParams) (result []models.BookSummary, err error)
func (*Client) GetContractSize ¶
func (c *Client) GetContractSize(ctx context.Context, params *models.GetContractSizeParams) (result models.GetContractSizeResponse, err error)
func (*Client) GetCurrencies ¶
func (*Client) GetCurrentDepositAddress ¶
func (c *Client) GetCurrentDepositAddress(ctx context.Context, params *models.GetCurrentDepositAddressParams) (result models.DepositAddress, err error)
func (*Client) GetDeposits ¶
func (c *Client) GetDeposits(ctx context.Context, params *models.GetDepositsParams) (result models.GetDepositsResponse, err error)
func (*Client) GetEmailLanguage ¶
func (*Client) GetFundingChartData ¶
func (c *Client) GetFundingChartData(ctx context.Context, params *models.GetFundingChartDataParams) (result models.GetFundingChartDataResponse, err error)
func (*Client) GetHistoricalVolatility ¶
func (c *Client) GetHistoricalVolatility(ctx context.Context, params *models.GetHistoricalVolatilityParams) (result models.GetHistoricalVolatilityResponse, err error)
func (*Client) GetIndex ¶
func (c *Client) GetIndex(ctx context.Context, params *models.GetIndexParams) (result models.GetIndexResponse, err error)
func (*Client) GetInstruments ¶
func (c *Client) GetInstruments(ctx context.Context, params *models.GetInstrumentsParams) (result []models.Instrument, err error)
func (*Client) GetLastSettlementsByCurrency ¶
func (c *Client) GetLastSettlementsByCurrency(ctx context.Context, params *models.GetLastSettlementsByCurrencyParams) (result models.GetLastSettlementsResponse, err error)
func (*Client) GetLastSettlementsByInstrument ¶
func (c *Client) GetLastSettlementsByInstrument(ctx context.Context, params *models.GetLastSettlementsByInstrumentParams) (result models.GetLastSettlementsResponse, err error)
func (*Client) GetLastTradesByCurrency ¶
func (c *Client) GetLastTradesByCurrency(ctx context.Context, params *models.GetLastTradesByCurrencyParams) (result models.GetLastTradesResponse, err error)
func (*Client) GetLastTradesByCurrencyAndTime ¶
func (c *Client) GetLastTradesByCurrencyAndTime(ctx context.Context, params *models.GetLastTradesByCurrencyAndTimeParams) (result models.GetLastTradesResponse, err error)
func (*Client) GetLastTradesByInstrument ¶
func (c *Client) GetLastTradesByInstrument(ctx context.Context, params *models.GetLastTradesByInstrumentParams) (result models.GetLastTradesResponse, err error)
func (*Client) GetLastTradesByInstrumentAndTime ¶
func (c *Client) GetLastTradesByInstrumentAndTime(ctx context.Context, params *models.GetLastTradesByInstrumentAndTimeParams) (result models.GetLastTradesResponse, err error)
func (*Client) GetMargins ¶
func (c *Client) GetMargins(ctx context.Context, params *models.GetMarginsParams) (result models.GetMarginsResponse, err error)
func (*Client) GetNewAnnouncements ¶
func (*Client) GetOpenOrdersByCurrency ¶
func (*Client) GetOpenOrdersByInstrument ¶
func (*Client) GetOrderBook ¶
func (c *Client) GetOrderBook(ctx context.Context, params *models.GetOrderBookParams) (result models.GetOrderBookResponse, err error)
func (*Client) GetOrderHistoryByCurrency ¶
func (*Client) GetOrderHistoryByInstrument ¶
func (*Client) GetOrderMarginByIDs ¶
func (c *Client) GetOrderMarginByIDs(ctx context.Context, params *models.GetOrderMarginByIDsParams) (result models.GetOrderMarginByIDsResponse, err error)
func (*Client) GetOrderState ¶
func (*Client) GetPosition ¶
func (*Client) GetPositions ¶
func (*Client) GetSettlementHistoryByCurrency ¶
func (c *Client) GetSettlementHistoryByCurrency(ctx context.Context, params *models.GetSettlementHistoryByCurrencyParams) (result models.GetSettlementHistoryResponse, err error)
func (*Client) GetSettlementHistoryByInstrument ¶
func (c *Client) GetSettlementHistoryByInstrument(ctx context.Context, params *models.GetSettlementHistoryByInstrumentParams) (result models.GetSettlementHistoryResponse, err error)
func (*Client) GetSubaccounts ¶
func (c *Client) GetSubaccounts(ctx context.Context, params *models.GetSubaccountsParams) (result []models.Subaccount, err error)
func (*Client) GetTradeVolumes ¶
func (c *Client) GetTradeVolumes(ctx context.Context, params *models.GetTradeVolumesParams) (result models.GetTradeVolumesResponse, err error)
func (*Client) GetTradingviewChartData ¶
func (c *Client) GetTradingviewChartData(ctx context.Context, params *models.GetTradingviewChartDataParams) (result models.GetTradingviewChartDataResponse, err error)
func (*Client) GetTransfers ¶
func (c *Client) GetTransfers(ctx context.Context, params *models.GetTransfersParams) (result models.GetTransfersResponse, err error)
func (*Client) GetUserTradesByCurrency ¶
func (c *Client) GetUserTradesByCurrency(ctx context.Context, params *models.GetUserTradesByCurrencyParams) (result models.GetUserTradesResponse, err error)
func (*Client) GetUserTradesByCurrencyAndTime ¶
func (c *Client) GetUserTradesByCurrencyAndTime(ctx context.Context, params *models.GetUserTradesByCurrencyAndTimeParams) (result models.GetUserTradesResponse, err error)
func (*Client) GetUserTradesByInstrument ¶
func (c *Client) GetUserTradesByInstrument(ctx context.Context, params *models.GetUserTradesByInstrumentParams) (result models.GetUserTradesResponse, err error)
func (*Client) GetUserTradesByInstrumentAndTime ¶
func (c *Client) GetUserTradesByInstrumentAndTime(ctx context.Context, params *models.GetUserTradesByInstrumentAndTimeParams) (result models.GetUserTradesResponse, err error)
func (*Client) GetUserTradesByOrder ¶
func (c *Client) GetUserTradesByOrder(ctx context.Context, params *models.GetUserTradesByOrderParams) (result models.GetUserTradesResponse, err error)
func (*Client) GetWithdrawals ¶
func (c *Client) GetWithdrawals(ctx context.Context, params *models.GetWithdrawalsParams) (result []models.Withdrawal, err error)
func (*Client) Hello ¶
func (c *Client) Hello(ctx context.Context, params *models.HelloParams) (result models.HelloResponse, err error)
func (*Client) IsConnected ¶
IsConnected returns the WebSocket connection state
func (*Client) PrivateSubscribe ¶
func (c *Client) PrivateSubscribe(ctx context.Context, params *models.SubscribeParams) (result models.SubscribeResponse, err error)
func (*Client) PrivateUnsubscribe ¶
func (c *Client) PrivateUnsubscribe(ctx context.Context, params *models.UnsubscribeParams) (result models.UnsubscribeResponse, err error)
func (*Client) PublicSubscribe ¶
func (c *Client) PublicSubscribe(ctx context.Context, params *models.SubscribeParams) (result models.SubscribeResponse, err error)
func (*Client) PublicUnsubscribe ¶
func (c *Client) PublicUnsubscribe(ctx context.Context, params *models.UnsubscribeParams) (result models.UnsubscribeResponse, err error)
func (*Client) ResetConnection ¶ added in v1.1.1
func (c *Client) ResetConnection()
ResetConnection force reconnect
func (*Client) Sell ¶
func (c *Client) Sell(ctx context.Context, params *models.SellParams) (result models.SellResponse, err error)
func (*Client) SetAnnouncementAsRead ¶
func (*Client) SetEmailForSubaccount ¶
func (*Client) SetEmailLanguage ¶
func (*Client) SetHeartbeat ¶
func (*Client) SetPasswordForSubaccount ¶
func (*Client) Ticker ¶
func (c *Client) Ticker(ctx context.Context, params *models.TickerParams) (result models.TickerResponse, err error)
func (*Client) ToggleNotificationsFromSubaccount ¶
func (*Client) ToggleSubaccountLogin ¶
func (*Client) Withdraw ¶
func (c *Client) Withdraw(ctx context.Context, params *models.WithdrawParams) (result models.Withdrawal, err error)
type Configuration ¶
type Event ¶
type Event struct { Channel string `json:"channel"` Data json.RawMessage `json:"data"` }
Event is wrapper of received event
Source Files ¶
Click to show internal directories.
Click to hide internal directories.