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

Method xpay

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

Source from the content-addressed store, hash-verified

4536 }
4537
4538 async fn xpay(
4539 &self,
4540 request: tonic::Request<pb::XpayRequest>,
4541 ) -> Result<tonic::Response<pb::XpayResponse>, tonic::Status> {
4542 let req = request.into_inner();
4543 let req: requests::XpayRequest = req.try_into()?;
4544 debug!("Client asked for xpay");
4545 trace!("xpay request: {:?}", req);
4546 let mut rpc = ClnRpc::new(&self.rpc_path)
4547 .await
4548 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
4549 let result = rpc.call(Request::Xpay(req))
4550 .await
4551 .map_err(|e| Status::new(
4552 Code::Unknown,
4553 format!("Error calling method Xpay: {:?}", e)))?;
4554 match result {
4555 Response::Xpay(r) => {
4556 trace!("xpay response: {:?}", r);
4557 Ok(tonic::Response::new(r.into()))
4558 },
4559 r => Err(Status::new(
4560 Code::Internal,
4561 format!(
4562 "Unexpected result {:?} to method call Xpay",
4563 r
4564 )
4565 )),
4566 }
4567
4568 }
4569
4570 async fn sign_message_with_key(
4571 &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