AbsoluteJS

Marketplace

@absolutejs/marketplacev0.1.7betaCommerce & Growth

Provider-agnostic marketplace primitives for listings, criteria orders, auctions, trades, and atomic collectible settlement.

#Installation

BASH
bun add @absolutejs/marketplace

#Capabilities

Overview

Headless marketplace policy and settlement primitives for AbsoluteJS applications.

Marketplace model

It models fixed-price listings, criteria-based buy orders, auctions, direct trades, opaque pagination cursors, asset matching, seller-paid fees, anti-sniping, idempotency, and explicit state transitions without choosing a database or web framework.

Atomicity boundary

The package deliberately emits a settlement plan instead of pretending independent wallet and ownership calls are atomic. Adapters must commit the wallet entries, asset transfer, entity status, and idempotency record in one database transaction.

Outcomes

What you can build

Overview

Headless marketplace policy and settlement primitives for AbsoluteJS applications.

Marketplace model

It models fixed-price listings, criteria-based buy orders, auctions, direct trades, opaque pagination cursors, asset matching, seller-paid fees, anti-sniping, idempotency, and explicit state transitions without choosing a database or web framework.

Atomicity boundary

The package deliberately emits a settlement plan instead of pretending independent wallet and ownership calls are atomic. Adapters must commit the wallet entries, asset transfer, entity status, and idempotency record in one database transaction.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/marketplace version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/marketplace example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Settlement planning

Partial snippet

Working example for Settlement planning.

TS
import {
	criteriaFromAsset,
	matchesAssetCriteria,
	planSaleSettlement
} from '@absolutejs/marketplace';

const wanted = criteriaFromAsset(copy, 'exact', 100);
if (matchesAssetCriteria(candidate, wanted)) {
	const plan = planSaleSettlement({
		idempotencyKey: 'sale:42',
		assetId: candidate.id,
		buyerAccountId: 'wallet:buyer',
		sellerAccountId: 'wallet:seller',
		platformAccountId: 'wallet:platform',
		grossCents: 2500
	});
	// Apply `plan.entries` and the ownership transfer in one storage transaction.
}

#Public entry points

Supported entry points declared by this project’s package manifest. Internal dist paths are not part of the package contract.

Public package entry point declared in package.json.

@absolutejs/marketplace@absolutejs/marketplace/manifest@absolutejs/marketplace/manifest.json

#Package commands

Scripts declared by this project’s package manifest.

bun run buildrm -rf dist && bun build src/index.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun --external @absolutejs/wallet --external '@absolutejs/wallet/*' && tsc --project tsconfig.build.json && absolute-manifest emit
bun run check:packagebun run typecheck && bun run test && bun run build
bun run testbun test
bun run typechecktsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

22 symbols
MarketplacePolicytypePermalink
TS
type MarketplacePolicy = {
    wallet: WalletPolicy;
    minimumListingCents: Cents;
    minimumBidIncrementCents: Cents;
    maximumActiveListings: number;
    maximumActiveBuyOrders: number;
    maximumActiveAuctions: number;
    maximumTradeAssetsPerSide: number;
    maximumOrderDays: number;
    maximumAuctionHours: number;
    antiSnipeWindowMs: number;
    antiSnipeExtensionMs: number;
    maximumAuctionExtensions: number;
};
Exported from @absolutejs/marketplace