![]() |
VOOZH | about |
dotnet add package Quantoz.Nexus.Sdk.Token --version 1.58.0
NuGet\Install-Package Quantoz.Nexus.Sdk.Token -Version 1.58.0
<PackageReference Include="Quantoz.Nexus.Sdk.Token" Version="1.58.0" />
<PackageVersion Include="Quantoz.Nexus.Sdk.Token" Version="1.58.0" />Directory.Packages.props
<PackageReference Include="Quantoz.Nexus.Sdk.Token" />Project file
paket add Quantoz.Nexus.Sdk.Token --version 1.58.0
#r "nuget: Quantoz.Nexus.Sdk.Token, 1.58.0"
#:package Quantoz.Nexus.Sdk.Token@1.58.0
#addin nuget:?package=Quantoz.Nexus.Sdk.Token&version=1.58.0Install as a Cake Addin
#tool nuget:?package=Quantoz.Nexus.Sdk.Token&version=1.58.0Install as a Cake Tool
This project provides the following functionalities to interact with your Nexus Token environments
| Functionality | Algorand | Stellar |
|---|---|---|
| Create a Customer | ✔️ | ✔️ |
| Create Accounts for a Customer | ✔️ | ✔️ |
| Create a Token | ✔️ | ✔️ |
| Connect an Account to a Tokens | ✔️ | ✔️ |
| Check an Account's Token Balances | ✔️ | ✔️ |
| Fund an Account with Tokens | ✔️ | ✔️ |
| Pay other Accounts with Tokens | ✔️ | ✔️ |
| Payout a Token from an Account | ✔️ | ✔️ |
| Orderbook | - | ✔ |
Inject the ITokenServer into your class:
public class MyClass
{
public MyClass(ITokenServer tokenServer)
{
...
}
}
Program.cs example:
var services = new ServiceCollection();
services.AddTokenServer(o => ...);
services.AddScoped<MyClass>();
var provider = services.BuildServiceProvider();
var instance = provider.GetRequiredService<MyClass>();
Startup.cs example:
public class Startup
{
// Configure using TokenServerOptionsBuilder
public void ConfigureServices(IServiceCollection services)
{
services.AddTokenServer(o => ...);
}
}
public class Startup
{
// Configure using IConfiguration
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddTokenServer(Configuration);
}
}
This sdk uses throws two types of custom exceptions: NexusApiException and AuthProviderException.
NexusApiException is thrown when Nexus API returns an error.
AuthProviderException is thrown when Nexus Identity returns an error.
Here is an example:
try
{
...
}
catch (NexusApiException ex)
{
// Handle api exception
if (ex.StatusCode == 400 || ex.StatusCode == 404)
{
// Handle user input error here
}
else
{
Console.WriteLine($"{ex.StatusCode}");
Console.WriteLine($"{ex.Message}");
Console.WriteLine($"{ex.ErrorCodes}");
}
}
catch (AuthProviderException ex)
{
// Handle authorized exception
Console.WriteLine($"{ex.Message}");
}
catch (Exception ex)
{
// Handle unexpected exception
Console.WriteLine($"{ex.Message}");
}
The sdk supports the ILogger interface. Here is a basic example of how to add debug logging to the console using Serilog:
using Serilog;
var logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.CreateLogger();
services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog(logger, dispose: true));
The sdk supports two environments for Nexus:
Using options builder:
services.AddTokenServer(o => o.ConnectToTest("clientId", "clientSecret"));
Using appsettings.json
{
"NexusOptions": {
"ApiUrl": "https://testapi.quantoz.com",
"PaymentMethodOptions": {
"Funding": "your-test-funding-paymentMethod",
"Payout": "your-test-funding-paymentMethod"
},
"AuthProviderOptions": {
"IdentityUrl": "https://testidentity.quantoz.com",
"ClientId": "your-test-clientId",
"ClientSecret": "your-test-clientSecret"
}
}
}
Using options builder:
services.AddTokenServer(o => o.ConnectToProduction("clientId", "clientSecret"));
Using appsettings.json
{
"NexusOptions": {
"ApiUrl": "https://api.quantoz.com",
"PaymentMethodOptions": {
"Funding": "your-prod-funding-paymentMethod",
"Payout": "your-prod-funding-paymentMethod"
},
"AuthProviderOptions": {
"IdentityUrl": "https://identity.quantoz.com",
"ClientId": "your-prod-clientId",
"ClientSecret": "your-prod-clientSecret"
}
}
}
Check our Nexus Docs for more information on how to generate a clientId and clientSecret for your environment.
The private key of an Account should be treated like a password. The sdk supports AES encryption and decryption of an accounts private key to ensure that it is not visibly exposed in a database or on the users mobile phone.
To use AES encryption:
services.UseSymmetricEncryption("KEY");
The length of the KEY can be 16 Bytes (~16 characters), 24 bytes (~24 characters) or 32 bytes (~32 characters) long. You can read up more on AES encryption here:.
Encrypt example:
public class MyClass
{
public MyClass(ITokenServer tokenServer, IEncrypter encrypter)
{
var kp = AlgorandKeyPair.Generate();
var encryptedPrivateKey = kp.GetPrivateKey(_encrypter);
}
}
Decrypt example:
public class MyClass
{
public MyClass(ITokenServer tokenServer, IDecrypter encrypter)
{
var encryptedPrivateKey = ""; // get from db or mobile phone storage
var kp = AlgorandKeyPair.FromPrivateKey(encryptedPrivateKey, _decrypter);
}
}
IMPORTANT: Make sure to safely store a backup of your AES KEY. If you lose it, you or your users will lose access to their Account.
Nexus supports two types of tokens:
1: StableCoin - A token that is pegged to currency at a certain rate.
2: AssetToken - A token that is pegged to a physical asset with limited supply.
Stellar Settings:
account limit (none) - The total amount of token a single Account can hold.authorization required (true) - This token can only be used in a closed system. This means that an account not known to Nexus cannot receive this token.authorization revocable (true) - Allow Nexus to revoke an accounts permission to hold it this token. This means that it can no longer send or receive more of this token.clawback enabled (true) - Allow Nexus to retrieve (clawback) this token from an account.Algorand Settings:
total supply - The total amount of token that can circulate in the system.decimals - The number of digits to use after the decimal point when displaying this asset. If set to 0, the asset is not divisible beyond its base unit. If set to 1, the base asset unit is tenths. If 2, the base asset unit is hundredths, and so on.authorization revocable (true) - Allow Nexus to revoke an accounts permission to hold it this token. This means that it can no longer send or receive more of this token.clawback enabled (true) - Allow Nexus to retrieve this token from an account.Note: That once a token has been created these settings cannot be changed.
The idea of token taxonomy is to provide a token on a blockchain with more meaning than just a code. The first step is to specify a set of properties that your tokens must comply with, this is called a schema (NJsonSchema is a library that can be used to easily generate a schema from an C# object).
When creating a new token, you specify the schema along with a set of properties the token has. These properties are validated against the schema and hashed using the SHA256 algorithm. This hash is stored base64 encoded as a token property on the blockchain. It is also possible to add an assetURL, this url can be a reference to a webpage where the asset is described or can contain a JSON representation of the properties.
Any person can verify that the properties of a created token have not been altered by encoding the JSON using SHA256 hashing algorithm and comparing it to the decoded hash on the blockchain.
Alternatively, you can provide a hash to store on the blockchain, instead of having to provide a taxonomy schema and properties to calculate one, but note a provided hash is not validated in any way.
Normally the Funding of a token and the Payout of a token involve an exchange of fiat currencies. You can find more information about Payment Methods To use a default Payment Method for all funding and payout requests you can configure the sdk to use a default ones instead:
Add default funding Payment Method:
services.AddTokenServer(o => o.AddDefaultFundingPaymentMethod("FUNDING_PM"));
Add default payout Payment Method:
services.AddTokenServer(o => o.AddDefaultPayoutPaymentMethod("PAYOUT_PM"));
If no default Payment Method is supplied, it will need to be specified on funding /payout level.
tokenServer.Operations.CreateFundingAsync("accountCode", "tokenCode", 100, pm: "FUNDING_PM");
tokenServer.Operations.CreatePayoutAsync("accountCode", "tokenCode", 100, pm: "PAYOUT_PM");
To allow for testability the TokenServer uses an ITokenServerProvider implementation. This means you can inject your own instance of this interface in your tests.
public class MockTokenServerProvider : ITokenServerProvider
{
public Task<SignableResponse> ConnectAccountToTokenAsync(string accountCode, string tokenCode)
{
throw new NotImplementedException();
}
public Task<SignableResponse> ConnectAccountToTokensAsync(string accountCode, string[] tokenCodes)
{
throw new NotImplementedException();
}
...
}
var mock = new MockTokenServerProvider();
_services.AddTokenServer(mock);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.58.0 | 184 | 5/15/2026 |
| 1.57.0 | 671 | 4/29/2026 |
| 1.56.0 | 110 | 4/28/2026 |
| 1.55.0 | 605 | 3/16/2026 |
| 1.54.0 | 514 | 3/5/2026 |
| 1.53.0 | 294 | 2/12/2026 |
| 1.52.0 | 231 | 1/22/2026 |
| 1.51.0 | 141 | 1/21/2026 |
| 1.50.0 | 1,124 | 1/9/2026 |
| 1.49.0 | 328 | 10/31/2025 |
| 1.48.0 | 1,905 | 10/1/2025 |
| 1.47.0 | 616 | 9/19/2025 |
| 1.46.0 | 353 | 8/26/2025 |
| 1.45.0 | 1,485 | 8/6/2025 |
| 1.44.0 | 401 | 7/8/2025 |
| 1.43.0 | 290 | 7/1/2025 |
| 1.42.0 | 307 | 6/30/2025 |
| 1.41.0 | 713 | 6/19/2025 |
| 1.40.0 | 265 | 6/17/2025 |
| 1.39.0 | 356 | 6/4/2025 |