Interact FAQs

thirdweb Interact is a toolkit that allows developers to seamlessly integrate smart contracts into their applications. It provides functionalities for any type of on-chain interaction. The toolkit includes features such as:

  • An intuitive DX: This allows developers to integrate smart contracts into any app with SDKs that detect contract extensions and handle any kind of on-chain interaction.
  • Fine-grained control: This feature enables developers to manage, read & write, and monitor any smart contract with quick access to custom contract configurations.
  • Onchain insights: This provides onchain data & understanding activity on your smart contracts with an easy-to-use analytics dashboard.
  • Manage contracts: This allows developers to manage all of their smart contracts from the dashboard.
  • Read & write to contracts: This feature enables developers to integrate smart contracts into their app, call any & all functions, and have code snippets auto-generated based on your contract's supported extensions.

For more information, you can visit the thirdweb Interact page.


General FAQs

Is a Client ID is required when using thirdweb’s SDK?

Yes, developers need an API key to use our SDK’s, Storage, CLI and Smart Accounts. Learn more about why and how to get started here.

Which SDK version should I be on?

We recommend always maintaining the latest versions of all our sdks. This can be done easily by running

How do I upgrade my SDK to the latest version?

For yarn yarn add @thirdweb-dev/sdk@latest @thirdweb-dev/react@latest

or

For npmnpm install @thirdweb-dev/react@latest @thirdweb-dev/sdk@latest

Can I use the thirdweb Dashboard and SDKs if I didn’t deploy my contract with thirdweb?

Yes! You can use our Dashboard to interact with any contract on any of our supported networks (any EVM chain), even if you didn’t deploy your contract with thirdweb. You can connect your wallet and import your contract into the thirdweb dashboard here. Select “Import contract”, enter the contract address you wish to import, and select the chain. Once imported, you will be able to use all the features of the dashboard and SDK for your contract, including Code Snippets that are generated specifically for your contract.

How can I import my contract to the thirdweb Dashboard?

You can connect your wallet and import your contract into the thirdweb dashboard here. Select “Import contract”, enter the contract address you wish to import, and select the chain. Once imported, you will be able to use all the features of the dashboard and SDK for your contract, including Code Snippets that are generated specifically for your contract.

What are the benefits of importing my contract?

Importing your contract gives you access to the thirdweb Dashboard to manage your contract, including access to our contract explorer and analytics, while also giving you access to our SDKs to integrate your contract into your frontend application.

Can I deploy a specific version of a prebuilt contract using the SDK?

Yes! On the Explorer page, select the contract you wish to deploy. Once selected, on the right-hand side of the page, click “Version” and select the version of the contract you wish to deploy.

Does my smart contract have to be verified to interact with the SDK?

We recommend verifying your smart contract and importing it into the thirdweb dashboard for full access to all read and write functions. If the contract is not verified, you may not have access to all functions in the contract.

How can I fetch the transaction hash before full confirmation?

Using our TypeScript SDK Transaction Builder, you are able to fetch the transaction hash prior to the transaction being confirmed onchain. Here is an example of using the Transaction Builder .preparesyntax to get the transaction hash off the sentTx:

const tx = contract.function.prepare(...)
const sentTx = await tx.send()

How can I customize the gas limit of a specific transaction using the SDK?

One of the benefits of using thirdweb’s SDK is the fine-grain control over transaction details that it enables. Using our TypeScript SDK Transaction Builder, you can use the .prepare preparesyntax to set the gas limit of your transaction, as well as many other controls over each step of this transaction journey.

How can I refresh the cache for the useOwnedNFTs hook?

the function returns a refetch function inside the object

 

Is it okay if my client ID is exposed on the front end?

Yes. The client ID is meant to be used on the front end. You should always restrict your client ID to only certain allowed domains and app bundle ids to access the API key's enabled services.

Is it okay if my secret key is exposed on the front end?

No. Your secret key should only be used in backend environments like CLI, scripts, and servers. It should never be exposed in client-side code (browsers, apps) as there are no access restrictions on secret keys.

How can I customize the gas limit of a specific transaction using the Web3Button?

To override the gas in the Web3Button component, you can use the overrides prop. This prop allows you to specify various transaction parameters, including the gasLimit. Here is an example of how to override the gas limit:


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

function App() {
  return (
    <Web3Button
      contractAddress="0x..."
      action={(contract) => console.log(contract)} // Logic to execute when clicked
      overrides={{
        gasLimit: 3000000, // Specify the desired gas limit for the transaction
      }}
    >
      Execute Action
    </Web3Button>
  );
}

In this example, the gasLimit is set to 3000000. You can adjust this value according to your needs.

How do I deploy an embedded wallet with gasless using smart contracts?

[]

How can I prevent people from minting tokens outside of my game?

Once a smart contract is deployed on the blockchain, it's public and anyone can interact with it. However, it’s possible way to restrict minting tokens to only within your game by incorporating a form of authentication or access control within your contract.

An example of this is using our prebuilt signature-based minting contracts or extensions.

Signature-based minting, allows a smart contract admin to generate signatures that can be used by other wallets to allow them to mint tokens on your smart contract in real-time.

This allows you to conditionally generate signatures based on some condition/criteria (i.e. an in-game achievement), and reward the user with minted tokens to their wallet.

For more information on signature-based minting and how to get started, see here.

To implement signature-based minting in your Unity project, the links are as follows: ERC-721, ERC-1155, and ERC-20.

How can I implement Metamask wallet’s Unity SDK within my thirdweb project?

You can use our WalletProvider.Metamask with the SDK out-of-the-box. To use a custom wallet implementation with the SDK you can create your own implementation here

 
Did this answer your question?
😞
😐
🤩