[PLA-2417] Update to SDK v3 - #6
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces the previous Node.js Express sample server with a new .NET 9 (C#) minimal-API server that integrates with Enjin Platform SDK v3 while preserving the Unity client’s expected HTTP routes and JSON shapes.
Changes:
- Introduces a new .NET 9 web API project with minimal API endpoint groups for auth, wallet, token operations, and setup.
- Adds a C# service layer for Enjin Platform v3 interactions (collection bootstrap, managed wallets, mint/melt/transfer, transaction polling, ENJ drip) plus SS58 address encoding.
- Removes the legacy Node.js implementation and its npm dependencies; moves configuration to
appsettings*.json+ environment variables.
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Ss58SelfTest/Ss58SelfTest.csproj | Adds a small console tool project referencing the server for SS58 encoding verification. |
| tools/Ss58SelfTest/Program.cs | Runs a simple SS58 encode example for manual validation. |
| src/services/enjinService.js | Removes old Node.js Enjin platform integration service. |
| src/services/authService.js | Removes old Node.js auth service (bcrypt/jwt). |
| src/routes/wallet.js | Removes old Node.js wallet routes. |
| src/routes/token.js | Removes old Node.js token routes. |
| src/routes/auth.js | Removes old Node.js auth routes. |
| src/models/user.js | Removes old in-memory user model. |
| src/middlewares/jwtAuth.js | Removes old JWT middleware. |
| src/index.js | Removes old Node.js server bootstrap. |
| Services/UserStore.cs | Adds in-memory, process-local user registry for the C# server. |
| Services/SubstrateAddress.cs | Adds SS58 encoding utility to convert platform public keys to SS58 addresses. |
| Services/Options.cs | Adds strongly typed configuration options for Enjin/JWT/Server settings. |
| Services/EnjinService.cs | Implements all Enjin Platform SDK v3 interactions + persisted bootstrap state. |
| Services/AuthService.cs | Implements bcrypt password hashing + JWT issuance for Unity client auth. |
| README.md | Updates documentation to reflect the new .NET server and setup flow. |
| Program.cs | Adds .NET host configuration, DI, auth, routing, and bootstrap orchestration. |
| PlatformSampleGameServer.csproj | Adds new .NET 9 web project and NuGet dependencies (JWT, bcrypt, Enjin SDK, blake2). |
| package.json | Removes Node.js package manifest. |
| package-lock.json | Removes Node.js lockfile. |
| Models/User.cs | Adds C# user record for in-memory auth store. |
| Models/Dtos.cs | Adds DTOs matching Unity client wire format. |
| Endpoints/WalletEndpoints.cs | Adds JWT-protected wallet endpoints (get managed wallet tokens). |
| Endpoints/TokenEndpoints.cs | Adds JWT-protected token endpoints (mint/melt/transfer). |
| Endpoints/SetupEndpoints.cs | Adds unauthenticated setup endpoint(s) for Unity editor tooling. |
| Endpoints/AuthEndpoints.cs | Adds auth endpoints (health-check, register-or-login). |
| appsettings.Sample.json | Adds sample configuration template for local setup. |
| appsettings.json | Adds default config for logging/server/jwt/enjin/resource tokens. |
| .gitignore | Updates ignored files for .NET build artifacts and local config/state. |
| .env.example | Removes Node.js .env template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JayPavlina
marked this pull request as ready for review
May 27, 2026 23:56
Collaborator
Author
|
CI will fail until the C# SDK is published to Nuget |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional Info
This pull request introduces a new C# web API server for the Enjin platform sample game, replacing the previous Node.js implementation. The new server is structured with modern .NET practices and provides endpoints for authentication, wallet management, token operations, and setup. It also introduces a new DTO model layer and configuration via appsettings/environment variables. The most important changes are summarized below:
API Endpoint Implementation
AuthEndpoints), wallet management (WalletEndpoints), token operations (TokenEndpoints), and setup (SetupEndpoints). These endpoints follow RESTful conventions and match the expected shapes for the Unity client, supporting features like user registration/login, wallet querying, token mint/melt/transfer, and collection ID retrieval. [1] [2] [3] [4]Data Transfer Objects (DTOs) and Models
Dtos.cs, ensuring wire compatibility with the Unity client and encapsulating all API request/response shapes. Also added an in-memoryUsermodel for authentication. [1] [2]Server Configuration and Bootstrap
.env.examplewith strongly-typed configuration usingappsettingsand environment variables, and removed the old environment variable file. The server now bootstraps the Enjin collection at startup and supports skipping bootstrap for local testing. [1] [2]Project Structure and Dependencies
PlatformSampleGameServer.csproj) targeting .NET 9, with dependencies for JWT authentication, cryptography, and the Enjin Platform SDK.Authentication and Security
These changes lay the foundation for a robust, modern, and maintainable sample game server for Enjin platform integration.