🔌Re:naissance API
Re:naissance features an easy-to-use API that can be plugged into any dApp and use-case to gate it for royalties paid.
Overview
The checked-nfts API call allows you to retrieve information about NFTs and their royalty status. The API call returns a list of NFTs with relevant details such as mint address, royalties paid status, royalties paid amount, royalties to pay, and status.
Endpoint
POST https://renaissance-api.builderzlabs.workers.dev/api/v1/checked-nfts
Headers
"renaissance-api-key": {API_KEY}: Replace{API_KEY}with your unique API key.
Request Body
"mints"(required): An array of strings containing the NFT mint addresses."paginationToken"(optional): A string used for pagination. Include this field if you want to load more data.
Response Object
The response object contains the following fields:
checkedNfts: An array of objects with the following fields:"mint": The mint address of the NFT as a string."royaltiesPaid": A boolean indicating whether royalties have been paid or not.trueif royalties have been paid,falseotherwise."royaltiesPaidAmount": A number representing the amount of royalties paid"royaltiesToPay": A number representing the amount of royalties to be paid"status": A string describing the status of the NFT."redemptionTimestamp": Timestamp when the redemption occoured (only if status = “paid-with-tool”)
paginationToken: A string used for pagination. Include this value in your next API call to retrieve more data.
Pagination Example
export type checkNftRes = {
mint: string;
royaltiesPaid: boolean;
royaltiesToPay: number;
royaltiesPaidAmount: number;
status: string;
};
const checkNfts = async(mints: string[]) => {
let paginationToken: string | null = null;
let allCheckedNFTs: checkNftRes[] = [];
do {
const res = await fetch(
"<https://renaissance-api.builderzlabs.workers.dev/api/v1/checked-nfts>",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"renaissance-api-key": "YOUR_API_KEY"
},
body: JSON.stringify({
mints: nftMints, // Array of NFT Mint Addresses
paginationToken,
}),
}
);
const { checkedNfts, paginationToken: newPaginationToken } = await res.json();
allCheckedNFTs.push(...checkedNfts);
paginationToken = newPaginationToken;
} while (paginationToken !== null);
return allCheckedNFTs
}
const checkedNfts = await checkNfts(["asdf...asdf", "asdf...asdf", etc.])
// Work with checkedNfts ...Last updated