Repository navigation
feat(react): implement useTransactionSubmission lifecycle hook (#1193) - #1277
Open
Ariyagold wants to merge 2 commits into
Conversation
|
@Ariyagold Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Author
|
@p3ris0n , pls review pr |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
useTransactionSubmissionlifecycle hook to manage Soroban smart contract transaction states (idle->simulating->signing->submitting->confirmed|failed), including automatic and manual retries, ledger inclusion polling, Soroban contract error decoding, and unmount cleanup.Closes #1193
Closes #1192
Closes #1191
Closes #1190
Changes Made
react/src/hooks.ts):useTransactionSubmissionwith granular status tracking:'idle' | 'simulating' | 'signing' | 'submitting' | 'confirmed' | 'failed'.markSimulating,markSigning,markSubmittinglifecycle markers) and staged descriptors (simulate,sign,send,pollStatus).BcForgeProvider(useOptionalBcForgeClient) andWalletProvider(useWallet), enforcing wallet connection checks, hardware wallet signature timeouts (signWithTimeout), and client cache invalidation (clearCache) on confirmation.decodeTransactionErrorto map Soroban token and admin contract numeric errors (Error(Contract, #N)) and wallet signature rejections into clear, user-friendly error messages.retry(), manualrefetch()for ledger confirmation polling,reset(), and safe timer/state cleanup on unmount.react/src/hooks.test.tsx):useTransactionSubmissionanddecodeTransactionError, covering status transitions, ledger polling, wallet connection guards, contract error decoding, user signature rejection, automatic/manual retries, and unmount cleanup.react/README.md):useTransactionSubmissionanddecodeTransactionErrorto the exported hooks list.Acceptance Criteria Checklist
'idle'->'simulating'->'signing'->'submitting'->'confirmed'|'failed'.noImplicitAny, strict null checks).