Zenon.Sdk
0.6.11
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Zenon.Sdk --version 0.6.11
NuGet\Install-Package Zenon.Sdk -Version 0.6.11
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zenon.Sdk" Version="0.6.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Zenon.Sdk --version 0.6.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Zenon.Sdk, 0.6.11"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Zenon.Sdk as a Cake Addin #addin nuget:?package=Zenon.Sdk&version=0.6.11 // Install Zenon.Sdk as a Cake Tool #tool nuget:?package=Zenon.Sdk&version=0.6.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Zenon Sdk for .NET
Reference implementation for the Zenon SDK for .NET. Compatible with the Zenon Alphanet - Network of Momentum Phase 1. It provides a simple integration with any .NET based projects.
Installation
Install the Zenon.Sdk package from NuGet
dotnet add package Zenon.Sdk
Usage
Connect node
using Zenon;
using Zenon.Client;
// Create client instance with default options (mainnet)
using var client = new WsClient("wss://my.hc1node.com:35998");
// Connect to node
await client.ConnectAsync();
Generate wallet
using Zenon;
using Zenon.Wallet;
var walletName = "name";
var passphrase = "secret";
// Use key store manager
var walletManager = new KeyStoreManager();
// Create wallet
var walletDefinition = walletManager
.CreateNew(passphrase, walletName);
Generate wallet from mnemonic
using Zenon;
using Zenon.Wallet;
var walletName = "name";
var passphrase = "secret";
var mnemonic = @"route become dream access impulse price inform obtain
engage ski believe awful absent pig thing vibrant
possible exotic flee pepper marble rural fire fancy";
// Use key store manager
var walletManager = new KeyStoreManager();
// Create wallet
var walletDefinition = walletManager
.CreateFromMnemonic(mnemonic, passphrase, walletName);
Sending a transaction
using Zenon;
using Zenon.Client;
using Zenon.Wallet;
// Use key store manager
var walletManager = new KeyStoreManager();
// Use first wallet available
var walletDefinition =
(await walletManager.GetWalletDefinitionsAsync()).First();
// Options for retrieving the wallet
var options = new KeyStoreOptions()
{
DecryptionPassword = "secret"
};
// Retrieve the wallet
var wallet =
await walletManager.GetWalletAsync(walletDefinition, options);
// Create client instance with default options (mainnet)
using var client = new WsClient("wss://my.hc1node.com:35998");
// Connect to node
await client.ConnectAsync();
// Create zdk instance and attach primary wallet account
var zdk = new Zdk(client)
{
DefaultWalletAccount =
await wallet.GetAccountAsync(accountIndex: 0)
};
// Send tx
await zdk.SendAsync(zdk.Embedded.Pillar.CollectReward());
Receive a transaction
using Zenon;
using Zenon.Client;
using Zenon.Wallet;
using Zenon.Model.NoM;
// Use key store manager
var walletManager = new KeyStoreManager();
// Use first wallet available
var walletDefinition =
(await walletManager.GetWalletDefinitionsAsync()).First();
// Options for retrieving the wallet
var options = new KeyStoreOptions()
{
DecryptionPassword = "secret"
};
// Retrieve the wallet
var wallet =
await walletManager.GetWalletAsync(walletDefinition, options);
// Create client instance with default options (mainnet)
using var client = new WsClient("wss://my.hc1node.com:35998");
// Connect to node
await client.ConnectAsync();
// Create zdk instance and attach primary wallet account
var zdk = new Zdk(client)
{
DefaultWalletAccount =
await wallet.GetAccountAsync(accountIndex: 0)
};
// Get account address
var address = await zdk.DefaultWalletAccount.GetAddressAsync();
// Get all unreceived tx's
var result = await zdk.Ledger
.GetUnreceivedBlocksByAddress(address);
if (result.Count != 0)
{
foreach (var item in result.List)
{
// Send tx
await zdk.SendAsync(AccountBlockTemplate
.Receive(client.ProtocolVersion, client.ChainIdentifier, item.Hash));
}
}
Contributing
Please check CONTRIBUTING for more details.
License
The MIT License (MIT). Please check LICENSE for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Chaos.NaCl.Standard (>= 1.0.0)
- Konscious.Security.Cryptography.Argon2 (>= 1.3.0)
- Newtonsoft.Json (>= 13.0.3)
- P3.Ed25519.HdKey (>= 1.0.3)
- SHA3.Net (>= 2.0.0)
- StreamJsonRpc (>= 2.17.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Zenon.Sdk:
Package | Downloads |
---|---|
Zenon.Wallet.Ledger
Ledger wallet for the Zenon .NET SDK |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.6.25-ledger-g727123be4d | 126 | 12/11/2023 |
0.6.24-ledger-g403a3f8f67 | 110 | 12/11/2023 |
0.6.22-ledger-gbdfa921f2b | 104 | 12/11/2023 |
0.6.20-ledger-gef4ff81bd3 | 153 | 9/11/2023 |
0.6.19-ledger-ga45e76931d | 142 | 9/11/2023 |
0.6.17-ledger-g59034ed1b6 | 108 | 9/6/2023 |
0.6.16-ledger-g6a30ee89b1 | 106 | 9/6/2023 |
0.6.15-ledger-g0b99f5fe01 | 132 | 9/6/2023 |
0.6.14 | 141 | 4/29/2024 |
0.6.14-ledger-g30ff5b1b3c | 144 | 8/8/2023 |
0.6.13 | 185 | 4/4/2024 |
0.6.12 | 108 | 3/29/2024 |
0.6.12-ledger-gf29ee9d4de | 164 | 7/23/2023 |
0.6.11 | 110 | 3/21/2024 |
0.6.10 | 172 | 3/6/2024 |
0.6.9 | 288 | 12/13/2023 |
0.6.8-g8373116dd0 | 112 | 12/13/2023 |
0.6.6 | 163 | 9/18/2023 |
0.6.4 | 156 | 9/6/2023 |
0.6.3 | 140 | 9/6/2023 |
0.6.2 | 148 | 9/6/2023 |
0.6.1 | 183 | 8/1/2023 |
0.5.8 | 181 | 5/22/2023 |
0.5.7 | 259 | 4/22/2023 |
0.5.4-ptlc-g5a7a6e5328 | 140 | 4/14/2023 |
0.4.1 | 199 | 4/14/2023 |
0.3.12 | 315 | 1/25/2023 |
0.3.10 | 326 | 1/14/2023 |
0.3.9 | 338 | 12/22/2022 |
0.3.8 | 323 | 12/22/2022 |
0.3.7 | 414 | 10/14/2022 |
0.3.6 | 423 | 10/14/2022 |
0.3.5 | 434 | 10/8/2022 |
0.3.2 | 463 | 7/12/2022 |