typescript-sdk icon indicating copy to clipboard operation
typescript-sdk copied to clipboard

[Breaking change] Multichain SDK

Open joaquim-verges opened this issue 3 years ago • 1 comments

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

joaquim-verges avatar Jun 17 '22 23:06 joaquim-verges

🎉

jnsdls avatar Jun 17 '22 23:06 jnsdls