mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-11 17:57:49 +01:00
23 lines
790 B
C#
23 lines
790 B
C#
|
using System.Net.Http;
|
||
|
using System.Threading;
|
||
|
using System.Threading.Tasks;
|
||
|
using BTCPayServer.Client.Models;
|
||
|
|
||
|
namespace BTCPayServer.Client
|
||
|
{
|
||
|
public partial class BTCPayServerClient
|
||
|
{
|
||
|
public virtual async Task<ApiKeyData> GetCurrentAPIKeyInfo(CancellationToken token = default)
|
||
|
{
|
||
|
var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/api-keys/current"), token);
|
||
|
return await HandleResponse<ApiKeyData>(response);
|
||
|
}
|
||
|
|
||
|
public virtual async Task RevokeCurrentAPIKeyInfo(CancellationToken token = default)
|
||
|
{
|
||
|
var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/api-keys/current", null, HttpMethod.Delete), token);
|
||
|
HandleResponse(response);
|
||
|
}
|
||
|
}
|
||
|
}
|