Feat(wallet): build TransactionSignerPanel component (#222) - #301
Open
MAN7A-afk wants to merge 6 commits into
Open
Feat(wallet): build TransactionSignerPanel component (#222)#301MAN7A-afk wants to merge 6 commits into
MAN7A-afk wants to merge 6 commits into
Conversation
- Add DEFAULT_SIGNING_TIMEOUT_MS = 60_000 configurable constant - Add TxSignRequest interface, TxSignatureTimeoutError class, clearTxSensitiveMemory helper, and signTxWithTimeout function to app/lib/transactions.ts, matching the setTimeout + Promise.race pattern used by all other connector helpers in the codebase - Wire signTxWithTimeout into submitContractTransaction via optional signingTimeoutMs param (defaults to the constant); on timeout the operation is aborted and any sensitive payload memory is zeroed - Add __tests__/transactions_timeout.test.ts with 21 test cases covering: timeout fires, memory cleared, successful signing flow, pre-deadline no-early-fire, timer cleanup, error propagation, default constant, TxSignatureTimeoutError class, and clearTxSensitiveMemory helper
Adds app/components/TransactionSignerPanel.tsx — a wallet-agnostic sign-transaction interface that unblocks issue Goldii-locks#222 (RTL tests). - Parses supplied XDR on mount via useWalletMultiSigAssembly.parseStructure and displays a structure preview (source account, fee, operation count, existing signatures) - States: idle -> signing -> success | error | parse-error - Sign button delegates to hook.signTransaction(xdr, signTransaction) — no new XDR parsing or signing logic introduced - Retry button returns to idle on signing failure - Cancel/Dismiss calls onRejected() and resets state - onSigned, onRejected, onError callbacks for parent integration - Works for all four supported wallets (freighter, albedo, xbull, hana) through the unified useWalletMultiSigAssembly hook
…onSignerPanel - Move state declarations before closeModal callback (WalletSelectorModal) - Remove eslint-disable and add missing hook dependency (TransactionSignerPanel)
|
@MAN7A-afk 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! 🚀 |
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 #222
Summary
Closes issue #222 (RTL tests for
transaction_signer_component).What changed
app/components/TransactionSignerPanel.tsx— new fileA wallet-agnostic sign-transaction panel. On mount it parses the supplied
XDR, shows a human-readable transaction preview, then lets the user confirm
or cancel before the wallet extension is invoked.
Props:
xdrstringselectedWalletIdSupportedWalletIdnetworkPassphrasestring?signTransaction(xdr) => Promise<string>onSigned(signedXdr) => voidonRejected() => void?onError(error) => void?labelstring?States:
parse-error XDR unparseable on mount → error message + Dismiss idle Structure preview + Sign + Cancel signing Buttons disabled, spinner, wallet extension open success Green confirmation, onSigned fired error Red error message, Retry + Cancel, onError fired
Signing is 100% delegated to
useWalletMultiSigAssembly— no new XDRparsing or signing logic. Works for all four wallets (freighter, albedo,
xbull, hana) through the unified hook.
No regressions
Test Files 18 passed (18) Tests 266 passed (266)