rest

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestNetBaseURL = "https://test.deribit.com"
	BaseURL        = "https://www.deribit.com"
)

Variables

View Source
var (
	DefaultContentType = map[string]string{
		"Content-Type": "application/json",
	}

	JsonRPCVersion = "2.0"
)
View Source
var ErrAuth = errors.New("auth error, you should reinitialize client using key and secret")

Functions

This section is empty.

Types

type DeribitRestClient

type DeribitRestClient struct {
	// contains filtered or unexported fields
}

func NewDeribitRestClient

func NewDeribitRestClient(cfg *DeribitRestClientCfg) (*DeribitRestClient, error)

func (*DeribitRestClient) Auth

func (*DeribitRestClient) Buy

func (*DeribitRestClient) Cancel

func (*DeribitRestClient) CancelAll

func (d *DeribitRestClient) CancelAll(ctx context.Context) (int, error)

func (*DeribitRestClient) CancelAllByInstrument

func (d *DeribitRestClient) CancelAllByInstrument(ctx context.Context, param trading.CancelAllByInstrumentParams) (int, error)

func (*DeribitRestClient) ClosePosition

func (*DeribitRestClient) GetAccountSummary

func (*DeribitRestClient) GetBookSummaryByCurrency

func (*DeribitRestClient) GetBookSummaryByInstrument

func (*DeribitRestClient) GetContractSize

func (*DeribitRestClient) GetCurrencies

func (d *DeribitRestClient) GetCurrencies(ctx context.Context) ([]*marketdata.Currency, error)

func (*DeribitRestClient) GetFundingRate

func (*DeribitRestClient) GetIndexPrice

func (*DeribitRestClient) GetInstrument

func (*DeribitRestClient) GetInstruments

func (*DeribitRestClient) GetOpenOrdersByCurrency

func (d *DeribitRestClient) GetOpenOrdersByCurrency(ctx context.Context, param trading.GetOpenOrdersByCurrencyParams) ([]*trading.Order, error)

func (*DeribitRestClient) GetOpenOrdersByInstrument

func (d *DeribitRestClient) GetOpenOrdersByInstrument(ctx context.Context, param trading.GetOpenOrdersByInstrumentParams) ([]*trading.Order, error)

func (*DeribitRestClient) GetOrderBook

func (*DeribitRestClient) GetOrderState

func (*DeribitRestClient) GetPositions

func (*DeribitRestClient) GetTicker

func (*DeribitRestClient) GetTransactionLog

func (*DeribitRestClient) GetUserTradesByCurrency

func (*DeribitRestClient) GetUserTradesByCurrencyAndTime

func (*DeribitRestClient) GetUserTradesByInstrument

func (*DeribitRestClient) GetUserTradesByInstrumentAndTime

func (*DeribitRestClient) Sell

func (*DeribitRestClient) SendHTTPRequest

func (d *DeribitRestClient) SendHTTPRequest(ctx context.Context, req types.HTTPRequest) ([]byte, error)

func (*DeribitRestClient) Test

type DeribitRestClientCfg

type DeribitRestClientCfg struct {
	BaseURL string `validate:"required"`
	Key     string
	Secret  string
	Debug   bool
	// Logger
	Logger *slog.Logger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL