BlueWallet/hooks
PeterXMR d7261d4d2a FIX: ElectrumTransaction confirmation fields are optional until mined (#8093)
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.
2026-05-28 09:43:46 +01:00
..
context Revert "wio" 2025-01-13 08:51:40 -04:00
useAnimateOnChange.ts REF: bump react native 2026-03-16 21:13:23 +00:00
useAppState.ts wip 2024-11-05 16:07:28 -04:00
useAsyncPromise.ts REF: Use Error type 2023-12-25 17:22:49 -04:00
useBiometrics.ts DEL: Remove package 2024-06-03 21:27:21 -04:00
useBounceAnimation.ts FX: ManageFlatlist fixes 2025-04-29 20:04:30 -04:00
useCompanionListeners.ts feat: drop rn-qr-generator depenedency 2026-04-26 11:28:58 +01:00
useDebounce.ts REF: use debounce in wallet transactions to avoid rapid reattempts 2025-02-21 21:57:37 -04:00
useDeviceQuickActions.ts FIX: graceful error handling (attempt to prevent startup crashes) 2026-02-22 15:27:54 +00:00
useDeviceQuickActions.windows.ts REF: useDeviceQUickactions 2024-11-14 11:30:19 -04:00
useExtendedNavigation.ts FIX: WalletXpub bio unlock 2025-11-09 13:48:25 -05:00
useHandoffListener.ios.ts REF: bump react native 2026-03-16 21:13:23 +00:00
useHandoffListener.ts Update useHandoffListener.ts 2025-02-01 10:29:05 -04:00
useKeyboard.ts ADD: useKeyboard 2024-08-24 12:16:38 -04:00
useMenuElements.ios.ts REF: bump react native 2026-03-16 21:13:23 +00:00
useMenuElements.ts REF: Use bottom tabs 2025-03-09 07:45:19 -04:00
useOnAppLaunch.ts FIx: onapp launch was not working 2025-05-12 23:14:28 -04:00
useScreenProtect.ts fix: use of usescreenprotect 2026-02-20 11:21:37 -05:00
useSizeClass.ts wip 2025-04-12 20:08:08 -04:00
useWalletSubscribe.tsx REF: bump react native 2026-03-16 21:13:23 +00:00
useWatchConnectivity.ios.ts FIX: greatly improve startup time 2026-04-21 19:18:25 +01:00
useWatchConnectivity.ts wip 2024-11-08 23:00:38 -04:00
useWidgetCommunication.ios.ts FIX: ElectrumTransaction confirmation fields are optional until mined (#8093) 2026-05-28 09:43:46 +01:00
useWidgetCommunication.ts wip 2024-11-08 21:59:39 -04:00