This is the Libra C# library which connects to the validator-node through the gRPC. Libra Canonical Serialization (LCS) implemented.
- Clone repository
git clone https://github.com/Rio-dapp/libra-csharp-sdk.git
- Open Example.sln in Visual Studio 2017 or another IDE. This project use .Net Core 2.2
- Select Examples.CLI and press F5.
- Get Account Info
- Get Transactions
- Get Transactions by Seqenc number
- Send Transaction
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);
LibraAdmissionControlService service = new LibraAdmissionControlService("ac.testnet.libra.org",8000);
var address = "0000000000000000000000000000000000000000000000000000000000000000";
AccountStateWithProof account = await service.GetAccountInfoAsync(address);
Console.WriteLine(account.Proof);