V1 to V2 Migration Guide
This guide provides a high-level overview of the changes between the V1 and V2 versions of the Immutable Typescript SDK.
Breaking Changes
1. Ethers.js v6
The core change between the V1 and V2 versions of the Immutable Typescript SDK is the update of the Ethers.js library from v5 to v6.
Updating the Typescript SDK to V2 will require you to update your application to use Ethers.js v6 if it is being used in your project. You can follow the migration guide provided by Ethers.js here.
2. Checkout SDK Provider
The V2 version of the Immutable Typescript SDK introduces a new WrappedBrowserProvider
class that is used to interact with the Checkout SDK ONLY. Other SDKs such as Passport will continue to use the default BrowserProvider
from Ethers.js v6.
This new class is initialized using the same parameters as the BrowserProvider
class, and differs by providing an ethereumProvider
value that is the EIP1193 provider that was used to initialise the WrappedBrowserProvider
.
3. Passport ConnectEVM
The connectEvm
in the Passport class has been updated to be an async function that returns a promise. All instances of connectEvm
should be updated to use the new async function signature.
// before
const provider = passportInstance.connectEvm();
// after
const provider = await passportInstance.connectEvm();
4. Updated Bundling
Although not specifically a breaking change, the behaviour behind the bundling process has been heavily improved and should now work on all environments correctly.
Any polyfills or resolves set up based on the information provided in the V1 SDK Troubleshooting guide should be removed and everything should work out of the box, including browser environments. If there are still issues you are facing with a clean default config due to the v2 Typescript SDK, please reach out to the team.