Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
030bf85
docs: plan real transaction history
j-kon Jun 30, 2026
c5ffc47
refactor: rename transaction history model
j-kon Jun 30, 2026
872f362
feat: map wallet transactions for history
j-kon Jun 30, 2026
4fe1f20
feat: load real wallet transaction history
j-kon Jun 30, 2026
08b201a
chore: clean up PR 102, delete docs, fix UTC time, handle no wallet s…
j-kon Jun 30, 2026
6539787
refactor: extract hasActiveWalletProvider and remove real BDK wallet …
j-kon Jun 30, 2026
d7f3842
test: rename helper parameter to hasActiveWallet in transactions_list…
j-kon Jun 30, 2026
720ce42
Scope transactions controller and details to active logical wallet ID
j-kon Jul 14, 2026
51d2d75
Merge remote-tracking branch 'upstream/main' into feat/bdk-demo-real-…
j-kon Jul 14, 2026
1bbf82a
fix(demo): clean up transaction history resources
j-kon Jul 14, 2026
2bfc3ff
fix(demo): scope transaction state by wallet ID
j-kon Jul 18, 2026
ac5acbb
feat: automatically load and refresh transaction history
j-kon Jul 21, 2026
82e246d
feat: auto-reload transactions in background after broadcast and sync…
j-kon Jul 21, 2026
ec8434d
fix: stabilize transaction history refresh lifecycle
j-kon Jul 22, 2026
eb368c5
ci: trigger fresh build on all platforms
j-kon Jul 22, 2026
ce9da32
fix: queue pending transaction refreshes and resolve analyzer warning
j-kon Jul 25, 2026
36c8a82
fix(demo): address transaction history review feedback
j-kon Aug 10, 2026
3d441b4
fix(demo): address transaction history follow-up
j-kon Aug 27, 2026
aace3a5
style(demo): remove redundant section heading from transaction histor…
j-kon Aug 31, 2026
0cb3375
style(demo): remove redundant subtitle text from transaction detail h…
j-kon Aug 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bdk_demo/lib/features/send/send_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:math' as math;
import 'package:bdk_demo/core/router/app_router.dart';
import 'package:bdk_demo/features/shared/widgets/secondary_app_bar.dart';
import 'package:bdk_demo/features/shared/widgets/wallet_ui_helpers.dart';
import 'package:bdk_demo/features/transactions/transactions_controller.dart';
import 'package:bdk_demo/providers/blockchain_providers.dart';
import 'package:bdk_demo/providers/connectivity_provider.dart';
import 'package:bdk_demo/providers/send_providers.dart';
Expand Down Expand Up @@ -351,6 +352,7 @@ class _SendPageState extends ConsumerState<SendPage> {
ref
.read(balanceSnapshotProvider.notifier)
.applyFromWallet(wallet, record.id);
ref.invalidate(transactionsControllerProvider(record.id));
_showSnackBar('Transaction broadcast successfully.');
context.go(AppRoutes.home);
} catch (_) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'package:bdk_demo/core/utils/formatters.dart';

class DemoTxDetails {
class TransactionHistoryItem {
final String txid;
final int sent;
final int received;
final bool pending;
final int? blockHeight;
final DateTime? confirmationTime;

const DemoTxDetails({
const TransactionHistoryItem({
required this.txid,
required this.sent,
required this.received,
Expand Down
38 changes: 25 additions & 13 deletions bdk_demo/lib/features/transactions/transaction_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import 'package:bdk_demo/core/theme/app_theme.dart';
import 'package:bdk_demo/core/utils/formatters.dart';
import 'package:bdk_demo/features/shared/widgets/secondary_app_bar.dart';
import 'package:bdk_demo/features/shared/widgets/wallet_ui_helpers.dart';
import 'package:bdk_demo/features/transactions/models/demo_tx_details.dart';
import 'package:bdk_demo/features/transactions/models/transaction_history_item.dart';
import 'package:bdk_demo/features/transactions/transactions_controller.dart';
import 'package:bdk_demo/models/currency_unit.dart';
import 'package:bdk_demo/providers/wallet_providers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

Expand All @@ -13,7 +14,7 @@ class TransactionDetailPage extends ConsumerWidget {

const TransactionDetailPage({super.key, required this.txid});

String _formatAmount(DemoTxDetails transaction) {
String _formatAmount(TransactionHistoryItem transaction) {
final amount = transaction.netAmount;
final prefix = amount >= 0 ? '+' : '-';
final value = Formatters.formatBalance(amount.abs(), CurrencyUnit.satoshi);
Expand All @@ -28,7 +29,25 @@ class TransactionDetailPage extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context);
final transactionAsync = ref.watch(transactionDetailsProvider(txid));
final activeWalletId = ref.watch(activeWalletIdProvider);
final hasActiveWallet = ref.watch(hasActiveTransactionWalletProvider);
if (!hasActiveWallet) {
return const Scaffold(
appBar: SecondaryAppBar(title: 'Transaction Detail'),
body: SafeArea(
child: WalletStateCard(
icon: Icons.account_balance_wallet_outlined,
title: 'No active wallet',
message:
'Create or load a wallet before viewing transaction details.',
centered: true,
),
),
);
}
final transactionAsync = ref.watch(
transactionDetailsProvider((walletId: activeWalletId, txid: txid)),
);

return Scaffold(
appBar: const SecondaryAppBar(title: 'Transaction Detail'),
Expand All @@ -37,14 +56,14 @@ class TransactionDetailPage extends ConsumerWidget {
loading: () => const WalletStateCard(
icon: Icons.hourglass_bottom,
title: 'Loading transaction',
message: 'Preparing placeholder transaction details...',
message: 'Reading wallet transaction details...',
showSpinner: true,
centered: true,
),
error: (_, __) => WalletStateCard(
icon: Icons.error_outline,
title: 'Transaction unavailable',
message: 'The demo could not load placeholder transaction details.',
message: 'The wallet transaction details could not be loaded.',
accentColor: theme.colorScheme.error,
centered: true,
),
Expand All @@ -54,7 +73,7 @@ class TransactionDetailPage extends ConsumerWidget {
icon: Icons.search_off,
title: 'Transaction not found',
message:
'No placeholder transaction was found for this txid.\n\n$txid',
'No wallet transaction was found for this txid.\n\n$txid',
Comment thread
j-kon marked this conversation as resolved.
centered: true,
);
}
Expand All @@ -81,13 +100,6 @@ class TransactionDetailPage extends ConsumerWidget {
WalletStatusChip(status: transaction.statusLabel),
],
),
const SizedBox(height: 8),
Text(
'Standalone transaction detail view for the selected placeholder transaction.',
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.onSurface.withAlpha(170),
),
),
],
),
),
Expand Down
50 changes: 50 additions & 0 deletions bdk_demo/lib/features/transactions/transaction_history_mapper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import 'package:bdk_demo/features/transactions/models/transaction_history_item.dart';

sealed class TransactionHistoryPosition {
const TransactionHistoryPosition();
}

class ConfirmedTransactionPosition extends TransactionHistoryPosition {
final int blockHeight;
final int confirmationTime;

const ConfirmedTransactionPosition({
required this.blockHeight,
required this.confirmationTime,
});
}

class UnconfirmedTransactionPosition extends TransactionHistoryPosition {
const UnconfirmedTransactionPosition();
}

class TransactionHistoryMapper {
const TransactionHistoryMapper._();

static TransactionHistoryItem fromWalletData({
required String txid,
required int sent,
required int received,
required TransactionHistoryPosition position,
}) {
return switch (position) {
ConfirmedTransactionPosition() => TransactionHistoryItem(
txid: txid,
sent: sent,
received: received,
pending: false,
blockHeight: position.blockHeight,
confirmationTime: DateTime.fromMillisecondsSinceEpoch(
position.confirmationTime * 1000,
isUtc: true,
),
),
UnconfirmedTransactionPosition() => TransactionHistoryItem(
txid: txid,
sent: sent,
received: received,
pending: true,
),
};
}
}
Loading
Loading