margin

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FillsEndPoint = "/api/margin/v3/fills"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Borrowed

type Borrowed struct {
	BorrowID         string          `json:"borrow_id"`
	InstrumentID     string          `json:"instrument_id"`
	Currency         string          `json:"currency"`
	Timestamp        string          `json:"timestamp"`
	Amount           decimal.Decimal `json:"amount"`
	Interest         decimal.Decimal `json:"interest"`
	ReturnedAmount   decimal.Decimal `json:"returned_amount"`
	PaidInterest     decimal.Decimal `json:"paid_interest"`
	LastInterestTime string          `json:"last_interest_time"`
	ForceRepayTime   string          `json:"force_repay_time"`
	Rate             decimal.Decimal `json:"rate"`
}

type BorrowedStatus

type BorrowedStatus int
const (
	BorrowedStatusOpen BorrowedStatus = iota
	BorrowedStatusClose

	BorrowedEndPoint = "/api/margin/v3/accounts/borrowed"
)

type Fill

type Fill struct {
	LedgerID     string          `json:"ledger_id"`
	InstrumentID string          `json:"instrument_id"`
	Price        decimal.Decimal `json:"price"`
	Size         decimal.Decimal `json:"size"`
	OrderID      string          `json:"order_id"`
	Timestamp    string          `json:"timestamp"`
	ExecType     string          `json:"exec_type"`
	Fee          string          `json:"fee"`
	Side         string          `json:"side"`
	Currency     string          `json:"currency"`
}

type RestClient

type RestClient struct {
	*okex.RestClient
}

func NewRestClient

func NewRestClient(key, secret, pass string) *RestClient

func (*RestClient) Borrowed

func (rc *RestClient) Borrowed(ctx context.Context, status BorrowedStatus, before, after, limit string) ([]Borrowed, error)

func (*RestClient) Fills

func (rc *RestClient) Fills(ctx context.Context, orderID string, instrumentID string, before string, after string, limit string) ([]Fill, error)

func (*RestClient) Finance

func (rc *RestClient) Finance(ctx context.Context, req *exchange.FinanceReqParam) ([]*exchange.Finance, error)

func (*RestClient) Ledgers

func (rc *RestClient) Ledgers(ctx context.Context, instrumentID string, before, after, limit, typ string) ([]okex.Ledger, error)

Jump to

Keyboard shortcuts

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