From 072e54a566fb92e5358145dbc442fb5b8e4b791a Mon Sep 17 00:00:00 2001 From: Lioncat2002 Date: Tue, 22 Nov 2022 19:10:48 +0530 Subject: [PATCH] feat: added signature subscribe --- src/rpc.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/rpc.rs b/src/rpc.rs index 6fdd4660..4c582dc7 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -1,5 +1,5 @@ use solana_client::{ - pubsub_client::{BlockSubscription, PubsubClientError}, + pubsub_client::{BlockSubscription, PubsubClientError, SignatureSubscription}, tpu_client::TpuClientConfig, }; use solana_pubsub_client::pubsub_client::{PubsubBlockClientSubscription, PubsubClient}; @@ -114,6 +114,23 @@ impl LightRpcRequestProcessor { ) } + fn subscribe_signature( + websocket_url: &String, + signature: &Signature, + commitment:CommitmentLevel + ) -> std::result::Result { + PubsubClient::signature_subscribe( + websocket_url.as_str(), + signature, + Some(RpcSignatureSubscribeConfig { + commitment: Some(CommitmentConfig { + commitment, + }), + enable_received_notification: Some(false), + }), + ) + } + fn build_thread_to_process_blocks( reciever: Receiver>, context: &Arc,