Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions src/blockfrost/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::error::DataProviderBlockfrostError;
use super::BlockfrostProvider;
use crate::models::{
CDPDatum, CardanoNativeAssetView, DelegationView, HoldingWalletView, StakeDelegationView,
StakeDeregistrationView, StakeRegistrationView, TokenInfoView, RewardView,
StakeDeregistrationView, StakeRegistrationView, TokenInfoView, RewardView, PoolInfo
};
use crate::provider::error::DataProviderError;
use blockfrost::{AccountAddress, AddressUtxo};
Expand Down Expand Up @@ -258,129 +258,153 @@ pub fn retrieve_generated_rewards (
Ok(vec![])
}


#[cfg(feature = "granular_pool")]
pub fn pool_vrf_key_hash (
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<Vec<u8>, DataProviderError> {
) -> Result<String, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_blocks_minted (
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_blocks_current_epoch(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_reward_recipients(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_last_reward_earned_epoch(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_declared_pledge(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<BigDecimal, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_margin_cost(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<f64, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_fixed_cost(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<BigDecimal, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_reward_address(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<String, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_owner(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<String, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_registration(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_retirement(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<i32, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_url(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<String, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_ticker(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<String, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_metadata_json(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<Value, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_name(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<String, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_homepage(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<String, DataProviderError> {
todo!()
}

#[cfg(feature = "granular_pool")]
pub fn pool_description(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<String, DataProviderError> {
todo!()
}

pub fn pool_info(
bfp: &BlockfrostProvider,
pool_hash: &str,
) -> Result<PoolInfo, DataProviderError> {
todo!()
}
29 changes: 27 additions & 2 deletions src/blockfrost/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::provider::error::DataProviderError;
use crate::models::{CDPDatum, RewardView, TokenInfoView, CardanoNativeAssetView, StakeDelegationView, DelegationView,
StakeRegistrationView, StakeDeregistrationView, HoldingWalletView, TxHistoryListView
StakeRegistrationView, StakeDeregistrationView, HoldingWalletView, TxHistoryListView, PoolInfo
};

use async_trait::async_trait;
Expand Down Expand Up @@ -269,129 +269,154 @@ impl super::provider::CardanoDataProvider for BlockfrostProvider {
Ok(api::retrieve_generated_rewards(self, stake_addr)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_vrf_key_hash (
&self,
pool_hash: &str,
) -> Result<Vec<u8>, DataProviderError> {
) -> Result<String, DataProviderError> {
Ok(api::pool_vrf_key_hash(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_blocks_minted (
&self,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
Ok(api::pool_blocks_minted(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_blocks_current_epoch(
&self,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
Ok(api::pool_blocks_current_epoch(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_reward_recipients(
&self,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
Ok(api::pool_reward_recipients(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_last_reward_earned_epoch(
&self,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
Ok(api::pool_last_reward_earned_epoch(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_declared_pledge(
&self,
pool_hash: &str,
) -> Result<BigDecimal, DataProviderError> {
Ok(api::pool_declared_pledge(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_margin_cost(
&self,
pool_hash: &str,
) -> Result<f64, DataProviderError> {
Ok(api::pool_margin_cost(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_fixed_cost(
&self,
pool_hash: &str,
) -> Result<BigDecimal, DataProviderError> {
Ok(api::pool_fixed_cost(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_reward_address(
&self,
pool_hash: &str,
) -> Result<String, DataProviderError> {
Ok(api::pool_reward_address(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_owner(
&self,
pool_hash: &str,
) -> Result<String, DataProviderError> {
Ok(api::pool_owner(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_registration(
&self,
pool_hash: &str,
) -> Result<i64, DataProviderError> {
Ok(api::pool_registration(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_retirement(
&self,
pool_hash: &str,
) -> Result<i32, DataProviderError> {
Ok(api::pool_retirement(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_url(
&self,
pool_hash: &str,
) -> Result<String, DataProviderError> {
Ok(api::pool_url(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_ticker(
&self,
pool_hash: &str,
) -> Result<String, DataProviderError> {
Ok(api::pool_ticker(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_metadata_json(
&self,
pool_hash: &str,
) -> Result<Value, DataProviderError> {
Ok(api::pool_metadata_json(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_name(
&self,
pool_hash: &str,
) -> Result<String, DataProviderError> {
Ok(api::pool_name(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_homepage(
&self,
pool_hash: &str,
) -> Result<String, DataProviderError> {
Ok(api::pool_homepage(self, pool_hash)?)
}

#[cfg(feature = "granular_pool")]
async fn pool_description(
&self,
pool_hash: &str,
) -> Result<String, DataProviderError> {
Ok(api::pool_description(self, pool_hash)?)
}

async fn pool_info(
&self,
pool_hash: &str,
) -> Result<PoolInfo, DataProviderError> {
Ok(api::pool_info(self, pool_hash)?)
}
}
Loading