Giter Site home page Giter Site logo

slp-balances's Introduction

slp-balances

Returns the address and balance for all holders of a given token

Installation

npm install slp-balances

Usage

getBalances(bitdbApiKey, tokenId)

Returns array of objects containing an address and amount property

const slpBalances = require('slp-balances')

async function main() {
  const bitdbApiKey = 'your_bitdb_api_key'
  const tokenId = 'd7c32d972a21b664f60b5fc422900179d8883dec7bd61418434aa12b09b99c12'

  const balances = await slpBalances.getBalances(bitdbApiKey, tokenId)
  console.log(balances)

  // [
  //   {
  //     address: "bitcoincash:qrxqcmh8ryux52s9uudgs6n2vqlxva2n9c0ygmxtr9",
  //     amount: "1.25"
  //   },
  //   {
  //     address: "bitcoincash:qpj6mrzrygelddyzp978cz379g68ywks9ug7xcpf4s",
  //     amount: "82.75"
  //   },
  //   {
  //     address: "bitcoincash:qq44hua5vzwllg3z0v2v47zqa4d86yqmasl7delpn0",
  //     amount: "6"
  //   },
  //   {
  //     address: "bitcoincash:qpau56wwgyetef54wlxlfdkaqr87kh05mvfqghkz7y",
  //     amount: "2"
  //   },
  //   {
  //     address: "bitcoincash:qrv9s50hk4q8pfhj82mfkuev22f2z5emsgyat52pzq",
  //     amount: "1.5"
  //   },
  //   {
  //     address: "bitcoincash:qqn4tcdqvaz6frepnrymcu4zv34w5kke2ye6txu4rp",
  //     amount: "6.5"
  //   }
  // ]
}

main()

slp-balances's People

Contributors

spendbch avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.