Struct concordium_std::ExchangeRates
source · pub struct ExchangeRates {
pub euro_per_energy: ExchangeRate,
pub micro_ccd_per_euro: ExchangeRate,
}
Expand description
The current exchange rates.
Fields§
§euro_per_energy: ExchangeRate
Euro per NRG exchange rate.
micro_ccd_per_euro: ExchangeRate
Micro CCD per Euro exchange rate.
Implementations§
source§impl ExchangeRates
impl ExchangeRates
sourcepub fn convert_euro_cent_to_amount(&self, euro_cent: u64) -> Amount
pub fn convert_euro_cent_to_amount(&self, euro_cent: u64) -> Amount
Convert Euro cent to CCD using the current exchange rate. This will round down to the nearest micro CCD.
sourcepub fn convert_amount_to_euro_cent(&self, amount: Amount) -> u64
pub fn convert_amount_to_euro_cent(&self, amount: Amount) -> u64
Convert CCD to Euro cent using the current exchange rate. This will round down to the nearest Euro cent.
Trait Implementations§
source§impl Clone for ExchangeRates
impl Clone for ExchangeRates
source§fn clone(&self) -> ExchangeRates
fn clone(&self) -> ExchangeRates
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ExchangeRates
impl Debug for ExchangeRates
source§impl Deserial for ExchangeRates
impl Deserial for ExchangeRates
source§impl PartialEq<ExchangeRates> for ExchangeRates
impl PartialEq<ExchangeRates> for ExchangeRates
source§fn eq(&self, other: &ExchangeRates) -> bool
fn eq(&self, other: &ExchangeRates) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.