thirdweb-dev / js

Best in class web3 SDKs for Browser, Node and Mobile apps
https://thirdweb.com
Apache License 2.0
466 stars 389 forks source link

SDK: Private key accounts have incorrect type when converted to Viem clients #2603

Closed gregfromstl closed 8 months ago

gregfromstl commented 8 months ago

When converting a Thirdweb account to a viem client, viem's createClient function assumes an address passed a json-rpc account. This causes issues with local accounts that should have the type local on their viem client. Functions that many SDKs use like getAddresses break due to the incorrect account type.

Can fix this by adding to the PrivateKeyAccount type in progress on #2525 and passing the full account to viem's createClient when the account is a PrivateKeyAccount

jnsdls commented 8 months ago

should be fixed once #2600 is released due to the fix in #2525, thanks @gregfromstl