Skip to content

sgns::CoinGeckoPriceRetriever

#include <coinprices.hpp>

Public Types

Name
enum class PriceError

Public Functions

Name
CoinGeckoPriceRetriever()
std::string formatDate(int64_t timestamp, bool includeTime =false)
outcome::result< std::map< std::string, double > > getCurrentPrices(const std::vector< std::string > & tokenIds)
outcome::result< std::map< std::string, std::map< int64_t, double > > > getHistoricalPrices(const std::vector< std::string > & tokenIds, const std::vector< int64_t > & timestamps)
outcome::result< std::map< std::string, std::map< int64_t, double > > > getHistoricalPriceRange(const std::vector< std::string > & tokenIds, int64_t from, int64_t to)

Public Types Documentation

enum PriceError

Enumerator Value Description
EmptyInput 1
NetworkError
JsonParseError
NoDataFound
RateLimitExceeded
DateTooOld

Public Functions Documentation

function CoinGeckoPriceRetriever

CoinGeckoPriceRetriever()

function formatDate

std::string formatDate(
    int64_t timestamp,
    bool includeTime =false
)

function getCurrentPrices

outcome::result< std::map< std::string, double > > getCurrentPrices(
    const std::vector< std::string > & tokenIds
)

function getHistoricalPrices

outcome::result< std::map< std::string, std::map< int64_t, double > > > getHistoricalPrices(
    const std::vector< std::string > & tokenIds,
    const std::vector< int64_t > & timestamps
)

function getHistoricalPriceRange

outcome::result< std::map< std::string, std::map< int64_t, double > > > getHistoricalPriceRange(
    const std::vector< std::string > & tokenIds,
    int64_t from,
    int64_t to
)

Updated on 2026-03-04 at 13:10:43 -0800