Skip to content

Feat(wallet): build TransactionSignerPanel component (#222) - #301

Open
MAN7A-afk wants to merge 6 commits into
Goldii-locks:mainfrom
MAN7A-afk:feat/222-transaction-signer-panel
Open

Feat(wallet): build TransactionSignerPanel component (#222)#301
MAN7A-afk wants to merge 6 commits into
Goldii-locks:mainfrom
MAN7A-afk:feat/222-transaction-signer-panel

Conversation

@MAN7A-afk

@MAN7A-afk MAN7A-afk commented Aug 26, 2026

Copy link
Copy Markdown

Closes #222


Summary

Closes issue #222 (RTL tests for transaction_signer_component).

What changed

app/components/TransactionSignerPanel.tsx — new file

A 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:

Prop Type Purpose
xdr string Base-64 XDR to sign
selectedWalletId SupportedWalletId Routes to the correct wallet impl
networkPassphrase string? Defaults to Testnet
signTransaction (xdr) => Promise<string> WalletContext sign fn or compatible
onSigned (signedXdr) => void Called on success
onRejected () => void? Called on Cancel
onError (error) => void? Called on signing failure
label string? Optional subtitle above the preview

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 XDR
parsing 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)

- 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)
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write React Testing Library assertions for transaction_signer_component

1 participant