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

Method currency_convert

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

Source from the content-addressed store, hash-verified

4792 }
4793
4794 async fn currency_convert(
4795 &self,
4796 request: tonic::Request<pb::CurrencyconvertRequest>,
4797 ) -> Result<tonic::Response<pb::CurrencyconvertResponse>, tonic::Status> {
4798 let req = request.into_inner();
4799 let req: requests::CurrencyconvertRequest = req.try_into()?;
4800 debug!("Client asked for currency_convert");
4801 trace!("currency_convert request: {:?}", req);
4802 let mut rpc = ClnRpc::new(&self.rpc_path)
4803 .await
4804 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
4805 let result = rpc.call(Request::CurrencyConvert(req))
4806 .await
4807 .map_err(|e| Status::new(
4808 Code::Unknown,
4809 format!("Error calling method CurrencyConvert: {:?}", e)))?;
4810 match result {
4811 Response::CurrencyConvert(r) => {
4812 trace!("currency_convert response: {:?}", r);
4813 Ok(tonic::Response::new(r.into()))
4814 },
4815 r => Err(Status::new(
4816 Code::Internal,
4817 format!(
4818 "Unexpected result {:?} to method call CurrencyConvert",
4819 r
4820 )
4821 )),
4822 }
4823
4824 }
4825
4826 async fn currency_rate(
4827 &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