feat: Add Tether Gold (XAUT0) token support to Solana wallet and add migration for existing wallets (#3136)
David Adegoke committed
Mar 26, 2026 at 16:36 UTC
680cf22a98b12dfadb770531a4c1b3e64ec1e4ff
6 files changed
+52
-3
assets/images/xau_sol.png
Binary files /dev/null and b/assets/images/xau_sol.png differ
cw_solana/lib/default_spl_tokens.dart
+9
@@ -99,6 +99,15 @@ class DefaultSPLTokens {
99
iconPath: 'assets/images/avdo_icon.png',
100
enabled: false,
101
),
102
+ SPLToken(
103
+ name: "Tether Gold",
104
+ symbol: "XAUT0",
105
+ mintAddress: "AymATz4TCL9sWNEEV9Kvyz45CHVhDZ6kUgjTJPzLpU9P",
106
+ decimal: 6,
107
+ mint: 'xaut0',
108
+ enabled: false,
109
+ iconPath: "assets/images/xau_sol.png",
110
+ ),
111
SPLToken(
112
name: 'Abbott xStock',
113
symbol: 'ABTx',
lib/entities/default_settings_migration.dart
+40
@@ -23,6 +23,7 @@ import 'package:cake_wallet/entities/sync_status_display_mode.dart';
23
import 'package:cake_wallet/wownero/wownero.dart';
24
import 'package:cw_core/pathForWallet.dart';
25
import 'package:cw_core/root_dir.dart';
26
+import 'package:cw_core/spl_token.dart';
27
import 'package:cw_core/utils/print_verbose.dart';
28
import 'package:cw_core/wallet_info.dart';
29
import 'package:cw_core/wallet_type.dart';
@@ -611,6 +612,9 @@ Future<void> defaultSettingsMigration(
612
enabled: false,
613
);
614
break;
615
+ case 63:
616
+ await _addXaut0TokenToExistingSolanaWallets();
617
+ break;
618
default:
619
break;
620
}
@@ -1489,3 +1493,39 @@ Future<void> _addXautTokenToExistingEthereumWallets() async {
1493
printV('Error in XAUT migration: $e');
1494
}
1495
}
1496
+Future<void> _addXaut0TokenToExistingSolanaWallets() async {
1497
+ try {
1498
+ final xaut0Token = SPLToken(
1499
+ name: "Tether Gold",
1500
+ symbol: "XAUT0",
1501
+ mintAddress: "AymATz4TCL9sWNEEV9Kvyz45CHVhDZ6kUgjTJPzLpU9P",
1502
+ decimal: 6,
1503
+ mint: 'xaut0',
1504
+ enabled: false,
1505
+ iconPath: "assets/images/xau_sol.png",
1506
+ );
1507
+
1508
+ final allWallets = await WalletInfo.getAll();
1509
+
1510
+ final solanaWallets = allWallets.where((wallet) => wallet.type == WalletType.solana).toList();
1511
+
1512
+ for (final walletInfo in solanaWallets) {
1513
+ final sanitizedName = walletInfo.name.replaceAll(' ', '_');
1514
+ final boxName = '${sanitizedName}_${SPLToken.boxName}';
1515
+
1516
+ Box<SPLToken> tokenBox;
1517
+ if (CakeHive.isBoxOpen(boxName)) {
1518
+ tokenBox = CakeHive.box<SPLToken>(boxName);
1519
+ } else {
1520
+ tokenBox = await CakeHive.openBox<SPLToken>(boxName);
1521
+ }
1522
+
1523
+ final xaut0Address = xaut0Token.mintAddress;
1524
+ if (!tokenBox.containsKey(xaut0Address)) {
1525
+ await tokenBox.put(xaut0Address, xaut0Token);
1526
+ }
1527
+ }
1528
+ } catch (e) {
1529
+ printV('Error in XAUT0 migration: $e');
1530
+ }
1531
+}
lib/main.dart
+1
-1
@@ -324,7 +324,7 @@ Future<void> initializeAppConfigs({bool loadWallet = true}) async {
324
payjoinSessionSource: payjoinSessionSource,
325
anonpayInvoiceInfo: anonpayInvoiceInfo,
326
havenSeedStore: havenSeedStore,
327
- initialMigrationVersion: 62,
327
+ initialMigrationVersion: 63,
328
);
329
}
330
lib/new-ui/widgets/coins_page/assets_history/asset_details_modal.dart
+1
-1
@@ -74,7 +74,7 @@ class AssetDetailsModal extends StatelessWidget {
74
child: Stack(
75
children: [
76
if (iconPath.isNotEmpty)
77
- Image.asset(iconPath, width: 75, height: 75)
77
+ CakeImageWidget(imageUrl: iconPath, width: 75, height: 75)
78
else
79
Container(
80
width: 75,
lib/new-ui/widgets/coins_page/assets_history/asset_tile.dart
+1
-1
@@ -92,7 +92,7 @@ class AssetTile extends StatelessWidget {
92
child: Stack(
93
children: [
94
if((iconPath).isNotEmpty)
95
- Image.asset(iconPath)
95
+ CakeImageWidget(imageUrl: iconPath)
96
else
97
Container(
98
width: 45,