Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsPackable>false</IsPackable>

<Version>3.0.0</Version>
<Version>3.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description>Open source SDK for connecting to and interacting with the Enjin Platform.</Description>
<Company>Enjin Pte. Ltd.</Company>
<Copyright>Enjin Pte. Ltd.</Copyright>
<Version>3.0.0</Version>
<Version>3.0.1</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>12</LangVersion>
<RootNamespace>Enjin.Platform.Sdk</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static class GraphQlTypes

public const string Account = "Account";
public const string AccountPool = "AccountPool";
public const string AccountToken = "AccountToken";
public const string Attribute = "Attribute";
public const string Block = "Block";
public const string Collection = "Collection";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public partial class Account
/// </summary>
public global::System.Numerics.BigInteger Balance { get; set; }
/// <summary>
/// The tokens held by this account.
/// The tokens held by this account, each paired with the account's balance.
/// </summary>
public ICollection<Token>? Tokens { get; set; }
public ICollection<AccountToken>? Tokens { get; set; }
Comment thread
JayPavlina marked this conversation as resolved.
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// <auto-generated> This file has been auto generated. </auto-generated>
#nullable enable annotations

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
#if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON
using Newtonsoft.Json;
#endif

namespace Enjin.Platform.Sdk;

/// <summary>
/// A token held by an account, paired with the account's balance for that token.
/// </summary>
public partial class AccountToken
{
/// <summary>
/// The account's balance of this token.
/// </summary>
public global::System.Numerics.BigInteger Balance { get; set; }
/// <summary>
/// The token itself.
/// </summary>
public Token? Token { get; set; }
}

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public partial class Collection
/// </summary>
public ICollection<TokenGroup>? TokenGroups { get; set; }
/// <summary>
/// The holders of tokens in this collection. Only populated when fetching a single collection via GetCollection.
/// The holders of tokens in this collection. The effective per-page limit depends on context: up to 100 when fetched via GetCollection (detail), up to 10 when fetched via GetCollections (bulk).
/// </summary>
public ICollection<CollectionHolder>? Holders { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public partial class Token
/// </summary>
public Collection? Collection { get; set; }
/// <summary>
/// The holders of this token with their balances. Only populated when querying via GetToken directly.
/// The holders of this token with their balances. The effective per-page limit depends on context: up to 100 when fetched via GetToken (detail), up to 10 when fetched via GetTokens or GetAccount.tokens (bulk).
/// </summary>
public ICollection<TokenHolder>? Holders { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class AccountQueryBuilder : GraphQlQueryBuilder<AccountQueryBuild
new() { Name = "address" },
new() { Name = "nonce" },
new() { Name = "balance" },
new() { Name = "tokens", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(TokenQueryBuilder) }
new() { Name = "tokens", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(AccountTokenQueryBuilder) }
};

protected override string TypeName => "Account";
Expand All @@ -47,7 +47,8 @@ public partial class AccountQueryBuilder : GraphQlQueryBuilder<AccountQueryBuild
/// <param name="after">The offset for pagination.</param>
/// <param name="collectionId">Filter tokens by collection ID.</param>
/// <param name="tokenIds">Filter by token IDs within the collection (requires collectionId).</param>
public AccountQueryBuilder WithTokens(TokenQueryBuilder tokenQueryBuilder, QueryBuilderParameter<int> limit, QueryBuilderParameter<int?>? after = null, QueryBuilderParameter<global::System.Numerics.BigInteger?>? collectionId = null, QueryBuilderParameter<IEnumerable<global::System.Numerics.BigInteger>>? tokenIds = null, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null)
/// <param name="tokenGroupId">Filter tokens to only those belonging to this token group ID.</param>
public AccountQueryBuilder WithTokens(AccountTokenQueryBuilder accountTokenQueryBuilder, QueryBuilderParameter<int> limit, QueryBuilderParameter<int?>? after = null, QueryBuilderParameter<global::System.Numerics.BigInteger?>? collectionId = null, QueryBuilderParameter<IEnumerable<global::System.Numerics.BigInteger>>? tokenIds = null, QueryBuilderParameter<global::System.Numerics.BigInteger?>? tokenGroupId = null, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null)
{
var args = new List<QueryBuilderArgumentInfo>();
args.Add(new() { ArgumentName = "limit", ArgumentValue = limit} );
Expand All @@ -60,7 +61,10 @@ public AccountQueryBuilder WithTokens(TokenQueryBuilder tokenQueryBuilder, Query
if (tokenIds != null)
args.Add(new() { ArgumentName = "tokenIds", ArgumentValue = tokenIds} );

return WithObjectField("tokens", alias, tokenQueryBuilder, [include, skip], args);
if (tokenGroupId != null)
args.Add(new() { ArgumentName = "tokenGroupId", ArgumentValue = tokenGroupId} );

return WithObjectField("tokens", alias, accountTokenQueryBuilder, [include, skip], args);
}

public AccountQueryBuilder ExceptTokens() => ExceptField("tokens");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// <auto-generated> This file has been auto generated. </auto-generated>
#nullable enable annotations

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
#if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON
using Newtonsoft.Json;
#endif

namespace Enjin.Platform.Sdk;

public partial class AccountTokenQueryBuilder : GraphQlQueryBuilder<AccountTokenQueryBuilder>
{
private static readonly GraphQlFieldMetadata[] AllFieldMetadata =
{
new() { Name = "balance" },
new() { Name = "token", IsComplex = true, QueryBuilderType = typeof(TokenQueryBuilder) }
};

protected override string TypeName => "AccountToken";

public override IReadOnlyList<GraphQlFieldMetadata> AllFields => AllFieldMetadata;

public AccountTokenQueryBuilder WithBalance(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("balance", alias, [include, skip]);

public AccountTokenQueryBuilder ExceptBalance() => ExceptField("balance");

public AccountTokenQueryBuilder WithToken(TokenQueryBuilder tokenQueryBuilder, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithObjectField("token", alias, tokenQueryBuilder, [include, skip]);

public AccountTokenQueryBuilder ExceptToken() => ExceptField("token");
}

Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ public partial class CollectionQueryBuilder : GraphQlQueryBuilder<CollectionQuer

public CollectionQueryBuilder ExceptTokenGroups() => ExceptField("tokenGroups");

/// <param name="limit">Number of holders to return per page (max 100, default 100).</param>
/// <param name="limit">Number of holders to return per page. Defaults to the context cap (100 in GetCollection, 10 in bulk queries). Requesting a limit above the context cap raises a validation error.</param>
/// <param name="page">Page number (max 500, default 1).</param>
public CollectionQueryBuilder WithHolders(CollectionHolderQueryBuilder collectionHolderQueryBuilder, QueryBuilderParameter<int> limit, QueryBuilderParameter<int> page, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null)
public CollectionQueryBuilder WithHolders(CollectionHolderQueryBuilder collectionHolderQueryBuilder, QueryBuilderParameter<int> page, QueryBuilderParameter<int?>? limit = null, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null)
{
var args = new List<QueryBuilderArgumentInfo>();
Comment thread
JayPavlina marked this conversation as resolved.
args.Add(new() { ArgumentName = "limit", ArgumentValue = limit} );
if (limit != null)
args.Add(new() { ArgumentName = "limit", ArgumentValue = limit} );

args.Add(new() { ArgumentName = "page", ArgumentValue = page} );
return WithObjectField("holders", alias, collectionHolderQueryBuilder, [include, skip], args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ public partial class TokenQueryBuilder : GraphQlQueryBuilder<TokenQueryBuilder>

public TokenQueryBuilder ExceptCollection() => ExceptField("collection");

/// <param name="limit">Number of holders to return per page (max 100, default 100).</param>
/// <param name="limit">Number of holders to return per page. Defaults to the context cap (100 in GetToken, 10 in bulk queries). Requesting a limit above the context cap raises a validation error.</param>
/// <param name="page">Page number (max 500, default 1).</param>
public TokenQueryBuilder WithHolders(TokenHolderQueryBuilder tokenHolderQueryBuilder, QueryBuilderParameter<int> limit, QueryBuilderParameter<int> page, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null)
public TokenQueryBuilder WithHolders(TokenHolderQueryBuilder tokenHolderQueryBuilder, QueryBuilderParameter<int> page, QueryBuilderParameter<int?>? limit = null, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null)
{
var args = new List<QueryBuilderArgumentInfo>();
Comment thread
JayPavlina marked this conversation as resolved.
args.Add(new() { ArgumentName = "limit", ArgumentValue = limit} );
if (limit != null)
args.Add(new() { ArgumentName = "limit", ArgumentValue = limit} );

args.Add(new() { ArgumentName = "page", ArgumentValue = page} );
return WithObjectField("holders", alias, tokenHolderQueryBuilder, [include, skip], args);
}
Expand Down
Loading