Skip to content

Commit

Permalink
Added restClient.SpotApi.Account.GetApiKeyInfoAsync endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Nov 4, 2024
1 parent f22301f commit df2eb4d
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Kucoin.Net/Clients/SpotApi/KucoinRestClientSpotApiAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,14 @@ public async Task<WebCallResult<bool>> GetIsHfAccountAsync(CancellationToken ct
return await _baseClient.SendAsync<bool>(request, parameters, ct).ConfigureAwait(false);
}

/// <inheritdoc />
public async Task<WebCallResult<KucoinApiKey>> GetApiKeyInfoAsync(CancellationToken ct = default)
{
var parameters = new ParameterCollection();
var request = _definitions.GetOrCreate(HttpMethod.Get, $"api/v1/user/api-key", KucoinExchange.RateLimiter.SpotRest, 10, true);
return await _baseClient.SendAsync<KucoinApiKey>(request, parameters, ct).ConfigureAwait(false);
}

internal async Task<WebCallResult<KucoinToken>> GetWebsocketTokenPublicAsync(CancellationToken ct = default)
{
var request = _definitions.GetOrCreate(HttpMethod.Post, $"api/v1/bullet-public", KucoinExchange.RateLimiter.PublicRest, 10, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,5 +314,12 @@ Task<WebCallResult<KucoinUniversalTransfer>> UniversalTransferAsync(
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<WebCallResult<bool>> GetIsHfAccountAsync(CancellationToken ct = default);

/// <summary>
/// Get API key info
/// </summary>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<WebCallResult<KucoinApiKey>> GetApiKeyInfoAsync(CancellationToken ct = default);
}
}
50 changes: 50 additions & 0 deletions Kucoin.Net/Kucoin.Net.xml
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,9 @@
<member name="M:Kucoin.Net.Clients.SpotApi.KucoinRestClientSpotApiAccount.GetIsHfAccountAsync(System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="M:Kucoin.Net.Clients.SpotApi.KucoinRestClientSpotApiAccount.GetApiKeyInfoAsync(System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="T:Kucoin.Net.Clients.SpotApi.KucoinRestClientSpotApiExchangeData">
<inheritdoc />
</member>
Expand Down Expand Up @@ -3708,6 +3711,13 @@
<param name="ct">Cancellation token</param>
<returns></returns>
</member>
<member name="M:Kucoin.Net.Interfaces.Clients.SpotApi.IKucoinRestClientSpotApiAccount.GetApiKeyInfoAsync(System.Threading.CancellationToken)">
<summary>
Get API key info
</summary>
<param name="ct">Cancellation token</param>
<returns></returns>
</member>
<member name="T:Kucoin.Net.Interfaces.Clients.SpotApi.IKucoinRestClientSpotApiExchangeData">
<summary>
Kucoin Spot exchange data endpoints. Exchange data includes market data (tickers, order books, etc) and system status.
Expand Down Expand Up @@ -8474,6 +8484,46 @@
Announcement types
</summary>
</member>
<member name="T:Kucoin.Net.Objects.Models.Spot.KucoinApiKey">
<summary>
API key info
</summary>
</member>
<member name="P:Kucoin.Net.Objects.Models.Spot.KucoinApiKey.Remark">
<summary>
Remark
</summary>
</member>
<member name="P:Kucoin.Net.Objects.Models.Spot.KucoinApiKey.Apikey">
<summary>
Api key
</summary>
</member>
<member name="P:Kucoin.Net.Objects.Models.Spot.KucoinApiKey.ApiKeyVersion">
<summary>
Version of the API key
</summary>
</member>
<member name="P:Kucoin.Net.Objects.Models.Spot.KucoinApiKey.Permissions">
<summary>
Permissions, comma seperated
</summary>
</member>
<member name="P:Kucoin.Net.Objects.Models.Spot.KucoinApiKey.CreateTime">
<summary>
Creation time
</summary>
</member>
<member name="P:Kucoin.Net.Objects.Models.Spot.KucoinApiKey.UserId">
<summary>
User id
</summary>
</member>
<member name="P:Kucoin.Net.Objects.Models.Spot.KucoinApiKey.IsMaster">
<summary>
Is master account
</summary>
</member>
<member name="T:Kucoin.Net.Objects.Models.Spot.KucoinAssetBase">
<summary>
Asset info
Expand Down
48 changes: 48 additions & 0 deletions Kucoin.Net/Objects/Models/Spot/KucoinApiKey.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace Kucoin.Net.Objects.Models.Spot
{
/// <summary>
/// API key info
/// </summary>
public record KucoinApiKey
{
/// <summary>
/// Remark
/// </summary>
[JsonProperty("remark")]
public string Remark { get; set; } = string.Empty;
/// <summary>
/// Api key
/// </summary>
[JsonProperty("apiKey")]
public string Apikey { get; set; } = string.Empty;
/// <summary>
/// Version of the API key
/// </summary>
[JsonProperty("apiVersion")]
public int ApiKeyVersion { get; set; }
/// <summary>
/// Permissions, comma seperated
/// </summary>
[JsonProperty("permission")]
public string Permissions { get; set; } = string.Empty;
/// <summary>
/// Creation time
/// </summary>
[JsonProperty("createdAt"), JsonConverter(typeof(DateTimeConverter))]
public DateTime CreateTime { get; set; }
/// <summary>
/// User id
/// </summary>
[JsonProperty("uid")]
public long UserId { get; set; }
/// <summary>
/// Is master account
/// </summary>
[JsonProperty("isMaster")]
public bool IsMaster { get; set; }
}
}

0 comments on commit df2eb4d

Please sign in to comment.