Netezos 2.10.1
Prefix Reserveddotnet add package Netezos --version 2.10.1
NuGet\Install-Package Netezos -Version 2.10.1
<PackageReference Include="Netezos" Version="2.10.1" />
paket add Netezos --version 2.10.1
#r "nuget: Netezos, 2.10.1"
// Install Netezos as a Cake Addin #addin nuget:?package=Netezos&version=2.10.1 // Install Netezos as a Cake Tool #tool nuget:?package=Netezos&version=2.10.1
Netezos
<a href="https://www.nuget.org/packages/Netezos/"><img src="https://img.shields.io/nuget/v/Netezos.svg" /></a> <a href="https://www.nuget.org/packages/Netezos/"><img src="https://img.shields.io/nuget/dt/Netezos.svg" /></a>
The first version of the library has been moved to the
v1
branch for historical purposes.
Netezos is a cross-platform Tezos SDK for .NET developers, simplifying the access and interaction with the Tezos blockchain.
The following features have been implemented so far:
Namespace | Description | Status |
---|---|---|
Netezos.Contracts | Interaction with Tezos smart contracts | Ready to use. Dynamic wrapper: in progress... |
Netezos.Forge | Forging (encoding) operation bytes | Ready to use |
Netezos.Keys | Working with keys, HD keys, signing, verifying signature, etc. | Ready to use |
Netezos.Ledger | Interaction with Tezos Ledger App | Ready to use (separate package) |
Netezos.Rpc | Tezos RPC wrapper | Ready to use |
For full documentation and API Reference, please refer to the Netezos website
Contribution
Netezos is an open development project so any contribution is highly appreciated, starting from documentation improvements, writing examples of usage, etc. and ending with adding new features (as long as these features do not break existing API or are only intended for one person and for very specific use case).
Do not hesitate to use GitHub issue tracker to report bugs or request features.
Support
Feel free to join our Discord server, Telegram chat, or find us in Tezos Dev Slack. We will be glad to hear any feedback and feature requests and will try to help you with general use cases of the Netezos library.
Getting started
Let's consider the most common use case - sending a transaction.
Installation
PM> Install-Package Netezos
Create private key
// generate new key
var key = new Key();
// or use existing one
var key = Key.FromBase58("edsk4ZkGeBwDyFVjZLL2neV5FUeWNN4NJntFNWmWyEBNbRwa2u3jh1");
// use this address to receive some tez
var address = key.PubKey.Address; // tz1SauKgPRsTSuQRWzJA262QR8cKdw1d9pyK
Get some data from RPC
using var rpc = new TezosRpc("https://mainnet-tezos.giganode.io/");
// get a head block
var head = await rpc.Blocks.Head.Hash.GetAsync<string>();
// get account's counter
var counter = await rpc.Blocks.Head.Context.Contracts[address].Counter.GetAsync<int>();
Forge an operation
Since our address has just been created, we need to reveal its public key before sending any operation, so that everyone can validate our signatures. Therefore, we need to send actually two operations: a reveal and then a transaction.
Netezos allows you to pack multiple operations into a group and forge/send it as a single batch.
var content = new ManagerOperationContent[]
{
new RevealContent
{
Source = address,
Counter = ++counter,
PublicKey = key.PubKey.GetBase58(),
GasLimit = 1500,
Fee = 1000 // 0.001 tez
},
new TransactionContent
{
Source = address,
Counter = ++counter,
Amount = 1000000, // 1 tez
Destination = "tz1KhnTgwoRRALBX6vRHRnydDGSBFsWtcJxc",
GasLimit = 1500,
Fee = 1000 // 0.001 tez
}
};
var bytes = await new LocalForge().ForgeOperationGroupAsync(head, content);
Sign and send
// sign the operation bytes
byte[] signature = key.SignOperation(bytes);
// inject the operation and get its id (operation hash)
var result = await rpc.Inject.Operation.PostAsync(bytes.Concat(signature));
That is it. We have successfully injected our first operation into the Tezos blockchain.
Useful links
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Dynamic.Json (>= 1.4.1)
- Portable.BouncyCastle (>= 1.9.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Netezos:
Package | Downloads |
---|---|
Swisschain.Sirius.Sdk.Crypto
Package Description |
|
Beacon.Sdk
Beacon .NET SDK for Tezos wallet / dApps developers. |
|
Nichelson
Package Description |
|
TzWatch.Lib
Package Description |
|
TezosPayments
Package for payment generation in the Tezos Payments system |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Netezos:
Repository | Stars |
---|---|
baking-bad/tzkt
😼 Awesome Tezos blockchain indexer and API
|
Version | Downloads | Last updated |
---|---|---|
2.10.1 | 941 | 5/23/2024 |
2.10.0 | 106 | 5/23/2024 |
2.9.0 | 2,005 | 2/5/2024 |
2.8.0 | 2,674 | 3/29/2023 |
2.7.7 | 1,307 | 2/8/2023 |
2.7.6 | 802 | 2/7/2023 |
2.7.5 | 1,206 | 1/24/2023 |
2.7.4 | 901 | 1/22/2023 |
2.7.3 | 1,209 | 12/25/2022 |
2.7.2 | 1,077 | 12/9/2022 |
2.7.1 | 987 | 11/29/2022 |
2.7.0 | 986 | 11/24/2022 |
2.6.2 | 2,033 | 8/18/2022 |
2.6.1 | 1,147 | 8/3/2022 |
2.6.0 | 1,406 | 6/29/2022 |
2.6.0-rc.1 | 314 | 5/23/2022 |
2.5.2 | 3,108 | 3/31/2022 |
2.5.1 | 1,837 | 3/12/2022 |
2.5.0 | 1,003 | 3/12/2022 |
2.4.7 | 1,532 | 12/22/2021 |
2.4.6 | 9,815 | 11/25/2021 |
2.4.5 | 4,028 | 11/25/2021 |
2.4.4 | 1,125 | 11/4/2021 |
2.4.3 | 16,083 | 10/28/2021 |
2.4.2 | 899 | 10/28/2021 |
2.4.1 | 1,345 | 10/20/2021 |
2.4.0 | 965 | 10/20/2021 |
2.4.0-rc.1 | 359 | 9/29/2021 |
2.3.14 | 1,267 | 9/2/2021 |
2.3.13 | 4,049 | 6/15/2021 |
2.3.12 | 1,067 | 6/2/2021 |
2.3.11 | 1,056 | 5/25/2021 |
2.3.10 | 1,086 | 5/23/2021 |
2.3.9 | 2,454 | 4/9/2021 |
2.3.8 | 1,885 | 4/7/2021 |
2.3.7 | 943 | 4/2/2021 |
2.3.6 | 935 | 4/1/2021 |
2.3.5 | 1,040 | 3/29/2021 |
2.3.4 | 953 | 3/28/2021 |
2.3.3 | 985 | 3/26/2021 |
2.3.2 | 1,421 | 3/19/2021 |
2.3.1 | 1,024 | 3/17/2021 |
2.3.0 | 949 | 3/16/2021 |
2.2.1 | 1,602 | 2/20/2021 |
2.2.0 | 1,145 | 2/11/2021 |
2.1.5 | 959 | 2/9/2021 |
2.1.4 | 1,019 | 1/28/2021 |
2.1.3 | 1,037 | 1/25/2021 |
2.1.2 | 988 | 1/24/2021 |
2.1.1 | 1,067 | 1/22/2021 |
2.1.0 | 1,061 | 1/21/2021 |
2.0.1 | 1,047 | 12/9/2020 |
2.0.0 | 1,125 | 12/6/2020 |
2.0.0-rc.1 | 531 | 10/22/2020 |