diff --git a/Cargo.toml b/Cargo.toml index b2ab05d..ae0da4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,18 +5,18 @@ edition = "2021" [dependencies] log = "0.4" -env_logger = "0.10" +env_logger = "0.11" chrono = "0.4" -url = { version = "2.4.1", features = ["serde"] } +url = { version = "2.5.0", features = ["serde"] } anyhow = "1.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -tokio = { version = "1.0", features = ["full"] } -solana-client = "1.17" -solana-sdk = "1.17" -solana-account-decoder = "1.17" -solana-transaction-status = "1.17" +tokio = { version = "1.36", features = ["full"] } +solana-client = "1.18" +solana-sdk = "1.18" +solana-account-decoder = "1.18" +solana-transaction-status = "1.18" spl-token = "4.0" base64 = "0.21" bs58 = "0.5" -bincode = "1.3" +bincode = "1.3" \ No newline at end of file diff --git a/src/config.rs b/src/config.rs index da37216..41378fa 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,7 +21,7 @@ impl Config { // Fall back to environment variables let rpc_url = env::var("SOLANA_RPC_URL") - .unwrap_or_else(|_| "https://api.opensvm.com".to_string()); + .unwrap_or_else(|_| "https://api.mainnet-beta.solana.com".to_string()); let commitment = env::var("SOLANA_COMMITMENT") .unwrap_or_else(|_| "confirmed".to_string()); @@ -35,4 +35,4 @@ impl Config { protocol_version, }) } -} +} \ No newline at end of file diff --git a/src/protocol.rs b/src/protocol.rs index 334d556..c08543b 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use url::Url; -pub const LATEST_PROTOCOL_VERSION: &str = "2024-11-05"; +pub const LATEST_PROTOCOL_VERSION: &str = "2023-11-15"; #[derive(Debug, Clone, Serialize, Deserialize, Default)] #[serde(rename_all = "camelCase")] @@ -219,4 +219,4 @@ mod tests { let json = serde_json::to_string(&capabilities).unwrap(); assert_eq!(json, "{}"); } -} +} \ No newline at end of file diff --git a/src/tools/mod.rs b/src/tools/mod.rs index a248a39..d6e0e1c 100644 --- a/src/tools/mod.rs +++ b/src/tools/mod.rs @@ -35,9 +35,7 @@ pub fn create_error_response(code: i32, message: String, id: u64, protocol_versi #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] struct CancelledParams { - #[allow(dead_code)] request_id: i64, - #[allow(dead_code)] reason: String, } @@ -224,7 +222,8 @@ pub async fn handle_initialize(params: Option, id: Option, state: pub async fn handle_cancelled(params: Option, id: Option, state: &ServerState) -> Result { log::info!("Handling cancelled request"); if let Some(params) = params { - let _cancel_params: CancelledParams = serde_json::from_value(params)?; + let cancel_params: CancelledParams = serde_json::from_value(params)?; + log::info!("Request {} cancelled: {}", cancel_params.request_id, cancel_params.reason); Ok(create_success_response( Value::Null, id.and_then(|v| v.as_u64()).unwrap_or(0) @@ -529,4 +528,4 @@ pub async fn handle_request(request: &str, state: Arc>) -> R } }, } -} +} \ No newline at end of file