pub enum ExchangeRateError {
Show 15 variants
AnonymousPrincipalNotAllowed,
Pending,
CryptoBaseAssetNotFound,
CryptoQuoteAssetNotFound,
StablecoinRateNotFound,
StablecoinRateTooFewRates,
StablecoinRateZeroRate,
ForexInvalidTimestamp,
ForexBaseAssetNotFound,
ForexQuoteAssetNotFound,
ForexAssetsNotFound,
RateLimited,
NotEnoughCycles,
InconsistentRatesReceived,
Other(OtherError),
}Expand description
Returned to the user when something goes wrong retrieving the exchange rate.
Variants§
AnonymousPrincipalNotAllowed
Returned when the canister receives a call from the anonymous principal.
Pending
Returned when the canister is in process of retrieving a rate from an exchange.
CryptoBaseAssetNotFound
Returned when the base asset rates are not found from the exchanges HTTP outcalls.
CryptoQuoteAssetNotFound
Returned when the quote asset rates are not found from the exchanges HTTP outcalls.
StablecoinRateNotFound
Returned when the stablecoin rates are not found from the exchanges HTTP outcalls needed for computing a crypto/fiat pair.
StablecoinRateTooFewRates
Returned when there are not enough stablecoin rates to determine the forex/USDT rate.
StablecoinRateZeroRate
Returned when the stablecoin rate is zero.
ForexInvalidTimestamp
Returned when a rate for the provided forex asset could not be found at the provided timestamp.
ForexBaseAssetNotFound
Returned when the forex base asset is found.
ForexQuoteAssetNotFound
Returned when the forex quote asset is found.
ForexAssetsNotFound
Returned when neither forex asset is found.
RateLimited
Returned when the caller is not the CMC and there are too many active requests.
NotEnoughCycles
Returned when the caller does not send enough cycles to make a request.
InconsistentRatesReceived
Returned if too many collected rates deviate substantially.
Other(OtherError)
Until candid bug is fixed, new errors after launch will be placed here.
Trait Implementations§
Source§impl CandidType for ExchangeRateError
impl CandidType for ExchangeRateError
Source§impl Clone for ExchangeRateError
impl Clone for ExchangeRateError
Source§fn clone(&self) -> ExchangeRateError
fn clone(&self) -> ExchangeRateError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more