Blockcoli.Libra.Net 0.7.4

dotnet add package Blockcoli.Libra.Net --version 0.7.4
NuGet\Install-Package Blockcoli.Libra.Net -Version 0.7.4
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="Blockcoli.Libra.Net" Version="0.7.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blockcoli.Libra.Net --version 0.7.4
#r "nuget: Blockcoli.Libra.Net, 0.7.4"
#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 Blockcoli.Libra.Net as a Cake Addin
#addin nuget:?package=Blockcoli.Libra.Net&version=0.7.4

// Install Blockcoli.Libra.Net as a Cake Tool
#tool nuget:?package=Blockcoli.Libra.Net&version=0.7.4

Blockcoli.Libra.Net

Libra Wallet SDK for .NET

Blockcoli is an open source project which is the world 1st .NET SDK for creating Libra wallet. It is hosted on Github repository and also built as a Nuget package.

What's New

  • Update Proto file

Installation

To install the nuget package from a command line, run:

dotnet add package Blockcoli.Libra.Net

Or from Visual Studio Package Manager Console

Install-Package Blockcoli.Libra.Net

Usage

At the top of your class file, add using for two namespaces.

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

Creating an account

In order to create a libra account, you would need to instantiate the LibraWallet as shown in the following code example:

// Create a new wallet
var wallet = new LibraWallet();

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

// Mnemonic words (secret) for recovering wallet
var mnemonic = wallet.Mnemonic;
Console.WriteLine(mnemonic);

// Get your account address
Console.WriteLine(account.Address);

Recovering an account

In order to create a libra account, you would need to instantiate the LibraWallet as shown in the following code example:

// Recovering a wallet with mnemonic words (secret)
var mnemonic = "elite kidney kangaroo enhance list mule paddle arrange popular frown ahead carry endorse thunder toy broken absorb level surprise arrow analyst segment wave fat";

// Create a wallet
var wallet = new LibraWallet(mnemonic);

// Recover an Account
var account = wallet.NewAccount();

// Get your account address
Console.WriteLine(account.Address);

Minting an amount

To mint an amount, you would 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 checking multiple addresses.
var accountState = await client.QueryBalance(account.Address);
Console.WriteLine(accountState.Balance);

Transferring Libra coins

// You can use parameter array for checking multiple addresses.
var sender = wallet.Accounts.ElementAt(0).Value;
var receiverAddress = "face4412ab3325cf6e26624cff089eb1bf8ec6da489f05aad72a81de5ff7b5d1";
var amount = 10000000UL;
var success = await client.TransferCoins(sender, receiverAddress, amount);
Console.WriteLine($"AC Status: {success}");

License

MIT License Copyright (c) 2019 Blockcoli

Official website

blockcoli.com

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.7.4 707 2/3/2020
0.7.3 449 1/16/2020
0.7.2 435 1/14/2020
0.7.1 494 1/2/2020
0.7.0 466 12/18/2019
0.6.0 446 10/31/2019
0.5.0 488 9/30/2019
0.4.0 453 9/10/2019
0.3.0 499 8/26/2019
0.2.0 485 8/25/2019
0.1.0 511 8/20/2019

Update Proto file