data

package
v0.0.0-...-8682519 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBitfinexETHPrice

func GetBitfinexETHPrice() (decimal.Decimal, error)

func GetCexIOETHUSDLastPrice

func GetCexIOETHUSDLastPrice() (decimal.Decimal, error)

func GetCoinbaseETHPrice

func GetCoinbaseETHPrice() (decimal.Decimal, error)

func GetKrakenETHPrice

func GetKrakenETHPrice() (decimal.Decimal, error)

func GetKuCoinETHUSDTPrice

func GetKuCoinETHUSDTPrice() (decimal.Decimal, error)

func GetWeightedAvgPriceFromBinance

func GetWeightedAvgPriceFromBinance() (decimal.Decimal, error)

func PingBinance

func PingBinance() (decimal.Decimal, error)

Types

type BitfinexTickerResponse

type BitfinexTickerResponse struct {
	Mid string `json:"mid"`
}

type CexIOResponse

type CexIOResponse struct {
	Timestamp             string  `json:"timestamp"`
	Low                   string  `json:"low"`
	High                  string  `json:"high"`
	Last                  string  `json:"last"`
	Volume                string  `json:"volume"`
	Volume30d             string  `json:"volume30d"`
	Bid                   float64 `json:"bid"`
	Ask                   float64 `json:"ask"`
	PriceChange           string  `json:"priceChange"`
	PriceChangePercentage string  `json:"priceChangePercentage"`
	Pair                  string  `json:"pair"`
}

type CoinbaseResponse

type CoinbaseResponse struct {
	Data struct {
		Amount   string `json:"amount"`
		Base     string `json:"base"`
		Currency string `json:"currency"`
	} `json:"data"`
}

type Data

type Data struct {
	Time        int64  `json:"time"`
	Sequence    string `json:"sequence"`
	Price       string `json:"price"`
	Size        string `json:"size"`
	BestBid     string `json:"bestBid"`
	BestBidSize string `json:"bestBidSize"`
	BestAsk     string `json:"bestAsk"`
	BestAskSize string `json:"bestAskSize"`
}

type Kline

type Kline struct {
	ClosePrice decimal.Decimal
	Volume     decimal.Decimal
	CloseTime  time.Time
}

func GetHistoricalPriceFromBinance

func GetHistoricalPriceFromBinance(ts time.Time) ([]Kline, error)

type KrakenTickerResponse

type KrakenTickerResponse struct {
	Error  []interface{} `json:"error"`
	Result map[string]struct {
		C []string `json:"c"`
	} `json:"result"`
}

type KuCoinResponse

type KuCoinResponse struct {
	Code string `json:"code"`
	Data Data   `json:"data"`
}

type TickerData

type TickerData struct {
	Symbol           string `json:"symbol"`
	WeightedAvgPrice string `json:"weightedAvgPrice"`
}

Struct to unmarshal the JSON response

Jump to

Keyboard shortcuts

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