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

@@ -40,6 +40,7 @@ namespace BTCPayServer.Controllers.Greenfield
_lightningClientFactory = lightningClientFactory;
_btcPayNetworkProvider = btcPayNetworkProvider;
}
[Authorize(Policy = Policies.CanUseLightningNodeInStore,
AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[HttpGet("~/api/v1/stores/{storeId}/lightning/{cryptoCode}/info")]
@@ -48,6 +49,14 @@ namespace BTCPayServer.Controllers.Greenfield
return base.GetInfo(cryptoCode, cancellationToken);
}
[Authorize(Policy = Policies.CanUseLightningNodeInStore,
AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[HttpGet("~/api/v1/stores/{storeId}/lightning/{cryptoCode}/balance")]
public override Task<IActionResult> GetBalance(string cryptoCode, CancellationToken cancellationToken = default)
{
return base.GetBalance(cryptoCode, cancellationToken);
}
[Authorize(Policy = Policies.CanUseLightningNodeInStore,
AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[HttpPost("~/api/v1/stores/{storeId}/lightning/{cryptoCode}/connect")]