refreshContract - SDK
Triggers a metadata refresh of all NFTs in the provided contract address. This method is useful after an NFT collection is revealed.
Don’t have an API key?
Start using this method in your app today. Get started for free
Triggers a metadata refresh of all NFTs in the provided contract address. This method is useful after an NFT collection is revealed.
Refreshes are queued on the Alchemy backend and may take time to fully process. To refresh the metadata for a specific token, use the refreshNftMetadata method instead.
Parameters
Response
RefreshContractResult
response object parameters
Example Request and Response
Prerequisite: You will need to install the Alchemy SDK before making requests with it.
The commands for installing it using npm or yarn are given below:
Request
Response
Use Cases
Here are some potential use cases for the refreshContract
method:
-
Marketplace management: NFT marketplaces can use the
refreshContract
method to ensure that the data for a specific contract is up-to-date, including any changes to the contract’s metadata or events. This information is crucial for ensuring that the marketplace accurately reflects the current state of the contract. -
Contract management: Developers can use the
refreshContract
method to update the data for a contract they are developing. This can be useful for ensuring that the contract is functioning properly and for identifying any potential issues or bugs. -
User interface updates: DApp developers can use the
refreshContract
method to update their user interfaces to reflect any changes to the contract’s metadata or events. This can be useful for improving the user experience and ensuring that the DApp is always displaying the most accurate information.
Related Methods
Here are the methods related to refreshContract
:
-
refreshNftMetadata: Refreshes the cached metadata for a provided NFT contract address and token id. Returns a boolean value indicating whether the metadata was refreshed.
-
searchContractMetadata: Search for a keyword across the metadata of all ERC-721 and ERC-1155 smart contracts.