enjin/enjin-csharp-sdk

Blockchain SDK by Enjin for C#

Create blockchain video games and applications using the C# programming language

Blockchain SDK by Enjin for C#

Blockchain SDK by Enjin for C#

Create blockchain video games and applications using the C# programming language.

Learn more about the Enjin blockchain platform.

Sign up to Enjin Cloud: Goerli (Testnet), Mainnet (Production) or JumpNet.

Resources

  • Enjin Docs
  • Doxygen Docs

Table of Contents

  • Compatibility
  • Installation
  • Quick Start
  • Contributing
    • Issues
    • Pull Requests
  • Copyright and Licensing

Compatibility

The Enjin C# SDK is targeted for .NET Standard 2.0.

Installation

This SDK is available on NuGet and may be installed with the following package manager command:

Quick Start

This example showcases how to quickly create and authenticate a client on the project schema which will then allow us to make further requests to the platform.

Contributing

Contributions to the SDK are appreciated!

Issues

You can open issues for bugs and enhancement requests.

Pull Requests

If you make any changes or improvements to the SDK, which you believe are beneficial to others, consider making a pull request to merge your changes to be included in the next release.

Ensure that tests are passing when running TestSuite and add any necessary test classes or test cases for your code.

Be sure to include your name in the list of contributors.

Copyright and Licensing

The license summary below may be copied.

Issues

Quick list of the latest Issues we found

seertenedos

seertenedos

enhancement
Icon For Comments0

Firstly i wanted to say that they look extreamly useful but i see one main issue with them. If you build your application to rely on them then you need to be able to deal with the case when the reader crashes or looses connection and needs to resume. If not you would need to ge thte state of everything when you restart the app or process. To me it seems like it could be ideal to be able to specify the events you are interested in from a block going forward or something like that and you have the events report the block so you can keep track of where you are up to and resume from there once connection is back or your app is back up again.

If developers could do something like that then i could see a lot of the API calls not being needed for queries and managing local state that is in sync with the blockchain would be a lot easier.

seertenedos

seertenedos

enhancement
Icon For Comments2

I am only starting to play with the library so i may have missed something but the auth workflow feels a little wrong to me. When we authenticate a project or a player Enjin returns a JWT token that is valid for 24 hours and then i beleive you need to renew it using the original authentication method as i assume you can't refresh the token using the token. For a short running program this is not an issue but for a server side program that may run for days, weeks or months it would be.bFrom what i can tell the clients don't really have anything in there to manage this or help with this and instead the developer needs to code it all and i would think it would be common task for almost anyone using the lib.

Perhaps you could have an Authentication Helper or something that could optionally be passed to the clients when created that could do the token management and refresh for the client by taking in the AuthProject UUID and Secret from config or some other source like a secret store. If the project auth is going to expire in say 30 minutes it will create a project client and get a new auth token to be used by all project clients that use the AuthHelper. For the playerClient i think it is a little more complex as as to refresh those you need the project aith token and the player details but the authhelper could provide the project token needed and i would think the player details would be in the player token since they are jwt tokens.

honestly i have not quite understood yet when you would use the player access token vs just using the access token for the project as it seems like you cna do most things if not all on the project in relation to the players. I get the reason froma security side of things but if their tokens expire then you still need to project level auth token to keep getting the players tokens so does not really let you seperate things out unless you do it at login one time or something as normally a user should be online for less than 24 hours

Lelegithub

Lelegithub

Icon For Comments9

We get all errors on importing the Project inside Unity. PusherClient is not defined and many more, could you please fix it ? It would be useful if you create a proper Unity doc/SDK since it's the number one game engine out there! Thanks!

image

Versions

Quick list of the latest released versions

1.0.0-beta.1 - Jul 18, 2022

Added

  • Added HttpLogLevel enum values.
  • Added reauthentication features to ProjectClient.

Changed

  • Renamed AssetSort to AssetSortInput.
  • Renamed Melt to MeltInput.
  • Renamed PaginationOptions to PaginationInput.
  • Renamed Request to Transaction.
  • Renamed RequestState to TransactionState.
  • Renamed RequestType to TransactionType.
  • Renamed Trade to TradeInput.
  • Renamed TransactionSort to TransactionSortInput.
  • Renamed Transfers to TransferInput.
  • Renamed GetRequest to GetTransaction.
  • Renamed GetRequests to GetTransactions.
  • Renamed IProjectTransactionRequestArguments to ITransactionRequestArguments.
  • Renamed TrustedPlatformMiddleware to ClientMiddleware.
  • Renamed TrustedPlatformHandler to ClientHandler.
  • ClientHandler now locks its authentication token with a mutex.
  • Platform clients and event services now utilize builders.
  • Replaced Boolean input to set HTTP debugging in platform clients and middleware with HttpLogLevel enum value.
  • Replaced JObject type with IDictionary<string, object>.
  • Replaced IsConnected() method in IEventService with property of the same name.
  • Logger provider input for platform clients is now nullable.
  • Logger provider input for PusherEventService is now nullable.
  • The logger provider passed to the platform clients now handles HTTP logs when HTTP debugging is enabled.
  • Reformatted HTTP log messages.
  • Changed access of HttpLoggingHandler from public to internal.
  • Changed access of CreateRequestBody(OGraphqlRequest) method in BaseSchema from protected to private.
  • Changed access of JSON constructor in GraphqlData from public to internal.
  • Added finalizers to platform clients.

Removed

  • Removed Refit as a dependency.
  • Removed constructors from platform clients and event services.

1.0.0-alpha.7 - Jul 05, 2022

Added

  • Added GOERLI to EnjinHosts.

Removed

  • Removed KOVAN from EnjinHosts.

1.0.0-alpha.6 - May 23, 2022

Added

  • Added arguments and fields to Transaction.gql template file for getting the wallet address.
  • Added arguments and fields to Wallet.gql template file for getting balances and transactions.
  • Added WithTransactionWalletAddress extension method for ITransactionFragmentArguments.
  • Added WalletBalanceFilter, WithWalletBalances, and WithWalletTransactions extension methods for IWalletFragmentArguments.
  • Added Wallet property to Request model.
  • Added Balances and Transactions properties to Wallet model.

Changed

  • Changed argument name in Transaction.gql template file from assetIdFormat to withTransactionWalletAddress to avoid name-collisions.
  • Changed name of extension method for ITransactionFragmentArguments from AssetIdFormat to TransactionAssetIdFormat.
  • IWalletFragmentArguments now implements IBalanceFragmentArguments and ITransactionFragmentArguments.

1.0.0-alpha.5 - Apr 25, 2022

Changed

  • Removed ProjectUuid and ProjectUuidIn methods from BalanceFilter.

1.0.0-alpha.4 - Apr 11, 2022

Changed

  • GetWallets query in project schema no longer implements IPaginationArguments.

Fixed

  • Fixed typo for result in GetWallets.gql template file for project schema.

1.0.0-alpha.3 - Mar 28, 2022

Fixed

  • Boolean responses of the Delete method in IDelete Refit service are now nullable.

1.0.0-alpha.2 - Nov 10, 2021

Added

  • Added Enjin Bridge mutations for project and player schemas.
  • Added Asset property to Request.
  • Added AssetIdFormat method to ITransactionFragmentArguments.

Changed

  • Changed versioning for project to follow Semantic Versioning.
  • Changed project information in preparation for NuGet package release.
  • The asset for transactions is now included in returned Request models when using WithAssetData() in requests which implement ITransactionFragmentArguments.

Fixed

  • Schema requests to the platform no longer serialize arguments that have not been set.
  • Fixed type constraints on methods in ITransactionFragmentArguments.

1.0.0.1000 - Sep 27, 2021

Implementation of Player and Project Schemas

This alpha release introduces support for the new V2 Platform Schemas (Player and Project).

Library Stats (Sep 21, 2022)

Subscribers: 7
Stars: 29
Forks: 10
Issues: 3

csharp-data-visualization

I've always wanted to learn how to visualize data in C#

csharp-data-visualization

C Sharp Helper Methods

Bu bir Windows Form uygulamas覺d覺r ve i癟erisinde genel olarak ERP projelerinde s覺k癟a kullan覺labilecek baz覺 metotlar覺 ve kullan覺mlar覺n覺 i癟ermektedir

C Sharp Helper Methods

CSharp-Collection

Challenges, projects, educational files

CSharp-Collection

CSharp_Veri_Tipleri

byte, sbyte, short, ushort, int, uint, long, ulong, decimal, bool, char, string, var, object veri tipleri incelenmistir

CSharp_Veri_Tipleri

CSharp-CodeSnippet

Wide variety of sample code snippets from the topics related in C#

CSharp-CodeSnippet

csharp-aspnet-microservices

Course on building microservices on

csharp-aspnet-microservices

CSharp &quot;C#&quot; WAVE &quot;

Parses the audio data and the format chunk info from a WAVE-Format audio file &quot;

CSharp &quot;C#&quot; WAVE &quot;

CSharp_ChromaStreamApp

C# Chroma Stream App for Chroma RGB streaming

CSharp_ChromaStreamApp

CSharp-SMTP-Server

Simple (receive only) SMTP server library for C#

CSharp-SMTP-Server

CSharp To Mindustry Logic

This is a code transpiler that will transpile C# code to mlog

CSharp To Mindustry Logic