diff --git a/connector/examples/call_gpa_gma_example.rs b/connector/examples/call_gpa_gma_example.rs index 5b37a86..bc483c1 100644 --- a/connector/examples/call_gpa_gma_example.rs +++ b/connector/examples/call_gpa_gma_example.rs @@ -2,11 +2,6 @@ use clap::Parser; -use jsonrpc_core_client::transports::http; -use solana_account_decoder::UiAccountEncoding; -use solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig}; -use solana_client::rpc_response::OptionalContext; -use solana_sdk::commitment_config::CommitmentConfig; use solana_sdk::pubkey::Pubkey; use mango_feeds_connector::snapshot::get_snapshot_gma; diff --git a/connector/src/snapshot.rs b/connector/src/snapshot.rs index ab96c0c..99e19c5 100644 --- a/connector/src/snapshot.rs +++ b/connector/src/snapshot.rs @@ -66,16 +66,10 @@ pub async fn get_snapshot_gma( rpc_http_url: &str, ids: Vec, ) -> anyhow::Result { - - info!("Call patched get_snapshot_gma"); let rpc_client = http::connect::(rpc_http_url) .await .map_err_anyhow()?; - // let rpc_client = http::connect::(rpc_http_url) - // .await - // .map_err_anyhow()?; - let account_info_config = RpcAccountInfoConfig { encoding: Some(UiAccountEncoding::Base64), commitment: Some(CommitmentConfig::finalized()), diff --git a/connector/src/solana_rpc_minimal.rs b/connector/src/solana_rpc_minimal.rs index d54879c..f3ea5c1 100644 --- a/connector/src/solana_rpc_minimal.rs +++ b/connector/src/solana_rpc_minimal.rs @@ -1,14 +1,11 @@ pub mod rpc_accounts_scan { - use std::sync::Arc; use jsonrpc_core::Result; use jsonrpc_derive::rpc; - use jsonrpc_pubsub::typed::Subscriber; use solana_account_decoder::UiAccount; use solana_rpc_client_api::config::{RpcAccountInfoConfig, RpcProgramAccountsConfig}; - use solana_rpc_client_api::response::{Response as RpcResponse, RpcKeyedAccount, SlotUpdate, OptionalContext}; - use jsonrpc_pubsub::SubscriptionId as PubSubSubscriptionId; + use solana_rpc_client_api::response::{Response as RpcResponse, RpcKeyedAccount, OptionalContext}; /// this definition is derived from solana-rpc/rpc.rs /// we want to avoid the heavy dependency to solana-rpc @@ -46,15 +43,13 @@ pub mod rpc_pubsub { use jsonrpc_pubsub::typed::Subscriber; use solana_account_decoder::UiAccount; use solana_rpc_client_api::config::{RpcAccountInfoConfig, RpcProgramAccountsConfig}; - use solana_rpc_client_api::response::{Response as RpcResponse, RpcKeyedAccount, SlotUpdate, OptionalContext}; + use solana_rpc_client_api::response::{Response as RpcResponse, RpcKeyedAccount, SlotUpdate}; use jsonrpc_pubsub::SubscriptionId as PubSubSubscriptionId; #[rpc] pub trait RpcSolPubSub { type Metadata; - // Get notification every time account data is changed - // Accepts pubkey parameter as base-58 encoded string #[pubsub( subscription = "accountNotification", subscribe, @@ -68,7 +63,6 @@ pub mod rpc_pubsub { config: Option, ); - // Unsubscribe from account notification subscription. #[pubsub( subscription = "accountNotification", unsubscribe, @@ -78,11 +72,8 @@ pub mod rpc_pubsub { &self, meta: Option, id: PubSubSubscriptionId, - ) -> jsonrpc_core::Result; - + ) -> Result; - // Get notification every time account data owned by a particular program is changed - // Accepts pubkey parameter as base-58 encoded string #[pubsub( subscription = "programNotification", subscribe, @@ -96,7 +87,6 @@ pub mod rpc_pubsub { config: Option, ); - // Unsubscribe from account notification subscription. #[pubsub( subscription = "programNotification", unsubscribe, @@ -106,10 +96,9 @@ pub mod rpc_pubsub { &self, meta: Option, id: PubSubSubscriptionId, - ) -> jsonrpc_core::Result; + ) -> Result; - // Get series of updates for all slots #[pubsub( subscription = "slotsUpdatesNotification", subscribe, @@ -121,7 +110,6 @@ pub mod rpc_pubsub { subscriber: Subscriber>, ); - // Unsubscribe from slots updates notification subscription. #[pubsub( subscription = "slotsUpdatesNotification", unsubscribe, @@ -131,7 +119,7 @@ pub mod rpc_pubsub { &self, meta: Option, id: PubSubSubscriptionId, - ) -> jsonrpc_core::Result; + ) -> Result; } diff --git a/connector/src/websocket_source.rs b/connector/src/websocket_source.rs index c0c1789..7e72f0e 100644 --- a/connector/src/websocket_source.rs +++ b/connector/src/websocket_source.rs @@ -18,7 +18,6 @@ use std::{ sync::Arc, time::{Duration, Instant}, }; -use solana_rpc_client::rpc_client::RpcClient; use tokio::time::timeout; use crate::snapshot::{