feat: added signature subscribe
This commit is contained in:
parent
b19e4bdd62
commit
072e54a566
19
src/rpc.rs
19
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<SignatureSubscription, PubsubClientError> {
|
||||
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<RpcResponse<RpcBlockUpdate>>,
|
||||
context: &Arc<LiteRpcContext>,
|
||||
|
|
Loading…
Reference in New Issue