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
12 changes: 5 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ To regenerate the schema after a Platform API change:
git clone git@github.com:enjin/platform-sdk-generators.git
```

2. Drop the latest `v3.json` schema (downloadable via introspection from the target Platform deployment) into
`platform-sdk-generators/CSharpSchemaGenerator/CSharpSchemaGenerator/schema/v3.json`.

3. Run the generator:
2. Run the generator. It fetches the live GraphQL schema via introspection directly from the Platform,
so there is no schema file to download or drop in:

```sh
cd platform-sdk-generators/CSharpSchemaGenerator/CSharpSchemaGenerator
Expand All @@ -100,21 +98,21 @@ To regenerate the schema after a Platform API change:
This produces `generated/v3/Schema/{Infrastructure,Enums,Model,Inputs,QueryBuilders}/*.cs` in the same folder.
The generator wipes `generated/v3/` before writing, so renamed or removed types do not leave orphan files.

4. Replace the SDK's `Schema/` tree with the generator output:
3. Replace the SDK's `Schema/` tree with the generator output:

```sh
rm -rf ../../../platform-csharp-sdk/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema
cp -R generated/v3/Schema \
../../../platform-csharp-sdk/src/Enjin.Platform.Sdk/Enjin.Platform.Sdk/Schema
```

5. Build and run the tests:
4. Build and run the tests:

```sh
dotnet test src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.sln
```

6. (Recommended) Run the live smoke runner against a real Platform deployment to confirm the regenerated
5. (Recommended) Run the live smoke runner against a real Platform deployment to confirm the regenerated
client still round-trips real data over the wire:

```sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsPackable>false</IsPackable>

<Version>3.0.2</Version>
<Version>3.0.3</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.2</Version>
<Version>3.0.3</Version>
Comment thread
JayPavlina marked this conversation as resolved.
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>12</LangVersion>
<RootNamespace>Enjin.Platform.Sdk</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// <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>
/// Determines how a batch transaction handles failed calls.
/// </summary>
public enum BatchTransactionModeEnum
{
[EnumMember(Value = "HALT_ON_ERROR")] HaltOnError,
[EnumMember(Value = "CONTINUE_ON_ERROR")] ContinueOnError,
[EnumMember(Value = "ALL_OR_NOTHING")] AllOrNothing
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// <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>
/// Whether the fuel tank covers only transaction fees (FEES) or fees and the storage deposit (FEES_AND_DEPOSIT).
/// </summary>
public enum CoveragePolicy
{
[EnumMember(Value = "FEES")] Fees,
[EnumMember(Value = "FEES_AND_DEPOSIT")] FeesAndDeposit
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// <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 transaction method that a fuel tank rule set may permit. Identifies the pallet and extrinsic; the call arguments are irrelevant on-chain.
/// </summary>
public enum FuelTankPermittedMethod
{
[EnumMember(Value = "CREATE_COLLECTION")] CreateCollection,
[EnumMember(Value = "DESTROY_COLLECTION")] DestroyCollection,
[EnumMember(Value = "MUTATE_COLLECTION")] MutateCollection,
[EnumMember(Value = "MUTATE_TOKEN")] MutateToken,
[EnumMember(Value = "CREATE_TOKEN")] CreateToken,
[EnumMember(Value = "MINT_TOKEN")] MintToken,
[EnumMember(Value = "TRANSFER_TOKEN")] TransferToken,
[EnumMember(Value = "CREATE_TOKENS")] CreateTokens,
[EnumMember(Value = "MINT_TOKENS")] MintTokens,
[EnumMember(Value = "BATCH_TRANSFER")] BatchTransfer,
[EnumMember(Value = "FREEZE_COLLECTION")] FreezeCollection,
[EnumMember(Value = "THAW_COLLECTION")] ThawCollection,
[EnumMember(Value = "FREEZE_TOKEN")] FreezeToken,
[EnumMember(Value = "THAW_TOKEN")] ThawToken,
[EnumMember(Value = "BURN_TOKEN")] BurnToken,
[EnumMember(Value = "INFUSE_TOKEN")] InfuseToken,
[EnumMember(Value = "INFUSE_TOKENS")] InfuseTokens,
[EnumMember(Value = "TRANSFER_ENJ")] TransferEnj,
[EnumMember(Value = "CREATE_LISTING")] CreateListing,
[EnumMember(Value = "CANCEL_LISTING")] CancelListing,
[EnumMember(Value = "FILL_LISTING")] FillListing,
[EnumMember(Value = "FINALIZE_AUCTION")] FinalizeAuction,
[EnumMember(Value = "ADD_WHITELISTED_ACCOUNTS")] AddWhitelistedAccounts,
[EnumMember(Value = "REMOVE_WHITELISTED_ACCOUNTS")] RemoveWhitelistedAccounts,
[EnumMember(Value = "PLACE_BID")] PlaceBid,
[EnumMember(Value = "PLACE_COUNTER_OFFER")] PlaceCounterOffer,
[EnumMember(Value = "ANSWER_COUNTER_OFFER")] AnswerCounterOffer,
[EnumMember(Value = "CREATE_TOKEN_GROUP")] CreateTokenGroup,
[EnumMember(Value = "DESTROY_TOKEN_GROUP")] DestroyTokenGroup,
[EnumMember(Value = "ADD_TOKEN_TO_GROUP")] AddTokenToGroup,
[EnumMember(Value = "REMOVE_TOKEN_FROM_GROUP")] RemoveTokenFromGroup,
[EnumMember(Value = "SET_TOKEN_GROUPS")] SetTokenGroups,
[EnumMember(Value = "SET_TOKEN_GROUP_ATTRIBUTE")] SetTokenGroupAttribute,
[EnumMember(Value = "REMOVE_TOKEN_GROUP_ATTRIBUTE")] RemoveTokenGroupAttribute,
[EnumMember(Value = "SET_TOKEN_ATTRIBUTE")] SetTokenAttribute,
[EnumMember(Value = "SET_COLLECTION_ATTRIBUTE")] SetCollectionAttribute,
[EnumMember(Value = "REMOVE_TOKEN_ATTRIBUTE")] RemoveTokenAttribute,
[EnumMember(Value = "REMOVE_COLLECTION_ATTRIBUTE")] RemoveCollectionAttribute,
[EnumMember(Value = "BATCH_SET_COLLECTION_ATTRIBUTE")] BatchSetCollectionAttribute,
[EnumMember(Value = "BATCH_SET_TOKEN_ATTRIBUTE")] BatchSetTokenAttribute,
[EnumMember(Value = "REMOVE_ALL_COLLECTION_ATTRIBUTES")] RemoveAllCollectionAttributes,
[EnumMember(Value = "REMOVE_ALL_TOKEN_ATTRIBUTES")] RemoveAllTokenAttributes,
[EnumMember(Value = "ACCEPT_COLLECTION_TRANSFER")] AcceptCollectionTransfer,
[EnumMember(Value = "CANCEL_COLLECTION_TRANSFER")] CancelCollectionTransfer,
[EnumMember(Value = "APPROVE_COLLECTION")] ApproveCollection,
[EnumMember(Value = "UNAPPROVE_COLLECTION")] UnapproveCollection
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// <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 pallet that a fuel tank rule set may whitelist, allowing any of its calls.
/// </summary>
public enum FuelTankWhitelistedPallet
{
[EnumMember(Value = "MULTI_TOKENS")] MultiTokens,
[EnumMember(Value = "BALANCES")] Balances,
[EnumMember(Value = "MARKETPLACE")] Marketplace,
[EnumMember(Value = "UTILITY")] Utility
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// <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>
/// The sweep status of a managed wallet: SWEPT once emptied of transferable tokens, PENDING while any remain.
/// </summary>
public enum ManagedWalletSweepStatusEnum
{
[EnumMember(Value = "PENDING")] Pending,
[EnumMember(Value = "SWEPT")] Swept
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// <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>
/// How to apply an optional mutation field on the fuel tank. NO_MUTATION keeps the existing value; CLEAR sets it to None; SET requires a value and applies it.
/// </summary>
public enum ShouldMutateAction
{
[EnumMember(Value = "NO_MUTATION")] NoMutation,
[EnumMember(Value = "CLEAR")] Clear,
[EnumMember(Value = "SET")] Set
}

Loading
Loading