Skip to content
NodeJs lib for IOTA Tangle
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
src
test
.gitignore
.npmrc
LICENSE
README.md
_config.yml
package-lock.json
package.json

README.md

IOTAPAY

GitHub package.json version License: MIT node npm Dependency Status DevDependency Status GitHub code size in bytes

NPM

Join Discord Follow on Twitter

NodeJs library to Pay using IOTA

Setup

Install the library npm install iotapay

Import package: require('iotapay');

Initialize:

new IOTAPAY({
    host : 'http://node06.iotatoken.nl:14265'
});

Basic functions

Initialize:

Initialize the iotapay object.

const iotapay = new IOTAPAY();

Set Host manually like this:

iotapay.setHost('http://node06.iotatoken.nl:14265');

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

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


Get Balance:

Retrieve Balance

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


Pay:

Transfer iota as payment.

iotapay.transfer({
    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.

You can’t perform that action at this time.