typescript-sdk
typescript-sdk copied to clipboard
[Breaking change] Multichain SDK
Separated provider and signer logic, which gives the following setup API:
const sdk = new ThirdwebSDK("polygon");
sdk.wallet.connect(signer);
and we still have of course:
const sdk = ThirdwebSDK.fromPrivateKey(pkey, "polygon");
const sdk = ThirdwebSDK.fromSigner(signer, "polygon");
That separation is what enables the much nicer multichain support and mismatch detection. So now if you're not connected to the right chain, it'll give a really clean error message instead of the current random ones we throw
🎉