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 🙏

© 2025 – Pkg Stats / Ryan Hefner

shrimpy-node-temp

v0.0.2

Published

Client for the Shrimpy API

Downloads

4

Readme

shrimpy-node

The official Node.js library for the Shrimpy Developer API https://developers.shrimpy.io/docs

Installation

npm install shrimpy-node

You can learn about the API responses of each endpoint by reading our documentation.

Quick Start

All asynchronous methods return promises.

Promise Example

client
    .getTicker('kucoin')
    .then(data => {
        // do something with the data
    })
    .catch(error => {
         // handle the error
    });

Async Example

The promises can be used as expected in async functions in ES2017+ environments:

async function yourFunction() {
    try {
        const ticker = await client.getTicker('kucoin');
        // do something with the data
    } catch (error) {
        // handle the error
    }
}

Public Client

const Shrimpy = require('shrimpy-node');
const publicClient = new Shrimpy.ShrimpyApiClient();

The public client can only use public methods.

Private Client

const publicKey = 'your_public_key';   // e.g. 12326758a39a720e15d064cab3c1f0a9332d107de453bd41926bb3acd565059e
const privateKey = 'your_private_key'; // e.g. 6991cf4c9b518293429db0df6085d1731074bed8abccd7f0279a52fac5b0c1a8a2f6d28e11a50fbb1c6575d1407e637f9ad7c73fbddfa87c5d418fd58971f829
const Shrimpy = require('shrimpy-node');
const privateClient = new Shrimpy.ShrimpyApiClient(publicKey, privateKey);

The private client can use public and private methods.

Public Methods

const ticker = await client.getTicker(
    'kucoin' // exchange
);

User Methods

const users = await client.getUsers();
const user = await client.getUser(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8' //userId
);
const userId = await client.createUser();
await client.enableUser(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8' //userId
);
await client.disableUser(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8' //userId
);

User API Keys Methods

const publicKeys = await client.getApiKeys(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8' //userId
);
const apiKeys = await client.createApiKeys(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8' // userId
);
const apiKeys = await client.deleteApiKeys(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8',                            // userId
    '51ac18b7d208f59b3c88acbb1ecefe6ba6be6ea4edc07e7a2450307ddc27ab80' // publicKey
);
const permissions = await client.getPermissions(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8',                            // userId
    '51ac18b7d208f59b3c88acbb1ecefe6ba6be6ea4edc07e7a2450307ddc27ab80' // publicKey
);
await client.setPermissions(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8',                             // userId
    '51ac18b7d208f59b3c88acbb1ecefe6ba6be6ea4edc07e7a2450307ddc27ab80', // publicKey
    true,                                                               // enable account methods
    false                                                               // enable trading methods
);

Account Methods

const accounts = await client.getAccounts(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8' // userId
);
const account = await client.getAccount(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123                                     // accountId
);
const accountId = await client.createAccount(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8',                             // userId
    'binance',                                                          // exchange
    'GOelL5FT6TklPxAzICIQK25aqct52T2lHoKvtcwsFla5sbVXmeePqVJaoXmXI6Qd', // publicKey (a.k.a. apiKey)
    'SelUuFq1sF2zGd97Lmfbb4ghITeziKo9IvM5NltjEdffatRN1N5vfHXIU6dsqRQw'  // privateKey (a.k.a. secretKey
);

Note: The createAccount method accepts a fifth optional parameter: passphrase. The passphrase is only required for some exchanges, such as Coinbase Pro.

await client.deleteAccount(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    456                                     // accountId
);

Trading Methods

const balance = await client.getBalance(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123                                     // accountId
);
await client.rebalance(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123                                     // accountId
);
const rebalancePeriodHours = await client.getRebalancePeriod(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123                                     // accountId
);
await client.setRebalancePeriod(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123,                                    // accountId
    24                                      // rebalancePeriod in hours
);
const strategy = await client.getStrategy(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123                                     // accountId
);
await client.setStrategy(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8',                                                                 // userId
    123,                                                                                                    // accountId
    { isDynamic: false, allocations: [{ symbol: 'BTC', percent: '50' }, { symbol: 'ETH', percent: '50' }] } // strategy
);
await client.allocate(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8',                                 // userId
    123,                                                                    // accountId
    { isDynamic: false, allocations: [{ symbol: 'USDT', percent: '100' }] } // strategy
);
const tradeId = await client.createTrade(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123,                                    // accountId
    'BTC',                                  // fromSymbol
    'ETH',                                  // toSymbol
    new Decimal('0.01')                     // amount of fromSymbol
);
const trade = await client.getTrade(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123,                                    // exchangeAccountId
    '72dff099-54c0-4a32-b046-5c19d4f55758'  // tradeId
);
const activeTrades = await client.getActiveTrades(
    '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', // userId
    123,                                    // exchangeAccountId
);