types

package
v0.0.0-...-f6b255e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package types of both request and response for API

Index

Constants

This section is empty.

Variables

View Source
var IntervalOptions intervalOptions

IntervalOptions for interval

View Source
var SortOptions sortOptions

SortOptions for sorting

Functions

This section is empty.

Types

type CryptoInfo

type CryptoInfo struct {
	ID       int                    `json:"id"`
	Name     string                 `json:"name"`
	Symbol   string                 `json:"symbol"`
	Slug     string                 `json:"slug"`
	Category string                 `json:"category,omitempty"`
	Tags     []string               `json:"tags,omitempty"`
	Urls     map[string]interface{} `json:"urls,omitempty"`
}

CryptoInfo structure

type CryptoInfoMap

type CryptoInfoMap struct {
	CryptoInfo map[string]*CryptoInfo `json:"data"`
}

CryptoInfoMap structure

type CryptoMap

type CryptoMap struct {
	ID                  int    `json:"id"`
	Name                string `json:"name"`
	Symbol              string `json:"symbol"`
	Slug                string `json:"slug"`
	IsActive            int    `json:"is_active"`
	FirstHistoricalData string `json:"first_historical_data"`
	LastHistoricalData  string `json:"last_historical_data"`
}

CryptoMap structure

type CryptoMapList

type CryptoMapList struct {
	CryptoMap []*CryptoMap `json:"data"`
}

CryptoMapList structure

type CryptoMarket

type CryptoMarket struct {
	ID                int               `json:"id"`
	Name              string            `json:"name"`
	Symbol            string            `json:"symbol"`
	Slug              string            `json:"slug"`
	CirculatingSupply float64           `json:"circulating_supply"`
	TotalSupply       float64           `json:"total_supply"`
	MaxSupply         float64           `json:"max_supply"`
	DateAdded         string            `json:"date_added"`
	NumMarketPairs    int               `json:"num_market_pairs"`
	CMCRank           int               `json:"cmc_rank"`
	LastUpdated       string            `json:"last_updated"`
	Quote             map[string]*Quote `json:"quote"`
}

CryptoMarket structure

type CryptoMarketList

type CryptoMarketList struct {
	CryptoMarket []*CryptoMarket `json:"data"`
}

CryptoMarketList structure

type CryptoMarketMap

type CryptoMarketMap struct {
	CryptoMarket map[string]*CryptoMarket `json:"data"`
}

CryptoMarketMap structure

type Currency

type Currency struct {
	ID     int    `json:"currency_id"`
	Symbol string `json:"currency_symbol"`
	Type   string `json:"currency_type"`
}

Currency structure

type ExchangeInfo

type ExchangeInfo struct {
	ID   int                    `json:"id"`
	Name string                 `json:"name"`
	Slug string                 `json:"slug"`
	Urls map[string]interface{} `json:"urls,omitempty"`
}

ExchangeInfo options

type ExchangeInfoMap

type ExchangeInfoMap struct {
	ExchangeInfo map[string]*ExchangeInfo `json:"data"`
}

ExchangeInfoMap structure

type ExchangeMap

type ExchangeMap struct {
	ID                  int    `json:"id"`
	Name                string `json:"name"`
	Slug                string `json:"slug"`
	IsActive            int    `json:"is_active"`
	FirstHistoricalData string `json:"first_historical_data"`
	LastHistoricalData  string `json:"last_historical_data"`
}

ExchangeMap options

type ExchangeMapList

type ExchangeMapList struct {
	ExchangeMap []*ExchangeMap `json:"data"`
}

ExchangeMapList options

type ExchangeMarketList

type ExchangeMarketList struct {
	MarketQuote []*MarketQuote `json:"data"`
}

ExchangeMarketList structure

type ExchangeMarketQuotes

type ExchangeMarketQuotes struct {
	MarketQuote map[string]*MarketQuote `json:"data"`
}

ExchangeMarketQuotes structure

type GlobalMarket

type GlobalMarket struct {
	ActiveCurrencies             int                           `json:"active_cryptocurrencies"`
	ActiveMarkets                int                           `json:"active_markets"`
	BitcoinPercentageOfMarketCap float64                       `json:"bitcoin_percentage_of_market_cap"`
	LastUpdated                  int                           `json:"last_updated"`
	Quotes                       map[string]*GlobalMarketQuote `json:"quotes"`
}

GlobalMarket struct

type GlobalMarketQuote

type GlobalMarketQuote struct {
	TotalMarketCap float64 `json:"total_market_cap"`
	TotalVolume24H float64 `json:"total_volume_24h"`
}

GlobalMarketQuote struct

type Market

type Market struct {
	Rank          int
	Exchange      string
	Pair          string
	VolumeUSD     float64
	Price         float64
	VolumePercent float64
	Updated       string
}

Market struct

type MarketGraph

type MarketGraph struct {
	MarketCapByAvailableSupply [][]float64 `json:"market_cap_by_available_supply"`
	VolumeUSD                  [][]float64 `json:"volume_usd"`
}

MarketGraph struct

type MarketPair

type MarketPair struct {
	ExchangeInfo    *ExchangeInfo     `json:"exchange"`
	MarketPair      string            `json:"market_pair"`
	MarketPairBase  *Currency         `json:"market_pair_base"`
	MarketPairQuote *Currency         `json:"market_pair_quote"`
	Quote           map[string]*Quote `json:"quote"`
}

MarketPair structure

type MarketPairs

type MarketPairs struct {
	ID             int           `json:"id"`
	Name           string        `json:"name"`
	Symbol         string        `json:"symbol"`
	Slug           string        `json:"slug"`
	NumMarketPairs int           `json:"num_market_pairs"`
	MarketPair     []*MarketPair `json:"market_pairs"`
}

MarketPairs structure

type MarketQuote

type MarketQuote struct {
	ID             int               `json:"id"`
	Name           string            `json:"name"`
	Slug           string            `json:"slug"`
	NumMarketPairs int               `json:"num_market_pairs"`
	LastUpdated    string            `json:"last_updated"`
	Quote          map[string]*Quote `json:"quote"`
}

MarketQuote structure

type Ohlcv

type Ohlcv struct {
	ID          int                    `json:"id"`
	Name        string                 `json:"name"`
	Symbol      string                 `json:"symbol"`
	LastUpdated string                 `json:"last_updated"`
	TimeOpen    string                 `json:"time_open"`
	TimeClose   string                 `json:"time_close"`
	Quote       map[string]*OhlcvQuote `json:"quote"`
}

Ohlcv structure

type OhlcvList

type OhlcvList struct {
	ID     int      `json:"id"`
	Name   string   `json:"name"`
	Symbol string   `json:"symbol"`
	Ohlcv  []*Ohlcv `json:"quotes"`
}

OhlcvList structure

type OhlcvMap

type OhlcvMap struct {
	Ohlcv map[string]*Ohlcv `json:"data"`
}

OhlcvMap structure

type OhlcvQuote

type OhlcvQuote struct {
	Open        float64 `json:"open"`
	High        float64 `json:"high"`
	Low         float64 `json:"low"`
	Close       float64 `json:"close"`
	Volume      float64 `json:"volume"`
	Timestamp   string  `json:"timestamp,omitempty"`
	LastUpdated string  `json:"last_updated,omitempty"`
}

OhlcvQuote structure

type Options

type Options struct {
	ID         string `json:"id,omitempty"`
	Symbol     string `json:"symbol,omitempty"`
	Slug       string `json:"slug,omitempty"`
	Start      int    `json:"start,omitempty"` // >= 1
	Limit      int    `json:"limit,omitempty"`
	Convert    string `json:"convert,omitempty"`             // "USD", ...
	Sort       string `json:"sort,omitempty"`                // <- SortOptions
	SortDir    string `json:"sort_dir,omitempty"`            // "asc", "desc"
	CryptoType string `json:"cryptocurrency_type,omitempty"` // "all", "coins", "tokens"
	MarketType string `json:"market_type,omitempty"`         // "all", "fees", "no_fees"
	TimePeriod string `json:"time_period,omitempty"`         // "daily"
	TimeStart  string `json:"time_start,omitempty"`
	TimeEnd    string `json:"time_end,omitempty"`
	Interval   string `json:"interval,omitempty"` // "hourly" "daily" "weekly" "monthly" "yearly" "1d" "2d" "3d" "7d" "14d" "15d" "30d" "60d" "90d" "365d"
	Count      int    `json:"count,omitempty"`
}

Options for request

type Quote

type Quote struct {
	Price            float64 `json:"price,omitempty"`
	Volume24H        float64 `json:"volume_24h,omitempty"`
	Volume7D         float64 `json:"volume_7d,omitempty"`
	Volume30D        float64 `json:"volume_30d,omitempty"`
	Volume24Hbase    float64 `json:"volume_24h_base,omitempty"`
	Volume24Hquote   float64 `json:"volume_24h_quote,omitempty"`
	PercentChange1H  float64 `json:"percent_change_1h,omitempty"`
	PercentChange24H float64 `json:"percent_change_24h,omitempty"`
	PercentChange7D  float64 `json:"percent_change_7d,omitempty"`
	PercentChange30D float64 `json:"percent_change_30d,omitempty"`
	MarketCap        float64 `json:"market_cap,omitempty"`
	LastUpdated      string  `json:"last_updated"`
}

Quote structure

type Response

type Response struct {
	Status Status      `json:"status"`
	Data   interface{} `json:"data"`
}

Response structure

type Status

type Status struct {
	Timestamp    string  `json:"timestamp"`
	ErrorCode    int     `json:"error_code"`
	ErrorMessage *string `json:"error_message"`
	Elapsed      int     `json:"elapsed"`
	CreditCount  int     `json:"credit_count"`
}

Status structure

type Ticker

type Ticker struct {
	ID                int                     `json:"id"`
	Name              string                  `json:"name"`
	Symbol            string                  `json:"symbol"`
	Slug              string                  `json:"website_slug"`
	Rank              int                     `json:"rank"`
	CirculatingSupply float64                 `json:"circulating_supply"`
	TotalSupply       float64                 `json:"total_supply"`
	MaxSupply         float64                 `json:"max_supply"`
	Quotes            map[string]*TickerQuote `json:"quotes"`
	LastUpdated       int                     `json:"last_updated"`
}

Ticker struct

type TickerGraph

type TickerGraph struct {
	MarketCapByAvailableSupply [][]float64 `json:"market_cap_by_available_supply"`
	PriceBTC                   [][]float64 `json:"price_btc"`
	PriceUSD                   [][]float64 `json:"price_usd"`
	VolumeUSD                  [][]float64 `json:"volume_usd"`
}

TickerGraph struct

type TickerQuote

type TickerQuote struct {
	Price            float64 `json:"price"`
	Volume24H        float64 `json:"volume_24h"`
	MarketCap        float64 `json:"market_cap"`
	PercentChange1H  float64 `json:"percent_change_1h"`
	PercentChange24H float64 `json:"percent_change_24h"`
	PercentChange7D  float64 `json:"percent_change_7d"`
}

TickerQuote struct

Jump to

Keyboard shortcuts

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