mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-14 09:14:05 +01:00
LCW-1128-Add-support-for-Trezor (#2565)
* feat: add support for Trezor hardware wallet integration Restore Wallets * feat: add Trezor hardware wallet support, implement RLP decoding utility, and update transaction signing logic * feat: add bitcoin trezor signing * chore: update Trezor Connect dependency to specific commit hash in pubspec_base.yaml * feat: add trezor support for litecoin * feat: add colorFilter for device manufacturer icons to align with theme styles * refactor: optimize Trezor callback handling * feat: add BitBox and Trezor support for Bitcoin and Litecoin, update transaction signing logic, and improve modularity in hardware wallet services * refactor: simplify constructor assertions in `BaseBottomSheetWidget` and cleanup Trezor chainId handling logic * feat: conditionally render device manufacturers based on platform and hide SeedSigner for now
This commit is contained in:
+15
-5
@@ -112,6 +112,7 @@ import 'package:cw_core/get_height_by_date.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:ledger_flutter_plus/ledger_flutter_plus.dart' as ledger;
|
||||
import 'package:bitbox_flutter/bitbox_flutter.dart' as bitbox;
|
||||
import 'package:trezor_connect/trezor_connect.dart' as trezor;
|
||||
import 'package:blockchain_utils/blockchain_utils.dart';
|
||||
import 'package:bip39/bip39.dart' as bip39;
|
||||
""";
|
||||
@@ -138,6 +139,7 @@ import 'package:cw_bitcoin/litecoin_wallet.dart';
|
||||
import 'package:cw_bitcoin/hardware/bitcoin_ledger_service.dart';
|
||||
import 'package:cw_bitcoin/hardware/litecoin_ledger_service.dart';
|
||||
import 'package:cw_bitcoin/hardware/bitbox_service.dart';
|
||||
import 'package:cw_bitcoin/hardware/trezor_service.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
""";
|
||||
const bitcoinCwPart = "part 'cw_bitcoin.dart';";
|
||||
@@ -245,10 +247,10 @@ abstract class Bitcoin {
|
||||
void deleteSilentPaymentAddress(Object wallet, String address);
|
||||
Future<void> updateFeeRates(Object wallet);
|
||||
int getMaxCustomFeeRate(Object wallet);
|
||||
void setLedgerConnection(WalletBase wallet, ledger.LedgerConnection connection);
|
||||
void setHardwareWalletService(WalletBase wallet, HardwareWalletService service);
|
||||
HardwareWalletService getLedgerHardwareWalletService(ledger.LedgerConnection connection, bool isBitcoin);
|
||||
HardwareWalletService getBitboxHardwareWalletService(bitbox.BitboxManager manager, bool isBitcoin);
|
||||
HardwareWalletService getTrezorHardwareWalletService(trezor.TrezorConnect connect, bool isBitcoin);
|
||||
List<Output> updateOutputs(PendingTransaction pendingTransaction, List<Output> outputs);
|
||||
bool txIsReceivedSilentPayment(TransactionInfo txInfo);
|
||||
bool txIsMweb(TransactionInfo txInfo);
|
||||
@@ -697,6 +699,7 @@ import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:ledger_flutter_plus/ledger_flutter_plus.dart' as ledger;
|
||||
import 'package:bitbox_flutter/bitbox_flutter.dart' as bitbox;
|
||||
import 'package:trezor_connect/trezor_connect.dart' as trezor;
|
||||
import 'package:web3dart/web3dart.dart';
|
||||
|
||||
""";
|
||||
@@ -707,11 +710,13 @@ import 'package:cw_evm/evm_chain_transaction_credentials.dart';
|
||||
import 'package:cw_evm/evm_chain_transaction_info.dart';
|
||||
import 'package:cw_evm/evm_chain_transaction_priority.dart';
|
||||
import 'package:cw_evm/evm_chain_wallet_creation_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_ledger_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_bitbox_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_bitbox_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_ledger_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_trezor_credentials.dart';
|
||||
import 'package:cw_evm/evm_chain_wallet.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_bitbox_service.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_ledger_service.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_trezor_service.dart';
|
||||
|
||||
import 'package:cw_ethereum/ethereum_client.dart';
|
||||
import 'package:cw_ethereum/ethereum_wallet.dart';
|
||||
@@ -780,6 +785,7 @@ abstract class Ethereum {
|
||||
void setHardwareWalletService(WalletBase wallet, HardwareWalletService service);
|
||||
HardwareWalletService getLedgerHardwareWalletService(ledger.LedgerConnection connection);
|
||||
HardwareWalletService getBitboxHardwareWalletService(bitbox.BitboxManager manager);
|
||||
HardwareWalletService getTrezorHardwareWalletService(trezor.TrezorConnect connect);
|
||||
List<String> getDefaultTokenContractAddresses();
|
||||
bool isTokenAlreadyAdded(WalletBase wallet, String contractAddress);
|
||||
}
|
||||
@@ -822,6 +828,7 @@ import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:ledger_flutter_plus/ledger_flutter_plus.dart' as ledger;
|
||||
import 'package:bitbox_flutter/bitbox_flutter.dart' as bitbox;
|
||||
import 'package:trezor_connect/trezor_connect.dart' as trezor;
|
||||
import 'package:web3dart/web3dart.dart';
|
||||
|
||||
""";
|
||||
@@ -832,11 +839,13 @@ import 'package:cw_evm/evm_chain_transaction_credentials.dart';
|
||||
import 'package:cw_evm/evm_chain_transaction_info.dart';
|
||||
import 'package:cw_evm/evm_chain_transaction_priority.dart';
|
||||
import 'package:cw_evm/evm_chain_wallet_creation_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_ledger_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_bitbox_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_bitbox_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_ledger_credentials.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_trezor_credentials.dart';
|
||||
import 'package:cw_evm/evm_chain_wallet.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_bitbox_service.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_ledger_service.dart';
|
||||
import 'package:cw_evm/hardware/evm_chain_trezor_service.dart';
|
||||
|
||||
import 'package:cw_polygon/polygon_client.dart';
|
||||
import 'package:cw_polygon/polygon_wallet.dart';
|
||||
@@ -895,6 +904,7 @@ abstract class Polygon {
|
||||
void setHardwareWalletService(WalletBase wallet, HardwareWalletService service);
|
||||
HardwareWalletService getLedgerHardwareWalletService(ledger.LedgerConnection connection);
|
||||
HardwareWalletService getBitboxHardwareWalletService(bitbox.BitboxManager manager);
|
||||
HardwareWalletService getTrezorHardwareWalletService(trezor.TrezorConnect connect);
|
||||
List<String> getDefaultTokenContractAddresses();
|
||||
bool isTokenAlreadyAdded(WalletBase wallet, String contractAddress);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user