Skip to content

Commit

Permalink
Updated SpotApi.Account.WithdrawAsync endpoint and network property f…
Browse files Browse the repository at this point in the history
…rom UserAssets response
  • Loading branch information
JKorf committed Jun 18, 2024
1 parent 0147c81 commit 62717e3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions Mexc.Net/Clients/SpotApi/MexcRestClientSpotApiAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task<WebCallResult<IEnumerable<MexcUserAsset>>> GetUserAssetsAsync(
#region Withdraw

/// <inheritdoc />
public async Task<WebCallResult<MexcId>> WithdrawAsync(string asset, string address, decimal quantity, string? clientOrderId = null, string? network = null, string? memo = null, string? remark = null, CancellationToken ct = default)
public async Task<WebCallResult<MexcId>> WithdrawAsync(string asset, string address, decimal quantity, string? clientOrderId = null, string? network = null, string? memo = null, string? remark = null, string? contractAddress = null, CancellationToken ct = default)
{
var parameters = new ParameterCollection
{
Expand All @@ -58,10 +58,11 @@ public async Task<WebCallResult<MexcId>> WithdrawAsync(string asset, string addr
};
parameters.AddString("amount", quantity);
parameters.AddOptional("withdrawOrderId", clientOrderId);
parameters.AddOptional("network", network);
parameters.AddOptional("netWork", network);
parameters.AddOptional("memo", memo);
parameters.AddOptional("remark", remark);
var result = await _baseClient.SendRequestInternal<IEnumerable<MexcId>>("/api/v3/capital/withdraw/apply", HttpMethod.Post, ct, parameters, true).ConfigureAwait(false);
parameters.AddOptional("contractAddress", contractAddress);
var result = await _baseClient.SendRequestInternal<IEnumerable<MexcId>>("/api/v3/capital/withdraw", HttpMethod.Post, ct, parameters, true).ConfigureAwait(false);
return result.As<MexcId>(result.Data?.Single());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface IMexcRestClientSpotApiAccount

/// <summary>
/// Withdraw funds
/// <para><a href="https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information" /></para>
/// <para><a href="https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new" /></para>
/// </summary>
/// <param name="asset">Asset</param>
/// <param name="address">Address to withdraw to</param>
Expand All @@ -41,9 +41,10 @@ public interface IMexcRestClientSpotApiAccount
/// <param name="network">Network to use</param>
/// <param name="memo">Memo</param>
/// <param name="remark">Remark</param>
/// <param name="contractAddress">Asset contract address</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<WebCallResult<MexcId>> WithdrawAsync(string asset, string address, decimal quantity, string? clientOrderId = null, string? network = null, string? memo = null, string? remark = null, CancellationToken ct = default);
Task<WebCallResult<MexcId>> WithdrawAsync(string asset, string address, decimal quantity, string? clientOrderId = null, string? network = null, string? memo = null, string? remark = null, string? contractAddress = null, CancellationToken ct = default);

/// <summary>
/// Cancel a withdrawal
Expand Down
7 changes: 4 additions & 3 deletions Mexc.Net/Mexc.Net.xml

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

2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcUserAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class MexcNetwork
/// <summary>
/// Network name
/// </summary>
[JsonProperty("network")]
[JsonProperty("netWork")]
public string Network { get; set; } = string.Empty;
/// <summary>
/// Is withdrawing enabled
Expand Down

0 comments on commit 62717e3

Please sign in to comment.