Tokenbound iFrame
Last updated
Last updated
By using an animation_url
developers may embed a web app as the media for NFTs on , and other platforms. This allows users to view detailed information about the tokenbound account (TBA) associated with the respective NFTs directly within the marketplace interface.
This basic iframe implementation lets users explore their NFT's tokenbound accounts and view information such as:
Contents of the NFT's tokenbound account: ERC-721, ERC-1155, and ERC-20 tokens
Lock status of the TBA (locked
or unlocked)
. A locked
state allows users to confidently purchase an NFT, knowing that none of the contents of the TBA will be transferred during the course of the purchase transaction.
Tokenbound currently provides two ways you can easily integrate iframes into your project URL
and Custom
.
The URL
method is recommended for NFT projects using static images for their artwork, and wish to display their NFT's Tokenbound account. This method requires updating the animation_url
of your NFT's metadata to match this pattern in two ways:
This method is useful when you don't know the address of your Tokenbound Account (TBA). Here's how to use it:
nft_contractAddress
: the contract address of the NFT collection you wish to display.
tokenId
: the token ID of the individual NFT to be rendered in the iframe.
chainId
: the network chainID.
This method is applicable when you know the TBA address and don't need to specify the token ID. Here's how to use it:
contractAddress
: the contract address of the TBA you wish to display.
chainId
: the network chainID.
You can find currently supported chains below:
Starknet Mainnet
SN_MAIN
Starknet Sepolia
SN_SEPOLIA
For NFT:
For TBA:
This iframe implementation relies on Ark Project's indexer to render the NFT's media. If your project uses a custom API to render the NFT's media, use the custom implementation below.
Alchemy is used as a JSON-RPC provider to interact with the blockchain.
Update your environment variables with your Alchemy key
You would also need the API URL in your .env
The application expects the endpoint to be: string | string[]
, where the string is a url link to your NFT's assets. It should dynamically have a route for each tokenId.
For example the NEXT_PUBLIC_NFT_ENDPOINT
env variable is https://nft-api.com/nft
. The application will then take the tokenId from the URL and make a fetch to that endpoint: https://nft-api.com/nft/<tokenId>
.
Host your application on a service provider of your choice and set your metadata server with that host.
Navigate to and create an API key , if you don't already have one.
Navigate to and create an API key which is being used as an indexer