Skip to content

Commit

Permalink
Added mexcRestClient.SpotApi.Account.GetKycStatusAsync endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Oct 18, 2024
1 parent a0841f2 commit a47b948
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Mexc.Net/Clients/SpotApi/MexcRestClientSpotApiAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public async Task<WebCallResult<MexcAccountInfo>> GetAccountInfoAsync(Cancellati

#endregion

#region Get KYC Status

/// <inheritdoc />
public async Task<WebCallResult<MexcKycStatus>> GetKycStatusAsync(CancellationToken ct = default)
{
return await _baseClient.SendRequestInternal<MexcKycStatus>("/api/v3/kyc/status", HttpMethod.Get, ct, signed: true).ConfigureAwait(false);
}

#endregion

#region Get User Assets

/// <inheritdoc />
Expand Down
34 changes: 34 additions & 0 deletions Mexc.Net/Enums/KycStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using CryptoExchange.Net.Attributes;
using System;
using System.Collections.Generic;
using System.Text;

namespace Mexc.Net.Enums
{
/// <summary>
/// KYC status
/// </summary>
public enum KycStatus
{
/// <summary>
/// Unverified
/// </summary>
[Map("1")]
Unverified,
/// <summary>
/// Primary
/// </summary>
[Map("2")]
Primary,
/// <summary>
/// Advanced
/// </summary>
[Map("3")]
Advanced,
/// <summary>
/// Institutional
/// </summary>
[Map("4")]
Institutional
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ public interface IMexcRestClientSpotApiAccount
/// <returns></returns>
Task<WebCallResult<MexcAccountInfo>> GetAccountInfoAsync(CancellationToken ct = default);

/// <summary>
/// Get KYC status for the account
/// <para><a href="https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-kyc-status" /></para>
/// </summary>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<WebCallResult<MexcKycStatus>> GetKycStatusAsync(CancellationToken ct = default);

/// <summary>
/// Get a list of user assets and deposit/withdrawal data
/// <para><a href="https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information" /></para>
Expand Down
46 changes: 46 additions & 0 deletions Mexc.Net/Mexc.Net.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions Mexc.Net/Objects/Models/Spot/MexcKycStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Mexc.Net.Enums;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;

namespace Mexc.Net.Objects.Models.Spot
{
/// <summary>
/// KYC status
/// </summary>
public record MexcKycStatus
{
/// <summary>
/// Status
/// </summary>
[JsonPropertyName("status")]
public KycStatus Status { get; set; }
}
}

0 comments on commit a47b948

Please sign in to comment.