diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ba3c43..0fba1e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,119 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v3.0.4] - 2026-08-04 + +### Added + +- Pusher channel authorization: the `AuthenticatePusherSocket(id)` mutation, plus the + `PusherSocketAuth` model and `PusherSocketAuthQueryBuilder`. Authorizes the current user to + subscribe to a private Pusher channel; this SDK still ships no event-subscription transport of its + own. +- `Transaction.FailedItemIndexes` — zero-based positions of batch items that failed to dispatch while + the extrinsic itself finalized (`CONTINUE_ON_ERROR` batches only). +- `freezeState` on `CreateTokenInput` and `CreateTokenEntryInput`, to create a token already frozen. +- `idempotencyPrefix` on the `SweepManagedWallet` mutation; each chunk is keyed as `{prefix}-{n}`. +- `CompatibleFuelTank.Address` (the tank account address) and `CompatibleFuelTank.AvailableBudget` + (the amount available to fund this transaction, expressed as ENJ). + +### Changed + +- **Breaking:** `GetCompatibleFuelTanks` no longer takes `pallet` and `method`. It now takes + `transactions: [TransactionInput]` and `batchMode: BatchTransactionModeEnum`, so compatibility is + evaluated against the encoded calls. +- **Breaking:** `infusion` on `CreateTokenInput` / `CreateTokenEntryInput` retyped from + `System.Numerics.BigInteger` to `string`, and `unitPrice` on `MintTokenInput` / + `MintTokenEntryInput` from `BigInteger?` to `string?`. Both now take decimal or integer ENJ + (e.g. `"1.5"`), converted to base units on-chain. +- **Breaking:** `FuelTankRuleSet.WhitelistedPallets` retyped from `ICollection?` to + `ICollection?`. +- `CreateFuelTankInput.RuleSets` documentation corrected: at least one rule set is required, because + the chain rejects a tank with none. +- `Transaction.Error` documentation expanded: a non-null value means the requested work did not fully + happen, including when `state` is `FINALIZED` but wrapped batch items failed to dispatch. + +### Removed + +- **Breaking:** `CompatibleFuelTank.RemainingBudget`, `CompatibleFuelTank.MaxBudget`, and + `CompatibleFuelTank.ConsumedBudget`, superseded by `CompatibleFuelTank.AvailableBudget`. + +## [v3.0.3] - 2026-07-13 + +### Added + +- Fuel tanks are covered again after the v3.0.0 rewrite dropped them: + - Queries: `GetFuelTank`, `GetFuelTanks`, `GetFuelTankAccounts`, `GetCompatibleFuelTanks`. + - Inputs for creating, mutating, and removing tanks, rule sets, and accounts — + `CreateFuelTankInput`, `MutateFuelTankInput`, `RemoveFuelTankInput`, `CreateRuleSetInput`, + `RemoveRuleSetInput`, `AddAccountInput`, `AddAccountsInput`, `RemoveAccountInput`, + `RemoveAccountsInput`, `DispatchRuleInput`, `AccountRuleInput`, `FuelBudgetRuleInput`, + `RequireTokenInput`, `RuleSetEntryInput`, `UserAccountManagementInput`, + `ShouldMutateAccountExpirationInput`, and `ShouldMutateUserAccountManagementInput`. + - Models (and their query builders): `FuelTank`, `FuelTankRuleSet`, `FuelTankAccount`, + `FuelTankAccountRule`, `FuelTankPermittedExtrinsic`, `FuelTankUserAccountManagement`, + `FuelBudget`, `RequireToken`, `CompatibleFuelTank`, and `CompatibleFuelTankRuleSet`. + - Enums: `CoveragePolicy`, `FuelTankPermittedMethod`, and `FuelTankWhitelistedPallet`. +- Managed wallet sweeps: the `SweepManagedWallet` mutation and `ManagedWalletSweepStatus` query, with + the `SweepManagedWalletResult` and `ManagedWalletSweepStatus` models and + `ManagedWalletSweepStatusEnum`. +- Wallet linking: the `CreateLinkingCode` mutation and `GetLinkedWallet` query, with the + `LinkingCode` and `LinkedWallet` models. +- Collection approvals: `ApproveCollectionInput` and `UnapproveCollectionInput`. +- `MutateFreezeStateInput`, plus the `BatchTransactionModeEnum` and `ShouldMutateAction` enums. +- `Transaction.Error` — the on-chain failure reason, including partial batch failures. +- `Event.Data` (the raw event payload), `Extrinsic.Events`, and `TokenGroupToken.CollectionId`. + +### Changed + +- **Breaking:** ENJ and `BigDecimal` scalars now map to `string` instead of + `System.Numerics.BigInteger` throughout the generated client — including `Account.Balance`, + `Listing.Price`, `Listing.MinTakeValue`, `Listing.HighestPrice`, `Token.Infusion`, + `PoolBalance.Stash` / `Reward` / `Active`, `AccountPool.Bonded`, `NominationPool.Capacity`, + `CreateListingInput.Price`, `PlaceBidInput.Price`, `NominationPoolsBondInput.Amount`, and + `AnswerCounterOfferInput.CounterPrice`. Values are decimal ENJ (e.g. `"1.5"`) and round-trip + without precision loss. +- **Breaking:** `Transaction.ExtrinsicHash` (`string?`) replaced by `Transaction.Extrinsic` + (`Extrinsic?`), resolved from the indexer. +- **Breaking:** `Block.Validator` retyped from `Account?` to `string?` — the validator public key. +- `Event.Name` documentation clarified: it is the human-readable pallet and method name. + +### Removed + +- **Breaking:** `Block.Events`. Events are now reached through `Extrinsic.Events`. +- **Breaking:** Unity support and the UPM distribution were dropped from this repository — + `unity-template/`, `scripts/assemble-upm.sh`, the `upm` CI job, and the README's Unity install + instructions. The SDK is distributed as a NuGet package only. + +## [v3.0.2] - 2026-06-17 + +### Changed + +- Release artifacts are no longer attached to GitHub Releases. The NuGet package is the distribution + channel, and releases are created and published manually so they stay compatible with GitHub's + immutable releases. + +## [v3.0.1] - 2026-06-16 + +### Added + +- `AccountToken` model and `AccountTokenQueryBuilder`, pairing a token with the holding account's + balance for it. +- `PlatformClient.DefaultBaseAddress` (`https://platform.enjin.io/graphql`). The `baseAddress` + constructor parameter is now optional and falls back to it instead of throwing + `ArgumentNullException`. + +### Changed + +- **Breaking:** `Account.Tokens` retyped from `ICollection?` to `ICollection?`, + so each entry carries the account's balance alongside the token. +- Default `User-Agent` changed from `Enjin.Platform.Sdk/{version}` to + `Enjin-Platform-CSharp-SDK/{version}`. +- The UPM package is now published to the dedicated + [`enjin/platform-unity-sdk`](https://github.com/enjin/platform-unity-sdk) repository, installed by + git URL, instead of parallel `upm/v` tags on this repository. +- `Collection.Accounts` and `Token.Accounts` documentation now states the effective per-page limit: + up to 100 when fetched via `GetCollection` / `GetToken`, up to 10 via the bulk queries. + ## [v3.0.0] - 2026-05-25 ### Added @@ -54,7 +167,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Public beta release. -[Unreleased]: https://github.com/enjin/platform-csharp-sdk/compare/v3.0.0...HEAD +[Unreleased]: https://github.com/enjin/platform-csharp-sdk/compare/v3.0.4...HEAD + +[v3.0.4]: https://github.com/enjin/platform-csharp-sdk/compare/v3.0.3...v3.0.4 + +[v3.0.3]: https://github.com/enjin/platform-csharp-sdk/compare/v3.0.2...v3.0.3 + +[v3.0.2]: https://github.com/enjin/platform-csharp-sdk/compare/v3.0.1...v3.0.2 + +[v3.0.1]: https://github.com/enjin/platform-csharp-sdk/compare/v3.0.0...v3.0.1 [v3.0.0]: https://github.com/enjin/platform-csharp-sdk/compare/v1.0.0-beta.1...v3.0.0 diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.Tests/Enjin.Platform.Sdk.Tests.csproj b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.Tests/Enjin.Platform.Sdk.Tests.csproj index 4feb682..6c1c2b9 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.Tests/Enjin.Platform.Sdk.Tests.csproj +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.Tests/Enjin.Platform.Sdk.Tests.csproj @@ -6,7 +6,7 @@ false - 3.0.3 + 3.0.4 diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Enjin.Platform.Sdk.csproj b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Enjin.Platform.Sdk.csproj index c0604bf..b6dbf1c 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Enjin.Platform.Sdk.csproj +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Enjin.Platform.Sdk.csproj @@ -5,7 +5,7 @@ Open source SDK for connecting to and interacting with the Enjin Platform. Enjin Pte. Ltd. Enjin Pte. Ltd. - 3.0.3 + 3.0.4 netstandard2.1 12 Enjin.Platform.Sdk diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Infrastructure/GraphQlTypes.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Infrastructure/GraphQlTypes.cs index 9ae61ef..4626bcd 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Infrastructure/GraphQlTypes.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Infrastructure/GraphQlTypes.cs @@ -73,6 +73,7 @@ public static class GraphQlTypes public const string PendingCollection = "PendingCollection"; public const string PoolBalance = "PoolBalance"; public const string PoolMember = "PoolMember"; + public const string PusherSocketAuth = "PusherSocketAuth"; public const string Query = "Query"; public const string RequireToken = "RequireToken"; public const string RoyaltyBeneficiary = "RoyaltyBeneficiary"; diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateFuelTankInput.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateFuelTankInput.cs index 2a48a5b..0ae18cc 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateFuelTankInput.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateFuelTankInput.cs @@ -61,7 +61,7 @@ public QueryBuilderParameter? UserAccountManagement } /// - /// Rule sets to create with the tank, each paired with its numeric id. Omit for an empty tank. + /// Rule sets to create with the tank, each paired with its numeric id. At least one rule set is required — the chain rejects a tank with no rule sets. /// #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON [JsonConverter(typeof(QueryBuilderParameterConverter?>))] diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateTokenEntryInput.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateTokenEntryInput.cs index 9c71549..e38bd3e 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateTokenEntryInput.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateTokenEntryInput.cs @@ -23,6 +23,7 @@ public partial class CreateTokenEntryInput : IGraphQlInputObject private InputPropertyInfo _listingForbidden; private InputPropertyInfo _cap; private InputPropertyInfo _behavior; + private InputPropertyInfo _freezeState; private InputPropertyInfo _attributes; private InputPropertyInfo _infusion; private InputPropertyInfo _anyoneCanInfuse; @@ -100,6 +101,18 @@ public QueryBuilderParameter? Behavior set => _behavior = new() { Name = "behavior", Value = value }; } + /// + /// The initial freeze state of the token. Omit to create the token unfrozen and freezable later. + /// + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FreezeState + { + get => (QueryBuilderParameter?)_freezeState.Value; + set => _freezeState = new() { Name = "freezeState", Value = value }; + } + /// /// Key-value attributes to attach to the token on-chain. /// @@ -113,14 +126,14 @@ public QueryBuilderParameter?>? Attributes } /// - /// Amount of currency infused into the token at creation. + /// Amount of ENJ infused into the token at creation, expressed as a decimal or integer ENJ (e.g. "1.5"); converted to base units on-chain. /// #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] + [JsonConverter(typeof(QueryBuilderParameterConverter))] #endif - public QueryBuilderParameter? Infusion + public QueryBuilderParameter? Infusion { - get => (QueryBuilderParameter?)_infusion.Value; + get => (QueryBuilderParameter?)_infusion.Value; set => _infusion = new() { Name = "infusion", Value = value }; } @@ -156,6 +169,7 @@ IEnumerable IGraphQlInputObject.GetPropertyValues() if (_listingForbidden.Name != null) yield return _listingForbidden; if (_cap.Name != null) yield return _cap; if (_behavior.Name != null) yield return _behavior; + if (_freezeState.Name != null) yield return _freezeState; if (_attributes.Name != null) yield return _attributes; if (_infusion.Name != null) yield return _infusion; if (_anyoneCanInfuse.Name != null) yield return _anyoneCanInfuse; diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateTokenInput.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateTokenInput.cs index decad44..8718e63 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateTokenInput.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/CreateTokenInput.cs @@ -24,6 +24,7 @@ public partial class CreateTokenInput : IGraphQlInputObject private InputPropertyInfo _listingForbidden; private InputPropertyInfo _cap; private InputPropertyInfo _behavior; + private InputPropertyInfo _freezeState; private InputPropertyInfo _attributes; private InputPropertyInfo _infusion; private InputPropertyInfo _anyoneCanInfuse; @@ -113,6 +114,18 @@ public QueryBuilderParameter? Behavior set => _behavior = new() { Name = "behavior", Value = value }; } + /// + /// The initial freeze state of the token. Omit to create the token unfrozen and freezable later. + /// + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FreezeState + { + get => (QueryBuilderParameter?)_freezeState.Value; + set => _freezeState = new() { Name = "freezeState", Value = value }; + } + /// /// Key-value attributes to attach to the token on-chain. /// @@ -126,14 +139,14 @@ public QueryBuilderParameter?>? Attributes } /// - /// Amount of currency infused into the token at creation. + /// Amount of ENJ infused into the token at creation, expressed as a decimal or integer ENJ (e.g. "1.5"); converted to base units on-chain. /// #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] + [JsonConverter(typeof(QueryBuilderParameterConverter))] #endif - public QueryBuilderParameter? Infusion + public QueryBuilderParameter? Infusion { - get => (QueryBuilderParameter?)_infusion.Value; + get => (QueryBuilderParameter?)_infusion.Value; set => _infusion = new() { Name = "infusion", Value = value }; } @@ -170,6 +183,7 @@ IEnumerable IGraphQlInputObject.GetPropertyValues() if (_listingForbidden.Name != null) yield return _listingForbidden; if (_cap.Name != null) yield return _cap; if (_behavior.Name != null) yield return _behavior; + if (_freezeState.Name != null) yield return _freezeState; if (_attributes.Name != null) yield return _attributes; if (_infusion.Name != null) yield return _infusion; if (_anyoneCanInfuse.Name != null) yield return _anyoneCanInfuse; diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/MintTokenEntryInput.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/MintTokenEntryInput.cs index 99a47f0..adcc1f9 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/MintTokenEntryInput.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/MintTokenEntryInput.cs @@ -59,14 +59,14 @@ public QueryBuilderParameter? Recipient } /// - /// The unit price for the minted tokens. Omit to keep the existing unit price. + /// The unit price for the minted tokens, expressed as a decimal or integer ENJ (e.g. "1.5"); converted to base units on-chain. Omit to keep the existing unit price. /// #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] + [JsonConverter(typeof(QueryBuilderParameterConverter))] #endif - public QueryBuilderParameter? UnitPrice + public QueryBuilderParameter? UnitPrice { - get => (QueryBuilderParameter?)_unitPrice.Value; + get => (QueryBuilderParameter?)_unitPrice.Value; set => _unitPrice = new() { Name = "unitPrice", Value = value }; } diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/MintTokenInput.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/MintTokenInput.cs index a790222..217a2d0 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/MintTokenInput.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Inputs/MintTokenInput.cs @@ -72,14 +72,14 @@ public QueryBuilderParameter? Recipient } /// - /// The unit price for the minted tokens. Omit to keep the existing unit price. + /// The unit price for the minted tokens, expressed as a decimal or integer ENJ (e.g. "1.5"); converted to base units on-chain. Omit to keep the existing unit price. /// #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] + [JsonConverter(typeof(QueryBuilderParameterConverter))] #endif - public QueryBuilderParameter? UnitPrice + public QueryBuilderParameter? UnitPrice { - get => (QueryBuilderParameter?)_unitPrice.Value; + get => (QueryBuilderParameter?)_unitPrice.Value; set => _unitPrice = new() { Name = "unitPrice", Value = value }; } diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/CompatibleFuelTank.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/CompatibleFuelTank.cs index 49cb796..e70001b 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/CompatibleFuelTank.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/CompatibleFuelTank.cs @@ -13,7 +13,7 @@ namespace Enjin.Platform.Sdk; /// -/// A fuel tank that is compatible with a given account, pallet, and method. +/// A fuel tank that is compatible with a transaction call. /// public partial class CompatibleFuelTank { @@ -26,6 +26,10 @@ public partial class CompatibleFuelTank /// public string? Name { get; set; } /// + /// The fuel tank account address. + /// + public string? Address { get; set; } + /// /// Whether the tank covers the storage deposit in addition to fees. /// public bool? ProvidesDeposit { get; set; } @@ -38,20 +42,12 @@ public partial class CompatibleFuelTank /// public CompatibleFuelTankRuleSet? RuleSet { get; set; } /// - /// Remaining per-user fuel budget expressed as ENJ, or null if no budget rule applies. - /// - public string? RemainingBudget { get; set; } - /// - /// Maximum per-user fuel budget expressed as ENJ, or null if no budget rule applies. - /// - public string? MaxBudget { get; set; } - /// - /// Amount of per-user fuel budget already consumed, expressed as ENJ, or null if no budget rule applies. - /// - public string? ConsumedBudget { get; set; } - /// /// Free balance of the tank account, expressed as ENJ. /// public string? TankBalance { get; set; } + /// + /// The amount available to fund this transaction, expressed as ENJ. + /// + public string AvailableBudget { get; set; } } diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Event.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Event.cs index e8858d9..08491bd 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Event.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Event.cs @@ -18,7 +18,7 @@ namespace Enjin.Platform.Sdk; public partial class Event { /// - /// The event ID. + /// The event ID (blockNumber-eventIndex). /// public string? Id { get; set; } /// diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/FuelTankRuleSet.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/FuelTankRuleSet.cs index 32a8494..b3cc002 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/FuelTankRuleSet.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/FuelTankRuleSet.cs @@ -42,9 +42,9 @@ public partial class FuelTankRuleSet /// public ICollection? WhitelistedCollections { get; set; } /// - /// Only calls targeting these pallet names are permitted. + /// Only calls targeting these pallets are permitted. /// - public ICollection? WhitelistedPallets { get; set; } + public ICollection? WhitelistedPallets { get; set; } /// /// Maximum fuel that any single transaction under this rule set may burn, expressed as ENJ. /// diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Mutation.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Mutation.cs index cf1babf..8ae966d 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Mutation.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Mutation.cs @@ -14,6 +14,10 @@ namespace Enjin.Platform.Sdk; public partial class Mutation { + /// + /// Authorizes the current user to subscribe to a private Pusher channel. + /// + public PusherSocketAuth? AuthenticatePusherSocket { get; set; } /// /// Create and encode a transaction on the Enjin blockchain. /// diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/PusherSocketAuth.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/PusherSocketAuth.cs new file mode 100644 index 0000000..115926a --- /dev/null +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/PusherSocketAuth.cs @@ -0,0 +1,29 @@ +// This file has been 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; + +/// +/// The authorization details required to subscribe to a private Pusher channel. +/// +public partial class PusherSocketAuth +{ + /// + /// The signed Pusher channel authorization token. + /// + public string? Auth { get; set; } + /// + /// The private Pusher channel authorized for the current user. + /// + public string? Channel { get; set; } +} + diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Query.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Query.cs index bfb13a0..e3c729e 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Query.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Query.cs @@ -119,7 +119,7 @@ public partial class Query /// public ICollection? GetFuelTankAccounts { get; set; } /// - /// Get fuel tanks that are compatible with a given account, pallet, and method. + /// Get fuel tanks that are compatible with a transaction call. /// public ICollection? GetCompatibleFuelTanks { get; set; } } diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Transaction.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Transaction.cs index 73878b7..3d097ad 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Transaction.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/Model/Transaction.cs @@ -42,10 +42,14 @@ public partial class Transaction /// public TransactionStateEnum? State { get; set; } /// - /// The on-chain failure reason when the transaction failed, including partial batch failures where the extrinsic finalized but one or more wrapped items did not dispatch. + /// The on-chain failure reason, or null when none. Set both when the extrinsic itself failed (state FAILED) and when it finalized (state FINALIZED) with one or more wrapped batch items failing to dispatch — a force_batch still finalizes on-chain, so state reflects the extrinsic while this field reports the per-item outcome. Treat a non-null value as "the requested work did not fully happen" regardless of state. /// public string? Error { get; set; } /// + /// Zero-based positions of batch items that failed to dispatch while the extrinsic finalized, i.e. with state FINALIZED and a non-null error (CONTINUE_ON_ERROR batches only). Null when unknown or not applicable. + /// + public ICollection? FailedItemIndexes { get; set; } + /// /// When the transaction was created. /// public DateTimeOffset? CreatedAt { get; set; } diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/CompatibleFuelTankQueryBuilder.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/CompatibleFuelTankQueryBuilder.cs index ad9cff8..da9b63e 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/CompatibleFuelTankQueryBuilder.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/CompatibleFuelTankQueryBuilder.cs @@ -18,13 +18,12 @@ public partial class CompatibleFuelTankQueryBuilder : GraphQlQueryBuilder "CompatibleFuelTank"; @@ -39,6 +38,10 @@ public partial class CompatibleFuelTankQueryBuilder : GraphQlQueryBuilder ExceptField("name"); + public CompatibleFuelTankQueryBuilder WithAddress(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("address", alias, [include, skip]); + + public CompatibleFuelTankQueryBuilder ExceptAddress() => ExceptField("address"); + public CompatibleFuelTankQueryBuilder WithProvidesDeposit(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("providesDeposit", alias, [include, skip]); public CompatibleFuelTankQueryBuilder ExceptProvidesDeposit() => ExceptField("providesDeposit"); @@ -51,20 +54,12 @@ public partial class CompatibleFuelTankQueryBuilder : GraphQlQueryBuilder ExceptField("ruleSet"); - public CompatibleFuelTankQueryBuilder WithRemainingBudget(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("remainingBudget", alias, [include, skip]); - - public CompatibleFuelTankQueryBuilder ExceptRemainingBudget() => ExceptField("remainingBudget"); - - public CompatibleFuelTankQueryBuilder WithMaxBudget(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("maxBudget", alias, [include, skip]); - - public CompatibleFuelTankQueryBuilder ExceptMaxBudget() => ExceptField("maxBudget"); - - public CompatibleFuelTankQueryBuilder WithConsumedBudget(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("consumedBudget", alias, [include, skip]); - - public CompatibleFuelTankQueryBuilder ExceptConsumedBudget() => ExceptField("consumedBudget"); - public CompatibleFuelTankQueryBuilder WithTankBalance(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("tankBalance", alias, [include, skip]); public CompatibleFuelTankQueryBuilder ExceptTankBalance() => ExceptField("tankBalance"); + + public CompatibleFuelTankQueryBuilder WithAvailableBudget(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("availableBudget", alias, [include, skip]); + + public CompatibleFuelTankQueryBuilder ExceptAvailableBudget() => ExceptField("availableBudget"); } diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/MutationQueryBuilder.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/MutationQueryBuilder.cs index 9022d31..05dd144 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/MutationQueryBuilder.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/MutationQueryBuilder.cs @@ -16,6 +16,7 @@ public partial class MutationQueryBuilder : GraphQlQueryBuilder(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + /// The socket identifier assigned by Pusher. + public MutationQueryBuilder WithAuthenticatePusherSocket(PusherSocketAuthQueryBuilder pusherSocketAuthQueryBuilder, QueryBuilderParameter id, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) + { + var args = new List(); + args.Add(new() { ArgumentName = "id", ArgumentValue = id} ); + return WithObjectField("AuthenticatePusherSocket", alias, pusherSocketAuthQueryBuilder, [include, skip], args); + } + + public MutationQueryBuilder ExceptAuthenticatePusherSocket() => ExceptField("AuthenticatePusherSocket"); + /// The network to mutate. /// The chain to mutate. /// The SS58 address or public key of the signer. (mutually exclusive with signerExternalId) @@ -182,7 +193,8 @@ public MutationQueryBuilder WithSignTransaction(TransactionQueryBuilder transact /// The address to which all swept funds and tokens will be sent. /// Optional fuel tank to sponsor the sweep fee. When set, the sweep is dispatched via FuelTanks.dispatch_and_touch. /// The fuel tank rule set id to dispatch against. Defaults to 0. Only used when fuelTank is provided. - public MutationQueryBuilder WithSweepManagedWallet(SweepManagedWalletResultQueryBuilder sweepManagedWalletResultQueryBuilder, QueryBuilderParameter network, QueryBuilderParameter chain, QueryBuilderParameter recipient, QueryBuilderParameter? signerAddress = null, QueryBuilderParameter? signerExternalId = null, QueryBuilderParameter? fuelTank = null, QueryBuilderParameter? fuelTankRuleSetId = null, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) + /// Optional idempotency prefix for the sweep transactions; each chunk is keyed as "{prefix}-{n}". Generated by the platform when omitted. + public MutationQueryBuilder WithSweepManagedWallet(SweepManagedWalletResultQueryBuilder sweepManagedWalletResultQueryBuilder, QueryBuilderParameter network, QueryBuilderParameter chain, QueryBuilderParameter recipient, QueryBuilderParameter? signerAddress = null, QueryBuilderParameter? signerExternalId = null, QueryBuilderParameter? fuelTank = null, QueryBuilderParameter? fuelTankRuleSetId = null, QueryBuilderParameter? idempotencyPrefix = null, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) { var args = new List(); args.Add(new() { ArgumentName = "network", ArgumentValue = network} ); @@ -200,6 +212,9 @@ public MutationQueryBuilder WithSweepManagedWallet(SweepManagedWalletResultQuery if (fuelTankRuleSetId != null) args.Add(new() { ArgumentName = "fuelTankRuleSetId", ArgumentValue = fuelTankRuleSetId} ); + if (idempotencyPrefix != null) + args.Add(new() { ArgumentName = "idempotencyPrefix", ArgumentValue = idempotencyPrefix} ); + return WithObjectField("SweepManagedWallet", alias, sweepManagedWalletResultQueryBuilder, [include, skip], args); } diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/PusherSocketAuthQueryBuilder.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/PusherSocketAuthQueryBuilder.cs new file mode 100644 index 0000000..9af1861 --- /dev/null +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/PusherSocketAuthQueryBuilder.cs @@ -0,0 +1,35 @@ +// This file has been 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 PusherSocketAuthQueryBuilder : GraphQlQueryBuilder +{ + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new() { Name = "auth" }, + new() { Name = "channel" } + }; + + protected override string TypeName => "PusherSocketAuth"; + + public override IReadOnlyList AllFields => AllFieldMetadata; + + public PusherSocketAuthQueryBuilder WithAuth(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("auth", alias, [include, skip]); + + public PusherSocketAuthQueryBuilder ExceptAuth() => ExceptField("auth"); + + public PusherSocketAuthQueryBuilder WithChannel(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("channel", alias, [include, skip]); + + public PusherSocketAuthQueryBuilder ExceptChannel() => ExceptField("channel"); +} + diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/QueryQueryBuilder.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/QueryQueryBuilder.cs index a6bfc5b..2b32701 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/QueryQueryBuilder.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/QueryQueryBuilder.cs @@ -542,16 +542,16 @@ public QueryQueryBuilder WithGetFuelTankAccounts(FuelTankAccountQueryBuilder fue /// The network to query. /// The chain to query. /// The account address that will dispatch the call. Accepts either a 0x-prefixed public key or an SS58 address. - /// The pallet name, e.g. MULTI_TOKENS. - /// The extrinsic / method name, e.g. CREATE_TOKEN. - public QueryQueryBuilder WithGetCompatibleFuelTanks(CompatibleFuelTankQueryBuilder compatibleFuelTankQueryBuilder, QueryBuilderParameter network, QueryBuilderParameter chain, QueryBuilderParameter account, QueryBuilderParameter pallet, QueryBuilderParameter method, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) + /// Transaction calls to encode and check for compatible fuel tanks. + /// The batching behavior used when multiple transactions are supplied. + public QueryQueryBuilder WithGetCompatibleFuelTanks(CompatibleFuelTankQueryBuilder compatibleFuelTankQueryBuilder, QueryBuilderParameter network, QueryBuilderParameter chain, QueryBuilderParameter account, QueryBuilderParameter> transactions, QueryBuilderParameter batchMode, string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) { var args = new List(); args.Add(new() { ArgumentName = "network", ArgumentValue = network} ); args.Add(new() { ArgumentName = "chain", ArgumentValue = chain} ); args.Add(new() { ArgumentName = "account", ArgumentValue = account} ); - args.Add(new() { ArgumentName = "pallet", ArgumentValue = pallet} ); - args.Add(new() { ArgumentName = "method", ArgumentValue = method} ); + args.Add(new() { ArgumentName = "transactions", ArgumentValue = transactions} ); + args.Add(new() { ArgumentName = "batchMode", ArgumentValue = batchMode} ); return WithObjectField("GetCompatibleFuelTanks", alias, compatibleFuelTankQueryBuilder, [include, skip], args); } diff --git a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/TransactionQueryBuilder.cs b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/TransactionQueryBuilder.cs index 3b8d32d..933650b 100644 --- a/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/TransactionQueryBuilder.cs +++ b/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema/QueryBuilders/TransactionQueryBuilder.cs @@ -23,6 +23,7 @@ public partial class TransactionQueryBuilder : GraphQlQueryBuilder ExceptField("error"); + public TransactionQueryBuilder WithFailedItemIndexes(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("failedItemIndexes", alias, [include, skip]); + + public TransactionQueryBuilder ExceptFailedItemIndexes() => ExceptField("failedItemIndexes"); + public TransactionQueryBuilder WithCreatedAt(string? alias = null, IncludeDirective? include = null, SkipDirective? skip = null) => WithScalarField("createdAt", alias, [include, skip]); public TransactionQueryBuilder ExceptCreatedAt() => ExceptField("createdAt");