diff --git a/src/endpoints/get_altcoin_quote.rs b/src/endpoints/get_altcoin_quote.rs index aa71cbc..e67e756 100644 --- a/src/endpoints/get_altcoin_quote.rs +++ b/src/endpoints/get_altcoin_quote.rs @@ -25,7 +25,8 @@ pub struct AddrQuery { #[derive(Deserialize, Debug)] pub struct AvnuApiResult { address: FieldElement, - currentPrice: f64, + #[serde(rename = "currentPrice")] + current_price: f64, } lazy_static::lazy_static! { @@ -63,7 +64,7 @@ pub async fn handler( let max_validity_timestamp = (now + Duration::seconds(altcoin_data.max_quote_validity)) .timestamp(); - let quote = 1.0 / data.currentPrice; + let quote = 1.0 / data.current_price; // check if quote is within the valid range if quote < altcoin_data.min_price as f64 || quote > altcoin_data.max_price as f64 diff --git a/src/endpoints/renewal/get_renewal_data.rs b/src/endpoints/renewal/get_renewal_data.rs index 06729bf..11ae89d 100644 --- a/src/endpoints/renewal/get_renewal_data.rs +++ b/src/endpoints/renewal/get_renewal_data.rs @@ -9,7 +9,7 @@ use axum::{ }; use axum_auto_routes::route; use futures::StreamExt; -use mongodb::{bson::doc, options::FindOptions}; +use mongodb::bson::doc; use serde::{Deserialize, Serialize}; use starknet::core::types::FieldElement; use std::sync::Arc;