How to use KleverChain (SDK)

The Klever Blockchain SDK is your ultimate solution for building decentralized applications with ease. Whether you are a frontend or backend developer, the Klever Blockchain SDK has you covered.

1. Installation

				
					$ npm install @klever/sdk
				
			

With support for popular programming languages such as JavaScript, Go Lang, and .NET, the Klever Blockchain SDK makes it easy for you to start building your next big idea. Visit docs.klever.finance for more tutorials or join our dev channel on slack.

2. Create Account

				
					//import the sdk
var sdk = require("@klever/sdk");

//create a new klever account for klv and kda tokens
var klvAccount = await sdk.utils.generateKeyPair()

//check your private key and addresss
console.log(klvAccount)
				
			

3. Make a Transaction

				
					import { Account, TransactionType } from "@klever/sdk";

const payload = {
    amount // The amount of KLV to be transferred
    receiver, // The address of the receiver
    kda: "KLV", // The symbol for the KLEVER token or your token id
}

const privateKey = "yourPrivateKey";

const account = new Account(privateKey);

await account.ready;

const broadcastRes = await account.quickSend([
    {
        payload, // The transaction payload
        type: TransactionType.Transfer, // The type of transaction is a transfer
    },
]);