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

Method withdraw

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

Source from the content-addressed store, hash-verified

1364 }
1365
1366 async fn withdraw(
1367 &self,
1368 request: tonic::Request<pb::WithdrawRequest>,
1369 ) -> Result<tonic::Response<pb::WithdrawResponse>, tonic::Status> {
1370 let req = request.into_inner();
1371 let req: requests::WithdrawRequest = req.try_into()?;
1372 debug!("Client asked for withdraw");
1373 trace!("withdraw request: {:?}", req);
1374 let mut rpc = ClnRpc::new(&self.rpc_path)
1375 .await
1376 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
1377 let result = rpc.call(Request::Withdraw(req))
1378 .await
1379 .map_err(|e| Status::new(
1380 Code::Unknown,
1381 format!("Error calling method Withdraw: {:?}", e)))?;
1382 match result {
1383 Response::Withdraw(r) => {
1384 trace!("withdraw response: {:?}", r);
1385 Ok(tonic::Response::new(r.into()))
1386 },
1387 r => Err(Status::new(
1388 Code::Internal,
1389 format!(
1390 "Unexpected result {:?} to method call Withdraw",
1391 r
1392 )
1393 )),
1394 }
1395
1396 }
1397
1398 async fn key_send(
1399 &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