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

nft-aggregator

v1.2.0

Published

nft-aggregator is a SDK built to fetch NFT metadata from world-renowed NFT marketplaces over EVM-compatible blockchains.

Downloads

22

Readme

nft-aggregator

Developed by: Jay Rank

Introduction

nft-aggregator is a SDK built to fetch NFT metadata from world-renowed NFT marketplaces over EVM-compatible blockchains.

For installation, refer here or run the following command in your node project.

npm install nft-aggregator

How to use

1. Using Rarible Aggregator for fetching MetaData

This class returns the value of NFT MetaData from Rarible NFT Marketplace with respective endpoint requests.

  • Use this class when you simply want to fetch any suitable aggregation data from Rarible.
const Aggregator = require('nft-aggregator');

let networkName = 'mainnet'; // Works on 'mainnet', 'rinkeby', 'ropsten' network over EVM.
let APIKey = null; // Enter your API Key here only if you wish to use Opensea Class, not required in case of Rarible Class.

async function getNftMetadata(networkName, APIKey) {
	nftMetadata = await new Aggregator(networkName, APIKey).Rarible.getNftItemById('0x6ede7f3c26975aad32a475e1021d8f6f39c89d82:102269783871445009689193659504668254296443359178228669659681116260700662094166');
	console.log(nftMetadata);
}


getNftMetadata();
  • Reference for available functions under Rarible

    getNftItemById(itemID)		// itemID = '0x6ede7f3c26975aad32a475e1021d8f6f39c89d82:102269783871445009689193659504668254296443359178228669659681116260700662094166'
    getNftItemByOwner(ownerAddress)		// ownerAddress = '0xe21aa579a784d7903833c9392679c44d20fd5582'
    getNftItemByCreator(ownerAddress)		// ownerAddress = '0xe21aa579a784d7903833c9392679c44d20fd5582'
    getNftItemByCollection(collectionID)		// collectionID = '0xda38e3cf623793fa46277773bbc5def9ad435c06'
    getNftCollectionById(collectionID)		// collectionID = '0xda38e3cf623793fa46277773bbc5def9ad435c06'
    getNftCollectionsByOwner(ownerAddress)		//ownerAddress = '0x2e3afad5fc47f686ccf2a46443fafa8ab4730b48'
    getSellOrderByMakerAndByStatus(ownerAddress)		// ownerAddress = '0xe21aa579a784d7903833c9392679c44d20fd5582'
    getSellOrderByItemAndByStatus(itemNumber, contractAddress)		// itemNumber = '0x6ede7f3c26975aad32a475e1021d8f6f39c89d82', contractAddress = '102269783871445009689193659504668254296443359178228669659681116260700662094166'
    getSellOrderByCollectionAndByStatus(collectionID)		// collectionID = '0xda38e3cf623793fa46277773bbc5def9ad435c06'
    getOrderBidsByMakerAndByStatus(ownerAddress)		// ownerAddress = '0xe21aa579a784d7903833c9392679c44d20fd5582'
    getOrderBidsByItemAndByStatus(itemNumber, contractAddress)		// itemNumber = '0x6ede7f3c26975aad32a475e1021d8f6f39c89d82', contractAddress = '102269783871445009689193659504668254296443359178228669659681116260700662094166'
    getAllCollections(blockchainName)		// blockchainName = 'ETHEREUM', 'TEZOS', etc.
  • Reference for available paramter schema under Rarible

    • itemID: String
    • ownerAddress: String
    • collectionID: String
    • itemNumber: String
    • contractAddress: String
    • blockchainName: String (ALL CAPITAL LETTERS)
    • NOTE HERE:> itemID == contractAddress + ':' + itemNumber

2. Using Opensea Aggregator for fetching MetaData

This class returns the value of NFT MetaData from Opensea NFT Marketplace with respective endpoint requests.

  • Use this class when you simply want to fetch any suitable aggregation data from Opensea.
const Aggregator = require('nft-aggregator');

let networkName = 'mainnet'; // Works on 'mainnet', 'rinkeby', 'ropsten' network over EVM.
let APIKey = null; // Enter your API Key here only if you wish to use Opensea Class, required in case of Opensea Class.

async function getNftMetadata(networkName, APIKey) {
	nftMetadata = await new Aggregator(networkName, APIKey).Opensea.getNftItemById('0', '0xa411c4df63bb82d520ea5caca21be754a8290c83');
	console.log(nftMetadata);
}


getNftMetadata();
  • Reference for available functions under Opensea

    getNftItemById(tokenID, assetContractAddress)		// tokenID = '0', assetContractAddress = '0xa411c4df63bb82d520ea5caca21be754a8290c83'
    getNftItemsById(ownerAddress, tokenId, assetContractAddress, collectionAddress)		// assetContractAddress = '0x697d6736c4cb5be9a1ae5d9f82609051d97fe853'
    getNftItemByCollections(ownerAddress)		// ownerAddress = '0x6e5c7b954ccf4d3c070a1c50a6a624cc8cc8a61b'
    getNftItemByCollection(collectionSlug)		// collectionSlug = 'test-horses-dzuo9jwrhe'
    getNftStatsByCollection(collectionSlug)		// collectionSlug = 'test-horses-dzuo9jwrhe'
    getNftOrdersById(tokenID, assetContractAddress)		// tokenID = '0', assetContractAddress = '0xa411c4df63bb82d520ea5caca21be754a8290c83'
    getAllCollections()
    getNftItemByContract(assetContractAddress)		// assetContractAddress = '0xa411c4df63bb82d520ea5caca21be754a8290c83'
    getNftOffersById(tokenID, assetContractAddress)		// tokenID = '0', assetContractAddress = '0xa411c4df63bb82d520ea5caca21be754a8290c83'
    getNftOrdersById(tokenID, assetContractAddress)		// tokenID = '0', assetContractAddress = '0xa411c4df63bb82d520ea5caca21be754a8290c83'
  • Reference for available paramter schema under Opensea

    • tokenID: String
    • assetContractAddress: String
    • ownerAddress: String
    • collectionSlug: String

2. Using Mintable Aggregator for fetching MetaData

This class returns the value of NFT MetaData from Mintable NFT Marketplace with respective endpoint requests.

  • Use this class when you simply want to fetch any suitable aggregation data from Mintable.
const Aggregator = require('nft-aggregator');

let networkName = 'mainnet'; // Works on 'mainnet', 'rinkeby', 'ropsten' network over EVM.
let APIKey = null; // Enter your API Key here only if you wish to use Opensea Class, required in case of Opensea Class.

async function getNftMetadata(networkName, APIKey) {
	nftMetadata = await new Aggregator(networkName, APIKey).Mintable.getGaslessNftItemByOwner('0x02A522D98EC2D2c3bBe91AcC29ee7fD32ab880ab');
	console.log(nftMetadata);
}


getNftMetadata();
  • Reference for available functions under Mintable

    getGaslessNftItemByOwner(ownerAddress)		// ownerAddress = '0x02A522D98EC2D2c3bBe91AcC29ee7fD32ab880ab'
    getSellingNftItem(category, ownerAddress, auction, orderByDate, size, network)		// category = 'art', ownerAddress = '0x60e5f59C480442c69f6Cc853c39E3D3a702Add9C', auction = '', orderByDate = '', size = '', network = ''
    getNftItemById(itemID)		// itemID = 'TH3JgTVs0DZLcQl'
    getNftAuctionEndingSoon()
    getHotNftAuctions()
  • Reference for available paramter schema under Opensea

    • itemID: String
    • auction: Boolean
    • ownerAddress: String
    • orderByDate: Boolean
    • size: Integer
    • network: Integer