Skip to content
Merged
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ base64 = "0.22.1"
bincode = "1.3.3" # TODO: Update when solana updates.
chrono = { version = "0.4.11", features = ["serde"] }
futures-util = "0.3.30"
log = "0.4"
once_cell = "1.21.3"
phf = { version = "0.13.1", features = ["macros"] }
rand = "0.9.2"
Expand Down
4 changes: 2 additions & 2 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ impl HeliusBuilder {

// Warn if no API key for Helius endpoints
if self.api_key.is_none() {
eprintln!(
"⚠️ Warning: No API key provided for Helius endpoint. \
log::warn!(
"No API key provided for Helius endpoint. \
Most features require authentication. Use .with_api_key(\"your-key\")"
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ impl RequestHandler {
match serde_json::from_str::<T>(&body_text) {
Ok(data) => Ok(data),
Err(e) => {
println!("Deserialization error: {}", e);
println!("Raw JSON: {}", body_text);
log::error!("Deserialization error: {}", e);
log::debug!("Raw JSON: {}", body_text);
Err(HeliusError::from(e))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl RpcClient {
self.get_program_accounts_v2(program_id.clone(), config.clone()).await?;
all_accounts.extend(response.accounts);

println!("Fetched {} accounts so far", all_accounts.len());
log::info!("Fetched {} accounts so far", all_accounts.len());

if let Some(key) = response.pagination_key {
config.pagination_key = Some(key);
Expand Down
7 changes: 4 additions & 3 deletions src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ impl EnhancedWebsocket {
UnboundedReceiverStream::new(notifications)
.filter_map(|value| match serde_json::from_value::<T>(value.clone()) {
Err(e) => {
eprintln!(
log::warn!(
"Failed to parse websocket notification: {:#?} for value: {:#?}",
e, value
e,
value
);
ready(None)
}
Expand Down Expand Up @@ -429,7 +430,7 @@ impl EnhancedWebsocket {
}
}
} else {
eprintln!("Unknown request id: {}", id);
log::warn!("Unknown request id: {}", id);
break;
}
continue;
Expand Down
Loading