CW-1273: Implement USDT0 Bridge (#2855)

* feat: Implement USDT0 Bridging using OFT Standard by Layer Zero. POC available in apps menu.

* feat: Implement USDT0 Bridging using OFT Standard by Layer Zero. POC available in apps menu.

* feat: Implement USDT0 Bridging using OFT Standard by Layer Zero. POC available in apps menu.

* Add transaction history and status polling for USDT0 bridging

* Add  Transaction history and status polling for USDT0 Bridging

* USDT0 Bridging Implementation

* Update Arbitrum USDT token symbol

* fix: Merge conflicts

* fix: Merge conflicts

* chore: Rever formatting

* feat: Implement new flow

* feat: Implement new ui flow

* Add currency to configure

* feat: new ui flow

* Update USDT0 implementation
- Switch to sqlite for storage instead of hive
- Switch bridge history and details to modals
- Switch bridge transfer details page to new tx details ui

* refactor: rearrange modal action buttons

* enhance usdt0 bridge flows

* Update lib/entities/wallet_manager.dart [skip ci]

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
David Adegoke
2026-04-15 05:06:05 +02:00
committed by GitHub
co-authored by Omar Hatem
parent 162e0a5300
commit 586a040e4a
45 changed files with 3958 additions and 43 deletions
+34 -1
View File
@@ -7,6 +7,8 @@ import 'package:sqflite_common_ffi/sqflite_ffi.dart';
Database? db;
Future<void> _addColumnIfNotExists(
Database db, {
required String table,
@@ -39,7 +41,7 @@ Future<void> initDb({String? pathOverride}) async {
}
}
await db?.close();
db = await openDatabase(dbFile.path, version: 4,
db = await openDatabase(dbFile.path, version: 5,
onUpgrade: (Database db, int oldVersion, int newVersion) async {
printV("migrating: $oldVersion, $newVersion");
if (oldVersion <= 1) {
@@ -88,6 +90,9 @@ CREATE TABLE IF NOT EXISTS BalanceCardStyleSettings (
// if address doesn't correspond to a valid token, fallback to primary token
await _addColumnIfNotExists(db, table: "WalletInfo", column: "favoriteTokenAddress", definition: "TEXT DEFAULT NULL");
}
if (oldVersion <= 4) {
await _createBridgeTransferTable(db);
}
},
onCreate: (Database db, int version) async {
await db.execute(
@@ -185,6 +190,7 @@ CREATE TABLE BalanceCardStyleSettings (
FOREIGN KEY (walletInfoId) REFERENCES WalletInfo(walletInfoId)
);
''');
await _createBridgeTransferTable(db);
}
);
}
@@ -222,4 +228,31 @@ Future<Map<String, dynamic>> dumpCustomDb(String path) async {
ret[tableName] = await db.query(tableName);
}
return ret;
}
Future<void> _createBridgeTransferTable(Database db) async {
await db.execute('''
CREATE TABLE IF NOT EXISTS BridgeTransfer (
id TEXT NOT NULL PRIMARY KEY,
wallet_id TEXT NOT NULL,
source_chain_id INTEGER NOT NULL,
destination_chain_id INTEGER NOT NULL,
token_symbol TEXT NOT NULL,
token_contract TEXT NOT NULL,
amount TEXT NOT NULL,
recipient_address TEXT NOT NULL,
source_tx_hash TEXT NOT NULL,
status TEXT NOT NULL,
created_at INTEGER NOT NULL,
updated_at INTEGER,
confirmed_at INTEGER,
amount_raw TEXT,
error_message TEXT,
status_message TEXT
);
''');
await db.execute('''
CREATE INDEX IF NOT EXISTS idx_bridgetransfer_wallet_id
ON BridgeTransfer(wallet_id);
''');
}
+1 -1
View File
@@ -21,4 +21,4 @@ const HARDWARE_WALLET_TYPE_TYPE_ID = 19;
const MWEB_UTXO_TYPE_ID = 20;
const HAVEN_SEED_STORE_TYPE_ID = 21;
const ZANO_ASSET_TYPE_ID = 22;
const PAYJOIN_SESSION_TYPE_ID = 23;
const PAYJOIN_SESSION_TYPE_ID = 23;