Greenfield: Add balance endpoint (#3887)

* Greenfield: Add balance endpoint

* Remove superfluous try/catch
This commit is contained in:
d11n
2022-06-23 06:42:28 +02:00
committed by GitHub
parent c89f7aaaed
commit 61c6a2ab57
10 changed files with 296 additions and 2 deletions

View File

@@ -17,6 +17,15 @@ namespace BTCPayServer.Client
method: HttpMethod.Get), token);
return await HandleResponse<LightningNodeInformationData>(response);
}
public virtual async Task<LightningNodeBalanceData> GetLightningNodeBalance(string cryptoCode,
CancellationToken token = default)
{
var response = await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/server/lightning/{cryptoCode}/balance",
method: HttpMethod.Get), token);
return await HandleResponse<LightningNodeBalanceData>(response);
}
public virtual async Task ConnectToLightningNode(string cryptoCode, ConnectToNodeRequest request,
CancellationToken token = default)