-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interact-with-wallets.md refactor: optimize web3 import and add error…
… handling to transaction … (#354) * refactor: optimize web3 import and add error handling to transaction logic - Refactored import from 'import * as web3' to 'importing the necessary packages' for better efficiency. - Added try-catch block for robust error handling during transaction execution. - Fixed variable typo when logging transaction signature. - Improved handling for cases where connection or publicKey is unavailable. * refcator(): - Refactored `useEffect` to use `async/await` consistently instead of mixing with `.then()`/`.catch()`. - Wrapped the code in `try/catch` blocks for better error handling and to ensure any failures are properly caught. - Updated error handling to use `throw new Error()` instead of throwing strings. - Improved code readability and maintainability by centralizing the balance update logic within a single `async` function. --------- Co-authored-by: Onyewuchi Emeka <[email protected]>
- Loading branch information
1 parent
08b2dce
commit f8c8b4d
Showing
1 changed file
with
94 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters