Introducing Libra Wallet SDK for .NET

Blockcoli Open-Source Project release .NET SDK for Libra Wallet creating on Github repository and build to Nuget package manager. You can contribute project and join social community from link below.

.Blockcoli.Libra.Net

This library build from .NET Standard 2.0 and .NET Core 2.2 dependencies package with Google.Protobuf, Grpc and use Elliptic-curve cryptography by PeterWaher

Installation

To install with nuget run:

dotnet add package Blockcoli.Libra.Net

Usage

Using two namespaces

using Blockcoli.Libra.Net.Wallet;
using Blockcoli.Libra.Net.Client;

Creating Account

In order to create a libra account, you would need to instantiate the LibraWallet like:

// Creating a new Wallet
var wallet = new LibraWallet();

// Generate a new Account
var account = wallet.NewAccount();

// you can see your address by:
Console.WriteLine(account.Address);

Minting Account

To mint you need to create a LibraClient and use it to mint

// Currently minting only works for testnet and uses the faucet service.
var client = new LibraClient(LibraNetwork.Testnet);

// Mint amout in Micro-Libra. (1 Libra = 1000000 Micro-Libra)
var sequenceNumber = await client.MintWithFaucetService(account.Address, 1000000);

Checking an address balance

// You can use parameter array for check multiple address.
var accountStates = await client.QueryBalance(account.Address);
Console.WriteLine(accountStates[0].Balance);

Related projects

  • Libra Core by perfectmak
  • Libra Core by kulapio
  • Elliptic-curve cryptography by PeterWaher
1 Like