Skip to main content

Generate

Detects all contract addresses in your project, then fetches and stores each smart contracts ABI in memory (inside node_modules); improving the performance of the SDK when using functions such as getContract and useContract.

Once the ABIs are cached locally, the SDK becomes strongly typed when interacting with your smart contracts. Providing you with Intellisense and type-checking when using functions such as contract.call, in the TypeScript SDK, or useContractRead, and useContractWrite in the React SDK.

npx thirdweb generate

Usage

This command recursively checks all files in your project for valid smart contract addresses and fetches the ABIs for each contract. The ABIs are then stored locally in the projects node_modules/@thirdweb-dev/generated-abis directory.

Functions that require the fetching of a smart contract such as getContract and useContract will now use the cached ABIs instead of fetching them each time the function is called. This improves the performance of your application and allows the SDK to become strongly typed when interacting with your smart contracts.

npx thirdweb generate [options]

Options

-p--path <string>
  Path to project