import 'dart:convert'; import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/erc20_token.dart'; import 'package:cw_core/node.dart'; import 'package:cw_core/pathForWallet.dart'; import 'package:cw_core/pending_transaction.dart'; import 'package:cw_core/sync_status.dart'; import 'package:cw_core/transaction_priority.dart'; import 'package:cw_core/wallet_addresses.dart'; import 'package:cw_core/wallet_info.dart'; import 'package:cw_nano/nano_balance.dart'; import 'package:cw_nano/nano_transaction_history.dart'; import 'package:cw_nano/nano_transaction_info.dart'; import 'package:mobx/mobx.dart'; import 'package:web3dart/credentials.dart'; import 'dart:async'; import 'dart:io'; import 'package:cw_nano/nano_wallet_addresses.dart'; import 'package:cw_nano/nano_wallet_keys.dart'; import 'package:cw_core/wallet_base.dart'; import 'package:web3dart/web3dart.dart'; part 'nano_wallet.g.dart'; class NanoWallet = NanoWalletBase with _$NanoWallet; abstract class NanoWalletBase extends WalletBase with Store { NanoWalletBase({ required WalletInfo walletInfo, required String mnemonic, required String password, NanoBalance? initialBalance, }) : syncStatus = NotConnectedSyncStatus(), _password = password, _mnemonic = mnemonic, _isTransactionUpdating = false, _priorityFees = [], walletAddresses = NanoWalletAddresses(walletInfo), balance = ObservableMap.of({ CryptoCurrency.nano: initialBalance ?? NanoBalance(currentBalance: BigInt.zero, receivableBalance: BigInt.zero) }), super(walletInfo) { print("@@@@@ initializing nano wallet @@@@@"); this.walletInfo = walletInfo; transactionHistory = NanoTransactionHistory(); } final String _mnemonic; final String _password; List _priorityFees; int? _gasPrice; bool _isTransactionUpdating; @override WalletAddresses walletAddresses; @override @observable SyncStatus syncStatus; @override @observable late ObservableMap balance; Future init() async {} @override int calculateEstimatedFee(TransactionPriority priority, int? amount) { return 0; } @override Future changePassword(String password) { print("e"); throw UnimplementedError("changePassword"); } @override void close() { // _client.stop(); } @action @override Future connectToNode({required Node node}) async { print("f"); throw UnimplementedError(); } @override Future createTransaction(Object credentials) async { print("g"); throw UnimplementedError(); } Future updateTransactions() async { print("h"); throw UnimplementedError(); } @override Future> fetchTransactions() async { print("i"); throw UnimplementedError(); } @override Object get keys { print("j"); throw UnimplementedError("keys"); } @override Future rescan({required int height}) { print("k"); throw UnimplementedError("rescan"); } @override Future save() async { print("l"); throw UnimplementedError(); } @override String get seed => _mnemonic; @action @override Future startSync() async { throw UnimplementedError(); } int feeRate(TransactionPriority priority) { throw UnimplementedError(); } static Future open({ required String name, required String password, required WalletInfo walletInfo, }) async { throw UnimplementedError(); } Future _updateBalance() async { await save(); } Future _fetchErc20Balances() async { throw UnimplementedError(); } Future getPrivateKey(String mnemonic, String password) async { print("o"); throw UnimplementedError(); } Future? updateBalance() async => await _updateBalance(); Future addErc20Token(Erc20Token token) async { throw UnimplementedError(); } Future deleteErc20Token(Erc20Token token) async { throw UnimplementedError(); } void _onNewTransaction(FilterEvent event) { throw UnimplementedError(); } @override Future renameWalletFiles(String newWalletName) async { print("rename"); throw UnimplementedError(); } }