Ethers.js in v5
One common misconception about the thirdweb SDK v5 is that it will no longer work with Ethers.js. As a matter of fact, the SDK v5 is built so that it can play well with polular web3 SDKs like viem, ethers v5 and ether v6!
Let's say you decide to upgrade to v5, and still want to stick with ethers.js, you can utilize thirdweb's ethers Adapter to achieve that!
Signer
In v5, instead of having "signer", we pivoted to Account
, which is the replacement for "signer".
Thanks to the thirdweb ethers adapter, you can conveniently convert between ethers's Signer and thirdweb's Account.
Once you have the signer, you can perform different tasks using ethers.js as usual:
Provider
Similar to signer
, you can retrieve the ethers provider in thirdweb v5 using the same adapter:
and perform tasks with it:
Contracts
Similarly to the 2 components above, here's how you can convert a thirdweb contract instance to ethers's:
and then do stuff with it: