Skip to main content

usePrimarySaleRecipient

Hook for retrieving the current primary sale recipient for an NFT collection contract.

import { usePrimarySaleRecipient } from "@thirdweb-dev/react";

Usage

Provide your NFT collection contract as the argument.

import { usePrimarySaleRecipient, useContract } from "@thirdweb-dev/react";

// Your smart contract address
const contractAddress = "{{contract_address}}";

function App() {
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = usePrimarySaleRecipient(contract);

if (error) {
console.error("failed to get primary recipient", error);
}

return <div>{isLoading ? "Loading..." : data}</div>;
}