C# library for V Systems
-
To use this SDK, we need .Net framework 4.5.1 or above. If your OS does not have this framework, please download it here.
-
clone this project
$ git clone https://github.com/virtualeconomy/cs-v-sdk.git
-
The external libraries using are under
libs
folder. Here is source code info:-
Blake2Sharp.dll
is from https://github.com/BLAKE2/BLAKE2/tree/master/csharp -
HashLib.dll
is from https://github.com/stratisproject/HashLib
-
-
For testnet chain:
using v.systems; using v.systems.type; ... Blockchain chain = new Blockchain(NetworkType.Testnet, "http://test.v.systems:9922");
-
For mainnet chain:
using v.systems; using v.systems.type; ... Blockchain chain = new Blockchain(NetworkType.Mainnet, "https://wallet.v.systems/api");
-
Create account by seed
using v.systems; using v.systems.type; ... Account acc = new Account(NetworkType.Testnet, "<your seed>", 0);
-
Create account by private key
using v.systems; using v.systems.type; ... Account acc = new Account(NetworkType.Testnet, "<base58 private key>");
-
Create account by public key
using v.systems; using v.systems.type; ... Account acc = new Account(NetworkType.Testnet, "<base58 public key>", null);
-
Create account by address
using v.systems; using v.systems.type; ... Account acc = new Account(NetworkType.Testnet, null, "<base58 address>");
-
Send Payment transaction
long amount = 1 * Blockchain.V_UNITY; // Send 1.0 V coin PaymentTransaction tx = TransactionFactory.BuildPaymentTx("<recipient address>", amount); // Usage 1: for hot wallet sending payment transaction ITransaction result = acc.SendTransaction(chain, tx); // Usage 2: for cold wallet signing payment transaction string signature = acc.GetSignature(tx);
-
Send Lease transaction
long amount = 1 * Blockchain.V_UNITY; // Lease 1.0 V coin LeaseTransaction tx = TransactionFactory.BuildLeaseTx("<recipient address>", amount); // Usage 1: for hot wallet sending lease transaction ITransaction result = acc.SendTransaction(chain, tx); // Usage 2: for cold wallet signing lease transaction string signature = acc.GetSignature(tx);