Closed phoenixVS closed 3 days ago
I'm going to close this because error messages come directly from the wallet and this repo can't do what you're asking. It's up to wallets to determine the error returned here.
Eg here you can see the Phantom adapter just wraps/throws whatever errors it catches from the Phantom wallet: https://github.com/anza-xyz/wallet-adapter/blob/689a3d1faf491aa83b47faef179ba8e90704d3f5/packages/wallets/phantom/src/adapter.ts#L217C1-L224C10
The wrapper around wallet-standard works similarly.
This repo also doesn't include the phrase "Unexpected error" so that's not something we can control here.
When using Phantom wallet adapter (or any other perhaps) and executing sendTransaction() with an error, the only info it provides is "Unexpected error" text.
Probably this error should be more descriptive, some RPC response with error code, something like this:
It also would have a great boost for WalletConnect's Web3Modal implementation developer experience
Additional context![image](https://github.com/anza-xyz/wallet-adapter/assets/28185581/6dd0a6cc-d01b-4ec6-b869-c48f886ffd5a)