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 🙏

© 2026 – Pkg Stats / Ryan Hefner

opensea-dev-wrapper

v1.2.2

Published

A custom software development kit (SDK) for interacting with original OpenSea SDK, API, or contracts

Readme

opensea-dev-wrapper

A JavaScript software development kit (SDK) for easily interacting with native OpenSea SDK, APIs, or contracts.

Table of Content

Installation

Developers can install opensea-dev-wrapper via yarn (recommended) or npm package managers.

In your project directory, run

yarn add opensea-dev-wrapper

or

npm i opensea-dev-wrapper --save

Getting Started

First, developers use require() to include opensea-dev-wrapper as

const {openseaWrap, apiConfig} = require('opensea-dev-wrapper');

Developers can interact with OpenSea with openseaWrap object and can retieve the built-in default configs of OpenSea native APIs with apiConfig object.

Then, developers can use opensea-dev-wrapper in different ways as described as follows.

Native API

Developers can call any native OpenSea API with nativeApi function defined as

/**
  * Native API
  * @param {any} apiConfig - Default config of native API
  * @param {any} [customParams={}] - Custom parameters of native API
  * @param {any} [apiKey=''] - API key if available
  * @return {any}
  */
  nativeApi(apiConfig, customParams={}, apiKey='');

Developers can get the default configs of some OpenSea APIs built-in in opensea-dev-wrapper with apiConfig object as

const testnetTargetApiConfig = apiConfig.testnet.[built-in APIs]; // use apiConfig.mainnet for mainnet

If specific path and query parameters are required, developers can define the customParams object. For example,

const customParams = {
  pathParams: {},
  queryParams: {
    limit: 5,
  },
};

If target API is not built-in in opensea-dev-wrapper, experienced developers can create the config of target API by themself. For example, the config of testnet API (retrieve assets) can be defined as

const testnetRetrieveAssetsConfig =  {
  endpoint: `https://testnets-api.opensea.io/api/v1/assets`,
  pathParams: {},
  queryParams: {
    order_direction: 'desc',
    limit: 20,
    include_orders: false,
  },
},  

A Complete Example of Native API

const {openseaWrap, apiConfig} = require('opensea-dev-wrapper');
const targetApiConfig = apiConfig.testnet.retrieveAssets;

const customParams = {
  pathParams: {},
  queryParams: {
    collection: 'dtg-wounderland',
    limit: 5,
  },
};

async function test() {
  const data = await openseaWrap.testnet.nativeApi(targetApiConfig, customParams);
  console.log(data);
}

test();

Built-in Native API Configs

Wrapped APIs

Developers who focus on target collection can use the wrapped APIs built-in in opensea-dev-wrapper.

To use the wrapped APIs, developers MUST define a wrap config as

const wrapConfig = {
  collection: 'dtg-wounderland',
  contract_address: '0x88b48f654c30e99bc2e4a1559b4dcf1ad93fa656',
  schema: 'ERC1155',
  api_key: '',
  infura_endpoint: '',
};

Then, developers can define specific query parameters if required as

const queryParams = {
  limit: 5
};

Finally, developers can call the wrapped APIs as

async function test() {
  const data = await openseaWrap.testnet.api.getAssetsByCollection(wrapConfig, queryParams);
  console.log(data); 
}

test();

A Complete Example of Wrapped APIs

const {openseaWrap} = require('opensea-dev-wrapper');

const wrapConfig = {
  collection: 'dtg-wounderland',
  contract_address: '0x88b48f654c30e99bc2e4a1559b4dcf1ad93fa656',
  schema: 'ERC1155',
  api_key: '',
  infura_endpoint: '',
};

const queryParams = {
  limit: 5
};

async function test() {
  const data = await openseaWrap.testnet.api.getAssetsByCollection(wrapConfig, queryParams);
  console.log(data); 
}

test();

Built-in Wrapped APIs

  • getAssetsByCollection
  • getAssetById

Custom APIs

Developers can also call the custom APIs built-in in opensea-dev-wrapper. For example, developers can check the ownership with the checkOwnership custom API defined as

/**
  * Mainnet: check if the given account address is the owner of any asset of specified collection or not
  * @param {any} customConfig - Custom config of custom API
  * @param {string} address - Account address
  * @param {any} [retrieveAssetsParams={}] - Custom parameters of native API (retrieveAssets)
  * @param {any} [retrieveAnAssetParams={}] - Custom parameters of native API (retrieveAnAsset)
  * @return {any}
  */
  checkOwnership(customConfig, address, retrieveAssetsParams={}, retrieveAnAssetParams={}) {

To use the custom APIs, developers MUST define a custom config as

const customConfig = {
  collection: 'dtg-wounderland',
  contract_address: '0x88b48f654c30e99bc2e4a1559b4dcf1ad93fa656',
  schema: 'ERC1155',
  api_key: '',
  infura_endpoint: '',
};

Then, developers can call the custom APIs with defined parameters as

const address = '0xCB2DeeF8Bff8f948bA8bA655cc6C81D199Ee3D32';
async function test() {
  const data = await openseaWrap.testnet.custom.checkOwnership(customConfig, address);
  console.log(data); 
}

test();

A Complete Example of Custom APIs

const {openseaWrap} = require('opensea-dev-wrapper');

const customConfig = {
  collection: 'dtg-wounderland',
  contract_address: '0x88b48f654c30e99bc2e4a1559b4dcf1ad93fa656',
  schema: 'ERC1155',
  api_key: '',
  infura_endpoint: '',
};

const address = '0xCB2DeeF8Bff8f948bA8bA655cc6C81D199Ee3D32';
const retrieveAssetsQueryParams = {
  limit: 5,
};

async function test() {
  const data = await openseaWrap.testnet.custom.checkOwnership(customConfig, address, retrieveAssetsQueryParams);
  console.log(data); 
}

test();

Bulit-in Custom APIs

  • getAssetIdsByCollection
  • getOwnerList (CAUTION: it takes time if there are too many tokens in target collection.)
  • checkOwnership (CAUTION: it takes time if there are too many tokens in target collection.)

Release Notes

v1.2.1

August 11, 2022

What's New

  • Improve custom API
    • checkOwnership() now can take short time with OpenSea SDK by providing Infura endpoint in config
  • Package manager change
    • yarn is recommended to install opensea-dev-wrapper

v1.2.0

August 10, 2022

What's New

  • Add native API configs
    • Retrieve collections (mainnet, testnet)
    • Retrieve a collection (mainnet, testnet)
    • Retrieve collection stats (mainnet, testnet)
    • Retrieve a contract (mainnet, testnet)
    • Retrieve bundles (mainnet, tesetnet)
    • Retrieve owners (mainnet, testnet)
  • Add custom API
    • getAssetIdsByCollection (mainnet, testnet)

Bug Fixed

  • getOwnerList and checkOwnership are fixed by fetching all owners (via retrieveOwners native API) instead of top_ownerships (vai retrieveAnAssets native API)

v1.1.0

August 9, 2022

What's New

  • Add native API configs
    • Retrieve assets (mainnet, testnet)
    • Retrieve an asset (mainnet, testnet)
  • Add wrapped APIs
    • getAssetsByCollection (mainnet, testnet)
    • getAssetById (mainnet, testnet)
  • Add custom APIs
    • getOwnerList (mainnet, testnet)
    • checkOwnership (mainnet, testnet)

v1.0.1

August 7, 2022

First release