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

Method list_funds

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

Source from the content-addressed store, hash-verified

91}
92
93async fn list_funds(
94 &self,
95 request: tonic::Request<pb::ListfundsRequest>,
96) -> Result<tonic::Response<pb::ListfundsResponse>, tonic::Status> {
97 let req = request.into_inner();
98 let req: requests::ListfundsRequest = req.into();
99 debug!("Client asked for list_funds");
100 trace!("list_funds request: {:?}", req);
101 let mut rpc = ClnRpc::new(&self.rpc_path)
102 .await
103 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
104 let result = rpc.call(Request::ListFunds(req))
105 .await
106 .map_err(|e| Status::new(
107 Code::Unknown,
108 format!("Error calling method ListFunds: {:?}", e)))?;
109 match result {
110 Response::ListFunds(r) => {
111 trace!("list_funds response: {:?}", r);
112 Ok(tonic::Response::new(r.into()))
113 },
114 r => Err(Status::new(
115 Code::Internal,
116 format!(
117 "Unexpected result {:?} to method call ListFunds",
118 r
119 )
120 )),
121 }
122
123}
124
125async fn send_pay(
126 &self,

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected