Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #348 from RivalCoins/liquidity_pools_amount
Browse files Browse the repository at this point in the history
AssetResponse - Added num_liquidity_pools and liquidity_pools_amount
  • Loading branch information
elucidsoft authored Nov 21, 2021
2 parents 959196d + 9d338e2 commit e76ff78
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using stellar_dotnet_sdk.responses;
Expand Down Expand Up @@ -60,6 +61,12 @@ public static void AssertTestData(Page<AssetResponse> 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");
}
}
}
2 changes: 2 additions & 0 deletions stellar-dotnet-sdk-test/testdata/assetPage.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 12 additions & 0 deletions stellar-dotnet-sdk/responses/AssetResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ public class AssetResponse : Response, IPagingToken
[JsonProperty(PropertyName = "flags")]
public AssetResponseFlags Flags { get; set; }

/// <summary>
/// The number of liquidity pools trading this asset
/// </summary>
[JsonProperty(PropertyName = "num_liquidity_pools")]
public int NumLiquidityPools { get; set; }

/// <summary>
/// The amount of this asset held in liquidity pools
/// </summary>
[JsonProperty(PropertyName = "liquidity_pools_amount")]
public string LiquidityPoolsAmount { get; set; }

/// <summary>
/// Describe asset accounts
/// </summary>
Expand Down

0 comments on commit e76ff78

Please sign in to comment.