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

sudo-defined-quoter

v1.0.10

Published

Get bids or asks for any NFT collection on sudoswap. Powered by the defined API.

Downloads

20

Readme

sudoswap SDK

Uses the sudoswap Defined API to get bid/asks for any NFT.

The Defined API free tier allows for 50k requests a month. The lib can also be easily forked to support additional data sources (e.g. The Graph, direct on-chain values, etc.)

Install

Published on npm.

npm i sudo-defined-quoter

Usage

Create an instance of Quoter with your Defined API key.

Supports both Mainnet (by default), or Goerli (pass in a value of 5 to the Quoter constructor).

Quoter supports getting instant asks (i.e. prices to buy at) and instant bids (i.e. prices to sell at) for any NFT collection listed on sudoswap v2.

Both getBidQuotes and getAskQuotes have the same function signature:

getBidQuotes(
    address: string, // Required, the NFT collection to get quotes for
    id: string | undefined = undefined, // Optional, for ERC1155 listings, filters by a specific ID
    quoteTokenAddress: string | undefined = undefined // Optional, defaults to ETH pools if undefined, otherwise specify a specific token address for pools listed in that token
  ) 

Simple use case of getting the immediate pools/prices to sell a Remilio NFT:

import { Quoter } from "sudo-defined-quoter";
let q = new Quoter(DEFINED_API_KEY, chainID /* 1 or 5, optional, defaults to 1 for Mainnet */);
let p = await q.getAskQuotes('0xd3d9ddd0cf0a5f0bfb8f7fceae075df687eaebab');

/*
[
  {
    pool: {
      address: '0xcdb8f114d2fb28a4b85bb1ab6e09444006ef5385',
      tokenBalance: 3356524524442673218n,
      spotPrice: 572773849040265576n,
      delta: 1040000000000000000n,
      royalty: 0n,
      nftIds: [Set],
      nftBalance: 9n,
      fee: 20000000000000000n,
      bondingCurveAddress: '0xfa056c602ad0c0c4ee4385b3233f2cb06730334a',
      isETHPool: true,
      tokenAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
      poolType: 1
    },
    quote: 558454502814258937n
  },
  {
    pool: {
      ...
    },
    quote: 565156442280810239n
  }
]

*/