Provides a typescript-enabled wrapper around the PaintSwap MarketplaceV2 contract.
Requires: yarn
yarn installyarn listenyarn queryTypes are deefined in marketplaceV2Types.
MarketplaceV2 defines a typescript-enabled wrapper around the events and getters of the main contract to make it simpler to use.
Scripts listen.ts and query.ts provide examples of interactions all functions defined by the MarketplaceV2 class.
First, include @paintswap/marketplace-interactions in your package.json.
As an example if you'd like to subscribe to Sold events:
import { MarketplaceV2, Sold } from '@paintswap/marketplace-interactions';
const provider = new ethers.providers.JsonRpcProvider(
"https://rpc.ftm.tools/"
);
const marketplace = new MarketplaceV2(provider)
v2.onSold((sale) => console.log(sale))Please note this library is only as reliable as the given RPC provider and the events that come through it. There is no guarantee of event delivery.
See existing Enhancement Issues