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

@coinsenda/sdk

v1.6.0

Published

NodeJS SDK for Coinsenda

Readme

@coinsenda/sdk

Node.js SDK for Coinsenda — a crypto exchange platform.

Authentication uses RSA public key signatures. Before calling the SDK you must generate a key pair locally and register the public key in your Coinsenda account profile settings. The private key never leaves your environment.

Installation

npm install @coinsenda/sdk jsonwebtoken node-rsa

Prerequisites

1. Generate an RSA key pair

Create a 2048-bit RSA key pair on your machine. Store the private key securely — you will use it on every login.

const NodeRSA = require('node-rsa');

let key = new NodeRSA({ b: 2048 });
let public_key = key.exportKey('pkcs8-public-pem');
let private_key = key.exportKey('pkcs8-private-pem');

// Save private_key in a secrets manager or env variable — never commit it

You can also generate the pair with OpenSSL:

openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -pubout -out public.pem

2. Register the public key in your Coinsenda account

Sign in to your Coinsenda account and open Profile Settings → API Public Key.

Paste the public key (PEM format) and save. Coinsenda stores it in your profile and uses it to verify future signature-based logins.

This step is required once per key pair. If you rotate keys, register the new public key before authenticating with the new private key.

Authentication

Every session needs:

| Requirement | Description | |-------------|-------------| | Registered public key | Saved in your Coinsenda profile settings | | Private key | Held locally; used to sign the login token |

Full example

const NodeRSA = require('node-rsa');
const jwt = require('jsonwebtoken');
const { CoinsendaClient, isHttpSuccess } = require('@coinsenda/sdk');

async function authenticate(email, private_key_pem) {
  // 1. Create client
  let client = new CoinsendaClient({ domain: 'coinsenda.com' });

  // 2. Sign a short-lived token with your private key
  let rsa_key = new NodeRSA(private_key_pem, 'pkcs8-private-pem');
  let signed_token = jwt.sign(
    { email: email, iat: Math.floor(Date.now() / 1000) },
    rsa_key.exportKey('private'),
    { algorithm: 'RS256', expiresIn: '5m' }
  );

  // 3. Authenticate via POST /auth/pubkey
  let auth_result = await client.auth.passport.authPubkey({
    data: { signed_token }
  });

  if (!isHttpSuccess(auth_result.status)) {
    throw new Error(`Authentication failed: ${auth_result.status}`);
  }

  let response_data = auth_result.data?.data || auth_result.data;
  client.setJwt(response_data.jwt);
  client.setRefreshToken(response_data.refresh_token);

  return client;
}

// Usage
let client = await authenticate('[email protected]', process.env.COINSENDA_PRIVATE_KEY);

let profile = await client.transaction.user.__get__profile();
console.log(profile.data);

Identifier in the signed token

The payload you sign must identify your Coinsenda account:

| Field | When to use | |-------|-------------| | email | Default — matches the email on your Coinsenda account | | userId | When you know your Coinsenda user ID | | phone_number | Phone-based accounts |

Always include iat (issued-at timestamp). The token expires after 5 minutes — generate a new one for each login attempt.

Environment

// Production
new CoinsendaClient({ domain: 'coinsenda.com' });

// Staging
new CoinsendaClient({ domain: 'bitsenda.com' });

// Local development (requires config/environments.local.js)
new CoinsendaClient({ environment: 'local' });

Copy config/environments.local.example.js to config/environments.local.js and adjust ports if needed.

Calling endpoints

After authentication, all requests include Authorization: Bearer <jwt> automatically.

Methods follow client.{service}.{model}.{method}(data):

await client.account.user.__get__accounts();
await client.deposit.user.__get__deposits();
await client.withdraw.withdraw.addNewWithdrawPublic({ ... });

Responses are raw server objects: { status, data, headers }. Use isHttpSuccess(result.status) to check for 2xx.

License

Apache-2.0