Skip to main content

4. Build classes from ABIs

If your adapter requires implementations that rely on on-chain queries to your protocol's smart contracts, you'll need to import ABIs to create factories for type-safe interaction with those contracts.

To do this, add a JSON file containing the ABI for each contract to the contracts/abis folder of your protocol (e.g., /packages/adapters-library/src/adapters/<protocol-id>/abis). Afterward, run the following command to generate the contract factories, which you can then import into your adapter.

npm run build-types