Skip to main content

CryptoProvider

Trait CryptoProvider 

Source
pub trait CryptoProvider: ProviderCore {
    // Required method
    fn fetch_crypto_quote<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        vs_currency: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<CryptoQuote>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn fetch_protocol_tvl<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _protocol: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ProtocolTvl>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn fetch_protocol_tvl_history<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _protocol: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TvlPoint>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn fetch_crypto_trending<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TrendingCoin>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn fetch_crypto_global<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<GlobalCryptoStats>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn fetch_crypto_news<'life0, 'async_trait>(
        &'life0 self,
        _limit: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<News>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

crate::Capability::CRYPTO — cryptocurrency quotes.

Required Methods§

Source

fn fetch_crypto_quote<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, vs_currency: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<CryptoQuote>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch a quote for one coin, priced in vs_currency.

Provided Methods§

Source

fn fetch_protocol_tvl<'life0, 'life1, 'async_trait>( &'life0 self, _protocol: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ProtocolTvl>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch total value locked in a DeFi protocol.

Source

fn fetch_protocol_tvl_history<'life0, 'life1, 'async_trait>( &'life0 self, _protocol: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<TvlPoint>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a DeFi protocol’s TVL history, oldest first.

Fetch coins/nfts/categories trending in the last 24h (CoinGecko only).

Source

fn fetch_crypto_global<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GlobalCryptoStats>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Fetch aggregate global cryptocurrency market statistics (CoinGecko only).

Source

fn fetch_crypto_news<'life0, 'async_trait>( &'life0 self, _limit: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<News>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Fetch market-wide crypto news, newest first.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§