diff --git a/libs/sdk-core/src/greenlight/node_api.rs b/libs/sdk-core/src/greenlight/node_api.rs index 580a72199..66cbd5eb6 100644 --- a/libs/sdk-core/src/greenlight/node_api.rs +++ b/libs/sdk-core/src/greenlight/node_api.rs @@ -1461,7 +1461,7 @@ impl NodeAPI for Greenlight { .list_peers(cln::ListpeersRequest::default()) .await? .into_inner(); - Ok(format!("{resp:?}")) + Ok(serde_json::to_string_pretty(&resp)?) } NodeCommand::ListPeerChannels => { let resp = self @@ -1470,7 +1470,7 @@ impl NodeAPI for Greenlight { .list_peer_channels(cln::ListpeerchannelsRequest::default()) .await? .into_inner(); - Ok(format!("{resp:?}")) + Ok(serde_json::to_string_pretty(&resp)?) } NodeCommand::ListFunds => { let resp = self @@ -1479,7 +1479,7 @@ impl NodeAPI for Greenlight { .list_funds(cln::ListfundsRequest::default()) .await? .into_inner(); - Ok(format!("{resp:?}")) + Ok(serde_json::to_string_pretty(&resp)?) } NodeCommand::ListPayments => { let resp = self @@ -1488,7 +1488,7 @@ impl NodeAPI for Greenlight { .list_pays(cln::ListpaysRequest::default()) .await? .into_inner(); - Ok(format!("{resp:?}")) + Ok(serde_json::to_string_pretty(&resp)?) } NodeCommand::ListInvoices => { let resp = self @@ -1497,7 +1497,7 @@ impl NodeAPI for Greenlight { .list_invoices(cln::ListinvoicesRequest::default()) .await? .into_inner(); - Ok(format!("{resp:?}")) + Ok(serde_json::to_string_pretty(&resp)?) } NodeCommand::CloseAllChannels => { let peers_res = self @@ -1519,11 +1519,11 @@ impl NodeAPI for Greenlight { .getinfo(cln::GetinfoRequest::default()) .await? .into_inner(); - Ok(format!("{resp:?}")) + Ok(serde_json::to_string_pretty(&resp)?) } NodeCommand::GenerateDiagnosticData => { let resp = self.generate_diagnostic_data().await?; - Ok(format!("{resp:?}")) + Ok(serde_json::to_string_pretty(&resp)?) } NodeCommand::Stop => { let resp = self @@ -1532,7 +1532,7 @@ impl NodeAPI for Greenlight { .stop(cln::StopRequest::default()) .await? .into_inner(); - Ok(format!("{resp:?}")) + Ok(serde_json::to_string_pretty(&resp)?) } } }