@iota/client
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-rc.5 • Public • Published

IOTA Client Library - Node.js binding

Node.js binding to the iota.rs client library.

Installation

  • Using NPM:
$ npm i @iota/client
  • Using yarn:
$ yarn add @iota/client

Requirements

One of the following Node.js version: '14.x', '16.x', '18.x'

If there is no prebuilt binary available for your system you need Rust and Cargo, to build it yourself. Install them here. Also for Linux libudev is needed and can be installed with apt install libudev-dev.

Getting Started

After you linked the library, you can create a Client instance and interface with it.

const { Client, initLogger } = require('@iota/client');

async function run() {
    initLogger();

    const client = new Client({
        nodes: ['https://api.testnet.shimmer.network'],
        localPow: true,
    });

    try {
        const nodeInfo = await client.getInfo();
        console.log('Node info: ', nodeInfo);
    } catch (error) {
        console.error('Error: ', error);
    }
}

run().then(() => process.exit());

Readme

Keywords

none

Package Sidebar

Install

npm i @iota/client

Weekly Downloads

26

Version

3.0.0-rc.5

License

Apache-2.0

Unpacked Size

319 kB

Total Files

171

Last publish

Collaborators

  • tuditi
  • msarcevic
  • braniota
  • lmoe
  • domschiener
  • lexerr
  • martyniota
  • nothingismagick
  • laumair
  • iota_ci
  • rubenkoch
  • brord