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

mr-gem-sdk

v0.0.5-rc.33

Published

SDK providing access to Gem infrastructure, MomentRanks fork

Readme

gem-sdk

npm install gem-sdk
const web3Provider = new Web3(window.ethereum);

const gemInstance = new Gem(web3Provider);

Test Cases

fork mainnet
ganache-cli --fork https://mainnet.infura.io/v3/infuraid

rename .env.example to .env and input required fields

npm test

batchBuyNft

const account = senders wallet address;

const paymentToken = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; // ethereum
or
const paymentToken = "0x6B175474E89094C44Da98b954EedeAC495271d0F"; // dai

in case of dai it will automatically approve dai.
in case of both eth and dai it will automatically check users balance.
you can use any currency the function will manage.

single asset buying

await gemNewInstance.batchBuyNfts(account, paymentToken, [
     {
          standard: "ERC1155",
          address: "0xa342f5d851e866e18ff98f351f2c6637f4478db5",
          tokenId:
            "53343204100803765692379285688171671302437967278842259121980540727210832568320",
          amount: 1,
     }
]);

multiple asset buying (single transaction)

await gemNewInstance.batchBuyNfts(account, paymentToken, [
      {
        standard: "ERC721",
        address: "0xf9d53e156fe880889e777392585feb46d8d840f6",
        tokenId: "993",
        amount: 1,
      },
      {
        standard: "ERC721",
        address: "0xf9d53e156fe880889e777392585feb46d8d840f6",
        tokenId: "3167",
        amount: 1,
      },
      {
        standard: "ERC721",
        address: "0xf75140376d246d8b1e5b8a48e3f00772468b3c0c",
        tokenId: "7085",
        amount: 1,
      },
      {
        standard: "ERC721",
        address: "0xe5545fa0636a82c0b37c7db62e2104e69a11d062",
        tokenId: "642",
        amount: 1,
      },
 ]);


await gemNewInstance.batchBuyNfts(account, paymentToken, [
      {
        standard: "ERC1155",
        address: "0x76be3b62873462d2142405439777e971754e8e77",
        tokenId: "10172",
        amount: 2,
      },
      {
        standard: "ERC1155",
        address: "0x76be3b62873462d2142405439777e971754e8e77",
        tokenId: "10391",
        amount: 2,
      },
      {
        standard: "ERC1155",
        address: "0x28472a58a490c5e09a238847f66a68a47cc76f0f",
        tokenId: "0",
        amount: 2,
      },
      {
        standard: "ERC721",
        address: "0xf9d53e156fe880889e777392585feb46d8d840f6",
        tokenId: "993",
        amount: 1,
      },
      {
        standard: "ERC721",
        address: "0xf9d53e156fe880889e777392585feb46d8d840f6",
        tokenId: "3167",
        amount: 1,
      },
      {
        standard: "ERC721",
        address: "0xf75140376d246d8b1e5b8a48e3f00772468b3c0c",
        tokenId: "7085",
        amount: 1,
      },
      {
        standard: "ERC721",
        address: "0xe5545fa0636a82c0b37c7db62e2104e69a11d062",
        tokenId: "642",
        amount: 1,
      },
]);

refer to this doc to use these ahead functions in detailed manner

https://drive.google.com/file/d/1YwZ7nradT_iS-BRNtz3EIdLAVBQav9Xq/view

getNftData

const data = await gemInstance.getNftData({
      nftAddress: "0x28472a58a490c5e09a238847f66a68a47cc76f0f",
      nftId: "0",
});

const fields = {
        name: 1,
        symbol: 1,
        standard: 1,
        description: 1,
        address: 1,
        createdDate: 1,
        externalUrl: 1,
        imageUrl: 1,
        totalSupply: 1,
        sevenDayVolume: 1,
        oneDayVolume: 1,
        stats: 1,
        traits: 1,
        indexingStatus: 1,
        discordUrl: 1,
        instagramUsername: 1,
        isVerified: 1,
        lastNumberOfUpdates: 1,
        lastOpenSeaCancelledId: 1,
        lastOpenSeaSaleCreatedId: 1,
        lastOpenSeaTransferId: 1,
        lastRaribleAssetUpdateId: 1,
        mediumUsername: 1,
        telegramUrl: 1,
        twitterUsername: 1,
        updatedAt: 1,
        wikiUrl: 1,
      }

getCollectionData


 sdk is using this api from the doc

 https://gem-public-api.herokuapp.com/collections

 const data = await gemInstance.getCollectionData({
      sort: { sevenDayVolume: 1 },
      limit: 1,
      fields: fields, // by default if you dont have fileds key in object it will take automatically take above fields object
    });

getFilteredData


the sdk is using this api https://gem-public-api.herokuapp.com/collections with filter field is here

const data = await gemInstance.getCollectionData({
      filters: { address: "0x50f5474724e0ee42d9a4e711ccfb275809fd6d4a" },
      limit: 1,
      fields: fields,
    });

    const data = await gemInstance.getCollectionData({
      sort: { sevenDayVolume: 1 },
      filters: { searchText: "bored" },
      limit: 1,
      fields: fields,
    });
const assetFields = {
    "id": 1,
    "name": 1,
    "address": 1,
    "collectionName": 1,
    "collectionSymbol": 1,
    "externalLink": 1,
    "imageUrl": 1,
    "smallImageUrl": 1,
    "animationUrl": 1,
    "standard": 1,
    "decimals": 1,
    "market": 1,
    "currentBasePrice": 1,
    "paymentToken": 1,
    "marketUrl": 1,
    "marketplace": 1,
    "tokenId": 1,
    "priceInfo": 1,
    "tokenReserves": 1,
    "ethReserves": 1,
    "url": 1,
    "sellOrders": 1
};

getAssetData


the sdk is using this api https://gem-public-api.herokuapp.com/assets from the doc

const data = await gemInstance.getAssetData({
      filters: {
        address: "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
      },
      // { "field name": "asc" or "desc"}, you can sort by multiple fields
      sort: { currentEthPrice: "asc" },
      // { "field name": 1 (include field) or -1 (ignore field) }
      fields: assetFields, // by default if you dont have fileds key in object it will take automatically take above assetFields object
      limit: 10,
      offset: 0,
      markets: ["opensea", "rarible", "nftx", "nft20","larvalabs"],
    });