Contract events
Listen for launch, collection, listing, sale, and withdrawal events.
Events connect contract transactions to Spawn's discovery index. Integrations can query historical logs or subscribe to new logs through a compatible provider.
Launchpad events
| Contract | Event | Use |
|---|---|---|
| Spawn factory | ERC20TokenCreated | Discover a launched token address |
| Spawn factory | TokenFeeRecipientSet | Record the LP fee recipient |
| Spawn factory | TokenReferrerSet | Record the permanent token referrer |
| Spawn factory | ReferralFeePaid | Record an LP referral payout by asset |
| Spawn factory | CreateTokenSwitched | Track launch availability |
| Spawn factory | InitialBuyAmountUpdated | Refresh launch minimums |
| Spawn router | Buy | Record routed token buys |
| Spawn router | Sell | Record routed token sells |
| Spawn router | ReferralFeePaid | Record a router referral payout |
Uniswap pool swap events provide the full market activity stream, including swaps that bypass the Spawn router.
NFT events
| Contract | Event | Use |
|---|---|---|
| Collection factory | CollectionCreated | Discover collection identity and creator |
| Spawn collection | TokenMinted | Discover token ID, recipient, and URI |
| Spawn collection | ContractURIUpdated | Refresh collection metadata |
| Spawn collection | DefaultRoyaltyUpdated | Track collection royalty settings |
| Marketplace | ListingCreated | Add an active fixed-price listing |
| Marketplace | ListingUpdated | Replace price and expiry |
| Marketplace | ListingCancelled | Remove a seller's listing |
| Marketplace | ListingInvalidated | Remove stale listing state |
| Marketplace | ListingPurchased | Record sale settlement and ownership change |
| Marketplace | ProceedsWithdrawn | Record a claimed pending balance |
Standard ERC-721 Transfer events remain the source for ownership changes, including transfers outside the marketplace.
Query historical purchases
import { Contract } from "ethers";
import { addresses, provider } from "./spawn";
const marketplace = new Contract(addresses.nftMarketplace, [
"event ListingPurchased(address indexed collection,uint256 indexed tokenId,address indexed seller,address buyer,uint256 price,uint256 platformFee,address royaltyReceiver,uint256 royaltyAmount)",
], provider);
const filter = marketplace.filters.ListingPurchased(collectionAddress);
const events = await marketplace.queryFilter(filter, 8_923_296, "latest");
for (const event of events) {
console.log(event.transactionHash, event.args);
}
Use bounded block ranges for production queries. Public RPC endpoints may limit result size or request duration.
Subscribe to new listings
const market = new Contract(addresses.nftMarketplace, [
"event ListingCreated(address indexed collection,uint256 indexed tokenId,address indexed seller,uint256 price,uint64 expiresAt)",
], provider);
market.on("ListingCreated", (collection, tokenId, seller, price, expiresAt, event) => {
console.log({ collection, tokenId, seller, price, expiresAt, event });
});
// Call when the subscription is no longer needed.
await market.removeAllListeners("ListingCreated");