diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 62eaedc8a24e19..5b91b065e78e26 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -398,6 +398,25 @@ impl JsonRpcRequestProcessor { .unwrap_or(None)) } + pub fn get_signature_confirmation_status( + &self, + signature: Signature, + commitment: Option, + ) -> Option { + self.bank(commitment) + .get_signature_confirmation_status(&signature) + .map( + |SignatureConfirmationStatus { + confirmations, + status, + .. + }| RpcSignatureConfirmation { + confirmations, + status, + }, + ) + } + pub fn get_signature_status( &self, signature: Signature, @@ -560,6 +579,14 @@ pub trait RpcSol { #[rpc(meta, name = "getFeeRateGovernor")] fn get_fee_rate_governor(&self, meta: Self::Metadata) -> RpcResponse; + #[rpc(meta, name = "getSignatureConfirmation")] + fn get_signature_confirmation( + &self, + meta: Self::Metadata, + signature_str: String, + commitment: Option, + ) -> Result>; + #[rpc(meta, name = "getSignatureStatus")] fn get_signature_status( &self, @@ -899,6 +926,24 @@ impl RpcSol for RpcSolImpl { .get_fee_rate_governor() } + fn get_signature_confirmation( + &self, + meta: Self::Metadata, + signature_str: String, + commitment: Option, + ) -> Result> { + debug!( + "get_signature_confirmation rpc request received: {:?}", + signature_str + ); + let signature = verify_signature(&signature_str)?; + Ok(meta + .request_processor + .read() + .unwrap() + .get_signature_confirmation_status(signature, commitment)) + } + fn get_signature_status( &self, meta: Self::Metadata,