Iota.js
IOTA JavaScript
Install / Use
/learn @iotaledger-archive/Iota.jsREADME
iota.js
This library is functionally complete, but it is recommended to use iota.rs. The rust library will be more heavily maintained and is more performant.
Mono-repo containing client and supporting packages for the IOTA chrysalis network, implemented in TypeScript to strongly type the objects sent and received from the API.
Runs in both NodeJS and Browser environments.
Prerequisites
npm install @iota/iota.js
Example
const { SingleNodeClient } = require("@iota/iota.js");
async function run() {
const client = new SingleNodeClient("https://chrysalis-nodes.iota.org");
const info = await client.info();
console.log("Node Info");
console.log("\tName:", info.name);
console.log("\tVersion:", info.version);
console.log("\tIs Healthy:", info.isHealthy);
console.log("\tNetwork Id:", info.networkId);
console.log("\tLatest Milestone Index:", info.latestMilestoneIndex);
console.log("\tConfirmed Milestone Index:", info.confirmedMilestoneIndex);
console.log("\tPruning Index:", info.pruningIndex);
console.log("\tFeatures:", info.features);
console.log("\tMin PoW Score:", info.minPoWScore);
}
run()
.then(() => console.log("Done"))
.catch((err) => console.error(err));
Packages
For more details on the main package see @iota/iota.js.
Other packages within the framework are.
- @iota/util.js - Utility classes and methods.
- @iota/crypto.js - Cryptographic implementations.
- @iota/mqtt.js - MQTT Client.
- @iota/pow-neon.js - PoW as a multi-threaded Neon Rust binding.
- @iota/pow-node.js - PoW as a multi-threaded node module.
- @iota/pow-wasm.js - PoW as a multi-threaded WASM module.
Examples
Please find other examples in the ./packages/iota/examples folder.
- Simple - Performs basic API operations.
- Address - Demonstrates address generation from a Bip39 mnemonic seed using raw and Bip32 path methods.
- Transaction - Demonstrates how to send a transaction and call some of the other higher level functions.
- Data - Storing and retrieving data on the tangle.
- Browser - Demonstrates direct inclusion and use of the library in an html page.
- Peers - Demonstrates peer management.
- Pow - Demonstrates using one of the other PoW packages.
Supporting the project
If the iota.js has been useful to you and you feel like contributing, consider submitting a bug report, feature request or a pull request.
See our contributing guidelines for more information.
Joining the discussion
If you want to get involved in the community, need help with getting set up, have any issues or just want to discuss IOTA, feel free to join our Discord.
License
The separate packages all contain their own licenses.
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
