JS Library to read data from the atomicmarket contract which is based on the atomicassets NFT standard.
Contract / General Documentation can be found on https://github.com/pinknetworkx/atomicmarket-contract/wiki
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
$ npm install atomicmarket
Web library can be found in the dist folder
// standard import
const {AtomicMarketApi} = require("atomicmarket");
// ES6 import
import {AtomicMarketApi} from "atomicmarket"
There are two methods available to fetch data from the blockchain.
- ExplorerAPI: uses an hosted API which proves simple and fast REST API endpoints
- RpcAPI: uses only native nodeos calls
The explorer API uses eosio-contract-api to query data about the NFTs. A documentation of each endpoint and its responses can be found here. It is recommended to self-host the API for the best performance.
// init Explorer Api
// endpoint: server where atomicmarket api is deployed
// namespace: used namespace for the API
// options:
// - fetch: either node-fetch module or the browser equivalent
const api = new AtomicMarketApi("https://test.wax.api.atomicassets.io", "atomicmarket", {fetch});
const sale = await api.getSale("100");