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 🙏

© 2024 – Pkg Stats / Ryan Hefner

digiasset-lookup

v1.1.3

Published

Lookup tools to help with DigiByte DigiAssets

Downloads

30

Readme

digiasset-lookup

Serverless way to lookup digiasset and digibyte data. Below are instructions on how to get your access keys.

Installation

npm install digiasset-lookup

IPFS(Needed for getVote):

  1. Follow instructions at https://docs.ipfs.io/install/ipfs-desktop/
  2. Forward port 4001 to this machine
  3. If planning to run this all the time you may want to set IPFS to run on boot. In linux I did that by running crontab -e and adding @reboot /usr/local/bin/ipfs daemon

AWS S3 API Key(Needed for all commands):

  1. Create an account at https://aws.amazon.com/
  2. Services->IAM
  3. In left column: Policies
  4. Blue Create policy button
  5. JSON
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "s3:GetObjectAcl",
                "s3:GetObject",
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::*/*",
                "arn:aws:s3:::chaindata-digibyte"
            ]
        }
    ]
}
  1. Blue Review policy button
  2. name: digiassetX_data
  3. Blue Create policy
  4. In left Column: Groups
  5. Blue Create Group Button
  6. Group Name: digiassetX_data
  7. Type digi into search then select digiassetX_data
  8. Blue Next Step Button
  9. Blue Create Group Button
  10. On left panel select Users
  11. Blue add user button
  12. user name: digiassetX_data
  13. Select: Programmatic access
  14. Blue Next: Permissions button
  15. select: digiassetX_data
  16. Blue Next: Tags button
  17. Blue Next: Review button
  18. Blue Create user button
  19. Copy Access key ID and Secret access key into config/config.js
  20. click Close(make sure you have copied keys there will not be a second chance.

Usage

//initialize
const lookup=require('digiasset-lookup');
lookup.initS3({
    accessKeyId:    'Your AWS S3 API Access Key',
    secretAccessKey:'Your AWS S3 API Secret Access Key'
});

//get an addresses data
let addressData=await lookup.getAddress('dgb1qunxh378eltj2jrwza5sj9grvu5xud43vqvudwh');
console.log(addressData);

//get if an address is KYC verified
let kycData=await lookup.getKYC('DSXnZTQABeBrJEU5b2vpnysoGiiZwjKKDY');
console.log(kycData);

//gets an assets rules
let rules=await lookup.getRules('Ua9hJ3q7zKnaRZS9E5frb3Ukon6aBNNgxLX3i5');
console.log(rules);

//get an exchange rate
let numberOfDGBsatsToEqual1DolarCanadian=await lookup.getExchangeRate({
    address: "dgb1qunxh378eltj2jrwza5sj9grvu5xud43vqvudwh",
    index:   0,
    name:    "CAD"
});
console.log(numberOfDGBsatsToEqual1DolarCanadian);