Docs Home
PostPlaza relies on an indexer to get on-chain data. The frontend doesn’t directly query the blockchain. It instead uses a backend that holds indexed on-chain data. This makes it run faster and be cheaper. Anybody can recreate this database and continuously update it by listening to events from the contracts. View contracts here.
Example of contract indexer
const contract = new web3.eth.Contract(abi, address);
contract.events.NewPost({}).on('data', async function(event){
const hash = event.transactionHash;
const tokenContract = event.returnValues.tokenContract;
const tokenId = event.returnValues.tokenId;
const content = event.returnValues.content;
const poster = event.returnValues.poster;
const parentPostId = event.returnValues.parentPostId;
const postTimestamp = event.returnValues.postTimestamp;
const tags = JSON.stringify(event.returnValues.tags)
})
.on('error', console.error);
Post Contract Events
- Use the seed return value to make sure a transaction isn’t submitted twice.
Events |
Return Value #1 |
Return Value #2 |
Return Value #3 |
Return Value #4 |
Return Value #5 |
Return Value #6 |
Return Value #7 |
NewPost |
content |
poster |
parentPostId |
postTimestamp |
tags |
tokenContract |
tokenId |
DeletePost |
tokenId |
|
|
|
|
|
|
Upvote |
upvoter |
tokenId |
seed |
|
|
|
|
RemoveUpvote |
upvoter |
tokenId |
seed |
|
|
|
|
Downvote |
downvoter |
tokenId |
seed |
|
|
|
|
RemoveDownvote |
downvoter |
tokenId |
seed |
|
|
|
|
Repost |
reposter |
tokenId |
seed |
|
|
|
|
RemoveRepost |
reposter |
tokenId |
seed |
|
|
|
|
NewNFPCollection |
creator |
collectionAddress |
name |
|
|
|
|
NFPTransfer |
from |
to |
tokenId |
|
|
|
|
NFPApproved |
contractAddress |
owner |
operator |
approved |
|
|
|
Profile Contract Events
Events |
Return Value #1 |
Return Value #2 |
Return Value #3 |
Return Value #3 |
AvatarConnected |
owner |
avatarNFTChainId |
avatarNFTContractAddress |
tokenId |
BioSet |
user |
bio |
|
|
WebsiteSet |
user |
website |
|
|
AddressVerified |
verifiedAddress |
linkToSource |
|
|
UseVerifiedSourceUsername |
user |
shouldUse |
|
|
UpdateAll |
user |
|
|
|
Social Graph Contract Events
Events |
Return Value #1 |
Return Value #2 |
Follow |
following |
follower |
Unfollow |
unfollowing |
unfollower |
Marketplace Contract Events
Events |
Return Value #1 |
Return Value #2 |
Return Value #3 |
Return Value #4 |
Return Value #5 |
Return Value #6 |
Return Value #7 |
Return Value #8 |
Return Value #9 |
Return Value #10 |
NftAuctionCreated |
nftContractAddress |
tokenId |
nftSeller |
erc20Token |
minPrice |
buyNowPrice |
auctionEnd |
bidIncreasePercentage |
feeRecipients |
feePercentages |
SaleCreated |
nftContractAddress |
tokenId |
nftSeller |
erc20Token |
buyNowPrice |
whitelistedBuyer |
feeRecipients |
feePercentages |
|
|
BidMade |
nftContractAddress |
tokenId |
bidder |
erc20Token |
tokenAmount |
|
|
|
|
|
AuctionPeriodUpdated |
nftContractAddress |
tokenId |
auctionEndPeriod |
|
|
|
|
|
|
|
NFTTransferredAndSellerPaid |
nftContractAddress |
tokenId |
nftSeller |
nftHighestBid |
nftHighestBidder |
nftRecipient |
|
|
|
|
AuctionSettled |
nftContractAddress |
tokenId |
auctionSettler |
|
|
|
|
|
|
|
AuctionWithdrawn |
nftContractAddress |
tokenId |
nftOwner |
|
|
|
|
|
|
|
BidWithdrawn |
nftContractAddress |
tokenId |
highestBidder |
|
|
|
|
|
|
|
WhitelistedBuyerUpdated |
nftContractAddress |
tokenId |
newWhitelistedBuyer |
|
|
|
|
|
|
|
MinimumPriceUpdated |
nftContractAddress |
tokenId |
newMinPrice |
|
|
|
|
|
|
|
BuyNowPriceUpdated |
nftContractAddress |
tokenId |
newBuyNowPrice |
|
|
|
|
|
|
|
HighestBidTaken |
nftContractAddress |
tokenId |
|
|
|
|
|
|
|
|