Closed phoenixVS closed 4 months 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.
@phoenixVS @mcintyre94 Any idea of were the Unexpected error
is coming from ? Using the provider like phantom which is directly injected in the window without the walletAdapter, I have well defined error from the wallet. But when using the library, I always have
Error: Unexpected error
at Pi.<anonymous> (<anonymous>:3:240911)
at Generator.next (<anonymous>)
at s (<anonymous>:1:1456)
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