ShardeumAPI class incorporates try...catch blocks around all network and wallet interactions.
Common Error Scenarios
- Wallet Not Found: Prompt user to install MetaMask or another wallet extension.
- Wallet Connection Rejected: User declined wallet connection; show a clear message.
- Transaction Rejected by User: User declined to sign the transaction; handle gracefully.
- RPC Errors: Inspect the
errorobject in the RPC response for details. - Network Errors: Catch and display network issues (e.g., endpoint down, no internet).