coinapi_v1

package
v0.0.0-...-8422377 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT, MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TEST_URL = "https://rest-test.coinapi.io"
View Source
var URL = "https://rest.coinapi.io"

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Asset_id       string `json:"asset_id"`
	Name           string `json:"name"`
	Type_is_crypto int    `json:"type_is_crypto"`
}

type Bid

type Bid struct {
	Price decimal.Decimal `json:"price"`
	Size  decimal.Decimal `json:"size"`
}

type ErrorMessage

type ErrorMessage struct {
	Message string `json:"message"`
}

type Exchange

type Exchange struct {
	Exchange_id string `json:"exchange_id"`
	Website     string `json:"website"`
	Name        string `json:"name"`
}

Exchange info

type Exchange_rate

type Exchange_rate struct {
	Time           time.Time       `json:"time"`
	Asset_id_base  string          `json:"asset_id_base"`
	Asset_id_quote string          `json:"asset_id_quote"`
	Rate           decimal.Decimal `json:"rate"`
}

type Future

type Future struct {
	Symbol
	Future_delivery_time time.Time `json:"future_delivery_time"`
}

type Ohlcv_data

type Ohlcv_data struct {
	Time_period_start time.Time       `json:"time_period_start"`
	Time_period_end   time.Time       `json:"time_period_end"`
	Time_open         time.Time       `json:"time_open"`
	Time_close        time.Time       `json:"time_close"`
	Price_open        decimal.Decimal `json:"price_open"`
	Price_high        decimal.Decimal `json:"price_high"`
	Price_low         decimal.Decimal `json:"price_low"`
	Price_close       decimal.Decimal `json:"price_close"`
	Volume_traded     decimal.Decimal `json:"volume_traded"`
	Trades_count      uint32          `json:"trades_count"`
}

type Ohlcv_period

type Ohlcv_period struct {
	Period_id      string `json:"period_id"`
	Length_seconds uint64 `json:"length_seconds"`
	Length_months  uint32 `json:"length_months"`
	Unit_count     uint32 `json:"unit_count"`
	Unit_name      string `json:"unit_name"`
	Display_name   string `json:"display_name"`
}

type Option

type Option struct {
	Option_type_is_call    bool            `json:"option_type_is_call"`
	Option_strike_price    decimal.Decimal `json:"option_strike_price"`
	Option_contract_unit   uint32          `json:"option_contract_unit"`
	Option_exercise_style  string          `json:"option_exercise_style"`
	Option_expiration_time time.Time       `json:"option_excercise_style"`
}

type Orderbook

type Orderbook struct {
	Symbol_id     string    `json:"symbol_id"`
	Time_exchange time.Time `json:"time_exchange"`
	Time_coinapi  time.Time `json:"time_coinapi"`
	Asks          []Bid     `json:"asks"`
	Bids          []Bid     `json:"bids"`
}

type Quote

type Quote struct {
	Symbol_id     string          `json:"symbol_id"`
	Time_exchange time.Time       `json:"time_exchange"`
	Time_coinapi  time.Time       `json:"time_coinapi"`
	Ask_price     decimal.Decimal `json:"ask_price"`
	Ask_size      decimal.Decimal `json:"ask_size"`
	Bid_price     decimal.Decimal `json:"bid_price"`
	Bid_size      decimal.Decimal `json:"bid_size"`
	Last_trade    Trade           `json:"last_trade"`
}

type SDK

type SDK struct {
	// contains filtered or unexported fields
}

func NewSDK

func NewSDK(api_key string) *SDK

func NewTestSDK

func NewTestSDK() *SDK

func (SDK) Exchange_rates_get_all_current_rates

func (sdk SDK) Exchange_rates_get_all_current_rates(asset_id_base string) (rates []Exchange_rate, err error)

func (SDK) Exchange_rates_get_specific_rate

func (sdk SDK) Exchange_rates_get_specific_rate(asset_id_base string, asset_id_quote string) (rate Exchange_rate, err error)

func (SDK) Exchange_rates_get_specific_rate_with_time

func (sdk SDK) Exchange_rates_get_specific_rate_with_time(asset_id_base string, asset_id_quote string, _time time.Time) (rate Exchange_rate, err error)

func (SDK) Metadata_list_assets

func (sdk SDK) Metadata_list_assets() (assets []Asset, err error)

func (SDK) Metadata_list_exchanges

func (sdk SDK) Metadata_list_exchanges() (exchanges []Exchange, err error)

func (SDK) Metadata_list_symbols

func (sdk SDK) Metadata_list_symbols() (spots []Spot, futures []Future, options []Option, err error)

func (SDK) Ohlcv_historic_data

func (sdk SDK) Ohlcv_historic_data(symbol_id string, period_id string, time_start time.Time) (data []Ohlcv_data, err error)

func (SDK) Ohlcv_historic_data_with_limit

func (sdk SDK) Ohlcv_historic_data_with_limit(symbol_id string, period_id string, time_start time.Time, limit uint32) (data []Ohlcv_data, err error)

func (SDK) Ohlcv_historic_data_with_time_end

func (sdk SDK) Ohlcv_historic_data_with_time_end(symbol_id string, period_id string, time_start time.Time, time_end time.Time) (data []Ohlcv_data, err error)

func (SDK) Ohlcv_historic_data_with_time_end_and_limit

func (sdk SDK) Ohlcv_historic_data_with_time_end_and_limit(symbol_id string, period_id string, time_start time.Time, time_end time.Time, limit uint32) (data []Ohlcv_data, err error)

func (SDK) Ohlcv_latest_data

func (sdk SDK) Ohlcv_latest_data(symbol_id string, period_id string) (data []Ohlcv_data, err error)

func (SDK) Ohlcv_latest_data_with_limit

func (sdk SDK) Ohlcv_latest_data_with_limit(symbol_id string, period_id string, limit uint32) (data []Ohlcv_data, err error)

func (SDK) Ohlcv_list_all_periods

func (sdk SDK) Ohlcv_list_all_periods() (periods []Ohlcv_period, err error)

func (SDK) Orderbooks_current_data_all

func (sdk SDK) Orderbooks_current_data_all() (orderbooks []Orderbook, err error)

func (SDK) Orderbooks_current_data_symbol

func (sdk SDK) Orderbooks_current_data_symbol(symbol_id string) (orderbook Orderbook, err error)

func (SDK) Orderbooks_historical_data

func (sdk SDK) Orderbooks_historical_data(symbol_id string, time_start time.Time) (orderbooks []Orderbook, err error)

func (SDK) Orderbooks_historical_data_with_limit

func (sdk SDK) Orderbooks_historical_data_with_limit(symbol_id string, time_start time.Time, limit uint32) (orderbooks []Orderbook, err error)

func (SDK) Orderbooks_historical_data_with_time_end

func (sdk SDK) Orderbooks_historical_data_with_time_end(symbol_id string, time_start time.Time, time_end time.Time) (orderbooks []Orderbook, err error)

func (SDK) Orderbooks_historical_data_with_time_end_and_limit

func (sdk SDK) Orderbooks_historical_data_with_time_end_and_limit(symbol_id string, time_start time.Time, time_end time.Time, limit uint32) (orderbooks []Orderbook, err error)

func (SDK) Orderbooks_latest_data

func (sdk SDK) Orderbooks_latest_data(symbol_id string) (orderbooks []Orderbook, err error)

func (SDK) Orderbooks_latest_data_with_limit

func (sdk SDK) Orderbooks_latest_data_with_limit(symbol_id string, limit uint32) (orderbooks []Orderbook, err error)

func (SDK) Quotes_current_data_all

func (sdk SDK) Quotes_current_data_all() (quotes []Quote, err error)

func (SDK) Quotes_current_data_symbol

func (sdk SDK) Quotes_current_data_symbol(symbol_id string) (quote Quote, err error)

func (SDK) Quotes_historical_data

func (sdk SDK) Quotes_historical_data(symbol_id string, time_start time.Time) (quotes []Quote, err error)

func (SDK) Quotes_historical_data_with_limit

func (sdk SDK) Quotes_historical_data_with_limit(symbol_id string, time_start time.Time, limit uint32) (quotes []Quote, err error)

func (SDK) Quotes_historical_data_with_time_end

func (sdk SDK) Quotes_historical_data_with_time_end(symbol_id string, time_start time.Time, time_end time.Time) (quotes []Quote, err error)

func (SDK) Quotes_historical_data_with_time_end_and_limit

func (sdk SDK) Quotes_historical_data_with_time_end_and_limit(symbol_id string, time_start time.Time, time_end time.Time, limit uint32) (quotes []Quote, err error)

func (SDK) Quotes_latest_data_all

func (sdk SDK) Quotes_latest_data_all() (quotes []Quote, err error)

func (SDK) Quotes_latest_data_all_with_limit

func (sdk SDK) Quotes_latest_data_all_with_limit(limit uint32) (quotes []Quote, err error)

func (SDK) Quotes_latest_data_symbol

func (sdk SDK) Quotes_latest_data_symbol(symbol_id string) (quotes []Quote, err error)

func (SDK) Quotes_latest_data_symbol_with_limit

func (sdk SDK) Quotes_latest_data_symbol_with_limit(symbol_id string, limit uint32) (quotes []Quote, err error)

func (SDK) Trades_historical_data

func (sdk SDK) Trades_historical_data(symbol_id string, time_start time.Time) (trades []Trade, err error)

func (SDK) Trades_historical_data_with_limit

func (sdk SDK) Trades_historical_data_with_limit(symbol_id string, time_start time.Time, limit uint32) (trades []Trade, err error)

func (SDK) Trades_historical_data_with_time_end

func (sdk SDK) Trades_historical_data_with_time_end(symbol_id string, time_start time.Time, time_end time.Time) (trades []Trade, err error)

func (SDK) Trades_historical_data_with_time_end_and_limit

func (sdk SDK) Trades_historical_data_with_time_end_and_limit(symbol_id string, time_start time.Time, time_end time.Time, limit uint32) (trades []Trade, err error)

func (SDK) Trades_latest_data_all

func (sdk SDK) Trades_latest_data_all() (trades []Trade, err error)

func (SDK) Trades_latest_data_all_with_limit

func (sdk SDK) Trades_latest_data_all_with_limit(limit uint32) (trades []Trade, err error)

func (SDK) Trades_latest_data_symbol

func (sdk SDK) Trades_latest_data_symbol(symbol_id string) (trades []Trade, err error)

func (SDK) Trades_latest_data_symbol_with_limit

func (sdk SDK) Trades_latest_data_symbol_with_limit(symbol_id string, limit uint32) (trades []Trade, err error)

type Spot

type Spot struct {
	Symbol
}

type Symbol

type Symbol struct {
	SymbolBase
	Symbol_id      string `json:"symbol_id"`
	Exchange_id    string `json:"exchange_id"`
	Asset_id_base  string `json:"asset_id_base"`
	Asset_id_quote string `json:"asset_id_quote"`
}

type SymbolBase

type SymbolBase struct {
	Symbol_type string `json:"symbol_type"`
}

type Trade

type Trade struct {
	Symbol_id     string          `json:"symbol_id"`
	Time_exchange time.Time       `json:"time_exchange"`
	Time_coinapi  time.Time       `json:"time_coinapi"`
	Uuid          string          `json:"uuid"`
	Price         decimal.Decimal `json:"price"`
	Size          decimal.Decimal `json:"size"`
	// contains filtered or unexported fields
}

type Tweet

type Tweet struct {
	CreatedAt            string                 `json:"created_at"`
	FavoriteCount        int                    `json:"favorite_count"`
	Favorited            bool                   `json:"favorited"`
	FilterLevel          string                 `json:"filter_level"`
	ID                   int64                  `json:"id"`
	IDStr                string                 `json:"id_str"`
	InReplyToScreenName  string                 `json:"in_reply_to_screen_name"`
	InReplyToStatusID    int64                  `json:"in_reply_to_status_id"`
	InReplyToStatusIDStr string                 `json:"in_reply_to_status_id_str"`
	InReplyToUserID      int64                  `json:"in_reply_to_user_id"`
	InReplyToUserIDStr   string                 `json:"in_reply_to_user_id_str"`
	Lang                 string                 `json:"lang"`
	PossiblySensitive    bool                   `json:"possibly_sensitive"`
	RetweetCount         int                    `json:"retweet_count"`
	Retweeted            bool                   `json:"retweeted"`
	Source               string                 `json:"source"`
	Scopes               map[string]interface{} `json:"scopes"`
	Text                 string                 `json:"text"`
	FullText             string                 `json:"full_text"`
	Truncated            bool                   `json:"truncated"`
	WithheldCopyright    bool                   `json:"withheld_copyright"`
	WithheldInCountries  []string               `json:"withheld_in_countries"`
	WithheldScope        string                 `json:"withheld_scope"`
	QuotedStatusID       int64                  `json:"quoted_status_id"`
	QuotedStatusIDStr    string                 `json:"quoted_status_id_str"`
}

Jump to

Keyboard shortcuts

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