Quick start

Installing the library

The following instructions assume you have a project already created, and you have npm installed and operable.

$ npm install idena-js

Import the library in your project

import { Idena, LocalKeyStore } from "idena-js";

Configuration

import { Idena, LocalKeyStore } from "idena-js";

const provider = new LocalKeyStore();
const idena = new Idena(provider);

Example

Create random address and import

This will import your private key in memory letting idena object to sign transaction using such key.

const provider = new LocalKeyStore();
const idena = new Idena(provider);

Import private key

This will import your private key in memory letting idena object to sign transaction using such key.

Transfer

The transfer operation requires an idena object with an imported key having some funds.

Wait for transaction mining

When a transaction is injected an Operation object is returned. You can use the confirmation method to wait for an operation confirmation.

Bulk transactions

You can also send more transactions in bulk.

Balance

Following example shows how to retrieve balance and stake (where stake are the balance plus the frozen DNA due staking/mining activity).

Identity

This method returns an Identity object about identity address.

Retrieve address

Retrieve current epoch

Last updated

Was this helpful?