public

package
v0.0.0-...-b6e08ef Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	Price  string
	Size   string
	Offset string
}

func (*Book) UnmarshalJSON

func (p *Book) UnmarshalJSON(data []byte) error

type Candle

type Candle struct {
	Market               string    `json:"market"`
	Resolution           string    `json:"resolution"`
	Low                  string    `json:"low"`
	High                 string    `json:"high"`
	Open                 string    `json:"open"`
	Close                string    `json:"close"`
	BaseTokenVolume      string    `json:"baseTokenVolume"`
	Trades               string    `json:"trades"`
	UsdVolume            string    `json:"usdVolume"`
	StartingOpenInterest string    `json:"startingOpenInterest"`
	StartedAt            time.Time `json:"startedAt"`
	UpdatedAt            time.Time `json:"updatedAt"`
}

type CandlesParam

type CandlesParam struct {
	Market     string `url:"-"`
	Resolution string `url:"resolution,omitempty"`
	FromISO    string `url:"fromISO,omitempty"`
	ToISO      string `url:"toISO,omitempty"`
	// Max:100
	Limit int `url:"limit,omitempty"`
}

type CandlesResponse

type CandlesResponse struct {
	Candles []Candle `json:"candles"`
}

type HistoricalFunding

type HistoricalFunding struct {
	Market      string    `json:"-"`
	Rate        string    `json:"rate"`
	Price       string    `json:"price"`
	EffectiveAt time.Time `json:"effectiveAt"`
}

type HistoricalFundingsParam

type HistoricalFundingsParam struct {
	Market              string `url:"-"`
	EffectiveBeforeOrAt string `url:"effectiveBeforeOrAt,omitempty"`
}

type HistoricalFundingsResponse

type HistoricalFundingsResponse struct {
	HistoricalFundings []HistoricalFunding `json:"historicalFunding"`
}

type Market

type Market struct {
	Market                           string    `json:"market"`
	BaseAsset                        string    `json:"baseAsset"`
	QuoteAsset                       string    `json:"quoteAsset"`
	StepSize                         string    `json:"stepSize"`
	TickSize                         string    `json:"tickSize"`
	IndexPrice                       string    `json:"indexPrice"`
	OraclePrice                      string    `json:"oraclePrice"`
	PriceChange24H                   string    `json:"priceChange24H"`
	NextFundingRate                  string    `json:"nextFundingRate"`
	MinOrderSize                     string    `json:"minOrderSize"`
	Type                             string    `json:"type"`
	InitialMarginFraction            string    `json:"initialMarginFraction"`
	MaintenanceMarginFraction        string    `json:"maintenanceMarginFraction"`
	BaselinePositionSize             string    `json:"baselinePositionSize"`
	IncrementalPositionSize          string    `json:"incrementalPositionSize"`
	IncrementalInitialMarginFraction string    `json:"incrementalInitialMarginFraction"`
	Volume24H                        string    `json:"volume24H"`
	Trades24H                        string    `json:"trades24H"`
	OpenInterest                     string    `json:"openInterest"`
	MaxPositionSize                  string    `json:"maxPositionSize"`
	AssetResolution                  string    `json:"assetResolution"`
	SyntheticAssetID                 string    `json:"syntheticAssetId"`
	Status                           string    `json:"status"`
	NextFundingAt                    time.Time `json:"nextFundingAt"`
}

type MarketsResponse

type MarketsResponse struct {
	Markets map[string]Market `json:"markets"`
}

type OrderbookResponse

type OrderbookResponse struct {
	Offset string `json:"offset"`
	Bids   []Book `json:"bids"`
	Asks   []Book `json:"asks"`
}

type Public

type Public struct {
	Host      string
	NetworkId int

	RateLimit  *types.RateLimit
	Logger     *log.Logger
	HttpClient *http.Client
}

func (*Public) GetCandles

func (p *Public) GetCandles(param *CandlesParam) (*CandlesResponse, error)

GetCandles response head of the array is currently

func (*Public) GetHistoricalFunding

func (p *Public) GetHistoricalFunding(param *HistoricalFundingsParam) (*HistoricalFundingsResponse, error)

func (*Public) GetMarkets

func (p *Public) GetMarkets(marketID string) (*MarketsResponse, error)

func (*Public) GetTrades

func (p *Public) GetTrades(param *TradesParam) (*TradesResponse, error)

type Trade

type Trade struct {
	Side      string    `json:"side"`
	Size      string    `json:"size"`
	Price     string    `json:"price"`
	CreatedAt time.Time `json:"createdAt"`
}

type TradesParam

type TradesParam struct {
	MarketID           string `url:"-"`
	Limit              int    `url:"limit,omitempty"`
	StartingBeforeOrAt string `url:"startingBeforeOrAt,omitempty"`
}

type TradesResponse

type TradesResponse struct {
	Trades []Trade `json:"trades"`
}

Jump to

Keyboard shortcuts

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