@@ -14,10 +14,13 @@ import 'dart:io';
1414
1515import 'package:decimal/decimal.dart' ;
1616import 'package:flutter/material.dart' ;
17+ import 'package:isar_community/isar.dart' ;
1718import 'package:flutter_riverpod/flutter_riverpod.dart' ;
1819import 'package:flutter_svg/svg.dart' ;
1920
21+ import '../../models/input.dart' ;
2022import '../../models/isar/models/transaction_note.dart' ;
23+ import '../../models/isar/ordinal.dart' ;
2124import '../../notifications/show_flush_bar.dart' ;
2225import '../../pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart' ;
2326import '../../pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_auth_send.dart' ;
@@ -1418,6 +1421,74 @@ class _ConfirmTransactionViewState
14181421 ),
14191422 ),
14201423 ),
1424+ // Ordinal UTXO spend warning
1425+ Builder (
1426+ builder: (context) {
1427+ final usedUtxos = widget.txData.usedUTXOs;
1428+ if (usedUtxos == null || usedUtxos.isEmpty) {
1429+ return const SizedBox .shrink ();
1430+ }
1431+
1432+ final db = ref.read (mainDBProvider);
1433+ bool hasOrdinal = false ;
1434+ for (final input in usedUtxos) {
1435+ if (input is StandardInput ) {
1436+ final ordinal = db.isar.ordinals
1437+ .where ()
1438+ .filter ()
1439+ .walletIdEqualTo (walletId)
1440+ .and ()
1441+ .utxoTXIDEqualTo (input.utxo.txid)
1442+ .and ()
1443+ .utxoVOUTEqualTo (input.utxo.vout)
1444+ .findFirstSync ();
1445+ if (ordinal != null ) {
1446+ hasOrdinal = true ;
1447+ break ;
1448+ }
1449+ }
1450+ }
1451+
1452+ if (! hasOrdinal) return const SizedBox .shrink ();
1453+
1454+ return Padding (
1455+ padding: isDesktop
1456+ ? const EdgeInsets .symmetric (
1457+ horizontal: 32 ,
1458+ vertical: 8 ,
1459+ )
1460+ : const EdgeInsets .symmetric (vertical: 8 ),
1461+ child: RoundedContainer (
1462+ color: Theme .of (context)
1463+ .extension < StackColors > ()!
1464+ .warningBackground,
1465+ child: Row (
1466+ children: [
1467+ Icon (
1468+ Icons .warning_amber_rounded,
1469+ color: Theme .of (context)
1470+ .extension < StackColors > ()!
1471+ .warningForeground,
1472+ size: 20 ,
1473+ ),
1474+ const SizedBox (width: 8 ),
1475+ Expanded (
1476+ child: Text (
1477+ "This transaction spends a UTXO containing "
1478+ "an ordinal inscription." ,
1479+ style: STextStyles .smallMed12 (context).copyWith (
1480+ color: Theme .of (context)
1481+ .extension < StackColors > ()!
1482+ .warningForeground,
1483+ ),
1484+ ),
1485+ ),
1486+ ],
1487+ ),
1488+ ),
1489+ );
1490+ },
1491+ ),
14211492 SizedBox (height: isDesktop ? 28 : 16 ),
14221493 Padding (
14231494 padding: isDesktop
0 commit comments