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

@esrevitlu/mkt-client

v1.1.6

Published

## Installation

Readme

@esrevitlu/mkt-client

Installation

yarn add @esrevitlu/mkt-client -S

Getting Started

Instantiate your instance using your ethers provider:

Examples

Through a browser provider (i.e. Metamask)

import { MKT } from "@esrevitlu/mkt-client";
import { ethers } from "ethers";

const provider = new ethers.providers.Web3Provider(window.ethereum);
const mktClient = new MKT(provider);

Use Cases

Listing

const provider = new ethers.providers.Web3Provider((window as any).ethereum);
const signer = provider.getSigner();
const address = await signer.getAddress();
const mkt = new MKT(provider);

const {
  isCollectionApproved,
  actions,
  executeAllActions
} = await mkt.createOrder({
  collection: "", // Collection address
  // (Optional) collectionType: CollectionType.ERC721,
  // (Optional) strategyId: StrategyType.standard,
  // (Optional) subsetNonce: 0, // keep 0 if you don't know what it is used for
  orderNonce: 0, // You need to retrieve this value from the API
  price: ethers.utils.parseUnits("0.001", "ether"), // Be careful to use a price in wei, this example is for 1 ETH
  itemIds: [1], // Token id of the NFT(s) you want to sell, add several ids to create a bundle
  amounts: [1], // Use it for listing multiple ERC-1155 (Optional, Default to [1])
  startTime: Math.floor(Date.now() / 1000), // Use it to create an order that will be valid in the future (Optional, Default to now)
  endTime: Math.floor(Date.now() / 1000) + 3600 // If you use a timestamp in ms, the function will revert
});


// If only get the message for signature
for await (const action of actions) {
  if (action.type === "create") {
    console.log("create order sign msg", await action.getMessageToSign());
  }

  if (action.type === "approval") {
    console.log(
      "approval sign msg",
      await action.transactionMethods.buildTransaction()
    );
  }
}

// Execute all actions, include the all approvals if needed
const order = await executeAllActions();

// *List order through API /order/makerAsk

Buy

import { MKT } from "@esrevitlu/mkt-client";
import { ethers } from "ethers";

const provider = new ethers.providers.Web3Provider((window as any).ethereum);
const mkt = new MKT(provider);

// Get order from API /orders
const { actions, executeAllActions } = await mkt.fulfillOrder(order);
await executeAllActions();


// Buy multiple orders
const { actions, executeAllActions } = await mkt.fulfillOrders(orders);
await executeAllActions();

Cancel

const { call, buildTransaction } = await mkt.cancelOrders([order.orderNonce]);
const res = await call();

// Sign message for canceling
const msg = await buildTransaction();

Check orderNonce (Same as exchange contract function userOrderNonce)

console.log(
  "check userOrderNonce",
  address,
  orderNonce,
  await mkt.userOrderNonce(address, orderNonce)
);

Bid

const {
  maker,
  actions,
  executeAllActions,
  isBalanceSufficient,
  isCurrencyApproved
} = await mkt.createOffer({
  collection: "", // Collection address
  // (Optional) collectionType: CollectionType.ERC721,
  // (Optional) strategyId: StrategyType.standard,
  // (Optional) subsetNonce: 0, // keep 0 if you don't know what it is used for
  orderNonce: 0, // You need to retrieve this value from the API
  price: ethers.utils.parseUnits("0.001", "ether"), // Be careful to use a price in wei, this example is for 1 ETH
  itemIds: [1], // Token id of the NFT(s) you want to sell, add several ids to create a bundle
  amounts: [1], // Use it for listing multiple ERC-1155 (Optional, Default to [1])
  startTime: Math.floor(Date.now() / 1000), // Use it to create an order that will be valid in the future (Optional, Default to now)
  endTime: Math.floor(Date.now() / 1000) + 3600 // If you use a timestamp in ms, the function will revert
});

// Execute all actions, include the all approvals if needed
const order = await executeAllActions();

Accept Bid

Just same as buy(fulfillOrder).

balanceOf

const balance = await mkt.balanceOf();