Skip to content

Rio-dapp/libra-csharp-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C# SDK for Libra blockchain

This is the Libra C# library which connects to the validator-node through the gRPC. Libra Canonical Serialization (LCS) implemented.

How to use it

  1. Clone repository
git clone https://github.com/Rio-dapp/libra-csharp-sdk.git
  1. Open Example.sln in Visual Studio 2017 or another IDE. This project use .Net Core 2.2
  2. Select Examples.CLI and press F5.

Possibilities

  1. Get Account Info
  2. Get Transactions
  3. Get Transactions by Seqenc number
  4. Send Transaction

Example

Get Account Info as in example below. GetAccountInfoAsync returns CustomAccountResource object. It is processed data.

LibraAdmissionControl service = new LibraAdmissionControl();

var address = "0000000000000000000000000000000000000000000000000000000000000000";
CustomAccountResource account = service.GetAccountInfoAsync(address).Result;
Console.WriteLine(account.Balance);

or

LibraAdmissionControl service = new LibraAdmissionControl();

var address = "0000000000000000000000000000000000000000000000000000000000000000";
CustomAccountResource account = await service.GetAccountInfoAsync(address);
Console.WriteLine(account.Balance);

If you want to get original Raw data use the LibraAdmissionControlService:

LibraAdmissionControlService service = new LibraAdmissionControlService("ac.testnet.libra.org",8000);

var address = "0000000000000000000000000000000000000000000000000000000000000000";
AccountStateWithProof account = await service.GetAccountInfoAsync(address);
Console.WriteLine(account.Proof);

This Sdk is used in the following example:

libraview.org

About

C# sdk for libra blockchain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages