Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including iotapay with all npm packages installed. Try it out:

var iotapay = require("iotapay")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

iotapay v1.2.2

Pay using IOTA


GitHub package.json version License: MIT node npm NPM

NodeJs library to Pay using IOTA


Install the library npm install iotapay

Import package: require('iotapay');


    host : ''

Basic functions


Initialize the iotapay object.

const iotapay = new IOTAPAY();

Set Host manually like this:


or we will find a suitable host for you like this:

iotapay.findHost(function (err, host) {
    if(err) {
        console.log('error:', err);

Get Balance:

Retrieve Balance

iotapay.getBalance(['ADDRESS'], function (err, balance) {
    if(err) {
        console.log('error:', err);
    console.log('balance:', balance);


Transfer iota as payment.

    address: 'ADDRESS',
    value: 1,
    message: 'Testing',
    seed: 'SEED'
}, function (err, result) {
    if(err) {
        console.log('error:', err);
    console.log('result:', result);

Result gives bundle hash.

More Functions coming soon.

NOTE: Please, use proper iota node url, ADDRESS and your SEED to initialise. These are simple dummy values. NOT meant for production usage.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free