From 9d338e2aa0831fda5a5bc7f7712f20d1c7bcbbee Mon Sep 17 00:00:00 2001 From: Jerome Bell Date: Fri, 19 Nov 2021 19:21:24 -0600 Subject: [PATCH] AssetReponse - Added num_liquidity_pools and liquidity_pools_amount --- .../responses/AssetPageDeserializerTest.cs | 7 +++++++ stellar-dotnet-sdk-test/testdata/assetPage.json | 2 ++ stellar-dotnet-sdk/responses/AssetResponse.cs | 12 ++++++++++++ 3 files changed, 21 insertions(+) diff --git a/stellar-dotnet-sdk-test/responses/AssetPageDeserializerTest.cs b/stellar-dotnet-sdk-test/responses/AssetPageDeserializerTest.cs index 72523a17..2b1615d0 100644 --- a/stellar-dotnet-sdk-test/responses/AssetPageDeserializerTest.cs +++ b/stellar-dotnet-sdk-test/responses/AssetPageDeserializerTest.cs @@ -1,4 +1,5 @@ using System.IO; +using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using stellar_dotnet_sdk.responses; @@ -60,6 +61,12 @@ public static void AssertTestData(Page assetsPage) Assert.AreEqual(false, assetsPage.Records[0].Flags.AuthRequired); Assert.AreEqual(false, assetsPage.Records[0].Flags.AuthRevocable); Assert.AreEqual(true, assetsPage.Records[0].Flags.AuthImmutable); + + assetsPage.Records[0].NumLiquidityPools + .Should().Be(1); + + assetsPage.Records[0].LiquidityPoolsAmount + .Should().Be("70000000.0000000"); } } } \ No newline at end of file diff --git a/stellar-dotnet-sdk-test/testdata/assetPage.json b/stellar-dotnet-sdk-test/testdata/assetPage.json index be640fa9..f0103e9e 100644 --- a/stellar-dotnet-sdk-test/testdata/assetPage.json +++ b/stellar-dotnet-sdk-test/testdata/assetPage.json @@ -27,6 +27,8 @@ "authorized_to_maintain_liabilities": 0, "unauthorized": 0 }, + "liquidity_pools_amount": "70000000.0000000", + "num_liquidity_pools": 1, "balances": { "authorized": "1200000000.0000000", "authorized_to_maintain_liabilities": "0.0000000", diff --git a/stellar-dotnet-sdk/responses/AssetResponse.cs b/stellar-dotnet-sdk/responses/AssetResponse.cs index 70eb05e3..846099d3 100644 --- a/stellar-dotnet-sdk/responses/AssetResponse.cs +++ b/stellar-dotnet-sdk/responses/AssetResponse.cs @@ -41,6 +41,18 @@ public class AssetResponse : Response, IPagingToken [JsonProperty(PropertyName = "flags")] public AssetResponseFlags Flags { get; set; } + /// + /// The number of liquidity pools trading this asset + /// + [JsonProperty(PropertyName = "num_liquidity_pools")] + public int NumLiquidityPools { get; set; } + + /// + /// The amount of this asset held in liquidity pools + /// + [JsonProperty(PropertyName = "liquidity_pools_amount")] + public string LiquidityPoolsAmount { get; set; } + /// /// Describe asset accounts ///