types

package
v0.0.0-...-795c9cd Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllBBO

type AllBBO struct {
	Topic string         `json:"topic"`
	Ts    int64          `json:"ts"`
	Data  []BestBidOffer `json:"data"`
}

type AnyMessage

type AnyMessage struct {
	Response          *Response
	SubscribedMessage *SubscribedMessage
}

AnyMessage represents either a JSON Response or SubscribedMessage.

func (AnyMessage) MarshalJSON

func (m AnyMessage) MarshalJSON() ([]byte, error)

func (*AnyMessage) UnmarshalJSON

func (m *AnyMessage) UnmarshalJSON(data []byte) error

type BBO

type BBO struct {
	Topic string       `json:"topic"`
	Ts    int64        `json:"ts"`
	Data  BestBidOffer `json:"data"`
}

type BestBidOffer

type BestBidOffer struct {
	Symbol  string  `json:"symbol"`
	Ask     float64 `json:"ask"`
	AskSize float64 `json:"askSize"`
	Bid     float64 `json:"bid"`
	BidSize float64 `json:"bidSize"`
}

type EstFundingRate

type EstFundingRate struct {
	Topic string `json:"topic"`
	Ts    int64  `json:"ts"`
	Data  struct {
		Symbol      string  `json:"symbol"`
		FundingRate float64 `json:"fundingRate"`
		FundingTs   int64   `json:"fundingTs"`
	} `json:"data"`
}

type IndexPrice

type IndexPrice struct {
	Topic string      `json:"topic"`
	Ts    int64       `json:"ts"`
	Data  SymbolPrice `json:"data"`
}

type Kline

type Kline struct {
	Topic string `json:"topic"`
	Ts    int64  `json:"ts"`
	Data  struct {
		Symbol    string  `json:"symbol"`
		Type      string  `json:"type"`
		Open      float64 `json:"open"`
		Close     float64 `json:"close"`
		High      float64 `json:"high"`
		Low       float64 `json:"low"`
		Volume    float64 `json:"volume"`
		Amount    float64 `json:"amount"`
		StartTime int64   `json:"startTime"`
		EndTime   int64   `json:"endTime"`
	} `json:"data"`
}

type MarkPrice

type MarkPrice struct {
	Topic string      `json:"topic"`
	Ts    int64       `json:"ts"`
	Data  SymbolPrice `json:"data"`
}

type MarkPrices

type MarkPrices struct {
	Topic string        `json:"topic"`
	Ts    int64         `json:"ts"`
	Data  []SymbolPrice `json:"data"`
}

type OpenInterest

type OpenInterest struct {
	Topic string `json:"topic"`
	Ts    int64  `json:"ts"`
	Data  struct {
		Symbol       string  `json:"symbol"`
		OpenInterest float64 `json:"openInterest"`
	} `json:"data"`
}

type Orderbook

type Orderbook struct {
	Topic string `json:"topic"`
	Ts    int64  `json:"ts"`
	Data  struct {
		Symbol string      `json:"symbol"`
		Asks   [][]float64 `json:"asks"`
		Bids   [][]float64 `json:"bids"`
	} `json:"data"`
}

type Request

type Request struct {
	ID    string `json:"id,omitempty"`
	Topic string `json:"topic,omitempty"`
	Event string `json:"event,omitempty"`
}

type Response

type Response struct {
	ID        string `json:"id"`
	Event     string `json:"event"`
	Success   bool   `json:"success"`
	Timestamp int64  `json:"ts"`
}

type SubscribedMessage

type SubscribedMessage struct {
	OriginData []byte
	Topic      string          `json:"topic"`
	Data       json.RawMessage `json:"data"`
	Timestamp  int64           `json:"ts"`
}

type SymbolPrice

type SymbolPrice struct {
	Symbol string  `json:"symbol"`
	Price  float64 `json:"price"`
}

type Ticker

type Ticker struct {
	Symbol string  `json:"symbol"`
	Open   float64 `json:"open"`
	Close  float64 `json:"close"`
	High   float64 `json:"high"`
	Low    float64 `json:"low"`
	Volume float64 `json:"volume"`
	Amount float64 `json:"amount"`
	Count  int     `json:"count"`
}

type Ticker24H

type Ticker24H struct {
	Topic string `json:"topic"`
	Ts    int64  `json:"ts"`
	Data  Ticker `json:"data"`
}

type Tickers

type Tickers struct {
	Topic string   `json:"topic"`
	Ts    int64    `json:"ts"`
	Data  []Ticker `json:"data"`
}

type Trade

type Trade struct {
	Topic string `json:"topic"`
	Ts    int64  `json:"ts"`
	Data  struct {
		Symbol string  `json:"symbol"`
		Price  float64 `json:"price"`
		Size   float64 `json:"size"`
		Side   string  `json:"side"`
		Source int     `json:"source"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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