Tz.Net is a .NET Standard 2.0 library created for the purpose of interacting with the Tezos blockchain by communicating with the JSON RPC API.
- Wallet funds transfer
- Wallet activation
- Get wallet balance
- Public/private key generation
- Message signing
- Message verification
- Describe the RPC API schema
- Get head chain/block
- Get network stats
- ... and other less notable functions
This library is currently in beta!
Many features are still being developed, are not yet fully implemented, and may not work 100% of the time. To date, this has only been tested on the alphanet and zeronet.
Using the NuGet package manager console:
Install-Package Tz.Net
https://www.nuget.org/packages/Tz.Net/
using Tz.Net;
namespace Tz.Net.Demo
{
public class Foo
{
public async void Bar()
{
// Seed a wallet with mnemonic, email, and password.
var wallet = new Wallet(15WordMnemonic, Email, Password);
// Activates a wallet.
var activationResult = await wallet.Activate("<your activation code>");
// Get the wallet balance.
var balance = await wallet.GetBalance();
// Send 2 tezzies from sending "from" address to recipient "to" address.
var transferOpResult = await wallet.Transfer(from: "tz1...", to: "tz1...", amount: 2, fee: 0);
}
}
}
See the tests project for more examples.
NOTE: The default connection is made to a locally running node at http://localhost:8732
. Whatever node version is listening there will be on what network these calls are made (e.g. alphanet/zeronet/betanet).
- In command line, navigate to
tests\Tz.Net.Tests
directory - Execute
dotnet test
- More features
- More tests -- always
- Wiki documentation
- Contracts (Michelson => Micheline support would be super rad)
- Help
I want help! Please don't hesitate to contribute. This project is being developed completely in spare time out of sheer admiration for Tezos and the expansion of the Tezos community. Pull requests will be reviewed as soon as possible.
If you introduce new functionality, if at all possible, please find a way to create unit tests that also test this new functionality (and ensure the changes do not break existing functionality by running the tests--see Testing
section above).
Please do all new development on the develop
branch and do pull requests from there.
Please file any bugs you discover or feature requests you'd like to see.
I have to give special credit to stephenandrews for creating eztz and LMilfont for creating TezosJ SDK. Their projects were invaluable resources for me as reference material to better understand the Tezos node RPC API. This project was only made possible because I stand on the shoulders of giants.
- https://github.com/stephenandrews/eztz (reference material)
- https://github.com/LMilfont/TezosJ (reference material)
- https://github.com/bitcoinjs/bip39 (mnemonic code support)
- I translated this to C#.
- https://github.com/kmaragon/Konscious.Security.Cryptography (Blake2B generic hashing algorithm)
- https://github.com/adamcaudill/Base58Check (Base58 Checked Encoding based on public domain Gist by CodesInChaos)
- I had to build and distribute a custom .NET core assembly for Tz.Net.
- https://github.com/CodesInChaos/Chaos.NaCl (Ed25519 signature support)
- I had to build and distribute a custom .NET core assembly for Tz.Net.
- https://github.com/Osinko/BigFloat (BigFloat support)
Mark Scappini
Tz.Net is available under the MIT License. Check the LICENSE file for details.