Adapters
The thirdweb SDK can work side by side with:
- wagmi
- ethers.js v5
- ethers.js v6
- viem
- older versions of the @thirdweb-dev/sdk (using the ethers.js v5 adapter)
Adapters allow you to use contracts, providers and wallets from these libraries with the thirdweb SDK and vice versa.
Wagmi
You can use the thirdweb SDK within a wagmi application by setting the wagmi connected account as the thirdweb 'active wallet'. After that, you can use all of the react components and hooks normally, including PayEmbed
, TransactionButton
, etc.
You can view a fully functioning wagmi + thirdweb app in this github repository.
Ethers v6
You can use an existing ethers.js v6 Signer with the thirdweb SDK by converting it using the ethers6Adapter
:
Similarly, you can use any wallets created with the thirdweb SDK with ethers.js v6 by converting them using the ethers6Adapter
:
You can also convert ethers.js providers and contracts from and to the thirdweb SDK.
View the ethers6Adapter reference for more details.
Ethers v5
You can use an existing ethers.js v5 Signer with the thirdweb SDK by converting it using the ethers5Adapter
:
You can also convert ethers.js providers and contracts from and to the thirdweb SDK.
View the ethers5Adapter reference for more details.
viem
You can use an existing wallet client from viem with the thirdweb SDK by converting it using the viemAdapter
:
You can also convert viem public clients and contracts from and to the thirdweb SDK.
View the viemAdapter reference for more details.