Thirdweb Logo

Marketplace


In a Marketplace you can sell or buy NFTs. Platforms like Opensea or Rarible are examples of marketplaces. thirdweb let's you create your own Marketplace.

You can restrict the marketplace to sell only your NFTs, or make it an open marketplace; where any user can buy and sell!

Check out the documentation here.

Loading...


How It Works

export default function Marketplace() {
const { contract: marketplace } = useContract(
contractAddresses[5].address,
"marketplace"
);
const { data: listings } = useActiveListings(marketplace);
return (
<div>
{listings?.map((listing) => (
<div key={listing.id.toString()}>
<ThirdwebNftMedia
metadata={{ ...listing.asset }}
/>
<h3>{listing.asset.name}</h3>
<p>
{listing.buyoutCurrencyValuePerToken.displayValue}
{" "}
{listing.buyoutCurrencyValuePerToken.symbol}
</p>
<Web3Button
theme="dark"
contractAddress={contractAddresses[5].address}
action={() => marketplace?.buyoutListing(listing.id, 1)}
onError={(error) => alert(error)}
onSuccess={() => alert("Success!")}
>
Buy
</Web3Button>
</div>
))}
</div>
);
}