npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

kin-node-callback

v2.0.1

Published

An implementation of the Kin ecosystem SDK for Node.js (https://github.com/kinecosystem/kin-sdk-node)

Readme

kin-node-callback

A callback implementation of the Kin ecosystem SDK for Node.js

Note 1: - this will only work with pre-created accounts (you provide the private key of an on-boarded account).

Note 2: - this uses channels to increase performance, so you need to make sure that only a single instance of a KinAccount is initialized with multiple channel accounts.

Note 3: - You can find a fully implemented version of this code here with instructions of how to implement it yourself on heroku.

Usage

Installation

npm install kin-node-callback

Initializing

Initialize once and use throughout your code

const isProduction = false;
const appID = 'appID';
const KinWrapper = require('./KinWrapper');

//NOTE: store your seed in an environment variable! Below is just an example
const seed = 'SD5A7NFIWBZFMVNH73IORNWEGLEL6FTEHQD6N2HDJEM6RC5UZCIH7YK6';
const salt = 'SAQDKPXW2XC5SCNEADTEH2PHYHP74RWTCJ4MOK573RZINXI5HYIU4XK3';


var kin = new KinWrapper(seed, salt,isProduction,appID);
console.log(kin.account.publicAddress);

kin.sendKin('GC7LPGWEPTC47ENOCWC6B57FT6M6MBHK2ZAKWSAUISQFAEETMSWSUNNI', 10, 'test send', callback);

function callback(err, data) {
    console.log(data);
}

First use

Before calling any functions, you will need to create and fund channels once. This creates 100 channels on Kin's blockchain that the wrapper will use. After this one time creation, you can comment out the code. Create the channels as follows:

kin.CreateChannels(callback);

Calling functions

Synchronous functions

Just call synchronous functions defined in the SDK as follows:

const address = kin.account.publicAddress;

Or

const whitelistedTransaction = kin.account.whitelistTransaction(clientTransaction);

Or

const decodedTransaction = kin.client.decodeTransaction(encodedTransaction);

etc

Asynchronous functions

Check if an account exists

kin.isAccountExisting(address, (err, exists) => {
    if (!err) {
        console.log(exists);
    }
});

Get the minimum fee per transaction

kin.getMinimumFee((err, fee) => {
    if (!err) {
        console.log(fee);
    }
});

Create an account on the blockchain

kin.createAccount(address, startingBalance, memoText, (err, transactionId) => {
    if (!err) {
        console.log(transactionId);
    }
});

Get the balance on an account

kin.getAccountBalance(address, (err, transactionId) => {
    if (!err) {
        console.log(transactionId);
    }
});

Get the data on an account

kin.getAccountData(address, (err, transactionId) => {
    if (!err) {
        console.log(transactionId);
    }
});

Send Kin to a destination

kin.sendKin(destination, amount, memoText,  (err, transactionId) => {
    if (!err) {
        console.log(transactionId);
    }
});

Get the data on a transaction

kin.getTransactionData(transactionId, (err, transactionId) => {
    if (!err) {
        console.log(transactionId);
    }
});

Fund an account with the friendbot (test network)

kin.friendbot(address, ammount,  (err, transactionId) => {
    if (!err) {
        console.log(transactionId);
    }
});

Listening for Kin Payments

These methods can be used to listening for Kin payment that an account or multiple accounts are sending or receiving.

It is possible to monitor multiple accounts using createPaymentListener. This function will continuously get data about all accounts on the blockchain, and you can specify which accounts you want to monitor.

const paymentListener = kin.client.createPaymentListener({
        onPayment: payment => {
            console.log(payment);
        },
        addresses: ['address1', 'address2']
    });

You can freely add accounts to this monitor or remove them:

paymentListener.addAddress('address3');
paymentListener.removeAddress('address1');

Stopping a Monitor

When you are done monitoring, stop the monitor to terminate the connection to the blockchain.

paymentListener.close();