JavaScript/TypeScript SDK for the AtomicMarket NFT marketplace contract on Antelope (EOSIO) chains such as WAX. It reads sales, auctions, buyoffers, and royalty configuration through the AtomicMarket Explorer API and builds royalty-config contract actions for signing with any transaction library. This is a maintained fork of the dormant atomicmarket package by pink.network, updated for the v2 AtomicMarket contract.
The NFT-standard companion package is @atomichub/atomicassets.
npm install @atomichub/atomicmarketRequires Node.js >= 20, or any modern browser or bundler. The package ships CJS, ESM, and a browser IIFE bundle (build/atomicmarket.global.js, global atomicmarket).
// ESM / TypeScript
import { AtomicMarketApi } from '@atomichub/atomicmarket';
// CommonJS
const { AtomicMarketApi } = require('@atomichub/atomicmarket');The Explorer API queries a hosted eosio-contract-api instance. The built-in fetch is used unless you pass your own.
import { AtomicMarketApi } from '@atomichub/atomicmarket';
const api = new AtomicMarketApi('https://wax.api.atomicassets.io', 'atomicmarket', {});
const sales = await api.getSales({ collection_name: 'mycollection' }, 1, 20);
const sale = await api.getSale('100');AtomicHub's public endpoints ship as presets, so a client for a supported network needs one call:
import { marketApiForNetwork } from '@atomichub/atomicmarket';
const api = marketApiForNetwork('wax');Custom or self-hosted deployments still work through the plain constructor shown above.
// null when the collection has no royalty config
const config = await api.getRoyaltyConfig('mycollection');
const templateRules = await api.getRoyaltyTemplateRules('mycollection');
const attributeRules = await api.getRoyaltyAttributeRules('mycollection');MarketActionBuilder is synchronous and returns authorization-free {account, name, data} objects for the v2 royalty-config actions. Attach authorization when you sign.
import { MarketActionBuilder } from '@atomichub/atomicmarket';
const builder = new MarketActionBuilder('atomicmarket');
const actions = builder.setroyalconf('mycollection', {
founders: [{ recipient: 'founderacct1', weight: 1 }],
attribute_mode: 0,
split_founders: 5000,
split_templates: 2500,
split_attributes: 2500
});
await session.transact({
actions: actions.map((action) => ({
...action,
authorization: [{ actor: 'authoracct11', permission: 'active' }]
}))
});- Zero third-party runtime dependencies: the built-in
fetchreplaces node-fetch (a customfetchcan still be injected); the only dependency is the sibling@atomichub/atomicassets. - Dual CJS/ESM output with bundled type declarations, plus a browser IIFE build.
- v2 contract surface: royalty read endpoints (
getRoyaltyConfig,getRoyaltyTemplateRules,getRoyaltyAttributeRules), the syncMarketActionBuilderfor royalty-config actions, typed on-chain table rows, and theAtomicMarketActionsaction-name constants. - Market API response-object, query-parameter, and enum types are exported from the package root; no deep
build/imports needed.
- Package name:
npm install @atomichub/atomicmarketand change imports from'atomicmarket'to'@atomichub/atomicmarket'. - Deep imports such as
atomicmarket/build/API/Explorer/Paramsare replaced by root exports:import { SaleApiParams } from '@atomichub/atomicmarket'. - Numeric ABI fields (
template_id, weights, splits) are numbers; 64-bit id fields (sale ids, rule ids) remain strings. - Node.js >= 20 is required.
Fork of atomicmarket-js by pink.network. Maintained by AtomicHub.
MIT licensed; see LICENSE for the full text including the original pink.network copyright.