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

@blockydevs/arns-marketplace-data

v0.2.0

Published

Data and utility library for interacting with the ArNS Marketplace, including hooks, contexts, data-fetching logic, and formatting utilities.

Downloads

21

Readme

@blockydevs/arns-marketplace-data

A data and utility library for working with the ArNS Marketplace on ar.io: discover listings, correlate them with Arweave Name Tokens (ANTs), and perform actions (create/buy/bid/settle/cancel) via AO messages.

Table of Contents

Installation

Requires Node >= 18

pnpm add @blockydevs/arns-marketplace-data @ar.io/sdk @permaweb/aoconnect arweave-graphql bignumber.js

Quick Start

import { fetchActiveListings } from '@blockydevs/arns-marketplace-data';
import { connect } from '@permaweb/aoconnect';

const ao = connect();

const listings = await fetchActiveListings({
  ao,
  marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>',
  limit: 10,
});

console.log(listings.items);

Common lookups:

import { searchANT, fetchListingDetails } from '@blockydevs/arns-marketplace-data';

await searchANT({
  name: 'ardrive',
  ao,
  arioProcessId: '<ARIO_PROCESS_ID>',
  marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>',
});

await fetchListingDetails({ ao, marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>', orderId: '<ORDER_ID>' });

Bulk metadata lookups:

import { fetchAllAntsFromActivity, fetchANTsMetadata } from '@blockydevs/arns-marketplace-data';

// Get all ANT IDs that have ever been listed
const antIds = await fetchAllAntsFromActivity({
  ao,
  marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>',
});

// Fetch metadata for multiple ANTs
const metadata = await fetchANTsMetadata({
  ao,
  arioProcessId: '<ARIO_PROCESS_ID>',
  antIds: ['<ANT_ID_1>', '<ANT_ID_2>', '<ANT_ID_3>'],
});

console.log(metadata);

Process IDs you need

  • ARIO (network) Process ID
  • Marketplace Contract Process ID

Essential APIs

Read

  • fetchActiveListings({ ao, marketplaceProcessId, limit?, cursor?, filters? })
  • fetchListingDetails({ ao, marketplaceProcessId, orderId })
  • fetchCompletedListings({ ao, marketplaceProcessId, limit?, cursor?, filters? })
  • fetchMyANTs({ ao, walletAddress, arioProcessId, marketplaceProcessId, config? })
  • searchANT({ name, ao, arioProcessId, marketplaceProcessId })
  • fetchAllAntsFromActivity({ ao, marketplaceProcessId })
  • fetchANTsMetadata({ ao, arioProcessId, antIds })

Write (requires signer)

import { ArweaveSigner } from '@ar.io/sdk/node';
import { createListing, buyListing, bidListing, settleListing, cancelListing } from '@blockydevs/arns-marketplace-data';

const signer = new ArweaveSigner(/* JWK */);

// create
await createListing({
  ao,
  signer,
  walletAddress: '<WALLET>',
  antProcessId: '<ANT_ID>',
  marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>',
  arioProcessId: '<ARIO_PROCESS_ID>',
  config: { type: 'fixed', price: '10' },
  waitForConfirmation: true,
});

// buy (fixed/dutch)
await buyListing({
  ao,
  signer,
  walletAddress: '<WALLET>',
  orderId: '<ORDER_ID>',
  price: '12.5',
  marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>',
  arioProcessId: '<ARIO_PROCESS_ID>',
  antTokenId: '<ANT_ID>',
  orderType: 'fixed',
});

// bid (english)
await bidListing({
  ao,
  signer,
  walletAddress: '<WALLET>',
  orderId: '<ORDER_ID>',
  bidPrice: '15',
  marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>',
  arioProcessId: '<ARIO_PROCESS_ID>',
  antTokenId: '<ANT_ID>',
});

// finalize
await settleListing({ ao, signer, orderId: '<ORDER_ID>', marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>' });
await cancelListing({ ao, signer, orderId: '<ORDER_ID>', marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>' });

Filtering listings

Both active and completed listings support simple server-side filtering via the filters option:

  • Sender: wallet address that created the order
  • DominantToken: the primary token (e.g., ANT process ID)
  • Name: the ArNS name to look up (exact match)

Tips:

  • Use limit: 0 to fetch all available pages in one call (the helper will paginate under the hood).
  • You can combine filters with cursor for manual pagination strategies.

Completed listings

Fetch recently completed, settled, or cancelled orders:

import { fetchCompletedListings } from '@blockydevs/arns-marketplace-data';

const completed = await fetchCompletedListings({
  ao,
  marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>',
  limit: 20, // or 0 to fetch all
  // filters: { Sender: '<WALLET>', DominantToken: '<ANT_ID>', Name: 'example' }
});

console.log(completed.items);

Amounts & conversion

  • Amounts for write calls are ARIO strings (e.g. '12.5').
  • Internally converted to mARIO to avoid float issues.
import { marioToArio, arioToMario } from '@blockydevs/arns-marketplace-data';

marioToArio(1_000_000); // => 1
arioToMario(1.5);       // => 1_500_000

Pagination (cursor-based)

Paginated responses include items, nextCursor, hasMore, totalItems.

let cursor: string | undefined;
const all: any[] = [];

while (true) {
  const page = await fetchActiveListings({ ao, marketplaceProcessId: '<MARKETPLACE_PROCESS_ID>', limit: 100, cursor });
  all.push(...page.items);
  if (!page.hasMore) break;
  cursor = page.nextCursor;
}

Write confirmations and retries

When creating listings, you can control confirmation behavior:

  • waitForConfirmation?: boolean (default true) — waits until the new listing is visible from activity reads.
  • retryConfirmationAttempts?: number — how many times to re-check for the new listing.
  • retryConfirmationBaseDelayMs?: number — base delay used between retries with backoff.

This helps ensure your UI only proceeds once the listing is discoverable.

Types

Useful exported types to help with typing and state modeling:

  • ActiveListing and subtypes for fixed/english/dutch listings
  • ListingDetails for a single order details view
  • CompletedListing (for completed items)
  • OwnedANT and common enums like OrderType, OrderStatus, OwnershipType