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

crypto-assets

v0.0.1

Published

Fetch all your crypto assets at once

Readme

CircleCI (eslint)

Crypto Assets

Presentation

Crypto Assets is a js library that allows to retrieve your cryptocurrency assets from several places. This idea came from the need for me to keep a track of where my assets are. Some are on several exchanges, some on wallets. It became complicated to know exactly where everything is.

In opposition to some tools where you declare where your assets are (like Blockfolio, which is really nice), Crypto Assets queries a list of exchanges with your (READ ONLY) API keys or wallet addresses through coin explorers. Thus, when you buy or sell an asset on an exchange, it will automatically be reported by Crypto Assets. Once you have made your config with the exchanges or wallets you usually use, everything is automatic.

Installation

First checkout locally and install deps:

yarn add crypto-assets

or

npm install --save crypto-assets 

Usage

This example file show how to use it :

const cryptoAssets = require('crypto-assets');

const config = {
  "fiat": "eur",
  "wallets": {
    "eth": ["0xB277E6188b189c22853E9CdB13852597E77E8876"],
    "sc": ["c258335d4b6196c9eb7f3481dc18d8c85f7f8d18cbcc49d8c089554db4ce7632b7d4e985d916"]
  },
  "markets": {
    "bitfinex": {
      "key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    "poloniex": {
      "key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  }
};

cryptoAssets(config).then((assets) => {
  console.log(assets);

  let sum = assets.reduce((c, b) => c + b.eur, 0);
  sum = Math.round(sum * 100) / 100;

  console.log(`Total ${sum} €`);
});

Explanation of the config var :

  • The fiat key indicates in wich fiat currency the Crypto Assets should convert every asset. So far it works with with eur and usd.
  • The wallets key list all wallets addresses you have by currency.
  • The markets key list all markets where you have some assets. For each market you have to specify the api key and secret. Even if you run this script locally on your machine, I recommend to use READ ONE api keys.

This program will output :

[ { locationType: 'exchange',
    locationCode: 'bitfinex',
    currency: 'btc',
    volume: 0.25638038,
    eur: 588.7416494168001 },
  { locationType: 'exchange',
    locationCode: 'bitfinex',
    currency: 'iot',
    volume: 220,
    eur: 46.882000000000005 },
  { locationType: 'exchange',
    locationCode: 'bitfinex',
    currency: 'xrp',
    volume: 300,
    eur: 39.900000000000006 },
  { locationType: 'exchange',
    locationCode: 'poloniex',
    currency: 'btc',
    volume: 0.00940004,
    eur: 21.5858758544 },
  { locationType: 'exchange',
    locationCode: 'poloniex',
    currency: 'eth',
    volume: 0.41570815,
    eur: 64.368249946 },
  { locationType: 'exchange',
    locationCode: 'poloniex',
    currency: 'ltc',
    volume: 10.6451823,
    eur: 356.40070340399996 },
  { locationType: 'exchange',
    locationCode: 'poloniex',
    currency: 'sc',
    volume: 1704.14993461,
    eur: 11.07527042503039 },
  { locationType: 'wallet',
    locationCode: '0xB277E6188b189c22853E9CdB13852597E77E8876',
    currency: 'eth',
    volume: 0.296407175,
    eur: 45.895686977000004 },
  { locationType: 'wallet',
    locationCode: 'c258335d4b6196c9eb7f3481dc18d8c85f7f8d18cbcc49d8c089554db4ce7632b7d4e985d916',
    currency: 'sc',
    volume: 500.22740098590094,
    eur: 3.2509778790073702 } ]
Total 1178.1 eur

Contribution

Feel free to contribute to this project by adding more exchanges and wallets. Take a look at src/exchanges/bitfinex.js or src/wallets/eth.js to see how it works.

You dont know how to contribute ? Here is a guide that explains how to contribute to a github project.

While there is no unit testing yet, your code should pass the linter :

> yarn run lint
> (or npm run lint)

yarn run v0.24.6
$ eslint --ext .js index.js src 
Done in 1.90s