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

Method send_invoice

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

Source from the content-addressed store, hash-verified

2872 }
2873
2874 async fn send_invoice(
2875 &self,
2876 request: tonic::Request<pb::SendinvoiceRequest>,
2877 ) -> Result<tonic::Response<pb::SendinvoiceResponse>, tonic::Status> {
2878 let req = request.into_inner();
2879 let req: requests::SendinvoiceRequest = req.try_into()?;
2880 debug!("Client asked for send_invoice");
2881 trace!("send_invoice request: {:?}", req);
2882 let mut rpc = ClnRpc::new(&self.rpc_path)
2883 .await
2884 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
2885 let result = rpc.call(Request::SendInvoice(req))
2886 .await
2887 .map_err(|e| Status::new(
2888 Code::Unknown,
2889 format!("Error calling method SendInvoice: {:?}", e)))?;
2890 match result {
2891 Response::SendInvoice(r) => {
2892 trace!("send_invoice response: {:?}", r);
2893 Ok(tonic::Response::new(r.into()))
2894 },
2895 r => Err(Status::new(
2896 Code::Internal,
2897 format!(
2898 "Unexpected result {:?} to method call SendInvoice",
2899 r
2900 )
2901 )),
2902 }
2903
2904 }
2905
2906 async fn set_channel(
2907 &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