Skip to content

michielpost/NanoRPC

Repository files navigation

Build .NET

NanoRPC

Nano RPC Client and Nano Wallet library in C#

Easily communicate with a Nano Node using C# This library includes a programmable wallet to easily receive and send Nano. It can be used in ASP.Net, Desktop apps and also in the browser using Blazor WebAssembly.

Donation address: nano_14ezmbmoj5zqzoj7g99bec1rfr7woe1d7bsa87wmsbfpt4u4mnur8183oqtm

Live Blazor WebAssembly Wallet Demo

How To install?

Download the source from GitHub or get the compiled assembly from NuGet NanoRPC on NuGet.

Example Usage

var client = NanoClient.GetClient("http://url_to_nano_node:port");

var balanceResult = await _client.AccountBalance(new AccountBalanceRequest() { Account = "xrb_1cyca8x1u4bdi3m6aqjx1ouwayrnais7aucc33w9zxdtrwqaoxdt8yfdzm94" });

Wallet

var client = NanoClient.GetClient(A"http://url_to_nano_node:port");
var manager = new NanoAccountManager(client, "nano_default_representative_address", "HEX SEED STRING");
var wallet = manager.GetNanoWallet(i);

var balance = await wallet.GetBalanceAsync();

//Send Nano
await wallet.SendNano("To Address", amount);

Supported RPC methods

All RPC methods are supported.
List of RPC methods: https://docs.nano.org/commands/rpc-protocol/

Please create an issue if something is not working as expected. Pull Requests are also welcome!

License

NanoRPC is licensed under MIT. Refer to LICENSE for more information.

Contributions

Contributions are welcome. Fork this repository and send a pull request if you have something useful to add.

Open Source Project Credits

This library uses RestEase https://github.com/canton7/RestEase