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
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -35,4 +35,4 @@ impl Config {
protocol_version,
})
}
}
}
4 changes: 2 additions & 2 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -219,4 +219,4 @@ mod tests {
let json = serde_json::to_string(&capabilities).unwrap();
assert_eq!(json, "{}");
}
}
}
7 changes: 3 additions & 4 deletions src/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -224,7 +222,8 @@ pub async fn handle_initialize(params: Option<Value>, id: Option<Value>, state:
pub async fn handle_cancelled(params: Option<Value>, id: Option<Value>, state: &ServerState) -> Result<JsonRpcMessage> {
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)
Expand Down Expand Up @@ -529,4 +528,4 @@ pub async fn handle_request(request: &str, state: Arc<RwLock<ServerState>>) -> R
}
},
}
}
}