Generating extensions
You can generate precompiled, optimized extensions for any deployed contract using the thirdweb CLI.
The thirdweb SDK comes with a CLI that can be run with your package manager of choice.
This will generate a new thirdweb
directory in your own project, containing the precompiled extension for the contract at the given address.
Example: Generating an extension for a USDC contract on Optimism
This will generate the following file thirdweb/10/0x0b2c639c533813f4aa9d7837caf62653d097ff85.ts
in your project, containing:
- Precompiled, type-safe event definitions
- Precompiled, type-safe function definitions
You can inspect the generated code, modify it, and use it in your project.