feat: add TransactionContext for optimistic wallet transaction tracking (#123) - #230
Closed
bbkenny wants to merge 2 commits into
Closed
feat: add TransactionContext for optimistic wallet transaction tracking (#123)#230bbkenny wants to merge 2 commits into
bbkenny wants to merge 2 commits into
Conversation
…ioBitsStellar#124) - Add hooks/useSearchHistory.ts hook for managing search history in localStorage - Max 20 unique searches stored, deduplicated, sorted by recency - Integrate useSearchHistory into SearchOverlay component - Show recent searches as dropdown when search input is empty - Allow clicking on a suggestion to populate and submit the search - Add clear history button with Trash2 icon - Each search query saved with timestamp
…ng (AudioBitsStellar#123) - Create context/TransactionContext.tsx with transaction state management - Track transactions with { id, hash, type, status, timestamp } - Support addTransaction, updateTransactionStatus, clearTransaction, clearAllTransactions - Auto-poll transaction status every 2 seconds - Show toast notifications for pending, confirmed, and failed transactions - Auto-clear confirmed transactions after 60 seconds - Transaction history limited to last 20 entries - Add TransactionProvider to the provider chain in provider.tsx
|
@thebabalola is attempting to deploy a commit to the akatenvictor's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Closes #123
Summary
Added a TransactionContext that tracks pending, confirmed, and failed blockchain transactions, providing real-time status updates to the UI without polling.
What changed
New
context/TransactionContext.tsx:{ id, hash, type, status, timestamp }addTransaction(hash, type)— adds a pending transaction and starts pollingupdateTransactionStatus(id, status)— manually update a transaction's statusclearTransaction(id)— remove a single transaction and stop its pollclearAllTransactions()— remove all transactions and stop all polls/api/transactions/{hash}/statusUpdated
context/provider.tsx:TransactionProviderto the provider chain betweenWalletProviderandLoadingProviderAcceptance Criteria
Verification
npm run lint— no new warnings or errorsnpm run test— 170/170 tests passnpm run build— builds successfully (pre-existing TS errors in unrelated files remain unchanged)