Skip to content

klever-io/klever.net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Klever .NET SDK

Overview

The Klever .NET SDK is a library for integrating with the Klever blockchain, enabling you to create, sign, send, and decode transactions, as well as interact with smart contracts. The project is organized into three main directories:

Using the Klever .NET SDK in Your Project

1. Add the SDK to Your Project

Clone or add the kleversdk library to your .NET solution.

2. Import the SDK Namespaces

using kleversdk.core;
using kleversdk.provider;

3. Initialize and Use SDK Features

You can use the SDK to interact with the Klever blockchain. For example, to create a wallet, query an account, and send a transaction:

// Initialize provider for TestNet
var kp = new KleverProvider(new NetworkConfig(Network.TestNet));

// Create wallet from mnemonic
var mnemonic = "word1 word2 ...";
var wallet = Wallet.DeriveFromMnemonic(mnemonic);
var acc = wallet.GetAccount();

// Sync account data
await acc.Sync(kp);

// Send a transaction
var tx = await kp.Send(acc.Address.Bech32, acc.Nonce, "recipient_address", 100);
var decoded = await kp.Decode(tx);
var signature = wallet.SignHex(decoded.Hash);
tx.AddSignature(signature);
var broadcastResult = await kp.Broadcast(tx);
Console.WriteLine($"Broadcast result: {broadcastResult.String()}");

Examples

The demo directory provides runnable examples that demonstrate how to use the Klever .NET SDK for different blockchain operations. Here are some of the included examples:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages