Skip to content

Commit

Permalink
Added restClient.V5Api.Account.GetTransferableAsync endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Dec 12, 2024
1 parent 9cb356c commit 33400f9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ByBit.Net/Clients/V5/BybitRestClientApiAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,5 +1149,18 @@ public async Task<WebCallResult<IEnumerable<BybitConvertTransaction>>> GetConver
}

#endregion

#region Get Transferable

/// <inheritdoc />
public async Task<WebCallResult<BybitTransferable>> GetTransferableAsync(string asset, CancellationToken ct = default)
{
var parameters = new ParameterCollection();
parameters.Add("coinName", asset.ToUpperInvariant());

return await _baseClient.SendRequestAsync<BybitTransferable>(_baseClient.GetUrl("v5/account/withdrawal"), HttpMethod.Get, ct, parameters, true).ConfigureAwait(false);
}

#endregion
}
}
9 changes: 9 additions & 0 deletions ByBit.Net/Interfaces/Clients/V5/IBybitRestClientApiAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -674,5 +674,14 @@ Task<WebCallResult<BybitPosition>> AddOrReduceMarginAsync(
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<WebCallResult<IEnumerable<BybitConvertTransaction>>> GetConvertHistoryAsync(ConvertAccountType? accountType = null, int? page = null, int? pageSize = null, CancellationToken ct = default);

/// <summary>
/// Get quantity available for withdrawal/transfer from unified wallet
/// <para><a href="https://bybit-exchange.github.io/docs/v5/account/unified-trans-amnt" /></para>
/// </summary>
/// <param name="asset">Asset name</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<WebCallResult<BybitTransferable>> GetTransferableAsync(string asset, CancellationToken ct = default);
}
}
21 changes: 21 additions & 0 deletions ByBit.Net/Objects/Models/V5/BybitTransferable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using CryptoExchange.Net.Attributes;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;

namespace Bybit.Net.Objects.Models.V5
{
/// <summary>
/// Transferable
/// </summary>
public record BybitTransferable
{
/// <summary>
/// Available transferable quantity
/// </summary>
[JsonProperty("availableWithdrawal")]
public decimal Available { get; set; }
}
}

0 comments on commit 33400f9

Please sign in to comment.