Skip to content

Commit 923bb5e

Browse files
author
Cuong Pham
committed
add XML comments
1 parent f552e8a commit 923bb5e

4 files changed

Lines changed: 71 additions & 5 deletions

File tree

StellarDotnetSdk/Claimants/ClaimPredicate.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@
33

44
namespace StellarDotnetSdk.Claimants;
55

6+
/// <summary>
7+
/// Represents a claim predicate for building claimable balance operations in Stellar transactions.
8+
/// </summary>
9+
/// <remarks>
10+
/// <para>
11+
/// This abstract class and its implementations are used when constructing
12+
/// <see cref="StellarDotnetSdk.Operations.CreateClaimableBalanceOperation"/> to define
13+
/// conditions under which a claimable balance can be claimed.
14+
/// </para>
15+
/// <para>
16+
/// Predicates can be combined using logical operators:
17+
/// <list type="bullet">
18+
/// <item><see cref="And"/> - Both predicates must be true</item>
19+
/// <item><see cref="Or"/> - At least one predicate must be true</item>
20+
/// <item><see cref="Not"/> - The predicate must be false</item>
21+
/// </list>
22+
/// </para>
23+
/// <para>
24+
/// <strong>For deserializing Horizon API responses</strong>, use <see cref="Responses.Predicate"/> instead,
25+
/// which can be converted to this type using <see cref="Responses.Predicate.ToClaimPredicate"/>.
26+
/// </para>
27+
/// </remarks>
28+
/// <seealso cref="Responses.Predicate"/>
629
public abstract class ClaimPredicate
730
{
831
public abstract Xdr.ClaimPredicate ToXdr();

StellarDotnetSdk/Claimants/Claimant.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,35 @@
33

44
namespace StellarDotnetSdk.Claimants;
55

6+
/// <summary>
7+
/// Represents a claimant for building claimable balance operations in Stellar transactions.
8+
/// </summary>
9+
/// <remarks>
10+
/// <para>
11+
/// This class is used when constructing <see cref="StellarDotnetSdk.Operations.CreateClaimableBalanceOperation"/>
12+
/// to specify who can claim the balance and under what conditions.
13+
/// </para>
14+
/// <para>
15+
/// <strong>For deserializing Horizon API responses</strong>, use <see cref="Responses.Claimant"/> instead.
16+
/// </para>
17+
/// </remarks>
18+
/// <seealso cref="Responses.Claimant"/>
619
public class Claimant
720
{
821
/// <summary>
922
/// Constructs a <c>Claimant</c> object from a public key and a predicate.
1023
/// </summary>
1124
/// <param name="recipientId">An Ed25519 public key.</param>
12-
/// <param name="predicate">A <c>Predicate</c> object.</param>
25+
/// <param name="predicate">A <see cref="ClaimPredicate"/> defining when this claimant can claim the balance.</param>
1326
public Claimant(string recipientId, ClaimPredicate predicate) : this(KeyPair.FromAccountId(recipientId), predicate)
1427
{
1528
}
1629

1730
/// <summary>
1831
/// Constructs a <c>Claimant</c> object from a key pair and a predicate.
1932
/// </summary>
20-
/// <param name="recipientId">An Ed25519 public key.</param>
21-
/// <param name="predicate">A <c>Predicate</c> object.</param>
33+
/// <param name="destination">The destination account that can claim the balance.</param>
34+
/// <param name="predicate">A <see cref="ClaimPredicate"/> defining when this claimant can claim the balance.</param>
2235
public Claimant(KeyPair destination, ClaimPredicate predicate)
2336
{
2437
Destination = destination;

StellarDotnetSdk/Responses/Claimant.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
namespace StellarDotnetSdk.Responses;
44
#nullable disable
55

6+
/// <summary>
7+
/// Represents a claimant in Horizon API responses.
8+
/// </summary>
9+
/// <remarks>
10+
/// <para>
11+
/// This class is specifically designed for deserializing claimant data from Horizon API responses,
12+
/// such as when querying claimable balances.
13+
/// </para>
14+
/// <para>
15+
/// <strong>For building transactions</strong>, use <see cref="Claimants.Claimant"/> instead.
16+
/// You can convert the <see cref="Predicate"/> to a transaction predicate using
17+
/// <see cref="Predicate.ToClaimPredicate"/>.
18+
/// </para>
19+
/// </remarks>
20+
/// <seealso cref="Claimants.Claimant"/>
621
public class Claimant
722
{
823
[JsonPropertyName("destination")]

StellarDotnetSdk/Responses/Predicate.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,24 @@
66
namespace StellarDotnetSdk.Responses;
77

88
/// <summary>
9-
/// Represents a claim predicate that defines conditions for claiming a claimable balance.
10-
/// Predicates can be combined using logical operators (AND, OR, NOT) or specify time-based conditions.
9+
/// Represents a claim predicate in Horizon API responses.
1110
/// </summary>
11+
/// <remarks>
12+
/// <para>
13+
/// This class is specifically designed for deserializing predicate data from Horizon API responses.
14+
/// It uses <see cref="long"/> for time-based fields to accommodate values returned by Horizon endpoints.
15+
/// </para>
16+
/// <para>
17+
/// The Horizon API may return numeric fields as strings in some cases. The SDK's
18+
/// <see cref="Converters.JsonOptions.DefaultOptions"/> handles both formats automatically
19+
/// via <c>JsonNumberHandling.AllowReadingFromString</c>.
20+
/// </para>
21+
/// <para>
22+
/// <strong>For building transactions</strong>, use <see cref="Claimants.ClaimPredicate"/> instead.
23+
/// You can convert this response predicate to a transaction predicate using <see cref="ToClaimPredicate"/>.
24+
/// </para>
25+
/// </remarks>
26+
/// <seealso cref="Claimants.ClaimPredicate"/>
1227
public sealed class Predicate
1328
{
1429
/// <summary>

0 commit comments

Comments
 (0)