MCPcopy Create free account
hub / github.com/ElementsProject/lightning / currency_rate

Method currency_rate

cln-grpc/src/server.rs:4826–4856  ·  view source on GitHub ↗
(
        &self,
        request: tonic::Request<pb::CurrencyrateRequest>,
    )

Source from the content-addressed store, hash-verified

4824 }
4825
4826 async fn currency_rate(
4827 &self,
4828 request: tonic::Request<pb::CurrencyrateRequest>,
4829 ) -> Result<tonic::Response<pb::CurrencyrateResponse>, tonic::Status> {
4830 let req = request.into_inner();
4831 let req: requests::CurrencyrateRequest = req.try_into()?;
4832 debug!("Client asked for currency_rate");
4833 trace!("currency_rate request: {:?}", req);
4834 let mut rpc = ClnRpc::new(&self.rpc_path)
4835 .await
4836 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
4837 let result = rpc.call(Request::CurrencyRate(req))
4838 .await
4839 .map_err(|e| Status::new(
4840 Code::Unknown,
4841 format!("Error calling method CurrencyRate: {:?}", e)))?;
4842 match result {
4843 Response::CurrencyRate(r) => {
4844 trace!("currency_rate response: {:?}", r);
4845 Ok(tonic::Response::new(r.into()))
4846 },
4847 r => Err(Status::new(
4848 Code::Internal,
4849 format!(
4850 "Unexpected result {:?} to method call CurrencyRate",
4851 r
4852 )
4853 )),
4854 }
4855
4856 }
4857
4858 async fn send_amount(
4859 &self,

Callers

nothing calls this directly

Calls 3

into_innerMethod · 0.80
to_stringMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected