Electrum's `blockchain.transaction.get` verbose response does not include
`blockhash`, `confirmations`, `time`, or `blocktime` when the transaction
is still in the mempool. Both `ElectrumTransaction` in
`blue_modules/BlueElectrum.ts` and the sibling `Transaction` type in
`class/wallets/types.ts` declared all four as required, which silently
let unguarded access compile and crash at runtime on real mempool data.
- Mark the four confirmation-only fields optional on both types. They
describe the same shape and have the same bug.
- Export `ElectrumTransaction` so a regression test can reference it.
- Collapse the two-line `tx.timestamp = tx.blocktime; if (!tx.blocktime)
tx.timestamp = ...` pattern in `abstract-hd-electrum-wallet.ts` into a
single `||` fallback — type-safe and runtime-equivalent.
- Add nullish-coalesce guards at the two call sites that compared
`confirmations` directly to a number. In `useWidgetCommunication.ios.ts`,
`t.confirmations ?? 0` keeps the filter semantically unchanged. In
`PaymentCodesList.tsx`, normalize once via
`notificationTx?.confirmations ?? 0` and use the local in both the
`> 0` (already confirmed) and `=== 0` (mempool / unconfirmed alert)
branches — otherwise a mempool notification tx would skip both branches
and the code would create a duplicate notification transaction.
- Add `tests/unit/electrum-transaction-types.test.ts` documenting that a
mempool-shaped object satisfies the type.