Skip to content

Commit

Permalink
Added SpotApiV2.ExchangeData.GetAssetsAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Jul 16, 2024
1 parent 6e554ff commit 7a41bd6
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,13 @@ public async Task<WebCallResult<CoinExAamLiquidity>> RemoveAutoMarketMakerLiquid
};
return await _baseClient.ExecuteAsync<CoinExAamLiquidity>(_baseClient.GetUri("v2/amm/remove-liquidity"), HttpMethod.Post, ct, parameters, true).ConfigureAwait(false);
}


/// <inheritdoc />
public async Task<WebCallResult<IEnumerable<CoinExSymbol>>> GetAssetsAsync(CancellationToken ct = default)
{
return await _baseClient.ExecuteAsync<IEnumerable<CoinExSymbol>>(_baseClient.GetUri("v2/spot/market"), HttpMethod.Get, ct).ConfigureAwait(false);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public async Task<WebCallResult<IEnumerable<CoinExSymbol>>> GetSymbolsAsync(Canc
return await _baseClient.ExecuteAsync<IEnumerable<CoinExSymbol>>(_baseClient.GetUri("v2/spot/market"), HttpMethod.Get, ct).ConfigureAwait(false);
}

/// <inheritdoc />
public async Task<WebCallResult<IEnumerable<CoinExAsset>>> GetAssetsAsync(CancellationToken ct = default)
{
return await _baseClient.ExecuteAsync<IEnumerable<CoinExAsset>>(_baseClient.GetUri("v2/assets/info"), HttpMethod.Get, ct).ConfigureAwait(false);
}

/// <inheritdoc />
public async Task<WebCallResult<IEnumerable<CoinExTicker>>> GetTickersAsync(IEnumerable<string>? symbols = null, CancellationToken ct = default)
{
Expand Down
64 changes: 64 additions & 0 deletions CoinEx.Net/CoinEx.Net.xml

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

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public interface ICoinExRestClientSpotApiExchangeData
/// <returns></returns>
Task<WebCallResult<IEnumerable<CoinExSymbol>>> GetSymbolsAsync(CancellationToken ct = default);

/// <summary>
/// Get asset information
/// <para><a href="https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-assets-info" /></para>
/// </summary>
/// <param name="ct">Cancelation Token</param>
/// <returns></returns>
Task<WebCallResult<IEnumerable<CoinExAsset>>> GetAssetsAsync(CancellationToken ct = default);

/// <summary>
/// Get symbol tickers
/// <para><a href="https://docs.coinex.com/api/v2/spot/market/http/list-market-ticker" /></para>
Expand Down
63 changes: 63 additions & 0 deletions CoinEx.Net/Objects/Models/V2/CoinExAsset.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;

namespace CoinEx.Net.Objects.Models.V2
{
/// <summary>
/// Asset info
/// </summary>
public record CoinExAsset
{
/// <summary>
/// Short name
/// </summary>
[JsonPropertyName("short_name")]
public string ShortName { get; set; } = string.Empty;
/// <summary>
/// Full name
/// </summary>
[JsonPropertyName("full_name")]
public string FullName { get; set; } = string.Empty;
/// <summary>
/// Website url
/// </summary>
[JsonPropertyName("website_url")]
public string WebsiteUrl { get; set; } = string.Empty;
/// <summary>
/// White paper url
/// </summary>
[JsonPropertyName("white_paper_url")]
public string WhitePaperUrl { get; set; } = string.Empty;
/// <summary>
/// Network info
/// </summary>
[JsonPropertyName("chain_info")]
public IEnumerable<CoinExAssetNetwork> Networks { get; set; } = Array.Empty<CoinExAssetNetwork>();
}

/// <summary>
/// Asset network info
/// </summary>
public record CoinExAssetNetwork
{
/// <summary>
/// Network name
/// </summary>
[JsonPropertyName("chain_name")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// Identity
/// </summary>
[JsonPropertyName("identity")]
public string? Identity { get; set; }
/// <summary>
/// Explorer url
/// </summary>
[JsonPropertyName("explorer_url")]
public string ExplorerUrl { get; set; } = string.Empty;
}


}

0 comments on commit 7a41bd6

Please sign in to comment.