diff --git a/.gitignore b/.gitignore index 6aee5aef7..db6365d49 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,6 @@ ios/build shared_external/** cw_shared_external/** cw_haven/** + +lib/bitcoin/bitcoin.dart +lib/monero/monero.dart \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml index d74761d26..56738f471 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,10 +2,7 @@ analyzer: strong-mode: implicit-casts: false implicit-dynamic: false - exclude: - - "build/**" - - "lib/generated/*.dart" - - "**.g.dart" + exclude: [build/**, lib/generated/*.dart, lib/**.g.dart, cw_monero/ios/External/**, cw_shared_external/**, shared_external/**] linter: rules: diff --git a/cw_monero/lib/account_list.dart b/cw_monero/lib/account_list.dart deleted file mode 100644 index 79342cf3b..000000000 --- a/cw_monero/lib/account_list.dart +++ /dev/null @@ -1,83 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; -import 'package:cw_monero/signatures.dart'; -import 'package:cw_monero/types.dart'; -import 'package:cw_monero/monero_api.dart'; -import 'package:cw_monero/structs/account_row.dart'; -import 'package:flutter/foundation.dart'; -import 'package:cw_monero/wallet.dart'; - -final accountSizeNative = moneroApi - .lookup>('account_size') - .asFunction(); - -final accountRefreshNative = moneroApi - .lookup>('account_refresh') - .asFunction(); - -final accountGetAllNative = moneroApi - .lookup>('account_get_all') - .asFunction(); - -final accountAddNewNative = moneroApi - .lookup>('account_add_row') - .asFunction(); - -final accountSetLabelNative = moneroApi - .lookup>('account_set_label_row') - .asFunction(); - -bool isUpdating = false; - -void refreshAccounts() { - try { - isUpdating = true; - accountRefreshNative(); - isUpdating = false; - } catch (e) { - isUpdating = false; - rethrow; - } -} - -List getAllAccount() { - final size = accountSizeNative(); - final accountAddressesPointer = accountGetAllNative(); - final accountAddresses = accountAddressesPointer.asTypedList(size); - - return accountAddresses - .map((addr) => Pointer.fromAddress(addr).ref) - .toList(); -} - -void addAccountSync({String label}) { - final labelPointer = Utf8.toUtf8(label); - accountAddNewNative(labelPointer); - free(labelPointer); -} - -void setLabelForAccountSync({int accountIndex, String label}) { - final labelPointer = Utf8.toUtf8(label); - accountSetLabelNative(accountIndex, labelPointer); - free(labelPointer); -} - -void _addAccount(String label) => addAccountSync(label: label); - -void _setLabelForAccount(Map args) { - final label = args['label'] as String; - final accountIndex = args['accountIndex'] as int; - - setLabelForAccountSync(label: label, accountIndex: accountIndex); -} - -Future addAccount({String label}) async { - await compute(_addAccount, label); - await store(); -} - -Future setLabelForAccount({int accountIndex, String label}) async { - await compute( - _setLabelForAccount, {'accountIndex': accountIndex, 'label': label}); - await store(); -} \ No newline at end of file diff --git a/cw_monero/lib/convert_utf8_to_string.dart b/cw_monero/lib/convert_utf8_to_string.dart deleted file mode 100644 index 7fa5a68df..000000000 --- a/cw_monero/lib/convert_utf8_to_string.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; - -String convertUTF8ToString({Pointer pointer}) { - final str = Utf8.fromUtf8(pointer); - free(pointer); - return str; -} \ No newline at end of file diff --git a/cw_monero/lib/exceptions/connection_to_node_exception.dart b/cw_monero/lib/exceptions/connection_to_node_exception.dart deleted file mode 100644 index 6ee272b89..000000000 --- a/cw_monero/lib/exceptions/connection_to_node_exception.dart +++ /dev/null @@ -1,5 +0,0 @@ -class ConnectionToNodeException implements Exception { - ConnectionToNodeException({this.message}); - - final String message; -} \ No newline at end of file diff --git a/cw_monero/lib/exceptions/creation_transaction_exception.dart b/cw_monero/lib/exceptions/creation_transaction_exception.dart deleted file mode 100644 index bb477d673..000000000 --- a/cw_monero/lib/exceptions/creation_transaction_exception.dart +++ /dev/null @@ -1,8 +0,0 @@ -class CreationTransactionException implements Exception { - CreationTransactionException({this.message}); - - final String message; - - @override - String toString() => message; -} \ No newline at end of file diff --git a/cw_monero/lib/exceptions/setup_wallet_exception.dart b/cw_monero/lib/exceptions/setup_wallet_exception.dart deleted file mode 100644 index ce43c0ec6..000000000 --- a/cw_monero/lib/exceptions/setup_wallet_exception.dart +++ /dev/null @@ -1,5 +0,0 @@ -class SetupWalletException implements Exception { - SetupWalletException({this.message}); - - final String message; -} \ No newline at end of file diff --git a/cw_monero/lib/exceptions/wallet_creation_exception.dart b/cw_monero/lib/exceptions/wallet_creation_exception.dart deleted file mode 100644 index 6b00445ad..000000000 --- a/cw_monero/lib/exceptions/wallet_creation_exception.dart +++ /dev/null @@ -1,8 +0,0 @@ -class WalletCreationException implements Exception { - WalletCreationException({this.message}); - - final String message; - - @override - String toString() => message; -} \ No newline at end of file diff --git a/cw_monero/lib/exceptions/wallet_opening_exception.dart b/cw_monero/lib/exceptions/wallet_opening_exception.dart deleted file mode 100644 index 8d84b0f7e..000000000 --- a/cw_monero/lib/exceptions/wallet_opening_exception.dart +++ /dev/null @@ -1,8 +0,0 @@ -class WalletOpeningException implements Exception { - WalletOpeningException({this.message}); - - final String message; - - @override - String toString() => message; -} \ No newline at end of file diff --git a/cw_monero/lib/exceptions/wallet_restore_from_keys_exception.dart b/cw_monero/lib/exceptions/wallet_restore_from_keys_exception.dart deleted file mode 100644 index 5f08437d4..000000000 --- a/cw_monero/lib/exceptions/wallet_restore_from_keys_exception.dart +++ /dev/null @@ -1,5 +0,0 @@ -class WalletRestoreFromKeysException implements Exception { - WalletRestoreFromKeysException({this.message}); - - final String message; -} \ No newline at end of file diff --git a/cw_monero/lib/exceptions/wallet_restore_from_seed_exception.dart b/cw_monero/lib/exceptions/wallet_restore_from_seed_exception.dart deleted file mode 100644 index fd89e4161..000000000 --- a/cw_monero/lib/exceptions/wallet_restore_from_seed_exception.dart +++ /dev/null @@ -1,5 +0,0 @@ -class WalletRestoreFromSeedException implements Exception { - WalletRestoreFromSeedException({this.message}); - - final String message; -} \ No newline at end of file diff --git a/cw_monero/lib/monero_api.dart b/cw_monero/lib/monero_api.dart deleted file mode 100644 index 398d737d1..000000000 --- a/cw_monero/lib/monero_api.dart +++ /dev/null @@ -1,6 +0,0 @@ -import 'dart:ffi'; -import 'dart:io'; - -final DynamicLibrary moneroApi = Platform.isAndroid - ? DynamicLibrary.open("libcw_monero.so") - : DynamicLibrary.open("cw_monero.framework/cw_monero"); \ No newline at end of file diff --git a/cw_monero/lib/monero_output.dart b/cw_monero/lib/monero_output.dart deleted file mode 100644 index 831ee1f22..000000000 --- a/cw_monero/lib/monero_output.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'package:flutter/foundation.dart'; - -class MoneroOutput { - MoneroOutput({@required this.address, @required this.amount}); - - final String address; - final String amount; -} \ No newline at end of file diff --git a/cw_monero/lib/signatures.dart b/cw_monero/lib/signatures.dart deleted file mode 100644 index 1e8ad0fbd..000000000 --- a/cw_monero/lib/signatures.dart +++ /dev/null @@ -1,122 +0,0 @@ -import 'dart:ffi'; -import 'package:cw_monero/structs/pending_transaction.dart'; -import 'package:cw_monero/structs/ut8_box.dart'; -import 'package:ffi/ffi.dart'; - -typedef create_wallet = Int8 Function( - Pointer, Pointer, Pointer, Int32, Pointer); - -typedef restore_wallet_from_seed = Int8 Function( - Pointer, Pointer, Pointer, Int32, Int64, Pointer); - -typedef restore_wallet_from_keys = Int8 Function(Pointer, Pointer, - Pointer, Pointer, Pointer, Pointer, Int32, Int64, Pointer); - -typedef is_wallet_exist = Int8 Function(Pointer); - -typedef load_wallet = Int8 Function(Pointer, Pointer, Int8); - -typedef error_string = Pointer Function(); - -typedef get_filename = Pointer Function(); - -typedef get_seed = Pointer Function(); - -typedef get_address = Pointer Function(Int32, Int32); - -typedef get_full_balanace = Int64 Function(Int32); - -typedef get_unlocked_balanace = Int64 Function(Int32); - -typedef get_current_height = Int64 Function(); - -typedef get_node_height = Int64 Function(); - -typedef is_connected = Int8 Function(); - -typedef setup_node = Int8 Function( - Pointer, Pointer, Pointer, Int8, Int8, Pointer); - -typedef start_refresh = Void Function(); - -typedef connect_to_node = Int8 Function(); - -typedef set_refresh_from_block_height = Void Function(Int64); - -typedef set_recovering_from_seed = Void Function(Int8); - -typedef store_c = Void Function(Pointer); - -typedef set_listener = Void Function(); - -typedef get_syncing_height = Int64 Function(); - -typedef is_needed_to_refresh = Int8 Function(); - -typedef is_new_transaction_exist = Int8 Function(); - -typedef subaddrress_size = Int32 Function(); - -typedef subaddrress_refresh = Void Function(Int32); - -typedef subaddress_get_all = Pointer Function(); - -typedef subaddress_add_new = Void Function( - Int32 accountIndex, Pointer label); - -typedef subaddress_set_label = Void Function( - Int32 accountIndex, Int32 addressIndex, Pointer label); - -typedef account_size = Int32 Function(); - -typedef account_refresh = Void Function(); - -typedef account_get_all = Pointer Function(); - -typedef account_add_new = Void Function(Pointer label); - -typedef account_set_label = Void Function( - Int32 accountIndex, Pointer label); - -typedef transactions_refresh = Void Function(); - -typedef get_tx_key = Pointer Function(Pointer txId); - -typedef transactions_count = Int64 Function(); - -typedef transactions_get_all = Pointer Function(); - -typedef transaction_create = Int8 Function( - Pointer address, - Pointer paymentId, - Pointer amount, - Int8 priorityRaw, - Int32 subaddrAccount, - Pointer error, - Pointer pendingTransaction); - -typedef transaction_create_mult_dest = Int8 Function( - Pointer> addresses, - Pointer paymentId, - Pointer> amounts, - Int32 size, - Int8 priorityRaw, - Int32 subaddrAccount, - Pointer error, - Pointer pendingTransaction); - -typedef transaction_commit = Int8 Function(Pointer, Pointer); - -typedef secret_view_key = Pointer Function(); - -typedef public_view_key = Pointer Function(); - -typedef secret_spend_key = Pointer Function(); - -typedef public_spend_key = Pointer Function(); - -typedef close_current_wallet = Void Function(); - -typedef on_startup = Void Function(); - -typedef rescan_blockchain = Void Function(); diff --git a/cw_monero/lib/structs/account_row.dart b/cw_monero/lib/structs/account_row.dart deleted file mode 100644 index c3fc22de1..000000000 --- a/cw_monero/lib/structs/account_row.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; - -class AccountRow extends Struct { - @Int64() - int id; - Pointer label; - - String getLabel() => Utf8.fromUtf8(label); - int getId() => id; -} diff --git a/cw_monero/lib/structs/pending_transaction.dart b/cw_monero/lib/structs/pending_transaction.dart deleted file mode 100644 index b492f28a0..000000000 --- a/cw_monero/lib/structs/pending_transaction.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; - -class PendingTransactionRaw extends Struct { - @Int64() - int amount; - - @Int64() - int fee; - - Pointer hash; - - String getHash() => Utf8.fromUtf8(hash); -} - -class PendingTransactionDescription { - PendingTransactionDescription({this.amount, this.fee, this.hash, this.pointerAddress}); - - final int amount; - final int fee; - final String hash; - final int pointerAddress; -} \ No newline at end of file diff --git a/cw_monero/lib/structs/subaddress_row.dart b/cw_monero/lib/structs/subaddress_row.dart deleted file mode 100644 index 1673e00c7..000000000 --- a/cw_monero/lib/structs/subaddress_row.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; - -class SubaddressRow extends Struct { - @Int64() - int id; - Pointer address; - Pointer label; - - String getLabel() => Utf8.fromUtf8(label); - String getAddress() => Utf8.fromUtf8(address); - int getId() => id; -} \ No newline at end of file diff --git a/cw_monero/lib/structs/transaction_info_row.dart b/cw_monero/lib/structs/transaction_info_row.dart deleted file mode 100644 index 37b0d02e8..000000000 --- a/cw_monero/lib/structs/transaction_info_row.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; - -class TransactionInfoRow extends Struct { - @Uint64() - int amount; - - @Uint64() - int fee; - - @Uint64() - int blockHeight; - - @Uint64() - int confirmations; - - @Uint32() - int subaddrAccount; - - @Int8() - int direction; - - @Int8() - int isPending; - - @Uint32() - int subaddrIndex; - - Pointer hash; - - Pointer paymentId; - - @Int64() - int datetime; - - int getDatetime() => datetime; - int getAmount() => amount >= 0 ? amount : amount * -1; - bool getIsPending() => isPending != 0; - String getHash() => Utf8.fromUtf8(hash); - String getPaymentId() => Utf8.fromUtf8(paymentId); -} diff --git a/cw_monero/lib/structs/ut8_box.dart b/cw_monero/lib/structs/ut8_box.dart deleted file mode 100644 index a6f41bc75..000000000 --- a/cw_monero/lib/structs/ut8_box.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; - -class Utf8Box extends Struct { - Pointer value; - - String getValue() => Utf8.fromUtf8(value); -} diff --git a/cw_monero/lib/subaddress_list.dart b/cw_monero/lib/subaddress_list.dart deleted file mode 100644 index caa0fffd3..000000000 --- a/cw_monero/lib/subaddress_list.dart +++ /dev/null @@ -1,97 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; -import 'package:flutter/foundation.dart'; -import 'package:cw_monero/signatures.dart'; -import 'package:cw_monero/types.dart'; -import 'package:cw_monero/monero_api.dart'; -import 'package:cw_monero/structs/subaddress_row.dart'; -import 'package:cw_monero/wallet.dart'; - -final subaddressSizeNative = moneroApi - .lookup>('subaddrress_size') - .asFunction(); - -final subaddressRefreshNative = moneroApi - .lookup>('subaddress_refresh') - .asFunction(); - -final subaddrressGetAllNative = moneroApi - .lookup>('subaddrress_get_all') - .asFunction(); - -final subaddrressAddNewNative = moneroApi - .lookup>('subaddress_add_row') - .asFunction(); - -final subaddrressSetLabelNative = moneroApi - .lookup>('subaddress_set_label') - .asFunction(); - -bool isUpdating = false; - -void refreshSubaddresses({@required int accountIndex}) { - try { - isUpdating = true; - subaddressRefreshNative(accountIndex); - isUpdating = false; - } catch (e) { - isUpdating = false; - rethrow; - } -} - -List getAllSubaddresses() { - final size = subaddressSizeNative(); - final subaddressAddressesPointer = subaddrressGetAllNative(); - final subaddressAddresses = subaddressAddressesPointer.asTypedList(size); - - return subaddressAddresses - .map((addr) => Pointer.fromAddress(addr).ref) - .toList(); -} - -void addSubaddressSync({int accountIndex, String label}) { - final labelPointer = Utf8.toUtf8(label); - subaddrressAddNewNative(accountIndex, labelPointer); - free(labelPointer); -} - -void setLabelForSubaddressSync( - {int accountIndex, int addressIndex, String label}) { - final labelPointer = Utf8.toUtf8(label); - - subaddrressSetLabelNative(accountIndex, addressIndex, labelPointer); - free(labelPointer); -} - -void _addSubaddress(Map args) { - final label = args['label'] as String; - final accountIndex = args['accountIndex'] as int; - - addSubaddressSync(accountIndex: accountIndex, label: label); -} - -void _setLabelForSubaddress(Map args) { - final label = args['label'] as String; - final accountIndex = args['accountIndex'] as int; - final addressIndex = args['addressIndex'] as int; - - setLabelForSubaddressSync( - accountIndex: accountIndex, addressIndex: addressIndex, label: label); -} - -Future addSubaddress({int accountIndex, String label}) async { - await compute, void>( - _addSubaddress, {'accountIndex': accountIndex, 'label': label}); - await store(); -} - -Future setLabelForSubaddress( - {int accountIndex, int addressIndex, String label}) async { - await compute, void>(_setLabelForSubaddress, { - 'accountIndex': accountIndex, - 'addressIndex': addressIndex, - 'label': label - }); - await store(); -} diff --git a/cw_monero/lib/transaction_history.dart b/cw_monero/lib/transaction_history.dart deleted file mode 100644 index 0ca584778..000000000 --- a/cw_monero/lib/transaction_history.dart +++ /dev/null @@ -1,230 +0,0 @@ -import 'dart:ffi'; -import 'package:cw_monero/convert_utf8_to_string.dart'; -import 'package:cw_monero/monero_output.dart'; -import 'package:cw_monero/structs/ut8_box.dart'; -import 'package:ffi/ffi.dart'; -import 'package:flutter/foundation.dart'; -import 'package:cw_monero/signatures.dart'; -import 'package:cw_monero/types.dart'; -import 'package:cw_monero/monero_api.dart'; -import 'package:cw_monero/structs/transaction_info_row.dart'; -import 'package:cw_monero/structs/pending_transaction.dart'; -import 'package:cw_monero/exceptions/creation_transaction_exception.dart'; - -final transactionsRefreshNative = moneroApi - .lookup>('transactions_refresh') - .asFunction(); - -final transactionsCountNative = moneroApi - .lookup>('transactions_count') - .asFunction(); - -final transactionsGetAllNative = moneroApi - .lookup>('transactions_get_all') - .asFunction(); - -final transactionCreateNative = moneroApi - .lookup>('transaction_create') - .asFunction(); - -final transactionCreateMultDestNative = moneroApi - .lookup>('transaction_create_mult_dest') - .asFunction(); - -final transactionCommitNative = moneroApi - .lookup>('transaction_commit') - .asFunction(); - -final getTxKeyNative = moneroApi - .lookup>('get_tx_key') - .asFunction(); - -String getTxKey(String txId) { - final txIdPointer = Utf8.toUtf8(txId); - final keyPointer = getTxKeyNative(txIdPointer); - - free(txIdPointer); - - if (keyPointer != null) { - return convertUTF8ToString(pointer: keyPointer); - } - - return null; -} - -void refreshTransactions() => transactionsRefreshNative(); - -int countOfTransactions() => transactionsCountNative(); - -List getAllTransations() { - final size = transactionsCountNative(); - final transactionsPointer = transactionsGetAllNative(); - final transactionsAddresses = transactionsPointer.asTypedList(size); - - return transactionsAddresses - .map((addr) => Pointer.fromAddress(addr).ref) - .toList(); -} - -PendingTransactionDescription createTransactionSync( - {String address, - String paymentId, - String amount, - int priorityRaw, - int accountIndex = 0}) { - final addressPointer = Utf8.toUtf8(address); - final paymentIdPointer = Utf8.toUtf8(paymentId); - final amountPointer = amount != null ? Utf8.toUtf8(amount) : nullptr; - final errorMessagePointer = allocate(); - final pendingTransactionRawPointer = allocate(); - final created = transactionCreateNative( - addressPointer, - paymentIdPointer, - amountPointer, - priorityRaw, - accountIndex, - errorMessagePointer, - pendingTransactionRawPointer) != - 0; - - free(addressPointer); - free(paymentIdPointer); - - if (amountPointer != nullptr) { - free(amountPointer); - } - - if (!created) { - final message = errorMessagePointer.ref.getValue(); - free(errorMessagePointer); - throw CreationTransactionException(message: message); - } - - return PendingTransactionDescription( - amount: pendingTransactionRawPointer.ref.amount, - fee: pendingTransactionRawPointer.ref.fee, - hash: pendingTransactionRawPointer.ref.getHash(), - pointerAddress: pendingTransactionRawPointer.address); -} - -PendingTransactionDescription createTransactionMultDestSync( - {List outputs, - String paymentId, - int priorityRaw, - int accountIndex = 0}) { - final int size = outputs.length; - final List> addressesPointers = outputs.map((output) => - Utf8.toUtf8(output.address)).toList(); - final Pointer> addressesPointerPointer = allocate(count: size); - final List> amountsPointers = outputs.map((output) => - Utf8.toUtf8(output.amount)).toList(); - final Pointer> amountsPointerPointer = allocate(count: size); - - for (int i = 0; i < size; i++) { - addressesPointerPointer[i] = addressesPointers[i]; - amountsPointerPointer[i] = amountsPointers[i]; - } - - final paymentIdPointer = Utf8.toUtf8(paymentId); - final errorMessagePointer = allocate(); - final pendingTransactionRawPointer = allocate(); - final created = transactionCreateMultDestNative( - addressesPointerPointer, - paymentIdPointer, - amountsPointerPointer, - size, - priorityRaw, - accountIndex, - errorMessagePointer, - pendingTransactionRawPointer) != - 0; - - free(addressesPointerPointer); - free(amountsPointerPointer); - - addressesPointers.forEach((element) => free(element)); - amountsPointers.forEach((element) => free(element)); - - free(paymentIdPointer); - - if (!created) { - final message = errorMessagePointer.ref.getValue(); - free(errorMessagePointer); - throw CreationTransactionException(message: message); - } - - return PendingTransactionDescription( - amount: pendingTransactionRawPointer.ref.amount, - fee: pendingTransactionRawPointer.ref.fee, - hash: pendingTransactionRawPointer.ref.getHash(), - pointerAddress: pendingTransactionRawPointer.address); -} - -void commitTransactionFromPointerAddress({int address}) => commitTransaction( - transactionPointer: Pointer.fromAddress(address)); - -void commitTransaction({Pointer transactionPointer}) { - final errorMessagePointer = allocate(); - final isCommited = - transactionCommitNative(transactionPointer, errorMessagePointer) != 0; - - if (!isCommited) { - final message = errorMessagePointer.ref.getValue(); - free(errorMessagePointer); - throw CreationTransactionException(message: message); - } -} - -PendingTransactionDescription _createTransactionSync(Map args) { - final address = args['address'] as String; - final paymentId = args['paymentId'] as String; - final amount = args['amount'] as String; - final priorityRaw = args['priorityRaw'] as int; - final accountIndex = args['accountIndex'] as int; - - return createTransactionSync( - address: address, - paymentId: paymentId, - amount: amount, - priorityRaw: priorityRaw, - accountIndex: accountIndex); -} - -PendingTransactionDescription _createTransactionMultDestSync(Map args) { - final outputs = args['outputs'] as List; - final paymentId = args['paymentId'] as String; - final priorityRaw = args['priorityRaw'] as int; - final accountIndex = args['accountIndex'] as int; - - return createTransactionMultDestSync( - outputs: outputs, - paymentId: paymentId, - priorityRaw: priorityRaw, - accountIndex: accountIndex); -} - -Future createTransaction( - {String address, - String paymentId = '', - String amount, - int priorityRaw, - int accountIndex = 0}) => - compute(_createTransactionSync, { - 'address': address, - 'paymentId': paymentId, - 'amount': amount, - 'priorityRaw': priorityRaw, - 'accountIndex': accountIndex - }); - -Future createTransactionMultDest( - {List outputs, - String paymentId = '', - int priorityRaw, - int accountIndex = 0}) => - compute(_createTransactionMultDestSync, { - 'outputs': outputs, - 'paymentId': paymentId, - 'priorityRaw': priorityRaw, - 'accountIndex': accountIndex - }); diff --git a/cw_monero/lib/types.dart b/cw_monero/lib/types.dart deleted file mode 100644 index b972231e6..000000000 --- a/cw_monero/lib/types.dart +++ /dev/null @@ -1,120 +0,0 @@ -import 'dart:ffi'; -import 'package:cw_monero/structs/pending_transaction.dart'; -import 'package:cw_monero/structs/ut8_box.dart'; -import 'package:ffi/ffi.dart'; - -typedef CreateWallet = int Function( - Pointer, Pointer, Pointer, int, Pointer); - -typedef RestoreWalletFromSeed = int Function( - Pointer, Pointer, Pointer, int, int, Pointer); - -typedef RestoreWalletFromKeys = int Function(Pointer, Pointer, - Pointer, Pointer, Pointer, Pointer, int, int, Pointer); - -typedef IsWalletExist = int Function(Pointer); - -typedef LoadWallet = int Function(Pointer, Pointer, int); - -typedef ErrorString = Pointer Function(); - -typedef GetFilename = Pointer Function(); - -typedef GetSeed = Pointer Function(); - -typedef GetAddress = Pointer Function(int, int); - -typedef GetFullBalance = int Function(int); - -typedef GetUnlockedBalance = int Function(int); - -typedef GetCurrentHeight = int Function(); - -typedef GetNodeHeight = int Function(); - -typedef IsConnected = int Function(); - -typedef SetupNode = int Function( - Pointer, Pointer, Pointer, int, int, Pointer); - -typedef StartRefresh = void Function(); - -typedef ConnectToNode = int Function(); - -typedef SetRefreshFromBlockHeight = void Function(int); - -typedef SetRecoveringFromSeed = void Function(int); - -typedef Store = void Function(Pointer); - -typedef SetListener = void Function(); - -typedef GetSyncingHeight = int Function(); - -typedef IsNeededToRefresh = int Function(); - -typedef IsNewTransactionExist = int Function(); - -typedef SubaddressSize = int Function(); - -typedef SubaddressRefresh = void Function(int); - -typedef SubaddressGetAll = Pointer Function(); - -typedef SubaddressAddNew = void Function(int accountIndex, Pointer label); - -typedef SubaddressSetLabel = void Function( - int accountIndex, int addressIndex, Pointer label); - -typedef AccountSize = int Function(); - -typedef AccountRefresh = void Function(); - -typedef AccountGetAll = Pointer Function(); - -typedef AccountAddNew = void Function(Pointer label); - -typedef AccountSetLabel = void Function(int accountIndex, Pointer label); - -typedef TransactionsRefresh = void Function(); - -typedef GetTxKey = Pointer Function(Pointer txId); - -typedef TransactionsCount = int Function(); - -typedef TransactionsGetAll = Pointer Function(); - -typedef TransactionCreate = int Function( - Pointer address, - Pointer paymentId, - Pointer amount, - int priorityRaw, - int subaddrAccount, - Pointer error, - Pointer pendingTransaction); - -typedef TransactionCreateMultDest = int Function( - Pointer> addresses, - Pointer paymentId, - Pointer> amounts, - int size, - int priorityRaw, - int subaddrAccount, - Pointer error, - Pointer pendingTransaction); - -typedef TransactionCommit = int Function(Pointer, Pointer); - -typedef SecretViewKey = Pointer Function(); - -typedef PublicViewKey = Pointer Function(); - -typedef SecretSpendKey = Pointer Function(); - -typedef PublicSpendKey = Pointer Function(); - -typedef CloseCurrentWallet = void Function(); - -typedef OnStartup = void Function(); - -typedef RescanBlockchainAsync = void Function(); \ No newline at end of file diff --git a/cw_monero/lib/wallet.dart b/cw_monero/lib/wallet.dart deleted file mode 100644 index 34f94b275..000000000 --- a/cw_monero/lib/wallet.dart +++ /dev/null @@ -1,329 +0,0 @@ -import 'dart:async'; -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; -import 'package:cw_monero/convert_utf8_to_string.dart'; -import 'package:cw_monero/signatures.dart'; -import 'package:cw_monero/types.dart'; -import 'package:cw_monero/monero_api.dart'; -import 'package:cw_monero/exceptions/setup_wallet_exception.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -int _boolToInt(bool value) => value ? 1 : 0; - -final getFileNameNative = moneroApi - .lookup>('get_filename') - .asFunction(); - -final getSeedNative = - moneroApi.lookup>('seed').asFunction(); - -final getAddressNative = moneroApi - .lookup>('get_address') - .asFunction(); - -final getFullBalanceNative = moneroApi - .lookup>('get_full_balance') - .asFunction(); - -final getUnlockedBalanceNative = moneroApi - .lookup>('get_unlocked_balance') - .asFunction(); - -final getCurrentHeightNative = moneroApi - .lookup>('get_current_height') - .asFunction(); - -final getNodeHeightNative = moneroApi - .lookup>('get_node_height') - .asFunction(); - -final isConnectedNative = moneroApi - .lookup>('is_connected') - .asFunction(); - -final setupNodeNative = moneroApi - .lookup>('setup_node') - .asFunction(); - -final startRefreshNative = moneroApi - .lookup>('start_refresh') - .asFunction(); - -final connecToNodeNative = moneroApi - .lookup>('connect_to_node') - .asFunction(); - -final setRefreshFromBlockHeightNative = moneroApi - .lookup>( - 'set_refresh_from_block_height') - .asFunction(); - -final setRecoveringFromSeedNative = moneroApi - .lookup>( - 'set_recovering_from_seed') - .asFunction(); - -final storeNative = - moneroApi.lookup>('store').asFunction(); - -final setListenerNative = moneroApi - .lookup>('set_listener') - .asFunction(); - -final getSyncingHeightNative = moneroApi - .lookup>('get_syncing_height') - .asFunction(); - -final isNeededToRefreshNative = moneroApi - .lookup>('is_needed_to_refresh') - .asFunction(); - -final isNewTransactionExistNative = moneroApi - .lookup>( - 'is_new_transaction_exist') - .asFunction(); - -final getSecretViewKeyNative = moneroApi - .lookup>('secret_view_key') - .asFunction(); - -final getPublicViewKeyNative = moneroApi - .lookup>('public_view_key') - .asFunction(); - -final getSecretSpendKeyNative = moneroApi - .lookup>('secret_spend_key') - .asFunction(); - -final getPublicSpendKeyNative = moneroApi - .lookup>('public_spend_key') - .asFunction(); - -final closeCurrentWalletNative = moneroApi - .lookup>('close_current_wallet') - .asFunction(); - -final onStartupNative = moneroApi - .lookup>('on_startup') - .asFunction(); - -final rescanBlockchainAsyncNative = moneroApi - .lookup>('rescan_blockchain') - .asFunction(); - -int getSyncingHeight() => getSyncingHeightNative(); - -bool isNeededToRefresh() => isNeededToRefreshNative() != 0; - -bool isNewTransactionExist() => isNewTransactionExistNative() != 0; - -String getFilename() => convertUTF8ToString(pointer: getFileNameNative()); - -String getSeed() => convertUTF8ToString(pointer: getSeedNative()); - -String getAddress({int accountIndex = 0, int addressIndex = 0}) => - convertUTF8ToString(pointer: getAddressNative(accountIndex, addressIndex)); - -int getFullBalance({int accountIndex = 0}) => - getFullBalanceNative(accountIndex); - -int getUnlockedBalance({int accountIndex = 0}) => - getUnlockedBalanceNative(accountIndex); - -int getCurrentHeight() => getCurrentHeightNative(); - -int getNodeHeightSync() => getNodeHeightNative(); - -bool isConnectedSync() => isConnectedNative() != 0; - -bool setupNodeSync( - {String address, - String login, - String password, - bool useSSL = false, - bool isLightWallet = false}) { - final addressPointer = Utf8.toUtf8(address); - Pointer loginPointer; - Pointer passwordPointer; - - if (login != null) { - loginPointer = Utf8.toUtf8(login); - } - - if (password != null) { - passwordPointer = Utf8.toUtf8(password); - } - - final errorMessagePointer = allocate(); - final isSetupNode = setupNodeNative( - addressPointer, - loginPointer, - passwordPointer, - _boolToInt(useSSL), - _boolToInt(isLightWallet), - errorMessagePointer) != - 0; - - free(addressPointer); - free(loginPointer); - free(passwordPointer); - - if (!isSetupNode) { - throw SetupWalletException( - message: convertUTF8ToString(pointer: errorMessagePointer)); - } - - return isSetupNode; -} - -void startRefreshSync() => startRefreshNative(); - -Future connectToNode() async => connecToNodeNative() != 0; - -void setRefreshFromBlockHeight({int height}) => - setRefreshFromBlockHeightNative(height); - -void setRecoveringFromSeed({bool isRecovery}) => - setRecoveringFromSeedNative(_boolToInt(isRecovery)); - -void storeSync() { - final pathPointer = Utf8.toUtf8(''); - storeNative(pathPointer); - free(pathPointer); -} - -void closeCurrentWallet() => closeCurrentWalletNative(); - -String getSecretViewKey() => - convertUTF8ToString(pointer: getSecretViewKeyNative()); - -String getPublicViewKey() => - convertUTF8ToString(pointer: getPublicViewKeyNative()); - -String getSecretSpendKey() => - convertUTF8ToString(pointer: getSecretSpendKeyNative()); - -String getPublicSpendKey() => - convertUTF8ToString(pointer: getPublicSpendKeyNative()); - -class SyncListener { - SyncListener(this.onNewBlock, this.onNewTransaction) { - _cachedBlockchainHeight = 0; - _lastKnownBlockHeight = 0; - _initialSyncHeight = 0; - } - - void Function(int, int, double) onNewBlock; - void Function() onNewTransaction; - - Timer _updateSyncInfoTimer; - int _cachedBlockchainHeight; - int _lastKnownBlockHeight; - int _initialSyncHeight; - - Future getNodeHeightOrUpdate(int baseHeight) async { - if (_cachedBlockchainHeight < baseHeight || _cachedBlockchainHeight == 0) { - _cachedBlockchainHeight = await getNodeHeight(); - } - - return _cachedBlockchainHeight; - } - - void start() { - _cachedBlockchainHeight = 0; - _lastKnownBlockHeight = 0; - _initialSyncHeight = 0; - _updateSyncInfoTimer ??= - Timer.periodic(Duration(milliseconds: 1200), (_) async { - if (isNewTransactionExist()) { - onNewTransaction?.call(); - } - - var syncHeight = getSyncingHeight(); - - if (syncHeight <= 0) { - syncHeight = getCurrentHeight(); - } - - if (_initialSyncHeight <= 0) { - _initialSyncHeight = syncHeight; - } - - final bchHeight = await getNodeHeightOrUpdate(syncHeight); - - if (_lastKnownBlockHeight == syncHeight || syncHeight == null) { - return; - } - - _lastKnownBlockHeight = syncHeight; - final track = bchHeight - _initialSyncHeight; - final diff = track - (bchHeight - syncHeight); - final ptc = diff <= 0 ? 0.0 : diff / track; - final left = bchHeight - syncHeight; - - if (syncHeight < 0 || left < 0) { - return; - } - - // 1. Actual new height; 2. Blocks left to finish; 3. Progress in percents; - onNewBlock?.call(syncHeight, left, ptc); - }); - } - - void stop() => _updateSyncInfoTimer?.cancel(); -} - -SyncListener setListeners(void Function(int, int, double) onNewBlock, - void Function() onNewTransaction) { - final listener = SyncListener(onNewBlock, onNewTransaction); - setListenerNative(); - return listener; -} - -void onStartup() => onStartupNative(); - -void _storeSync(Object _) => storeSync(); - -bool _setupNodeSync(Map args) { - final address = args['address'] as String; - final login = (args['login'] ?? '') as String; - final password = (args['password'] ?? '') as String; - final useSSL = args['useSSL'] as bool; - final isLightWallet = args['isLightWallet'] as bool; - - return setupNodeSync( - address: address, - login: login, - password: password, - useSSL: useSSL, - isLightWallet: isLightWallet); -} - -bool _isConnected(Object _) => isConnectedSync(); - -int _getNodeHeight(Object _) => getNodeHeightSync(); - -void startRefresh() => startRefreshSync(); - -Future setupNode( - {String address, - String login, - String password, - bool useSSL = false, - bool isLightWallet = false}) => - compute, void>(_setupNodeSync, { - 'address': address, - 'login': login, - 'password': password, - 'useSSL': useSSL, - 'isLightWallet': isLightWallet - }); - -Future store() => compute(_storeSync, 0); - -Future isConnected() => compute(_isConnected, 0); - -Future getNodeHeight() => compute(_getNodeHeight, 0); - -void rescanBlockchainAsync() => rescanBlockchainAsyncNative(); diff --git a/cw_monero/lib/wallet_manager.dart b/cw_monero/lib/wallet_manager.dart deleted file mode 100644 index 2400c5f3f..000000000 --- a/cw_monero/lib/wallet_manager.dart +++ /dev/null @@ -1,248 +0,0 @@ -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; -import 'package:flutter/foundation.dart'; -import 'package:cw_monero/convert_utf8_to_string.dart'; -import 'package:cw_monero/signatures.dart'; -import 'package:cw_monero/types.dart'; -import 'package:cw_monero/monero_api.dart'; -import 'package:cw_monero/wallet.dart'; -import 'package:cw_monero/exceptions/wallet_opening_exception.dart'; -import 'package:cw_monero/exceptions/wallet_creation_exception.dart'; -import 'package:cw_monero/exceptions/wallet_restore_from_keys_exception.dart'; -import 'package:cw_monero/exceptions/wallet_restore_from_seed_exception.dart'; - -final createWalletNative = moneroApi - .lookup>('create_wallet') - .asFunction(); - -final restoreWalletFromSeedNative = moneroApi - .lookup>( - 'restore_wallet_from_seed') - .asFunction(); - -final restoreWalletFromKeysNative = moneroApi - .lookup>( - 'restore_wallet_from_keys') - .asFunction(); - -final isWalletExistNative = moneroApi - .lookup>('is_wallet_exist') - .asFunction(); - -final loadWalletNative = moneroApi - .lookup>('load_wallet') - .asFunction(); - -final errorStringNative = moneroApi - .lookup>('error_string') - .asFunction(); - -void createWalletSync( - {String path, String password, String language, int nettype = 0}) { - final pathPointer = Utf8.toUtf8(path); - final passwordPointer = Utf8.toUtf8(password); - final languagePointer = Utf8.toUtf8(language); - final errorMessagePointer = allocate(); - final isWalletCreated = createWalletNative(pathPointer, passwordPointer, - languagePointer, nettype, errorMessagePointer) != - 0; - - free(pathPointer); - free(passwordPointer); - free(languagePointer); - - if (!isWalletCreated) { - throw WalletCreationException( - message: convertUTF8ToString(pointer: errorMessagePointer)); - } - - // setupNodeSync(address: "node.moneroworld.com:18089"); -} - -bool isWalletExistSync({String path}) { - final pathPointer = Utf8.toUtf8(path); - final isExist = isWalletExistNative(pathPointer) != 0; - - free(pathPointer); - - return isExist; -} - -void restoreWalletFromSeedSync( - {String path, - String password, - String seed, - int nettype = 0, - int restoreHeight = 0}) { - final pathPointer = Utf8.toUtf8(path); - final passwordPointer = Utf8.toUtf8(password); - final seedPointer = Utf8.toUtf8(seed); - final errorMessagePointer = allocate(); - final isWalletRestored = restoreWalletFromSeedNative( - pathPointer, - passwordPointer, - seedPointer, - nettype, - restoreHeight, - errorMessagePointer) != - 0; - - free(pathPointer); - free(passwordPointer); - free(seedPointer); - - if (!isWalletRestored) { - throw WalletRestoreFromSeedException( - message: convertUTF8ToString(pointer: errorMessagePointer)); - } -} - -void restoreWalletFromKeysSync( - {String path, - String password, - String language, - String address, - String viewKey, - String spendKey, - int nettype = 0, - int restoreHeight = 0}) { - final pathPointer = Utf8.toUtf8(path); - final passwordPointer = Utf8.toUtf8(password); - final languagePointer = Utf8.toUtf8(language); - final addressPointer = Utf8.toUtf8(address); - final viewKeyPointer = Utf8.toUtf8(viewKey); - final spendKeyPointer = Utf8.toUtf8(spendKey); - final errorMessagePointer = allocate(); - final isWalletRestored = restoreWalletFromKeysNative( - pathPointer, - passwordPointer, - languagePointer, - addressPointer, - viewKeyPointer, - spendKeyPointer, - nettype, - restoreHeight, - errorMessagePointer) != - 0; - - free(pathPointer); - free(passwordPointer); - free(languagePointer); - free(addressPointer); - free(viewKeyPointer); - free(spendKeyPointer); - - if (!isWalletRestored) { - throw WalletRestoreFromKeysException( - message: convertUTF8ToString(pointer: errorMessagePointer)); - } -} - -void loadWallet({String path, String password, int nettype = 0}) { - final pathPointer = Utf8.toUtf8(path); - final passwordPointer = Utf8.toUtf8(password); - final loaded = loadWalletNative(pathPointer, passwordPointer, nettype) != 0; - free(pathPointer); - free(passwordPointer); - - if (!loaded) { - throw WalletOpeningException( - message: convertUTF8ToString(pointer: errorStringNative())); - } -} - -void _createWallet(Map args) { - final path = args['path'] as String; - final password = args['password'] as String; - final language = args['language'] as String; - - createWalletSync(path: path, password: password, language: language); -} - -void _restoreFromSeed(Map args) { - final path = args['path'] as String; - final password = args['password'] as String; - final seed = args['seed'] as String; - final restoreHeight = args['restoreHeight'] as int; - - restoreWalletFromSeedSync( - path: path, password: password, seed: seed, restoreHeight: restoreHeight); -} - -void _restoreFromKeys(Map args) { - final path = args['path'] as String; - final password = args['password'] as String; - final language = args['language'] as String; - final restoreHeight = args['restoreHeight'] as int; - final address = args['address'] as String; - final viewKey = args['viewKey'] as String; - final spendKey = args['spendKey'] as String; - - restoreWalletFromKeysSync( - path: path, - password: password, - language: language, - restoreHeight: restoreHeight, - address: address, - viewKey: viewKey, - spendKey: spendKey); -} - -Future _openWallet(Map args) async => - loadWallet(path: args['path'], password: args['password']); - -bool _isWalletExist(String path) => isWalletExistSync(path: path); - -void openWallet({String path, String password, int nettype = 0}) async => - loadWallet(path: path, password: password, nettype: nettype); - -Future openWalletAsync(Map args) async => - compute(_openWallet, args); - -Future createWallet( - {String path, - String password, - String language, - int nettype = 0}) async => - compute(_createWallet, { - 'path': path, - 'password': password, - 'language': language, - 'nettype': nettype - }); - -Future restoreFromSeed( - {String path, - String password, - String seed, - int nettype = 0, - int restoreHeight = 0}) async => - compute, void>(_restoreFromSeed, { - 'path': path, - 'password': password, - 'seed': seed, - 'nettype': nettype, - 'restoreHeight': restoreHeight - }); - -Future restoreFromKeys( - {String path, - String password, - String language, - String address, - String viewKey, - String spendKey, - int nettype = 0, - int restoreHeight = 0}) async => - compute, void>(_restoreFromKeys, { - 'path': path, - 'password': password, - 'language': language, - 'address': address, - 'viewKey': viewKey, - 'spendKey': spendKey, - 'nettype': nettype, - 'restoreHeight': restoreHeight - }); - -Future isWalletExist({String path}) => compute(_isWalletExist, path); diff --git a/cw_monero/pubspec.lock b/cw_monero/pubspec.lock index d44aacc6b..c9289a003 100644 --- a/cw_monero/pubspec.lock +++ b/cw_monero/pubspec.lock @@ -1,6 +1,27 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "14.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.41.2" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" async: dependency: transitive description: @@ -15,6 +36,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.2" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.6" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.10" + build_resolvers: + dependency: "direct dev" + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.3" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.5" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.10" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.3" characters: dependency: transitive description: @@ -29,6 +106,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" clock: dependency: transitive description: @@ -36,6 +127,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" collection: dependency: transitive description: @@ -43,6 +141,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.15.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + cw_core: + dependency: "direct main" + description: + path: "../cw_core" + relative: true + source: path + version: "0.0.1" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.12" + dartx: + dependency: transitive + description: + name: dartx + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.0" fake_async: dependency: transitive description: @@ -57,16 +190,121 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_mobx: + dependency: "direct main" + description: + name: flutter_mobx + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0+2" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + hive: + dependency: transitive + description: + name: hive + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0-nullsafety.2" + hive_generator: + dependency: "direct dev" + description: + name: hive_generator + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.2" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" matcher: dependency: transitive description: @@ -81,6 +319,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + mobx: + dependency: "direct main" + description: + name: mobx + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1+4" + mobx_codegen: + dependency: "direct dev" + description: + name: mobx_codegen + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" path: dependency: transitive description: @@ -95,6 +361,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.4.0" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" platform: dependency: transitive description: @@ -102,11 +375,53 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.1" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.9" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.4+1" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.10+3" source_span: dependency: transitive description: @@ -128,6 +443,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" string_scanner: dependency: transitive description: @@ -149,6 +471,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.19" + time: + dependency: transitive + description: + name: time + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+3" typed_data: dependency: transitive description: @@ -163,6 +499,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" sdks: - dart: ">=2.12.0-0.0 <3.0.0" - flutter: ">=0.1.4" + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/cw_monero/pubspec.yaml b/cw_monero/pubspec.yaml index 79229759c..4967c1e5f 100644 --- a/cw_monero/pubspec.yaml +++ b/cw_monero/pubspec.yaml @@ -12,10 +12,20 @@ dependencies: sdk: flutter ffi: ^0.1.3 path_provider: ^1.4.0 + http: ^0.12.0+2 + mobx: ^1.2.1+2 + flutter_mobx: ^1.1.0+2 + intl: ^0.17.0 + cw_core: + path: ../cw_core dev_dependencies: flutter_test: sdk: flutter + build_runner: ^1.10.3 + build_resolvers: ^1.3.10 + mobx_codegen: ^1.1.0+1 + hive_generator: ^0.8.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 8ac179b9f..e318cd4f8 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -196,4 +196,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: bc2591d23316907c9c90ca1cd2fce063fd866508 -COCOAPODS: 1.9.3 +COCOAPODS: 1.10.2 diff --git a/lib/bitcoin/address_to_output_script.dart b/lib/bitcoin/address_to_output_script.dart deleted file mode 100644 index 01c7b67a5..000000000 --- a/lib/bitcoin/address_to_output_script.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'dart:typed_data'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:bs58check/bs58check.dart' as bs58check; -import 'package:bitcoin_flutter/src/utils/constants/op.dart'; -import 'package:bitcoin_flutter/src/utils/script.dart' as bscript; -import 'package:bitcoin_flutter/src/address.dart'; - -Uint8List p2shAddressToOutputScript(String address) { - final decodeBase58 = bs58check.decode(address); - final hash = decodeBase58.sublist(1); - return bscript.compile([OPS['OP_HASH160'], hash, OPS['OP_EQUAL']]); -} - -Uint8List addressToOutputScript( - String address, bitcoin.NetworkType networkType) { - try { - // FIXME: improve validation for p2sh addresses - // 3 for bitcoin - // m for litecoin - if (address.startsWith('3') || address.toLowerCase().startsWith('m')) { - return p2shAddressToOutputScript(address); - } - - return Address.addressToOutputScript(address, networkType); - } catch (err) { - print(err); - return Uint8List(0); - } -} diff --git a/lib/bitcoin/bitcoin_address_record.dart b/lib/bitcoin/bitcoin_address_record.dart deleted file mode 100644 index 5e3967308..000000000 --- a/lib/bitcoin/bitcoin_address_record.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'dart:convert'; - -class BitcoinAddressRecord { - BitcoinAddressRecord(this.address, {this.index, bool isHidden}) - : _isHidden = isHidden; - - factory BitcoinAddressRecord.fromJSON(String jsonSource) { - final decoded = json.decode(jsonSource) as Map; - - return BitcoinAddressRecord(decoded['address'] as String, - index: decoded['index'] as int, isHidden: decoded['isHidden'] as bool); - } - - @override - bool operator ==(Object o) => - o is BitcoinAddressRecord && address == o.address; - - final String address; - bool get isHidden => _isHidden ?? false; - int index; - final bool _isHidden; - - @override - int get hashCode => address.hashCode; - - String toJSON() => - json.encode({'address': address, 'index': index, 'isHidden': isHidden}); -} diff --git a/lib/bitcoin/bitcoin_amount_format.dart b/lib/bitcoin/bitcoin_amount_format.dart deleted file mode 100644 index 714fc5a97..000000000 --- a/lib/bitcoin/bitcoin_amount_format.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'dart:math'; - -import 'package:intl/intl.dart'; -import 'package:cake_wallet/entities/crypto_amount_format.dart'; - -const bitcoinAmountLength = 8; -const bitcoinAmountDivider = 100000000; -final bitcoinAmountFormat = NumberFormat() - ..maximumFractionDigits = bitcoinAmountLength - ..minimumFractionDigits = 1; - -String bitcoinAmountToString({int amount}) => bitcoinAmountFormat.format( - cryptoAmountToDouble(amount: amount, divider: bitcoinAmountDivider)); - -double bitcoinAmountToDouble({int amount}) => - cryptoAmountToDouble(amount: amount, divider: bitcoinAmountDivider); - -int stringDoubleToBitcoinAmount(String amount) { - int result = 0; - - try { - result = (double.parse(amount) * bitcoinAmountDivider).toInt(); - } catch (e) { - result = 0; - } - - return result; -} diff --git a/lib/bitcoin/bitcoin_commit_transaction_exception.dart b/lib/bitcoin/bitcoin_commit_transaction_exception.dart deleted file mode 100644 index 3e21bae81..000000000 --- a/lib/bitcoin/bitcoin_commit_transaction_exception.dart +++ /dev/null @@ -1,4 +0,0 @@ -class BitcoinCommitTransactionException implements Exception { - @override - String toString() => 'Transaction commit is failed.'; -} \ No newline at end of file diff --git a/lib/bitcoin/bitcoin_mnemonic.dart b/lib/bitcoin/bitcoin_mnemonic.dart deleted file mode 100644 index 4f56161e0..000000000 --- a/lib/bitcoin/bitcoin_mnemonic.dart +++ /dev/null @@ -1,2297 +0,0 @@ -import 'dart:convert'; -import 'dart:math'; -import 'dart:typed_data'; -import 'package:crypto/crypto.dart'; -import 'package:unorm_dart/unorm_dart.dart' as unorm; -import 'package:cryptography/cryptography.dart' as cryptography; -import 'package:cake_wallet/core/sec_random_native.dart'; - -const segwit = '100'; -final wordlist = englishWordlist; - -double logBase(num x, num base) => log(x) / log(base); - -String mnemonicEncode(int i) { - var _i = i; - final n = wordlist.length; - final words = []; - - while (_i > 0) { - final x = i % n; - _i = (i / n).floor(); - words.add(wordlist[x]); - } - - return words.join(' '); -} - -int mnemonicDecode(String seed) { - var i = 0; - final n = wordlist.length; - final words = seed.split(' '); - - while (words.length > 0) { - final word = words.removeLast(); - final k = wordlist.indexOf(word); - i = i * n + k; - } - - return i; -} - -bool isNewSeed(String seed, {String prefix = segwit}) { - final hmacSha512 = Hmac(sha512, utf8.encode('Seed version')); - final digest = hmacSha512.convert(utf8.encode(normalizeText(seed))); - final hx = digest.toString(); - return hx.startsWith(prefix.toLowerCase()); -} - -void maskBytes(Uint8List bytes, int bits) { - final skipCount = (bits / 8).floor(); - var lastByte = (1 << bits % 8) - 1; - - for (var i = bytes.length - 1 - skipCount; i >= 0; i--) { - bytes[i] &= lastByte; - - if (lastByte > 0) { - lastByte = 0; - } - } -} - -String bufferToBin(Uint8List data) { - final q1 = data.map((e) => e.toRadixString(2).padLeft(8, '0')); - final q2 = q1.join(''); - return q2; -} - -String encode(Uint8List data) { - final dataBitLen = data.length * 8; - final wordBitLen = logBase(wordlist.length, 2).ceil(); - final wordCount = (dataBitLen / wordBitLen).floor(); - maskBytes(data, wordCount * wordBitLen); - final bin = bufferToBin(data); - final binStr = bin.substring(bin.length - (wordCount * wordBitLen)); - final result = []; - - for (var i = 0; i < wordCount; i++) { - final wordBin = binStr.substring(i * wordBitLen, (i + 1) * wordBitLen); - result.add(wordlist[int.parse(wordBin, radix: 2)]); - } - - return result.join(' '); -} - -List prefixMatches(String source, List prefixes) { - final hmacSha512 = Hmac(sha512, utf8.encode('Seed version')); - final digest = hmacSha512.convert(utf8.encode(normalizeText(source))); - final hx = digest.toString(); - - return prefixes.map((prefix) => hx.startsWith(prefix.toLowerCase())).toList(); -} - -Future generateMnemonic( - {int strength = 264, String prefix = segwit}) async { - final wordBitlen = logBase(wordlist.length, 2).ceil(); - final wordCount = strength / wordBitlen; - final byteCount = ((wordCount * wordBitlen).ceil() / 8).ceil(); - var result = ''; - - do { - final bytes = await secRandom(byteCount); - maskBytes(bytes, strength); - result = encode(bytes); - } while (!prefixMatches(result, [prefix]).first); - - return result; -} - -Uint8List mnemonicToSeedBytes(String mnemonic, {String prefix = segwit}) { - final pbkdf2 = cryptography.Pbkdf2( - macAlgorithm: cryptography.Hmac(cryptography.sha512), - iterations: 2048, - bits: 512); - final text = normalizeText(mnemonic); - - return pbkdf2.deriveBitsSync(text.codeUnits, - nonce: cryptography.Nonce('electrum'.codeUnits)); -} - -bool matchesAnyPrefix(String mnemonic) => - prefixMatches(mnemonic, [segwit]).any((el) => el); - -bool validateMnemonic(String mnemonic, {String prefix = segwit}) { - try { - return matchesAnyPrefix(mnemonic); - } catch (e) { - return false; - } -} - -final COMBININGCODEPOINTS = combiningcodepoints(); - -List combiningcodepoints() { - final source = '300:34e|350:36f|483:487|591:5bd|5bf|5c1|5c2|5c4|5c5|5c7|610:61a|64b:65f|670|' + - '6d6:6dc|6df:6e4|6e7|6e8|6ea:6ed|711|730:74a|7eb:7f3|816:819|81b:823|825:827|' + - '829:82d|859:85b|8d4:8e1|8e3:8ff|93c|94d|951:954|9bc|9cd|a3c|a4d|abc|acd|b3c|' + - 'b4d|bcd|c4d|c55|c56|cbc|ccd|d4d|dca|e38:e3a|e48:e4b|eb8|eb9|ec8:ecb|f18|f19|' + - 'f35|f37|f39|f71|f72|f74|f7a:f7d|f80|f82:f84|f86|f87|fc6|1037|1039|103a|108d|' + - '135d:135f|1714|1734|17d2|17dd|18a9|1939:193b|1a17|1a18|1a60|1a75:1a7c|1a7f|' + - '1ab0:1abd|1b34|1b44|1b6b:1b73|1baa|1bab|1be6|1bf2|1bf3|1c37|1cd0:1cd2|' + - '1cd4:1ce0|1ce2:1ce8|1ced|1cf4|1cf8|1cf9|1dc0:1df5|1dfb:1dff|20d0:20dc|20e1|' + - '20e5:20f0|2cef:2cf1|2d7f|2de0:2dff|302a:302f|3099|309a|a66f|a674:a67d|a69e|' + - 'a69f|a6f0|a6f1|a806|a8c4|a8e0:a8f1|a92b:a92d|a953|a9b3|a9c0|aab0|aab2:aab4|' + - 'aab7|aab8|aabe|aabf|aac1|aaf6|abed|fb1e|fe20:fe2f|101fd|102e0|10376:1037a|' + - '10a0d|10a0f|10a38:10a3a|10a3f|10ae5|10ae6|11046|1107f|110b9|110ba|11100:11102|' + - '11133|11134|11173|111c0|111ca|11235|11236|112e9|112ea|1133c|1134d|11366:1136c|' + - '11370:11374|11442|11446|114c2|114c3|115bf|115c0|1163f|116b6|116b7|1172b|11c3f|' + - '16af0:16af4|16b30:16b36|1bc9e|1d165:1d169|1d16d:1d172|1d17b:1d182|1d185:1d18b|' + - '1d1aa:1d1ad|1d242:1d244|1e000:1e006|1e008:1e018|1e01b:1e021|1e023|1e024|' + - '1e026:1e02a|1e8d0:1e8d6|1e944:1e94a'; - - return source.split('|').map((e) { - if (e.contains(':')) { - return e.split(':').map((hex) => int.parse(hex, radix: 16)); - } - - return int.parse(e, radix: 16); - }).fold([], (List acc, element) { - if (element is List) { - for (var i = element[0] as int; i <= (element[1] as int); i++) {} - } else if (element is int) { - acc.add(element); - } - - return acc; - }).toList(); -} - -String removeCombiningCharacters(String source) { - return source - .split('') - .where((char) => !COMBININGCODEPOINTS.contains(char.codeUnits.first)) - .join(''); -} - -bool isCJK(String char) { - final n = char.codeUnitAt(0); - - for (var x in CJKINTERVALS) { - final imin = x[0] as num; - final imax = x[1] as num; - - if (n >= imin && n <= imax) return true; - } - - return false; -} - -String removeCJKSpaces(String source) { - final splitted = source.split(''); - final filtered = []; - - for (var i = 0; i < splitted.length; i++) { - final char = splitted[i]; - final isSpace = char.trim() == ''; - final prevIsCJK = i != 0 && isCJK(splitted[i - 1]); - final nextIsCJK = i != splitted.length - 1 && isCJK(splitted[i + 1]); - - if (!(isSpace && prevIsCJK && nextIsCJK)) { - filtered.add(char); - } - } - - return filtered.join(''); -} - -String normalizeText(String source) { - final res = removeCombiningCharacters(unorm.nfkd(source).toLowerCase()) - .trim() - .split('/\s+/') - .join(' '); - - return removeCJKSpaces(res); -} - -const CJKINTERVALS = [ - [0x4e00, 0x9fff, 'CJK Unified Ideographs'], - [0x3400, 0x4dbf, 'CJK Unified Ideographs Extension A'], - [0x20000, 0x2a6df, 'CJK Unified Ideographs Extension B'], - [0x2a700, 0x2b73f, 'CJK Unified Ideographs Extension C'], - [0x2b740, 0x2b81f, 'CJK Unified Ideographs Extension D'], - [0xf900, 0xfaff, 'CJK Compatibility Ideographs'], - [0x2f800, 0x2fa1d, 'CJK Compatibility Ideographs Supplement'], - [0x3190, 0x319f, 'Kanbun'], - [0x2e80, 0x2eff, 'CJK Radicals Supplement'], - [0x2f00, 0x2fdf, 'CJK Radicals'], - [0x31c0, 0x31ef, 'CJK Strokes'], - [0x2ff0, 0x2fff, 'Ideographic Description Characters'], - [0xe0100, 0xe01ef, 'Variation Selectors Supplement'], - [0x3100, 0x312f, 'Bopomofo'], - [0x31a0, 0x31bf, 'Bopomofo Extended'], - [0xff00, 0xffef, 'Halfwidth and Fullwidth Forms'], - [0x3040, 0x309f, 'Hiragana'], - [0x30a0, 0x30ff, 'Katakana'], - [0x31f0, 0x31ff, 'Katakana Phonetic Extensions'], - [0x1b000, 0x1b0ff, 'Kana Supplement'], - [0xac00, 0xd7af, 'Hangul Syllables'], - [0x1100, 0x11ff, 'Hangul Jamo'], - [0xa960, 0xa97f, 'Hangul Jamo Extended A'], - [0xd7b0, 0xd7ff, 'Hangul Jamo Extended B'], - [0x3130, 0x318f, 'Hangul Compatibility Jamo'], - [0xa4d0, 0xa4ff, 'Lisu'], - [0x16f00, 0x16f9f, 'Miao'], - [0xa000, 0xa48f, 'Yi Syllables'], - [0xa490, 0xa4cf, 'Yi Radicals'], -]; - -final englishWordlist = [ - 'abandon', - 'ability', - 'able', - 'about', - 'above', - 'absent', - 'absorb', - 'abstract', - 'absurd', - 'abuse', - 'access', - 'accident', - 'account', - 'accuse', - 'achieve', - 'acid', - 'acoustic', - 'acquire', - 'across', - 'act', - 'action', - 'actor', - 'actress', - 'actual', - 'adapt', - 'add', - 'addict', - 'address', - 'adjust', - 'admit', - 'adult', - 'advance', - 'advice', - 'aerobic', - 'affair', - 'afford', - 'afraid', - 'again', - 'age', - 'agent', - 'agree', - 'ahead', - 'aim', - 'air', - 'airport', - 'aisle', - 'alarm', - 'album', - 'alcohol', - 'alert', - 'alien', - 'all', - 'alley', - 'allow', - 'almost', - 'alone', - 'alpha', - 'already', - 'also', - 'alter', - 'always', - 'amateur', - 'amazing', - 'among', - 'amount', - 'amused', - 'analyst', - 'anchor', - 'ancient', - 'anger', - 'angle', - 'angry', - 'animal', - 'ankle', - 'announce', - 'annual', - 'another', - 'answer', - 'antenna', - 'antique', - 'anxiety', - 'any', - 'apart', - 'apology', - 'appear', - 'apple', - 'approve', - 'april', - 'arch', - 'arctic', - 'area', - 'arena', - 'argue', - 'arm', - 'armed', - 'armor', - 'army', - 'around', - 'arrange', - 'arrest', - 'arrive', - 'arrow', - 'art', - 'artefact', - 'artist', - 'artwork', - 'ask', - 'aspect', - 'assault', - 'asset', - 'assist', - 'assume', - 'asthma', - 'athlete', - 'atom', - 'attack', - 'attend', - 'attitude', - 'attract', - 'auction', - 'audit', - 'august', - 'aunt', - 'author', - 'auto', - 'autumn', - 'average', - 'avocado', - 'avoid', - 'awake', - 'aware', - 'away', - 'awesome', - 'awful', - 'awkward', - 'axis', - 'baby', - 'bachelor', - 'bacon', - 'badge', - 'bag', - 'balance', - 'balcony', - 'ball', - 'bamboo', - 'banana', - 'banner', - 'bar', - 'barely', - 'bargain', - 'barrel', - 'base', - 'basic', - 'basket', - 'battle', - 'beach', - 'bean', - 'beauty', - 'because', - 'become', - 'beef', - 'before', - 'begin', - 'behave', - 'behind', - 'believe', - 'below', - 'belt', - 'bench', - 'benefit', - 'best', - 'betray', - 'better', - 'between', - 'beyond', - 'bicycle', - 'bid', - 'bike', - 'bind', - 'biology', - 'bird', - 'birth', - 'bitter', - 'black', - 'blade', - 'blame', - 'blanket', - 'blast', - 'bleak', - 'bless', - 'blind', - 'blood', - 'blossom', - 'blouse', - 'blue', - 'blur', - 'blush', - 'board', - 'boat', - 'body', - 'boil', - 'bomb', - 'bone', - 'bonus', - 'book', - 'boost', - 'border', - 'boring', - 'borrow', - 'boss', - 'bottom', - 'bounce', - 'box', - 'boy', - 'bracket', - 'brain', - 'brand', - 'brass', - 'brave', - 'bread', - 'breeze', - 'brick', - 'bridge', - 'brief', - 'bright', - 'bring', - 'brisk', - 'broccoli', - 'broken', - 'bronze', - 'broom', - 'brother', - 'brown', - 'brush', - 'bubble', - 'buddy', - 'budget', - 'buffalo', - 'build', - 'bulb', - 'bulk', - 'bullet', - 'bundle', - 'bunker', - 'burden', - 'burger', - 'burst', - 'bus', - 'business', - 'busy', - 'butter', - 'buyer', - 'buzz', - 'cabbage', - 'cabin', - 'cable', - 'cactus', - 'cage', - 'cake', - 'call', - 'calm', - 'camera', - 'camp', - 'can', - 'canal', - 'cancel', - 'candy', - 'cannon', - 'canoe', - 'canvas', - 'canyon', - 'capable', - 'capital', - 'captain', - 'car', - 'carbon', - 'card', - 'cargo', - 'carpet', - 'carry', - 'cart', - 'case', - 'cash', - 'casino', - 'castle', - 'casual', - 'cat', - 'catalog', - 'catch', - 'category', - 'cattle', - 'caught', - 'cause', - 'caution', - 'cave', - 'ceiling', - 'celery', - 'cement', - 'census', - 'century', - 'cereal', - 'certain', - 'chair', - 'chalk', - 'champion', - 'change', - 'chaos', - 'chapter', - 'charge', - 'chase', - 'chat', - 'cheap', - 'check', - 'cheese', - 'chef', - 'cherry', - 'chest', - 'chicken', - 'chief', - 'child', - 'chimney', - 'choice', - 'choose', - 'chronic', - 'chuckle', - 'chunk', - 'churn', - 'cigar', - 'cinnamon', - 'circle', - 'citizen', - 'city', - 'civil', - 'claim', - 'clap', - 'clarify', - 'claw', - 'clay', - 'clean', - 'clerk', - 'clever', - 'click', - 'client', - 'cliff', - 'climb', - 'clinic', - 'clip', - 'clock', - 'clog', - 'close', - 'cloth', - 'cloud', - 'clown', - 'club', - 'clump', - 'cluster', - 'clutch', - 'coach', - 'coast', - 'coconut', - 'code', - 'coffee', - 'coil', - 'coin', - 'collect', - 'color', - 'column', - 'combine', - 'come', - 'comfort', - 'comic', - 'common', - 'company', - 'concert', - 'conduct', - 'confirm', - 'congress', - 'connect', - 'consider', - 'control', - 'convince', - 'cook', - 'cool', - 'copper', - 'copy', - 'coral', - 'core', - 'corn', - 'correct', - 'cost', - 'cotton', - 'couch', - 'country', - 'couple', - 'course', - 'cousin', - 'cover', - 'coyote', - 'crack', - 'cradle', - 'craft', - 'cram', - 'crane', - 'crash', - 'crater', - 'crawl', - 'crazy', - 'cream', - 'credit', - 'creek', - 'crew', - 'cricket', - 'crime', - 'crisp', - 'critic', - 'crop', - 'cross', - 'crouch', - 'crowd', - 'crucial', - 'cruel', - 'cruise', - 'crumble', - 'crunch', - 'crush', - 'cry', - 'crystal', - 'cube', - 'culture', - 'cup', - 'cupboard', - 'curious', - 'current', - 'curtain', - 'curve', - 'cushion', - 'custom', - 'cute', - 'cycle', - 'dad', - 'damage', - 'damp', - 'dance', - 'danger', - 'daring', - 'dash', - 'daughter', - 'dawn', - 'day', - 'deal', - 'debate', - 'debris', - 'decade', - 'december', - 'decide', - 'decline', - 'decorate', - 'decrease', - 'deer', - 'defense', - 'define', - 'defy', - 'degree', - 'delay', - 'deliver', - 'demand', - 'demise', - 'denial', - 'dentist', - 'deny', - 'depart', - 'depend', - 'deposit', - 'depth', - 'deputy', - 'derive', - 'describe', - 'desert', - 'design', - 'desk', - 'despair', - 'destroy', - 'detail', - 'detect', - 'develop', - 'device', - 'devote', - 'diagram', - 'dial', - 'diamond', - 'diary', - 'dice', - 'diesel', - 'diet', - 'differ', - 'digital', - 'dignity', - 'dilemma', - 'dinner', - 'dinosaur', - 'direct', - 'dirt', - 'disagree', - 'discover', - 'disease', - 'dish', - 'dismiss', - 'disorder', - 'display', - 'distance', - 'divert', - 'divide', - 'divorce', - 'dizzy', - 'doctor', - 'document', - 'dog', - 'doll', - 'dolphin', - 'domain', - 'donate', - 'donkey', - 'donor', - 'door', - 'dose', - 'double', - 'dove', - 'draft', - 'dragon', - 'drama', - 'drastic', - 'draw', - 'dream', - 'dress', - 'drift', - 'drill', - 'drink', - 'drip', - 'drive', - 'drop', - 'drum', - 'dry', - 'duck', - 'dumb', - 'dune', - 'during', - 'dust', - 'dutch', - 'duty', - 'dwarf', - 'dynamic', - 'eager', - 'eagle', - 'early', - 'earn', - 'earth', - 'easily', - 'east', - 'easy', - 'echo', - 'ecology', - 'economy', - 'edge', - 'edit', - 'educate', - 'effort', - 'egg', - 'eight', - 'either', - 'elbow', - 'elder', - 'electric', - 'elegant', - 'element', - 'elephant', - 'elevator', - 'elite', - 'else', - 'embark', - 'embody', - 'embrace', - 'emerge', - 'emotion', - 'employ', - 'empower', - 'empty', - 'enable', - 'enact', - 'end', - 'endless', - 'endorse', - 'enemy', - 'energy', - 'enforce', - 'engage', - 'engine', - 'enhance', - 'enjoy', - 'enlist', - 'enough', - 'enrich', - 'enroll', - 'ensure', - 'enter', - 'entire', - 'entry', - 'envelope', - 'episode', - 'equal', - 'equip', - 'era', - 'erase', - 'erode', - 'erosion', - 'error', - 'erupt', - 'escape', - 'essay', - 'essence', - 'estate', - 'eternal', - 'ethics', - 'evidence', - 'evil', - 'evoke', - 'evolve', - 'exact', - 'example', - 'excess', - 'exchange', - 'excite', - 'exclude', - 'excuse', - 'execute', - 'exercise', - 'exhaust', - 'exhibit', - 'exile', - 'exist', - 'exit', - 'exotic', - 'expand', - 'expect', - 'expire', - 'explain', - 'expose', - 'express', - 'extend', - 'extra', - 'eye', - 'eyebrow', - 'fabric', - 'face', - 'faculty', - 'fade', - 'faint', - 'faith', - 'fall', - 'false', - 'fame', - 'family', - 'famous', - 'fan', - 'fancy', - 'fantasy', - 'farm', - 'fashion', - 'fat', - 'fatal', - 'father', - 'fatigue', - 'fault', - 'favorite', - 'feature', - 'february', - 'federal', - 'fee', - 'feed', - 'feel', - 'female', - 'fence', - 'festival', - 'fetch', - 'fever', - 'few', - 'fiber', - 'fiction', - 'field', - 'figure', - 'file', - 'film', - 'filter', - 'final', - 'find', - 'fine', - 'finger', - 'finish', - 'fire', - 'firm', - 'first', - 'fiscal', - 'fish', - 'fit', - 'fitness', - 'fix', - 'flag', - 'flame', - 'flash', - 'flat', - 'flavor', - 'flee', - 'flight', - 'flip', - 'float', - 'flock', - 'floor', - 'flower', - 'fluid', - 'flush', - 'fly', - 'foam', - 'focus', - 'fog', - 'foil', - 'fold', - 'follow', - 'food', - 'foot', - 'force', - 'forest', - 'forget', - 'fork', - 'fortune', - 'forum', - 'forward', - 'fossil', - 'foster', - 'found', - 'fox', - 'fragile', - 'frame', - 'frequent', - 'fresh', - 'friend', - 'fringe', - 'frog', - 'front', - 'frost', - 'frown', - 'frozen', - 'fruit', - 'fuel', - 'fun', - 'funny', - 'furnace', - 'fury', - 'future', - 'gadget', - 'gain', - 'galaxy', - 'gallery', - 'game', - 'gap', - 'garage', - 'garbage', - 'garden', - 'garlic', - 'garment', - 'gas', - 'gasp', - 'gate', - 'gather', - 'gauge', - 'gaze', - 'general', - 'genius', - 'genre', - 'gentle', - 'genuine', - 'gesture', - 'ghost', - 'giant', - 'gift', - 'giggle', - 'ginger', - 'giraffe', - 'girl', - 'give', - 'glad', - 'glance', - 'glare', - 'glass', - 'glide', - 'glimpse', - 'globe', - 'gloom', - 'glory', - 'glove', - 'glow', - 'glue', - 'goat', - 'goddess', - 'gold', - 'good', - 'goose', - 'gorilla', - 'gospel', - 'gossip', - 'govern', - 'gown', - 'grab', - 'grace', - 'grain', - 'grant', - 'grape', - 'grass', - 'gravity', - 'great', - 'green', - 'grid', - 'grief', - 'grit', - 'grocery', - 'group', - 'grow', - 'grunt', - 'guard', - 'guess', - 'guide', - 'guilt', - 'guitar', - 'gun', - 'gym', - 'habit', - 'hair', - 'half', - 'hammer', - 'hamster', - 'hand', - 'happy', - 'harbor', - 'hard', - 'harsh', - 'harvest', - 'hat', - 'have', - 'hawk', - 'hazard', - 'head', - 'health', - 'heart', - 'heavy', - 'hedgehog', - 'height', - 'hello', - 'helmet', - 'help', - 'hen', - 'hero', - 'hidden', - 'high', - 'hill', - 'hint', - 'hip', - 'hire', - 'history', - 'hobby', - 'hockey', - 'hold', - 'hole', - 'holiday', - 'hollow', - 'home', - 'honey', - 'hood', - 'hope', - 'horn', - 'horror', - 'horse', - 'hospital', - 'host', - 'hotel', - 'hour', - 'hover', - 'hub', - 'huge', - 'human', - 'humble', - 'humor', - 'hundred', - 'hungry', - 'hunt', - 'hurdle', - 'hurry', - 'hurt', - 'husband', - 'hybrid', - 'ice', - 'icon', - 'idea', - 'identify', - 'idle', - 'ignore', - 'ill', - 'illegal', - 'illness', - 'image', - 'imitate', - 'immense', - 'immune', - 'impact', - 'impose', - 'improve', - 'impulse', - 'inch', - 'include', - 'income', - 'increase', - 'index', - 'indicate', - 'indoor', - 'industry', - 'infant', - 'inflict', - 'inform', - 'inhale', - 'inherit', - 'initial', - 'inject', - 'injury', - 'inmate', - 'inner', - 'innocent', - 'input', - 'inquiry', - 'insane', - 'insect', - 'inside', - 'inspire', - 'install', - 'intact', - 'interest', - 'into', - 'invest', - 'invite', - 'involve', - 'iron', - 'island', - 'isolate', - 'issue', - 'item', - 'ivory', - 'jacket', - 'jaguar', - 'jar', - 'jazz', - 'jealous', - 'jeans', - 'jelly', - 'jewel', - 'job', - 'join', - 'joke', - 'journey', - 'joy', - 'judge', - 'juice', - 'jump', - 'jungle', - 'junior', - 'junk', - 'just', - 'kangaroo', - 'keen', - 'keep', - 'ketchup', - 'key', - 'kick', - 'kid', - 'kidney', - 'kind', - 'kingdom', - 'kiss', - 'kit', - 'kitchen', - 'kite', - 'kitten', - 'kiwi', - 'knee', - 'knife', - 'knock', - 'know', - 'lab', - 'label', - 'labor', - 'ladder', - 'lady', - 'lake', - 'lamp', - 'language', - 'laptop', - 'large', - 'later', - 'latin', - 'laugh', - 'laundry', - 'lava', - 'law', - 'lawn', - 'lawsuit', - 'layer', - 'lazy', - 'leader', - 'leaf', - 'learn', - 'leave', - 'lecture', - 'left', - 'leg', - 'legal', - 'legend', - 'leisure', - 'lemon', - 'lend', - 'length', - 'lens', - 'leopard', - 'lesson', - 'letter', - 'level', - 'liar', - 'liberty', - 'library', - 'license', - 'life', - 'lift', - 'light', - 'like', - 'limb', - 'limit', - 'link', - 'lion', - 'liquid', - 'list', - 'little', - 'live', - 'lizard', - 'load', - 'loan', - 'lobster', - 'local', - 'lock', - 'logic', - 'lonely', - 'long', - 'loop', - 'lottery', - 'loud', - 'lounge', - 'love', - 'loyal', - 'lucky', - 'luggage', - 'lumber', - 'lunar', - 'lunch', - 'luxury', - 'lyrics', - 'machine', - 'mad', - 'magic', - 'magnet', - 'maid', - 'mail', - 'main', - 'major', - 'make', - 'mammal', - 'man', - 'manage', - 'mandate', - 'mango', - 'mansion', - 'manual', - 'maple', - 'marble', - 'march', - 'margin', - 'marine', - 'market', - 'marriage', - 'mask', - 'mass', - 'master', - 'match', - 'material', - 'math', - 'matrix', - 'matter', - 'maximum', - 'maze', - 'meadow', - 'mean', - 'measure', - 'meat', - 'mechanic', - 'medal', - 'media', - 'melody', - 'melt', - 'member', - 'memory', - 'mention', - 'menu', - 'mercy', - 'merge', - 'merit', - 'merry', - 'mesh', - 'message', - 'metal', - 'method', - 'middle', - 'midnight', - 'milk', - 'million', - 'mimic', - 'mind', - 'minimum', - 'minor', - 'minute', - 'miracle', - 'mirror', - 'misery', - 'miss', - 'mistake', - 'mix', - 'mixed', - 'mixture', - 'mobile', - 'model', - 'modify', - 'mom', - 'moment', - 'monitor', - 'monkey', - 'monster', - 'month', - 'moon', - 'moral', - 'more', - 'morning', - 'mosquito', - 'mother', - 'motion', - 'motor', - 'mountain', - 'mouse', - 'move', - 'movie', - 'much', - 'muffin', - 'mule', - 'multiply', - 'muscle', - 'museum', - 'mushroom', - 'music', - 'must', - 'mutual', - 'myself', - 'mystery', - 'myth', - 'naive', - 'name', - 'napkin', - 'narrow', - 'nasty', - 'nation', - 'nature', - 'near', - 'neck', - 'need', - 'negative', - 'neglect', - 'neither', - 'nephew', - 'nerve', - 'nest', - 'net', - 'network', - 'neutral', - 'never', - 'news', - 'next', - 'nice', - 'night', - 'noble', - 'noise', - 'nominee', - 'noodle', - 'normal', - 'north', - 'nose', - 'notable', - 'note', - 'nothing', - 'notice', - 'novel', - 'now', - 'nuclear', - 'number', - 'nurse', - 'nut', - 'oak', - 'obey', - 'object', - 'oblige', - 'obscure', - 'observe', - 'obtain', - 'obvious', - 'occur', - 'ocean', - 'october', - 'odor', - 'off', - 'offer', - 'office', - 'often', - 'oil', - 'okay', - 'old', - 'olive', - 'olympic', - 'omit', - 'once', - 'one', - 'onion', - 'online', - 'only', - 'open', - 'opera', - 'opinion', - 'oppose', - 'option', - 'orange', - 'orbit', - 'orchard', - 'order', - 'ordinary', - 'organ', - 'orient', - 'original', - 'orphan', - 'ostrich', - 'other', - 'outdoor', - 'outer', - 'output', - 'outside', - 'oval', - 'oven', - 'over', - 'own', - 'owner', - 'oxygen', - 'oyster', - 'ozone', - 'pact', - 'paddle', - 'page', - 'pair', - 'palace', - 'palm', - 'panda', - 'panel', - 'panic', - 'panther', - 'paper', - 'parade', - 'parent', - 'park', - 'parrot', - 'party', - 'pass', - 'patch', - 'path', - 'patient', - 'patrol', - 'pattern', - 'pause', - 'pave', - 'payment', - 'peace', - 'peanut', - 'pear', - 'peasant', - 'pelican', - 'pen', - 'penalty', - 'pencil', - 'people', - 'pepper', - 'perfect', - 'permit', - 'person', - 'pet', - 'phone', - 'photo', - 'phrase', - 'physical', - 'piano', - 'picnic', - 'picture', - 'piece', - 'pig', - 'pigeon', - 'pill', - 'pilot', - 'pink', - 'pioneer', - 'pipe', - 'pistol', - 'pitch', - 'pizza', - 'place', - 'planet', - 'plastic', - 'plate', - 'play', - 'please', - 'pledge', - 'pluck', - 'plug', - 'plunge', - 'poem', - 'poet', - 'point', - 'polar', - 'pole', - 'police', - 'pond', - 'pony', - 'pool', - 'popular', - 'portion', - 'position', - 'possible', - 'post', - 'potato', - 'pottery', - 'poverty', - 'powder', - 'power', - 'practice', - 'praise', - 'predict', - 'prefer', - 'prepare', - 'present', - 'pretty', - 'prevent', - 'price', - 'pride', - 'primary', - 'print', - 'priority', - 'prison', - 'private', - 'prize', - 'problem', - 'process', - 'produce', - 'profit', - 'program', - 'project', - 'promote', - 'proof', - 'property', - 'prosper', - 'protect', - 'proud', - 'provide', - 'public', - 'pudding', - 'pull', - 'pulp', - 'pulse', - 'pumpkin', - 'punch', - 'pupil', - 'puppy', - 'purchase', - 'purity', - 'purpose', - 'purse', - 'push', - 'put', - 'puzzle', - 'pyramid', - 'quality', - 'quantum', - 'quarter', - 'question', - 'quick', - 'quit', - 'quiz', - 'quote', - 'rabbit', - 'raccoon', - 'race', - 'rack', - 'radar', - 'radio', - 'rail', - 'rain', - 'raise', - 'rally', - 'ramp', - 'ranch', - 'random', - 'range', - 'rapid', - 'rare', - 'rate', - 'rather', - 'raven', - 'raw', - 'razor', - 'ready', - 'real', - 'reason', - 'rebel', - 'rebuild', - 'recall', - 'receive', - 'recipe', - 'record', - 'recycle', - 'reduce', - 'reflect', - 'reform', - 'refuse', - 'region', - 'regret', - 'regular', - 'reject', - 'relax', - 'release', - 'relief', - 'rely', - 'remain', - 'remember', - 'remind', - 'remove', - 'render', - 'renew', - 'rent', - 'reopen', - 'repair', - 'repeat', - 'replace', - 'report', - 'require', - 'rescue', - 'resemble', - 'resist', - 'resource', - 'response', - 'result', - 'retire', - 'retreat', - 'return', - 'reunion', - 'reveal', - 'review', - 'reward', - 'rhythm', - 'rib', - 'ribbon', - 'rice', - 'rich', - 'ride', - 'ridge', - 'rifle', - 'right', - 'rigid', - 'ring', - 'riot', - 'ripple', - 'risk', - 'ritual', - 'rival', - 'river', - 'road', - 'roast', - 'robot', - 'robust', - 'rocket', - 'romance', - 'roof', - 'rookie', - 'room', - 'rose', - 'rotate', - 'rough', - 'round', - 'route', - 'royal', - 'rubber', - 'rude', - 'rug', - 'rule', - 'run', - 'runway', - 'rural', - 'sad', - 'saddle', - 'sadness', - 'safe', - 'sail', - 'salad', - 'salmon', - 'salon', - 'salt', - 'salute', - 'same', - 'sample', - 'sand', - 'satisfy', - 'satoshi', - 'sauce', - 'sausage', - 'save', - 'say', - 'scale', - 'scan', - 'scare', - 'scatter', - 'scene', - 'scheme', - 'school', - 'science', - 'scissors', - 'scorpion', - 'scout', - 'scrap', - 'screen', - 'script', - 'scrub', - 'sea', - 'search', - 'season', - 'seat', - 'second', - 'secret', - 'section', - 'security', - 'seed', - 'seek', - 'segment', - 'select', - 'sell', - 'seminar', - 'senior', - 'sense', - 'sentence', - 'series', - 'service', - 'session', - 'settle', - 'setup', - 'seven', - 'shadow', - 'shaft', - 'shallow', - 'share', - 'shed', - 'shell', - 'sheriff', - 'shield', - 'shift', - 'shine', - 'ship', - 'shiver', - 'shock', - 'shoe', - 'shoot', - 'shop', - 'short', - 'shoulder', - 'shove', - 'shrimp', - 'shrug', - 'shuffle', - 'shy', - 'sibling', - 'sick', - 'side', - 'siege', - 'sight', - 'sign', - 'silent', - 'silk', - 'silly', - 'silver', - 'similar', - 'simple', - 'since', - 'sing', - 'siren', - 'sister', - 'situate', - 'six', - 'size', - 'skate', - 'sketch', - 'ski', - 'skill', - 'skin', - 'skirt', - 'skull', - 'slab', - 'slam', - 'sleep', - 'slender', - 'slice', - 'slide', - 'slight', - 'slim', - 'slogan', - 'slot', - 'slow', - 'slush', - 'small', - 'smart', - 'smile', - 'smoke', - 'smooth', - 'snack', - 'snake', - 'snap', - 'sniff', - 'snow', - 'soap', - 'soccer', - 'social', - 'sock', - 'soda', - 'soft', - 'solar', - 'soldier', - 'solid', - 'solution', - 'solve', - 'someone', - 'song', - 'soon', - 'sorry', - 'sort', - 'soul', - 'sound', - 'soup', - 'source', - 'south', - 'space', - 'spare', - 'spatial', - 'spawn', - 'speak', - 'special', - 'speed', - 'spell', - 'spend', - 'sphere', - 'spice', - 'spider', - 'spike', - 'spin', - 'spirit', - 'split', - 'spoil', - 'sponsor', - 'spoon', - 'sport', - 'spot', - 'spray', - 'spread', - 'spring', - 'spy', - 'square', - 'squeeze', - 'squirrel', - 'stable', - 'stadium', - 'staff', - 'stage', - 'stairs', - 'stamp', - 'stand', - 'start', - 'state', - 'stay', - 'steak', - 'steel', - 'stem', - 'step', - 'stereo', - 'stick', - 'still', - 'sting', - 'stock', - 'stomach', - 'stone', - 'stool', - 'story', - 'stove', - 'strategy', - 'street', - 'strike', - 'strong', - 'struggle', - 'student', - 'stuff', - 'stumble', - 'style', - 'subject', - 'submit', - 'subway', - 'success', - 'such', - 'sudden', - 'suffer', - 'sugar', - 'suggest', - 'suit', - 'summer', - 'sun', - 'sunny', - 'sunset', - 'super', - 'supply', - 'supreme', - 'sure', - 'surface', - 'surge', - 'surprise', - 'surround', - 'survey', - 'suspect', - 'sustain', - 'swallow', - 'swamp', - 'swap', - 'swarm', - 'swear', - 'sweet', - 'swift', - 'swim', - 'swing', - 'switch', - 'sword', - 'symbol', - 'symptom', - 'syrup', - 'system', - 'table', - 'tackle', - 'tag', - 'tail', - 'talent', - 'talk', - 'tank', - 'tape', - 'target', - 'task', - 'taste', - 'tattoo', - 'taxi', - 'teach', - 'team', - 'tell', - 'ten', - 'tenant', - 'tennis', - 'tent', - 'term', - 'test', - 'text', - 'thank', - 'that', - 'theme', - 'then', - 'theory', - 'there', - 'they', - 'thing', - 'this', - 'thought', - 'three', - 'thrive', - 'throw', - 'thumb', - 'thunder', - 'ticket', - 'tide', - 'tiger', - 'tilt', - 'timber', - 'time', - 'tiny', - 'tip', - 'tired', - 'tissue', - 'title', - 'toast', - 'tobacco', - 'today', - 'toddler', - 'toe', - 'together', - 'toilet', - 'token', - 'tomato', - 'tomorrow', - 'tone', - 'tongue', - 'tonight', - 'tool', - 'tooth', - 'top', - 'topic', - 'topple', - 'torch', - 'tornado', - 'tortoise', - 'toss', - 'total', - 'tourist', - 'toward', - 'tower', - 'town', - 'toy', - 'track', - 'trade', - 'traffic', - 'tragic', - 'train', - 'transfer', - 'trap', - 'trash', - 'travel', - 'tray', - 'treat', - 'tree', - 'trend', - 'trial', - 'tribe', - 'trick', - 'trigger', - 'trim', - 'trip', - 'trophy', - 'trouble', - 'truck', - 'true', - 'truly', - 'trumpet', - 'trust', - 'truth', - 'try', - 'tube', - 'tuition', - 'tumble', - 'tuna', - 'tunnel', - 'turkey', - 'turn', - 'turtle', - 'twelve', - 'twenty', - 'twice', - 'twin', - 'twist', - 'two', - 'type', - 'typical', - 'ugly', - 'umbrella', - 'unable', - 'unaware', - 'uncle', - 'uncover', - 'under', - 'undo', - 'unfair', - 'unfold', - 'unhappy', - 'uniform', - 'unique', - 'unit', - 'universe', - 'unknown', - 'unlock', - 'until', - 'unusual', - 'unveil', - 'update', - 'upgrade', - 'uphold', - 'upon', - 'upper', - 'upset', - 'urban', - 'urge', - 'usage', - 'use', - 'used', - 'useful', - 'useless', - 'usual', - 'utility', - 'vacant', - 'vacuum', - 'vague', - 'valid', - 'valley', - 'valve', - 'van', - 'vanish', - 'vapor', - 'various', - 'vast', - 'vault', - 'vehicle', - 'velvet', - 'vendor', - 'venture', - 'venue', - 'verb', - 'verify', - 'version', - 'very', - 'vessel', - 'veteran', - 'viable', - 'vibrant', - 'vicious', - 'victory', - 'video', - 'view', - 'village', - 'vintage', - 'violin', - 'virtual', - 'virus', - 'visa', - 'visit', - 'visual', - 'vital', - 'vivid', - 'vocal', - 'voice', - 'void', - 'volcano', - 'volume', - 'vote', - 'voyage', - 'wage', - 'wagon', - 'wait', - 'walk', - 'wall', - 'walnut', - 'want', - 'warfare', - 'warm', - 'warrior', - 'wash', - 'wasp', - 'waste', - 'water', - 'wave', - 'way', - 'wealth', - 'weapon', - 'wear', - 'weasel', - 'weather', - 'web', - 'wedding', - 'weekend', - 'weird', - 'welcome', - 'west', - 'wet', - 'whale', - 'what', - 'wheat', - 'wheel', - 'when', - 'where', - 'whip', - 'whisper', - 'wide', - 'width', - 'wife', - 'wild', - 'will', - 'win', - 'window', - 'wine', - 'wing', - 'wink', - 'winner', - 'winter', - 'wire', - 'wisdom', - 'wise', - 'wish', - 'witness', - 'wolf', - 'woman', - 'wonder', - 'wood', - 'wool', - 'word', - 'work', - 'world', - 'worry', - 'worth', - 'wrap', - 'wreck', - 'wrestle', - 'wrist', - 'write', - 'wrong', - 'yard', - 'year', - 'yellow', - 'you', - 'young', - 'youth', - 'zebra', - 'zero', - 'zone', - 'zoo' -]; diff --git a/lib/bitcoin/bitcoin_mnemonic_is_incorrect_exception.dart b/lib/bitcoin/bitcoin_mnemonic_is_incorrect_exception.dart deleted file mode 100644 index 8d0583ce5..000000000 --- a/lib/bitcoin/bitcoin_mnemonic_is_incorrect_exception.dart +++ /dev/null @@ -1,5 +0,0 @@ -class BitcoinMnemonicIsIncorrectException implements Exception { - @override - String toString() => - 'Bitcoin mnemonic has incorrect format. Mnemonic should contain 12 or 24 words separated by space.'; -} diff --git a/lib/bitcoin/bitcoin_transaction_credentials.dart b/lib/bitcoin/bitcoin_transaction_credentials.dart deleted file mode 100644 index 2799dbb28..000000000 --- a/lib/bitcoin/bitcoin_transaction_credentials.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:cake_wallet/bitcoin/bitcoin_transaction_priority.dart'; -import 'package:cake_wallet/view_model/send/output.dart'; - -class BitcoinTransactionCredentials { - BitcoinTransactionCredentials(this.outputs, this.priority); - - final List outputs; - BitcoinTransactionPriority priority; -} diff --git a/lib/bitcoin/bitcoin_transaction_no_inputs_exception.dart b/lib/bitcoin/bitcoin_transaction_no_inputs_exception.dart deleted file mode 100644 index d4397dead..000000000 --- a/lib/bitcoin/bitcoin_transaction_no_inputs_exception.dart +++ /dev/null @@ -1,4 +0,0 @@ -class BitcoinTransactionNoInputsException implements Exception { - @override - String toString() => 'Not enough inputs available'; -} diff --git a/lib/bitcoin/bitcoin_transaction_priority.dart b/lib/bitcoin/bitcoin_transaction_priority.dart deleted file mode 100644 index 455c4a5ad..000000000 --- a/lib/bitcoin/bitcoin_transaction_priority.dart +++ /dev/null @@ -1,103 +0,0 @@ -import 'package:cake_wallet/entities/transaction_priority.dart'; -import 'package:cake_wallet/generated/i18n.dart'; - -class BitcoinTransactionPriority extends TransactionPriority { - const BitcoinTransactionPriority({String title, int raw}) - : super(title: title, raw: raw); - - static const List all = [fast, medium, slow]; - static const BitcoinTransactionPriority slow = - BitcoinTransactionPriority(title: 'Slow', raw: 0); - static const BitcoinTransactionPriority medium = - BitcoinTransactionPriority(title: 'Medium', raw: 1); - static const BitcoinTransactionPriority fast = - BitcoinTransactionPriority(title: 'Fast', raw: 2); - - static BitcoinTransactionPriority deserialize({int raw}) { - switch (raw) { - case 0: - return slow; - case 1: - return medium; - case 2: - return fast; - default: - return null; - } - } - - String get units => 'sat'; - - @override - String toString() { - var label = ''; - - switch (this) { - case BitcoinTransactionPriority.slow: - label = '${S.current.transaction_priority_slow} ~24hrs'; - break; - case BitcoinTransactionPriority.medium: - label = S.current.transaction_priority_medium; - break; - case BitcoinTransactionPriority.fast: - label = S.current.transaction_priority_fast; - break; - default: - break; - } - - return label; - } - - String labelWithRate(int rate) => '${toString()} ($rate ${units}/byte)'; -} - -class LitecoinTransactionPriority extends BitcoinTransactionPriority { - const LitecoinTransactionPriority({String title, int raw}) - : super(title: title, raw: raw); - - static const List all = [fast, medium, slow]; - static const LitecoinTransactionPriority slow = - LitecoinTransactionPriority(title: 'Slow', raw: 0); - static const LitecoinTransactionPriority medium = - LitecoinTransactionPriority(title: 'Medium', raw: 1); - static const LitecoinTransactionPriority fast = - LitecoinTransactionPriority(title: 'Fast', raw: 2); - - static LitecoinTransactionPriority deserialize({int raw}) { - switch (raw) { - case 0: - return slow; - case 1: - return medium; - case 2: - return fast; - default: - return null; - } - } - - @override - String get units => 'Latoshi'; - - @override - String toString() { - var label = ''; - - switch (this) { - case LitecoinTransactionPriority.slow: - label = S.current.transaction_priority_slow; - break; - case LitecoinTransactionPriority.medium: - label = S.current.transaction_priority_medium; - break; - case LitecoinTransactionPriority.fast: - label = S.current.transaction_priority_fast; - break; - default: - break; - } - - return label; - } -} diff --git a/lib/bitcoin/bitcoin_transaction_wrong_balance_exception.dart b/lib/bitcoin/bitcoin_transaction_wrong_balance_exception.dart deleted file mode 100644 index b699ade29..000000000 --- a/lib/bitcoin/bitcoin_transaction_wrong_balance_exception.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:cake_wallet/entities/crypto_currency.dart'; - -class BitcoinTransactionWrongBalanceException implements Exception { - BitcoinTransactionWrongBalanceException(this.currency); - - final CryptoCurrency currency; - - @override - String toString() => 'Wrong balance. Not enough ${currency.title} on your balance.'; -} \ No newline at end of file diff --git a/lib/bitcoin/bitcoin_unspent.dart b/lib/bitcoin/bitcoin_unspent.dart deleted file mode 100644 index b95ed9bc3..000000000 --- a/lib/bitcoin/bitcoin_unspent.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; - -class BitcoinUnspent { - BitcoinUnspent(this.address, this.hash, this.value, this.vout) - : isSending = true, - isFrozen = false, - note = ''; - - factory BitcoinUnspent.fromJSON( - BitcoinAddressRecord address, Map json) => - BitcoinUnspent(address, json['tx_hash'] as String, json['value'] as int, - json['tx_pos'] as int); - - final BitcoinAddressRecord address; - final String hash; - final int value; - final int vout; - - bool get isP2wpkh => - address.address.startsWith('bc') || address.address.startsWith('ltc'); - bool isSending; - bool isFrozen; - String note; -} diff --git a/lib/bitcoin/bitcoin_wallet.dart b/lib/bitcoin/bitcoin_wallet.dart deleted file mode 100644 index 2c70bd4f8..000000000 --- a/lib/bitcoin/bitcoin_wallet.dart +++ /dev/null @@ -1,63 +0,0 @@ -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic.dart'; -import 'package:cake_wallet/bitcoin/unspent_coins_info.dart'; -import 'package:hive/hive.dart'; -import 'package:mobx/mobx.dart'; -import 'package:flutter/foundation.dart'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:cake_wallet/bitcoin/electrum_wallet_snapshot.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; -import 'package:cake_wallet/bitcoin/electrum_balance.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_wallet_addresses.dart'; - -part 'bitcoin_wallet.g.dart'; - -class BitcoinWallet = BitcoinWalletBase with _$BitcoinWallet; - -abstract class BitcoinWalletBase extends ElectrumWallet with Store { - BitcoinWalletBase( - {@required String mnemonic, - @required String password, - @required WalletInfo walletInfo, - @required Box unspentCoinsInfo, - List initialAddresses, - ElectrumBalance initialBalance, - int accountIndex = 0}) - : super( - mnemonic: mnemonic, - password: password, - walletInfo: walletInfo, - unspentCoinsInfo: unspentCoinsInfo, - networkType: bitcoin.bitcoin, - initialAddresses: initialAddresses, - initialBalance: initialBalance) { - walletAddresses = BitcoinWalletAddresses( - walletInfo, - initialAddresses: initialAddresses, - accountIndex: accountIndex, - mainHd: hd, - sideHd: bitcoin.HDWallet.fromSeed( - mnemonicToSeedBytes(mnemonic), network: networkType) - .derivePath("m/0'/1"), - networkType: networkType); - } - - static Future open({ - @required String name, - @required WalletInfo walletInfo, - @required Box unspentCoinsInfo, - @required String password, - }) async { - final snp = ElectrumWallletSnapshot(name, walletInfo.type, password); - await snp.load(); - return BitcoinWallet( - mnemonic: snp.mnemonic, - password: password, - walletInfo: walletInfo, - unspentCoinsInfo: unspentCoinsInfo, - initialAddresses: snp.addresses, - initialBalance: snp.balance, - accountIndex: snp.accountIndex); - } -} diff --git a/lib/bitcoin/bitcoin_wallet_addresses.dart b/lib/bitcoin/bitcoin_wallet_addresses.dart deleted file mode 100644 index 17c07efc0..000000000 --- a/lib/bitcoin/bitcoin_wallet_addresses.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:cake_wallet/bitcoin/utils.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet_addresses.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:flutter/foundation.dart'; -import 'package:mobx/mobx.dart'; - -part 'bitcoin_wallet_addresses.g.dart'; - -class BitcoinWalletAddresses = BitcoinWalletAddressesBase - with _$BitcoinWalletAddresses; - -abstract class BitcoinWalletAddressesBase extends ElectrumWalletAddresses - with Store { - BitcoinWalletAddressesBase( - WalletInfo walletInfo, - {@required List initialAddresses, - int accountIndex = 0, - @required bitcoin.HDWallet mainHd, - @required bitcoin.HDWallet sideHd, - @required this.networkType}) - : super( - walletInfo, - initialAddresses: initialAddresses, - accountIndex: accountIndex, - mainHd: mainHd, - sideHd: sideHd); - - bitcoin.NetworkType networkType; - - @override - String getAddress({@required int index, @required bitcoin.HDWallet hd}) => - generateP2WPKHAddress(hd: hd, index: index, networkType: networkType); -} \ No newline at end of file diff --git a/lib/bitcoin/bitcoin_wallet_creation_credentials.dart b/lib/bitcoin/bitcoin_wallet_creation_credentials.dart deleted file mode 100644 index f8df42df0..000000000 --- a/lib/bitcoin/bitcoin_wallet_creation_credentials.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:cake_wallet/core/wallet_credentials.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; - -class BitcoinNewWalletCredentials extends WalletCredentials { - BitcoinNewWalletCredentials({String name, WalletInfo walletInfo}) - : super(name: name, walletInfo: walletInfo); -} - -class BitcoinRestoreWalletFromSeedCredentials extends WalletCredentials { - BitcoinRestoreWalletFromSeedCredentials( - {String name, String password, this.mnemonic, WalletInfo walletInfo}) - : super(name: name, password: password, walletInfo: walletInfo); - - final String mnemonic; -} - -class BitcoinRestoreWalletFromWIFCredentials extends WalletCredentials { - BitcoinRestoreWalletFromWIFCredentials( - {String name, String password, this.wif, WalletInfo walletInfo}) - : super(name: name, password: password, walletInfo: walletInfo); - - final String wif; -} diff --git a/lib/bitcoin/bitcoin_wallet_keys.dart b/lib/bitcoin/bitcoin_wallet_keys.dart deleted file mode 100644 index 74212c74c..000000000 --- a/lib/bitcoin/bitcoin_wallet_keys.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:flutter/foundation.dart'; - -class BitcoinWalletKeys { - const BitcoinWalletKeys({@required this.wif, @required this.privateKey, @required this.publicKey}); - - final String wif; - final String privateKey; - final String publicKey; -} \ No newline at end of file diff --git a/lib/bitcoin/bitcoin_wallet_service.dart b/lib/bitcoin/bitcoin_wallet_service.dart deleted file mode 100644 index 8e5b31930..000000000 --- a/lib/bitcoin/bitcoin_wallet_service.dart +++ /dev/null @@ -1,80 +0,0 @@ -import 'dart:io'; -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic_is_incorrect_exception.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_wallet_creation_credentials.dart'; -import 'package:cake_wallet/bitcoin/unspent_coins_info.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/core/wallet_service.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart'; -import 'package:cake_wallet/entities/pathForWallet.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:hive/hive.dart'; - -class BitcoinWalletService extends WalletService< - BitcoinNewWalletCredentials, - BitcoinRestoreWalletFromSeedCredentials, - BitcoinRestoreWalletFromWIFCredentials> { - BitcoinWalletService(this.walletInfoSource, this.unspentCoinsInfoSource); - - final Box walletInfoSource; - final Box unspentCoinsInfoSource; - - @override - WalletType getType() => WalletType.bitcoin; - - @override - Future create(BitcoinNewWalletCredentials credentials) async { - final wallet = BitcoinWallet( - mnemonic: await generateMnemonic(), - password: credentials.password, - walletInfo: credentials.walletInfo, - unspentCoinsInfo: unspentCoinsInfoSource); - await wallet.save(); - await wallet.init(); - return wallet; - } - - @override - Future isWalletExit(String name) async => - File(await pathForWallet(name: name, type: getType())).existsSync(); - - @override - Future openWallet(String name, String password) async { - final walletInfo = walletInfoSource.values.firstWhere( - (info) => info.id == WalletBase.idFor(name, getType()), - orElse: () => null); - final wallet = await BitcoinWalletBase.open( - password: password, name: name, walletInfo: walletInfo, - unspentCoinsInfo: unspentCoinsInfoSource); - await wallet.init(); - return wallet; - } - - @override - Future remove(String wallet) async => - File(await pathForWalletDir(name: wallet, type: WalletType.bitcoin)) - .delete(recursive: true); - - @override - Future restoreFromKeys( - BitcoinRestoreWalletFromWIFCredentials credentials) async => - throw UnimplementedError(); - - @override - Future restoreFromSeed( - BitcoinRestoreWalletFromSeedCredentials credentials) async { - if (!validateMnemonic(credentials.mnemonic)) { - throw BitcoinMnemonicIsIncorrectException(); - } - - final wallet = BitcoinWallet( - password: credentials.password, - mnemonic: credentials.mnemonic, - walletInfo: credentials.walletInfo, - unspentCoinsInfo: unspentCoinsInfoSource); - await wallet.save(); - await wallet.init(); - return wallet; - } -} diff --git a/lib/bitcoin/electrum.dart b/lib/bitcoin/electrum.dart deleted file mode 100644 index 712b2e080..000000000 --- a/lib/bitcoin/electrum.dart +++ /dev/null @@ -1,444 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; -import 'dart:typed_data'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; -import 'package:cake_wallet/bitcoin/script_hash.dart'; -import 'package:flutter/foundation.dart'; -import 'package:rxdart/rxdart.dart'; - -String jsonrpcparams(List params) { - final _params = params?.map((val) => '"${val.toString()}"')?.join(','); - return '[$_params]'; -} - -String jsonrpc( - {String method, List params, int id, double version = 2.0}) => - '{"jsonrpc": "$version", "method": "$method", "id": "$id", "params": ${json.encode(params)}}\n'; - -class SocketTask { - SocketTask({this.completer, this.isSubscription, this.subject}); - - final Completer completer; - final BehaviorSubject subject; - final bool isSubscription; -} - -class ElectrumClient { - ElectrumClient() - : _id = 0, - _isConnected = false, - _tasks = {}, - unterminatedString = ''; - - static const connectionTimeout = Duration(seconds: 5); - static const aliveTimerDuration = Duration(seconds: 2); - - bool get isConnected => _isConnected; - Socket socket; - void Function(bool) onConnectionStatusChange; - int _id; - final Map _tasks; - bool _isConnected; - Timer _aliveTimer; - String unterminatedString; - - Future connectToUri(Uri uri) async => - await connect(host: uri.host, port: uri.port); - - Future connect({@required String host, @required int port}) async { - try { - await socket?.close(); - } catch (_) {} - - socket = await SecureSocket.connect(host, port, - timeout: connectionTimeout, onBadCertificate: (_) => true); - _setIsConnected(true); - - socket.listen((Uint8List event) { - try { - final response = - json.decode(utf8.decode(event.toList())) as Map; - _handleResponse(response); - } on FormatException catch (e) { - final msg = e.message.toLowerCase(); - - if (e.source is String) { - unterminatedString += e.source as String; - } - - if (msg.contains("not a subtype of type")) { - unterminatedString += e.source as String; - return; - } - - if (isJSONStringCorrect(unterminatedString)) { - final response = - json.decode(unterminatedString) as Map; - _handleResponse(response); - unterminatedString = ''; - } - } on TypeError catch (e) { - if (!e.toString().contains('Map')) { - return; - } - - final source = utf8.decode(event.toList()); - unterminatedString += source; - - if (isJSONStringCorrect(unterminatedString)) { - final response = - json.decode(unterminatedString) as Map; - _handleResponse(response); - unterminatedString = null; - } - } catch (e) { - print(e.toString()); - } - }, onError: (Object error) { - print(error.toString()); - _setIsConnected(false); - }, onDone: () { - _setIsConnected(false); - }); - keepAlive(); - } - - void keepAlive() { - _aliveTimer?.cancel(); - _aliveTimer = Timer.periodic(aliveTimerDuration, (_) async => ping()); - } - - Future ping() async { - try { - await callWithTimeout(method: 'server.ping'); - _setIsConnected(true); - } on RequestFailedTimeoutException catch (_) { - _setIsConnected(false); - } - } - - Future> version() => - call(method: 'server.version').then((dynamic result) { - if (result is List) { - return result.map((dynamic val) => val.toString()).toList(); - } - - return []; - }); - - Future> getBalance(String scriptHash) => - call(method: 'blockchain.scripthash.get_balance', params: [scriptHash]) - .then((dynamic result) { - if (result is Map) { - return result; - } - - return {}; - }); - - Future>> getHistory(String scriptHash) => - call(method: 'blockchain.scripthash.get_history', params: [scriptHash]) - .then((dynamic result) { - if (result is List) { - return result.map((dynamic val) { - if (val is Map) { - return val; - } - - return {}; - }).toList(); - } - - return []; - }); - - Future>> getListUnspentWithAddress( - String address, NetworkType networkType) => - call( - method: 'blockchain.scripthash.listunspent', - params: [scriptHash(address, networkType: networkType)]) - .then((dynamic result) { - if (result is List) { - return result.map((dynamic val) { - if (val is Map) { - val['address'] = address; - return val; - } - - return {}; - }).toList(); - } - - return []; - }); - - Future>> getListUnspent(String scriptHash) => - call(method: 'blockchain.scripthash.listunspent', params: [scriptHash]) - .then((dynamic result) { - if (result is List) { - return result.map((dynamic val) { - if (val is Map) { - return val; - } - - return {}; - }).toList(); - } - - return []; - }); - - Future>> getMempool(String scriptHash) => - call(method: 'blockchain.scripthash.get_mempool', params: [scriptHash]) - .then((dynamic result) { - if (result is List) { - return result.map((dynamic val) { - if (val is Map) { - return val; - } - - return {}; - }).toList(); - } - - return []; - }); - - Future> getTransactionRaw( - {@required String hash}) async => - call(method: 'blockchain.transaction.get', params: [hash, true]) - .then((dynamic result) { - if (result is Map) { - return result; - } - - return {}; - }); - - Future> getTransactionExpanded( - {@required String hash}) async { - try { - final originalTx = await getTransactionRaw(hash: hash); - final vins = originalTx['vin'] as List; - - for (dynamic vin in vins) { - if (vin is Map) { - vin['tx'] = await getTransactionRaw(hash: vin['txid'] as String); - } - } - - return originalTx; - } catch (_) { - return {}; - } - } - - Future broadcastTransaction( - {@required String transactionRaw}) async => - call(method: 'blockchain.transaction.broadcast', params: [transactionRaw]) - .then((dynamic result) { - if (result is String) { - return result; - } - - return ''; - }); - - Future> getMerkle( - {@required String hash, @required int height}) async => - await call( - method: 'blockchain.transaction.get_merkle', - params: [hash, height]) as Map; - - Future> getHeader({@required int height}) async => - await call(method: 'blockchain.block.get_header', params: [height]) - as Map; - - Future estimatefee({@required int p}) => - call(method: 'blockchain.estimatefee', params: [p]) - .then((dynamic result) { - if (result is double) { - return result; - } - - if (result is String) { - return double.parse(result); - } - - return 0; - }); - - Future>> feeHistogram() => - call(method: 'mempool.get_fee_histogram').then((dynamic result) { - if (result is List) { - return result.map((dynamic e) { - if (e is List) { - return e.map((dynamic ee) => ee is int ? ee : null).toList(); - } - - return null; - }).toList(); - } - - return []; - }); - - Future> feeRates() async { - try { - final topDoubleString = await estimatefee(p: 1); - final middleDoubleString = await estimatefee(p: 20); - final bottomDoubleString = await estimatefee(p: 100); - final top = - (stringDoubleToBitcoinAmount(topDoubleString.toString()) / 1000) - .round(); - final middle = - (stringDoubleToBitcoinAmount(middleDoubleString.toString()) / 1000) - .round(); - final bottom = - (stringDoubleToBitcoinAmount(bottomDoubleString.toString()) / 1000) - .round(); - - return [bottom, middle, top]; - } catch (_) { - return []; - } - } - - BehaviorSubject scripthashUpdate(String scripthash) { - _id += 1; - return subscribe( - id: 'blockchain.scripthash.subscribe:$scripthash', - method: 'blockchain.scripthash.subscribe', - params: [scripthash]); - } - - BehaviorSubject subscribe( - {@required String id, - @required String method, - List params = const []}) { - try { - final subscription = BehaviorSubject(); - _regisrySubscription(id, subscription); - socket.write(jsonrpc(method: method, id: _id, params: params)); - - return subscription; - } catch(e) { - print(e.toString()); - } - } - - Future call({String method, List params = const []}) async { - final completer = Completer(); - _id += 1; - final id = _id; - _registryTask(id, completer); - socket.write(jsonrpc(method: method, id: id, params: params)); - - return completer.future; - } - - Future callWithTimeout( - {String method, - List params = const [], - int timeout = 2000}) async { - try { - final completer = Completer(); - _id += 1; - final id = _id; - _registryTask(id, completer); - socket.write(jsonrpc(method: method, id: id, params: params)); - Timer(Duration(milliseconds: timeout), () { - if (!completer.isCompleted) { - completer.completeError(RequestFailedTimeoutException(method, id)); - } - }); - - return completer.future; - } catch(e) { - print(e.toString()); - } - } - - Future close() async { - _aliveTimer.cancel(); - await socket.close(); - onConnectionStatusChange = null; - } - - void _registryTask(int id, Completer completer) => _tasks[id.toString()] = - SocketTask(completer: completer, isSubscription: false); - - void _regisrySubscription(String id, BehaviorSubject subject) => - _tasks[id] = SocketTask(subject: subject, isSubscription: true); - - void _finish(String id, Object data) { - if (_tasks[id] == null) { - return; - } - - if (!(_tasks[id]?.completer?.isCompleted ?? false)) { - _tasks[id]?.completer?.complete(data); - } - - if (!(_tasks[id]?.isSubscription ?? false)) { - _tasks[id] = null; - } else { - _tasks[id].subject.add(data); - } - } - - void _methodHandler( - {@required String method, @required Map request}) { - switch (method) { - case 'blockchain.scripthash.subscribe': - final params = request['params'] as List; - final scripthash = params.first as String; - final id = 'blockchain.scripthash.subscribe:$scripthash'; - - _tasks[id]?.subject?.add(params.last); - break; - default: - break; - } - } - - void _setIsConnected(bool isConnected) { - if (_isConnected != isConnected) { - onConnectionStatusChange?.call(isConnected); - } - - _isConnected = isConnected; - } - - void _handleResponse(Map response) { - final method = response['method']; - final id = response['id'] as String; - final result = response['result']; - - if (method is String) { - _methodHandler(method: method, request: response); - return; - } - - _finish(id, result); - } -} - -// FIXME: move me -bool isJSONStringCorrect(String source) { - try { - json.decode(source); - return true; - } catch (_) { - return false; - } -} - -class RequestFailedTimeoutException implements Exception { - RequestFailedTimeoutException(this.method, this.id); - - final String method; - final int id; -} diff --git a/lib/bitcoin/electrum_balance.dart b/lib/bitcoin/electrum_balance.dart deleted file mode 100644 index 66e53f921..000000000 --- a/lib/bitcoin/electrum_balance.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'dart:convert'; -import 'package:flutter/foundation.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; -import 'package:cake_wallet/entities/balance.dart'; - -class ElectrumBalance extends Balance { - const ElectrumBalance({@required this.confirmed, @required this.unconfirmed}) - : super(confirmed, unconfirmed); - - factory ElectrumBalance.fromJSON(String jsonSource) { - if (jsonSource == null) { - return null; - } - - final decoded = json.decode(jsonSource) as Map; - - return ElectrumBalance( - confirmed: decoded['confirmed'] as int ?? 0, - unconfirmed: decoded['unconfirmed'] as int ?? 0); - } - - final int confirmed; - final int unconfirmed; - - @override - String get formattedAvailableBalance => - bitcoinAmountToString(amount: confirmed); - - @override - String get formattedAdditionalBalance => - bitcoinAmountToString(amount: unconfirmed); - - String toJSON() => - json.encode({'confirmed': confirmed, 'unconfirmed': unconfirmed}); -} diff --git a/lib/bitcoin/electrum_transaction_history.dart b/lib/bitcoin/electrum_transaction_history.dart deleted file mode 100644 index 2aabf1304..000000000 --- a/lib/bitcoin/electrum_transaction_history.dart +++ /dev/null @@ -1,98 +0,0 @@ -import 'dart:convert'; -import 'package:cake_wallet/entities/pathForWallet.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:flutter/foundation.dart'; -import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/bitcoin/file.dart'; -import 'package:cake_wallet/bitcoin/electrum_transaction_info.dart'; - -part 'electrum_transaction_history.g.dart'; - -const _transactionsHistoryFileName = 'transactions.json'; - -class ElectrumTransactionHistory = ElectrumTransactionHistoryBase - with _$ElectrumTransactionHistory; - -abstract class ElectrumTransactionHistoryBase - extends TransactionHistoryBase with Store { - ElectrumTransactionHistoryBase( - {@required this.walletInfo, @required String password}) - : _password = password, - _height = 0 { - transactions = ObservableMap(); - } - - final WalletInfo walletInfo; - final String _password; - int _height; - - Future init() async => await _load(); - - @override - void addOne(ElectrumTransactionInfo transaction) => - transactions[transaction.id] = transaction; - - @override - void addMany(Map transactions) => - transactions.forEach((_, tx) => _updateOrInsert(tx)); - - @override - Future save() async { - try { - final dirPath = - await pathForWalletDir(name: walletInfo.name, type: walletInfo.type); - final path = '$dirPath/$_transactionsHistoryFileName'; - final data = - json.encode({'height': _height, 'transactions': transactions}); - await writeData(path: path, password: _password, data: data); - } catch (e) { - print('Error while save bitcoin transaction history: ${e.toString()}'); - } - } - - Future> _read() async { - final dirPath = - await pathForWalletDir(name: walletInfo.name, type: walletInfo.type); - final path = '$dirPath/$_transactionsHistoryFileName'; - final content = await read(path: path, password: _password); - return json.decode(content) as Map; - } - - Future _load() async { - try { - final content = await _read(); - final txs = content['transactions'] as Map ?? {}; - - txs.entries.forEach((entry) { - final val = entry.value; - - if (val is Map) { - final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type); - _updateOrInsert(tx); - } - }); - - _height = content['height'] as int; - } catch (e) { - print(e); - } - } - - void _updateOrInsert(ElectrumTransactionInfo transaction) { - if (transaction.id == null) { - return; - } - - if (transactions[transaction.id] == null) { - transactions[transaction.id] = transaction; - } else { - final originalTx = transactions[transaction.id]; - originalTx.confirmations = transaction.confirmations; - originalTx.amount = transaction.amount; - originalTx.height = transaction.height; - originalTx.date ??= transaction.date; - originalTx.isPending = transaction.isPending; - } - } -} diff --git a/lib/bitcoin/electrum_transaction_info.dart b/lib/bitcoin/electrum_transaction_info.dart deleted file mode 100644 index 47005edc7..000000000 --- a/lib/bitcoin/electrum_transaction_info.dart +++ /dev/null @@ -1,178 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:bitcoin_flutter/src/payments/index.dart' show PaymentData; -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; -import 'package:cake_wallet/entities/transaction_direction.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; -import 'package:cake_wallet/entities/format_amount.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; - -class ElectrumTransactionInfo extends TransactionInfo { - ElectrumTransactionInfo(this.type, - {@required String id, - @required int height, - @required int amount, - @required int fee, - @required TransactionDirection direction, - @required bool isPending, - @required DateTime date, - @required int confirmations}) { - this.id = id; - this.height = height; - this.amount = amount; - this.fee = fee; - this.direction = direction; - this.date = date; - this.isPending = isPending; - this.confirmations = confirmations; - } - - factory ElectrumTransactionInfo.fromElectrumVerbose( - Map obj, WalletType type, - {@required List addresses, @required int height}) { - final addressesSet = addresses.map((addr) => addr.address).toSet(); - final id = obj['txid'] as String; - final vins = obj['vin'] as List ?? []; - final vout = (obj['vout'] as List ?? []); - final date = obj['time'] is int - ? DateTime.fromMillisecondsSinceEpoch((obj['time'] as int) * 1000) - : DateTime.now(); - final confirmations = obj['confirmations'] as int ?? 0; - var direction = TransactionDirection.incoming; - var inputsAmount = 0; - var amount = 0; - var totalOutAmount = 0; - - for (dynamic vin in vins) { - final vout = vin['vout'] as int; - final out = vin['tx']['vout'][vout] as Map; - final outAddresses = - (out['scriptPubKey']['addresses'] as List)?.toSet(); - inputsAmount += - stringDoubleToBitcoinAmount((out['value'] as double ?? 0).toString()); - - if (outAddresses?.intersection(addressesSet)?.isNotEmpty ?? false) { - direction = TransactionDirection.outgoing; - } - } - - for (dynamic out in vout) { - final outAddresses = - out['scriptPubKey']['addresses'] as List ?? []; - final ntrs = outAddresses.toSet().intersection(addressesSet); - final value = stringDoubleToBitcoinAmount( - (out['value'] as double ?? 0.0).toString()); - totalOutAmount += value; - - if ((direction == TransactionDirection.incoming && ntrs.isNotEmpty) || - (direction == TransactionDirection.outgoing && ntrs.isEmpty)) { - amount += value; - } - } - - final fee = inputsAmount - totalOutAmount; - - return ElectrumTransactionInfo(type, - id: id, - height: height, - isPending: false, - fee: fee, - direction: direction, - amount: amount, - date: date, - confirmations: confirmations); - } - - factory ElectrumTransactionInfo.fromHexAndHeader(WalletType type, String hex, - {List addresses, int height, int timestamp, int confirmations}) { - final tx = bitcoin.Transaction.fromHex(hex); - var exist = false; - var amount = 0; - - if (addresses != null) { - tx.outs.forEach((out) { - try { - final p2pkh = bitcoin.P2PKH( - data: PaymentData(output: out.script), network: bitcoin.bitcoin); - exist = addresses.contains(p2pkh.data.address); - - if (exist) { - amount += out.value; - } - } catch (_) {} - }); - } - - final date = timestamp != null - ? DateTime.fromMillisecondsSinceEpoch(timestamp * 1000) - : DateTime.now(); - - return ElectrumTransactionInfo(type, - id: tx.getId(), - height: height, - isPending: false, - fee: null, - direction: TransactionDirection.incoming, - amount: amount, - date: date, - confirmations: confirmations); - } - - factory ElectrumTransactionInfo.fromJson( - Map data, WalletType type) { - return ElectrumTransactionInfo(type, - id: data['id'] as String, - height: data['height'] as int, - amount: data['amount'] as int, - fee: data['fee'] as int, - direction: parseTransactionDirectionFromInt(data['direction'] as int), - date: DateTime.fromMillisecondsSinceEpoch(data['date'] as int), - isPending: data['isPending'] as bool, - confirmations: data['confirmations'] as int); - } - - final WalletType type; - - String _fiatAmount; - - @override - String amountFormatted() => - '${formatAmount(bitcoinAmountToString(amount: amount))} ${walletTypeToCryptoCurrency(type).title}'; - - @override - String feeFormatted() => fee != null - ? '${formatAmount(bitcoinAmountToString(amount: fee))} ${walletTypeToCryptoCurrency(type).title}' - : ''; - - @override - String fiatAmount() => _fiatAmount ?? ''; - - @override - void changeFiatAmount(String amount) => _fiatAmount = formatAmount(amount); - - ElectrumTransactionInfo updated(ElectrumTransactionInfo info) { - return ElectrumTransactionInfo(info.type, - id: id, - height: info.height, - amount: info.amount, - fee: info.fee, - direction: direction ?? info.direction, - date: date ?? info.date, - isPending: isPending ?? info.isPending, - confirmations: info.confirmations); - } - - Map toJson() { - final m = {}; - m['id'] = id; - m['height'] = height; - m['amount'] = amount; - m['direction'] = direction.index; - m['date'] = date.millisecondsSinceEpoch; - m['isPending'] = isPending; - m['confirmations'] = confirmations; - m['fee'] = fee; - return m; - } -} diff --git a/lib/bitcoin/electrum_wallet.dart b/lib/bitcoin/electrum_wallet.dart deleted file mode 100644 index 988c0ed76..000000000 --- a/lib/bitcoin/electrum_wallet.dart +++ /dev/null @@ -1,548 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'package:cake_wallet/bitcoin/unspent_coins_info.dart'; -import 'package:hive/hive.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet_addresses.dart'; -import 'package:mobx/mobx.dart'; -import 'package:rxdart/subjects.dart'; -import 'package:flutter/foundation.dart'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:cake_wallet/bitcoin/electrum_transaction_info.dart'; -import 'package:cake_wallet/entities/pathForWallet.dart'; -import 'package:cake_wallet/bitcoin/address_to_output_script.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; -import 'package:cake_wallet/bitcoin/electrum_balance.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_transaction_credentials.dart'; -import 'package:cake_wallet/bitcoin/electrum_transaction_history.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_transaction_no_inputs_exception.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_transaction_priority.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_transaction_wrong_balance_exception.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_unspent.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_wallet_keys.dart'; -import 'package:cake_wallet/bitcoin/file.dart'; -import 'package:cake_wallet/bitcoin/pending_bitcoin_transaction.dart'; -import 'package:cake_wallet/bitcoin/script_hash.dart'; -import 'package:cake_wallet/bitcoin/utils.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/node.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; -import 'package:cake_wallet/entities/transaction_priority.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/bitcoin/electrum.dart'; - -part 'electrum_wallet.g.dart'; - -class ElectrumWallet = ElectrumWalletBase with _$ElectrumWallet; - -abstract class ElectrumWalletBase extends WalletBase with Store { - ElectrumWalletBase( - {@required String password, - @required WalletInfo walletInfo, - @required Box unspentCoinsInfo, - @required List initialAddresses, - @required this.networkType, - @required this.mnemonic, - ElectrumClient electrumClient, - ElectrumBalance initialBalance}) - : balance = initialBalance ?? - const ElectrumBalance(confirmed: 0, unconfirmed: 0), - hd = bitcoin.HDWallet.fromSeed(mnemonicToSeedBytes(mnemonic), - network: networkType) - .derivePath("m/0'/0"), - syncStatus = NotConnectedSyncStatus(), - _password = password, - _feeRates = [], - _isTransactionUpdating = false, - super(walletInfo) { - this.electrumClient = electrumClient ?? ElectrumClient(); - this.walletInfo = walletInfo; - this.unspentCoinsInfo = unspentCoinsInfo; - transactionHistory = - ElectrumTransactionHistory(walletInfo: walletInfo, password: password); - unspentCoins = []; - _scripthashesUpdateSubject = {}; - } - - static int estimatedTransactionSize(int inputsCount, int outputsCounts) => - inputsCount * 146 + outputsCounts * 33 + 8; - - final bitcoin.HDWallet hd; - final String mnemonic; - - ElectrumClient electrumClient; - Box unspentCoinsInfo; - - @override - ElectrumWalletAddresses walletAddresses; - - @override - @observable - ElectrumBalance balance; - - @override - @observable - SyncStatus syncStatus; - - List get scriptHashes => walletAddresses.addresses - .map((addr) => scriptHash(addr.address, networkType: networkType)) - .toList(); - - List get publicScriptHashes => walletAddresses.addresses - .where((addr) => !addr.isHidden) - .map((addr) => scriptHash(addr.address, networkType: networkType)) - .toList(); - - String get xpub => hd.base58; - - @override - String get seed => mnemonic; - - bitcoin.NetworkType networkType; - - @override - BitcoinWalletKeys get keys => BitcoinWalletKeys( - wif: hd.wif, privateKey: hd.privKey, publicKey: hd.pubKey); - - final String _password; - List unspentCoins; - List _feeRates; - Map> _scripthashesUpdateSubject; - bool _isTransactionUpdating; - - Future init() async { - await walletAddresses.init(); - await transactionHistory.init(); - await save(); - } - - @action - @override - Future startSync() async { - try { - syncStatus = StartingSyncStatus(); - await updateTransactions(); - _subscribeForUpdates(); - await _updateBalance(); - await updateUnspent(); - _feeRates = await electrumClient.feeRates(); - - Timer.periodic(const Duration(minutes: 1), - (timer) async => _feeRates = await electrumClient.feeRates()); - - syncStatus = SyncedSyncStatus(); - } catch (e) { - print(e.toString()); - syncStatus = FailedSyncStatus(); - } - } - - @action - @override - Future connectToNode({@required Node node}) async { - try { - syncStatus = ConnectingSyncStatus(); - await electrumClient.connectToUri(node.uri); - electrumClient.onConnectionStatusChange = (bool isConnected) { - if (!isConnected) { - syncStatus = LostConnectionSyncStatus(); - } - }; - syncStatus = ConnectedSyncStatus(); - } catch (e) { - print(e.toString()); - syncStatus = FailedSyncStatus(); - } - } - - @override - Future createTransaction( - Object credentials) async { - const minAmount = 546; - final transactionCredentials = credentials as BitcoinTransactionCredentials; - final inputs = []; - final outputs = transactionCredentials.outputs; - final hasMultiDestination = outputs.length > 1; - var allInputsAmount = 0; - - if (unspentCoins.isEmpty) { - await updateUnspent(); - } - - for (final utx in unspentCoins) { - if (utx.isSending) { - allInputsAmount += utx.value; - inputs.add(utx); - } - } - - if (inputs.isEmpty) { - throw BitcoinTransactionNoInputsException(); - } - - final allAmountFee = feeAmountForPriority( - transactionCredentials.priority, inputs.length, outputs.length); - final allAmount = allInputsAmount - allAmountFee; - - var credentialsAmount = 0; - var amount = 0; - var fee = 0; - - if (hasMultiDestination) { - if (outputs.any((item) => item.sendAll - || item.formattedCryptoAmount <= 0)) { - throw BitcoinTransactionWrongBalanceException(currency); - } - - credentialsAmount = outputs.fold(0, (acc, value) => - acc + value.formattedCryptoAmount); - - if (allAmount - credentialsAmount < minAmount) { - throw BitcoinTransactionWrongBalanceException(currency); - } - - amount = credentialsAmount; - - fee = calculateEstimatedFee(transactionCredentials.priority, amount, - outputsCount: outputs.length + 1); - } else { - final output = outputs.first; - - credentialsAmount = !output.sendAll - ? output.formattedCryptoAmount - : 0; - - if (credentialsAmount > allAmount) { - throw BitcoinTransactionWrongBalanceException(currency); - } - - amount = output.sendAll || allAmount - credentialsAmount < minAmount - ? allAmount - : credentialsAmount; - - fee = output.sendAll || amount == allAmount - ? allAmountFee - : calculateEstimatedFee(transactionCredentials.priority, amount); - } - - if (fee == 0) { - throw BitcoinTransactionWrongBalanceException(currency); - } - - final totalAmount = amount + fee; - - if (totalAmount > balance.confirmed || totalAmount > allInputsAmount) { - throw BitcoinTransactionWrongBalanceException(currency); - } - - final txb = bitcoin.TransactionBuilder(network: networkType); - final changeAddress = walletAddresses.address; - var leftAmount = totalAmount; - var totalInputAmount = 0; - - inputs.clear(); - - for (final utx in unspentCoins) { - if (utx.isSending) { - leftAmount = leftAmount - utx.value; - totalInputAmount += utx.value; - inputs.add(utx); - - if (leftAmount <= 0) { - break; - } - } - } - - if (inputs.isEmpty) { - throw BitcoinTransactionNoInputsException(); - } - - if (amount <= 0 || totalInputAmount < totalAmount) { - throw BitcoinTransactionWrongBalanceException(currency); - } - - txb.setVersion(1); - - inputs.forEach((input) { - if (input.isP2wpkh) { - final p2wpkh = bitcoin - .P2WPKH( - data: generatePaymentData(hd: hd, index: input.address.index), - network: networkType) - .data; - - txb.addInput(input.hash, input.vout, null, p2wpkh.output); - } else { - txb.addInput(input.hash, input.vout); - } - }); - - outputs.forEach((item) { - final outputAmount = hasMultiDestination - ? item.formattedCryptoAmount - : amount; - - final outputAddress = item.isParsedAddress - ? item.extractedAddress - : item.address; - - txb.addOutput( - addressToOutputScript(outputAddress, networkType), - outputAmount); - }); - - final estimatedSize = - estimatedTransactionSize(inputs.length, outputs.length + 1); - final feeAmount = feeRate(transactionCredentials.priority) * estimatedSize; - final changeValue = totalInputAmount - amount - feeAmount; - - if (changeValue > minAmount) { - txb.addOutput(changeAddress, changeValue); - } - - for (var i = 0; i < inputs.length; i++) { - final input = inputs[i]; - final keyPair = generateKeyPair( - hd: hd, index: input.address.index, network: networkType); - final witnessValue = input.isP2wpkh ? input.value : null; - - txb.sign(vin: i, keyPair: keyPair, witnessValue: witnessValue); - } - - return PendingBitcoinTransaction(txb.build(), type, - electrumClient: electrumClient, amount: amount, fee: fee) - ..addListener((transaction) async { - transactionHistory.addOne(transaction); - await _updateBalance(); - }); - } - - String toJSON() => json.encode({ - 'mnemonic': mnemonic, - 'account_index': walletAddresses.accountIndex.toString(), - 'addresses': walletAddresses.addresses.map((addr) => addr.toJSON()).toList(), - 'balance': balance?.toJSON() - }); - - int feeRate(TransactionPriority priority) { - if (priority is BitcoinTransactionPriority) { - return _feeRates[priority.raw]; - } - - return 0; - } - - int feeAmountForPriority(BitcoinTransactionPriority priority, int inputsCount, - int outputsCount) => - feeRate(priority) * estimatedTransactionSize(inputsCount, outputsCount); - - @override - int calculateEstimatedFee(TransactionPriority priority, int amount, - {int outputsCount}) { - if (priority is BitcoinTransactionPriority) { - int inputsCount = 0; - - if (amount != null) { - int totalValue = 0; - - for (final input in unspentCoins) { - if (totalValue >= amount) { - break; - } - - if (input.isSending) { - totalValue += input.value; - inputsCount += 1; - } - } - - if (totalValue < amount) return 0; - } else { - for (final input in unspentCoins) { - if (input.isSending) { - inputsCount += 1; - } - } - } - - // If send all, then we have no change value - final _outputsCount = outputsCount ?? (amount != null ? 2 : 1); - - return feeAmountForPriority( - priority, inputsCount, _outputsCount); - } - - return 0; - } - - @override - Future save() async { - final path = await makePath(); - await write(path: path, password: _password, data: toJSON()); - await transactionHistory.save(); - } - - bitcoin.ECPair keyPairFor({@required int index}) => - generateKeyPair(hd: hd, index: index, network: networkType); - - @override - Future rescan({int height}) async => throw UnimplementedError(); - - @override - Future close() async { - try { - await electrumClient?.close(); - } catch (_) {} - } - - Future makePath() async => - pathForWallet(name: walletInfo.name, type: walletInfo.type); - - Future updateUnspent() async { - final unspent = await Future.wait(walletAddresses - .addresses.map((address) => electrumClient - .getListUnspentWithAddress(address.address, networkType) - .then((unspent) => unspent - .map((unspent) => BitcoinUnspent.fromJSON(address, unspent))))); - unspentCoins = unspent.expand((e) => e).toList(); - - if (unspentCoinsInfo.isEmpty) { - unspentCoins.forEach((coin) => _addCoinInfo(coin)); - return; - } - - if (unspentCoins.isNotEmpty) { - unspentCoins.forEach((coin) { - final coinInfoList = unspentCoinsInfo.values.where((element) => - element.walletId.contains(id) && element.hash.contains(coin.hash)); - - if (coinInfoList.isNotEmpty) { - final coinInfo = coinInfoList.first; - - coin.isFrozen = coinInfo.isFrozen; - coin.isSending = coinInfo.isSending; - coin.note = coinInfo.note; - } else { - _addCoinInfo(coin); - } - }); - } - - await _refreshUnspentCoinsInfo(); - } - - Future _addCoinInfo(BitcoinUnspent coin) async { - final newInfo = UnspentCoinsInfo( - walletId: id, - hash: coin.hash, - isFrozen: coin.isFrozen, - isSending: coin.isSending, - note: coin.note - ); - - await unspentCoinsInfo.add(newInfo); - } - - Future _refreshUnspentCoinsInfo() async { - try { - final List keys = []; - final currentWalletUnspentCoins = unspentCoinsInfo.values - .where((element) => element.walletId.contains(id)); - - if (currentWalletUnspentCoins.isNotEmpty) { - currentWalletUnspentCoins.forEach((element) { - final existUnspentCoins = unspentCoins - ?.where((coin) => element.hash.contains(coin?.hash)); - - if (existUnspentCoins?.isEmpty ?? true) { - keys.add(element.key); - } - }); - } - - if (keys.isNotEmpty) { - await unspentCoinsInfo.deleteAll(keys); - } - } catch (e) { - print(e.toString()); - } - } - - Future fetchTransactionInfo( - {@required String hash, @required int height}) async { - final tx = await electrumClient.getTransactionExpanded(hash: hash); - return ElectrumTransactionInfo.fromElectrumVerbose(tx, walletInfo.type, - height: height, addresses: walletAddresses.addresses); - } - - @override - Future> fetchTransactions() async { - final histories = - publicScriptHashes.map((scriptHash) => electrumClient.getHistory(scriptHash)); - final _historiesWithDetails = await Future.wait(histories) - .then((histories) => histories.expand((i) => i).toList()) - .then((histories) => histories.map((tx) => fetchTransactionInfo( - hash: tx['tx_hash'] as String, height: tx['height'] as int))); - final historiesWithDetails = await Future.wait(_historiesWithDetails); - - return historiesWithDetails.fold>( - {}, (acc, tx) { - acc[tx.id] = acc[tx.id]?.updated(tx) ?? tx; - return acc; - }); - } - - Future updateTransactions() async { - try { - if (_isTransactionUpdating) { - return; - } - - _isTransactionUpdating = true; - final transactions = await fetchTransactions(); - transactionHistory.addMany(transactions); - await transactionHistory.save(); - _isTransactionUpdating = false; - } catch (e) { - print(e); - _isTransactionUpdating = false; - } - } - - void _subscribeForUpdates() { - scriptHashes.forEach((sh) async { - await _scripthashesUpdateSubject[sh]?.close(); - _scripthashesUpdateSubject[sh] = electrumClient.scripthashUpdate(sh); - _scripthashesUpdateSubject[sh].listen((event) async { - try { - await _updateBalance(); - await updateUnspent(); - await updateTransactions(); - } catch (e) { - print(e.toString()); - } - }); - }); - } - - Future _fetchBalances() async { - final balances = await Future.wait( - scriptHashes.map((sh) => electrumClient.getBalance(sh))); - final balance = balances.fold( - ElectrumBalance(confirmed: 0, unconfirmed: 0), - (ElectrumBalance acc, val) => ElectrumBalance( - confirmed: (val['confirmed'] as int ?? 0) + (acc.confirmed ?? 0), - unconfirmed: - (val['unconfirmed'] as int ?? 0) + (acc.unconfirmed ?? 0))); - - return balance; - } - - Future _updateBalance() async { - balance = await _fetchBalances(); - await save(); - } -} diff --git a/lib/bitcoin/electrum_wallet_addresses.dart b/lib/bitcoin/electrum_wallet_addresses.dart deleted file mode 100644 index 6d2d7af28..000000000 --- a/lib/bitcoin/electrum_wallet_addresses.dart +++ /dev/null @@ -1,132 +0,0 @@ -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; -import 'package:cake_wallet/entities/wallet_addresses.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:flutter/foundation.dart'; -import 'package:mobx/mobx.dart'; - -part 'electrum_wallet_addresses.g.dart'; - -class ElectrumWalletAddresses = ElectrumWalletAddressesBase - with _$ElectrumWalletAddresses; - -abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store { - ElectrumWalletAddressesBase(WalletInfo walletInfo, - {@required List initialAddresses, - int accountIndex = 0, - this.mainHd, - this.sideHd}) - : super(walletInfo) { - this.accountIndex = accountIndex; - addresses = ObservableList.of( - (initialAddresses ?? []).toSet()); - } - - static const regularAddressesCount = 22; - static const hiddenAddressesCount = 17; - - @override - @observable - String address; - - bitcoin.HDWallet mainHd; - bitcoin.HDWallet sideHd; - - ObservableList addresses; - - int accountIndex; - - @override - Future init() async { - await generateAddresses(); - address = addresses[accountIndex].address; - await updateAddressesInBox(); - } - - @action - Future nextAddress() async { - accountIndex += 1; - - if (accountIndex >= addresses.length) { - accountIndex = 0; - } - - address = addresses[accountIndex].address; - - await updateAddressesInBox(); - } - - Future generateAddresses() async { - final regularAddresses = []; - final hiddenAddresses = []; - - addresses.forEach((addr) { - if (addr.isHidden) { - hiddenAddresses.add(addr); - return; - } - - regularAddresses.add(addr); - }); - - if (regularAddresses.length < regularAddressesCount) { - final addressesCount = regularAddressesCount - regularAddresses.length; - await generateNewAddresses(addressesCount, - startIndex: regularAddresses.length, hd: mainHd, isHidden: false); - } - - if (hiddenAddresses.length < hiddenAddressesCount) { - final addressesCount = hiddenAddressesCount - hiddenAddresses.length; - await generateNewAddresses(addressesCount, - startIndex: hiddenAddresses.length, hd: sideHd, isHidden: true); - } - } - - Future generateNewAddress( - {bool isHidden = false, bitcoin.HDWallet hd}) async { - accountIndex += 1; - final address = BitcoinAddressRecord( - getAddress(index: accountIndex, hd: hd), - index: accountIndex, - isHidden: isHidden); - addresses.add(address); - return address; - } - - Future> generateNewAddresses(int count, - {int startIndex = 0, bitcoin.HDWallet hd, bool isHidden = false}) async { - final list = []; - - for (var i = startIndex; i < count + startIndex; i++) { - final address = BitcoinAddressRecord(getAddress(index: i, hd: hd), - index: i, isHidden: isHidden); - list.add(address); - } - - addresses.addAll(list); - return list; - } - - /*Future updateAddress(String address) async { - for (final addr in addresses) { - if (addr.address == address) { - await save(); - break; - } - } - }*/ - - String getAddress({@required int index, @required bitcoin.HDWallet hd}) => ''; - - @override - Future updateAddressesInBox() async { - try { - addressesMap.clear(); - addressesMap[address] = ''; - - await saveAddressesInBox(); - } catch (e) { - print(e.toString()); - } - } -} \ No newline at end of file diff --git a/lib/bitcoin/electrum_wallet_snapshot.dart b/lib/bitcoin/electrum_wallet_snapshot.dart deleted file mode 100644 index 9347157ad..000000000 --- a/lib/bitcoin/electrum_wallet_snapshot.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'dart:convert'; -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; -import 'package:cake_wallet/bitcoin/electrum_balance.dart'; -import 'package:cake_wallet/bitcoin/file.dart'; -import 'package:cake_wallet/entities/pathForWallet.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; - -class ElectrumWallletSnapshot { - ElectrumWallletSnapshot(this.name, this.type, this.password); - - final String name; - final String password; - final WalletType type; - - String mnemonic; - List addresses; - ElectrumBalance balance; - int accountIndex; - - Future load() async { - try { - final path = await pathForWallet(name: name, type: type); - final jsonSource = await read(path: path, password: password); - final data = json.decode(jsonSource) as Map; - final addressesTmp = data['addresses'] as List ?? []; - mnemonic = data['mnemonic'] as String; - addresses = addressesTmp - .whereType() - .map((addr) => BitcoinAddressRecord.fromJSON(addr)) - .toList(); - balance = ElectrumBalance.fromJSON(data['balance'] as String) ?? - ElectrumBalance(confirmed: 0, unconfirmed: 0); - accountIndex = 0; - - try { - accountIndex = int.parse(data['account_index'] as String); - } catch (_) {} - } catch (e) { - print(e); - } - } -} diff --git a/lib/bitcoin/file.dart b/lib/bitcoin/file.dart deleted file mode 100644 index 53f8f06b0..000000000 --- a/lib/bitcoin/file.dart +++ /dev/null @@ -1,40 +0,0 @@ -import 'dart:io'; -import 'package:cake_wallet/bitcoin/key.dart'; -import 'package:encrypt/encrypt.dart' as encrypt; -import 'package:flutter/foundation.dart'; - -Future write( - {@required String path, - @required String password, - @required String data}) async { - final keys = extractKeys(password); - final key = encrypt.Key.fromBase64(keys.first); - final iv = encrypt.IV.fromBase64(keys.last); - final encrypted = await encode(key: key, iv: iv, data: data); - final f = File(path); - f.writeAsStringSync(encrypted); -} - -Future writeData( - {@required String path, - @required String password, - @required String data}) async { - final keys = extractKeys(password); - final key = encrypt.Key.fromBase64(keys.first); - final iv = encrypt.IV.fromBase64(keys.last); - final encrypted = await encode(key: key, iv: iv, data: data); - final f = File(path); - f.writeAsStringSync(encrypted); -} - -Future read({@required String path, @required String password}) async { - final file = File(path); - - if (!file.existsSync()) { - file.createSync(); - } - - final encrypted = file.readAsStringSync(); - - return decode(password: password, data: encrypted); -} diff --git a/lib/bitcoin/key.dart b/lib/bitcoin/key.dart deleted file mode 100644 index bdabe7852..000000000 --- a/lib/bitcoin/key.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:encrypt/encrypt.dart' as encrypt; - -const ivEncodedStringLength = 12; - -String generateKey() { - final key = encrypt.Key.fromSecureRandom(512); - final iv = encrypt.IV.fromSecureRandom(8); - - return key.base64 + iv.base64; -} - -List extractKeys(String key) { - final _key = key.substring(0, key.length - ivEncodedStringLength); - final iv = key.substring(key.length - ivEncodedStringLength); - - return [_key, iv]; -} - -Future encode({encrypt.Key key, encrypt.IV iv, String data}) async { - final encrypter = encrypt.Encrypter(encrypt.Salsa20(key)); - final encrypted = encrypter.encrypt(data, iv: iv); - - return encrypted.base64; -} - -Future decode({String password, String data}) async { - final keys = extractKeys(password); - final key = encrypt.Key.fromBase64(keys.first); - final iv = encrypt.IV.fromBase64(keys.last); - final encrypter = encrypt.Encrypter(encrypt.Salsa20(key)); - final encrypted = encrypter.decrypt64(data, iv: iv); - - return encrypted; -} diff --git a/lib/bitcoin/litecoin_network.dart b/lib/bitcoin/litecoin_network.dart deleted file mode 100644 index d7ad2f837..000000000 --- a/lib/bitcoin/litecoin_network.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:bitcoin_flutter/bitcoin_flutter.dart'; - -final litecoinNetwork = NetworkType( - messagePrefix: '\x19Litecoin Signed Message:\n', - bech32: 'ltc', - bip32: Bip32Type(public: 0x0488b21e, private: 0x0488ade4), - pubKeyHash: 0x30, - scriptHash: 0x32, - wif: 0xb0); diff --git a/lib/bitcoin/litecoin_wallet.dart b/lib/bitcoin/litecoin_wallet.dart deleted file mode 100644 index cdae9a73b..000000000 --- a/lib/bitcoin/litecoin_wallet.dart +++ /dev/null @@ -1,82 +0,0 @@ -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_transaction_priority.dart'; -import 'package:cake_wallet/bitcoin/unspent_coins_info.dart'; -import 'package:cake_wallet/bitcoin/litecoin_wallet_addresses.dart'; -import 'package:cake_wallet/entities/transaction_priority.dart'; -import 'package:flutter/foundation.dart'; -import 'package:hive/hive.dart'; -import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet_snapshot.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; -import 'package:cake_wallet/bitcoin/electrum_balance.dart'; -import 'package:cake_wallet/bitcoin/litecoin_network.dart'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; - -part 'litecoin_wallet.g.dart'; - -class LitecoinWallet = LitecoinWalletBase with _$LitecoinWallet; - -abstract class LitecoinWalletBase extends ElectrumWallet with Store { - LitecoinWalletBase( - {@required String mnemonic, - @required String password, - @required WalletInfo walletInfo, - @required Box unspentCoinsInfo, - List initialAddresses, - ElectrumBalance initialBalance, - int accountIndex = 0}) - : super( - mnemonic: mnemonic, - password: password, - walletInfo: walletInfo, - unspentCoinsInfo: unspentCoinsInfo, - networkType: litecoinNetwork, - initialAddresses: initialAddresses, - initialBalance: initialBalance) { - walletAddresses = LitecoinWalletAddresses( - walletInfo, - initialAddresses: initialAddresses, - accountIndex: accountIndex, - mainHd: hd, - sideHd: bitcoin.HDWallet - .fromSeed(mnemonicToSeedBytes(mnemonic), network: networkType) - .derivePath("m/0'/1"), - networkType: networkType,); - } - - static Future open({ - @required String name, - @required WalletInfo walletInfo, - @required Box unspentCoinsInfo, - @required String password, - }) async { - final snp = ElectrumWallletSnapshot(name, walletInfo.type, password); - await snp.load(); - return LitecoinWallet( - mnemonic: snp.mnemonic, - password: password, - walletInfo: walletInfo, - unspentCoinsInfo: unspentCoinsInfo, - initialAddresses: snp.addresses, - initialBalance: snp.balance, - accountIndex: snp.accountIndex); - } - - @override - int feeRate(TransactionPriority priority) { - if (priority is LitecoinTransactionPriority) { - switch (priority) { - case LitecoinTransactionPriority.slow: - return 1; - case LitecoinTransactionPriority.medium: - return 2; - case LitecoinTransactionPriority.fast: - return 3; - } - } - - return 0; - } -} diff --git a/lib/bitcoin/litecoin_wallet_addresses.dart b/lib/bitcoin/litecoin_wallet_addresses.dart deleted file mode 100644 index 5dd6fba95..000000000 --- a/lib/bitcoin/litecoin_wallet_addresses.dart +++ /dev/null @@ -1,48 +0,0 @@ -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic.dart'; -import 'package:cake_wallet/bitcoin/utils.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet_addresses.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:flutter/foundation.dart'; -import 'package:mobx/mobx.dart'; - -part 'litecoin_wallet_addresses.g.dart'; - -class LitecoinWalletAddresses = LitecoinWalletAddressesBase - with _$LitecoinWalletAddresses; - -abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses - with Store { - LitecoinWalletAddressesBase( - WalletInfo walletInfo, - {@required List initialAddresses, - int accountIndex = 0, - @required bitcoin.HDWallet mainHd, - @required bitcoin.HDWallet sideHd, - @required this.networkType}) - : super( - walletInfo, - initialAddresses: initialAddresses, - accountIndex: accountIndex, - mainHd: mainHd, - sideHd: sideHd); - - bitcoin.NetworkType networkType; - - - @override - String getAddress({@required int index, @required bitcoin.HDWallet hd}) => - generateP2WPKHAddress(hd: hd, index: index, networkType: networkType); - - @override - Future generateAddresses() async { - if (addresses.length < 33) { - final addressesCount = 22 - addresses.length; - await generateNewAddresses(addressesCount, - hd: mainHd, startIndex: addresses.length); - await generateNewAddresses(11, - startIndex: 0, hd: sideHd, isHidden: true); - } - } -} \ No newline at end of file diff --git a/lib/bitcoin/litecoin_wallet_service.dart b/lib/bitcoin/litecoin_wallet_service.dart deleted file mode 100644 index dc5081e12..000000000 --- a/lib/bitcoin/litecoin_wallet_service.dart +++ /dev/null @@ -1,81 +0,0 @@ -import 'dart:io'; -import 'package:cake_wallet/bitcoin/unspent_coins_info.dart'; -import 'package:hive/hive.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic_is_incorrect_exception.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_wallet_creation_credentials.dart'; -import 'package:cake_wallet/bitcoin/litecoin_wallet.dart'; -import 'package:cake_wallet/core/wallet_service.dart'; -import 'package:cake_wallet/entities/pathForWallet.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; - -class LitecoinWalletService extends WalletService< - BitcoinNewWalletCredentials, - BitcoinRestoreWalletFromSeedCredentials, - BitcoinRestoreWalletFromWIFCredentials> { - LitecoinWalletService(this.walletInfoSource, this.unspentCoinsInfoSource); - - final Box walletInfoSource; - final Box unspentCoinsInfoSource; - - @override - WalletType getType() => WalletType.litecoin; - - @override - Future create(BitcoinNewWalletCredentials credentials) async { - final wallet = LitecoinWallet( - mnemonic: await generateMnemonic(), - password: credentials.password, - walletInfo: credentials.walletInfo, - unspentCoinsInfo: unspentCoinsInfoSource); - await wallet.save(); - await wallet.init(); - - return wallet; - } - - @override - Future isWalletExit(String name) async => - File(await pathForWallet(name: name, type: getType())).existsSync(); - - @override - Future openWallet(String name, String password) async { - final walletInfo = walletInfoSource.values.firstWhere( - (info) => info.id == WalletBase.idFor(name, getType()), - orElse: () => null); - final wallet = await LitecoinWalletBase.open( - password: password, name: name, walletInfo: walletInfo, - unspentCoinsInfo: unspentCoinsInfoSource); - await wallet.init(); - return wallet; - } - - @override - Future remove(String wallet) async => - File(await pathForWalletDir(name: wallet, type: getType())) - .delete(recursive: true); - - @override - Future restoreFromKeys( - BitcoinRestoreWalletFromWIFCredentials credentials) async => - throw UnimplementedError(); - - @override - Future restoreFromSeed( - BitcoinRestoreWalletFromSeedCredentials credentials) async { - if (!validateMnemonic(credentials.mnemonic)) { - throw BitcoinMnemonicIsIncorrectException(); - } - - final wallet = LitecoinWallet( - password: credentials.password, - mnemonic: credentials.mnemonic, - walletInfo: credentials.walletInfo, - unspentCoinsInfo: unspentCoinsInfoSource); - await wallet.save(); - await wallet.init(); - return wallet; - } -} diff --git a/lib/bitcoin/pending_bitcoin_transaction.dart b/lib/bitcoin/pending_bitcoin_transaction.dart deleted file mode 100644 index b26814339..000000000 --- a/lib/bitcoin/pending_bitcoin_transaction.dart +++ /dev/null @@ -1,60 +0,0 @@ -import 'package:cake_wallet/bitcoin/bitcoin_commit_transaction_exception.dart'; -import 'package:flutter/foundation.dart'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:cake_wallet/core/pending_transaction.dart'; -import 'package:cake_wallet/bitcoin/electrum.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; -import 'package:cake_wallet/bitcoin/electrum_transaction_info.dart'; -import 'package:cake_wallet/entities/transaction_direction.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; - -class PendingBitcoinTransaction with PendingTransaction { - PendingBitcoinTransaction(this._tx, this.type, - {@required this.electrumClient, - @required this.amount, - @required this.fee}) - : _listeners = []; - - final WalletType type; - final bitcoin.Transaction _tx; - final ElectrumClient electrumClient; - final int amount; - final int fee; - - @override - String get id => _tx.getId(); - - @override - String get amountFormatted => bitcoinAmountToString(amount: amount); - - @override - String get feeFormatted => bitcoinAmountToString(amount: fee); - - final List _listeners; - - @override - Future commit() async { - final result = - await electrumClient.broadcastTransaction(transactionRaw: _tx.toHex()); - - if (result.isEmpty) { - throw BitcoinCommitTransactionException(); - } - - _listeners?.forEach((listener) => listener(transactionInfo())); - } - - void addListener( - void Function(ElectrumTransactionInfo transaction) listener) => - _listeners.add(listener); - - ElectrumTransactionInfo transactionInfo() => ElectrumTransactionInfo(type, - id: id, - height: 0, - amount: amount, - direction: TransactionDirection.outgoing, - date: DateTime.now(), - isPending: true, - confirmations: 0, - fee: fee); -} diff --git a/lib/bitcoin/script_hash.dart b/lib/bitcoin/script_hash.dart deleted file mode 100644 index b1025f66b..000000000 --- a/lib/bitcoin/script_hash.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:crypto/crypto.dart'; - -String scriptHash(String address, {@required bitcoin.NetworkType networkType}) { - final outputScript = - bitcoin.Address.addressToOutputScript(address, networkType); - final parts = sha256.convert(outputScript).toString().split(''); - var res = ''; - - for (var i = parts.length - 1; i >= 0; i--) { - final char = parts[i]; - i--; - final nextChar = parts[i]; - res += nextChar; - res += char; - } - - return res; -} diff --git a/lib/bitcoin/unspent_coins_info.dart b/lib/bitcoin/unspent_coins_info.dart deleted file mode 100644 index 6ce647dce..000000000 --- a/lib/bitcoin/unspent_coins_info.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:hive/hive.dart'; - -part 'unspent_coins_info.g.dart'; - -@HiveType(typeId: UnspentCoinsInfo.typeId) -class UnspentCoinsInfo extends HiveObject { - UnspentCoinsInfo({ - this.walletId, - this.hash, - this.isFrozen, - this.isSending, - this.note}); - - static const typeId = 9; - static const boxName = 'Unspent'; - static const boxKey = 'unspentBoxKey'; - - @HiveField(0) - String walletId; - - @HiveField(1) - String hash; - - @HiveField(2) - bool isFrozen; - - @HiveField(3) - bool isSending; - - @HiveField(4) - String note; -} \ No newline at end of file diff --git a/lib/bitcoin/utils.dart b/lib/bitcoin/utils.dart deleted file mode 100644 index 3a638555a..000000000 --- a/lib/bitcoin/utils.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'dart:typed_data'; -import 'package:flutter/foundation.dart'; -import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:bitcoin_flutter/src/payments/index.dart' show PaymentData; -import 'package:hex/hex.dart'; - -bitcoin.PaymentData generatePaymentData( - {@required bitcoin.HDWallet hd, @required int index}) => - PaymentData( - pubkey: Uint8List.fromList(HEX.decode(hd.derive(index).pubKey))); - -bitcoin.ECPair generateKeyPair( - {@required bitcoin.HDWallet hd, - @required int index, - bitcoin.NetworkType network}) => - bitcoin.ECPair.fromWIF(hd.derive(index).wif, network: network); - -String generateP2WPKHAddress( - {@required bitcoin.HDWallet hd, - @required int index, - bitcoin.NetworkType networkType}) => - bitcoin - .P2WPKH( - data: PaymentData( - pubkey: - Uint8List.fromList(HEX.decode(hd.derive(index).pubKey))), - network: networkType) - .data - .address; - -String generateP2WPKHAddressByPath( - {@required bitcoin.HDWallet hd, - @required String path, - bitcoin.NetworkType networkType}) => - bitcoin - .P2WPKH( - data: PaymentData( - pubkey: - Uint8List.fromList(HEX.decode(hd.derivePath(path).pubKey))), - network: networkType) - .data - .address; - -String generateP2PKHAddress( - {@required bitcoin.HDWallet hd, - @required int index, - bitcoin.NetworkType networkType}) => - bitcoin - .P2PKH( - data: PaymentData( - pubkey: - Uint8List.fromList(HEX.decode(hd.derive(index).pubKey))), - network: networkType) - .data - .address; diff --git a/lib/buy/buy_provider.dart b/lib/buy/buy_provider.dart index dc450ad7e..0f496bad2 100644 --- a/lib/buy/buy_provider.dart +++ b/lib/buy/buy_provider.dart @@ -1,8 +1,8 @@ import 'package:cake_wallet/buy/buy_amount.dart'; import 'package:cake_wallet/buy/buy_provider_description.dart'; import 'package:cake_wallet/buy/order.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/wallet_type.dart'; abstract class BuyProvider { BuyProvider({this.wallet, this.isTestEnvironment}); diff --git a/lib/buy/buy_provider_description.dart b/lib/buy/buy_provider_description.dart index 46b3bcdc1..bcb581d05 100644 --- a/lib/buy/buy_provider_description.dart +++ b/lib/buy/buy_provider_description.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/enumerable_item.dart'; +import 'package:cw_core/enumerable_item.dart'; class BuyProviderDescription extends EnumerableItem with Serializable { diff --git a/lib/buy/moonpay/moonpay_buy_provider.dart b/lib/buy/moonpay/moonpay_buy_provider.dart index ab0ef4b4b..4248df483 100644 --- a/lib/buy/moonpay/moonpay_buy_provider.dart +++ b/lib/buy/moonpay/moonpay_buy_provider.dart @@ -6,11 +6,11 @@ import 'package:cake_wallet/buy/buy_amount.dart'; import 'package:cake_wallet/buy/buy_provider.dart'; import 'package:cake_wallet/buy/buy_provider_description.dart'; import 'package:cake_wallet/buy/order.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/exchange/trade_state.dart'; import 'package:cake_wallet/.secrets.g.dart' as secrets; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; class MoonPaySellProvider { MoonPaySellProvider({this.isTest = false}) diff --git a/lib/buy/order.dart b/lib/buy/order.dart index 54c13bd37..24c5f58db 100644 --- a/lib/buy/order.dart +++ b/lib/buy/order.dart @@ -1,7 +1,7 @@ import 'package:cake_wallet/buy/buy_provider_description.dart'; import 'package:hive/hive.dart'; import 'package:cake_wallet/exchange/trade_state.dart'; -import 'package:cake_wallet/entities/format_amount.dart'; +import 'package:cw_core/format_amount.dart'; part 'order.g.dart'; diff --git a/lib/buy/wyre/wyre_buy_provider.dart b/lib/buy/wyre/wyre_buy_provider.dart index f1100d130..211173635 100644 --- a/lib/buy/wyre/wyre_buy_provider.dart +++ b/lib/buy/wyre/wyre_buy_provider.dart @@ -5,8 +5,8 @@ import 'package:cake_wallet/buy/buy_amount.dart'; import 'package:cake_wallet/buy/buy_provider.dart'; import 'package:cake_wallet/buy/buy_provider_description.dart'; import 'package:cake_wallet/buy/order.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/exchange/trade_state.dart'; import 'package:cake_wallet/.secrets.g.dart' as secrets; diff --git a/lib/core/address_label_validator.dart b/lib/core/address_label_validator.dart index 7d8f8c631..2b30272db 100644 --- a/lib/core/address_label_validator.dart +++ b/lib/core/address_label_validator.dart @@ -1,6 +1,6 @@ import 'package:cake_wallet/core/validator.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; class AddressLabelValidator extends TextValidator { AddressLabelValidator({WalletType type}) diff --git a/lib/core/address_validator.dart b/lib/core/address_validator.dart index f481d0b1d..65c89d589 100644 --- a/lib/core/address_validator.dart +++ b/lib/core/address_validator.dart @@ -1,7 +1,7 @@ import 'package:flutter/foundation.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/core/validator.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; class AddressValidator extends TextValidator { AddressValidator({@required CryptoCurrency type}) diff --git a/lib/core/amount_converter.dart b/lib/core/amount_converter.dart index 7ef4ed442..c939007f8 100644 --- a/lib/core/amount_converter.dart +++ b/lib/core/amount_converter.dart @@ -1,5 +1,5 @@ import 'package:intl/intl.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; class AmountConverter { static const _moneroAmountLength = 12; diff --git a/lib/core/amount_validator.dart b/lib/core/amount_validator.dart index 661e408b5..52e75969f 100644 --- a/lib/core/amount_validator.dart +++ b/lib/core/amount_validator.dart @@ -1,6 +1,6 @@ import 'package:cake_wallet/core/validator.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; class AmountValidator extends TextValidator { AmountValidator({WalletType type, bool isAutovalidate = false}) diff --git a/lib/core/backup_service.dart b/lib/core/backup_service.dart index 09edc6c1f..fcd8b2d0b 100644 --- a/lib/core/backup_service.dart +++ b/lib/core/backup_service.dart @@ -12,7 +12,7 @@ import 'package:cake_wallet/core/key_service.dart'; import 'package:cake_wallet/entities/encrypt.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; import 'package:cake_wallet/entities/secret_store_key.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; +import 'package:cw_core/wallet_info.dart'; import 'package:cake_wallet/.secrets.g.dart' as secrets; class BackupService { diff --git a/lib/core/fiat_conversion_service.dart b/lib/core/fiat_conversion_service.dart index 9bda4e7ad..7a0513d5c 100644 --- a/lib/core/fiat_conversion_service.dart +++ b/lib/core/fiat_conversion_service.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; import 'dart:convert'; import 'package:flutter/foundation.dart'; diff --git a/lib/core/generate_wallet_password.dart b/lib/core/generate_wallet_password.dart index 9f126d8c2..71fb68d9c 100644 --- a/lib/core/generate_wallet_password.dart +++ b/lib/core/generate_wallet_password.dart @@ -1,6 +1,6 @@ import 'package:uuid/uuid.dart'; -import 'package:cake_wallet/bitcoin/key.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/key.dart'; +import 'package:cw_core/wallet_type.dart'; String generateWalletPassword(WalletType type) { switch (type) { diff --git a/lib/core/mnemonic_length.dart b/lib/core/mnemonic_length.dart index 8adf5c438..ea51d40dd 100644 --- a/lib/core/mnemonic_length.dart +++ b/lib/core/mnemonic_length.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; const bitcoinMnemonicLength = 12; const moneroMnemonicLength = 25; diff --git a/lib/core/monero_account_label_validator.dart b/lib/core/monero_account_label_validator.dart index 2bc0fcccc..7e287959b 100644 --- a/lib/core/monero_account_label_validator.dart +++ b/lib/core/monero_account_label_validator.dart @@ -1,7 +1,7 @@ import 'package:flutter/foundation.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/core/validator.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; class MoneroLabelValidator extends TextValidator { MoneroLabelValidator({@required CryptoCurrency type}) diff --git a/lib/core/pending_transaction.dart b/lib/core/pending_transaction.dart deleted file mode 100644 index c7f9b77d5..000000000 --- a/lib/core/pending_transaction.dart +++ /dev/null @@ -1,7 +0,0 @@ -mixin PendingTransaction { - String get id; - String get amountFormatted; - String get feeFormatted; - - Future commit(); -} \ No newline at end of file diff --git a/lib/core/seed_validator.dart b/lib/core/seed_validator.dart index fd2e4851b..c45490f95 100644 --- a/lib/core/seed_validator.dart +++ b/lib/core/seed_validator.dart @@ -1,15 +1,8 @@ -import 'package:cake_wallet/bitcoin/bitcoin_mnemonic.dart' as bitcoin_electrum; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/core/validator.dart'; import 'package:cake_wallet/entities/mnemonic_item.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:cake_wallet/monero/mnemonics/chinese_simplified.dart'; -import 'package:cake_wallet/monero/mnemonics/dutch.dart'; -import 'package:cake_wallet/monero/mnemonics/english.dart'; -import 'package:cake_wallet/monero/mnemonics/german.dart'; -import 'package:cake_wallet/monero/mnemonics/japanese.dart'; -import 'package:cake_wallet/monero/mnemonics/portuguese.dart'; -import 'package:cake_wallet/monero/mnemonics/russian.dart'; -import 'package:cake_wallet/monero/mnemonics/spanish.dart'; +import 'package:cw_core/wallet_type.dart'; +import 'package:cake_wallet/monero/monero.dart'; import 'package:cake_wallet/utils/language_list.dart'; class SeedValidator extends Validator { @@ -27,46 +20,15 @@ class SeedValidator extends Validator { case WalletType.litecoin: return getBitcoinWordList(language); case WalletType.monero: - return getMoneroWordList(language); + return monero.getMoneroWordList(language); default: return []; } } - static List getMoneroWordList(String language) { - switch (language) { - case LanguageList.english: - return EnglishMnemonics.words; - break; - case LanguageList.chineseSimplified: - return ChineseSimplifiedMnemonics.words; - break; - case LanguageList.dutch: - return DutchMnemonics.words; - break; - case LanguageList.german: - return GermanMnemonics.words; - break; - case LanguageList.japanese: - return JapaneseMnemonics.words; - break; - case LanguageList.portuguese: - return PortugueseMnemonics.words; - break; - case LanguageList.russian: - return RussianMnemonics.words; - break; - case LanguageList.spanish: - return SpanishMnemonics.words; - break; - default: - return EnglishMnemonics.words; - } - } - static List getBitcoinWordList(String language) { assert(language.toLowerCase() == LanguageList.english.toLowerCase()); - return bitcoin_electrum.englishWordlist; + return bitcoin.getWordList(); } @override diff --git a/lib/core/transaction_history.dart b/lib/core/transaction_history.dart deleted file mode 100644 index ee386e392..000000000 --- a/lib/core/transaction_history.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; - -abstract class TransactionHistoryBase { - TransactionHistoryBase(); - // : _isUpdating = false; - - @observable - ObservableMap transactions; - - Future save(); - - void addOne(TransactionType transaction); - - void addMany(Map transactions); - - // bool _isUpdating; - - // @action - // Future update() async { - // if (_isUpdating) { - // return; - // } - - // try { - // _isUpdating = true; - // final _transactions = await fetchTransactions(); - // transactions.keys - // .toSet() - // .difference(_transactions.keys.toSet()) - // .forEach((k) => transactions.remove(k)); - // _transactions.forEach((key, value) => transactions[key] = value); - // _isUpdating = false; - // } catch (e) { - // _isUpdating = false; - // rethrow; - // } - // } - - // void updateAsync({void Function() onFinished}) { - // fetchTransactionsAsync( - // (transaction) => transactions[transaction.id] = transaction, - // onFinished: onFinished); - // } - - // void fetchTransactionsAsync( - // void Function(TransactionType transaction) onTransactionLoaded, - // {void Function() onFinished}); - - // Future> fetchTransactions(); -} diff --git a/lib/core/wallet_base.dart b/lib/core/wallet_base.dart deleted file mode 100644 index edcb05466..000000000 --- a/lib/core/wallet_base.dart +++ /dev/null @@ -1,71 +0,0 @@ -import 'package:cake_wallet/entities/balance.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; -import 'package:cake_wallet/entities/transaction_priority.dart'; -import 'package:cake_wallet/entities/wallet_addresses.dart'; -import 'package:flutter/foundation.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/core/pending_transaction.dart'; -import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/entities/currency_for_wallet_type.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; -import 'package:cake_wallet/entities/node.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; - -abstract class WalletBase< - BalanceType extends Balance, - HistoryType extends TransactionHistoryBase, - TransactionType extends TransactionInfo> { - WalletBase(this.walletInfo); - - static String idFor(String name, WalletType type) => - walletTypeToString(type).toLowerCase() + '_' + name; - - WalletInfo walletInfo; - - WalletType get type => walletInfo.type; - - CryptoCurrency get currency => currencyForWalletType(type); - - String get id => walletInfo.id; - - String get name => walletInfo.name; - - //String get address; - - //set address(String address); - - BalanceType get balance; - - SyncStatus get syncStatus; - - set syncStatus(SyncStatus status); - - String get seed; - - Object get keys; - - WalletAddresses get walletAddresses; - - HistoryType transactionHistory; - - Future connectToNode({@required Node node}); - - Future startSync(); - - Future createTransaction(Object credentials); - - int calculateEstimatedFee(TransactionPriority priority, int amount); - - // void fetchTransactionsAsync( - // void Function(TransactionType transaction) onTransactionLoaded, - // {void Function() onFinished}); - - Future> fetchTransactions(); - - Future save(); - - Future rescan({int height}); - - void close(); -} diff --git a/lib/core/wallet_creation_service.dart b/lib/core/wallet_creation_service.dart index fe3062d36..dcb7983f5 100644 --- a/lib/core/wallet_creation_service.dart +++ b/lib/core/wallet_creation_service.dart @@ -3,11 +3,11 @@ import 'package:flutter/foundation.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:cake_wallet/core/key_service.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:cake_wallet/core/generate_wallet_password.dart'; -import 'package:cake_wallet/core/wallet_credentials.dart'; -import 'package:cake_wallet/core/wallet_service.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_credentials.dart'; +import 'package:cw_core/wallet_service.dart'; +import 'package:cw_core/wallet_type.dart'; class WalletCreationService { WalletCreationService( diff --git a/lib/core/wallet_credentials.dart b/lib/core/wallet_credentials.dart deleted file mode 100644 index ddfafab1a..000000000 --- a/lib/core/wallet_credentials.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:cake_wallet/entities/wallet_info.dart'; - -abstract class WalletCredentials { - WalletCredentials({this.name, this.password, this.height, this.walletInfo}); - - final String name; - final int height; - String password; - WalletInfo walletInfo; -} diff --git a/lib/core/wallet_service.dart b/lib/core/wallet_service.dart deleted file mode 100644 index 2d207c31e..000000000 --- a/lib/core/wallet_service.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/core/wallet_credentials.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; - -abstract class WalletService { - WalletType getType(); - - Future create(N credentials); - - Future restoreFromSeed(RFS credentials); - - Future restoreFromKeys(RFK credentials); - - Future openWallet(String name, String password); - - Future isWalletExit(String name); - - Future remove(String wallet); -} diff --git a/lib/di.dart b/lib/di.dart index eb6a9e9b2..2a1430796 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -1,16 +1,15 @@ -import 'package:cake_wallet/bitcoin/bitcoin_wallet_service.dart'; -import 'package:cake_wallet/bitcoin/litecoin_wallet_service.dart'; -import 'package:cake_wallet/bitcoin/unspent_coins_info.dart'; +import 'package:cake_wallet/monero/monero.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; +import 'package:cw_core/unspent_coins_info.dart'; import 'package:cake_wallet/core/backup_service.dart'; -import 'package:cake_wallet/core/wallet_service.dart'; +import 'package:cw_core/wallet_service.dart'; import 'package:cake_wallet/entities/biometric_auth.dart'; import 'package:cake_wallet/entities/contact_record.dart'; import 'package:cake_wallet/buy/order.dart'; import 'package:cake_wallet/entities/transaction_description.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; -import 'package:cake_wallet/monero/monero_wallet_service.dart'; +import 'package:cw_core/transaction_info.dart'; import 'package:cake_wallet/entities/contact.dart'; -import 'package:cake_wallet/entities/node.dart'; +import 'package:cw_core/node.dart'; import 'package:cake_wallet/exchange/trade.dart'; import 'package:cake_wallet/reactions/on_authentication_state_change.dart'; import 'package:cake_wallet/src/screens/backup/backup_page.dart'; @@ -51,8 +50,7 @@ import 'package:cake_wallet/store/secret_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/core/auth_service.dart'; import 'package:cake_wallet/core/key_service.dart'; -import 'package:cake_wallet/monero/monero_wallet.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; +import 'package:cw_core/wallet_info.dart'; import 'package:cake_wallet/src/screens/monero_accounts/monero_account_list_page.dart'; import 'package:cake_wallet/src/screens/monero_accounts/monero_account_edit_or_create_page.dart'; import 'package:cake_wallet/src/screens/auth/auth_page.dart'; @@ -108,7 +106,7 @@ import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart'; import 'package:cake_wallet/view_model/wallet_restoration_from_keys_vm.dart'; import 'package:cake_wallet/core/wallet_creation_service.dart'; import 'package:cake_wallet/store/app_store.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/view_model/wallet_new_vm.dart'; import 'package:cake_wallet/store/authentication_store.dart'; import 'package:cake_wallet/store/dashboard/trades_store.dart'; @@ -354,7 +352,7 @@ Future setup( getIt.registerFactory(() { final wallet = getIt.get().wallet; - if (wallet is MoneroWallet) { + if (wallet.type == WalletType.monero) { return MoneroAccountListViewModel(wallet); } @@ -383,7 +381,7 @@ Future setup( getIt.registerFactoryParam( (AccountListItem account, _) => MoneroAccountEditOrCreateViewModel( - (getIt.get().wallet as MoneroWallet).walletAddresses.accountList, + monero.getAccountList(getIt.get().wallet), wallet: getIt.get().wallet, accountListItem: account)); @@ -467,23 +465,15 @@ Future setup( getIt.registerFactory( () => ExchangeTemplatePage(getIt.get())); - getIt.registerFactory(() => MoneroWalletService(_walletInfoSource)); - - getIt.registerFactory(() => - BitcoinWalletService(_walletInfoSource, _unspentCoinsInfoSource)); - - getIt.registerFactory(() => - LitecoinWalletService(_walletInfoSource, _unspentCoinsInfoSource)); - getIt.registerFactoryParam( (WalletType param1, __) { switch (param1) { case WalletType.monero: - return getIt.get(); + return monero.createMoneroWalletService(_walletInfoSource); case WalletType.bitcoin: - return getIt.get(); + return bitcoin.createBitcoinWalletService(_walletInfoSource, _unspentCoinsInfoSource); case WalletType.litecoin: - return getIt.get(); + return bitcoin.createLitecoinWalletService(_walletInfoSource, _unspentCoinsInfoSource); default: return null; } diff --git a/lib/entities/balance.dart b/lib/entities/balance.dart deleted file mode 100644 index cf98f9e0f..000000000 --- a/lib/entities/balance.dart +++ /dev/null @@ -1,11 +0,0 @@ -abstract class Balance { - const Balance(this.available, this.additional); - - final int available; - - final int additional; - - String get formattedAvailableBalance; - - String get formattedAdditionalBalance; -} diff --git a/lib/entities/balance_display_mode.dart b/lib/entities/balance_display_mode.dart index 8b11bf385..37049ac00 100644 --- a/lib/entities/balance_display_mode.dart +++ b/lib/entities/balance_display_mode.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/enumerable_item.dart'; +import 'package:cw_core/enumerable_item.dart'; class BalanceDisplayMode extends EnumerableItem with Serializable { const BalanceDisplayMode({@required String title, @required int raw}) diff --git a/lib/entities/calculate_estimated_fee.dart b/lib/entities/calculate_estimated_fee.dart deleted file mode 100644 index 0f48acad3..000000000 --- a/lib/entities/calculate_estimated_fee.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:cake_wallet/entities/monero_transaction_priority.dart'; - -double calculateEstimatedFee({MoneroTransactionPriority priority}) { - if (priority == MoneroTransactionPriority.slow) { - return 0.00002459; - } - - if (priority == MoneroTransactionPriority.regular) { - return 0.00012305; - } - - if (priority == MoneroTransactionPriority.medium) { - return 0.00024503; - } - - if (priority == MoneroTransactionPriority.fast) { - return 0.00061453; - } - - if (priority == MoneroTransactionPriority.fastest) { - return 0.0260216; - } - - return 0; -} \ No newline at end of file diff --git a/lib/entities/contact.dart b/lib/entities/contact.dart index 3f6772d3a..3c1177078 100644 --- a/lib/entities/contact.dart +++ b/lib/entities/contact.dart @@ -1,7 +1,8 @@ import 'package:flutter/foundation.dart'; import 'package:hive/hive.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/utils/mobx.dart'; +import 'package:cw_core/keyable.dart'; part 'contact.g.dart'; diff --git a/lib/entities/contact_base.dart b/lib/entities/contact_base.dart index a80fd1c21..46bc9200c 100644 --- a/lib/entities/contact_base.dart +++ b/lib/entities/contact_base.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; abstract class ContactBase { String name; diff --git a/lib/entities/contact_model.dart b/lib/entities/contact_model.dart index dacd1cfb1..86bdee969 100644 --- a/lib/entities/contact_model.dart +++ b/lib/entities/contact_model.dart @@ -1,7 +1,7 @@ // import 'package:hive/hive.dart'; // import 'package:mobx/mobx.dart'; // import 'package:cake_wallet/entities/contact.dart'; -// import 'package:cake_wallet/entities/crypto_currency.dart'; +// import 'package:cw_core/crypto_currency.dart'; // part 'contact_model.g.dart'; diff --git a/lib/entities/contact_record.dart b/lib/entities/contact_record.dart index ff535ecb0..2a023943c 100644 --- a/lib/entities/contact_record.dart +++ b/lib/entities/contact_record.dart @@ -1,7 +1,7 @@ import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/entities/contact.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/entities/record.dart'; import 'package:cake_wallet/entities/contact_base.dart'; diff --git a/lib/entities/crypto_amount_format.dart b/lib/entities/crypto_amount_format.dart deleted file mode 100644 index 649ac45f5..000000000 --- a/lib/entities/crypto_amount_format.dart +++ /dev/null @@ -1 +0,0 @@ -double cryptoAmountToDouble({num amount, num divider}) => amount / divider; \ No newline at end of file diff --git a/lib/entities/crypto_currency.dart b/lib/entities/crypto_currency.dart deleted file mode 100644 index 7f27da7d6..000000000 --- a/lib/entities/crypto_currency.dart +++ /dev/null @@ -1,125 +0,0 @@ -import 'package:cake_wallet/entities/enumerable_item.dart'; -import 'package:hive/hive.dart'; - -part 'crypto_currency.g.dart'; - -@HiveType(typeId: 0) -class CryptoCurrency extends EnumerableItem with Serializable { - const CryptoCurrency({final String title, final int raw}) - : super(title: title, raw: raw); - - static const all = [ - CryptoCurrency.xmr, - CryptoCurrency.ada, - CryptoCurrency.bch, - CryptoCurrency.bnb, - CryptoCurrency.btc, - CryptoCurrency.dai, - CryptoCurrency.dash, - CryptoCurrency.eos, - CryptoCurrency.eth, - CryptoCurrency.ltc, - CryptoCurrency.trx, - CryptoCurrency.usdt, - CryptoCurrency.usdterc20, - CryptoCurrency.xlm, - CryptoCurrency.xrp - ]; - static const xmr = CryptoCurrency(title: 'XMR', raw: 0); - static const ada = CryptoCurrency(title: 'ADA', raw: 1); - static const bch = CryptoCurrency(title: 'BCH', raw: 2); - static const bnb = CryptoCurrency(title: 'BNB BEP2', raw: 3); - static const btc = CryptoCurrency(title: 'BTC', raw: 4); - static const dai = CryptoCurrency(title: 'DAI', raw: 5); - static const dash = CryptoCurrency(title: 'DASH', raw: 6); - static const eos = CryptoCurrency(title: 'EOS', raw: 7); - static const eth = CryptoCurrency(title: 'ETH', raw: 8); - static const ltc = CryptoCurrency(title: 'LTC', raw: 9); - static const nano = CryptoCurrency(title: 'NANO', raw: 10); - static const trx = CryptoCurrency(title: 'TRX', raw: 11); - static const usdt = CryptoCurrency(title: 'USDT', raw: 12); - static const usdterc20 = CryptoCurrency(title: 'USDTERC20', raw: 13); - static const xlm = CryptoCurrency(title: 'XLM', raw: 14); - static const xrp = CryptoCurrency(title: 'XRP', raw: 15); - - static CryptoCurrency deserialize({int raw}) { - switch (raw) { - case 0: - return CryptoCurrency.xmr; - case 1: - return CryptoCurrency.ada; - case 2: - return CryptoCurrency.bch; - case 3: - return CryptoCurrency.bnb; - case 4: - return CryptoCurrency.btc; - case 5: - return CryptoCurrency.dai; - case 6: - return CryptoCurrency.dash; - case 7: - return CryptoCurrency.eos; - case 8: - return CryptoCurrency.eth; - case 9: - return CryptoCurrency.ltc; - case 10: - return CryptoCurrency.nano; - case 11: - return CryptoCurrency.trx; - case 12: - return CryptoCurrency.usdt; - case 13: - return CryptoCurrency.usdterc20; - case 14: - return CryptoCurrency.xlm; - case 15: - return CryptoCurrency.xrp; - default: - return null; - } - } - - static CryptoCurrency fromString(String raw) { - switch (raw.toLowerCase()) { - case 'xmr': - return CryptoCurrency.xmr; - case 'ada': - return CryptoCurrency.ada; - case 'bch': - return CryptoCurrency.bch; - case 'bnbmainnet': - return CryptoCurrency.bnb; - case 'btc': - return CryptoCurrency.btc; - case 'dai': - return CryptoCurrency.dai; - case 'dash': - return CryptoCurrency.dash; - case 'eos': - return CryptoCurrency.eos; - case 'eth': - return CryptoCurrency.eth; - case 'ltc': - return CryptoCurrency.ltc; - case 'nano': - return CryptoCurrency.nano; - case 'trx': - return CryptoCurrency.trx; - case 'usdt': - return CryptoCurrency.usdt; - case 'usdterc20': - return CryptoCurrency.usdterc20; - case 'xlm': - return CryptoCurrency.xlm; - case 'xrp': - return CryptoCurrency.xrp; - default: - return null; - } - } - - @override - String toString() => title; -} diff --git a/lib/entities/currency_for_wallet_type.dart b/lib/entities/currency_for_wallet_type.dart deleted file mode 100644 index 7f13d12b0..000000000 --- a/lib/entities/currency_for_wallet_type.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:cake_wallet/entities/crypto_currency.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; - -CryptoCurrency currencyForWalletType(WalletType type) { - switch (type) { - case WalletType.bitcoin: - return CryptoCurrency.btc; - case WalletType.monero: - return CryptoCurrency.xmr; - case WalletType.litecoin: - return CryptoCurrency.ltc; - default: - return null; - } -} diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index 51aa5b49a..889769055 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -1,21 +1,21 @@ import 'dart:io' show File, Platform; -import 'package:cake_wallet/bitcoin/bitcoin_transaction_priority.dart'; -import 'package:cake_wallet/entities/pathForWallet.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; +import 'package:cw_core/pathForWallet.dart'; import 'package:cake_wallet/entities/secret_store_key.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:hive/hive.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:cake_wallet/entities/node.dart'; +import 'package:cw_core/wallet_type.dart'; +import 'package:cw_core/node.dart'; import 'package:cake_wallet/entities/balance_display_mode.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/entities/node_list.dart'; -import 'package:cake_wallet/entities/monero_transaction_priority.dart'; +import 'package:cake_wallet/monero/monero.dart'; import 'package:cake_wallet/entities/contact.dart'; import 'package:cake_wallet/entities/fs_migration.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; +import 'package:cw_core/wallet_info.dart'; import 'package:cake_wallet/exchange/trade.dart'; import 'package:encrypt/encrypt.dart' as encrypt; @@ -55,7 +55,7 @@ Future defaultSettingsMigration( FiatCurrency.usd.toString()); await sharedPreferences.setInt( PreferencesKey.currentTransactionPriorityKeyLegacy, - MoneroTransactionPriority.standard.raw); + monero.getDefaultTransactionPriority().raw); await sharedPreferences.setInt( PreferencesKey.currentBalanceDisplayModeKey, BalanceDisplayMode.availableBalance.raw); @@ -308,7 +308,7 @@ Future changeTransactionPriorityAndFeeRateKeys( await sharedPreferences.setInt( PreferencesKey.moneroTransactionPriority, legacyTransactionPriority); await sharedPreferences.setInt(PreferencesKey.bitcoinTransactionPriority, - BitcoinTransactionPriority.medium.serialize()); + bitcoin.getMediumTransactionPriority().serialize()); } Future changeDefaultMoneroNode( diff --git a/lib/entities/enumerable_item.dart b/lib/entities/enumerable_item.dart deleted file mode 100644 index e9deb3056..000000000 --- a/lib/entities/enumerable_item.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:flutter/foundation.dart'; - -abstract class EnumerableItem { - const EnumerableItem({@required this.title, @required this.raw}); - - final T raw; - final String title; - - @override - String toString() => title; -} - -mixin Serializable on EnumerableItem { - static Serializable deserialize({T raw}) => null; - T serialize() => raw; -} diff --git a/lib/entities/fiat_currency.dart b/lib/entities/fiat_currency.dart index c47f91818..c5fa3a602 100644 --- a/lib/entities/fiat_currency.dart +++ b/lib/entities/fiat_currency.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/enumerable_item.dart'; +import 'package:cw_core/enumerable_item.dart'; class FiatCurrency extends EnumerableItem with Serializable { const FiatCurrency({String symbol}) : super(title: symbol, raw: symbol); diff --git a/lib/entities/fs_migration.dart b/lib/entities/fs_migration.dart index efaefdd64..f037ccd24 100644 --- a/lib/entities/fs_migration.dart +++ b/lib/entities/fs_migration.dart @@ -6,15 +6,15 @@ import 'package:hive/hive.dart'; import 'package:path_provider/path_provider.dart'; import 'package:cake_wallet/core/key_service.dart'; import 'package:cake_wallet/entities/contact.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/entities/encrypt.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/entities/ios_legacy_helper.dart' as ios_legacy_helper; import 'package:cake_wallet/entities/preferences_key.dart'; import 'package:cake_wallet/entities/secret_store_key.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_info.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/exchange/trade.dart'; import 'package:cake_wallet/.secrets.g.dart' as secrets; diff --git a/lib/entities/load_current_wallet.dart b/lib/entities/load_current_wallet.dart index 88c236088..6751b7709 100644 --- a/lib/entities/load_current_wallet.dart +++ b/lib/entities/load_current_wallet.dart @@ -2,9 +2,9 @@ import 'package:cake_wallet/di.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/core/key_service.dart'; -import 'package:cake_wallet/core/wallet_service.dart'; +import 'package:cw_core/wallet_service.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; Future loadCurrentWallet() async { final appStore = getIt.get(); diff --git a/lib/entities/monero_transaction_priority.dart b/lib/entities/monero_transaction_priority.dart deleted file mode 100644 index 7629cc5bc..000000000 --- a/lib/entities/monero_transaction_priority.dart +++ /dev/null @@ -1,74 +0,0 @@ -import 'package:cake_wallet/entities/transaction_priority.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/enumerable_item.dart'; - -class MoneroTransactionPriority extends TransactionPriority { - const MoneroTransactionPriority({String title, int raw}) - : super(title: title, raw: raw); - - static const all = [ - MoneroTransactionPriority.slow, - MoneroTransactionPriority.regular, - MoneroTransactionPriority.medium, - MoneroTransactionPriority.fast, - MoneroTransactionPriority.fastest - ]; - static const slow = MoneroTransactionPriority(title: 'Slow', raw: 0); - static const regular = MoneroTransactionPriority(title: 'Regular', raw: 1); - static const medium = MoneroTransactionPriority(title: 'Medium', raw: 2); - static const fast = MoneroTransactionPriority(title: 'Fast', raw: 3); - static const fastest = MoneroTransactionPriority(title: 'Fastest', raw: 4); - static const standard = slow; - - - static List forWalletType(WalletType type) { - switch (type) { - case WalletType.monero: - return MoneroTransactionPriority.all; - case WalletType.bitcoin: - return [ - MoneroTransactionPriority.slow, - MoneroTransactionPriority.regular, - MoneroTransactionPriority.fast - ]; - default: - return []; - } - } - - static MoneroTransactionPriority deserialize({int raw}) { - switch (raw) { - case 0: - return slow; - case 1: - return regular; - case 2: - return medium; - case 3: - return fast; - case 4: - return fastest; - default: - return null; - } - } - - @override - String toString() { - switch (this) { - case MoneroTransactionPriority.slow: - return S.current.transaction_priority_slow; - case MoneroTransactionPriority.regular: - return S.current.transaction_priority_regular; - case MoneroTransactionPriority.medium: - return S.current.transaction_priority_medium; - case MoneroTransactionPriority.fast: - return S.current.transaction_priority_fast; - case MoneroTransactionPriority.fastest: - return S.current.transaction_priority_fastest; - default: - return ''; - } - } -} diff --git a/lib/entities/node.dart b/lib/entities/node.dart deleted file mode 100644 index c1aa19ed3..000000000 --- a/lib/entities/node.dart +++ /dev/null @@ -1,131 +0,0 @@ -import 'dart:io'; - -import 'package:cake_wallet/utils/mobx.dart'; -import 'package:flutter/foundation.dart'; -import 'dart:convert'; -import 'package:http/http.dart' as http; -import 'package:hive/hive.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:cake_wallet/entities/digest_request.dart'; - -part 'node.g.dart'; - -Uri createUriFromElectrumAddress(String address) => - Uri.tryParse('tcp://$address'); - -@HiveType(typeId: Node.typeId) -class Node extends HiveObject with Keyable { - Node( - {@required String uri, - @required WalletType type, - this.login, - this.password, - this.useSSL}) { - uriRaw = uri; - this.type = type; - } - - Node.fromMap(Map map) - : uriRaw = map['uri'] as String ?? '', - login = map['login'] as String, - password = map['password'] as String, - typeRaw = map['typeRaw'] as int, - useSSL = map['useSSL'] as bool; - - static const typeId = 1; - static const boxName = 'Nodes'; - - @HiveField(0) - String uriRaw; - - @HiveField(1) - String login; - - @HiveField(2) - String password; - - @HiveField(3) - int typeRaw; - - @HiveField(4) - bool useSSL; - - bool get isSSL => useSSL ?? false; - - Uri get uri { - switch (type) { - case WalletType.monero: - return Uri.http(uriRaw, ''); - case WalletType.bitcoin: - return createUriFromElectrumAddress(uriRaw); - case WalletType.litecoin: - return createUriFromElectrumAddress(uriRaw); - default: - return null; - } - } - - @override - dynamic get keyIndex { - _keyIndex ??= key; - return _keyIndex; - } - - WalletType get type => deserializeFromInt(typeRaw); - - set type(WalletType type) => typeRaw = serializeToInt(type); - - dynamic _keyIndex; - - Future requestNode() async { - try { - switch (type) { - case WalletType.monero: - return requestMoneroNode(); - case WalletType.bitcoin: - return requestElectrumServer(); - case WalletType.litecoin: - return requestElectrumServer(); - default: - return false; - } - } catch (_) { - return false; - } - } - - Future requestMoneroNode() async { - try { - Map resBody; - - if (login != null && password != null) { - final digestRequest = DigestRequest(); - final response = await digestRequest.request( - uri: uri.toString(), login: login, password: password); - resBody = response.data as Map; - } else { - final rpcUri = Uri.http(uri.authority, '/json_rpc'); - final headers = {'Content-type': 'application/json'}; - final body = - json.encode({'jsonrpc': '2.0', 'id': '0', 'method': 'get_info'}); - final response = - await http.post(rpcUri.toString(), headers: headers, body: body); - resBody = json.decode(response.body) as Map; - } - - return !(resBody['result']['offline'] as bool); - } catch (_) { - return false; - } - } - - Future requestElectrumServer() async { - try { - await SecureSocket.connect(uri.host, uri.port, - timeout: Duration(seconds: 5), onBadCertificate: (_) => true); - return true; - } catch (_) { - return false; - } - } -} diff --git a/lib/entities/node_list.dart b/lib/entities/node_list.dart index a35ed47d4..167d9483c 100644 --- a/lib/entities/node_list.dart +++ b/lib/entities/node_list.dart @@ -1,8 +1,8 @@ import 'package:flutter/services.dart'; import 'package:hive/hive.dart'; import "package:yaml/yaml.dart"; -import 'package:cake_wallet/entities/node.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/node.dart'; +import 'package:cw_core/wallet_type.dart'; Future> loadDefaultNodes() async { final nodesRaw = await rootBundle.loadString('assets/node_list.yml'); diff --git a/lib/entities/parseBoolFromString.dart b/lib/entities/parseBoolFromString.dart deleted file mode 100644 index dbcbdedd4..000000000 --- a/lib/entities/parseBoolFromString.dart +++ /dev/null @@ -1,3 +0,0 @@ -bool parseBoolFromString(String string) { - return string.toString() == 'true'; -} \ No newline at end of file diff --git a/lib/entities/pathForWallet.dart b/lib/entities/pathForWallet.dart deleted file mode 100644 index 2d55c6dfa..000000000 --- a/lib/entities/pathForWallet.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'dart:io'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:flutter/foundation.dart'; -import 'package:path_provider/path_provider.dart'; - -Future pathForWalletDir({@required String name, @required WalletType type}) async { - final root = await getApplicationDocumentsDirectory(); - final prefix = walletTypeToString(type).toLowerCase(); - final walletsDir = Directory('${root.path}/wallets'); - final walletDire = Directory('${walletsDir.path}/$prefix/$name'); - - if (!walletDire.existsSync()) { - walletDire.createSync(recursive: true); - } - - return walletDire.path; -} - -Future pathForWallet({@required String name, @required WalletType type}) async => - await pathForWalletDir(name: name, type: type) - .then((path) => path + '/$name'); - -Future outdatedAndroidPathForWalletDir({String name}) async { - final directory = await getApplicationDocumentsDirectory(); - final pathDir = directory.path + '/$name'; - - return pathDir; -} \ No newline at end of file diff --git a/lib/entities/pending_transaction.dart b/lib/entities/pending_transaction.dart deleted file mode 100644 index 77e5d7b48..000000000 --- a/lib/entities/pending_transaction.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:cw_monero/transaction_history.dart' as transaction_history; -import 'package:cw_monero/structs/pending_transaction.dart'; -import 'package:cake_wallet/monero/monero_amount_format.dart'; - -class PendingTransaction { - PendingTransaction( - {@required this.amount, @required this.fee, @required this.hash}); - - PendingTransaction.fromTransactionDescription( - PendingTransactionDescription transactionDescription) - : amount = moneroAmountToString(amount: transactionDescription.amount), - fee = moneroAmountToString(amount: transactionDescription.fee), - hash = transactionDescription.hash, - _pointerAddress = transactionDescription.pointerAddress; - - final String amount; - final String fee; - final String hash; - - int _pointerAddress; - - Future commit() async => transaction_history - .commitTransactionFromPointerAddress(address: _pointerAddress); -} diff --git a/lib/entities/record.dart b/lib/entities/record.dart index 1ca661684..75563c682 100644 --- a/lib/entities/record.dart +++ b/lib/entities/record.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:cake_wallet/utils/mobx.dart'; import 'package:hive/hive.dart'; +import 'package:cw_core/keyable.dart'; abstract class Record with Keyable { Record(this._source, this.original) { diff --git a/lib/entities/sync_status.dart b/lib/entities/sync_status.dart deleted file mode 100644 index 52d496fac..000000000 --- a/lib/entities/sync_status.dart +++ /dev/null @@ -1,83 +0,0 @@ -import 'package:cake_wallet/generated/i18n.dart'; - -abstract class SyncStatus { - const SyncStatus(); - - double progress(); - - String title(); -} - -class SyncingSyncStatus extends SyncStatus { - SyncingSyncStatus(this.blocksLeft, this.ptc); - - final double ptc; - final int blocksLeft; - - @override - double progress() => ptc; - - @override - String title() => S.current.Blocks_remaining('$blocksLeft'); - - @override - String toString() => '$blocksLeft'; -} - -class SyncedSyncStatus extends SyncStatus { - @override - double progress() => 1.0; - - @override - String title() => S.current.sync_status_syncronized; -} - -class NotConnectedSyncStatus extends SyncStatus { - const NotConnectedSyncStatus(); - - @override - double progress() => 0.0; - - @override - String title() => S.current.sync_status_not_connected; -} - -class StartingSyncStatus extends SyncStatus { - @override - double progress() => 0.0; - - @override - String title() => S.current.sync_status_starting_sync; -} - -class FailedSyncStatus extends SyncStatus { - @override - double progress() => 1.0; - - @override - String title() => S.current.sync_status_failed_connect; -} - -class ConnectingSyncStatus extends SyncStatus { - @override - double progress() => 0.0; - - @override - String title() => S.current.sync_status_connecting; -} - -class ConnectedSyncStatus extends SyncStatus { - @override - double progress() => 0.0; - - @override - String title() => S.current.sync_status_connected; -} - -class LostConnectionSyncStatus extends SyncStatus { - @override - double progress() => 1.0; - - @override - String title() => S.current.sync_status_failed_connect; -} \ No newline at end of file diff --git a/lib/entities/transaction_direction.dart b/lib/entities/transaction_direction.dart deleted file mode 100644 index a82420e2c..000000000 --- a/lib/entities/transaction_direction.dart +++ /dev/null @@ -1,17 +0,0 @@ -enum TransactionDirection { incoming, outgoing } - -TransactionDirection parseTransactionDirectionFromInt(int raw) { - switch (raw) { - case 0: return TransactionDirection.incoming; - case 1: return TransactionDirection.outgoing; - default: return null; - } -} - -TransactionDirection parseTransactionDirectionFromNumber(String raw) { - switch (raw) { - case "0": return TransactionDirection.incoming; - case "1": return TransactionDirection.outgoing; - default: return null; - } -} \ No newline at end of file diff --git a/lib/entities/transaction_history.dart b/lib/entities/transaction_history.dart index e77360a62..0fe19a655 100644 --- a/lib/entities/transaction_history.dart +++ b/lib/entities/transaction_history.dart @@ -1,5 +1,5 @@ import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; +import 'package:cw_core/transaction_info.dart'; abstract class TransactionHistory { Observable> transactions; diff --git a/lib/entities/transaction_info.dart b/lib/entities/transaction_info.dart deleted file mode 100644 index 986ab384d..000000000 --- a/lib/entities/transaction_info.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:cake_wallet/entities/transaction_direction.dart'; -import 'package:cake_wallet/utils/mobx.dart'; - -abstract class TransactionInfo extends Object with Keyable { - String id; - int amount; - int fee; - TransactionDirection direction; - bool isPending; - DateTime date; - int height; - int confirmations; - String amountFormatted(); - String fiatAmount(); - String feeFormatted(); - void changeFiatAmount(String amount); - - @override - dynamic get keyIndex => id; -} \ No newline at end of file diff --git a/lib/entities/transaction_priority.dart b/lib/entities/transaction_priority.dart deleted file mode 100644 index e03607329..000000000 --- a/lib/entities/transaction_priority.dart +++ /dev/null @@ -1,6 +0,0 @@ -import 'package:cake_wallet/entities/enumerable_item.dart'; - -abstract class TransactionPriority extends EnumerableItem - with Serializable { - const TransactionPriority({String title, int raw}) : super(title: title, raw: raw); -} diff --git a/lib/entities/wallet.dart b/lib/entities/wallet.dart index 893457847..3e77b5ee7 100644 --- a/lib/entities/wallet.dart +++ b/lib/entities/wallet.dart @@ -1,61 +1,61 @@ -import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; -import 'package:cake_wallet/entities/transaction_history.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:cake_wallet/entities/transaction_creation_credentials.dart'; -import 'package:cake_wallet/entities/pending_transaction.dart'; -import 'package:cake_wallet/entities/balance.dart'; -import 'package:cake_wallet/entities/node.dart'; +//import 'package:mobx/mobx.dart'; +//import 'package:cw_core/sync_status.dart'; +//import 'package:cake_wallet/entities/transaction_history.dart'; +//import 'package:cw_core/wallet_type.dart'; +//import 'package:cake_wallet/entities/transaction_creation_credentials.dart'; +//import 'package:cake_wallet/entities/pending_transaction.dart'; +//import 'package:cw_core/balance.dart'; +//import 'package:cw_core/node.dart'; -abstract class Wallet { - WalletType getType(); +//abstract class Wallet { +// WalletType getType(); - WalletType walletType; +// WalletType walletType; - Observable onBalanceChange; +// Observable onBalanceChange; - Observable syncStatus; +// Observable syncStatus; - Observable get onNameChange; +// Observable get onNameChange; - Observable get onAddressChange; +// Observable get onAddressChange; - String get name; +// String get name; - String get address; +// String get address; - Future updateInfo(); +// Future updateInfo(); - Future getFilename(); +// Future getFilename(); - Future getName(); +// Future getName(); - Future getAddress(); +// Future getAddress(); - Future getSeed(); +// Future getSeed(); - Future> getKeys(); +// Future> getKeys(); - Future getFullBalance(); +// Future getFullBalance(); - Future getUnlockedBalance(); +// Future getUnlockedBalance(); - Future getCurrentHeight(); +// Future getCurrentHeight(); - Future getNodeHeight(); +// Future getNodeHeight(); - Future isConnected(); +// Future isConnected(); - Future close(); +// Future close(); - TransactionHistory getHistory(); +// TransactionHistory getHistory(); - Future connectToNode({Node node, bool useSSL = false, bool isLightWallet = false}); +// Future connectToNode({Node node, bool useSSL = false, bool isLightWallet = false}); - Future startSync(); +// Future startSync(); - Future createTransaction( - TransactionCreationCredentials credentials); +// Future createTransaction( +// TransactionCreationCredentials credentials); - Future rescan({int restoreHeight = 0}); -} +// Future rescan({int restoreHeight = 0}); +//} diff --git a/lib/entities/wallet_addresses.dart b/lib/entities/wallet_addresses.dart deleted file mode 100644 index cd5331911..000000000 --- a/lib/entities/wallet_addresses.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:cake_wallet/entities/wallet_info.dart'; - -abstract class WalletAddresses { - WalletAddresses(this.walletInfo) { - addressesMap = {}; - } - - final WalletInfo walletInfo; - - String get address; - - set address(String address); - - Map addressesMap; - - Future init(); - - Future updateAddressesInBox(); - - Future saveAddressesInBox() async { - try { - if (walletInfo == null) { - return; - } - - walletInfo.address = address; - walletInfo.addresses = addressesMap; - - if (walletInfo.isInBox) { - await walletInfo.save(); - } - } catch (e) { - print(e.toString()); - } - } -} \ No newline at end of file diff --git a/lib/entities/wallet_contact.dart b/lib/entities/wallet_contact.dart index 97edf2ac6..6b24560f7 100644 --- a/lib/entities/wallet_contact.dart +++ b/lib/entities/wallet_contact.dart @@ -1,5 +1,5 @@ import 'package:cake_wallet/entities/contact_base.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; class WalletContact implements ContactBase { WalletContact(this.address, this.name, this.type); diff --git a/lib/entities/wallet_description.dart b/lib/entities/wallet_description.dart index 1e25ffc1c..95bc54c7c 100644 --- a/lib/entities/wallet_description.dart +++ b/lib/entities/wallet_description.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; class WalletDescription { WalletDescription({this.name, this.type}); diff --git a/lib/entities/wallet_info.dart b/lib/entities/wallet_info.dart deleted file mode 100644 index 19dab6032..000000000 --- a/lib/entities/wallet_info.dart +++ /dev/null @@ -1,85 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:hive/hive.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'dart:async'; - -part 'wallet_info.g.dart'; - -@HiveType(typeId: WalletInfo.typeId) -class WalletInfo extends HiveObject { - WalletInfo(this.id, this.name, this.type, this.isRecovery, this.restoreHeight, - this.timestamp, this.dirPath, this.path, this.address, this.yatEid, - this.yatLastUsedAddressRaw) - : _yatLastUsedAddressController = StreamController.broadcast(); - - factory WalletInfo.external( - {@required String id, - @required String name, - @required WalletType type, - @required bool isRecovery, - @required int restoreHeight, - @required DateTime date, - @required String dirPath, - @required String path, - @required String address, - String yatEid ='', - String yatLastUsedAddressRaw = ''}) { - return WalletInfo(id, name, type, isRecovery, restoreHeight, - date.millisecondsSinceEpoch ?? 0, dirPath, path, address, - yatEid, yatLastUsedAddressRaw); - } - - static const typeId = 4; - static const boxName = 'WalletInfo'; - - @HiveField(0) - String id; - - @HiveField(1) - String name; - - @HiveField(2) - WalletType type; - - @HiveField(3) - bool isRecovery; - - @HiveField(4) - int restoreHeight; - - @HiveField(5) - int timestamp; - - @HiveField(6) - String dirPath; - - @HiveField(7) - String path; - - @HiveField(8) - String address; - - @HiveField(10) - Map addresses; - - @HiveField(11) - String yatEid; - - @HiveField(12) - String yatLastUsedAddressRaw; - - String get yatLastUsedAddress => yatLastUsedAddressRaw; - - set yatLastUsedAddress(String address) { - yatLastUsedAddressRaw = address; - _yatLastUsedAddressController.add(address); - } - - String get yatEmojiId => yatEid ?? ''; - - DateTime get date => DateTime.fromMillisecondsSinceEpoch(timestamp); - - Stream get yatLastUsedAddressStream => _yatLastUsedAddressController.stream; - - StreamController _yatLastUsedAddressController; -} diff --git a/lib/entities/wallet_type.dart b/lib/entities/wallet_type.dart deleted file mode 100644 index b8a36e709..000000000 --- a/lib/entities/wallet_type.dart +++ /dev/null @@ -1,91 +0,0 @@ -import 'package:cake_wallet/entities/crypto_currency.dart'; -import 'package:hive/hive.dart'; - -part 'wallet_type.g.dart'; - -const walletTypes = [ - WalletType.monero, - WalletType.bitcoin, - WalletType.litecoin -]; -const walletTypeTypeId = 5; - -@HiveType(typeId: walletTypeTypeId) -enum WalletType { - @HiveField(0) - monero, - - @HiveField(1) - none, - - @HiveField(2) - bitcoin, - - @HiveField(3) - litecoin -} - -int serializeToInt(WalletType type) { - switch (type) { - case WalletType.monero: - return 0; - case WalletType.bitcoin: - return 1; - case WalletType.litecoin: - return 2; - default: - return -1; - } -} - -WalletType deserializeFromInt(int raw) { - switch (raw) { - case 0: - return WalletType.monero; - case 1: - return WalletType.bitcoin; - case 2: - return WalletType.litecoin; - default: - return null; - } -} - -String walletTypeToString(WalletType type) { - switch (type) { - case WalletType.monero: - return 'Monero'; - case WalletType.bitcoin: - return 'Bitcoin'; - case WalletType.litecoin: - return 'Litecoin'; - default: - return ''; - } -} - -String walletTypeToDisplayName(WalletType type) { - switch (type) { - case WalletType.monero: - return 'Monero'; - case WalletType.bitcoin: - return 'Bitcoin (Electrum)'; - case WalletType.litecoin: - return 'Litecoin (Electrum)'; - default: - return ''; - } -} - -CryptoCurrency walletTypeToCryptoCurrency(WalletType type) { - switch (type) { - case WalletType.monero: - return CryptoCurrency.xmr; - case WalletType.bitcoin: - return CryptoCurrency.btc; - case WalletType.litecoin: - return CryptoCurrency.ltc; - default: - return null; - } -} diff --git a/lib/exchange/changenow/changenow_exchange_provider.dart b/lib/exchange/changenow/changenow_exchange_provider.dart index 0adaf6c83..0622609cf 100644 --- a/lib/exchange/changenow/changenow_exchange_provider.dart +++ b/lib/exchange/changenow/changenow_exchange_provider.dart @@ -3,7 +3,7 @@ import 'package:cake_wallet/exchange/trade_not_found_exeption.dart'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart'; import 'package:cake_wallet/.secrets.g.dart' as secrets; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/exchange_pair.dart'; import 'package:cake_wallet/exchange/exchange_provider.dart'; import 'package:cake_wallet/exchange/limits.dart'; diff --git a/lib/exchange/changenow/changenow_request.dart b/lib/exchange/changenow/changenow_request.dart index 1f79dfa47..f27106c40 100644 --- a/lib/exchange/changenow/changenow_request.dart +++ b/lib/exchange/changenow/changenow_request.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/trade_request.dart'; class ChangeNowRequest extends TradeRequest { diff --git a/lib/exchange/exchange_pair.dart b/lib/exchange/exchange_pair.dart index b8b77a0dd..b22bd590a 100644 --- a/lib/exchange/exchange_pair.dart +++ b/lib/exchange/exchange_pair.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; class ExchangePair { ExchangePair({this.from, this.to, this.reverse = true}); diff --git a/lib/exchange/exchange_provider.dart b/lib/exchange/exchange_provider.dart index 616715022..30a359fda 100644 --- a/lib/exchange/exchange_provider.dart +++ b/lib/exchange/exchange_provider.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/trade_request.dart'; import 'package:cake_wallet/exchange/exchange_pair.dart'; import 'package:cake_wallet/exchange/limits.dart'; diff --git a/lib/exchange/exchange_provider_description.dart b/lib/exchange/exchange_provider_description.dart index bb3b621b5..cae5a5683 100644 --- a/lib/exchange/exchange_provider_description.dart +++ b/lib/exchange/exchange_provider_description.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/enumerable_item.dart'; +import 'package:cw_core/enumerable_item.dart'; class ExchangeProviderDescription extends EnumerableItem with Serializable { diff --git a/lib/exchange/morphtoken/morphtoken_exchange_provider.dart b/lib/exchange/morphtoken/morphtoken_exchange_provider.dart index ed8010f41..cea92a1bb 100644 --- a/lib/exchange/morphtoken/morphtoken_exchange_provider.dart +++ b/lib/exchange/morphtoken/morphtoken_exchange_provider.dart @@ -4,7 +4,7 @@ import 'package:hive/hive.dart'; import 'package:cake_wallet/exchange/trade_not_found_exeption.dart'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/exchange_pair.dart'; import 'package:cake_wallet/exchange/exchange_provider.dart'; import 'package:cake_wallet/exchange/limits.dart'; diff --git a/lib/exchange/morphtoken/morphtoken_request.dart b/lib/exchange/morphtoken/morphtoken_request.dart index d92a643e8..046c6f10c 100644 --- a/lib/exchange/morphtoken/morphtoken_request.dart +++ b/lib/exchange/morphtoken/morphtoken_request.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/trade_request.dart'; class MorphTokenRequest extends TradeRequest { diff --git a/lib/exchange/trade.dart b/lib/exchange/trade.dart index 0bbcb844d..edc48d0f3 100644 --- a/lib/exchange/trade.dart +++ b/lib/exchange/trade.dart @@ -1,8 +1,8 @@ import 'package:hive/hive.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/exchange/trade_state.dart'; -import 'package:cake_wallet/entities/format_amount.dart'; +import 'package:cw_core/format_amount.dart'; part 'trade.g.dart'; diff --git a/lib/exchange/trade_state.dart b/lib/exchange/trade_state.dart index 9f08b4df2..4ddce2e02 100644 --- a/lib/exchange/trade_state.dart +++ b/lib/exchange/trade_state.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:cake_wallet/entities/enumerable_item.dart'; +import 'package:cw_core/enumerable_item.dart'; class TradeState extends EnumerableItem with Serializable { const TradeState({@required String raw, @required String title}) diff --git a/lib/exchange/xmrto/xmrto_exchange_provider.dart b/lib/exchange/xmrto/xmrto_exchange_provider.dart index 91365ee40..12c6c8587 100644 --- a/lib/exchange/xmrto/xmrto_exchange_provider.dart +++ b/lib/exchange/xmrto/xmrto_exchange_provider.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/exchange_pair.dart'; import 'package:cake_wallet/exchange/exchange_provider.dart'; import 'package:cake_wallet/exchange/limits.dart'; diff --git a/lib/exchange/xmrto/xmrto_trade_request.dart b/lib/exchange/xmrto/xmrto_trade_request.dart index e88db176d..ac9b6146a 100644 --- a/lib/exchange/xmrto/xmrto_trade_request.dart +++ b/lib/exchange/xmrto/xmrto_trade_request.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/trade_request.dart'; class XMRTOTradeRequest extends TradeRequest { diff --git a/lib/main.dart b/lib/main.dart index 692532a4f..285a2c123 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'package:cake_wallet/bitcoin/unspent_coins_info.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/entities/language_service.dart'; import 'package:cake_wallet/buy/order.dart'; import 'package:cake_wallet/src/screens/yat_emoji_id.dart'; @@ -15,7 +15,6 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; -import 'package:cw_monero/wallet.dart' as monero_wallet; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/router.dart' as Router; import 'package:cake_wallet/routes.dart'; @@ -26,15 +25,17 @@ import 'package:cake_wallet/store/authentication_store.dart'; import 'package:cake_wallet/entities/transaction_description.dart'; import 'package:cake_wallet/entities/get_encryption_key.dart'; import 'package:cake_wallet/entities/contact.dart'; -import 'package:cake_wallet/entities/node.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; +import 'package:cw_core/node.dart'; +import 'package:cw_core/wallet_info.dart'; import 'package:cake_wallet/entities/default_settings_migration.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/entities/template.dart'; import 'package:cake_wallet/exchange/trade.dart'; import 'package:cake_wallet/exchange/exchange_template.dart'; import 'package:cake_wallet/src/screens/root/root.dart'; import 'package:uni_links/uni_links.dart'; +import 'package:cw_core/unspent_coins_info.dart'; +import 'package:cake_wallet/monero/monero.dart'; final navigatorKey = GlobalKey(); final rootKey = GlobalKey(); @@ -83,10 +84,6 @@ Future main() async { Hive.registerAdapter(OrderAdapter()); } - if (!Hive.isAdapterRegistered(UnspentCoinsInfo.typeId)) { - Hive.registerAdapter(UnspentCoinsInfoAdapter()); - } - final secureStorage = FlutterSecureStorage(); final transactionDescriptionsBoxKey = await getEncryptionKey( secureStorage: secureStorage, forKey: TransactionDescription.boxKey); @@ -173,7 +170,7 @@ Future initialSetup( ordersSource: ordersSource, unspentCoinsInfoSource: unspentCoinsInfoSource); await bootstrap(navigatorKey); - monero_wallet.onStartup(); + monero?.onStartup(); } class App extends StatefulWidget { diff --git a/lib/monero/account.dart b/lib/monero/account.dart deleted file mode 100644 index d54d70e90..000000000 --- a/lib/monero/account.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:cw_monero/structs/account_row.dart'; - -class Account { - Account({this.id, this.label}); - - Account.fromMap(Map map) - : this.id = map['id'] == null ? 0 : int.parse(map['id'] as String), - this.label = (map['label'] ?? '') as String; - - Account.fromRow(AccountRow row) - : this.id = row.getId(), - this.label = row.getLabel(); - - final int id; - final String label; -} diff --git a/lib/monero/get_height_by_date.dart b/lib/monero/get_height_by_date.dart deleted file mode 100644 index 11921a2aa..000000000 --- a/lib/monero/get_height_by_date.dart +++ /dev/null @@ -1,120 +0,0 @@ -import 'package:intl/intl.dart'; - -// FIXME: Hardcoded values; Works only for monero - -final dateFormat = DateFormat('yyyy-MM'); -final dates = { - "2014-5": 18844, - "2014-6": 65406, - "2014-7": 108882, - "2014-8": 153594, - "2014-9": 198072, - "2014-10": 241088, - "2014-11": 285305, - "2014-12": 328069, - "2015-1": 372369, - "2015-2": 416505, - "2015-3": 456631, - "2015-4": 501084, - "2015-5": 543973, - "2015-6": 588326, - "2015-7": 631187, - "2015-8": 675484, - "2015-9": 719725, - "2015-10": 762463, - "2015-11": 806528, - "2015-12": 849041, - "2016-1": 892866, - "2016-2": 936736, - "2016-3": 977691, - "2016-4": 1015848, - "2016-5": 1037417, - "2016-6": 1059651, - "2016-7": 1081269, - "2016-8": 1103630, - "2016-9": 1125983, - "2016-10": 1147617, - "2016-11": 1169779, - "2016-12": 1191402, - "2017-1": 1213861, - "2017-2": 1236197, - "2017-3": 1256358, - "2017-4": 1278622, - "2017-5": 1300239, - "2017-6": 1322564, - "2017-7": 1344225, - "2017-8": 1366664, - "2017-9": 1389113, - "2017-10": 1410738, - "2017-11": 1433039, - "2017-12": 1454639, - "2018-1": 1477201, - "2018-2": 1499599, - "2018-3": 1519796, - "2018-4": 1542067, - "2018-5": 1562861, - "2018-6": 1585135, - "2018-7": 1606715, - "2018-8": 1629017, - "2018-9": 1651347, - "2018-10": 1673031, - "2018-11": 1695128, - "2018-12": 1716687, - "2019-1": 1738923, - "2019-2": 1761435, - "2019-3": 1781681, - "2019-4": 1803081, - "2019-5": 1824671, - "2019-6": 1847005, - "2019-7": 1868590, - "2019-8": 1890552, - "2019-9": 1912212, - "2019-10": 1932200, - "2019-11": 1957040, - "2019-12": 1978090, - "2020-1": 2001290, - "2020-2": 2022688, - "2020-3": 2043987, - "2020-4": 2066536, - "2020-5": 2090797, - "2020-6": 2111633, - "2020-7": 2131433, - "2020-8": 2153983, - "2020-9": 2176466, - "2020-10": 2198453, - "2020-11": 2220000 -}; - -int getHeigthByDate({DateTime date}) { - final raw = '${date.year}' + '-' + '${date.month}'; - final lastHeight = dates.values.last; - int startHeight; - int endHeight; - int height = 0; - - try { - if ((dates[raw] == null)||(dates[raw] == lastHeight)) { - startHeight = dates.values.toList()[dates.length - 2]; - endHeight = dates.values.toList()[dates.length - 1]; - final heightPerDay = (endHeight - startHeight) / 31; - final endDateRaw = dates.keys.toList()[dates.length - 1].split('-'); - final endYear = int.parse(endDateRaw[0]); - final endMonth = int.parse(endDateRaw[1]); - final endDate = DateTime(endYear, endMonth); - final differenceInDays = date.difference(endDate).inDays; - final daysHeight = (differenceInDays * heightPerDay).round(); - height = endHeight + daysHeight; - } else { - startHeight = dates[raw]; - final index = dates.values.toList().indexOf(startHeight); - endHeight = dates.values.toList()[index + 1]; - final heightPerDay = ((endHeight - startHeight) / 31).round(); - final daysHeight = (date.day - 1) * heightPerDay; - height = startHeight + daysHeight - heightPerDay; - } - } catch (e) { - print(e.toString()); - } - - return height; -} diff --git a/lib/monero/mnemonics/chinese_simplified.dart b/lib/monero/mnemonics/chinese_simplified.dart deleted file mode 100644 index da3225041..000000000 --- a/lib/monero/mnemonics/chinese_simplified.dart +++ /dev/null @@ -1,1630 +0,0 @@ -class ChineseSimplifiedMnemonics { - static const words = [ - "的", - "一", - "是", - "在", - "不", - "了", - "有", - "和", - "人", - "这", - "中", - "大", - "为", - "上", - "个", - "国", - "我", - "以", - "要", - "他", - "时", - "来", - "用", - "们", - "生", - "到", - "作", - "地", - "于", - "出", - "就", - "分", - "对", - "成", - "会", - "可", - "主", - "发", - "年", - "动", - "同", - "工", - "也", - "能", - "下", - "过", - "子", - "说", - "产", - "种", - "面", - "而", - "方", - "后", - "多", - "定", - "行", - "学", - "法", - "所", - "民", - "得", - "经", - "十", - "三", - "之", - "进", - "着", - "等", - "部", - "度", - "家", - "电", - "力", - "里", - "如", - "水", - "化", - "高", - "自", - "二", - "理", - "起", - "小", - "物", - "现", - "实", - "加", - "量", - "都", - "两", - "体", - "制", - "机", - "当", - "使", - "点", - "从", - "业", - "本", - "去", - "把", - "性", - "好", - "应", - "开", - "它", - "合", - "还", - "因", - "由", - "其", - "些", - "然", - "前", - "外", - "天", - "政", - "四", - "日", - "那", - "社", - "义", - "事", - "平", - "形", - "相", - "全", - "表", - "间", - "样", - "与", - "关", - "各", - "重", - "新", - "线", - "内", - "数", - "正", - "心", - "反", - "你", - "明", - "看", - "原", - "又", - "么", - "利", - "比", - "或", - "但", - "质", - "气", - "第", - "向", - "道", - "命", - "此", - "变", - "条", - "只", - "没", - "结", - "解", - "问", - "意", - "建", - "月", - "公", - "无", - "系", - "军", - "很", - "情", - "者", - "最", - "立", - "代", - "想", - "已", - "通", - "并", - "提", - "直", - "题", - "党", - "程", - "展", - "五", - "果", - "料", - "象", - "员", - "革", - "位", - "入", - "常", - "文", - "总", - "次", - "品", - "式", - "活", - "设", - "及", - "管", - "特", - "件", - "长", - "求", - "老", - "头", - "基", - "资", - "边", - "流", - "路", - "级", - "少", - "图", - "山", - "统", - "接", - "知", - "较", - "将", - "组", - "见", - "计", - "别", - "她", - "手", - "角", - "期", - "根", - "论", - "运", - "农", - "指", - "几", - "九", - "区", - "强", - "放", - "决", - "西", - "被", - "干", - "做", - "必", - "战", - "先", - "回", - "则", - "任", - "取", - "据", - "处", - "队", - "南", - "给", - "色", - "光", - "门", - "即", - "保", - "治", - "北", - "造", - "百", - "规", - "热", - "领", - "七", - "海", - "口", - "东", - "导", - "器", - "压", - "志", - "世", - "金", - "增", - "争", - "济", - "阶", - "油", - "思", - "术", - "极", - "交", - "受", - "联", - "什", - "认", - "六", - "共", - "权", - "收", - "证", - "改", - "清", - "美", - "再", - "采", - "转", - "更", - "单", - "风", - "切", - "打", - "白", - "教", - "速", - "花", - "带", - "安", - "场", - "身", - "车", - "例", - "真", - "务", - "具", - "万", - "每", - "目", - "至", - "达", - "走", - "积", - "示", - "议", - "声", - "报", - "斗", - "完", - "类", - "八", - "离", - "华", - "名", - "确", - "才", - "科", - "张", - "信", - "马", - "节", - "话", - "米", - "整", - "空", - "元", - "况", - "今", - "集", - "温", - "传", - "土", - "许", - "步", - "群", - "广", - "石", - "记", - "需", - "段", - "研", - "界", - "拉", - "林", - "律", - "叫", - "且", - "究", - "观", - "越", - "织", - "装", - "影", - "算", - "低", - "持", - "音", - "众", - "书", - "布", - "复", - "容", - "儿", - "须", - "际", - "商", - "非", - "验", - "连", - "断", - "深", - "难", - "近", - "矿", - "千", - "周", - "委", - "素", - "技", - "备", - "半", - "办", - "青", - "省", - "列", - "习", - "响", - "约", - "支", - "般", - "史", - "感", - "劳", - "便", - "团", - "往", - "酸", - "历", - "市", - "克", - "何", - "除", - "消", - "构", - "府", - "称", - "太", - "准", - "精", - "值", - "号", - "率", - "族", - "维", - "划", - "选", - "标", - "写", - "存", - "候", - "毛", - "亲", - "快", - "效", - "斯", - "院", - "查", - "江", - "型", - "眼", - "王", - "按", - "格", - "养", - "易", - "置", - "派", - "层", - "片", - "始", - "却", - "专", - "状", - "育", - "厂", - "京", - "识", - "适", - "属", - "圆", - "包", - "火", - "住", - "调", - "满", - "县", - "局", - "照", - "参", - "红", - "细", - "引", - "听", - "该", - "铁", - "价", - "严", - "首", - "底", - "液", - "官", - "德", - "随", - "病", - "苏", - "失", - "尔", - "死", - "讲", - "配", - "女", - "黄", - "推", - "显", - "谈", - "罪", - "神", - "艺", - "呢", - "席", - "含", - "企", - "望", - "密", - "批", - "营", - "项", - "防", - "举", - "球", - "英", - "氧", - "势", - "告", - "李", - "台", - "落", - "木", - "帮", - "轮", - "破", - "亚", - "师", - "围", - "注", - "远", - "字", - "材", - "排", - "供", - "河", - "态", - "封", - "另", - "施", - "减", - "树", - "溶", - "怎", - "止", - "案", - "言", - "士", - "均", - "武", - "固", - "叶", - "鱼", - "波", - "视", - "仅", - "费", - "紧", - "爱", - "左", - "章", - "早", - "朝", - "害", - "续", - "轻", - "服", - "试", - "食", - "充", - "兵", - "源", - "判", - "护", - "司", - "足", - "某", - "练", - "差", - "致", - "板", - "田", - "降", - "黑", - "犯", - "负", - "击", - "范", - "继", - "兴", - "似", - "余", - "坚", - "曲", - "输", - "修", - "故", - "城", - "夫", - "够", - "送", - "笔", - "船", - "占", - "右", - "财", - "吃", - "富", - "春", - "职", - "觉", - "汉", - "画", - "功", - "巴", - "跟", - "虽", - "杂", - "飞", - "检", - "吸", - "助", - "升", - "阳", - "互", - "初", - "创", - "抗", - "考", - "投", - "坏", - "策", - "古", - "径", - "换", - "未", - "跑", - "留", - "钢", - "曾", - "端", - "责", - "站", - "简", - "述", - "钱", - "副", - "尽", - "帝", - "射", - "草", - "冲", - "承", - "独", - "令", - "限", - "阿", - "宣", - "环", - "双", - "请", - "超", - "微", - "让", - "控", - "州", - "良", - "轴", - "找", - "否", - "纪", - "益", - "依", - "优", - "顶", - "础", - "载", - "倒", - "房", - "突", - "坐", - "粉", - "敌", - "略", - "客", - "袁", - "冷", - "胜", - "绝", - "析", - "块", - "剂", - "测", - "丝", - "协", - "诉", - "念", - "陈", - "仍", - "罗", - "盐", - "友", - "洋", - "错", - "苦", - "夜", - "刑", - "移", - "频", - "逐", - "靠", - "混", - "母", - "短", - "皮", - "终", - "聚", - "汽", - "村", - "云", - "哪", - "既", - "距", - "卫", - "停", - "烈", - "央", - "察", - "烧", - "迅", - "境", - "若", - "印", - "洲", - "刻", - "括", - "激", - "孔", - "搞", - "甚", - "室", - "待", - "核", - "校", - "散", - "侵", - "吧", - "甲", - "游", - "久", - "菜", - "味", - "旧", - "模", - "湖", - "货", - "损", - "预", - "阻", - "毫", - "普", - "稳", - "乙", - "妈", - "植", - "息", - "扩", - "银", - "语", - "挥", - "酒", - "守", - "拿", - "序", - "纸", - "医", - "缺", - "雨", - "吗", - "针", - "刘", - "啊", - "急", - "唱", - "误", - "训", - "愿", - "审", - "附", - "获", - "茶", - "鲜", - "粮", - "斤", - "孩", - "脱", - "硫", - "肥", - "善", - "龙", - "演", - "父", - "渐", - "血", - "欢", - "械", - "掌", - "歌", - "沙", - "刚", - "攻", - "谓", - "盾", - "讨", - "晚", - "粒", - "乱", - "燃", - "矛", - "乎", - "杀", - "药", - "宁", - "鲁", - "贵", - "钟", - "煤", - "读", - "班", - "伯", - "香", - "介", - "迫", - "句", - "丰", - "培", - "握", - "兰", - "担", - "弦", - "蛋", - "沉", - "假", - "穿", - "执", - "答", - "乐", - "谁", - "顺", - "烟", - "缩", - "征", - "脸", - "喜", - "松", - "脚", - "困", - "异", - "免", - "背", - "星", - "福", - "买", - "染", - "井", - "概", - "慢", - "怕", - "磁", - "倍", - "祖", - "皇", - "促", - "静", - "补", - "评", - "翻", - "肉", - "践", - "尼", - "衣", - "宽", - "扬", - "棉", - "希", - "伤", - "操", - "垂", - "秋", - "宜", - "氢", - "套", - "督", - "振", - "架", - "亮", - "末", - "宪", - "庆", - "编", - "牛", - "触", - "映", - "雷", - "销", - "诗", - "座", - "居", - "抓", - "裂", - "胞", - "呼", - "娘", - "景", - "威", - "绿", - "晶", - "厚", - "盟", - "衡", - "鸡", - "孙", - "延", - "危", - "胶", - "屋", - "乡", - "临", - "陆", - "顾", - "掉", - "呀", - "灯", - "岁", - "措", - "束", - "耐", - "剧", - "玉", - "赵", - "跳", - "哥", - "季", - "课", - "凯", - "胡", - "额", - "款", - "绍", - "卷", - "齐", - "伟", - "蒸", - "殖", - "永", - "宗", - "苗", - "川", - "炉", - "岩", - "弱", - "零", - "杨", - "奏", - "沿", - "露", - "杆", - "探", - "滑", - "镇", - "饭", - "浓", - "航", - "怀", - "赶", - "库", - "夺", - "伊", - "灵", - "税", - "途", - "灭", - "赛", - "归", - "召", - "鼓", - "播", - "盘", - "裁", - "险", - "康", - "唯", - "录", - "菌", - "纯", - "借", - "糖", - "盖", - "横", - "符", - "私", - "努", - "堂", - "域", - "枪", - "润", - "幅", - "哈", - "竟", - "熟", - "虫", - "泽", - "脑", - "壤", - "碳", - "欧", - "遍", - "侧", - "寨", - "敢", - "彻", - "虑", - "斜", - "薄", - "庭", - "纳", - "弹", - "饲", - "伸", - "折", - "麦", - "湿", - "暗", - "荷", - "瓦", - "塞", - "床", - "筑", - "恶", - "户", - "访", - "塔", - "奇", - "透", - "梁", - "刀", - "旋", - "迹", - "卡", - "氯", - "遇", - "份", - "毒", - "泥", - "退", - "洗", - "摆", - "灰", - "彩", - "卖", - "耗", - "夏", - "择", - "忙", - "铜", - "献", - "硬", - "予", - "繁", - "圈", - "雪", - "函", - "亦", - "抽", - "篇", - "阵", - "阴", - "丁", - "尺", - "追", - "堆", - "雄", - "迎", - "泛", - "爸", - "楼", - "避", - "谋", - "吨", - "野", - "猪", - "旗", - "累", - "偏", - "典", - "馆", - "索", - "秦", - "脂", - "潮", - "爷", - "豆", - "忽", - "托", - "惊", - "塑", - "遗", - "愈", - "朱", - "替", - "纤", - "粗", - "倾", - "尚", - "痛", - "楚", - "谢", - "奋", - "购", - "磨", - "君", - "池", - "旁", - "碎", - "骨", - "监", - "捕", - "弟", - "暴", - "割", - "贯", - "殊", - "释", - "词", - "亡", - "壁", - "顿", - "宝", - "午", - "尘", - "闻", - "揭", - "炮", - "残", - "冬", - "桥", - "妇", - "警", - "综", - "招", - "吴", - "付", - "浮", - "遭", - "徐", - "您", - "摇", - "谷", - "赞", - "箱", - "隔", - "订", - "男", - "吹", - "园", - "纷", - "唐", - "败", - "宋", - "玻", - "巨", - "耕", - "坦", - "荣", - "闭", - "湾", - "键", - "凡", - "驻", - "锅", - "救", - "恩", - "剥", - "凝", - "碱", - "齿", - "截", - "炼", - "麻", - "纺", - "禁", - "废", - "盛", - "版", - "缓", - "净", - "睛", - "昌", - "婚", - "涉", - "筒", - "嘴", - "插", - "岸", - "朗", - "庄", - "街", - "藏", - "姑", - "贸", - "腐", - "奴", - "啦", - "惯", - "乘", - "伙", - "恢", - "匀", - "纱", - "扎", - "辩", - "耳", - "彪", - "臣", - "亿", - "璃", - "抵", - "脉", - "秀", - "萨", - "俄", - "网", - "舞", - "店", - "喷", - "纵", - "寸", - "汗", - "挂", - "洪", - "贺", - "闪", - "柬", - "爆", - "烯", - "津", - "稻", - "墙", - "软", - "勇", - "像", - "滚", - "厘", - "蒙", - "芳", - "肯", - "坡", - "柱", - "荡", - "腿", - "仪", - "旅", - "尾", - "轧", - "冰", - "贡", - "登", - "黎", - "削", - "钻", - "勒", - "逃", - "障", - "氨", - "郭", - "峰", - "币", - "港", - "伏", - "轨", - "亩", - "毕", - "擦", - "莫", - "刺", - "浪", - "秘", - "援", - "株", - "健", - "售", - "股", - "岛", - "甘", - "泡", - "睡", - "童", - "铸", - "汤", - "阀", - "休", - "汇", - "舍", - "牧", - "绕", - "炸", - "哲", - "磷", - "绩", - "朋", - "淡", - "尖", - "启", - "陷", - "柴", - "呈", - "徒", - "颜", - "泪", - "稍", - "忘", - "泵", - "蓝", - "拖", - "洞", - "授", - "镜", - "辛", - "壮", - "锋", - "贫", - "虚", - "弯", - "摩", - "泰", - "幼", - "廷", - "尊", - "窗", - "纲", - "弄", - "隶", - "疑", - "氏", - "宫", - "姐", - "震", - "瑞", - "怪", - "尤", - "琴", - "循", - "描", - "膜", - "违", - "夹", - "腰", - "缘", - "珠", - "穷", - "森", - "枝", - "竹", - "沟", - "催", - "绳", - "忆", - "邦", - "剩", - "幸", - "浆", - "栏", - "拥", - "牙", - "贮", - "礼", - "滤", - "钠", - "纹", - "罢", - "拍", - "咱", - "喊", - "袖", - "埃", - "勤", - "罚", - "焦", - "潜", - "伍", - "墨", - "欲", - "缝", - "姓", - "刊", - "饱", - "仿", - "奖", - "铝", - "鬼", - "丽", - "跨", - "默", - "挖", - "链", - "扫", - "喝", - "袋", - "炭", - "污", - "幕", - "诸", - "弧", - "励", - "梅", - "奶", - "洁", - "灾", - "舟", - "鉴", - "苯", - "讼", - "抱", - "毁", - "懂", - "寒", - "智", - "埔", - "寄", - "届", - "跃", - "渡", - "挑", - "丹", - "艰", - "贝", - "碰", - "拔", - "爹", - "戴", - "码", - "梦", - "芽", - "熔", - "赤", - "渔", - "哭", - "敬", - "颗", - "奔", - "铅", - "仲", - "虎", - "稀", - "妹", - "乏", - "珍", - "申", - "桌", - "遵", - "允", - "隆", - "螺", - "仓", - "魏", - "锐", - "晓", - "氮", - "兼", - "隐", - "碍", - "赫", - "拨", - "忠", - "肃", - "缸", - "牵", - "抢", - "博", - "巧", - "壳", - "兄", - "杜", - "讯", - "诚", - "碧", - "祥", - "柯", - "页", - "巡", - "矩", - "悲", - "灌", - "龄", - "伦", - "票", - "寻", - "桂", - "铺", - "圣", - "恐", - "恰", - "郑", - "趣", - "抬", - "荒", - "腾", - "贴", - "柔", - "滴", - "猛", - "阔", - "辆", - "妻", - "填", - "撤", - "储", - "签", - "闹", - "扰", - "紫", - "砂", - "递", - "戏", - "吊", - "陶", - "伐", - "喂", - "疗", - "瓶", - "婆", - "抚", - "臂", - "摸", - "忍", - "虾", - "蜡", - "邻", - "胸", - "巩", - "挤", - "偶", - "弃", - "槽", - "劲", - "乳", - "邓", - "吉", - "仁", - "烂", - "砖", - "租", - "乌", - "舰", - "伴", - "瓜", - "浅", - "丙", - "暂", - "燥", - "橡", - "柳", - "迷", - "暖", - "牌", - "秧", - "胆", - "详", - "簧", - "踏", - "瓷", - "谱", - "呆", - "宾", - "糊", - "洛", - "辉", - "愤", - "竞", - "隙", - "怒", - "粘", - "乃", - "绪", - "肩", - "籍", - "敏", - "涂", - "熙", - "皆", - "侦", - "悬", - "掘", - "享", - "纠", - "醒", - "狂", - "锁", - "淀", - "恨", - "牲", - "霸", - "爬", - "赏", - "逆", - "玩", - "陵", - "祝", - "秒", - "浙", - "貌" - ]; -} \ No newline at end of file diff --git a/lib/monero/mnemonics/dutch.dart b/lib/monero/mnemonics/dutch.dart deleted file mode 100644 index 3a1d00cfc..000000000 --- a/lib/monero/mnemonics/dutch.dart +++ /dev/null @@ -1,1630 +0,0 @@ -class DutchMnemonics { - static const words = [ - "aalglad", - "aalscholver", - "aambeeld", - "aangeef", - "aanlandig", - "aanvaard", - "aanwakker", - "aapmens", - "aarten", - "abdicatie", - "abnormaal", - "abrikoos", - "accu", - "acuut", - "adjudant", - "admiraal", - "advies", - "afbidding", - "afdracht", - "affaire", - "affiche", - "afgang", - "afkick", - "afknap", - "aflees", - "afmijner", - "afname", - "afpreekt", - "afrader", - "afspeel", - "aftocht", - "aftrek", - "afzijdig", - "ahornboom", - "aktetas", - "akzo", - "alchemist", - "alcohol", - "aldaar", - "alexander", - "alfabet", - "alfredo", - "alice", - "alikruik", - "allrisk", - "altsax", - "alufolie", - "alziend", - "amai", - "ambacht", - "ambieer", - "amina", - "amnestie", - "amok", - "ampul", - "amuzikaal", - "angela", - "aniek", - "antje", - "antwerpen", - "anya", - "aorta", - "apache", - "apekool", - "appelaar", - "arganolie", - "argeloos", - "armoede", - "arrenslee", - "artritis", - "arubaan", - "asbak", - "ascii", - "asgrauw", - "asjes", - "asml", - "aspunt", - "asurn", - "asveld", - "aterling", - "atomair", - "atrium", - "atsma", - "atypisch", - "auping", - "aura", - "avifauna", - "axiaal", - "azoriaan", - "azteek", - "azuur", - "bachelor", - "badderen", - "badhotel", - "badmantel", - "badsteden", - "balie", - "ballans", - "balvers", - "bamibal", - "banneling", - "barracuda", - "basaal", - "batelaan", - "batje", - "beambte", - "bedlamp", - "bedwelmd", - "befaamd", - "begierd", - "begraaf", - "behield", - "beijaard", - "bejaagd", - "bekaaid", - "beks", - "bektas", - "belaad", - "belboei", - "belderbos", - "beloerd", - "beluchten", - "bemiddeld", - "benadeeld", - "benijd", - "berechten", - "beroemd", - "besef", - "besseling", - "best", - "betichten", - "bevind", - "bevochten", - "bevraagd", - "bewust", - "bidplaats", - "biefstuk", - "biemans", - "biezen", - "bijbaan", - "bijeenkom", - "bijfiguur", - "bijkaart", - "bijlage", - "bijpaard", - "bijtgaar", - "bijweg", - "bimmel", - "binck", - "bint", - "biobak", - "biotisch", - "biseks", - "bistro", - "bitter", - "bitumen", - "bizar", - "blad", - "bleken", - "blender", - "bleu", - "blief", - "blijven", - "blozen", - "bock", - "boef", - "boei", - "boks", - "bolder", - "bolus", - "bolvormig", - "bomaanval", - "bombarde", - "bomma", - "bomtapijt", - "bookmaker", - "boos", - "borg", - "bosbes", - "boshuizen", - "bosloop", - "botanicus", - "bougie", - "bovag", - "boxspring", - "braad", - "brasem", - "brevet", - "brigade", - "brinckman", - "bruid", - "budget", - "buffel", - "buks", - "bulgaar", - "buma", - "butaan", - "butler", - "buuf", - "cactus", - "cafeetje", - "camcorder", - "cannabis", - "canyon", - "capoeira", - "capsule", - "carkit", - "casanova", - "catalaan", - "ceintuur", - "celdeling", - "celplasma", - "cement", - "censeren", - "ceramisch", - "cerberus", - "cerebraal", - "cesium", - "cirkel", - "citeer", - "civiel", - "claxon", - "clenbuterol", - "clicheren", - "clijsen", - "coalitie", - "coassistentschap", - "coaxiaal", - "codetaal", - "cofinanciering", - "cognac", - "coltrui", - "comfort", - "commandant", - "condensaat", - "confectie", - "conifeer", - "convector", - "copier", - "corfu", - "correct", - "coup", - "couvert", - "creatie", - "credit", - "crematie", - "cricket", - "croupier", - "cruciaal", - "cruijff", - "cuisine", - "culemborg", - "culinair", - "curve", - "cyrano", - "dactylus", - "dading", - "dagblind", - "dagje", - "daglicht", - "dagprijs", - "dagranden", - "dakdekker", - "dakpark", - "dakterras", - "dalgrond", - "dambord", - "damkat", - "damlengte", - "damman", - "danenberg", - "debbie", - "decibel", - "defect", - "deformeer", - "degelijk", - "degradant", - "dejonghe", - "dekken", - "deppen", - "derek", - "derf", - "derhalve", - "detineren", - "devalueer", - "diaken", - "dicht", - "dictaat", - "dief", - "digitaal", - "dijbreuk", - "dijkmans", - "dimbaar", - "dinsdag", - "diode", - "dirigeer", - "disbalans", - "dobermann", - "doenbaar", - "doerak", - "dogma", - "dokhaven", - "dokwerker", - "doling", - "dolphijn", - "dolven", - "dombo", - "dooraderd", - "dopeling", - "doping", - "draderig", - "drama", - "drenkbak", - "dreumes", - "drol", - "drug", - "duaal", - "dublin", - "duplicaat", - "durven", - "dusdanig", - "dutchbat", - "dutje", - "dutten", - "duur", - "duwwerk", - "dwaal", - "dweil", - "dwing", - "dyslexie", - "ecostroom", - "ecotaks", - "educatie", - "eeckhout", - "eede", - "eemland", - "eencellig", - "eeneiig", - "eenruiter", - "eenwinter", - "eerenberg", - "eerrover", - "eersel", - "eetmaal", - "efteling", - "egaal", - "egtberts", - "eickhoff", - "eidooier", - "eiland", - "eind", - "eisden", - "ekster", - "elburg", - "elevatie", - "elfkoppig", - "elfrink", - "elftal", - "elimineer", - "elleboog", - "elma", - "elodie", - "elsa", - "embleem", - "embolie", - "emoe", - "emonds", - "emplooi", - "enduro", - "enfin", - "engageer", - "entourage", - "entstof", - "epileer", - "episch", - "eppo", - "erasmus", - "erboven", - "erebaan", - "erelijst", - "ereronden", - "ereteken", - "erfhuis", - "erfwet", - "erger", - "erica", - "ermitage", - "erna", - "ernie", - "erts", - "ertussen", - "eruitzien", - "ervaar", - "erven", - "erwt", - "esbeek", - "escort", - "esdoorn", - "essing", - "etage", - "eter", - "ethanol", - "ethicus", - "etholoog", - "eufonisch", - "eurocent", - "evacuatie", - "exact", - "examen", - "executant", - "exen", - "exit", - "exogeen", - "exotherm", - "expeditie", - "expletief", - "expres", - "extase", - "extinctie", - "faal", - "faam", - "fabel", - "facultair", - "fakir", - "fakkel", - "faliekant", - "fallisch", - "famke", - "fanclub", - "fase", - "fatsoen", - "fauna", - "federaal", - "feedback", - "feest", - "feilbaar", - "feitelijk", - "felblauw", - "figurante", - "fiod", - "fitheid", - "fixeer", - "flap", - "fleece", - "fleur", - "flexibel", - "flits", - "flos", - "flow", - "fluweel", - "foezelen", - "fokkelman", - "fokpaard", - "fokvee", - "folder", - "follikel", - "folmer", - "folteraar", - "fooi", - "foolen", - "forfait", - "forint", - "formule", - "fornuis", - "fosfaat", - "foxtrot", - "foyer", - "fragiel", - "frater", - "freak", - "freddie", - "fregat", - "freon", - "frijnen", - "fructose", - "frunniken", - "fuiven", - "funshop", - "furieus", - "fysica", - "gadget", - "galder", - "galei", - "galg", - "galvlieg", - "galzuur", - "ganesh", - "gaswet", - "gaza", - "gazelle", - "geaaid", - "gebiecht", - "gebufferd", - "gedijd", - "geef", - "geflanst", - "gefreesd", - "gegaan", - "gegijzeld", - "gegniffel", - "gegraaid", - "gehikt", - "gehobbeld", - "gehucht", - "geiser", - "geiten", - "gekaakt", - "gekheid", - "gekijf", - "gekmakend", - "gekocht", - "gekskap", - "gekte", - "gelubberd", - "gemiddeld", - "geordend", - "gepoederd", - "gepuft", - "gerda", - "gerijpt", - "geseald", - "geshockt", - "gesierd", - "geslaagd", - "gesnaaid", - "getracht", - "getwijfel", - "geuit", - "gevecht", - "gevlagd", - "gewicht", - "gezaagd", - "gezocht", - "ghanees", - "giebelen", - "giechel", - "giepmans", - "gips", - "giraal", - "gistachtig", - "gitaar", - "glaasje", - "gletsjer", - "gleuf", - "glibberen", - "glijbaan", - "gloren", - "gluipen", - "gluren", - "gluur", - "gnoe", - "goddelijk", - "godgans", - "godschalk", - "godzalig", - "goeierd", - "gogme", - "goklustig", - "gokwereld", - "gonggrijp", - "gonje", - "goor", - "grabbel", - "graf", - "graveer", - "grif", - "grolleman", - "grom", - "groosman", - "grubben", - "gruijs", - "grut", - "guacamole", - "guido", - "guppy", - "haazen", - "hachelijk", - "haex", - "haiku", - "hakhout", - "hakken", - "hanegem", - "hans", - "hanteer", - "harrie", - "hazebroek", - "hedonist", - "heil", - "heineken", - "hekhuis", - "hekman", - "helbig", - "helga", - "helwegen", - "hengelaar", - "herkansen", - "hermafrodiet", - "hertaald", - "hiaat", - "hikspoors", - "hitachi", - "hitparade", - "hobo", - "hoeve", - "holocaust", - "hond", - "honnepon", - "hoogacht", - "hotelbed", - "hufter", - "hugo", - "huilbier", - "hulk", - "humus", - "huwbaar", - "huwelijk", - "hype", - "iconisch", - "idema", - "ideogram", - "idolaat", - "ietje", - "ijker", - "ijkheid", - "ijklijn", - "ijkmaat", - "ijkwezen", - "ijmuiden", - "ijsbox", - "ijsdag", - "ijselijk", - "ijskoud", - "ilse", - "immuun", - "impliceer", - "impuls", - "inbijten", - "inbuigen", - "indijken", - "induceer", - "indy", - "infecteer", - "inhaak", - "inkijk", - "inluiden", - "inmijnen", - "inoefenen", - "inpolder", - "inrijden", - "inslaan", - "invitatie", - "inwaaien", - "ionisch", - "isaac", - "isolatie", - "isotherm", - "isra", - "italiaan", - "ivoor", - "jacobs", - "jakob", - "jammen", - "jampot", - "jarig", - "jehova", - "jenever", - "jezus", - "joana", - "jobdienst", - "josua", - "joule", - "juich", - "jurk", - "juut", - "kaas", - "kabelaar", - "kabinet", - "kagenaar", - "kajuit", - "kalebas", - "kalm", - "kanjer", - "kapucijn", - "karregat", - "kart", - "katvanger", - "katwijk", - "kegelaar", - "keiachtig", - "keizer", - "kenletter", - "kerdijk", - "keus", - "kevlar", - "kezen", - "kickback", - "kieviet", - "kijken", - "kikvors", - "kilheid", - "kilobit", - "kilsdonk", - "kipschnitzel", - "kissebis", - "klad", - "klagelijk", - "klak", - "klapbaar", - "klaver", - "klene", - "klets", - "klijnhout", - "klit", - "klok", - "klonen", - "klotefilm", - "kluif", - "klumper", - "klus", - "knabbel", - "knagen", - "knaven", - "kneedbaar", - "knmi", - "knul", - "knus", - "kokhals", - "komiek", - "komkommer", - "kompaan", - "komrij", - "komvormig", - "koning", - "kopbal", - "kopklep", - "kopnagel", - "koppejan", - "koptekst", - "kopwand", - "koraal", - "kosmisch", - "kostbaar", - "kram", - "kraneveld", - "kras", - "kreling", - "krengen", - "kribbe", - "krik", - "kruid", - "krulbol", - "kuijper", - "kuipbank", - "kuit", - "kuiven", - "kutsmoes", - "kuub", - "kwak", - "kwatong", - "kwetsbaar", - "kwezelaar", - "kwijnen", - "kwik", - "kwinkslag", - "kwitantie", - "lading", - "lakbeits", - "lakken", - "laklaag", - "lakmoes", - "lakwijk", - "lamheid", - "lamp", - "lamsbout", - "lapmiddel", - "larve", - "laser", - "latijn", - "latuw", - "lawaai", - "laxeerpil", - "lebberen", - "ledeboer", - "leefbaar", - "leeman", - "lefdoekje", - "lefhebber", - "legboor", - "legsel", - "leguaan", - "leiplaat", - "lekdicht", - "lekrijden", - "leksteen", - "lenen", - "leraar", - "lesbienne", - "leugenaar", - "leut", - "lexicaal", - "lezing", - "lieten", - "liggeld", - "lijdzaam", - "lijk", - "lijmstang", - "lijnschip", - "likdoorn", - "likken", - "liksteen", - "limburg", - "link", - "linoleum", - "lipbloem", - "lipman", - "lispelen", - "lissabon", - "litanie", - "liturgie", - "lochem", - "loempia", - "loesje", - "logheid", - "lonen", - "lonneke", - "loom", - "loos", - "losbaar", - "loslaten", - "losplaats", - "loting", - "lotnummer", - "lots", - "louie", - "lourdes", - "louter", - "lowbudget", - "luijten", - "luikenaar", - "luilak", - "luipaard", - "luizenbos", - "lulkoek", - "lumen", - "lunzen", - "lurven", - "lutjeboer", - "luttel", - "lutz", - "luuk", - "luwte", - "luyendijk", - "lyceum", - "lynx", - "maakbaar", - "magdalena", - "malheid", - "manchet", - "manfred", - "manhaftig", - "mank", - "mantel", - "marion", - "marxist", - "masmeijer", - "massaal", - "matsen", - "matverf", - "matze", - "maude", - "mayonaise", - "mechanica", - "meifeest", - "melodie", - "meppelink", - "midvoor", - "midweeks", - "midzomer", - "miezel", - "mijnraad", - "minus", - "mirck", - "mirte", - "mispakken", - "misraden", - "miswassen", - "mitella", - "moker", - "molecule", - "mombakkes", - "moonen", - "mopperaar", - "moraal", - "morgana", - "mormel", - "mosselaar", - "motregen", - "mouw", - "mufheid", - "mutueel", - "muzelman", - "naaidoos", - "naald", - "nadeel", - "nadruk", - "nagy", - "nahon", - "naima", - "nairobi", - "napalm", - "napels", - "napijn", - "napoleon", - "narigheid", - "narratief", - "naseizoen", - "nasibal", - "navigatie", - "nawijn", - "negatief", - "nekletsel", - "nekwervel", - "neolatijn", - "neonataal", - "neptunus", - "nerd", - "nest", - "neuzelaar", - "nihiliste", - "nijenhuis", - "nijging", - "nijhoff", - "nijl", - "nijptang", - "nippel", - "nokkenas", - "noordam", - "noren", - "normaal", - "nottelman", - "notulant", - "nout", - "nuance", - "nuchter", - "nudorp", - "nulde", - "nullijn", - "nulmeting", - "nunspeet", - "nylon", - "obelisk", - "object", - "oblie", - "obsceen", - "occlusie", - "oceaan", - "ochtend", - "ockhuizen", - "oerdom", - "oergezond", - "oerlaag", - "oester", - "okhuijsen", - "olifant", - "olijfboer", - "omaans", - "ombudsman", - "omdat", - "omdijken", - "omdoen", - "omgebouwd", - "omkeer", - "omkomen", - "ommegaand", - "ommuren", - "omroep", - "omruil", - "omslaan", - "omsmeden", - "omvaar", - "onaardig", - "onedel", - "onenig", - "onheilig", - "onrecht", - "onroerend", - "ontcijfer", - "onthaal", - "ontvallen", - "ontzadeld", - "onzacht", - "onzin", - "onzuiver", - "oogappel", - "ooibos", - "ooievaar", - "ooit", - "oorarts", - "oorhanger", - "oorijzer", - "oorklep", - "oorschelp", - "oorworm", - "oorzaak", - "opdagen", - "opdien", - "opdweilen", - "opel", - "opgebaard", - "opinie", - "opjutten", - "opkijken", - "opklaar", - "opkuisen", - "opkwam", - "opnaaien", - "opossum", - "opsieren", - "opsmeer", - "optreden", - "opvijzel", - "opvlammen", - "opwind", - "oraal", - "orchidee", - "orkest", - "ossuarium", - "ostendorf", - "oublie", - "oudachtig", - "oudbakken", - "oudnoors", - "oudshoorn", - "oudtante", - "oven", - "over", - "oxidant", - "pablo", - "pacht", - "paktafel", - "pakzadel", - "paljas", - "panharing", - "papfles", - "paprika", - "parochie", - "paus", - "pauze", - "paviljoen", - "peek", - "pegel", - "peigeren", - "pekela", - "pendant", - "penibel", - "pepmiddel", - "peptalk", - "periferie", - "perron", - "pessarium", - "peter", - "petfles", - "petgat", - "peuk", - "pfeifer", - "picknick", - "pief", - "pieneman", - "pijlkruid", - "pijnacker", - "pijpelink", - "pikdonker", - "pikeer", - "pilaar", - "pionier", - "pipet", - "piscine", - "pissebed", - "pitchen", - "pixel", - "plamuren", - "plan", - "plausibel", - "plegen", - "plempen", - "pleonasme", - "plezant", - "podoloog", - "pofmouw", - "pokdalig", - "ponywagen", - "popachtig", - "popidool", - "porren", - "positie", - "potten", - "pralen", - "prezen", - "prijzen", - "privaat", - "proef", - "prooi", - "prozawerk", - "pruik", - "prul", - "publiceer", - "puck", - "puilen", - "pukkelig", - "pulveren", - "pupil", - "puppy", - "purmerend", - "pustjens", - "putemmer", - "puzzelaar", - "queenie", - "quiche", - "raam", - "raar", - "raat", - "raes", - "ralf", - "rally", - "ramona", - "ramselaar", - "ranonkel", - "rapen", - "rapunzel", - "rarekiek", - "rarigheid", - "rattenhol", - "ravage", - "reactie", - "recreant", - "redacteur", - "redster", - "reewild", - "regie", - "reijnders", - "rein", - "replica", - "revanche", - "rigide", - "rijbaan", - "rijdansen", - "rijgen", - "rijkdom", - "rijles", - "rijnwijn", - "rijpma", - "rijstafel", - "rijtaak", - "rijzwepen", - "rioleer", - "ripdeal", - "riphagen", - "riskant", - "rits", - "rivaal", - "robbedoes", - "robot", - "rockact", - "rodijk", - "rogier", - "rohypnol", - "rollaag", - "rolpaal", - "roltafel", - "roof", - "roon", - "roppen", - "rosbief", - "rosharig", - "rosielle", - "rotan", - "rotleven", - "rotten", - "rotvaart", - "royaal", - "royeer", - "rubato", - "ruby", - "ruche", - "rudge", - "ruggetje", - "rugnummer", - "rugpijn", - "rugtitel", - "rugzak", - "ruilbaar", - "ruis", - "ruit", - "rukwind", - "rulijs", - "rumoeren", - "rumsdorp", - "rumtaart", - "runnen", - "russchen", - "ruwkruid", - "saboteer", - "saksisch", - "salade", - "salpeter", - "sambabal", - "samsam", - "satelliet", - "satineer", - "saus", - "scampi", - "scarabee", - "scenario", - "schobben", - "schubben", - "scout", - "secessie", - "secondair", - "seculair", - "sediment", - "seeland", - "settelen", - "setwinst", - "sheriff", - "shiatsu", - "siciliaan", - "sidderaal", - "sigma", - "sijben", - "silvana", - "simkaart", - "sinds", - "situatie", - "sjaak", - "sjardijn", - "sjezen", - "sjor", - "skinhead", - "skylab", - "slamixen", - "sleijpen", - "slijkerig", - "slordig", - "slowaak", - "sluieren", - "smadelijk", - "smiecht", - "smoel", - "smos", - "smukken", - "snackcar", - "snavel", - "sneaker", - "sneu", - "snijdbaar", - "snit", - "snorder", - "soapbox", - "soetekouw", - "soigneren", - "sojaboon", - "solo", - "solvabel", - "somber", - "sommatie", - "soort", - "soppen", - "sopraan", - "soundbar", - "spanen", - "spawater", - "spijgat", - "spinaal", - "spionage", - "spiraal", - "spleet", - "splijt", - "spoed", - "sporen", - "spul", - "spuug", - "spuw", - "stalen", - "standaard", - "star", - "stefan", - "stencil", - "stijf", - "stil", - "stip", - "stopdas", - "stoten", - "stoven", - "straat", - "strobbe", - "strubbel", - "stucadoor", - "stuif", - "stukadoor", - "subhoofd", - "subregent", - "sudoku", - "sukade", - "sulfaat", - "surinaams", - "suus", - "syfilis", - "symboliek", - "sympathie", - "synagoge", - "synchroon", - "synergie", - "systeem", - "taanderij", - "tabak", - "tachtig", - "tackelen", - "taiwanees", - "talman", - "tamheid", - "tangaslip", - "taps", - "tarkan", - "tarwe", - "tasman", - "tatjana", - "taxameter", - "teil", - "teisman", - "telbaar", - "telco", - "telganger", - "telstar", - "tenant", - "tepel", - "terzet", - "testament", - "ticket", - "tiesinga", - "tijdelijk", - "tika", - "tiksel", - "tilleman", - "timbaal", - "tinsteen", - "tiplijn", - "tippelaar", - "tjirpen", - "toezeggen", - "tolbaas", - "tolgeld", - "tolhek", - "tolo", - "tolpoort", - "toltarief", - "tolvrij", - "tomaat", - "tondeuse", - "toog", - "tooi", - "toonbaar", - "toos", - "topclub", - "toppen", - "toptalent", - "topvrouw", - "toque", - "torment", - "tornado", - "tosti", - "totdat", - "toucheer", - "toulouse", - "tournedos", - "tout", - "trabant", - "tragedie", - "trailer", - "traject", - "traktaat", - "trauma", - "tray", - "trechter", - "tred", - "tref", - "treur", - "troebel", - "tros", - "trucage", - "truffel", - "tsaar", - "tucht", - "tuenter", - "tuitelig", - "tukje", - "tuktuk", - "tulp", - "tuma", - "tureluurs", - "twijfel", - "twitteren", - "tyfoon", - "typograaf", - "ugandees", - "uiachtig", - "uier", - "uisnipper", - "ultiem", - "unitair", - "uranium", - "urbaan", - "urendag", - "ursula", - "uurcirkel", - "uurglas", - "uzelf", - "vaat", - "vakantie", - "vakleraar", - "valbijl", - "valpartij", - "valreep", - "valuatie", - "vanmiddag", - "vanonder", - "varaan", - "varken", - "vaten", - "veenbes", - "veeteler", - "velgrem", - "vellekoop", - "velvet", - "veneberg", - "venlo", - "vent", - "venusberg", - "venw", - "veredeld", - "verf", - "verhaaf", - "vermaak", - "vernaaid", - "verraad", - "vers", - "veruit", - "verzaagd", - "vetachtig", - "vetlok", - "vetmesten", - "veto", - "vetrek", - "vetstaart", - "vetten", - "veurink", - "viaduct", - "vibrafoon", - "vicariaat", - "vieux", - "vieveen", - "vijfvoud", - "villa", - "vilt", - "vimmetje", - "vindbaar", - "vips", - "virtueel", - "visdieven", - "visee", - "visie", - "vlaag", - "vleugel", - "vmbo", - "vocht", - "voesenek", - "voicemail", - "voip", - "volg", - "vork", - "vorselaar", - "voyeur", - "vracht", - "vrekkig", - "vreten", - "vrije", - "vrozen", - "vrucht", - "vucht", - "vugt", - "vulkaan", - "vulmiddel", - "vulva", - "vuren", - "waas", - "wacht", - "wadvogel", - "wafel", - "waffel", - "walhalla", - "walnoot", - "walraven", - "wals", - "walvis", - "wandaad", - "wanen", - "wanmolen", - "want", - "warklomp", - "warm", - "wasachtig", - "wasteil", - "watt", - "webhandel", - "weblog", - "webpagina", - "webzine", - "wedereis", - "wedstrijd", - "weeda", - "weert", - "wegmaaien", - "wegscheer", - "wekelijks", - "wekken", - "wekroep", - "wektoon", - "weldaad", - "welwater", - "wendbaar", - "wenkbrauw", - "wens", - "wentelaar", - "wervel", - "wesseling", - "wetboek", - "wetmatig", - "whirlpool", - "wijbrands", - "wijdbeens", - "wijk", - "wijnbes", - "wijting", - "wild", - "wimpelen", - "wingebied", - "winplaats", - "winter", - "winzucht", - "wipstaart", - "wisgerhof", - "withaar", - "witmaker", - "wokkel", - "wolf", - "wonenden", - "woning", - "worden", - "worp", - "wortel", - "wrat", - "wrijf", - "wringen", - "yoghurt", - "ypsilon", - "zaaijer", - "zaak", - "zacharias", - "zakelijk", - "zakkam", - "zakwater", - "zalf", - "zalig", - "zaniken", - "zebracode", - "zeeblauw", - "zeef", - "zeegaand", - "zeeuw", - "zege", - "zegje", - "zeil", - "zesbaans", - "zesenhalf", - "zeskantig", - "zesmaal", - "zetbaas", - "zetpil", - "zeulen", - "ziezo", - "zigzag", - "zijaltaar", - "zijbeuk", - "zijlijn", - "zijmuur", - "zijn", - "zijwaarts", - "zijzelf", - "zilt", - "zimmerman", - "zinledig", - "zinnelijk", - "zionist", - "zitdag", - "zitruimte", - "zitzak", - "zoal", - "zodoende", - "zoekbots", - "zoem", - "zoiets", - "zojuist", - "zondaar", - "zotskap", - "zottebol", - "zucht", - "zuivel", - "zulk", - "zult", - "zuster", - "zuur", - "zweedijk", - "zwendel", - "zwepen", - "zwiep", - "zwijmel", - "zworen" - ]; -} \ No newline at end of file diff --git a/lib/monero/mnemonics/english.dart b/lib/monero/mnemonics/english.dart deleted file mode 100644 index fb464d04e..000000000 --- a/lib/monero/mnemonics/english.dart +++ /dev/null @@ -1,1630 +0,0 @@ -class EnglishMnemonics { - static const words = [ - "abbey", - "abducts", - "ability", - "ablaze", - "abnormal", - "abort", - "abrasive", - "absorb", - "abyss", - "academy", - "aces", - "aching", - "acidic", - "acoustic", - "acquire", - "across", - "actress", - "acumen", - "adapt", - "addicted", - "adept", - "adhesive", - "adjust", - "adopt", - "adrenalin", - "adult", - "adventure", - "aerial", - "afar", - "affair", - "afield", - "afloat", - "afoot", - "afraid", - "after", - "against", - "agenda", - "aggravate", - "agile", - "aglow", - "agnostic", - "agony", - "agreed", - "ahead", - "aided", - "ailments", - "aimless", - "airport", - "aisle", - "ajar", - "akin", - "alarms", - "album", - "alchemy", - "alerts", - "algebra", - "alkaline", - "alley", - "almost", - "aloof", - "alpine", - "already", - "also", - "altitude", - "alumni", - "always", - "amaze", - "ambush", - "amended", - "amidst", - "ammo", - "amnesty", - "among", - "amply", - "amused", - "anchor", - "android", - "anecdote", - "angled", - "ankle", - "annoyed", - "answers", - "antics", - "anvil", - "anxiety", - "anybody", - "apart", - "apex", - "aphid", - "aplomb", - "apology", - "apply", - "apricot", - "aptitude", - "aquarium", - "arbitrary", - "archer", - "ardent", - "arena", - "argue", - "arises", - "army", - "around", - "arrow", - "arsenic", - "artistic", - "ascend", - "ashtray", - "aside", - "asked", - "asleep", - "aspire", - "assorted", - "asylum", - "athlete", - "atlas", - "atom", - "atrium", - "attire", - "auburn", - "auctions", - "audio", - "august", - "aunt", - "austere", - "autumn", - "avatar", - "avidly", - "avoid", - "awakened", - "awesome", - "awful", - "awkward", - "awning", - "awoken", - "axes", - "axis", - "axle", - "aztec", - "azure", - "baby", - "bacon", - "badge", - "baffles", - "bagpipe", - "bailed", - "bakery", - "balding", - "bamboo", - "banjo", - "baptism", - "basin", - "batch", - "bawled", - "bays", - "because", - "beer", - "befit", - "begun", - "behind", - "being", - "below", - "bemused", - "benches", - "berries", - "bested", - "betting", - "bevel", - "beware", - "beyond", - "bias", - "bicycle", - "bids", - "bifocals", - "biggest", - "bikini", - "bimonthly", - "binocular", - "biology", - "biplane", - "birth", - "biscuit", - "bite", - "biweekly", - "blender", - "blip", - "bluntly", - "boat", - "bobsled", - "bodies", - "bogeys", - "boil", - "boldly", - "bomb", - "border", - "boss", - "both", - "bounced", - "bovine", - "bowling", - "boxes", - "boyfriend", - "broken", - "brunt", - "bubble", - "buckets", - "budget", - "buffet", - "bugs", - "building", - "bulb", - "bumper", - "bunch", - "business", - "butter", - "buying", - "buzzer", - "bygones", - "byline", - "bypass", - "cabin", - "cactus", - "cadets", - "cafe", - "cage", - "cajun", - "cake", - "calamity", - "camp", - "candy", - "casket", - "catch", - "cause", - "cavernous", - "cease", - "cedar", - "ceiling", - "cell", - "cement", - "cent", - "certain", - "chlorine", - "chrome", - "cider", - "cigar", - "cinema", - "circle", - "cistern", - "citadel", - "civilian", - "claim", - "click", - "clue", - "coal", - "cobra", - "cocoa", - "code", - "coexist", - "coffee", - "cogs", - "cohesive", - "coils", - "colony", - "comb", - "cool", - "copy", - "corrode", - "costume", - "cottage", - "cousin", - "cowl", - "criminal", - "cube", - "cucumber", - "cuddled", - "cuffs", - "cuisine", - "cunning", - "cupcake", - "custom", - "cycling", - "cylinder", - "cynical", - "dabbing", - "dads", - "daft", - "dagger", - "daily", - "damp", - "dangerous", - "dapper", - "darted", - "dash", - "dating", - "dauntless", - "dawn", - "daytime", - "dazed", - "debut", - "decay", - "dedicated", - "deepest", - "deftly", - "degrees", - "dehydrate", - "deity", - "dejected", - "delayed", - "demonstrate", - "dented", - "deodorant", - "depth", - "desk", - "devoid", - "dewdrop", - "dexterity", - "dialect", - "dice", - "diet", - "different", - "digit", - "dilute", - "dime", - "dinner", - "diode", - "diplomat", - "directed", - "distance", - "ditch", - "divers", - "dizzy", - "doctor", - "dodge", - "does", - "dogs", - "doing", - "dolphin", - "domestic", - "donuts", - "doorway", - "dormant", - "dosage", - "dotted", - "double", - "dove", - "down", - "dozen", - "dreams", - "drinks", - "drowning", - "drunk", - "drying", - "dual", - "dubbed", - "duckling", - "dude", - "duets", - "duke", - "dullness", - "dummy", - "dunes", - "duplex", - "duration", - "dusted", - "duties", - "dwarf", - "dwelt", - "dwindling", - "dying", - "dynamite", - "dyslexic", - "each", - "eagle", - "earth", - "easy", - "eating", - "eavesdrop", - "eccentric", - "echo", - "eclipse", - "economics", - "ecstatic", - "eden", - "edgy", - "edited", - "educated", - "eels", - "efficient", - "eggs", - "egotistic", - "eight", - "either", - "eject", - "elapse", - "elbow", - "eldest", - "eleven", - "elite", - "elope", - "else", - "eluded", - "emails", - "ember", - "emerge", - "emit", - "emotion", - "empty", - "emulate", - "energy", - "enforce", - "enhanced", - "enigma", - "enjoy", - "enlist", - "enmity", - "enough", - "enraged", - "ensign", - "entrance", - "envy", - "epoxy", - "equip", - "erase", - "erected", - "erosion", - "error", - "eskimos", - "espionage", - "essential", - "estate", - "etched", - "eternal", - "ethics", - "etiquette", - "evaluate", - "evenings", - "evicted", - "evolved", - "examine", - "excess", - "exhale", - "exit", - "exotic", - "exquisite", - "extra", - "exult", - "fabrics", - "factual", - "fading", - "fainted", - "faked", - "fall", - "family", - "fancy", - "farming", - "fatal", - "faulty", - "fawns", - "faxed", - "fazed", - "feast", - "february", - "federal", - "feel", - "feline", - "females", - "fences", - "ferry", - "festival", - "fetches", - "fever", - "fewest", - "fiat", - "fibula", - "fictional", - "fidget", - "fierce", - "fifteen", - "fight", - "films", - "firm", - "fishing", - "fitting", - "five", - "fixate", - "fizzle", - "fleet", - "flippant", - "flying", - "foamy", - "focus", - "foes", - "foggy", - "foiled", - "folding", - "fonts", - "foolish", - "fossil", - "fountain", - "fowls", - "foxes", - "foyer", - "framed", - "friendly", - "frown", - "fruit", - "frying", - "fudge", - "fuel", - "fugitive", - "fully", - "fuming", - "fungal", - "furnished", - "fuselage", - "future", - "fuzzy", - "gables", - "gadget", - "gags", - "gained", - "galaxy", - "gambit", - "gang", - "gasp", - "gather", - "gauze", - "gave", - "gawk", - "gaze", - "gearbox", - "gecko", - "geek", - "gels", - "gemstone", - "general", - "geometry", - "germs", - "gesture", - "getting", - "geyser", - "ghetto", - "ghost", - "giant", - "giddy", - "gifts", - "gigantic", - "gills", - "gimmick", - "ginger", - "girth", - "giving", - "glass", - "gleeful", - "glide", - "gnaw", - "gnome", - "goat", - "goblet", - "godfather", - "goes", - "goggles", - "going", - "goldfish", - "gone", - "goodbye", - "gopher", - "gorilla", - "gossip", - "gotten", - "gourmet", - "governing", - "gown", - "greater", - "grunt", - "guarded", - "guest", - "guide", - "gulp", - "gumball", - "guru", - "gusts", - "gutter", - "guys", - "gymnast", - "gypsy", - "gyrate", - "habitat", - "hacksaw", - "haggled", - "hairy", - "hamburger", - "happens", - "hashing", - "hatchet", - "haunted", - "having", - "hawk", - "haystack", - "hazard", - "hectare", - "hedgehog", - "heels", - "hefty", - "height", - "hemlock", - "hence", - "heron", - "hesitate", - "hexagon", - "hickory", - "hiding", - "highway", - "hijack", - "hiker", - "hills", - "himself", - "hinder", - "hippo", - "hire", - "history", - "hitched", - "hive", - "hoax", - "hobby", - "hockey", - "hoisting", - "hold", - "honked", - "hookup", - "hope", - "hornet", - "hospital", - "hotel", - "hounded", - "hover", - "howls", - "hubcaps", - "huddle", - "huge", - "hull", - "humid", - "hunter", - "hurried", - "husband", - "huts", - "hybrid", - "hydrogen", - "hyper", - "iceberg", - "icing", - "icon", - "identity", - "idiom", - "idled", - "idols", - "igloo", - "ignore", - "iguana", - "illness", - "imagine", - "imbalance", - "imitate", - "impel", - "inactive", - "inbound", - "incur", - "industrial", - "inexact", - "inflamed", - "ingested", - "initiate", - "injury", - "inkling", - "inline", - "inmate", - "innocent", - "inorganic", - "input", - "inquest", - "inroads", - "insult", - "intended", - "inundate", - "invoke", - "inwardly", - "ionic", - "irate", - "iris", - "irony", - "irritate", - "island", - "isolated", - "issued", - "italics", - "itches", - "items", - "itinerary", - "itself", - "ivory", - "jabbed", - "jackets", - "jaded", - "jagged", - "jailed", - "jamming", - "january", - "jargon", - "jaunt", - "javelin", - "jaws", - "jazz", - "jeans", - "jeers", - "jellyfish", - "jeopardy", - "jerseys", - "jester", - "jetting", - "jewels", - "jigsaw", - "jingle", - "jittery", - "jive", - "jobs", - "jockey", - "jogger", - "joining", - "joking", - "jolted", - "jostle", - "journal", - "joyous", - "jubilee", - "judge", - "juggled", - "juicy", - "jukebox", - "july", - "jump", - "junk", - "jury", - "justice", - "juvenile", - "kangaroo", - "karate", - "keep", - "kennel", - "kept", - "kernels", - "kettle", - "keyboard", - "kickoff", - "kidneys", - "king", - "kiosk", - "kisses", - "kitchens", - "kiwi", - "knapsack", - "knee", - "knife", - "knowledge", - "knuckle", - "koala", - "laboratory", - "ladder", - "lagoon", - "lair", - "lakes", - "lamb", - "language", - "laptop", - "large", - "last", - "later", - "launching", - "lava", - "lawsuit", - "layout", - "lazy", - "lectures", - "ledge", - "leech", - "left", - "legion", - "leisure", - "lemon", - "lending", - "leopard", - "lesson", - "lettuce", - "lexicon", - "liar", - "library", - "licks", - "lids", - "lied", - "lifestyle", - "light", - "likewise", - "lilac", - "limits", - "linen", - "lion", - "lipstick", - "liquid", - "listen", - "lively", - "loaded", - "lobster", - "locker", - "lodge", - "lofty", - "logic", - "loincloth", - "long", - "looking", - "lopped", - "lordship", - "losing", - "lottery", - "loudly", - "love", - "lower", - "loyal", - "lucky", - "luggage", - "lukewarm", - "lullaby", - "lumber", - "lunar", - "lurk", - "lush", - "luxury", - "lymph", - "lynx", - "lyrics", - "macro", - "madness", - "magically", - "mailed", - "major", - "makeup", - "malady", - "mammal", - "maps", - "masterful", - "match", - "maul", - "maverick", - "maximum", - "mayor", - "maze", - "meant", - "mechanic", - "medicate", - "meeting", - "megabyte", - "melting", - "memoir", - "menu", - "merger", - "mesh", - "metro", - "mews", - "mice", - "midst", - "mighty", - "mime", - "mirror", - "misery", - "mittens", - "mixture", - "moat", - "mobile", - "mocked", - "mohawk", - "moisture", - "molten", - "moment", - "money", - "moon", - "mops", - "morsel", - "mostly", - "motherly", - "mouth", - "movement", - "mowing", - "much", - "muddy", - "muffin", - "mugged", - "mullet", - "mumble", - "mundane", - "muppet", - "mural", - "musical", - "muzzle", - "myriad", - "mystery", - "myth", - "nabbing", - "nagged", - "nail", - "names", - "nanny", - "napkin", - "narrate", - "nasty", - "natural", - "nautical", - "navy", - "nearby", - "necklace", - "needed", - "negative", - "neither", - "neon", - "nephew", - "nerves", - "nestle", - "network", - "neutral", - "never", - "newt", - "nexus", - "nibs", - "niche", - "niece", - "nifty", - "nightly", - "nimbly", - "nineteen", - "nirvana", - "nitrogen", - "nobody", - "nocturnal", - "nodes", - "noises", - "nomad", - "noodles", - "northern", - "nostril", - "noted", - "nouns", - "novelty", - "nowhere", - "nozzle", - "nuance", - "nucleus", - "nudged", - "nugget", - "nuisance", - "null", - "number", - "nuns", - "nurse", - "nutshell", - "nylon", - "oaks", - "oars", - "oasis", - "oatmeal", - "obedient", - "object", - "obliged", - "obnoxious", - "observant", - "obtains", - "obvious", - "occur", - "ocean", - "october", - "odds", - "odometer", - "offend", - "often", - "oilfield", - "ointment", - "okay", - "older", - "olive", - "olympics", - "omega", - "omission", - "omnibus", - "onboard", - "oncoming", - "oneself", - "ongoing", - "onion", - "online", - "onslaught", - "onto", - "onward", - "oozed", - "opacity", - "opened", - "opposite", - "optical", - "opus", - "orange", - "orbit", - "orchid", - "orders", - "organs", - "origin", - "ornament", - "orphans", - "oscar", - "ostrich", - "otherwise", - "otter", - "ouch", - "ought", - "ounce", - "ourselves", - "oust", - "outbreak", - "oval", - "oven", - "owed", - "owls", - "owner", - "oxidant", - "oxygen", - "oyster", - "ozone", - "pact", - "paddles", - "pager", - "pairing", - "palace", - "pamphlet", - "pancakes", - "paper", - "paradise", - "pastry", - "patio", - "pause", - "pavements", - "pawnshop", - "payment", - "peaches", - "pebbles", - "peculiar", - "pedantic", - "peeled", - "pegs", - "pelican", - "pencil", - "people", - "pepper", - "perfect", - "pests", - "petals", - "phase", - "pheasants", - "phone", - "phrases", - "physics", - "piano", - "picked", - "pierce", - "pigment", - "piloted", - "pimple", - "pinched", - "pioneer", - "pipeline", - "pirate", - "pistons", - "pitched", - "pivot", - "pixels", - "pizza", - "playful", - "pledge", - "pliers", - "plotting", - "plus", - "plywood", - "poaching", - "pockets", - "podcast", - "poetry", - "point", - "poker", - "polar", - "ponies", - "pool", - "popular", - "portents", - "possible", - "potato", - "pouch", - "poverty", - "powder", - "pram", - "present", - "pride", - "problems", - "pruned", - "prying", - "psychic", - "public", - "puck", - "puddle", - "puffin", - "pulp", - "pumpkins", - "punch", - "puppy", - "purged", - "push", - "putty", - "puzzled", - "pylons", - "pyramid", - "python", - "queen", - "quick", - "quote", - "rabbits", - "racetrack", - "radar", - "rafts", - "rage", - "railway", - "raking", - "rally", - "ramped", - "randomly", - "rapid", - "rarest", - "rash", - "rated", - "ravine", - "rays", - "razor", - "react", - "rebel", - "recipe", - "reduce", - "reef", - "refer", - "regular", - "reheat", - "reinvest", - "rejoices", - "rekindle", - "relic", - "remedy", - "renting", - "reorder", - "repent", - "request", - "reruns", - "rest", - "return", - "reunion", - "revamp", - "rewind", - "rhino", - "rhythm", - "ribbon", - "richly", - "ridges", - "rift", - "rigid", - "rims", - "ringing", - "riots", - "ripped", - "rising", - "ritual", - "river", - "roared", - "robot", - "rockets", - "rodent", - "rogue", - "roles", - "romance", - "roomy", - "roped", - "roster", - "rotate", - "rounded", - "rover", - "rowboat", - "royal", - "ruby", - "rudely", - "ruffled", - "rugged", - "ruined", - "ruling", - "rumble", - "runway", - "rural", - "rustled", - "ruthless", - "sabotage", - "sack", - "sadness", - "safety", - "saga", - "sailor", - "sake", - "salads", - "sample", - "sanity", - "sapling", - "sarcasm", - "sash", - "satin", - "saucepan", - "saved", - "sawmill", - "saxophone", - "sayings", - "scamper", - "scenic", - "school", - "science", - "scoop", - "scrub", - "scuba", - "seasons", - "second", - "sedan", - "seeded", - "segments", - "seismic", - "selfish", - "semifinal", - "sensible", - "september", - "sequence", - "serving", - "session", - "setup", - "seventh", - "sewage", - "shackles", - "shelter", - "shipped", - "shocking", - "shrugged", - "shuffled", - "shyness", - "siblings", - "sickness", - "sidekick", - "sieve", - "sifting", - "sighting", - "silk", - "simplest", - "sincerely", - "sipped", - "siren", - "situated", - "sixteen", - "sizes", - "skater", - "skew", - "skirting", - "skulls", - "skydive", - "slackens", - "sleepless", - "slid", - "slower", - "slug", - "smash", - "smelting", - "smidgen", - "smog", - "smuggled", - "snake", - "sneeze", - "sniff", - "snout", - "snug", - "soapy", - "sober", - "soccer", - "soda", - "software", - "soggy", - "soil", - "solved", - "somewhere", - "sonic", - "soothe", - "soprano", - "sorry", - "southern", - "sovereign", - "sowed", - "soya", - "space", - "speedy", - "sphere", - "spiders", - "splendid", - "spout", - "sprig", - "spud", - "spying", - "square", - "stacking", - "stellar", - "stick", - "stockpile", - "strained", - "stunning", - "stylishly", - "subtly", - "succeed", - "suddenly", - "suede", - "suffice", - "sugar", - "suitcase", - "sulking", - "summon", - "sunken", - "superior", - "surfer", - "sushi", - "suture", - "swagger", - "swept", - "swiftly", - "sword", - "swung", - "syllabus", - "symptoms", - "syndrome", - "syringe", - "system", - "taboo", - "tacit", - "tadpoles", - "tagged", - "tail", - "taken", - "talent", - "tamper", - "tanks", - "tapestry", - "tarnished", - "tasked", - "tattoo", - "taunts", - "tavern", - "tawny", - "taxi", - "teardrop", - "technical", - "tedious", - "teeming", - "tell", - "template", - "tender", - "tepid", - "tequila", - "terminal", - "testing", - "tether", - "textbook", - "thaw", - "theatrics", - "thirsty", - "thorn", - "threaten", - "thumbs", - "thwart", - "ticket", - "tidy", - "tiers", - "tiger", - "tilt", - "timber", - "tinted", - "tipsy", - "tirade", - "tissue", - "titans", - "toaster", - "tobacco", - "today", - "toenail", - "toffee", - "together", - "toilet", - "token", - "tolerant", - "tomorrow", - "tonic", - "toolbox", - "topic", - "torch", - "tossed", - "total", - "touchy", - "towel", - "toxic", - "toyed", - "trash", - "trendy", - "tribal", - "trolling", - "truth", - "trying", - "tsunami", - "tubes", - "tucks", - "tudor", - "tuesday", - "tufts", - "tugs", - "tuition", - "tulips", - "tumbling", - "tunnel", - "turnip", - "tusks", - "tutor", - "tuxedo", - "twang", - "tweezers", - "twice", - "twofold", - "tycoon", - "typist", - "tyrant", - "ugly", - "ulcers", - "ultimate", - "umbrella", - "umpire", - "unafraid", - "unbending", - "uncle", - "under", - "uneven", - "unfit", - "ungainly", - "unhappy", - "union", - "unjustly", - "unknown", - "unlikely", - "unmask", - "unnoticed", - "unopened", - "unplugs", - "unquoted", - "unrest", - "unsafe", - "until", - "unusual", - "unveil", - "unwind", - "unzip", - "upbeat", - "upcoming", - "update", - "upgrade", - "uphill", - "upkeep", - "upload", - "upon", - "upper", - "upright", - "upstairs", - "uptight", - "upwards", - "urban", - "urchins", - "urgent", - "usage", - "useful", - "usher", - "using", - "usual", - "utensils", - "utility", - "utmost", - "utopia", - "uttered", - "vacation", - "vague", - "vain", - "value", - "vampire", - "vane", - "vapidly", - "vary", - "vastness", - "vats", - "vaults", - "vector", - "veered", - "vegan", - "vehicle", - "vein", - "velvet", - "venomous", - "verification", - "vessel", - "veteran", - "vexed", - "vials", - "vibrate", - "victim", - "video", - "viewpoint", - "vigilant", - "viking", - "village", - "vinegar", - "violin", - "vipers", - "virtual", - "visited", - "vitals", - "vivid", - "vixen", - "vocal", - "vogue", - "voice", - "volcano", - "vortex", - "voted", - "voucher", - "vowels", - "voyage", - "vulture", - "wade", - "waffle", - "wagtail", - "waist", - "waking", - "wallets", - "wanted", - "warped", - "washing", - "water", - "waveform", - "waxing", - "wayside", - "weavers", - "website", - "wedge", - "weekday", - "weird", - "welders", - "went", - "wept", - "were", - "western", - "wetsuit", - "whale", - "when", - "whipped", - "whole", - "wickets", - "width", - "wield", - "wife", - "wiggle", - "wildly", - "winter", - "wipeout", - "wiring", - "wise", - "withdrawn", - "wives", - "wizard", - "wobbly", - "woes", - "woken", - "wolf", - "womanly", - "wonders", - "woozy", - "worry", - "wounded", - "woven", - "wrap", - "wrist", - "wrong", - "yacht", - "yahoo", - "yanks", - "yard", - "yawning", - "yearbook", - "yellow", - "yesterday", - "yeti", - "yields", - "yodel", - "yoga", - "younger", - "yoyo", - "zapped", - "zeal", - "zebra", - "zero", - "zesty", - "zigzags", - "zinger", - "zippers", - "zodiac", - "zombie", - "zones", - "zoom" - ]; -} diff --git a/lib/monero/mnemonics/german.dart b/lib/monero/mnemonics/german.dart deleted file mode 100644 index 1491c9b0e..000000000 --- a/lib/monero/mnemonics/german.dart +++ /dev/null @@ -1,1630 +0,0 @@ -class GermanMnemonics { - static const words = [ - "Abakus", - "Abart", - "abbilden", - "Abbruch", - "Abdrift", - "Abendrot", - "Abfahrt", - "abfeuern", - "Abflug", - "abfragen", - "Abglanz", - "abhärten", - "abheben", - "Abhilfe", - "Abitur", - "Abkehr", - "Ablauf", - "ablecken", - "Ablösung", - "Abnehmer", - "abnutzen", - "Abonnent", - "Abrasion", - "Abrede", - "abrüsten", - "Absicht", - "Absprung", - "Abstand", - "absuchen", - "Abteil", - "Abundanz", - "abwarten", - "Abwurf", - "Abzug", - "Achse", - "Achtung", - "Acker", - "Aderlass", - "Adler", - "Admiral", - "Adresse", - "Affe", - "Affront", - "Afrika", - "Aggregat", - "Agilität", - "ähneln", - "Ahnung", - "Ahorn", - "Akazie", - "Akkord", - "Akrobat", - "Aktfoto", - "Aktivist", - "Albatros", - "Alchimie", - "Alemanne", - "Alibi", - "Alkohol", - "Allee", - "Allüre", - "Almosen", - "Almweide", - "Aloe", - "Alpaka", - "Alpental", - "Alphabet", - "Alpinist", - "Alraune", - "Altbier", - "Alter", - "Altflöte", - "Altruist", - "Alublech", - "Aludose", - "Amateur", - "Amazonas", - "Ameise", - "Amnesie", - "Amok", - "Ampel", - "Amphibie", - "Ampulle", - "Amsel", - "Amulett", - "Anakonda", - "Analogie", - "Ananas", - "Anarchie", - "Anatomie", - "Anbau", - "Anbeginn", - "anbieten", - "Anblick", - "ändern", - "andocken", - "Andrang", - "anecken", - "Anflug", - "Anfrage", - "Anführer", - "Angebot", - "Angler", - "Anhalter", - "Anhöhe", - "Animator", - "Anis", - "Anker", - "ankleben", - "Ankunft", - "Anlage", - "anlocken", - "Anmut", - "Annahme", - "Anomalie", - "Anonymus", - "Anorak", - "anpeilen", - "Anrecht", - "Anruf", - "Ansage", - "Anschein", - "Ansicht", - "Ansporn", - "Anteil", - "Antlitz", - "Antrag", - "Antwort", - "Anwohner", - "Aorta", - "Apfel", - "Appetit", - "Applaus", - "Aquarium", - "Arbeit", - "Arche", - "Argument", - "Arktis", - "Armband", - "Aroma", - "Asche", - "Askese", - "Asphalt", - "Asteroid", - "Ästhetik", - "Astronom", - "Atelier", - "Athlet", - "Atlantik", - "Atmung", - "Audienz", - "aufatmen", - "Auffahrt", - "aufholen", - "aufregen", - "Aufsatz", - "Auftritt", - "Aufwand", - "Augapfel", - "Auktion", - "Ausbruch", - "Ausflug", - "Ausgabe", - "Aushilfe", - "Ausland", - "Ausnahme", - "Aussage", - "Autobahn", - "Avocado", - "Axthieb", - "Bach", - "backen", - "Badesee", - "Bahnhof", - "Balance", - "Balkon", - "Ballett", - "Balsam", - "Banane", - "Bandage", - "Bankett", - "Barbar", - "Barde", - "Barett", - "Bargeld", - "Barkasse", - "Barriere", - "Bart", - "Bass", - "Bastler", - "Batterie", - "Bauch", - "Bauer", - "Bauholz", - "Baujahr", - "Baum", - "Baustahl", - "Bauteil", - "Bauweise", - "Bazar", - "beachten", - "Beatmung", - "beben", - "Becher", - "Becken", - "bedanken", - "beeilen", - "beenden", - "Beere", - "befinden", - "Befreier", - "Begabung", - "Begierde", - "begrüßen", - "Beiboot", - "Beichte", - "Beifall", - "Beigabe", - "Beil", - "Beispiel", - "Beitrag", - "beizen", - "bekommen", - "beladen", - "Beleg", - "bellen", - "belohnen", - "Bemalung", - "Bengel", - "Benutzer", - "Benzin", - "beraten", - "Bereich", - "Bergluft", - "Bericht", - "Bescheid", - "Besitz", - "besorgen", - "Bestand", - "Besuch", - "betanken", - "beten", - "betören", - "Bett", - "Beule", - "Beute", - "Bewegung", - "bewirken", - "Bewohner", - "bezahlen", - "Bezug", - "biegen", - "Biene", - "Bierzelt", - "bieten", - "Bikini", - "Bildung", - "Billard", - "binden", - "Biobauer", - "Biologe", - "Bionik", - "Biotop", - "Birke", - "Bison", - "Bitte", - "Biwak", - "Bizeps", - "blasen", - "Blatt", - "Blauwal", - "Blende", - "Blick", - "Blitz", - "Blockade", - "Blödelei", - "Blondine", - "Blues", - "Blume", - "Blut", - "Bodensee", - "Bogen", - "Boje", - "Bollwerk", - "Bonbon", - "Bonus", - "Boot", - "Bordarzt", - "Börse", - "Böschung", - "Boudoir", - "Boxkampf", - "Boykott", - "Brahms", - "Brandung", - "Brauerei", - "Brecher", - "Breitaxt", - "Bremse", - "brennen", - "Brett", - "Brief", - "Brigade", - "Brillanz", - "bringen", - "brodeln", - "Brosche", - "Brötchen", - "Brücke", - "Brunnen", - "Brüste", - "Brutofen", - "Buch", - "Büffel", - "Bugwelle", - "Bühne", - "Buletten", - "Bullauge", - "Bumerang", - "bummeln", - "Buntglas", - "Bürde", - "Burgherr", - "Bursche", - "Busen", - "Buslinie", - "Bussard", - "Butangas", - "Butter", - "Cabrio", - "campen", - "Captain", - "Cartoon", - "Cello", - "Chalet", - "Charisma", - "Chefarzt", - "Chiffon", - "Chipsatz", - "Chirurg", - "Chor", - "Chronik", - "Chuzpe", - "Clubhaus", - "Cockpit", - "Codewort", - "Cognac", - "Coladose", - "Computer", - "Coupon", - "Cousin", - "Cracking", - "Crash", - "Curry", - "Dach", - "Dackel", - "daddeln", - "daliegen", - "Dame", - "Dammbau", - "Dämon", - "Dampflok", - "Dank", - "Darm", - "Datei", - "Datsche", - "Datteln", - "Datum", - "Dauer", - "Daunen", - "Deckel", - "Decoder", - "Defekt", - "Degen", - "Dehnung", - "Deiche", - "Dekade", - "Dekor", - "Delfin", - "Demut", - "denken", - "Deponie", - "Design", - "Desktop", - "Dessert", - "Detail", - "Detektiv", - "Dezibel", - "Diadem", - "Diagnose", - "Dialekt", - "Diamant", - "Dichter", - "Dickicht", - "Diesel", - "Diktat", - "Diplom", - "Direktor", - "Dirne", - "Diskurs", - "Distanz", - "Docht", - "Dohle", - "Dolch", - "Domäne", - "Donner", - "Dorade", - "Dorf", - "Dörrobst", - "Dorsch", - "Dossier", - "Dozent", - "Drachen", - "Draht", - "Drama", - "Drang", - "Drehbuch", - "Dreieck", - "Dressur", - "Drittel", - "Drossel", - "Druck", - "Duell", - "Duft", - "Düne", - "Dünung", - "dürfen", - "Duschbad", - "Düsenjet", - "Dynamik", - "Ebbe", - "Echolot", - "Echse", - "Eckball", - "Edding", - "Edelweiß", - "Eden", - "Edition", - "Efeu", - "Effekte", - "Egoismus", - "Ehre", - "Eiablage", - "Eiche", - "Eidechse", - "Eidotter", - "Eierkopf", - "Eigelb", - "Eiland", - "Eilbote", - "Eimer", - "einatmen", - "Einband", - "Eindruck", - "Einfall", - "Eingang", - "Einkauf", - "einladen", - "Einöde", - "Einrad", - "Eintopf", - "Einwurf", - "Einzug", - "Eisbär", - "Eisen", - "Eishöhle", - "Eismeer", - "Eiweiß", - "Ekstase", - "Elan", - "Elch", - "Elefant", - "Eleganz", - "Element", - "Elfe", - "Elite", - "Elixier", - "Ellbogen", - "Eloquenz", - "Emigrant", - "Emission", - "Emotion", - "Empathie", - "Empfang", - "Endzeit", - "Energie", - "Engpass", - "Enkel", - "Enklave", - "Ente", - "entheben", - "Entität", - "entladen", - "Entwurf", - "Episode", - "Epoche", - "erachten", - "Erbauer", - "erblühen", - "Erdbeere", - "Erde", - "Erdgas", - "Erdkunde", - "Erdnuss", - "Erdöl", - "Erdteil", - "Ereignis", - "Eremit", - "erfahren", - "Erfolg", - "erfreuen", - "erfüllen", - "Ergebnis", - "erhitzen", - "erkalten", - "erkennen", - "erleben", - "Erlösung", - "ernähren", - "erneuern", - "Ernte", - "Eroberer", - "eröffnen", - "Erosion", - "Erotik", - "Erpel", - "erraten", - "Erreger", - "erröten", - "Ersatz", - "Erstflug", - "Ertrag", - "Eruption", - "erwarten", - "erwidern", - "Erzbau", - "Erzeuger", - "erziehen", - "Esel", - "Eskimo", - "Eskorte", - "Espe", - "Espresso", - "essen", - "Etage", - "Etappe", - "Etat", - "Ethik", - "Etikett", - "Etüde", - "Eule", - "Euphorie", - "Europa", - "Everest", - "Examen", - "Exil", - "Exodus", - "Extrakt", - "Fabel", - "Fabrik", - "Fachmann", - "Fackel", - "Faden", - "Fagott", - "Fahne", - "Faible", - "Fairness", - "Fakt", - "Fakultät", - "Falke", - "Fallobst", - "Fälscher", - "Faltboot", - "Familie", - "Fanclub", - "Fanfare", - "Fangarm", - "Fantasie", - "Farbe", - "Farmhaus", - "Farn", - "Fasan", - "Faser", - "Fassung", - "fasten", - "Faulheit", - "Fauna", - "Faust", - "Favorit", - "Faxgerät", - "Fazit", - "fechten", - "Federboa", - "Fehler", - "Feier", - "Feige", - "feilen", - "Feinripp", - "Feldbett", - "Felge", - "Fellpony", - "Felswand", - "Ferien", - "Ferkel", - "Fernweh", - "Ferse", - "Fest", - "Fettnapf", - "Feuer", - "Fiasko", - "Fichte", - "Fiktion", - "Film", - "Filter", - "Filz", - "Finanzen", - "Findling", - "Finger", - "Fink", - "Finnwal", - "Fisch", - "Fitness", - "Fixpunkt", - "Fixstern", - "Fjord", - "Flachbau", - "Flagge", - "Flamenco", - "Flanke", - "Flasche", - "Flaute", - "Fleck", - "Flegel", - "flehen", - "Fleisch", - "fliegen", - "Flinte", - "Flirt", - "Flocke", - "Floh", - "Floskel", - "Floß", - "Flöte", - "Flugzeug", - "Flunder", - "Flusstal", - "Flutung", - "Fockmast", - "Fohlen", - "Föhnlage", - "Fokus", - "folgen", - "Foliant", - "Folklore", - "Fontäne", - "Förde", - "Forelle", - "Format", - "Forscher", - "Fortgang", - "Forum", - "Fotograf", - "Frachter", - "Fragment", - "Fraktion", - "fräsen", - "Frauenpo", - "Freak", - "Fregatte", - "Freiheit", - "Freude", - "Frieden", - "Frohsinn", - "Frosch", - "Frucht", - "Frühjahr", - "Fuchs", - "Fügung", - "fühlen", - "Füller", - "Fundbüro", - "Funkboje", - "Funzel", - "Furnier", - "Fürsorge", - "Fusel", - "Fußbad", - "Futteral", - "Gabelung", - "gackern", - "Gage", - "gähnen", - "Galaxie", - "Galeere", - "Galopp", - "Gameboy", - "Gamsbart", - "Gandhi", - "Gang", - "Garage", - "Gardine", - "Garküche", - "Garten", - "Gasthaus", - "Gattung", - "gaukeln", - "Gazelle", - "Gebäck", - "Gebirge", - "Gebräu", - "Geburt", - "Gedanke", - "Gedeck", - "Gedicht", - "Gefahr", - "Gefieder", - "Geflügel", - "Gefühl", - "Gegend", - "Gehirn", - "Gehöft", - "Gehweg", - "Geige", - "Geist", - "Gelage", - "Geld", - "Gelenk", - "Gelübde", - "Gemälde", - "Gemeinde", - "Gemüse", - "genesen", - "Genuss", - "Gepäck", - "Geranie", - "Gericht", - "Germane", - "Geruch", - "Gesang", - "Geschenk", - "Gesetz", - "Gesindel", - "Gesöff", - "Gespan", - "Gestade", - "Gesuch", - "Getier", - "Getränk", - "Getümmel", - "Gewand", - "Geweih", - "Gewitter", - "Gewölbe", - "Geysir", - "Giftzahn", - "Gipfel", - "Giraffe", - "Gitarre", - "glänzen", - "Glasauge", - "Glatze", - "Gleis", - "Globus", - "Glück", - "glühen", - "Glutofen", - "Goldzahn", - "Gondel", - "gönnen", - "Gottheit", - "graben", - "Grafik", - "Grashalm", - "Graugans", - "greifen", - "Grenze", - "grillen", - "Groschen", - "Grotte", - "Grube", - "Grünalge", - "Gruppe", - "gruseln", - "Gulasch", - "Gummibär", - "Gurgel", - "Gürtel", - "Güterzug", - "Haarband", - "Habicht", - "hacken", - "hadern", - "Hafen", - "Hagel", - "Hähnchen", - "Haifisch", - "Haken", - "Halbaffe", - "Halsader", - "halten", - "Halunke", - "Handbuch", - "Hanf", - "Harfe", - "Harnisch", - "härten", - "Harz", - "Hasenohr", - "Haube", - "hauchen", - "Haupt", - "Haut", - "Havarie", - "Hebamme", - "hecheln", - "Heck", - "Hedonist", - "Heiler", - "Heimat", - "Heizung", - "Hektik", - "Held", - "helfen", - "Helium", - "Hemd", - "hemmen", - "Hengst", - "Herd", - "Hering", - "Herkunft", - "Hermelin", - "Herrchen", - "Herzdame", - "Heulboje", - "Hexe", - "Hilfe", - "Himbeere", - "Himmel", - "Hingabe", - "hinhören", - "Hinweis", - "Hirsch", - "Hirte", - "Hitzkopf", - "Hobel", - "Hochform", - "Hocker", - "hoffen", - "Hofhund", - "Hofnarr", - "Höhenzug", - "Hohlraum", - "Hölle", - "Holzboot", - "Honig", - "Honorar", - "horchen", - "Hörprobe", - "Höschen", - "Hotel", - "Hubraum", - "Hufeisen", - "Hügel", - "huldigen", - "Hülle", - "Humbug", - "Hummer", - "Humor", - "Hund", - "Hunger", - "Hupe", - "Hürde", - "Hurrikan", - "Hydrant", - "Hypnose", - "Ibis", - "Idee", - "Idiot", - "Igel", - "Illusion", - "Imitat", - "impfen", - "Import", - "Inferno", - "Ingwer", - "Inhalte", - "Inland", - "Insekt", - "Ironie", - "Irrfahrt", - "Irrtum", - "Isolator", - "Istwert", - "Jacke", - "Jade", - "Jagdhund", - "Jäger", - "Jaguar", - "Jahr", - "Jähzorn", - "Jazzfest", - "Jetpilot", - "jobben", - "Jochbein", - "jodeln", - "Jodsalz", - "Jolle", - "Journal", - "Jubel", - "Junge", - "Junimond", - "Jupiter", - "Jutesack", - "Juwel", - "Kabarett", - "Kabine", - "Kabuff", - "Käfer", - "Kaffee", - "Kahlkopf", - "Kaimauer", - "Kajüte", - "Kaktus", - "Kaliber", - "Kaltluft", - "Kamel", - "kämmen", - "Kampagne", - "Kanal", - "Känguru", - "Kanister", - "Kanone", - "Kante", - "Kanu", - "kapern", - "Kapitän", - "Kapuze", - "Karneval", - "Karotte", - "Käsebrot", - "Kasper", - "Kastanie", - "Katalog", - "Kathode", - "Katze", - "kaufen", - "Kaugummi", - "Kauz", - "Kehle", - "Keilerei", - "Keksdose", - "Kellner", - "Keramik", - "Kerze", - "Kessel", - "Kette", - "keuchen", - "kichern", - "Kielboot", - "Kindheit", - "Kinnbart", - "Kinosaal", - "Kiosk", - "Kissen", - "Klammer", - "Klang", - "Klapprad", - "Klartext", - "kleben", - "Klee", - "Kleinod", - "Klima", - "Klingel", - "Klippe", - "Klischee", - "Kloster", - "Klugheit", - "Klüngel", - "kneten", - "Knie", - "Knöchel", - "knüpfen", - "Kobold", - "Kochbuch", - "Kohlrabi", - "Koje", - "Kokosöl", - "Kolibri", - "Kolumne", - "Kombüse", - "Komiker", - "kommen", - "Konto", - "Konzept", - "Kopfkino", - "Kordhose", - "Korken", - "Korsett", - "Kosename", - "Krabbe", - "Krach", - "Kraft", - "Krähe", - "Kralle", - "Krapfen", - "Krater", - "kraulen", - "Kreuz", - "Krokodil", - "Kröte", - "Kugel", - "Kuhhirt", - "Kühnheit", - "Künstler", - "Kurort", - "Kurve", - "Kurzfilm", - "kuscheln", - "küssen", - "Kutter", - "Labor", - "lachen", - "Lackaffe", - "Ladeluke", - "Lagune", - "Laib", - "Lakritze", - "Lammfell", - "Land", - "Langmut", - "Lappalie", - "Last", - "Laterne", - "Latzhose", - "Laubsäge", - "laufen", - "Laune", - "Lausbub", - "Lavasee", - "Leben", - "Leder", - "Leerlauf", - "Lehm", - "Lehrer", - "leihen", - "Lektüre", - "Lenker", - "Lerche", - "Leseecke", - "Leuchter", - "Lexikon", - "Libelle", - "Libido", - "Licht", - "Liebe", - "liefern", - "Liftboy", - "Limonade", - "Lineal", - "Linoleum", - "List", - "Liveband", - "Lobrede", - "locken", - "Löffel", - "Logbuch", - "Logik", - "Lohn", - "Loipe", - "Lokal", - "Lorbeer", - "Lösung", - "löten", - "Lottofee", - "Löwe", - "Luchs", - "Luder", - "Luftpost", - "Luke", - "Lümmel", - "Lunge", - "lutschen", - "Luxus", - "Macht", - "Magazin", - "Magier", - "Magnet", - "mähen", - "Mahlzeit", - "Mahnmal", - "Maibaum", - "Maisbrei", - "Makel", - "malen", - "Mammut", - "Maniküre", - "Mantel", - "Marathon", - "Marder", - "Marine", - "Marke", - "Marmor", - "Märzluft", - "Maske", - "Maßanzug", - "Maßkrug", - "Mastkorb", - "Material", - "Matratze", - "Mauerbau", - "Maulkorb", - "Mäuschen", - "Mäzen", - "Medium", - "Meinung", - "melden", - "Melodie", - "Mensch", - "Merkmal", - "Messe", - "Metall", - "Meteor", - "Methode", - "Metzger", - "Mieze", - "Milchkuh", - "Mimose", - "Minirock", - "Minute", - "mischen", - "Missetat", - "mitgehen", - "Mittag", - "Mixtape", - "Möbel", - "Modul", - "mögen", - "Möhre", - "Molch", - "Moment", - "Monat", - "Mondflug", - "Monitor", - "Monokini", - "Monster", - "Monument", - "Moorhuhn", - "Moos", - "Möpse", - "Moral", - "Mörtel", - "Motiv", - "Motorrad", - "Möwe", - "Mühe", - "Mulatte", - "Müller", - "Mumie", - "Mund", - "Münze", - "Muschel", - "Muster", - "Mythos", - "Nabel", - "Nachtzug", - "Nackedei", - "Nagel", - "Nähe", - "Nähnadel", - "Namen", - "Narbe", - "Narwal", - "Nasenbär", - "Natur", - "Nebel", - "necken", - "Neffe", - "Neigung", - "Nektar", - "Nenner", - "Neptun", - "Nerz", - "Nessel", - "Nestbau", - "Netz", - "Neubau", - "Neuerung", - "Neugier", - "nicken", - "Niere", - "Nilpferd", - "nisten", - "Nocke", - "Nomade", - "Nordmeer", - "Notdurft", - "Notstand", - "Notwehr", - "Nudismus", - "Nuss", - "Nutzhanf", - "Oase", - "Obdach", - "Oberarzt", - "Objekt", - "Oboe", - "Obsthain", - "Ochse", - "Odyssee", - "Ofenholz", - "öffnen", - "Ohnmacht", - "Ohrfeige", - "Ohrwurm", - "Ökologie", - "Oktave", - "Ölberg", - "Olive", - "Ölkrise", - "Omelett", - "Onkel", - "Oper", - "Optiker", - "Orange", - "Orchidee", - "ordnen", - "Orgasmus", - "Orkan", - "Ortskern", - "Ortung", - "Ostasien", - "Ozean", - "Paarlauf", - "Packeis", - "paddeln", - "Paket", - "Palast", - "Pandabär", - "Panik", - "Panorama", - "Panther", - "Papagei", - "Papier", - "Paprika", - "Paradies", - "Parka", - "Parodie", - "Partner", - "Passant", - "Patent", - "Patzer", - "Pause", - "Pavian", - "Pedal", - "Pegel", - "peilen", - "Perle", - "Person", - "Pfad", - "Pfau", - "Pferd", - "Pfleger", - "Physik", - "Pier", - "Pilotwal", - "Pinzette", - "Piste", - "Plakat", - "Plankton", - "Platin", - "Plombe", - "plündern", - "Pobacke", - "Pokal", - "polieren", - "Popmusik", - "Porträt", - "Posaune", - "Postamt", - "Pottwal", - "Pracht", - "Pranke", - "Preis", - "Primat", - "Prinzip", - "Protest", - "Proviant", - "Prüfung", - "Pubertät", - "Pudding", - "Pullover", - "Pulsader", - "Punkt", - "Pute", - "Putsch", - "Puzzle", - "Python", - "quaken", - "Qualle", - "Quark", - "Quellsee", - "Querkopf", - "Quitte", - "Quote", - "Rabauke", - "Rache", - "Radclub", - "Radhose", - "Radio", - "Radtour", - "Rahmen", - "Rampe", - "Randlage", - "Ranzen", - "Rapsöl", - "Raserei", - "rasten", - "Rasur", - "Rätsel", - "Raubtier", - "Raumzeit", - "Rausch", - "Reaktor", - "Realität", - "Rebell", - "Rede", - "Reetdach", - "Regatta", - "Regen", - "Rehkitz", - "Reifen", - "Reim", - "Reise", - "Reizung", - "Rekord", - "Relevanz", - "Rennboot", - "Respekt", - "Restmüll", - "retten", - "Reue", - "Revolte", - "Rhetorik", - "Rhythmus", - "Richtung", - "Riegel", - "Rindvieh", - "Rippchen", - "Ritter", - "Robbe", - "Roboter", - "Rockband", - "Rohdaten", - "Roller", - "Roman", - "röntgen", - "Rose", - "Rosskur", - "Rost", - "Rotahorn", - "Rotglut", - "Rotznase", - "Rubrik", - "Rückweg", - "Rufmord", - "Ruhe", - "Ruine", - "Rumpf", - "Runde", - "Rüstung", - "rütteln", - "Saaltür", - "Saatguts", - "Säbel", - "Sachbuch", - "Sack", - "Saft", - "sagen", - "Sahneeis", - "Salat", - "Salbe", - "Salz", - "Sammlung", - "Samt", - "Sandbank", - "Sanftmut", - "Sardine", - "Satire", - "Sattel", - "Satzbau", - "Sauerei", - "Saum", - "Säure", - "Schall", - "Scheitel", - "Schiff", - "Schlager", - "Schmied", - "Schnee", - "Scholle", - "Schrank", - "Schulbus", - "Schwan", - "Seeadler", - "Seefahrt", - "Seehund", - "Seeufer", - "segeln", - "Sehnerv", - "Seide", - "Seilzug", - "Senf", - "Sessel", - "Seufzer", - "Sexgott", - "Sichtung", - "Signal", - "Silber", - "singen", - "Sinn", - "Sirup", - "Sitzbank", - "Skandal", - "Skikurs", - "Skipper", - "Skizze", - "Smaragd", - "Socke", - "Sohn", - "Sommer", - "Songtext", - "Sorte", - "Spagat", - "Spannung", - "Spargel", - "Specht", - "Speiseöl", - "Spiegel", - "Sport", - "spülen", - "Stadtbus", - "Stall", - "Stärke", - "Stativ", - "staunen", - "Stern", - "Stiftung", - "Stollen", - "Strömung", - "Sturm", - "Substanz", - "Südalpen", - "Sumpf", - "surfen", - "Tabak", - "Tafel", - "Tagebau", - "takeln", - "Taktung", - "Talsohle", - "Tand", - "Tanzbär", - "Tapir", - "Tarantel", - "Tarnname", - "Tasse", - "Tatnacht", - "Tatsache", - "Tatze", - "Taube", - "tauchen", - "Taufpate", - "Taumel", - "Teelicht", - "Teich", - "teilen", - "Tempo", - "Tenor", - "Terrasse", - "Testflug", - "Theater", - "Thermik", - "ticken", - "Tiefflug", - "Tierart", - "Tigerhai", - "Tinte", - "Tischler", - "toben", - "Toleranz", - "Tölpel", - "Tonband", - "Topf", - "Topmodel", - "Torbogen", - "Torlinie", - "Torte", - "Tourist", - "Tragesel", - "trampeln", - "Trapez", - "Traum", - "treffen", - "Trennung", - "Treue", - "Trick", - "trimmen", - "Trödel", - "Trost", - "Trumpf", - "tüfteln", - "Turban", - "Turm", - "Übermut", - "Ufer", - "Uhrwerk", - "umarmen", - "Umbau", - "Umfeld", - "Umgang", - "Umsturz", - "Unart", - "Unfug", - "Unimog", - "Unruhe", - "Unwucht", - "Uranerz", - "Urlaub", - "Urmensch", - "Utopie", - "Vakuum", - "Valuta", - "Vandale", - "Vase", - "Vektor", - "Ventil", - "Verb", - "Verdeck", - "Verfall", - "Vergaser", - "verhexen", - "Verlag", - "Vers", - "Vesper", - "Vieh", - "Viereck", - "Vinyl", - "Virus", - "Vitrine", - "Vollblut", - "Vorbote", - "Vorrat", - "Vorsicht", - "Vulkan", - "Wachstum", - "Wade", - "Wagemut", - "Wahlen", - "Wahrheit", - "Wald", - "Walhai", - "Wallach", - "Walnuss", - "Walzer", - "wandeln", - "Wanze", - "wärmen", - "Warnruf", - "Wäsche", - "Wasser", - "Weberei", - "wechseln", - "Wegegeld", - "wehren", - "Weiher", - "Weinglas", - "Weißbier", - "Weitwurf", - "Welle", - "Weltall", - "Werkbank", - "Werwolf", - "Wetter", - "wiehern", - "Wildgans", - "Wind", - "Wohl", - "Wohnort", - "Wolf", - "Wollust", - "Wortlaut", - "Wrack", - "Wunder", - "Wurfaxt", - "Wurst", - "Yacht", - "Yeti", - "Zacke", - "Zahl", - "zähmen", - "Zahnfee", - "Zäpfchen", - "Zaster", - "Zaumzeug", - "Zebra", - "zeigen", - "Zeitlupe", - "Zellkern", - "Zeltdach", - "Zensor", - "Zerfall", - "Zeug", - "Ziege", - "Zielfoto", - "Zimteis", - "Zobel", - "Zollhund", - "Zombie", - "Zöpfe", - "Zucht", - "Zufahrt", - "Zugfahrt", - "Zugvogel", - "Zündung", - "Zweck", - "Zyklop" - ]; -} \ No newline at end of file diff --git a/lib/monero/mnemonics/japanese.dart b/lib/monero/mnemonics/japanese.dart deleted file mode 100644 index 5d17fdb14..000000000 --- a/lib/monero/mnemonics/japanese.dart +++ /dev/null @@ -1,1630 +0,0 @@ -class JapaneseMnemonics { - static const words = [ - "あいこくしん", - "あいさつ", - "あいだ", - "あおぞら", - "あかちゃん", - "あきる", - "あけがた", - "あける", - "あこがれる", - "あさい", - "あさひ", - "あしあと", - "あじわう", - "あずかる", - "あずき", - "あそぶ", - "あたえる", - "あたためる", - "あたりまえ", - "あたる", - "あつい", - "あつかう", - "あっしゅく", - "あつまり", - "あつめる", - "あてな", - "あてはまる", - "あひる", - "あぶら", - "あぶる", - "あふれる", - "あまい", - "あまど", - "あまやかす", - "あまり", - "あみもの", - "あめりか", - "あやまる", - "あゆむ", - "あらいぐま", - "あらし", - "あらすじ", - "あらためる", - "あらゆる", - "あらわす", - "ありがとう", - "あわせる", - "あわてる", - "あんい", - "あんがい", - "あんこ", - "あんぜん", - "あんてい", - "あんない", - "あんまり", - "いいだす", - "いおん", - "いがい", - "いがく", - "いきおい", - "いきなり", - "いきもの", - "いきる", - "いくじ", - "いくぶん", - "いけばな", - "いけん", - "いこう", - "いこく", - "いこつ", - "いさましい", - "いさん", - "いしき", - "いじゅう", - "いじょう", - "いじわる", - "いずみ", - "いずれ", - "いせい", - "いせえび", - "いせかい", - "いせき", - "いぜん", - "いそうろう", - "いそがしい", - "いだい", - "いだく", - "いたずら", - "いたみ", - "いたりあ", - "いちおう", - "いちじ", - "いちど", - "いちば", - "いちぶ", - "いちりゅう", - "いつか", - "いっしゅん", - "いっせい", - "いっそう", - "いったん", - "いっち", - "いってい", - "いっぽう", - "いてざ", - "いてん", - "いどう", - "いとこ", - "いない", - "いなか", - "いねむり", - "いのち", - "いのる", - "いはつ", - "いばる", - "いはん", - "いびき", - "いひん", - "いふく", - "いへん", - "いほう", - "いみん", - "いもうと", - "いもたれ", - "いもり", - "いやがる", - "いやす", - "いよかん", - "いよく", - "いらい", - "いらすと", - "いりぐち", - "いりょう", - "いれい", - "いれもの", - "いれる", - "いろえんぴつ", - "いわい", - "いわう", - "いわかん", - "いわば", - "いわゆる", - "いんげんまめ", - "いんさつ", - "いんしょう", - "いんよう", - "うえき", - "うえる", - "うおざ", - "うがい", - "うかぶ", - "うかべる", - "うきわ", - "うくらいな", - "うくれれ", - "うけたまわる", - "うけつけ", - "うけとる", - "うけもつ", - "うける", - "うごかす", - "うごく", - "うこん", - "うさぎ", - "うしなう", - "うしろがみ", - "うすい", - "うすぎ", - "うすぐらい", - "うすめる", - "うせつ", - "うちあわせ", - "うちがわ", - "うちき", - "うちゅう", - "うっかり", - "うつくしい", - "うったえる", - "うつる", - "うどん", - "うなぎ", - "うなじ", - "うなずく", - "うなる", - "うねる", - "うのう", - "うぶげ", - "うぶごえ", - "うまれる", - "うめる", - "うもう", - "うやまう", - "うよく", - "うらがえす", - "うらぐち", - "うらない", - "うりあげ", - "うりきれ", - "うるさい", - "うれしい", - "うれゆき", - "うれる", - "うろこ", - "うわき", - "うわさ", - "うんこう", - "うんちん", - "うんてん", - "うんどう", - "えいえん", - "えいが", - "えいきょう", - "えいご", - "えいせい", - "えいぶん", - "えいよう", - "えいわ", - "えおり", - "えがお", - "えがく", - "えきたい", - "えくせる", - "えしゃく", - "えすて", - "えつらん", - "えのぐ", - "えほうまき", - "えほん", - "えまき", - "えもじ", - "えもの", - "えらい", - "えらぶ", - "えりあ", - "えんえん", - "えんかい", - "えんぎ", - "えんげき", - "えんしゅう", - "えんぜつ", - "えんそく", - "えんちょう", - "えんとつ", - "おいかける", - "おいこす", - "おいしい", - "おいつく", - "おうえん", - "おうさま", - "おうじ", - "おうせつ", - "おうたい", - "おうふく", - "おうべい", - "おうよう", - "おえる", - "おおい", - "おおう", - "おおどおり", - "おおや", - "おおよそ", - "おかえり", - "おかず", - "おがむ", - "おかわり", - "おぎなう", - "おきる", - "おくさま", - "おくじょう", - "おくりがな", - "おくる", - "おくれる", - "おこす", - "おこなう", - "おこる", - "おさえる", - "おさない", - "おさめる", - "おしいれ", - "おしえる", - "おじぎ", - "おじさん", - "おしゃれ", - "おそらく", - "おそわる", - "おたがい", - "おたく", - "おだやか", - "おちつく", - "おっと", - "おつり", - "おでかけ", - "おとしもの", - "おとなしい", - "おどり", - "おどろかす", - "おばさん", - "おまいり", - "おめでとう", - "おもいで", - "おもう", - "おもたい", - "おもちゃ", - "おやつ", - "おやゆび", - "およぼす", - "おらんだ", - "おろす", - "おんがく", - "おんけい", - "おんしゃ", - "おんせん", - "おんだん", - "おんちゅう", - "おんどけい", - "かあつ", - "かいが", - "がいき", - "がいけん", - "がいこう", - "かいさつ", - "かいしゃ", - "かいすいよく", - "かいぜん", - "かいぞうど", - "かいつう", - "かいてん", - "かいとう", - "かいふく", - "がいへき", - "かいほう", - "かいよう", - "がいらい", - "かいわ", - "かえる", - "かおり", - "かかえる", - "かがく", - "かがし", - "かがみ", - "かくご", - "かくとく", - "かざる", - "がぞう", - "かたい", - "かたち", - "がちょう", - "がっきゅう", - "がっこう", - "がっさん", - "がっしょう", - "かなざわし", - "かのう", - "がはく", - "かぶか", - "かほう", - "かほご", - "かまう", - "かまぼこ", - "かめれおん", - "かゆい", - "かようび", - "からい", - "かるい", - "かろう", - "かわく", - "かわら", - "がんか", - "かんけい", - "かんこう", - "かんしゃ", - "かんそう", - "かんたん", - "かんち", - "がんばる", - "きあい", - "きあつ", - "きいろ", - "ぎいん", - "きうい", - "きうん", - "きえる", - "きおう", - "きおく", - "きおち", - "きおん", - "きかい", - "きかく", - "きかんしゃ", - "ききて", - "きくばり", - "きくらげ", - "きけんせい", - "きこう", - "きこえる", - "きこく", - "きさい", - "きさく", - "きさま", - "きさらぎ", - "ぎじかがく", - "ぎしき", - "ぎじたいけん", - "ぎじにってい", - "ぎじゅつしゃ", - "きすう", - "きせい", - "きせき", - "きせつ", - "きそう", - "きぞく", - "きぞん", - "きたえる", - "きちょう", - "きつえん", - "ぎっちり", - "きつつき", - "きつね", - "きてい", - "きどう", - "きどく", - "きない", - "きなが", - "きなこ", - "きぬごし", - "きねん", - "きのう", - "きのした", - "きはく", - "きびしい", - "きひん", - "きふく", - "きぶん", - "きぼう", - "きほん", - "きまる", - "きみつ", - "きむずかしい", - "きめる", - "きもだめし", - "きもち", - "きもの", - "きゃく", - "きやく", - "ぎゅうにく", - "きよう", - "きょうりゅう", - "きらい", - "きらく", - "きりん", - "きれい", - "きれつ", - "きろく", - "ぎろん", - "きわめる", - "ぎんいろ", - "きんかくじ", - "きんじょ", - "きんようび", - "ぐあい", - "くいず", - "くうかん", - "くうき", - "くうぐん", - "くうこう", - "ぐうせい", - "くうそう", - "ぐうたら", - "くうふく", - "くうぼ", - "くかん", - "くきょう", - "くげん", - "ぐこう", - "くさい", - "くさき", - "くさばな", - "くさる", - "くしゃみ", - "くしょう", - "くすのき", - "くすりゆび", - "くせげ", - "くせん", - "ぐたいてき", - "くださる", - "くたびれる", - "くちこみ", - "くちさき", - "くつした", - "ぐっすり", - "くつろぐ", - "くとうてん", - "くどく", - "くなん", - "くねくね", - "くのう", - "くふう", - "くみあわせ", - "くみたてる", - "くめる", - "くやくしょ", - "くらす", - "くらべる", - "くるま", - "くれる", - "くろう", - "くわしい", - "ぐんかん", - "ぐんしょく", - "ぐんたい", - "ぐんて", - "けあな", - "けいかく", - "けいけん", - "けいこ", - "けいさつ", - "げいじゅつ", - "けいたい", - "げいのうじん", - "けいれき", - "けいろ", - "けおとす", - "けおりもの", - "げきか", - "げきげん", - "げきだん", - "げきちん", - "げきとつ", - "げきは", - "げきやく", - "げこう", - "げこくじょう", - "げざい", - "けさき", - "げざん", - "けしき", - "けしごむ", - "けしょう", - "げすと", - "けたば", - "けちゃっぷ", - "けちらす", - "けつあつ", - "けつい", - "けつえき", - "けっこん", - "けつじょ", - "けっせき", - "けってい", - "けつまつ", - "げつようび", - "げつれい", - "けつろん", - "げどく", - "けとばす", - "けとる", - "けなげ", - "けなす", - "けなみ", - "けぬき", - "げねつ", - "けねん", - "けはい", - "げひん", - "けぶかい", - "げぼく", - "けまり", - "けみかる", - "けむし", - "けむり", - "けもの", - "けらい", - "けろけろ", - "けわしい", - "けんい", - "けんえつ", - "けんお", - "けんか", - "げんき", - "けんげん", - "けんこう", - "けんさく", - "けんしゅう", - "けんすう", - "げんそう", - "けんちく", - "けんてい", - "けんとう", - "けんない", - "けんにん", - "げんぶつ", - "けんま", - "けんみん", - "けんめい", - "けんらん", - "けんり", - "こあくま", - "こいぬ", - "こいびと", - "ごうい", - "こうえん", - "こうおん", - "こうかん", - "ごうきゅう", - "ごうけい", - "こうこう", - "こうさい", - "こうじ", - "こうすい", - "ごうせい", - "こうそく", - "こうたい", - "こうちゃ", - "こうつう", - "こうてい", - "こうどう", - "こうない", - "こうはい", - "ごうほう", - "ごうまん", - "こうもく", - "こうりつ", - "こえる", - "こおり", - "ごかい", - "ごがつ", - "ごかん", - "こくご", - "こくさい", - "こくとう", - "こくない", - "こくはく", - "こぐま", - "こけい", - "こける", - "ここのか", - "こころ", - "こさめ", - "こしつ", - "こすう", - "こせい", - "こせき", - "こぜん", - "こそだて", - "こたい", - "こたえる", - "こたつ", - "こちょう", - "こっか", - "こつこつ", - "こつばん", - "こつぶ", - "こてい", - "こてん", - "ことがら", - "ことし", - "ことば", - "ことり", - "こなごな", - "こねこね", - "このまま", - "このみ", - "このよ", - "ごはん", - "こひつじ", - "こふう", - "こふん", - "こぼれる", - "ごまあぶら", - "こまかい", - "ごますり", - "こまつな", - "こまる", - "こむぎこ", - "こもじ", - "こもち", - "こもの", - "こもん", - "こやく", - "こやま", - "こゆう", - "こゆび", - "こよい", - "こよう", - "こりる", - "これくしょん", - "ころっけ", - "こわもて", - "こわれる", - "こんいん", - "こんかい", - "こんき", - "こんしゅう", - "こんすい", - "こんだて", - "こんとん", - "こんなん", - "こんびに", - "こんぽん", - "こんまけ", - "こんや", - "こんれい", - "こんわく", - "ざいえき", - "さいかい", - "さいきん", - "ざいげん", - "ざいこ", - "さいしょ", - "さいせい", - "ざいたく", - "ざいちゅう", - "さいてき", - "ざいりょう", - "さうな", - "さかいし", - "さがす", - "さかな", - "さかみち", - "さがる", - "さぎょう", - "さくし", - "さくひん", - "さくら", - "さこく", - "さこつ", - "さずかる", - "ざせき", - "さたん", - "さつえい", - "ざつおん", - "ざっか", - "ざつがく", - "さっきょく", - "ざっし", - "さつじん", - "ざっそう", - "さつたば", - "さつまいも", - "さてい", - "さといも", - "さとう", - "さとおや", - "さとし", - "さとる", - "さのう", - "さばく", - "さびしい", - "さべつ", - "さほう", - "さほど", - "さます", - "さみしい", - "さみだれ", - "さむけ", - "さめる", - "さやえんどう", - "さゆう", - "さよう", - "さよく", - "さらだ", - "ざるそば", - "さわやか", - "さわる", - "さんいん", - "さんか", - "さんきゃく", - "さんこう", - "さんさい", - "ざんしょ", - "さんすう", - "さんせい", - "さんそ", - "さんち", - "さんま", - "さんみ", - "さんらん", - "しあい", - "しあげ", - "しあさって", - "しあわせ", - "しいく", - "しいん", - "しうち", - "しえい", - "しおけ", - "しかい", - "しかく", - "じかん", - "しごと", - "しすう", - "じだい", - "したうけ", - "したぎ", - "したて", - "したみ", - "しちょう", - "しちりん", - "しっかり", - "しつじ", - "しつもん", - "してい", - "してき", - "してつ", - "じてん", - "じどう", - "しなぎれ", - "しなもの", - "しなん", - "しねま", - "しねん", - "しのぐ", - "しのぶ", - "しはい", - "しばかり", - "しはつ", - "しはらい", - "しはん", - "しひょう", - "しふく", - "じぶん", - "しへい", - "しほう", - "しほん", - "しまう", - "しまる", - "しみん", - "しむける", - "じむしょ", - "しめい", - "しめる", - "しもん", - "しゃいん", - "しゃうん", - "しゃおん", - "じゃがいも", - "しやくしょ", - "しゃくほう", - "しゃけん", - "しゃこ", - "しゃざい", - "しゃしん", - "しゃせん", - "しゃそう", - "しゃたい", - "しゃちょう", - "しゃっきん", - "じゃま", - "しゃりん", - "しゃれい", - "じゆう", - "じゅうしょ", - "しゅくはく", - "じゅしん", - "しゅっせき", - "しゅみ", - "しゅらば", - "じゅんばん", - "しょうかい", - "しょくたく", - "しょっけん", - "しょどう", - "しょもつ", - "しらせる", - "しらべる", - "しんか", - "しんこう", - "じんじゃ", - "しんせいじ", - "しんちく", - "しんりん", - "すあげ", - "すあし", - "すあな", - "ずあん", - "すいえい", - "すいか", - "すいとう", - "ずいぶん", - "すいようび", - "すうがく", - "すうじつ", - "すうせん", - "すおどり", - "すきま", - "すくう", - "すくない", - "すける", - "すごい", - "すこし", - "ずさん", - "すずしい", - "すすむ", - "すすめる", - "すっかり", - "ずっしり", - "ずっと", - "すてき", - "すてる", - "すねる", - "すのこ", - "すはだ", - "すばらしい", - "ずひょう", - "ずぶぬれ", - "すぶり", - "すふれ", - "すべて", - "すべる", - "ずほう", - "すぼん", - "すまい", - "すめし", - "すもう", - "すやき", - "すらすら", - "するめ", - "すれちがう", - "すろっと", - "すわる", - "すんぜん", - "すんぽう", - "せあぶら", - "せいかつ", - "せいげん", - "せいじ", - "せいよう", - "せおう", - "せかいかん", - "せきにん", - "せきむ", - "せきゆ", - "せきらんうん", - "せけん", - "せこう", - "せすじ", - "せたい", - "せたけ", - "せっかく", - "せっきゃく", - "ぜっく", - "せっけん", - "せっこつ", - "せっさたくま", - "せつぞく", - "せつだん", - "せつでん", - "せっぱん", - "せつび", - "せつぶん", - "せつめい", - "せつりつ", - "せなか", - "せのび", - "せはば", - "せびろ", - "せぼね", - "せまい", - "せまる", - "せめる", - "せもたれ", - "せりふ", - "ぜんあく", - "せんい", - "せんえい", - "せんか", - "せんきょ", - "せんく", - "せんげん", - "ぜんご", - "せんさい", - "せんしゅ", - "せんすい", - "せんせい", - "せんぞ", - "せんたく", - "せんちょう", - "せんてい", - "せんとう", - "せんぬき", - "せんねん", - "せんぱい", - "ぜんぶ", - "ぜんぽう", - "せんむ", - "せんめんじょ", - "せんもん", - "せんやく", - "せんゆう", - "せんよう", - "ぜんら", - "ぜんりゃく", - "せんれい", - "せんろ", - "そあく", - "そいとげる", - "そいね", - "そうがんきょう", - "そうき", - "そうご", - "そうしん", - "そうだん", - "そうなん", - "そうび", - "そうめん", - "そうり", - "そえもの", - "そえん", - "そがい", - "そげき", - "そこう", - "そこそこ", - "そざい", - "そしな", - "そせい", - "そせん", - "そそぐ", - "そだてる", - "そつう", - "そつえん", - "そっかん", - "そつぎょう", - "そっけつ", - "そっこう", - "そっせん", - "そっと", - "そとがわ", - "そとづら", - "そなえる", - "そなた", - "そふぼ", - "そぼく", - "そぼろ", - "そまつ", - "そまる", - "そむく", - "そむりえ", - "そめる", - "そもそも", - "そよかぜ", - "そらまめ", - "そろう", - "そんかい", - "そんけい", - "そんざい", - "そんしつ", - "そんぞく", - "そんちょう", - "ぞんび", - "ぞんぶん", - "そんみん", - "たあい", - "たいいん", - "たいうん", - "たいえき", - "たいおう", - "だいがく", - "たいき", - "たいぐう", - "たいけん", - "たいこ", - "たいざい", - "だいじょうぶ", - "だいすき", - "たいせつ", - "たいそう", - "だいたい", - "たいちょう", - "たいてい", - "だいどころ", - "たいない", - "たいねつ", - "たいのう", - "たいはん", - "だいひょう", - "たいふう", - "たいへん", - "たいほ", - "たいまつばな", - "たいみんぐ", - "たいむ", - "たいめん", - "たいやき", - "たいよう", - "たいら", - "たいりょく", - "たいる", - "たいわん", - "たうえ", - "たえる", - "たおす", - "たおる", - "たおれる", - "たかい", - "たかね", - "たきび", - "たくさん", - "たこく", - "たこやき", - "たさい", - "たしざん", - "だじゃれ", - "たすける", - "たずさわる", - "たそがれ", - "たたかう", - "たたく", - "ただしい", - "たたみ", - "たちばな", - "だっかい", - "だっきゃく", - "だっこ", - "だっしゅつ", - "だったい", - "たてる", - "たとえる", - "たなばた", - "たにん", - "たぬき", - "たのしみ", - "たはつ", - "たぶん", - "たべる", - "たぼう", - "たまご", - "たまる", - "だむる", - "ためいき", - "ためす", - "ためる", - "たもつ", - "たやすい", - "たよる", - "たらす", - "たりきほんがん", - "たりょう", - "たりる", - "たると", - "たれる", - "たれんと", - "たろっと", - "たわむれる", - "だんあつ", - "たんい", - "たんおん", - "たんか", - "たんき", - "たんけん", - "たんご", - "たんさん", - "たんじょうび", - "だんせい", - "たんそく", - "たんたい", - "だんち", - "たんてい", - "たんとう", - "だんな", - "たんにん", - "だんねつ", - "たんのう", - "たんぴん", - "だんぼう", - "たんまつ", - "たんめい", - "だんれつ", - "だんろ", - "だんわ", - "ちあい", - "ちあん", - "ちいき", - "ちいさい", - "ちえん", - "ちかい", - "ちから", - "ちきゅう", - "ちきん", - "ちけいず", - "ちけん", - "ちこく", - "ちさい", - "ちしき", - "ちしりょう", - "ちせい", - "ちそう", - "ちたい", - "ちたん", - "ちちおや", - "ちつじょ", - "ちてき", - "ちてん", - "ちぬき", - "ちぬり", - "ちのう", - "ちひょう", - "ちへいせん", - "ちほう", - "ちまた", - "ちみつ", - "ちみどろ", - "ちめいど", - "ちゃんこなべ", - "ちゅうい", - "ちゆりょく", - "ちょうし", - "ちょさくけん", - "ちらし", - "ちらみ", - "ちりがみ", - "ちりょう", - "ちるど", - "ちわわ", - "ちんたい", - "ちんもく", - "ついか", - "ついたち", - "つうか", - "つうじょう", - "つうはん", - "つうわ", - "つかう", - "つかれる", - "つくね", - "つくる", - "つけね", - "つける", - "つごう", - "つたえる", - "つづく", - "つつじ", - "つつむ", - "つとめる", - "つながる", - "つなみ", - "つねづね", - "つのる", - "つぶす", - "つまらない", - "つまる", - "つみき", - "つめたい", - "つもり", - "つもる", - "つよい", - "つるぼ", - "つるみく", - "つわもの", - "つわり", - "てあし", - "てあて", - "てあみ", - "ていおん", - "ていか", - "ていき", - "ていけい", - "ていこく", - "ていさつ", - "ていし", - "ていせい", - "ていたい", - "ていど", - "ていねい", - "ていひょう", - "ていへん", - "ていぼう", - "てうち", - "ておくれ", - "てきとう", - "てくび", - "でこぼこ", - "てさぎょう", - "てさげ", - "てすり", - "てそう", - "てちがい", - "てちょう", - "てつがく", - "てつづき", - "でっぱ", - "てつぼう", - "てつや", - "でぬかえ", - "てぬき", - "てぬぐい", - "てのひら", - "てはい", - "てぶくろ", - "てふだ", - "てほどき", - "てほん", - "てまえ", - "てまきずし", - "てみじか", - "てみやげ", - "てらす", - "てれび", - "てわけ", - "てわたし", - "でんあつ", - "てんいん", - "てんかい", - "てんき", - "てんぐ", - "てんけん", - "てんごく", - "てんさい", - "てんし", - "てんすう", - "でんち", - "てんてき", - "てんとう", - "てんない", - "てんぷら", - "てんぼうだい", - "てんめつ", - "てんらんかい", - "でんりょく", - "でんわ", - "どあい", - "といれ", - "どうかん", - "とうきゅう", - "どうぐ", - "とうし", - "とうむぎ", - "とおい", - "とおか", - "とおく", - "とおす", - "とおる", - "とかい", - "とかす", - "ときおり", - "ときどき", - "とくい", - "とくしゅう", - "とくてん", - "とくに", - "とくべつ", - "とけい", - "とける", - "とこや", - "とさか", - "としょかん", - "とそう", - "とたん", - "とちゅう", - "とっきゅう", - "とっくん", - "とつぜん", - "とつにゅう", - "とどける", - "ととのえる", - "とない", - "となえる", - "となり", - "とのさま", - "とばす", - "どぶがわ", - "とほう", - "とまる", - "とめる", - "ともだち", - "ともる", - "どようび", - "とらえる", - "とんかつ", - "どんぶり", - "ないかく", - "ないこう", - "ないしょ", - "ないす", - "ないせん", - "ないそう", - "なおす", - "ながい", - "なくす", - "なげる", - "なこうど", - "なさけ", - "なたでここ", - "なっとう", - "なつやすみ", - "ななおし", - "なにごと", - "なにもの", - "なにわ", - "なのか", - "なふだ", - "なまいき", - "なまえ", - "なまみ", - "なみだ", - "なめらか", - "なめる", - "なやむ", - "ならう", - "ならび", - "ならぶ", - "なれる", - "なわとび", - "なわばり", - "にあう", - "にいがた", - "にうけ", - "におい", - "にかい", - "にがて", - "にきび", - "にくしみ", - "にくまん", - "にげる", - "にさんかたんそ", - "にしき", - "にせもの", - "にちじょう", - "にちようび", - "にっか", - "にっき", - "にっけい", - "にっこう", - "にっさん", - "にっしょく", - "にっすう", - "にっせき", - "にってい", - "になう", - "にほん", - "にまめ", - "にもつ", - "にやり", - "にゅういん", - "にりんしゃ", - "にわとり", - "にんい", - "にんか", - "にんき", - "にんげん", - "にんしき", - "にんずう", - "にんそう", - "にんたい", - "にんち", - "にんてい", - "にんにく", - "にんぷ", - "にんまり", - "にんむ", - "にんめい", - "にんよう", - "ぬいくぎ", - "ぬかす", - "ぬぐいとる", - "ぬぐう", - "ぬくもり", - "ぬすむ", - "ぬまえび", - "ぬめり", - "ぬらす", - "ぬんちゃく", - "ねあげ", - "ねいき", - "ねいる", - "ねいろ", - "ねぐせ", - "ねくたい", - "ねくら", - "ねこぜ", - "ねこむ", - "ねさげ", - "ねすごす", - "ねそべる", - "ねだん", - "ねつい", - "ねっしん", - "ねつぞう", - "ねったいぎょ", - "ねぶそく", - "ねふだ", - "ねぼう", - "ねほりはほり", - "ねまき", - "ねまわし", - "ねみみ", - "ねむい", - "ねむたい", - "ねもと", - "ねらう", - "ねわざ", - "ねんいり", - "ねんおし", - "ねんかん", - "ねんきん", - "ねんぐ", - "ねんざ", - "ねんし", - "ねんちゃく", - "ねんど", - "ねんぴ", - "ねんぶつ", - "ねんまつ", - "ねんりょう", - "ねんれい", - "のいず", - "のおづま", - "のがす", - "のきなみ", - "のこぎり", - "のこす", - "のこる", - "のせる", - "のぞく", - "のぞむ", - "のたまう", - "のちほど", - "のっく", - "のばす", - "のはら", - "のべる", - "のぼる", - "のみもの", - "のやま", - "のらいぬ", - "のらねこ", - "のりもの", - "のりゆき", - "のれん", - "のんき", - "ばあい", - "はあく", - "ばあさん", - "ばいか", - "ばいく", - "はいけん", - "はいご", - "はいしん", - "はいすい", - "はいせん", - "はいそう", - "はいち", - "ばいばい", - "はいれつ", - "はえる", - "はおる", - "はかい", - "ばかり", - "はかる", - "はくしゅ", - "はけん", - "はこぶ", - "はさみ", - "はさん", - "はしご", - "ばしょ", - "はしる", - "はせる", - "ぱそこん", - "はそん", - "はたん", - "はちみつ", - "はつおん", - "はっかく", - "はづき", - "はっきり", - "はっくつ", - "はっけん", - "はっこう", - "はっさん", - "はっしん", - "はったつ", - "はっちゅう", - "はってん", - "はっぴょう", - "はっぽう", - "はなす", - "はなび", - "はにかむ", - "はぶらし", - "はみがき", - "はむかう", - "はめつ", - "はやい", - "はやし", - "はらう", - "はろうぃん", - "はわい", - "はんい", - "はんえい", - "はんおん", - "はんかく", - "はんきょう", - "ばんぐみ", - "はんこ", - "はんしゃ", - "はんすう", - "はんだん", - "ぱんち", - "ぱんつ", - "はんてい", - "はんとし", - "はんのう", - "はんぱ", - "はんぶん", - "はんぺん", - "はんぼうき", - "はんめい", - "はんらん", - "はんろん", - "ひいき", - "ひうん", - "ひえる", - "ひかく", - "ひかり", - "ひかる", - "ひかん", - "ひくい", - "ひけつ", - "ひこうき", - "ひこく", - "ひさい", - "ひさしぶり", - "ひさん", - "びじゅつかん", - "ひしょ" - ]; -} \ No newline at end of file diff --git a/lib/monero/mnemonics/portuguese.dart b/lib/monero/mnemonics/portuguese.dart deleted file mode 100644 index bdd63d3b2..000000000 --- a/lib/monero/mnemonics/portuguese.dart +++ /dev/null @@ -1,1630 +0,0 @@ -class PortugueseMnemonics { - static const words = [ - "abaular", - "abdominal", - "abeto", - "abissinio", - "abjeto", - "ablucao", - "abnegar", - "abotoar", - "abrutalhar", - "absurdo", - "abutre", - "acautelar", - "accessorios", - "acetona", - "achocolatado", - "acirrar", - "acne", - "acovardar", - "acrostico", - "actinomicete", - "acustico", - "adaptavel", - "adeus", - "adivinho", - "adjunto", - "admoestar", - "adnominal", - "adotivo", - "adquirir", - "adriatico", - "adsorcao", - "adutora", - "advogar", - "aerossol", - "afazeres", - "afetuoso", - "afixo", - "afluir", - "afortunar", - "afrouxar", - "aftosa", - "afunilar", - "agentes", - "agito", - "aglutinar", - "aiatola", - "aimore", - "aino", - "aipo", - "airoso", - "ajeitar", - "ajoelhar", - "ajudante", - "ajuste", - "alazao", - "albumina", - "alcunha", - "alegria", - "alexandre", - "alforriar", - "alguns", - "alhures", - "alivio", - "almoxarife", - "alotropico", - "alpiste", - "alquimista", - "alsaciano", - "altura", - "aluviao", - "alvura", - "amazonico", - "ambulatorio", - "ametodico", - "amizades", - "amniotico", - "amovivel", - "amurada", - "anatomico", - "ancorar", - "anexo", - "anfora", - "aniversario", - "anjo", - "anotar", - "ansioso", - "anturio", - "anuviar", - "anverso", - "anzol", - "aonde", - "apaziguar", - "apito", - "aplicavel", - "apoteotico", - "aprimorar", - "aprumo", - "apto", - "apuros", - "aquoso", - "arauto", - "arbusto", - "arduo", - "aresta", - "arfar", - "arguto", - "aritmetico", - "arlequim", - "armisticio", - "aromatizar", - "arpoar", - "arquivo", - "arrumar", - "arsenio", - "arturiano", - "aruaque", - "arvores", - "asbesto", - "ascorbico", - "aspirina", - "asqueroso", - "assustar", - "astuto", - "atazanar", - "ativo", - "atletismo", - "atmosferico", - "atormentar", - "atroz", - "aturdir", - "audivel", - "auferir", - "augusto", - "aula", - "aumento", - "aurora", - "autuar", - "avatar", - "avexar", - "avizinhar", - "avolumar", - "avulso", - "axiomatico", - "azerbaijano", - "azimute", - "azoto", - "azulejo", - "bacteriologista", - "badulaque", - "baforada", - "baixote", - "bajular", - "balzaquiana", - "bambuzal", - "banzo", - "baoba", - "baqueta", - "barulho", - "bastonete", - "batuta", - "bauxita", - "bavaro", - "bazuca", - "bcrepuscular", - "beato", - "beduino", - "begonia", - "behaviorista", - "beisebol", - "belzebu", - "bemol", - "benzido", - "beocio", - "bequer", - "berro", - "besuntar", - "betume", - "bexiga", - "bezerro", - "biatlon", - "biboca", - "bicuspide", - "bidirecional", - "bienio", - "bifurcar", - "bigorna", - "bijuteria", - "bimotor", - "binormal", - "bioxido", - "bipolarizacao", - "biquini", - "birutice", - "bisturi", - "bituca", - "biunivoco", - "bivalve", - "bizarro", - "blasfemo", - "blenorreia", - "blindar", - "bloqueio", - "blusao", - "boazuda", - "bofete", - "bojudo", - "bolso", - "bombordo", - "bonzo", - "botina", - "boquiaberto", - "bostoniano", - "botulismo", - "bourbon", - "bovino", - "boximane", - "bravura", - "brevidade", - "britar", - "broxar", - "bruno", - "bruxuleio", - "bubonico", - "bucolico", - "buda", - "budista", - "bueiro", - "buffer", - "bugre", - "bujao", - "bumerangue", - "burundines", - "busto", - "butique", - "buzios", - "caatinga", - "cabuqui", - "cacunda", - "cafuzo", - "cajueiro", - "camurca", - "canudo", - "caquizeiro", - "carvoeiro", - "casulo", - "catuaba", - "cauterizar", - "cebolinha", - "cedula", - "ceifeiro", - "celulose", - "cerzir", - "cesto", - "cetro", - "ceus", - "cevar", - "chavena", - "cheroqui", - "chita", - "chovido", - "chuvoso", - "ciatico", - "cibernetico", - "cicuta", - "cidreira", - "cientistas", - "cifrar", - "cigarro", - "cilio", - "cimo", - "cinzento", - "cioso", - "cipriota", - "cirurgico", - "cisto", - "citrico", - "ciumento", - "civismo", - "clavicula", - "clero", - "clitoris", - "cluster", - "coaxial", - "cobrir", - "cocota", - "codorniz", - "coexistir", - "cogumelo", - "coito", - "colusao", - "compaixao", - "comutativo", - "contentamento", - "convulsivo", - "coordenativa", - "coquetel", - "correto", - "corvo", - "costureiro", - "cotovia", - "covil", - "cozinheiro", - "cretino", - "cristo", - "crivo", - "crotalo", - "cruzes", - "cubo", - "cucuia", - "cueiro", - "cuidar", - "cujo", - "cultural", - "cunilingua", - "cupula", - "curvo", - "custoso", - "cutucar", - "czarismo", - "dablio", - "dacota", - "dados", - "daguerreotipo", - "daiquiri", - "daltonismo", - "damista", - "dantesco", - "daquilo", - "darwinista", - "dasein", - "dativo", - "deao", - "debutantes", - "decurso", - "deduzir", - "defunto", - "degustar", - "dejeto", - "deltoide", - "demover", - "denunciar", - "deputado", - "deque", - "dervixe", - "desvirtuar", - "deturpar", - "deuteronomio", - "devoto", - "dextrose", - "dezoito", - "diatribe", - "dicotomico", - "didatico", - "dietista", - "difuso", - "digressao", - "diluvio", - "diminuto", - "dinheiro", - "dinossauro", - "dioxido", - "diplomatico", - "dique", - "dirimivel", - "disturbio", - "diurno", - "divulgar", - "dizivel", - "doar", - "dobro", - "docura", - "dodoi", - "doer", - "dogue", - "doloso", - "domo", - "donzela", - "doping", - "dorsal", - "dossie", - "dote", - "doutro", - "doze", - "dravidico", - "dreno", - "driver", - "dropes", - "druso", - "dubnio", - "ducto", - "dueto", - "dulija", - "dundum", - "duodeno", - "duquesa", - "durou", - "duvidoso", - "duzia", - "ebano", - "ebrio", - "eburneo", - "echarpe", - "eclusa", - "ecossistema", - "ectoplasma", - "ecumenismo", - "eczema", - "eden", - "editorial", - "edredom", - "edulcorar", - "efetuar", - "efigie", - "efluvio", - "egiptologo", - "egresso", - "egua", - "einsteiniano", - "eira", - "eivar", - "eixos", - "ejetar", - "elastomero", - "eldorado", - "elixir", - "elmo", - "eloquente", - "elucidativo", - "emaranhar", - "embutir", - "emerito", - "emfa", - "emitir", - "emotivo", - "empuxo", - "emulsao", - "enamorar", - "encurvar", - "enduro", - "enevoar", - "enfurnar", - "enguico", - "enho", - "enigmista", - "enlutar", - "enormidade", - "enpreendimento", - "enquanto", - "enriquecer", - "enrugar", - "entusiastico", - "enunciar", - "envolvimento", - "enxuto", - "enzimatico", - "eolico", - "epiteto", - "epoxi", - "epura", - "equivoco", - "erario", - "erbio", - "ereto", - "erguido", - "erisipela", - "ermo", - "erotizar", - "erros", - "erupcao", - "ervilha", - "esburacar", - "escutar", - "esfuziante", - "esguio", - "esloveno", - "esmurrar", - "esoterismo", - "esperanca", - "espirito", - "espurio", - "essencialmente", - "esturricar", - "esvoacar", - "etario", - "eterno", - "etiquetar", - "etnologo", - "etos", - "etrusco", - "euclidiano", - "euforico", - "eugenico", - "eunuco", - "europio", - "eustaquio", - "eutanasia", - "evasivo", - "eventualidade", - "evitavel", - "evoluir", - "exaustor", - "excursionista", - "exercito", - "exfoliado", - "exito", - "exotico", - "expurgo", - "exsudar", - "extrusora", - "exumar", - "fabuloso", - "facultativo", - "fado", - "fagulha", - "faixas", - "fajuto", - "faltoso", - "famoso", - "fanzine", - "fapesp", - "faquir", - "fartura", - "fastio", - "faturista", - "fausto", - "favorito", - "faxineira", - "fazer", - "fealdade", - "febril", - "fecundo", - "fedorento", - "feerico", - "feixe", - "felicidade", - "felpudo", - "feltro", - "femur", - "fenotipo", - "fervura", - "festivo", - "feto", - "feudo", - "fevereiro", - "fezinha", - "fiasco", - "fibra", - "ficticio", - "fiduciario", - "fiesp", - "fifa", - "figurino", - "fijiano", - "filtro", - "finura", - "fiorde", - "fiquei", - "firula", - "fissurar", - "fitoteca", - "fivela", - "fixo", - "flavio", - "flexor", - "flibusteiro", - "flotilha", - "fluxograma", - "fobos", - "foco", - "fofura", - "foguista", - "foie", - "foliculo", - "fominha", - "fonte", - "forum", - "fosso", - "fotossintese", - "foxtrote", - "fraudulento", - "frevo", - "frivolo", - "frouxo", - "frutose", - "fuba", - "fucsia", - "fugitivo", - "fuinha", - "fujao", - "fulustreco", - "fumo", - "funileiro", - "furunculo", - "fustigar", - "futurologo", - "fuxico", - "fuzue", - "gabriel", - "gado", - "gaelico", - "gafieira", - "gaguejo", - "gaivota", - "gajo", - "galvanoplastico", - "gamo", - "ganso", - "garrucha", - "gastronomo", - "gatuno", - "gaussiano", - "gaviao", - "gaxeta", - "gazeteiro", - "gear", - "geiser", - "geminiano", - "generoso", - "genuino", - "geossinclinal", - "gerundio", - "gestual", - "getulista", - "gibi", - "gigolo", - "gilete", - "ginseng", - "giroscopio", - "glaucio", - "glacial", - "gleba", - "glifo", - "glote", - "glutonia", - "gnostico", - "goela", - "gogo", - "goitaca", - "golpista", - "gomo", - "gonzo", - "gorro", - "gostou", - "goticula", - "gourmet", - "governo", - "gozo", - "graxo", - "grevista", - "grito", - "grotesco", - "gruta", - "guaxinim", - "gude", - "gueto", - "guizo", - "guloso", - "gume", - "guru", - "gustativo", - "grelhado", - "gutural", - "habitue", - "haitiano", - "halterofilista", - "hamburguer", - "hanseniase", - "happening", - "harpista", - "hastear", - "haveres", - "hebreu", - "hectometro", - "hedonista", - "hegira", - "helena", - "helminto", - "hemorroidas", - "henrique", - "heptassilabo", - "hertziano", - "hesitar", - "heterossexual", - "heuristico", - "hexagono", - "hiato", - "hibrido", - "hidrostatico", - "hieroglifo", - "hifenizar", - "higienizar", - "hilario", - "himen", - "hino", - "hippie", - "hirsuto", - "historiografia", - "hitlerista", - "hodometro", - "hoje", - "holograma", - "homus", - "honroso", - "hoquei", - "horto", - "hostilizar", - "hotentote", - "huguenote", - "humilde", - "huno", - "hurra", - "hutu", - "iaia", - "ialorixa", - "iambico", - "iansa", - "iaque", - "iara", - "iatista", - "iberico", - "ibis", - "icar", - "iceberg", - "icosagono", - "idade", - "ideologo", - "idiotice", - "idoso", - "iemenita", - "iene", - "igarape", - "iglu", - "ignorar", - "igreja", - "iguaria", - "iidiche", - "ilativo", - "iletrado", - "ilharga", - "ilimitado", - "ilogismo", - "ilustrissimo", - "imaturo", - "imbuzeiro", - "imerso", - "imitavel", - "imovel", - "imputar", - "imutavel", - "inaveriguavel", - "incutir", - "induzir", - "inextricavel", - "infusao", - "ingua", - "inhame", - "iniquo", - "injusto", - "inning", - "inoxidavel", - "inquisitorial", - "insustentavel", - "intumescimento", - "inutilizavel", - "invulneravel", - "inzoneiro", - "iodo", - "iogurte", - "ioio", - "ionosfera", - "ioruba", - "iota", - "ipsilon", - "irascivel", - "iris", - "irlandes", - "irmaos", - "iroques", - "irrupcao", - "isca", - "isento", - "islandes", - "isotopo", - "isqueiro", - "israelita", - "isso", - "isto", - "iterbio", - "itinerario", - "itrio", - "iuane", - "iugoslavo", - "jabuticabeira", - "jacutinga", - "jade", - "jagunco", - "jainista", - "jaleco", - "jambo", - "jantarada", - "japones", - "jaqueta", - "jarro", - "jasmim", - "jato", - "jaula", - "javel", - "jazz", - "jegue", - "jeitoso", - "jejum", - "jenipapo", - "jeova", - "jequitiba", - "jersei", - "jesus", - "jetom", - "jiboia", - "jihad", - "jilo", - "jingle", - "jipe", - "jocoso", - "joelho", - "joguete", - "joio", - "jojoba", - "jorro", - "jota", - "joule", - "joviano", - "jubiloso", - "judoca", - "jugular", - "juizo", - "jujuba", - "juliano", - "jumento", - "junto", - "jururu", - "justo", - "juta", - "juventude", - "labutar", - "laguna", - "laico", - "lajota", - "lanterninha", - "lapso", - "laquear", - "lastro", - "lauto", - "lavrar", - "laxativo", - "lazer", - "leasing", - "lebre", - "lecionar", - "ledo", - "leguminoso", - "leitura", - "lele", - "lemure", - "lento", - "leonardo", - "leopardo", - "lepton", - "leque", - "leste", - "letreiro", - "leucocito", - "levitico", - "lexicologo", - "lhama", - "lhufas", - "liame", - "licoroso", - "lidocaina", - "liliputiano", - "limusine", - "linotipo", - "lipoproteina", - "liquidos", - "lirismo", - "lisura", - "liturgico", - "livros", - "lixo", - "lobulo", - "locutor", - "lodo", - "logro", - "lojista", - "lombriga", - "lontra", - "loop", - "loquaz", - "lorota", - "losango", - "lotus", - "louvor", - "luar", - "lubrificavel", - "lucros", - "lugubre", - "luis", - "luminoso", - "luneta", - "lustroso", - "luto", - "luvas", - "luxuriante", - "luzeiro", - "maduro", - "maestro", - "mafioso", - "magro", - "maiuscula", - "majoritario", - "malvisto", - "mamute", - "manutencao", - "mapoteca", - "maquinista", - "marzipa", - "masturbar", - "matuto", - "mausoleu", - "mavioso", - "maxixe", - "mazurca", - "meandro", - "mecha", - "medusa", - "mefistofelico", - "megera", - "meirinho", - "melro", - "memorizar", - "menu", - "mequetrefe", - "mertiolate", - "mestria", - "metroviario", - "mexilhao", - "mezanino", - "miau", - "microssegundo", - "midia", - "migratorio", - "mimosa", - "minuto", - "miosotis", - "mirtilo", - "misturar", - "mitzvah", - "miudos", - "mixuruca", - "mnemonico", - "moagem", - "mobilizar", - "modulo", - "moer", - "mofo", - "mogno", - "moita", - "molusco", - "monumento", - "moqueca", - "morubixaba", - "mostruario", - "motriz", - "mouse", - "movivel", - "mozarela", - "muarra", - "muculmano", - "mudo", - "mugir", - "muitos", - "mumunha", - "munir", - "muon", - "muquira", - "murros", - "musselina", - "nacoes", - "nado", - "naftalina", - "nago", - "naipe", - "naja", - "nalgum", - "namoro", - "nanquim", - "napolitano", - "naquilo", - "nascimento", - "nautilo", - "navios", - "nazista", - "nebuloso", - "nectarina", - "nefrologo", - "negus", - "nelore", - "nenufar", - "nepotismo", - "nervura", - "neste", - "netuno", - "neutron", - "nevoeiro", - "newtoniano", - "nexo", - "nhenhenhem", - "nhoque", - "nigeriano", - "niilista", - "ninho", - "niobio", - "niponico", - "niquelar", - "nirvana", - "nisto", - "nitroglicerina", - "nivoso", - "nobreza", - "nocivo", - "noel", - "nogueira", - "noivo", - "nojo", - "nominativo", - "nonuplo", - "noruegues", - "nostalgico", - "noturno", - "nouveau", - "nuanca", - "nublar", - "nucleotideo", - "nudista", - "nulo", - "numismatico", - "nunquinha", - "nupcias", - "nutritivo", - "nuvens", - "oasis", - "obcecar", - "obeso", - "obituario", - "objetos", - "oblongo", - "obnoxio", - "obrigatorio", - "obstruir", - "obtuso", - "obus", - "obvio", - "ocaso", - "occipital", - "oceanografo", - "ocioso", - "oclusivo", - "ocorrer", - "ocre", - "octogono", - "odalisca", - "odisseia", - "odorifico", - "oersted", - "oeste", - "ofertar", - "ofidio", - "oftalmologo", - "ogiva", - "ogum", - "oigale", - "oitavo", - "oitocentos", - "ojeriza", - "olaria", - "oleoso", - "olfato", - "olhos", - "oliveira", - "olmo", - "olor", - "olvidavel", - "ombudsman", - "omeleteira", - "omitir", - "omoplata", - "onanismo", - "ondular", - "oneroso", - "onomatopeico", - "ontologico", - "onus", - "onze", - "opalescente", - "opcional", - "operistico", - "opio", - "oposto", - "oprobrio", - "optometrista", - "opusculo", - "oratorio", - "orbital", - "orcar", - "orfao", - "orixa", - "orla", - "ornitologo", - "orquidea", - "ortorrombico", - "orvalho", - "osculo", - "osmotico", - "ossudo", - "ostrogodo", - "otario", - "otite", - "ouro", - "ousar", - "outubro", - "ouvir", - "ovario", - "overnight", - "oviparo", - "ovni", - "ovoviviparo", - "ovulo", - "oxala", - "oxente", - "oxiuro", - "oxossi", - "ozonizar", - "paciente", - "pactuar", - "padronizar", - "paete", - "pagodeiro", - "paixao", - "pajem", - "paludismo", - "pampas", - "panturrilha", - "papudo", - "paquistanes", - "pastoso", - "patua", - "paulo", - "pauzinhos", - "pavoroso", - "paxa", - "pazes", - "peao", - "pecuniario", - "pedunculo", - "pegaso", - "peixinho", - "pejorativo", - "pelvis", - "penuria", - "pequno", - "petunia", - "pezada", - "piauiense", - "pictorico", - "pierro", - "pigmeu", - "pijama", - "pilulas", - "pimpolho", - "pintura", - "piorar", - "pipocar", - "piqueteiro", - "pirulito", - "pistoleiro", - "pituitaria", - "pivotar", - "pixote", - "pizzaria", - "plistoceno", - "plotar", - "pluviometrico", - "pneumonico", - "poco", - "podridao", - "poetisa", - "pogrom", - "pois", - "polvorosa", - "pomposo", - "ponderado", - "pontudo", - "populoso", - "poquer", - "porvir", - "posudo", - "potro", - "pouso", - "povoar", - "prazo", - "prezar", - "privilegios", - "proximo", - "prussiano", - "pseudopode", - "psoriase", - "pterossauros", - "ptialina", - "ptolemaico", - "pudor", - "pueril", - "pufe", - "pugilista", - "puir", - "pujante", - "pulverizar", - "pumba", - "punk", - "purulento", - "pustula", - "putsch", - "puxe", - "quatrocentos", - "quetzal", - "quixotesco", - "quotizavel", - "rabujice", - "racista", - "radonio", - "rafia", - "ragu", - "rajado", - "ralo", - "rampeiro", - "ranzinza", - "raptor", - "raquitismo", - "raro", - "rasurar", - "ratoeira", - "ravioli", - "razoavel", - "reavivar", - "rebuscar", - "recusavel", - "reduzivel", - "reexposicao", - "refutavel", - "regurgitar", - "reivindicavel", - "rejuvenescimento", - "relva", - "remuneravel", - "renunciar", - "reorientar", - "repuxo", - "requisito", - "resumo", - "returno", - "reutilizar", - "revolvido", - "rezonear", - "riacho", - "ribossomo", - "ricota", - "ridiculo", - "rifle", - "rigoroso", - "rijo", - "rimel", - "rins", - "rios", - "riqueza", - "respeito", - "rissole", - "ritualistico", - "rivalizar", - "rixa", - "robusto", - "rococo", - "rodoviario", - "roer", - "rogo", - "rojao", - "rolo", - "rompimento", - "ronronar", - "roqueiro", - "rorqual", - "rosto", - "rotundo", - "rouxinol", - "roxo", - "royal", - "ruas", - "rucula", - "rudimentos", - "ruela", - "rufo", - "rugoso", - "ruivo", - "rule", - "rumoroso", - "runico", - "ruptura", - "rural", - "rustico", - "rutilar", - "saariano", - "sabujo", - "sacudir", - "sadomasoquista", - "safra", - "sagui", - "sais", - "samurai", - "santuario", - "sapo", - "saquear", - "sartriano", - "saturno", - "saude", - "sauva", - "saveiro", - "saxofonista", - "sazonal", - "scherzo", - "script", - "seara", - "seborreia", - "secura", - "seduzir", - "sefardim", - "seguro", - "seja", - "selvas", - "sempre", - "senzala", - "sepultura", - "sequoia", - "sestercio", - "setuplo", - "seus", - "seviciar", - "sezonismo", - "shalom", - "siames", - "sibilante", - "sicrano", - "sidra", - "sifilitico", - "signos", - "silvo", - "simultaneo", - "sinusite", - "sionista", - "sirio", - "sisudo", - "situar", - "sivan", - "slide", - "slogan", - "soar", - "sobrio", - "socratico", - "sodomizar", - "soerguer", - "software", - "sogro", - "soja", - "solver", - "somente", - "sonso", - "sopro", - "soquete", - "sorveteiro", - "sossego", - "soturno", - "sousafone", - "sovinice", - "sozinho", - "suavizar", - "subverter", - "sucursal", - "sudoriparo", - "sufragio", - "sugestoes", - "suite", - "sujo", - "sultao", - "sumula", - "suntuoso", - "suor", - "supurar", - "suruba", - "susto", - "suturar", - "suvenir", - "tabuleta", - "taco", - "tadjique", - "tafeta", - "tagarelice", - "taitiano", - "talvez", - "tampouco", - "tanzaniano", - "taoista", - "tapume", - "taquion", - "tarugo", - "tascar", - "tatuar", - "tautologico", - "tavola", - "taxionomista", - "tchecoslovaco", - "teatrologo", - "tectonismo", - "tedioso", - "teflon", - "tegumento", - "teixo", - "telurio", - "temporas", - "tenue", - "teosofico", - "tepido", - "tequila", - "terrorista", - "testosterona", - "tetrico", - "teutonico", - "teve", - "texugo", - "tiara", - "tibia", - "tiete", - "tifoide", - "tigresa", - "tijolo", - "tilintar", - "timpano", - "tintureiro", - "tiquete", - "tiroteio", - "tisico", - "titulos", - "tive", - "toar", - "toboga", - "tofu", - "togoles", - "toicinho", - "tolueno", - "tomografo", - "tontura", - "toponimo", - "toquio", - "torvelinho", - "tostar", - "toto", - "touro", - "toxina", - "trazer", - "trezentos", - "trivialidade", - "trovoar", - "truta", - "tuaregue", - "tubular", - "tucano", - "tudo", - "tufo", - "tuiste", - "tulipa", - "tumultuoso", - "tunisino", - "tupiniquim", - "turvo", - "tutu", - "ucraniano", - "udenista", - "ufanista", - "ufologo", - "ugaritico", - "uiste", - "uivo", - "ulceroso", - "ulema", - "ultravioleta", - "umbilical", - "umero", - "umido", - "umlaut", - "unanimidade", - "unesco", - "ungulado", - "unheiro", - "univoco", - "untuoso", - "urano", - "urbano", - "urdir", - "uretra", - "urgente", - "urinol", - "urna", - "urologo", - "urro", - "ursulina", - "urtiga", - "urupe", - "usavel", - "usbeque", - "usei", - "usineiro", - "usurpar", - "utero", - "utilizar", - "utopico", - "uvular", - "uxoricidio", - "vacuo", - "vadio", - "vaguear", - "vaivem", - "valvula", - "vampiro", - "vantajoso", - "vaporoso", - "vaquinha", - "varziano", - "vasto", - "vaticinio", - "vaudeville", - "vazio", - "veado", - "vedico", - "veemente", - "vegetativo", - "veio", - "veja", - "veludo", - "venusiano", - "verdade", - "verve", - "vestuario", - "vetusto", - "vexatorio", - "vezes", - "viavel", - "vibratorio", - "victor", - "vicunha", - "vidros", - "vietnamita", - "vigoroso", - "vilipendiar", - "vime", - "vintem", - "violoncelo", - "viquingue", - "virus", - "visualizar", - "vituperio", - "viuvo", - "vivo", - "vizir", - "voar", - "vociferar", - "vodu", - "vogar", - "voile", - "volver", - "vomito", - "vontade", - "vortice", - "vosso", - "voto", - "vovozinha", - "voyeuse", - "vozes", - "vulva", - "vupt", - "western", - "xadrez", - "xale", - "xampu", - "xango", - "xarope", - "xaual", - "xavante", - "xaxim", - "xenonio", - "xepa", - "xerox", - "xicara", - "xifopago", - "xiita", - "xilogravura", - "xinxim", - "xistoso", - "xixi", - "xodo", - "xogum", - "xucro", - "zabumba", - "zagueiro", - "zambiano", - "zanzar", - "zarpar", - "zebu", - "zefiro", - "zeloso", - "zenite", - "zumbi" - ]; -} \ No newline at end of file diff --git a/lib/monero/mnemonics/russian.dart b/lib/monero/mnemonics/russian.dart deleted file mode 100644 index f10af0ff6..000000000 --- a/lib/monero/mnemonics/russian.dart +++ /dev/null @@ -1,1630 +0,0 @@ -class RussianMnemonics { - static const words = [ - "абажур", - "абзац", - "абонент", - "абрикос", - "абсурд", - "авангард", - "август", - "авиация", - "авоська", - "автор", - "агат", - "агент", - "агитатор", - "агнец", - "агония", - "агрегат", - "адвокат", - "адмирал", - "адрес", - "ажиотаж", - "азарт", - "азбука", - "азот", - "аист", - "айсберг", - "академия", - "аквариум", - "аккорд", - "акробат", - "аксиома", - "актер", - "акула", - "акция", - "алгоритм", - "алебарда", - "аллея", - "алмаз", - "алтарь", - "алфавит", - "алхимик", - "алый", - "альбом", - "алюминий", - "амбар", - "аметист", - "амнезия", - "ампула", - "амфора", - "анализ", - "ангел", - "анекдот", - "анимация", - "анкета", - "аномалия", - "ансамбль", - "антенна", - "апатия", - "апельсин", - "апофеоз", - "аппарат", - "апрель", - "аптека", - "арабский", - "арбуз", - "аргумент", - "арест", - "ария", - "арка", - "армия", - "аромат", - "арсенал", - "артист", - "архив", - "аршин", - "асбест", - "аскетизм", - "аспект", - "ассорти", - "астроном", - "асфальт", - "атака", - "ателье", - "атлас", - "атом", - "атрибут", - "аудитор", - "аукцион", - "аура", - "афера", - "афиша", - "ахинея", - "ацетон", - "аэропорт", - "бабушка", - "багаж", - "бадья", - "база", - "баклажан", - "балкон", - "бампер", - "банк", - "барон", - "бассейн", - "батарея", - "бахрома", - "башня", - "баян", - "бегство", - "бедро", - "бездна", - "бекон", - "белый", - "бензин", - "берег", - "беседа", - "бетонный", - "биатлон", - "библия", - "бивень", - "бигуди", - "бидон", - "бизнес", - "бикини", - "билет", - "бинокль", - "биология", - "биржа", - "бисер", - "битва", - "бицепс", - "благо", - "бледный", - "близкий", - "блок", - "блуждать", - "блюдо", - "бляха", - "бобер", - "богатый", - "бодрый", - "боевой", - "бокал", - "большой", - "борьба", - "босой", - "ботинок", - "боцман", - "бочка", - "боярин", - "брать", - "бревно", - "бригада", - "бросать", - "брызги", - "брюки", - "бублик", - "бугор", - "будущее", - "буква", - "бульвар", - "бумага", - "бунт", - "бурный", - "бусы", - "бутылка", - "буфет", - "бухта", - "бушлат", - "бывалый", - "быль", - "быстрый", - "быть", - "бюджет", - "бюро", - "бюст", - "вагон", - "важный", - "ваза", - "вакцина", - "валюта", - "вампир", - "ванная", - "вариант", - "вассал", - "вата", - "вафля", - "вахта", - "вдова", - "вдыхать", - "ведущий", - "веер", - "вежливый", - "везти", - "веко", - "великий", - "вена", - "верить", - "веселый", - "ветер", - "вечер", - "вешать", - "вещь", - "веяние", - "взаимный", - "взбучка", - "взвод", - "взгляд", - "вздыхать", - "взлетать", - "взмах", - "взнос", - "взор", - "взрыв", - "взывать", - "взятка", - "вибрация", - "визит", - "вилка", - "вино", - "вирус", - "висеть", - "витрина", - "вихрь", - "вишневый", - "включать", - "вкус", - "власть", - "влечь", - "влияние", - "влюблять", - "внешний", - "внимание", - "внук", - "внятный", - "вода", - "воевать", - "вождь", - "воздух", - "войти", - "вокзал", - "волос", - "вопрос", - "ворота", - "восток", - "впадать", - "впускать", - "врач", - "время", - "вручать", - "всадник", - "всеобщий", - "вспышка", - "встреча", - "вторник", - "вулкан", - "вурдалак", - "входить", - "въезд", - "выбор", - "вывод", - "выгодный", - "выделять", - "выезжать", - "выживать", - "вызывать", - "выигрыш", - "вылезать", - "выносить", - "выпивать", - "высокий", - "выходить", - "вычет", - "вышка", - "выяснять", - "вязать", - "вялый", - "гавань", - "гадать", - "газета", - "гаишник", - "галстук", - "гамма", - "гарантия", - "гастроли", - "гвардия", - "гвоздь", - "гектар", - "гель", - "генерал", - "геолог", - "герой", - "гешефт", - "гибель", - "гигант", - "гильза", - "гимн", - "гипотеза", - "гитара", - "глаз", - "глина", - "глоток", - "глубокий", - "глыба", - "глядеть", - "гнать", - "гнев", - "гнить", - "гном", - "гнуть", - "говорить", - "годовой", - "голова", - "гонка", - "город", - "гость", - "готовый", - "граница", - "грех", - "гриб", - "громкий", - "группа", - "грызть", - "грязный", - "губа", - "гудеть", - "гулять", - "гуманный", - "густой", - "гуща", - "давать", - "далекий", - "дама", - "данные", - "дарить", - "дать", - "дача", - "дверь", - "движение", - "двор", - "дебют", - "девушка", - "дедушка", - "дежурный", - "дезертир", - "действие", - "декабрь", - "дело", - "демократ", - "день", - "депутат", - "держать", - "десяток", - "детский", - "дефицит", - "дешевый", - "деятель", - "джаз", - "джинсы", - "джунгли", - "диалог", - "диван", - "диета", - "дизайн", - "дикий", - "динамика", - "диплом", - "директор", - "диск", - "дитя", - "дичь", - "длинный", - "дневник", - "добрый", - "доверие", - "договор", - "дождь", - "доза", - "документ", - "должен", - "домашний", - "допрос", - "дорога", - "доход", - "доцент", - "дочь", - "дощатый", - "драка", - "древний", - "дрожать", - "друг", - "дрянь", - "дубовый", - "дуга", - "дудка", - "дукат", - "дуло", - "думать", - "дупло", - "дурак", - "дуть", - "духи", - "душа", - "дуэт", - "дымить", - "дыня", - "дыра", - "дыханье", - "дышать", - "дьявол", - "дюжина", - "дюйм", - "дюна", - "дядя", - "дятел", - "егерь", - "единый", - "едкий", - "ежевика", - "ежик", - "езда", - "елка", - "емкость", - "ерунда", - "ехать", - "жадный", - "жажда", - "жалеть", - "жанр", - "жара", - "жать", - "жгучий", - "ждать", - "жевать", - "желание", - "жемчуг", - "женщина", - "жертва", - "жесткий", - "жечь", - "живой", - "жидкость", - "жизнь", - "жилье", - "жирный", - "житель", - "журнал", - "жюри", - "забывать", - "завод", - "загадка", - "задача", - "зажечь", - "зайти", - "закон", - "замечать", - "занимать", - "западный", - "зарплата", - "засыпать", - "затрата", - "захват", - "зацепка", - "зачет", - "защита", - "заявка", - "звать", - "звезда", - "звонить", - "звук", - "здание", - "здешний", - "здоровье", - "зебра", - "зевать", - "зеленый", - "земля", - "зенит", - "зеркало", - "зефир", - "зигзаг", - "зима", - "зиять", - "злак", - "злой", - "змея", - "знать", - "зной", - "зодчий", - "золотой", - "зомби", - "зона", - "зоопарк", - "зоркий", - "зрачок", - "зрение", - "зритель", - "зубной", - "зыбкий", - "зять", - "игла", - "иголка", - "играть", - "идея", - "идиот", - "идол", - "идти", - "иерархия", - "избрать", - "известие", - "изгонять", - "издание", - "излагать", - "изменять", - "износ", - "изоляция", - "изрядный", - "изучать", - "изымать", - "изящный", - "икона", - "икра", - "иллюзия", - "имбирь", - "иметь", - "имидж", - "иммунный", - "империя", - "инвестор", - "индивид", - "инерция", - "инженер", - "иномарка", - "институт", - "интерес", - "инфекция", - "инцидент", - "ипподром", - "ирис", - "ирония", - "искать", - "история", - "исходить", - "исчезать", - "итог", - "июль", - "июнь", - "кабинет", - "кавалер", - "кадр", - "казарма", - "кайф", - "кактус", - "калитка", - "камень", - "канал", - "капитан", - "картина", - "касса", - "катер", - "кафе", - "качество", - "каша", - "каюта", - "квартира", - "квинтет", - "квота", - "кедр", - "кекс", - "кенгуру", - "кепка", - "керосин", - "кетчуп", - "кефир", - "кибитка", - "кивнуть", - "кидать", - "километр", - "кино", - "киоск", - "кипеть", - "кирпич", - "кисть", - "китаец", - "класс", - "клетка", - "клиент", - "клоун", - "клуб", - "клык", - "ключ", - "клятва", - "книга", - "кнопка", - "кнут", - "князь", - "кобура", - "ковер", - "коготь", - "кодекс", - "кожа", - "козел", - "койка", - "коктейль", - "колено", - "компания", - "конец", - "копейка", - "короткий", - "костюм", - "котел", - "кофе", - "кошка", - "красный", - "кресло", - "кричать", - "кровь", - "крупный", - "крыша", - "крючок", - "кубок", - "кувшин", - "кудрявый", - "кузов", - "кукла", - "культура", - "кумир", - "купить", - "курс", - "кусок", - "кухня", - "куча", - "кушать", - "кювет", - "лабиринт", - "лавка", - "лагерь", - "ладонь", - "лазерный", - "лайнер", - "лакей", - "лампа", - "ландшафт", - "лапа", - "ларек", - "ласковый", - "лауреат", - "лачуга", - "лаять", - "лгать", - "лебедь", - "левый", - "легкий", - "ледяной", - "лежать", - "лекция", - "лента", - "лепесток", - "лесной", - "лето", - "лечь", - "леший", - "лживый", - "либерал", - "ливень", - "лига", - "лидер", - "ликовать", - "лиловый", - "лимон", - "линия", - "липа", - "лирика", - "лист", - "литр", - "лифт", - "лихой", - "лицо", - "личный", - "лишний", - "лобовой", - "ловить", - "логика", - "лодка", - "ложка", - "лозунг", - "локоть", - "ломать", - "лоно", - "лопата", - "лорд", - "лось", - "лоток", - "лохматый", - "лошадь", - "лужа", - "лукавый", - "луна", - "лупить", - "лучший", - "лыжный", - "лысый", - "львиный", - "льгота", - "льдина", - "любить", - "людской", - "люстра", - "лютый", - "лягушка", - "магазин", - "мадам", - "мазать", - "майор", - "максимум", - "мальчик", - "манера", - "март", - "масса", - "мать", - "мафия", - "махать", - "мачта", - "машина", - "маэстро", - "маяк", - "мгла", - "мебель", - "медведь", - "мелкий", - "мемуары", - "менять", - "мера", - "место", - "метод", - "механизм", - "мечтать", - "мешать", - "миграция", - "мизинец", - "микрофон", - "миллион", - "минута", - "мировой", - "миссия", - "митинг", - "мишень", - "младший", - "мнение", - "мнимый", - "могила", - "модель", - "мозг", - "мойка", - "мокрый", - "молодой", - "момент", - "монах", - "море", - "мост", - "мотор", - "мохнатый", - "мочь", - "мошенник", - "мощный", - "мрачный", - "мстить", - "мудрый", - "мужчина", - "музыка", - "мука", - "мумия", - "мундир", - "муравей", - "мусор", - "мутный", - "муфта", - "муха", - "мучить", - "мушкетер", - "мыло", - "мысль", - "мыть", - "мычать", - "мышь", - "мэтр", - "мюзикл", - "мягкий", - "мякиш", - "мясо", - "мятый", - "мячик", - "набор", - "навык", - "нагрузка", - "надежда", - "наемный", - "нажать", - "называть", - "наивный", - "накрыть", - "налог", - "намерен", - "наносить", - "написать", - "народ", - "натура", - "наука", - "нация", - "начать", - "небо", - "невеста", - "негодяй", - "неделя", - "нежный", - "незнание", - "нелепый", - "немалый", - "неправда", - "нервный", - "нести", - "нефть", - "нехватка", - "нечистый", - "неясный", - "нива", - "нижний", - "низкий", - "никель", - "нирвана", - "нить", - "ничья", - "ниша", - "нищий", - "новый", - "нога", - "ножницы", - "ноздря", - "ноль", - "номер", - "норма", - "нота", - "ночь", - "ноша", - "ноябрь", - "нрав", - "нужный", - "нутро", - "нынешний", - "нырнуть", - "ныть", - "нюанс", - "нюхать", - "няня", - "оазис", - "обаяние", - "обвинять", - "обгонять", - "обещать", - "обжигать", - "обзор", - "обида", - "область", - "обмен", - "обнимать", - "оборона", - "образ", - "обучение", - "обходить", - "обширный", - "общий", - "объект", - "обычный", - "обязать", - "овальный", - "овес", - "овощи", - "овраг", - "овца", - "овчарка", - "огненный", - "огонь", - "огромный", - "огурец", - "одежда", - "одинокий", - "одобрить", - "ожидать", - "ожог", - "озарение", - "озеро", - "означать", - "оказать", - "океан", - "оклад", - "окно", - "округ", - "октябрь", - "окурок", - "олень", - "опасный", - "операция", - "описать", - "оплата", - "опора", - "оппонент", - "опрос", - "оптимизм", - "опускать", - "опыт", - "орать", - "орбита", - "орган", - "орден", - "орел", - "оригинал", - "оркестр", - "орнамент", - "оружие", - "осадок", - "освещать", - "осень", - "осина", - "осколок", - "осмотр", - "основной", - "особый", - "осуждать", - "отбор", - "отвечать", - "отдать", - "отец", - "отзыв", - "открытие", - "отмечать", - "относить", - "отпуск", - "отрасль", - "отставка", - "оттенок", - "отходить", - "отчет", - "отъезд", - "офицер", - "охапка", - "охота", - "охрана", - "оценка", - "очаг", - "очередь", - "очищать", - "очки", - "ошейник", - "ошибка", - "ощущение", - "павильон", - "падать", - "паек", - "пакет", - "палец", - "память", - "панель", - "папка", - "партия", - "паспорт", - "патрон", - "пауза", - "пафос", - "пахнуть", - "пациент", - "пачка", - "пашня", - "певец", - "педагог", - "пейзаж", - "пельмень", - "пенсия", - "пепел", - "период", - "песня", - "петля", - "пехота", - "печать", - "пешеход", - "пещера", - "пианист", - "пиво", - "пиджак", - "пиковый", - "пилот", - "пионер", - "пирог", - "писать", - "пить", - "пицца", - "пишущий", - "пища", - "план", - "плечо", - "плита", - "плохой", - "плыть", - "плюс", - "пляж", - "победа", - "повод", - "погода", - "подумать", - "поехать", - "пожимать", - "позиция", - "поиск", - "покой", - "получать", - "помнить", - "пони", - "поощрять", - "попадать", - "порядок", - "пост", - "поток", - "похожий", - "поцелуй", - "почва", - "пощечина", - "поэт", - "пояснить", - "право", - "предмет", - "проблема", - "пруд", - "прыгать", - "прямой", - "психолог", - "птица", - "публика", - "пугать", - "пудра", - "пузырь", - "пуля", - "пункт", - "пурга", - "пустой", - "путь", - "пухлый", - "пучок", - "пушистый", - "пчела", - "пшеница", - "пыль", - "пытка", - "пыхтеть", - "пышный", - "пьеса", - "пьяный", - "пятно", - "работа", - "равный", - "радость", - "развитие", - "район", - "ракета", - "рамка", - "ранний", - "рапорт", - "рассказ", - "раунд", - "рация", - "рвать", - "реальный", - "ребенок", - "реветь", - "регион", - "редакция", - "реестр", - "режим", - "резкий", - "рейтинг", - "река", - "религия", - "ремонт", - "рента", - "реплика", - "ресурс", - "реформа", - "рецепт", - "речь", - "решение", - "ржавый", - "рисунок", - "ритм", - "рифма", - "робкий", - "ровный", - "рогатый", - "родитель", - "рождение", - "розовый", - "роковой", - "роль", - "роман", - "ронять", - "рост", - "рота", - "роща", - "рояль", - "рубль", - "ругать", - "руда", - "ружье", - "руины", - "рука", - "руль", - "румяный", - "русский", - "ручка", - "рыба", - "рывок", - "рыдать", - "рыжий", - "рынок", - "рысь", - "рыть", - "рыхлый", - "рыцарь", - "рычаг", - "рюкзак", - "рюмка", - "рябой", - "рядовой", - "сабля", - "садовый", - "сажать", - "салон", - "самолет", - "сани", - "сапог", - "сарай", - "сатира", - "сауна", - "сахар", - "сбегать", - "сбивать", - "сбор", - "сбыт", - "свадьба", - "свет", - "свидание", - "свобода", - "связь", - "сгорать", - "сдвигать", - "сеанс", - "северный", - "сегмент", - "седой", - "сезон", - "сейф", - "секунда", - "сельский", - "семья", - "сентябрь", - "сердце", - "сеть", - "сечение", - "сеять", - "сигнал", - "сидеть", - "сизый", - "сила", - "символ", - "синий", - "сирота", - "система", - "ситуация", - "сиять", - "сказать", - "скважина", - "скелет", - "скидка", - "склад", - "скорый", - "скрывать", - "скучный", - "слава", - "слеза", - "слияние", - "слово", - "случай", - "слышать", - "слюна", - "смех", - "смирение", - "смотреть", - "смутный", - "смысл", - "смятение", - "снаряд", - "снег", - "снижение", - "сносить", - "снять", - "событие", - "совет", - "согласие", - "сожалеть", - "сойти", - "сокол", - "солнце", - "сомнение", - "сонный", - "сообщать", - "соперник", - "сорт", - "состав", - "сотня", - "соус", - "социолог", - "сочинять", - "союз", - "спать", - "спешить", - "спина", - "сплошной", - "способ", - "спутник", - "средство", - "срок", - "срывать", - "стать", - "ствол", - "стена", - "стихи", - "сторона", - "страна", - "студент", - "стыд", - "субъект", - "сувенир", - "сугроб", - "судьба", - "суета", - "суждение", - "сукно", - "сулить", - "сумма", - "сунуть", - "супруг", - "суровый", - "сустав", - "суть", - "сухой", - "суша", - "существо", - "сфера", - "схема", - "сцена", - "счастье", - "счет", - "считать", - "сшивать", - "съезд", - "сынок", - "сыпать", - "сырье", - "сытый", - "сыщик", - "сюжет", - "сюрприз", - "таблица", - "таежный", - "таинство", - "тайна", - "такси", - "талант", - "таможня", - "танец", - "тарелка", - "таскать", - "тахта", - "тачка", - "таять", - "тварь", - "твердый", - "творить", - "театр", - "тезис", - "текст", - "тело", - "тема", - "тень", - "теория", - "теплый", - "терять", - "тесный", - "тетя", - "техника", - "течение", - "тигр", - "типичный", - "тираж", - "титул", - "тихий", - "тишина", - "ткань", - "товарищ", - "толпа", - "тонкий", - "топливо", - "торговля", - "тоска", - "точка", - "тощий", - "традиция", - "тревога", - "трибуна", - "трогать", - "труд", - "трюк", - "тряпка", - "туалет", - "тугой", - "туловище", - "туман", - "тундра", - "тупой", - "турнир", - "тусклый", - "туфля", - "туча", - "туша", - "тыкать", - "тысяча", - "тьма", - "тюльпан", - "тюрьма", - "тяга", - "тяжелый", - "тянуть", - "убеждать", - "убирать", - "убогий", - "убыток", - "уважение", - "уверять", - "увлекать", - "угнать", - "угол", - "угроза", - "удар", - "удивлять", - "удобный", - "уезд", - "ужас", - "ужин", - "узел", - "узкий", - "узнавать", - "узор", - "уйма", - "уклон", - "укол", - "уксус", - "улетать", - "улица", - "улучшать", - "улыбка", - "уметь", - "умиление", - "умный", - "умолять", - "умысел", - "унижать", - "уносить", - "уныние", - "упасть", - "уплата", - "упор", - "упрекать", - "упускать", - "уран", - "урна", - "уровень", - "усадьба", - "усердие", - "усилие", - "ускорять", - "условие", - "усмешка", - "уснуть", - "успеть", - "усыпать", - "утешать", - "утка", - "уточнять", - "утро", - "утюг", - "уходить", - "уцелеть", - "участие", - "ученый", - "учитель", - "ушко", - "ущерб", - "уютный", - "уяснять", - "фабрика", - "фаворит", - "фаза", - "файл", - "факт", - "фамилия", - "фантазия", - "фара", - "фасад", - "февраль", - "фельдшер", - "феномен", - "ферма", - "фигура", - "физика", - "фильм", - "финал", - "фирма", - "фишка", - "флаг", - "флейта", - "флот", - "фокус", - "фольклор", - "фонд", - "форма", - "фото", - "фраза", - "фреска", - "фронт", - "фрукт", - "функция", - "фуражка", - "футбол", - "фыркать", - "халат", - "хамство", - "хаос", - "характер", - "хата", - "хватать", - "хвост", - "хижина", - "хилый", - "химия", - "хирург", - "хитрый", - "хищник", - "хлам", - "хлеб", - "хлопать", - "хмурый", - "ходить", - "хозяин", - "хоккей", - "холодный", - "хороший", - "хотеть", - "хохотать", - "храм", - "хрен", - "хриплый", - "хроника", - "хрупкий", - "художник", - "хулиган", - "хутор", - "царь", - "цвет", - "цель", - "цемент", - "центр", - "цепь", - "церковь", - "цикл", - "цилиндр", - "циничный", - "цирк", - "цистерна", - "цитата", - "цифра", - "цыпленок", - "чадо", - "чайник", - "часть", - "чашка", - "человек", - "чемодан", - "чепуха", - "черный", - "честь", - "четкий", - "чехол", - "чиновник", - "число", - "читать", - "членство", - "чреватый", - "чтение", - "чувство", - "чугунный", - "чудо", - "чужой", - "чукча", - "чулок", - "чума", - "чуткий", - "чучело", - "чушь", - "шаблон", - "шагать", - "шайка", - "шакал", - "шалаш", - "шампунь", - "шанс", - "шапка", - "шарик", - "шасси", - "шатер", - "шахта", - "шашлык", - "швейный", - "швырять", - "шевелить", - "шедевр", - "шейка", - "шелковый", - "шептать", - "шерсть", - "шестерка", - "шикарный", - "шинель", - "шипеть", - "широкий", - "шить", - "шишка", - "шкаф", - "школа", - "шкура", - "шланг", - "шлем", - "шлюпка", - "шляпа", - "шнур", - "шоколад", - "шорох", - "шоссе", - "шофер", - "шпага", - "шпион", - "шприц", - "шрам", - "шрифт", - "штаб", - "штора", - "штраф", - "штука", - "штык", - "шуба", - "шуметь", - "шуршать", - "шутка", - "щадить", - "щедрый", - "щека", - "щель", - "щенок", - "щепка", - "щетка", - "щука", - "эволюция", - "эгоизм", - "экзамен", - "экипаж", - "экономия", - "экран", - "эксперт", - "элемент", - "элита", - "эмблема", - "эмигрант", - "эмоция", - "энергия", - "эпизод", - "эпоха", - "эскиз", - "эссе", - "эстрада", - "этап", - "этика", - "этюд", - "эфир", - "эффект", - "эшелон", - "юбилей", - "юбка", - "южный", - "юмор", - "юноша", - "юрист", - "яблоко", - "явление", - "ягода", - "ядерный", - "ядовитый", - "ядро", - "язва", - "язык", - "яйцо", - "якорь", - "январь", - "японец", - "яркий", - "ярмарка", - "ярость", - "ярус", - "ясный", - "яхта", - "ячейка", - "ящик" - ]; -} \ No newline at end of file diff --git a/lib/monero/mnemonics/spanish.dart b/lib/monero/mnemonics/spanish.dart deleted file mode 100644 index 531eafd35..000000000 --- a/lib/monero/mnemonics/spanish.dart +++ /dev/null @@ -1,1630 +0,0 @@ -class SpanishMnemonics { - static const words = [ - "ábaco", - "abdomen", - "abeja", - "abierto", - "abogado", - "abono", - "aborto", - "abrazo", - "abrir", - "abuelo", - "abuso", - "acabar", - "academia", - "acceso", - "acción", - "aceite", - "acelga", - "acento", - "aceptar", - "ácido", - "aclarar", - "acné", - "acoger", - "acoso", - "activo", - "acto", - "actriz", - "actuar", - "acudir", - "acuerdo", - "acusar", - "adicto", - "admitir", - "adoptar", - "adorno", - "aduana", - "adulto", - "aéreo", - "afectar", - "afición", - "afinar", - "afirmar", - "ágil", - "agitar", - "agonía", - "agosto", - "agotar", - "agregar", - "agrio", - "agua", - "agudo", - "águila", - "aguja", - "ahogo", - "ahorro", - "aire", - "aislar", - "ajedrez", - "ajeno", - "ajuste", - "alacrán", - "alambre", - "alarma", - "alba", - "álbum", - "alcalde", - "aldea", - "alegre", - "alejar", - "alerta", - "aleta", - "alfiler", - "alga", - "algodón", - "aliado", - "aliento", - "alivio", - "alma", - "almeja", - "almíbar", - "altar", - "alteza", - "altivo", - "alto", - "altura", - "alumno", - "alzar", - "amable", - "amante", - "amapola", - "amargo", - "amasar", - "ámbar", - "ámbito", - "ameno", - "amigo", - "amistad", - "amor", - "amparo", - "amplio", - "ancho", - "anciano", - "ancla", - "andar", - "andén", - "anemia", - "ángulo", - "anillo", - "ánimo", - "anís", - "anotar", - "antena", - "antiguo", - "antojo", - "anual", - "anular", - "anuncio", - "añadir", - "añejo", - "año", - "apagar", - "aparato", - "apetito", - "apio", - "aplicar", - "apodo", - "aporte", - "apoyo", - "aprender", - "aprobar", - "apuesta", - "apuro", - "arado", - "araña", - "arar", - "árbitro", - "árbol", - "arbusto", - "archivo", - "arco", - "arder", - "ardilla", - "arduo", - "área", - "árido", - "aries", - "armonía", - "arnés", - "aroma", - "arpa", - "arpón", - "arreglo", - "arroz", - "arruga", - "arte", - "artista", - "asa", - "asado", - "asalto", - "ascenso", - "asegurar", - "aseo", - "asesor", - "asiento", - "asilo", - "asistir", - "asno", - "asombro", - "áspero", - "astilla", - "astro", - "astuto", - "asumir", - "asunto", - "atajo", - "ataque", - "atar", - "atento", - "ateo", - "ático", - "atleta", - "átomo", - "atraer", - "atroz", - "atún", - "audaz", - "audio", - "auge", - "aula", - "aumento", - "ausente", - "autor", - "aval", - "avance", - "avaro", - "ave", - "avellana", - "avena", - "avestruz", - "avión", - "aviso", - "ayer", - "ayuda", - "ayuno", - "azafrán", - "azar", - "azote", - "azúcar", - "azufre", - "azul", - "baba", - "babor", - "bache", - "bahía", - "baile", - "bajar", - "balanza", - "balcón", - "balde", - "bambú", - "banco", - "banda", - "baño", - "barba", - "barco", - "barniz", - "barro", - "báscula", - "bastón", - "basura", - "batalla", - "batería", - "batir", - "batuta", - "baúl", - "bazar", - "bebé", - "bebida", - "bello", - "besar", - "beso", - "bestia", - "bicho", - "bien", - "bingo", - "blanco", - "bloque", - "blusa", - "boa", - "bobina", - "bobo", - "boca", - "bocina", - "boda", - "bodega", - "boina", - "bola", - "bolero", - "bolsa", - "bomba", - "bondad", - "bonito", - "bono", - "bonsái", - "borde", - "borrar", - "bosque", - "bote", - "botín", - "bóveda", - "bozal", - "bravo", - "brazo", - "brecha", - "breve", - "brillo", - "brinco", - "brisa", - "broca", - "broma", - "bronce", - "brote", - "bruja", - "brusco", - "bruto", - "buceo", - "bucle", - "bueno", - "buey", - "bufanda", - "bufón", - "búho", - "buitre", - "bulto", - "burbuja", - "burla", - "burro", - "buscar", - "butaca", - "buzón", - "caballo", - "cabeza", - "cabina", - "cabra", - "cacao", - "cadáver", - "cadena", - "caer", - "café", - "caída", - "caimán", - "caja", - "cajón", - "cal", - "calamar", - "calcio", - "caldo", - "calidad", - "calle", - "calma", - "calor", - "calvo", - "cama", - "cambio", - "camello", - "camino", - "campo", - "cáncer", - "candil", - "canela", - "canguro", - "canica", - "canto", - "caña", - "cañón", - "caoba", - "caos", - "capaz", - "capitán", - "capote", - "captar", - "capucha", - "cara", - "carbón", - "cárcel", - "careta", - "carga", - "cariño", - "carne", - "carpeta", - "carro", - "carta", - "casa", - "casco", - "casero", - "caspa", - "castor", - "catorce", - "catre", - "caudal", - "causa", - "cazo", - "cebolla", - "ceder", - "cedro", - "celda", - "célebre", - "celoso", - "célula", - "cemento", - "ceniza", - "centro", - "cerca", - "cerdo", - "cereza", - "cero", - "cerrar", - "certeza", - "césped", - "cetro", - "chacal", - "chaleco", - "champú", - "chancla", - "chapa", - "charla", - "chico", - "chiste", - "chivo", - "choque", - "choza", - "chuleta", - "chupar", - "ciclón", - "ciego", - "cielo", - "cien", - "cierto", - "cifra", - "cigarro", - "cima", - "cinco", - "cine", - "cinta", - "ciprés", - "circo", - "ciruela", - "cisne", - "cita", - "ciudad", - "clamor", - "clan", - "claro", - "clase", - "clave", - "cliente", - "clima", - "clínica", - "cobre", - "cocción", - "cochino", - "cocina", - "coco", - "código", - "codo", - "cofre", - "coger", - "cohete", - "cojín", - "cojo", - "cola", - "colcha", - "colegio", - "colgar", - "colina", - "collar", - "colmo", - "columna", - "combate", - "comer", - "comida", - "cómodo", - "compra", - "conde", - "conejo", - "conga", - "conocer", - "consejo", - "contar", - "copa", - "copia", - "corazón", - "corbata", - "corcho", - "cordón", - "corona", - "correr", - "coser", - "cosmos", - "costa", - "cráneo", - "cráter", - "crear", - "crecer", - "creído", - "crema", - "cría", - "crimen", - "cripta", - "crisis", - "cromo", - "crónica", - "croqueta", - "crudo", - "cruz", - "cuadro", - "cuarto", - "cuatro", - "cubo", - "cubrir", - "cuchara", - "cuello", - "cuento", - "cuerda", - "cuesta", - "cueva", - "cuidar", - "culebra", - "culpa", - "culto", - "cumbre", - "cumplir", - "cuna", - "cuneta", - "cuota", - "cupón", - "cúpula", - "curar", - "curioso", - "curso", - "curva", - "cutis", - "dama", - "danza", - "dar", - "dardo", - "dátil", - "deber", - "débil", - "década", - "decir", - "dedo", - "defensa", - "definir", - "dejar", - "delfín", - "delgado", - "delito", - "demora", - "denso", - "dental", - "deporte", - "derecho", - "derrota", - "desayuno", - "deseo", - "desfile", - "desnudo", - "destino", - "desvío", - "detalle", - "detener", - "deuda", - "día", - "diablo", - "diadema", - "diamante", - "diana", - "diario", - "dibujo", - "dictar", - "diente", - "dieta", - "diez", - "difícil", - "digno", - "dilema", - "diluir", - "dinero", - "directo", - "dirigir", - "disco", - "diseño", - "disfraz", - "diva", - "divino", - "doble", - "doce", - "dolor", - "domingo", - "don", - "donar", - "dorado", - "dormir", - "dorso", - "dos", - "dosis", - "dragón", - "droga", - "ducha", - "duda", - "duelo", - "dueño", - "dulce", - "dúo", - "duque", - "durar", - "dureza", - "duro", - "ébano", - "ebrio", - "echar", - "eco", - "ecuador", - "edad", - "edición", - "edificio", - "editor", - "educar", - "efecto", - "eficaz", - "eje", - "ejemplo", - "elefante", - "elegir", - "elemento", - "elevar", - "elipse", - "élite", - "elixir", - "elogio", - "eludir", - "embudo", - "emitir", - "emoción", - "empate", - "empeño", - "empleo", - "empresa", - "enano", - "encargo", - "enchufe", - "encía", - "enemigo", - "enero", - "enfado", - "enfermo", - "engaño", - "enigma", - "enlace", - "enorme", - "enredo", - "ensayo", - "enseñar", - "entero", - "entrar", - "envase", - "envío", - "época", - "equipo", - "erizo", - "escala", - "escena", - "escolar", - "escribir", - "escudo", - "esencia", - "esfera", - "esfuerzo", - "espada", - "espejo", - "espía", - "esposa", - "espuma", - "esquí", - "estar", - "este", - "estilo", - "estufa", - "etapa", - "eterno", - "ética", - "etnia", - "evadir", - "evaluar", - "evento", - "evitar", - "exacto", - "examen", - "exceso", - "excusa", - "exento", - "exigir", - "exilio", - "existir", - "éxito", - "experto", - "explicar", - "exponer", - "extremo", - "fábrica", - "fábula", - "fachada", - "fácil", - "factor", - "faena", - "faja", - "falda", - "fallo", - "falso", - "faltar", - "fama", - "familia", - "famoso", - "faraón", - "farmacia", - "farol", - "farsa", - "fase", - "fatiga", - "fauna", - "favor", - "fax", - "febrero", - "fecha", - "feliz", - "feo", - "feria", - "feroz", - "fértil", - "fervor", - "festín", - "fiable", - "fianza", - "fiar", - "fibra", - "ficción", - "ficha", - "fideo", - "fiebre", - "fiel", - "fiera", - "fiesta", - "figura", - "fijar", - "fijo", - "fila", - "filete", - "filial", - "filtro", - "fin", - "finca", - "fingir", - "finito", - "firma", - "flaco", - "flauta", - "flecha", - "flor", - "flota", - "fluir", - "flujo", - "flúor", - "fobia", - "foca", - "fogata", - "fogón", - "folio", - "folleto", - "fondo", - "forma", - "forro", - "fortuna", - "forzar", - "fosa", - "foto", - "fracaso", - "frágil", - "franja", - "frase", - "fraude", - "freír", - "freno", - "fresa", - "frío", - "frito", - "fruta", - "fuego", - "fuente", - "fuerza", - "fuga", - "fumar", - "función", - "funda", - "furgón", - "furia", - "fusil", - "fútbol", - "futuro", - "gacela", - "gafas", - "gaita", - "gajo", - "gala", - "galería", - "gallo", - "gamba", - "ganar", - "gancho", - "ganga", - "ganso", - "garaje", - "garza", - "gasolina", - "gastar", - "gato", - "gavilán", - "gemelo", - "gemir", - "gen", - "género", - "genio", - "gente", - "geranio", - "gerente", - "germen", - "gesto", - "gigante", - "gimnasio", - "girar", - "giro", - "glaciar", - "globo", - "gloria", - "gol", - "golfo", - "goloso", - "golpe", - "goma", - "gordo", - "gorila", - "gorra", - "gota", - "goteo", - "gozar", - "grada", - "gráfico", - "grano", - "grasa", - "gratis", - "grave", - "grieta", - "grillo", - "gripe", - "gris", - "grito", - "grosor", - "grúa", - "grueso", - "grumo", - "grupo", - "guante", - "guapo", - "guardia", - "guerra", - "guía", - "guiño", - "guion", - "guiso", - "guitarra", - "gusano", - "gustar", - "haber", - "hábil", - "hablar", - "hacer", - "hacha", - "hada", - "hallar", - "hamaca", - "harina", - "haz", - "hazaña", - "hebilla", - "hebra", - "hecho", - "helado", - "helio", - "hembra", - "herir", - "hermano", - "héroe", - "hervir", - "hielo", - "hierro", - "hígado", - "higiene", - "hijo", - "himno", - "historia", - "hocico", - "hogar", - "hoguera", - "hoja", - "hombre", - "hongo", - "honor", - "honra", - "hora", - "hormiga", - "horno", - "hostil", - "hoyo", - "hueco", - "huelga", - "huerta", - "hueso", - "huevo", - "huida", - "huir", - "humano", - "húmedo", - "humilde", - "humo", - "hundir", - "huracán", - "hurto", - "icono", - "ideal", - "idioma", - "ídolo", - "iglesia", - "iglú", - "igual", - "ilegal", - "ilusión", - "imagen", - "imán", - "imitar", - "impar", - "imperio", - "imponer", - "impulso", - "incapaz", - "índice", - "inerte", - "infiel", - "informe", - "ingenio", - "inicio", - "inmenso", - "inmune", - "innato", - "insecto", - "instante", - "interés", - "íntimo", - "intuir", - "inútil", - "invierno", - "ira", - "iris", - "ironía", - "isla", - "islote", - "jabalí", - "jabón", - "jamón", - "jarabe", - "jardín", - "jarra", - "jaula", - "jazmín", - "jefe", - "jeringa", - "jinete", - "jornada", - "joroba", - "joven", - "joya", - "juerga", - "jueves", - "juez", - "jugador", - "jugo", - "juguete", - "juicio", - "junco", - "jungla", - "junio", - "juntar", - "júpiter", - "jurar", - "justo", - "juvenil", - "juzgar", - "kilo", - "koala", - "labio", - "lacio", - "lacra", - "lado", - "ladrón", - "lagarto", - "lágrima", - "laguna", - "laico", - "lamer", - "lámina", - "lámpara", - "lana", - "lancha", - "langosta", - "lanza", - "lápiz", - "largo", - "larva", - "lástima", - "lata", - "látex", - "latir", - "laurel", - "lavar", - "lazo", - "leal", - "lección", - "leche", - "lector", - "leer", - "legión", - "legumbre", - "lejano", - "lengua", - "lento", - "leña", - "león", - "leopardo", - "lesión", - "letal", - "letra", - "leve", - "leyenda", - "libertad", - "libro", - "licor", - "líder", - "lidiar", - "lienzo", - "liga", - "ligero", - "lima", - "límite", - "limón", - "limpio", - "lince", - "lindo", - "línea", - "lingote", - "lino", - "linterna", - "líquido", - "liso", - "lista", - "litera", - "litio", - "litro", - "llaga", - "llama", - "llanto", - "llave", - "llegar", - "llenar", - "llevar", - "llorar", - "llover", - "lluvia", - "lobo", - "loción", - "loco", - "locura", - "lógica", - "logro", - "lombriz", - "lomo", - "lonja", - "lote", - "lucha", - "lucir", - "lugar", - "lujo", - "luna", - "lunes", - "lupa", - "lustro", - "luto", - "luz", - "maceta", - "macho", - "madera", - "madre", - "maduro", - "maestro", - "mafia", - "magia", - "mago", - "maíz", - "maldad", - "maleta", - "malla", - "malo", - "mamá", - "mambo", - "mamut", - "manco", - "mando", - "manejar", - "manga", - "maniquí", - "manjar", - "mano", - "manso", - "manta", - "mañana", - "mapa", - "máquina", - "mar", - "marco", - "marea", - "marfil", - "margen", - "marido", - "mármol", - "marrón", - "martes", - "marzo", - "masa", - "máscara", - "masivo", - "matar", - "materia", - "matiz", - "matriz", - "máximo", - "mayor", - "mazorca", - "mecha", - "medalla", - "medio", - "médula", - "mejilla", - "mejor", - "melena", - "melón", - "memoria", - "menor", - "mensaje", - "mente", - "menú", - "mercado", - "merengue", - "mérito", - "mes", - "mesón", - "meta", - "meter", - "método", - "metro", - "mezcla", - "miedo", - "miel", - "miembro", - "miga", - "mil", - "milagro", - "militar", - "millón", - "mimo", - "mina", - "minero", - "mínimo", - "minuto", - "miope", - "mirar", - "misa", - "miseria", - "misil", - "mismo", - "mitad", - "mito", - "mochila", - "moción", - "moda", - "modelo", - "moho", - "mojar", - "molde", - "moler", - "molino", - "momento", - "momia", - "monarca", - "moneda", - "monja", - "monto", - "moño", - "morada", - "morder", - "moreno", - "morir", - "morro", - "morsa", - "mortal", - "mosca", - "mostrar", - "motivo", - "mover", - "móvil", - "mozo", - "mucho", - "mudar", - "mueble", - "muela", - "muerte", - "muestra", - "mugre", - "mujer", - "mula", - "muleta", - "multa", - "mundo", - "muñeca", - "mural", - "muro", - "músculo", - "museo", - "musgo", - "música", - "muslo", - "nácar", - "nación", - "nadar", - "naipe", - "naranja", - "nariz", - "narrar", - "nasal", - "natal", - "nativo", - "natural", - "náusea", - "naval", - "nave", - "navidad", - "necio", - "néctar", - "negar", - "negocio", - "negro", - "neón", - "nervio", - "neto", - "neutro", - "nevar", - "nevera", - "nicho", - "nido", - "niebla", - "nieto", - "niñez", - "niño", - "nítido", - "nivel", - "nobleza", - "noche", - "nómina", - "noria", - "norma", - "norte", - "nota", - "noticia", - "novato", - "novela", - "novio", - "nube", - "nuca", - "núcleo", - "nudillo", - "nudo", - "nuera", - "nueve", - "nuez", - "nulo", - "número", - "nutria", - "oasis", - "obeso", - "obispo", - "objeto", - "obra", - "obrero", - "observar", - "obtener", - "obvio", - "oca", - "ocaso", - "océano", - "ochenta", - "ocho", - "ocio", - "ocre", - "octavo", - "octubre", - "oculto", - "ocupar", - "ocurrir", - "odiar", - "odio", - "odisea", - "oeste", - "ofensa", - "oferta", - "oficio", - "ofrecer", - "ogro", - "oído", - "oír", - "ojo", - "ola", - "oleada", - "olfato", - "olivo", - "olla", - "olmo", - "olor", - "olvido", - "ombligo", - "onda", - "onza", - "opaco", - "opción", - "ópera", - "opinar", - "oponer", - "optar", - "óptica", - "opuesto", - "oración", - "orador", - "oral", - "órbita", - "orca", - "orden", - "oreja", - "órgano", - "orgía", - "orgullo", - "oriente", - "origen", - "orilla", - "oro", - "orquesta", - "oruga", - "osadía", - "oscuro", - "osezno", - "oso", - "ostra", - "otoño", - "otro", - "oveja", - "óvulo", - "óxido", - "oxígeno", - "oyente", - "ozono", - "pacto", - "padre", - "paella", - "página", - "pago", - "país", - "pájaro", - "palabra", - "palco", - "paleta", - "pálido", - "palma", - "paloma", - "palpar", - "pan", - "panal", - "pánico", - "pantera", - "pañuelo", - "papá", - "papel", - "papilla", - "paquete", - "parar", - "parcela", - "pared", - "parir", - "paro", - "párpado", - "parque", - "párrafo", - "parte", - "pasar", - "paseo", - "pasión", - "paso", - "pasta", - "pata", - "patio", - "patria", - "pausa", - "pauta", - "pavo", - "payaso", - "peatón", - "pecado", - "pecera", - "pecho", - "pedal", - "pedir", - "pegar", - "peine", - "pelar", - "peldaño", - "pelea", - "peligro", - "pellejo", - "pelo", - "peluca", - "pena", - "pensar", - "peñón", - "peón", - "peor", - "pepino", - "pequeño", - "pera", - "percha", - "perder", - "pereza", - "perfil", - "perico", - "perla", - "permiso", - "perro", - "persona", - "pesa", - "pesca", - "pésimo", - "pestaña", - "pétalo", - "petróleo", - "pez", - "pezuña", - "picar", - "pichón", - "pie", - "piedra", - "pierna", - "pieza", - "pijama", - "pilar", - "piloto", - "pimienta", - "pino", - "pintor", - "pinza", - "piña", - "piojo", - "pipa", - "pirata", - "pisar", - "piscina", - "piso", - "pista", - "pitón", - "pizca", - "placa", - "plan", - "plata", - "playa", - "plaza", - "pleito", - "pleno", - "plomo", - "pluma", - "plural", - "pobre", - "poco", - "poder", - "podio", - "poema", - "poesía", - "poeta", - "polen", - "policía", - "pollo", - "polvo", - "pomada", - "pomelo", - "pomo", - "pompa", - "poner", - "porción", - "portal", - "posada", - "poseer", - "posible", - "poste", - "potencia", - "potro", - "pozo", - "prado", - "precoz", - "pregunta", - "premio", - "prensa", - "preso", - "previo", - "primo", - "príncipe", - "prisión", - "privar", - "proa", - "probar", - "proceso", - "producto", - "proeza", - "profesor", - "programa", - "prole", - "promesa", - "pronto", - "propio", - "próximo", - "prueba", - "público", - "puchero", - "pudor", - "pueblo", - "puerta", - "puesto", - "pulga", - "pulir", - "pulmón", - "pulpo", - "pulso", - "puma", - "punto", - "puñal", - "puño", - "pupa", - "pupila", - "puré", - "quedar", - "queja", - "quemar", - "querer", - "queso", - "quieto", - "química", - "quince", - "quitar", - "rábano", - "rabia", - "rabo", - "ración", - "radical", - "raíz", - "rama", - "rampa", - "rancho", - "rango", - "rapaz", - "rápido", - "rapto", - "rasgo", - "raspa", - "rato", - "rayo", - "raza", - "razón", - "reacción", - "realidad", - "rebaño", - "rebote", - "recaer", - "receta", - "rechazo", - "recoger", - "recreo", - "recto", - "recurso", - "red", - "redondo", - "reducir", - "reflejo", - "reforma", - "refrán", - "refugio", - "regalo", - "regir", - "regla", - "regreso", - "rehén", - "reino", - "reír", - "reja", - "relato", - "relevo", - "relieve", - "relleno", - "reloj", - "remar", - "remedio", - "remo", - "rencor", - "rendir", - "renta", - "reparto", - "repetir", - "reposo", - "reptil", - "res", - "rescate", - "resina", - "respeto", - "resto", - "resumen", - "retiro", - "retorno", - "retrato", - "reunir", - "revés", - "revista", - "rey", - "rezar", - "rico", - "riego", - "rienda", - "riesgo", - "rifa", - "rígido", - "rigor", - "rincón", - "riñón", - "río", - "riqueza", - "risa", - "ritmo", - "rito" - ]; -} \ No newline at end of file diff --git a/lib/monero/monero_account_list.dart b/lib/monero/monero_account_list.dart deleted file mode 100644 index 9e3b14931..000000000 --- a/lib/monero/monero_account_list.dart +++ /dev/null @@ -1,76 +0,0 @@ -import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/monero/account.dart'; -import 'package:cw_monero/account_list.dart' as account_list; - -part 'monero_account_list.g.dart'; - -class MoneroAccountList = MoneroAccountListBase with _$MoneroAccountList; - -abstract class MoneroAccountListBase with Store { - MoneroAccountListBase() - : accounts = ObservableList(), - _isRefreshing = false, - _isUpdating = false { - refresh(); - print(account_list.accountSizeNative()); - } - - @observable - ObservableList accounts; - bool _isRefreshing; - bool _isUpdating; - - void update() async { - if (_isUpdating) { - return; - } - - try { - _isUpdating = true; - refresh(); - final accounts = getAll(); - - if (accounts.isNotEmpty) { - this.accounts.clear(); - this.accounts.addAll(accounts); - } - - _isUpdating = false; - } catch (e) { - _isUpdating = false; - rethrow; - } - } - - List getAll() => account_list - .getAllAccount() - .map((accountRow) => Account.fromRow(accountRow)) - .toList(); - - Future addAccount({String label}) async { - await account_list.addAccount(label: label); - update(); - } - - Future setLabelAccount({int accountIndex, String label}) async { - await account_list.setLabelForAccount( - accountIndex: accountIndex, label: label); - update(); - } - - void refresh() { - if (_isRefreshing) { - return; - } - - try { - _isRefreshing = true; - account_list.refreshAccounts(); - _isRefreshing = false; - } catch (e) { - _isRefreshing = false; - print(e); - rethrow; - } - } -} diff --git a/lib/monero/monero_amount_format.dart b/lib/monero/monero_amount_format.dart deleted file mode 100644 index 2ade0206e..000000000 --- a/lib/monero/monero_amount_format.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:intl/intl.dart'; -import 'package:cake_wallet/entities/crypto_amount_format.dart'; - -const moneroAmountLength = 12; -const moneroAmountDivider = 1000000000000; -final moneroAmountFormat = NumberFormat() - ..maximumFractionDigits = moneroAmountLength - ..minimumFractionDigits = 1; - -String moneroAmountToString({int amount}) => moneroAmountFormat - .format(cryptoAmountToDouble(amount: amount, divider: moneroAmountDivider)); - -double moneroAmountToDouble({int amount}) => - cryptoAmountToDouble(amount: amount, divider: moneroAmountDivider); - -int moneroParseAmount({String amount}) => - (double.parse(amount) * moneroAmountDivider).toInt(); diff --git a/lib/monero/monero_balance.dart b/lib/monero/monero_balance.dart deleted file mode 100644 index 97b7915fd..000000000 --- a/lib/monero/monero_balance.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:cake_wallet/entities/balance.dart'; -import 'package:cake_wallet/entities/balance_display_mode.dart'; -import 'package:flutter/foundation.dart'; -import 'package:cake_wallet/monero/monero_amount_format.dart'; - -class MoneroBalance extends Balance { - MoneroBalance({@required this.fullBalance, @required this.unlockedBalance}) - : formattedFullBalance = moneroAmountToString(amount: fullBalance), - formattedUnlockedBalance = - moneroAmountToString(amount: unlockedBalance), - super(unlockedBalance, fullBalance); - - MoneroBalance.fromString( - {@required this.formattedFullBalance, - @required this.formattedUnlockedBalance}) - : fullBalance = moneroParseAmount(amount: formattedFullBalance), - unlockedBalance = moneroParseAmount(amount: formattedUnlockedBalance), - super(moneroParseAmount(amount: formattedUnlockedBalance), - moneroParseAmount(amount: formattedFullBalance)); - - final int fullBalance; - final int unlockedBalance; - final String formattedFullBalance; - final String formattedUnlockedBalance; - - @override - String get formattedAvailableBalance => formattedUnlockedBalance; - - @override - String get formattedAdditionalBalance => formattedFullBalance; -} diff --git a/lib/monero/monero_subaddress_list.dart b/lib/monero/monero_subaddress_list.dart deleted file mode 100644 index 639aa05e6..000000000 --- a/lib/monero/monero_subaddress_list.dart +++ /dev/null @@ -1,84 +0,0 @@ -import 'package:cw_monero/structs/subaddress_row.dart'; -import 'package:flutter/services.dart'; -import 'package:mobx/mobx.dart'; -import 'package:cw_monero/subaddress_list.dart' as subaddress_list; -import 'package:cake_wallet/monero/subaddress.dart'; - -part 'monero_subaddress_list.g.dart'; - -class MoneroSubaddressList = MoneroSubaddressListBase - with _$MoneroSubaddressList; - -abstract class MoneroSubaddressListBase with Store { - MoneroSubaddressListBase() { - _isRefreshing = false; - _isUpdating = false; - subaddresses = ObservableList(); - } - - @observable - ObservableList subaddresses; - - bool _isRefreshing; - bool _isUpdating; - - void update({int accountIndex}) { - if (_isUpdating) { - return; - } - - try { - _isUpdating = true; - refresh(accountIndex: accountIndex); - subaddresses.clear(); - subaddresses.addAll(getAll()); - _isUpdating = false; - } catch (e) { - _isUpdating = false; - rethrow; - } - } - - List getAll() { - var subaddresses = subaddress_list.getAllSubaddresses(); - - if (subaddresses.length > 2) { - final primary = subaddresses.first; - final rest = subaddresses.sublist(1).reversed; - subaddresses = [primary] + rest.toList(); - } - - return subaddresses - .map((subaddressRow) => Subaddress.fromRow(subaddressRow)) - .toList(); - } - - Future addSubaddress({int accountIndex, String label}) async { - await subaddress_list.addSubaddress( - accountIndex: accountIndex, label: label); - update(accountIndex: accountIndex); - } - - Future setLabelSubaddress( - {int accountIndex, int addressIndex, String label}) async { - await subaddress_list.setLabelForSubaddress( - accountIndex: accountIndex, addressIndex: addressIndex, label: label); - update(accountIndex: accountIndex); - } - - void refresh({int accountIndex}) { - if (_isRefreshing) { - return; - } - - try { - _isRefreshing = true; - subaddress_list.refreshSubaddresses(accountIndex: accountIndex); - _isRefreshing = false; - } on PlatformException catch (e) { - _isRefreshing = false; - print(e); - rethrow; - } - } -} diff --git a/lib/monero/monero_transaction_creation_credentials.dart b/lib/monero/monero_transaction_creation_credentials.dart deleted file mode 100644 index 1a9430619..000000000 --- a/lib/monero/monero_transaction_creation_credentials.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:cake_wallet/entities/transaction_creation_credentials.dart'; -import 'package:cake_wallet/entities/monero_transaction_priority.dart'; -import 'package:cake_wallet/view_model/send/output.dart'; - -class MoneroTransactionCreationCredentials - extends TransactionCreationCredentials { - MoneroTransactionCreationCredentials({this.outputs, this.priority}); - - final List outputs; - final MoneroTransactionPriority priority; -} diff --git a/lib/monero/monero_transaction_creation_exception.dart b/lib/monero/monero_transaction_creation_exception.dart deleted file mode 100644 index 19c1b718a..000000000 --- a/lib/monero/monero_transaction_creation_exception.dart +++ /dev/null @@ -1,8 +0,0 @@ -class MoneroTransactionCreationException implements Exception { - MoneroTransactionCreationException(this.message); - - final String message; - - @override - String toString() => message; -} \ No newline at end of file diff --git a/lib/monero/monero_transaction_history.dart b/lib/monero/monero_transaction_history.dart deleted file mode 100644 index 11eaff4b6..000000000 --- a/lib/monero/monero_transaction_history.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'dart:core'; -import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/monero/monero_transaction_info.dart'; - -part 'monero_transaction_history.g.dart'; - -class MoneroTransactionHistory = MoneroTransactionHistoryBase - with _$MoneroTransactionHistory; - -abstract class MoneroTransactionHistoryBase - extends TransactionHistoryBase with Store { - MoneroTransactionHistoryBase() { - transactions = ObservableMap(); - } - - @override - Future save() async {} - - @override - void addOne(MoneroTransactionInfo transaction) => - transactions[transaction.id] = transaction; - - @override - void addMany(Map transactions) => - this.transactions.addAll(transactions); -} diff --git a/lib/monero/monero_transaction_info.dart b/lib/monero/monero_transaction_info.dart deleted file mode 100644 index 0a700835a..000000000 --- a/lib/monero/monero_transaction_info.dart +++ /dev/null @@ -1,68 +0,0 @@ -import 'package:cake_wallet/entities/transaction_info.dart'; -import 'package:cake_wallet/monero/monero_amount_format.dart'; -import 'package:cw_monero/structs/transaction_info_row.dart'; -import 'package:cake_wallet/entities/parseBoolFromString.dart'; -import 'package:cake_wallet/entities/transaction_direction.dart'; -import 'package:cake_wallet/entities/format_amount.dart'; -import 'package:cw_monero/transaction_history.dart'; - -class MoneroTransactionInfo extends TransactionInfo { - MoneroTransactionInfo(this.id, this.height, this.direction, this.date, - this.isPending, this.amount, this.accountIndex, this.addressIndex, this.fee); - - MoneroTransactionInfo.fromMap(Map map) - : id = (map['hash'] ?? '') as String, - height = (map['height'] ?? 0) as int, - direction = - parseTransactionDirectionFromNumber(map['direction'] as String) ?? - TransactionDirection.incoming, - date = DateTime.fromMillisecondsSinceEpoch( - (int.parse(map['timestamp'] as String) ?? 0) * 1000), - isPending = parseBoolFromString(map['isPending'] as String), - amount = map['amount'] as int, - accountIndex = int.parse(map['accountIndex'] as String), - addressIndex = map['addressIndex'] as int, - key = getTxKey((map['hash'] ?? '') as String), - fee = map['fee'] as int ?? 0; - - MoneroTransactionInfo.fromRow(TransactionInfoRow row) - : id = row.getHash(), - height = row.blockHeight, - direction = parseTransactionDirectionFromInt(row.direction) ?? - TransactionDirection.incoming, - date = DateTime.fromMillisecondsSinceEpoch(row.getDatetime() * 1000), - isPending = row.isPending != 0, - amount = row.getAmount(), - accountIndex = row.subaddrAccount, - addressIndex = row.subaddrIndex, - key = getTxKey(row.getHash()), - fee = row.fee; - - final String id; - final int height; - final TransactionDirection direction; - final DateTime date; - final int accountIndex; - final bool isPending; - final int amount; - final int fee; - final int addressIndex; - String recipientAddress; - String key; - - String _fiatAmount; - - @override - String amountFormatted() => - '${formatAmount(moneroAmountToString(amount: amount))} XMR'; - - @override - String fiatAmount() => _fiatAmount ?? ''; - - @override - void changeFiatAmount(String amount) => _fiatAmount = formatAmount(amount); - - @override - String feeFormatted() => - '${formatAmount(moneroAmountToString(amount: fee))} XMR'; -} diff --git a/lib/monero/monero_wallet.dart b/lib/monero/monero_wallet.dart deleted file mode 100644 index 4195449c6..000000000 --- a/lib/monero/monero_wallet.dart +++ /dev/null @@ -1,413 +0,0 @@ -import 'dart:async'; -import 'package:cake_wallet/entities/transaction_priority.dart'; -import 'package:cake_wallet/monero/monero_amount_format.dart'; -import 'package:cake_wallet/monero/monero_transaction_creation_exception.dart'; -import 'package:cake_wallet/monero/monero_transaction_info.dart'; -import 'package:cake_wallet/monero/monero_wallet_addresses.dart'; -import 'package:cake_wallet/monero/monero_wallet_utils.dart'; -import 'package:cw_monero/structs/pending_transaction.dart'; -import 'package:flutter/foundation.dart'; -import 'package:mobx/mobx.dart'; -import 'package:cw_monero/transaction_history.dart' - as monero_transaction_history; -import 'package:cw_monero/wallet.dart'; -import 'package:cw_monero/wallet.dart' as monero_wallet; -import 'package:cw_monero/transaction_history.dart' as transaction_history; -import 'package:cw_monero/monero_output.dart'; -import 'package:cake_wallet/monero/monero_transaction_creation_credentials.dart'; -import 'package:cake_wallet/monero/pending_monero_transaction.dart'; -import 'package:cake_wallet/monero/monero_wallet_keys.dart'; -import 'package:cake_wallet/monero/monero_balance.dart'; -import 'package:cake_wallet/monero/monero_transaction_history.dart'; -import 'package:cake_wallet/monero/account.dart'; -import 'package:cake_wallet/core/pending_transaction.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/entities/node.dart'; -import 'package:cake_wallet/entities/monero_transaction_priority.dart'; - -part 'monero_wallet.g.dart'; - -const moneroBlockSize = 1000; - -class MoneroWallet = MoneroWalletBase with _$MoneroWallet; - -abstract class MoneroWalletBase extends WalletBase with Store { - MoneroWalletBase({WalletInfo walletInfo}) - : super(walletInfo) { - transactionHistory = MoneroTransactionHistory(); - balance = MoneroBalance( - fullBalance: monero_wallet.getFullBalance(accountIndex: 0), - unlockedBalance: monero_wallet.getFullBalance(accountIndex: 0)); - _isTransactionUpdating = false; - _hasSyncAfterStartup = false; - walletAddresses = MoneroWalletAddresses(walletInfo); - _onAccountChangeReaction = reaction((_) => walletAddresses.account, - (Account account) { - balance = MoneroBalance( - fullBalance: monero_wallet.getFullBalance(accountIndex: account.id), - unlockedBalance: - monero_wallet.getUnlockedBalance(accountIndex: account.id)); - walletAddresses.updateSubaddressList(accountIndex: account.id); - }); - } - - static const int _autoSaveInterval = 30; - - @override - MoneroWalletAddresses walletAddresses; - - @override - @observable - SyncStatus syncStatus; - - @override - @observable - MoneroBalance balance; - - @override - String get seed => monero_wallet.getSeed(); - - @override - MoneroWalletKeys get keys => MoneroWalletKeys( - privateSpendKey: monero_wallet.getSecretSpendKey(), - privateViewKey: monero_wallet.getSecretViewKey(), - publicSpendKey: monero_wallet.getPublicSpendKey(), - publicViewKey: monero_wallet.getPublicViewKey()); - - SyncListener _listener; - ReactionDisposer _onAccountChangeReaction; - bool _isTransactionUpdating; - bool _hasSyncAfterStartup; - Timer _autoSaveTimer; - - Future init() async { - await walletAddresses.init(); - balance = MoneroBalance( - fullBalance: monero_wallet.getFullBalance(accountIndex: walletAddresses.account.id), - unlockedBalance: - monero_wallet.getUnlockedBalance(accountIndex: walletAddresses.account.id)); - _setListeners(); - await updateTransactions(); - - if (walletInfo.isRecovery) { - monero_wallet.setRecoveringFromSeed(isRecovery: walletInfo.isRecovery); - - if (monero_wallet.getCurrentHeight() <= 1) { - monero_wallet.setRefreshFromBlockHeight( - height: walletInfo.restoreHeight); - } - } - - _autoSaveTimer = Timer.periodic( - Duration(seconds: _autoSaveInterval), - (_) async => await save()); - } - - @override - void close() { - _listener?.stop(); - _onAccountChangeReaction?.reaction?.dispose(); - _autoSaveTimer?.cancel(); - } - - @override - Future connectToNode({@required Node node}) async { - try { - syncStatus = ConnectingSyncStatus(); - await monero_wallet.setupNode( - address: node.uri.toString(), - login: node.login, - password: node.password, - useSSL: node.isSSL, - isLightWallet: false); // FIXME: hardcoded value - syncStatus = ConnectedSyncStatus(); - } catch (e) { - syncStatus = FailedSyncStatus(); - print(e); - } - } - - @override - Future startSync() async { - try { - _setInitialHeight(); - } catch (_) {} - - try { - syncStatus = StartingSyncStatus(); - monero_wallet.startRefresh(); - _setListeners(); - _listener?.start(); - } catch (e) { - syncStatus = FailedSyncStatus(); - print(e); - rethrow; - } - } - - @override - Future createTransaction(Object credentials) async { - final _credentials = credentials as MoneroTransactionCreationCredentials; - final outputs = _credentials.outputs; - final hasMultiDestination = outputs.length > 1; - final unlockedBalance = - monero_wallet.getUnlockedBalance(accountIndex: walletAddresses.account.id); - - PendingTransactionDescription pendingTransactionDescription; - - if (!(syncStatus is SyncedSyncStatus)) { - throw MoneroTransactionCreationException('The wallet is not synced.'); - } - - if (hasMultiDestination) { - if (outputs.any((item) => item.sendAll - || item.formattedCryptoAmount <= 0)) { - throw MoneroTransactionCreationException('Wrong balance. Not enough XMR on your balance.'); - } - - final int totalAmount = outputs.fold(0, (acc, value) => - acc + value.formattedCryptoAmount); - - if (unlockedBalance < totalAmount) { - throw MoneroTransactionCreationException('Wrong balance. Not enough XMR on your balance.'); - } - - final moneroOutputs = outputs.map((output) { - final outputAddress = output.isParsedAddress - ? output.extractedAddress - : output.address; - - return MoneroOutput( - address: outputAddress, - amount: output.cryptoAmount.replaceAll(',', '.')); - }).toList(); - - pendingTransactionDescription = - await transaction_history.createTransactionMultDest( - outputs: moneroOutputs, - priorityRaw: _credentials.priority.serialize(), - accountIndex: walletAddresses.account.id); - } else { - final output = outputs.first; - final address = output.isParsedAddress - ? output.extractedAddress - : output.address; - final amount = output.sendAll - ? null - : output.cryptoAmount.replaceAll(',', '.'); - final formattedAmount = output.sendAll - ? null - : output.formattedCryptoAmount; - - if ((formattedAmount != null && unlockedBalance < formattedAmount) || - (formattedAmount == null && unlockedBalance <= 0)) { - final formattedBalance = moneroAmountToString(amount: unlockedBalance); - - throw MoneroTransactionCreationException( - 'Incorrect unlocked balance. Unlocked: $formattedBalance. Transaction amount: ${output.cryptoAmount}.'); - } - - pendingTransactionDescription = - await transaction_history.createTransaction( - address: address, - amount: amount, - priorityRaw: _credentials.priority.serialize(), - accountIndex: walletAddresses.account.id); - } - - return PendingMoneroTransaction(pendingTransactionDescription); - } - - @override - int calculateEstimatedFee(TransactionPriority priority, int amount) { - // FIXME: hardcoded value; - - if (priority is MoneroTransactionPriority) { - switch (priority) { - case MoneroTransactionPriority.slow: - return 24590000; - case MoneroTransactionPriority.regular: - return 123050000; - case MoneroTransactionPriority.medium: - return 245029999; - case MoneroTransactionPriority.fast: - return 614530000; - case MoneroTransactionPriority.fastest: - return 26021600000; - } - } - - return 0; - } - - @override - Future save() async { - await walletAddresses.updateAddressesInBox(); - await backupWalletFiles(name); - await monero_wallet.store(); - } - - Future getNodeHeight() async => monero_wallet.getNodeHeight(); - - Future isConnected() async => monero_wallet.isConnected(); - - Future setAsRecovered() async { - walletInfo.isRecovery = false; - await walletInfo.save(); - } - - @override - Future rescan({int height}) async { - walletInfo.restoreHeight = height; - walletInfo.isRecovery = true; - monero_wallet.setRefreshFromBlockHeight(height: height); - monero_wallet.rescanBlockchainAsync(); - await startSync(); - _askForUpdateBalance(); - walletAddresses.accountList.update(); - await _askForUpdateTransactionHistory(); - await save(); - await walletInfo.save(); - } - - String getTransactionAddress(int accountIndex, int addressIndex) => - monero_wallet.getAddress( - accountIndex: accountIndex, - addressIndex: addressIndex); - - @override - Future> fetchTransactions() async { - monero_transaction_history.refreshTransactions(); - return _getAllTransactions(null).fold>( - {}, - (Map acc, MoneroTransactionInfo tx) { - acc[tx.id] = tx; - return acc; - }); - } - - Future updateTransactions() async { - try { - if (_isTransactionUpdating) { - return; - } - - _isTransactionUpdating = true; - final transactions = await fetchTransactions(); - transactionHistory.addMany(transactions); - await transactionHistory.save(); - _isTransactionUpdating = false; - } catch (e) { - print(e); - _isTransactionUpdating = false; - } - } - - List _getAllTransactions(dynamic _) => - monero_transaction_history - .getAllTransations() - .map((row) => MoneroTransactionInfo.fromRow(row)) - .toList(); - - void _setListeners() { - _listener?.stop(); - _listener = monero_wallet.setListeners(_onNewBlock, _onNewTransaction); - } - - void _setInitialHeight() { - if (walletInfo.isRecovery) { - return; - } - - final currentHeight = getCurrentHeight(); - - if (currentHeight <= 1) { - final height = _getHeightByDate(walletInfo.date); - monero_wallet.setRecoveringFromSeed(isRecovery: true); - monero_wallet.setRefreshFromBlockHeight(height: height); - } - } - - int _getHeightDistance(DateTime date) { - final distance = - DateTime.now().millisecondsSinceEpoch - date.millisecondsSinceEpoch; - final daysTmp = (distance / 86400).round(); - final days = daysTmp < 1 ? 1 : daysTmp; - - return days * 1000; - } - - int _getHeightByDate(DateTime date) { - final nodeHeight = monero_wallet.getNodeHeightSync(); - final heightDistance = _getHeightDistance(date); - - if (nodeHeight <= 0) { - return 0; - } - - return nodeHeight - heightDistance; - } - - void _askForUpdateBalance() { - final unlockedBalance = _getUnlockedBalance(); - final fullBalance = _getFullBalance(); - - if (balance.fullBalance != fullBalance || - balance.unlockedBalance != unlockedBalance) { - balance = MoneroBalance( - fullBalance: fullBalance, unlockedBalance: unlockedBalance); - } - } - - Future _askForUpdateTransactionHistory() async => - await updateTransactions(); - - int _getFullBalance() => - monero_wallet.getFullBalance(accountIndex: walletAddresses.account.id); - - int _getUnlockedBalance() => - monero_wallet.getUnlockedBalance(accountIndex: walletAddresses.account.id); - - void _onNewBlock(int height, int blocksLeft, double ptc) async { - try { - if (walletInfo.isRecovery) { - await _askForUpdateTransactionHistory(); - _askForUpdateBalance(); - walletAddresses.accountList.update(); - } - - if (blocksLeft < 100) { - await _askForUpdateTransactionHistory(); - _askForUpdateBalance(); - walletAddresses.accountList.update(); - syncStatus = SyncedSyncStatus(); - - if (!_hasSyncAfterStartup) { - _hasSyncAfterStartup = true; - await save(); - } - - if (walletInfo.isRecovery) { - await setAsRecovered(); - } - } else { - syncStatus = SyncingSyncStatus(blocksLeft, ptc); - } - } catch (e) { - print(e.toString()); - } - } - - void _onNewTransaction() async { - try { - await _askForUpdateTransactionHistory(); - _askForUpdateBalance(); - await Future.delayed(Duration(seconds: 1)); - } catch (e) { - print(e.toString()); - } - } -} diff --git a/lib/monero/monero_wallet_addresses.dart b/lib/monero/monero_wallet_addresses.dart deleted file mode 100644 index d14caa27b..000000000 --- a/lib/monero/monero_wallet_addresses.dart +++ /dev/null @@ -1,85 +0,0 @@ -import 'package:cake_wallet/entities/wallet_addresses.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/monero/account.dart'; -import 'package:cake_wallet/monero/monero_account_list.dart'; -import 'package:cake_wallet/monero/monero_subaddress_list.dart'; -import 'package:cake_wallet/monero/subaddress.dart'; -import 'package:mobx/mobx.dart'; - -part 'monero_wallet_addresses.g.dart'; - -class MoneroWalletAddresses = MoneroWalletAddressesBase - with _$MoneroWalletAddresses; - -abstract class MoneroWalletAddressesBase extends WalletAddresses with Store { - MoneroWalletAddressesBase(WalletInfo walletInfo) : super(walletInfo) { - accountList = MoneroAccountList(); - subaddressList = MoneroSubaddressList(); - } - - @override - @observable - String address; - - @observable - Account account; - - @observable - Subaddress subaddress; - - MoneroSubaddressList subaddressList; - - MoneroAccountList accountList; - - @override - Future init() async { - accountList.update(); - account = accountList.accounts.first; - updateSubaddressList(accountIndex: account.id ?? 0); - await updateAddressesInBox(); - } - - @override - Future updateAddressesInBox() async { - try { - final _subaddressList = MoneroSubaddressList(); - - addressesMap.clear(); - - accountList.accounts.forEach((account) { - _subaddressList.update(accountIndex: account.id); - _subaddressList.subaddresses.forEach((subaddress) { - addressesMap[subaddress.address] = subaddress.label; - }); - }); - - await saveAddressesInBox(); - } catch (e) { - print(e.toString()); - } - } - - bool validate() { - accountList.update(); - final accountListLength = accountList.accounts?.length ?? 0; - - if (accountListLength <= 0) { - return false; - } - - subaddressList.update(accountIndex: accountList.accounts.first.id); - final subaddressListLength = subaddressList.subaddresses?.length ?? 0; - - if (subaddressListLength <= 0) { - return false; - } - - return true; - } - - void updateSubaddressList({int accountIndex}) { - subaddressList.update(accountIndex: accountIndex); - subaddress = subaddressList.subaddresses.first; - address = subaddress.address; - } -} \ No newline at end of file diff --git a/lib/monero/monero_wallet_keys.dart b/lib/monero/monero_wallet_keys.dart deleted file mode 100644 index f0a96bfd3..000000000 --- a/lib/monero/monero_wallet_keys.dart +++ /dev/null @@ -1,12 +0,0 @@ -class MoneroWalletKeys { - const MoneroWalletKeys( - {this.privateSpendKey, - this.privateViewKey, - this.publicSpendKey, - this.publicViewKey}); - - final String publicViewKey; - final String privateViewKey; - final String publicSpendKey; - final String privateSpendKey; -} \ No newline at end of file diff --git a/lib/monero/monero_wallet_service.dart b/lib/monero/monero_wallet_service.dart deleted file mode 100644 index 0fbc0e876..000000000 --- a/lib/monero/monero_wallet_service.dart +++ /dev/null @@ -1,229 +0,0 @@ -import 'dart:io'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/monero/monero_wallet_utils.dart'; -import 'package:hive/hive.dart'; -import 'package:cw_monero/wallet_manager.dart' as monero_wallet_manager; -import 'package:cw_monero/wallet.dart' as monero_wallet; -import 'package:cw_monero/exceptions/wallet_opening_exception.dart'; -import 'package:cake_wallet/monero/monero_wallet.dart'; -import 'package:cake_wallet/core/wallet_credentials.dart'; -import 'package:cake_wallet/core/wallet_service.dart'; -import 'package:cake_wallet/entities/pathForWallet.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; - -class MoneroNewWalletCredentials extends WalletCredentials { - MoneroNewWalletCredentials({String name, String password, this.language}) - : super(name: name, password: password); - - final String language; -} - -class MoneroRestoreWalletFromSeedCredentials extends WalletCredentials { - MoneroRestoreWalletFromSeedCredentials( - {String name, String password, int height, this.mnemonic}) - : super(name: name, password: password, height: height); - - final String mnemonic; -} - -class MoneroWalletLoadingException implements Exception { - @override - String toString() => 'Failure to load the wallet.'; -} - -class MoneroRestoreWalletFromKeysCredentials extends WalletCredentials { - MoneroRestoreWalletFromKeysCredentials( - {String name, - String password, - this.language, - this.address, - this.viewKey, - this.spendKey, - int height}) - : super(name: name, password: password, height: height); - - final String language; - final String address; - final String viewKey; - final String spendKey; -} - -class MoneroWalletService extends WalletService< - MoneroNewWalletCredentials, - MoneroRestoreWalletFromSeedCredentials, - MoneroRestoreWalletFromKeysCredentials> { - MoneroWalletService(this.walletInfoSource); - - final Box walletInfoSource; - - static bool walletFilesExist(String path) => - !File(path).existsSync() && !File('$path.keys').existsSync(); - - @override - WalletType getType() => WalletType.monero; - - @override - Future create(MoneroNewWalletCredentials credentials) async { - try { - final path = await pathForWallet(name: credentials.name, type: getType()); - await monero_wallet_manager.createWallet( - path: path, - password: credentials.password, - language: credentials.language); - final wallet = MoneroWallet(walletInfo: credentials.walletInfo); - await wallet.init(); - - return wallet; - } catch (e) { - // TODO: Implement Exception for wallet list service. - print('MoneroWalletsManager Error: ${e.toString()}'); - rethrow; - } - } - - @override - Future isWalletExit(String name) async { - try { - final path = await pathForWallet(name: name, type: getType()); - return monero_wallet_manager.isWalletExist(path: path); - } catch (e) { - // TODO: Implement Exception for wallet list service. - print('MoneroWalletsManager Error: $e'); - rethrow; - } - } - - @override - Future openWallet(String name, String password) async { - try { - final path = await pathForWallet(name: name, type: getType()); - - if (walletFilesExist(path)) { - await repairOldAndroidWallet(name); - } - - await monero_wallet_manager - .openWalletAsync({'path': path, 'password': password}); - final walletInfo = walletInfoSource.values.firstWhere( - (info) => info.id == WalletBase.idFor(name, getType()), - orElse: () => null); - final wallet = MoneroWallet(walletInfo: walletInfo); - final isValid = wallet.walletAddresses.validate(); - - if (!isValid) { - await restoreOrResetWalletFiles(name); - wallet.close(); - return openWallet(name, password); - } - - await wallet.init(); - - return wallet; - } catch (e) { - // TODO: Implement Exception for wallet list service. - - if ((e.toString().contains('bad_alloc') || - (e is WalletOpeningException && - (e.message == 'std::bad_alloc' || - e.message.contains('bad_alloc')))) || - (e.toString().contains('does not correspond') || - (e is WalletOpeningException && - e.message.contains('does not correspond')))) { - await restoreOrResetWalletFiles(name); - return openWallet(name, password); - } - - rethrow; - } - } - - @override - Future remove(String wallet) async { - final path = await pathForWalletDir(name: wallet, type: getType()); - final file = Directory(path); - final isExist = file.existsSync(); - - if (isExist) { - await file.delete(recursive: true); - } - } - - @override - Future restoreFromKeys( - MoneroRestoreWalletFromKeysCredentials credentials) async { - try { - final path = await pathForWallet(name: credentials.name, type: getType()); - await monero_wallet_manager.restoreFromKeys( - path: path, - password: credentials.password, - language: credentials.language, - restoreHeight: credentials.height, - address: credentials.address, - viewKey: credentials.viewKey, - spendKey: credentials.spendKey); - final wallet = MoneroWallet(walletInfo: credentials.walletInfo); - await wallet.init(); - - return wallet; - } catch (e) { - // TODO: Implement Exception for wallet list service. - print('MoneroWalletsManager Error: $e'); - rethrow; - } - } - - @override - Future restoreFromSeed( - MoneroRestoreWalletFromSeedCredentials credentials) async { - try { - final path = await pathForWallet(name: credentials.name, type: getType()); - await monero_wallet_manager.restoreFromSeed( - path: path, - password: credentials.password, - seed: credentials.mnemonic, - restoreHeight: credentials.height); - final wallet = MoneroWallet(walletInfo: credentials.walletInfo); - await wallet.init(); - - return wallet; - } catch (e) { - // TODO: Implement Exception for wallet list service. - print('MoneroWalletsManager Error: $e'); - rethrow; - } - } - - Future repairOldAndroidWallet(String name) async { - try { - if (!Platform.isAndroid) { - return; - } - - final oldAndroidWalletDirPath = - await outdatedAndroidPathForWalletDir(name: name); - final dir = Directory(oldAndroidWalletDirPath); - - if (!dir.existsSync()) { - return; - } - - final newWalletDirPath = - await pathForWalletDir(name: name, type: getType()); - - dir.listSync().forEach((f) { - final file = File(f.path); - final name = f.path.split('/').last; - final newPath = newWalletDirPath + '/$name'; - final newFile = File(newPath); - - if (!newFile.existsSync()) { - newFile.createSync(); - } - newFile.writeAsBytesSync(file.readAsBytesSync()); - }); - } catch (e) { - print(e.toString()); - } - } -} diff --git a/lib/monero/monero_wallet_utils.dart b/lib/monero/monero_wallet_utils.dart deleted file mode 100644 index b0e509085..000000000 --- a/lib/monero/monero_wallet_utils.dart +++ /dev/null @@ -1,88 +0,0 @@ -import 'dart:io'; -import 'package:cake_wallet/entities/pathForWallet.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; - -String backupFileName(String originalPath) { - final pathParts = originalPath.split('/'); - final newName = '#_${pathParts.last}'; - pathParts.removeLast(); - pathParts.add(newName); - return pathParts.join('/'); -} - -Future backupWalletFiles(String name) async { - final path = await pathForWallet(name: name, type: WalletType.monero); - final cacheFile = File(path); - final keysFile = File('$path.keys'); - final addressListFile = File('$path.address.txt'); - final newCacheFilePath = backupFileName(cacheFile.path); - final newKeysFilePath = backupFileName(keysFile.path); - final newAddressListFilePath = backupFileName(addressListFile.path); - - if (cacheFile.existsSync()) { - await cacheFile.copy(newCacheFilePath); - } - - if (keysFile.existsSync()) { - await keysFile.copy(newKeysFilePath); - } - - if (addressListFile.existsSync()) { - await addressListFile.copy(newAddressListFilePath); - } -} - -Future restoreWalletFiles(String name) async { - final walletDirPath = await pathForWalletDir(name: name, type: WalletType.monero); - final cacheFilePath = '$walletDirPath/$name'; - final keysFilePath = '$walletDirPath/$name.keys'; - final addressListFilePath = '$walletDirPath/$name.address.txt'; - final backupCacheFile = File(backupFileName(cacheFilePath)); - final backupKeysFile = File(backupFileName(keysFilePath)); - final backupAddressListFile = File(backupFileName(addressListFilePath)); - - if (backupCacheFile.existsSync()) { - await backupCacheFile.copy(cacheFilePath); - } - - if (backupKeysFile.existsSync()) { - await backupKeysFile.copy(keysFilePath); - } - - if (backupAddressListFile.existsSync()) { - await backupAddressListFile.copy(addressListFilePath); - } -} - -Future backupWalletFilesExists(String name) async { - final walletDirPath = await pathForWalletDir(name: name, type: WalletType.monero); - final cacheFilePath = '$walletDirPath/$name'; - final keysFilePath = '$walletDirPath/$name.keys'; - final addressListFilePath = '$walletDirPath/$name.address.txt'; - final backupCacheFile = File(backupFileName(cacheFilePath)); - final backupKeysFile = File(backupFileName(keysFilePath)); - final backupAddressListFile = File(backupFileName(addressListFilePath)); - - return backupCacheFile.existsSync() - && backupKeysFile.existsSync() - && backupAddressListFile.existsSync(); -} - -Future removeCache(String name) async { - final path = await pathForWallet(name: name, type: WalletType.monero); - final cacheFile = File(path); - - if (cacheFile.existsSync()) { - cacheFile.deleteSync(); - } -} - -Future restoreOrResetWalletFiles(String name) async { - final backupsExists = await backupWalletFilesExists(name); - - if (backupsExists) { - await restoreWalletFiles(name); - } - - removeCache(name); -} \ No newline at end of file diff --git a/lib/monero/mymonero.dart b/lib/monero/mymonero.dart deleted file mode 100644 index d50e48b64..000000000 --- a/lib/monero/mymonero.dart +++ /dev/null @@ -1,1689 +0,0 @@ -const prefixLength = 3; - -String swapEndianBytes(String original) { - if (original.length != 8) { - return ''; - } - - return original[6] + - original[7] + - original[4] + - original[5] + - original[2] + - original[3] + - original[0] + - original[1]; -} - -List tructWords(List wordSet) { - final start = 0; - final end = prefixLength; - - return wordSet.map((word) => word.substring(start, end)).toList(); -} - -String mnemonicDecode(String seed) { - final n = englistWordSet.length; - var out = ''; - var wlist = seed.split(' '); - wlist.removeLast(); - - for (var i = 0; i < wlist.length; i += 3) { - final w1 = - tructWords(englistWordSet).indexOf(wlist[i].substring(0, prefixLength)); - final w2 = tructWords(englistWordSet) - .indexOf(wlist[i + 1].substring(0, prefixLength)); - final w3 = tructWords(englistWordSet) - .indexOf(wlist[i + 2].substring(0, prefixLength)); - - if (w1 == -1 || w2 == -1 || w3 == -1) { - print("invalid word in mnemonic"); - return ''; - } - - final x = w1 + n * (((n - w1) + w2) % n) + n * n * (((n - w2) + w3) % n); - - if (x % n != w1) { - print("Something went wrong when decoding your private key, please try again"); - return ''; - } - - final _res = '0000000' + x.toRadixString(16); - final start = _res.length - 8; - final end = _res.length; - final res = _res.substring(start, end); - - out += swapEndianBytes(res); - } - - return out; -} - -final englistWordSet = [ - "abbey", - "abducts", - "ability", - "ablaze", - "abnormal", - "abort", - "abrasive", - "absorb", - "abyss", - "academy", - "aces", - "aching", - "acidic", - "acoustic", - "acquire", - "across", - "actress", - "acumen", - "adapt", - "addicted", - "adept", - "adhesive", - "adjust", - "adopt", - "adrenalin", - "adult", - "adventure", - "aerial", - "afar", - "affair", - "afield", - "afloat", - "afoot", - "afraid", - "after", - "against", - "agenda", - "aggravate", - "agile", - "aglow", - "agnostic", - "agony", - "agreed", - "ahead", - "aided", - "ailments", - "aimless", - "airport", - "aisle", - "ajar", - "akin", - "alarms", - "album", - "alchemy", - "alerts", - "algebra", - "alkaline", - "alley", - "almost", - "aloof", - "alpine", - "already", - "also", - "altitude", - "alumni", - "always", - "amaze", - "ambush", - "amended", - "amidst", - "ammo", - "amnesty", - "among", - "amply", - "amused", - "anchor", - "android", - "anecdote", - "angled", - "ankle", - "annoyed", - "answers", - "antics", - "anvil", - "anxiety", - "anybody", - "apart", - "apex", - "aphid", - "aplomb", - "apology", - "apply", - "apricot", - "aptitude", - "aquarium", - "arbitrary", - "archer", - "ardent", - "arena", - "argue", - "arises", - "army", - "around", - "arrow", - "arsenic", - "artistic", - "ascend", - "ashtray", - "aside", - "asked", - "asleep", - "aspire", - "assorted", - "asylum", - "athlete", - "atlas", - "atom", - "atrium", - "attire", - "auburn", - "auctions", - "audio", - "august", - "aunt", - "austere", - "autumn", - "avatar", - "avidly", - "avoid", - "awakened", - "awesome", - "awful", - "awkward", - "awning", - "awoken", - "axes", - "axis", - "axle", - "aztec", - "azure", - "baby", - "bacon", - "badge", - "baffles", - "bagpipe", - "bailed", - "bakery", - "balding", - "bamboo", - "banjo", - "baptism", - "basin", - "batch", - "bawled", - "bays", - "because", - "beer", - "befit", - "begun", - "behind", - "being", - "below", - "bemused", - "benches", - "berries", - "bested", - "betting", - "bevel", - "beware", - "beyond", - "bias", - "bicycle", - "bids", - "bifocals", - "biggest", - "bikini", - "bimonthly", - "binocular", - "biology", - "biplane", - "birth", - "biscuit", - "bite", - "biweekly", - "blender", - "blip", - "bluntly", - "boat", - "bobsled", - "bodies", - "bogeys", - "boil", - "boldly", - "bomb", - "border", - "boss", - "both", - "bounced", - "bovine", - "bowling", - "boxes", - "boyfriend", - "broken", - "brunt", - "bubble", - "buckets", - "budget", - "buffet", - "bugs", - "building", - "bulb", - "bumper", - "bunch", - "business", - "butter", - "buying", - "buzzer", - "bygones", - "byline", - "bypass", - "cabin", - "cactus", - "cadets", - "cafe", - "cage", - "cajun", - "cake", - "calamity", - "camp", - "candy", - "casket", - "catch", - "cause", - "cavernous", - "cease", - "cedar", - "ceiling", - "cell", - "cement", - "cent", - "certain", - "chlorine", - "chrome", - "cider", - "cigar", - "cinema", - "circle", - "cistern", - "citadel", - "civilian", - "claim", - "click", - "clue", - "coal", - "cobra", - "cocoa", - "code", - "coexist", - "coffee", - "cogs", - "cohesive", - "coils", - "colony", - "comb", - "cool", - "copy", - "corrode", - "costume", - "cottage", - "cousin", - "cowl", - "criminal", - "cube", - "cucumber", - "cuddled", - "cuffs", - "cuisine", - "cunning", - "cupcake", - "custom", - "cycling", - "cylinder", - "cynical", - "dabbing", - "dads", - "daft", - "dagger", - "daily", - "damp", - "dangerous", - "dapper", - "darted", - "dash", - "dating", - "dauntless", - "dawn", - "daytime", - "dazed", - "debut", - "decay", - "dedicated", - "deepest", - "deftly", - "degrees", - "dehydrate", - "deity", - "dejected", - "delayed", - "demonstrate", - "dented", - "deodorant", - "depth", - "desk", - "devoid", - "dewdrop", - "dexterity", - "dialect", - "dice", - "diet", - "different", - "digit", - "dilute", - "dime", - "dinner", - "diode", - "diplomat", - "directed", - "distance", - "ditch", - "divers", - "dizzy", - "doctor", - "dodge", - "does", - "dogs", - "doing", - "dolphin", - "domestic", - "donuts", - "doorway", - "dormant", - "dosage", - "dotted", - "double", - "dove", - "down", - "dozen", - "dreams", - "drinks", - "drowning", - "drunk", - "drying", - "dual", - "dubbed", - "duckling", - "dude", - "duets", - "duke", - "dullness", - "dummy", - "dunes", - "duplex", - "duration", - "dusted", - "duties", - "dwarf", - "dwelt", - "dwindling", - "dying", - "dynamite", - "dyslexic", - "each", - "eagle", - "earth", - "easy", - "eating", - "eavesdrop", - "eccentric", - "echo", - "eclipse", - "economics", - "ecstatic", - "eden", - "edgy", - "edited", - "educated", - "eels", - "efficient", - "eggs", - "egotistic", - "eight", - "either", - "eject", - "elapse", - "elbow", - "eldest", - "eleven", - "elite", - "elope", - "else", - "eluded", - "emails", - "ember", - "emerge", - "emit", - "emotion", - "empty", - "emulate", - "energy", - "enforce", - "enhanced", - "enigma", - "enjoy", - "enlist", - "enmity", - "enough", - "enraged", - "ensign", - "entrance", - "envy", - "epoxy", - "equip", - "erase", - "erected", - "erosion", - "error", - "eskimos", - "espionage", - "essential", - "estate", - "etched", - "eternal", - "ethics", - "etiquette", - "evaluate", - "evenings", - "evicted", - "evolved", - "examine", - "excess", - "exhale", - "exit", - "exotic", - "exquisite", - "extra", - "exult", - "fabrics", - "factual", - "fading", - "fainted", - "faked", - "fall", - "family", - "fancy", - "farming", - "fatal", - "faulty", - "fawns", - "faxed", - "fazed", - "feast", - "february", - "federal", - "feel", - "feline", - "females", - "fences", - "ferry", - "festival", - "fetches", - "fever", - "fewest", - "fiat", - "fibula", - "fictional", - "fidget", - "fierce", - "fifteen", - "fight", - "films", - "firm", - "fishing", - "fitting", - "five", - "fixate", - "fizzle", - "fleet", - "flippant", - "flying", - "foamy", - "focus", - "foes", - "foggy", - "foiled", - "folding", - "fonts", - "foolish", - "fossil", - "fountain", - "fowls", - "foxes", - "foyer", - "framed", - "friendly", - "frown", - "fruit", - "frying", - "fudge", - "fuel", - "fugitive", - "fully", - "fuming", - "fungal", - "furnished", - "fuselage", - "future", - "fuzzy", - "gables", - "gadget", - "gags", - "gained", - "galaxy", - "gambit", - "gang", - "gasp", - "gather", - "gauze", - "gave", - "gawk", - "gaze", - "gearbox", - "gecko", - "geek", - "gels", - "gemstone", - "general", - "geometry", - "germs", - "gesture", - "getting", - "geyser", - "ghetto", - "ghost", - "giant", - "giddy", - "gifts", - "gigantic", - "gills", - "gimmick", - "ginger", - "girth", - "giving", - "glass", - "gleeful", - "glide", - "gnaw", - "gnome", - "goat", - "goblet", - "godfather", - "goes", - "goggles", - "going", - "goldfish", - "gone", - "goodbye", - "gopher", - "gorilla", - "gossip", - "gotten", - "gourmet", - "governing", - "gown", - "greater", - "grunt", - "guarded", - "guest", - "guide", - "gulp", - "gumball", - "guru", - "gusts", - "gutter", - "guys", - "gymnast", - "gypsy", - "gyrate", - "habitat", - "hacksaw", - "haggled", - "hairy", - "hamburger", - "happens", - "hashing", - "hatchet", - "haunted", - "having", - "hawk", - "haystack", - "hazard", - "hectare", - "hedgehog", - "heels", - "hefty", - "height", - "hemlock", - "hence", - "heron", - "hesitate", - "hexagon", - "hickory", - "hiding", - "highway", - "hijack", - "hiker", - "hills", - "himself", - "hinder", - "hippo", - "hire", - "history", - "hitched", - "hive", - "hoax", - "hobby", - "hockey", - "hoisting", - "hold", - "honked", - "hookup", - "hope", - "hornet", - "hospital", - "hotel", - "hounded", - "hover", - "howls", - "hubcaps", - "huddle", - "huge", - "hull", - "humid", - "hunter", - "hurried", - "husband", - "huts", - "hybrid", - "hydrogen", - "hyper", - "iceberg", - "icing", - "icon", - "identity", - "idiom", - "idled", - "idols", - "igloo", - "ignore", - "iguana", - "illness", - "imagine", - "imbalance", - "imitate", - "impel", - "inactive", - "inbound", - "incur", - "industrial", - "inexact", - "inflamed", - "ingested", - "initiate", - "injury", - "inkling", - "inline", - "inmate", - "innocent", - "inorganic", - "input", - "inquest", - "inroads", - "insult", - "intended", - "inundate", - "invoke", - "inwardly", - "ionic", - "irate", - "iris", - "irony", - "irritate", - "island", - "isolated", - "issued", - "italics", - "itches", - "items", - "itinerary", - "itself", - "ivory", - "jabbed", - "jackets", - "jaded", - "jagged", - "jailed", - "jamming", - "january", - "jargon", - "jaunt", - "javelin", - "jaws", - "jazz", - "jeans", - "jeers", - "jellyfish", - "jeopardy", - "jerseys", - "jester", - "jetting", - "jewels", - "jigsaw", - "jingle", - "jittery", - "jive", - "jobs", - "jockey", - "jogger", - "joining", - "joking", - "jolted", - "jostle", - "journal", - "joyous", - "jubilee", - "judge", - "juggled", - "juicy", - "jukebox", - "july", - "jump", - "junk", - "jury", - "justice", - "juvenile", - "kangaroo", - "karate", - "keep", - "kennel", - "kept", - "kernels", - "kettle", - "keyboard", - "kickoff", - "kidneys", - "king", - "kiosk", - "kisses", - "kitchens", - "kiwi", - "knapsack", - "knee", - "knife", - "knowledge", - "knuckle", - "koala", - "laboratory", - "ladder", - "lagoon", - "lair", - "lakes", - "lamb", - "language", - "laptop", - "large", - "last", - "later", - "launching", - "lava", - "lawsuit", - "layout", - "lazy", - "lectures", - "ledge", - "leech", - "left", - "legion", - "leisure", - "lemon", - "lending", - "leopard", - "lesson", - "lettuce", - "lexicon", - "liar", - "library", - "licks", - "lids", - "lied", - "lifestyle", - "light", - "likewise", - "lilac", - "limits", - "linen", - "lion", - "lipstick", - "liquid", - "listen", - "lively", - "loaded", - "lobster", - "locker", - "lodge", - "lofty", - "logic", - "loincloth", - "long", - "looking", - "lopped", - "lordship", - "losing", - "lottery", - "loudly", - "love", - "lower", - "loyal", - "lucky", - "luggage", - "lukewarm", - "lullaby", - "lumber", - "lunar", - "lurk", - "lush", - "luxury", - "lymph", - "lynx", - "lyrics", - "macro", - "madness", - "magically", - "mailed", - "major", - "makeup", - "malady", - "mammal", - "maps", - "masterful", - "match", - "maul", - "maverick", - "maximum", - "mayor", - "maze", - "meant", - "mechanic", - "medicate", - "meeting", - "megabyte", - "melting", - "memoir", - "menu", - "merger", - "mesh", - "metro", - "mews", - "mice", - "midst", - "mighty", - "mime", - "mirror", - "misery", - "mittens", - "mixture", - "moat", - "mobile", - "mocked", - "mohawk", - "moisture", - "molten", - "moment", - "money", - "moon", - "mops", - "morsel", - "mostly", - "motherly", - "mouth", - "movement", - "mowing", - "much", - "muddy", - "muffin", - "mugged", - "mullet", - "mumble", - "mundane", - "muppet", - "mural", - "musical", - "muzzle", - "myriad", - "mystery", - "myth", - "nabbing", - "nagged", - "nail", - "names", - "nanny", - "napkin", - "narrate", - "nasty", - "natural", - "nautical", - "navy", - "nearby", - "necklace", - "needed", - "negative", - "neither", - "neon", - "nephew", - "nerves", - "nestle", - "network", - "neutral", - "never", - "newt", - "nexus", - "nibs", - "niche", - "niece", - "nifty", - "nightly", - "nimbly", - "nineteen", - "nirvana", - "nitrogen", - "nobody", - "nocturnal", - "nodes", - "noises", - "nomad", - "noodles", - "northern", - "nostril", - "noted", - "nouns", - "novelty", - "nowhere", - "nozzle", - "nuance", - "nucleus", - "nudged", - "nugget", - "nuisance", - "null", - "number", - "nuns", - "nurse", - "nutshell", - "nylon", - "oaks", - "oars", - "oasis", - "oatmeal", - "obedient", - "object", - "obliged", - "obnoxious", - "observant", - "obtains", - "obvious", - "occur", - "ocean", - "october", - "odds", - "odometer", - "offend", - "often", - "oilfield", - "ointment", - "okay", - "older", - "olive", - "olympics", - "omega", - "omission", - "omnibus", - "onboard", - "oncoming", - "oneself", - "ongoing", - "onion", - "online", - "onslaught", - "onto", - "onward", - "oozed", - "opacity", - "opened", - "opposite", - "optical", - "opus", - "orange", - "orbit", - "orchid", - "orders", - "organs", - "origin", - "ornament", - "orphans", - "oscar", - "ostrich", - "otherwise", - "otter", - "ouch", - "ought", - "ounce", - "ourselves", - "oust", - "outbreak", - "oval", - "oven", - "owed", - "owls", - "owner", - "oxidant", - "oxygen", - "oyster", - "ozone", - "pact", - "paddles", - "pager", - "pairing", - "palace", - "pamphlet", - "pancakes", - "paper", - "paradise", - "pastry", - "patio", - "pause", - "pavements", - "pawnshop", - "payment", - "peaches", - "pebbles", - "peculiar", - "pedantic", - "peeled", - "pegs", - "pelican", - "pencil", - "people", - "pepper", - "perfect", - "pests", - "petals", - "phase", - "pheasants", - "phone", - "phrases", - "physics", - "piano", - "picked", - "pierce", - "pigment", - "piloted", - "pimple", - "pinched", - "pioneer", - "pipeline", - "pirate", - "pistons", - "pitched", - "pivot", - "pixels", - "pizza", - "playful", - "pledge", - "pliers", - "plotting", - "plus", - "plywood", - "poaching", - "pockets", - "podcast", - "poetry", - "point", - "poker", - "polar", - "ponies", - "pool", - "popular", - "portents", - "possible", - "potato", - "pouch", - "poverty", - "powder", - "pram", - "present", - "pride", - "problems", - "pruned", - "prying", - "psychic", - "public", - "puck", - "puddle", - "puffin", - "pulp", - "pumpkins", - "punch", - "puppy", - "purged", - "push", - "putty", - "puzzled", - "pylons", - "pyramid", - "python", - "queen", - "quick", - "quote", - "rabbits", - "racetrack", - "radar", - "rafts", - "rage", - "railway", - "raking", - "rally", - "ramped", - "randomly", - "rapid", - "rarest", - "rash", - "rated", - "ravine", - "rays", - "razor", - "react", - "rebel", - "recipe", - "reduce", - "reef", - "refer", - "regular", - "reheat", - "reinvest", - "rejoices", - "rekindle", - "relic", - "remedy", - "renting", - "reorder", - "repent", - "request", - "reruns", - "rest", - "return", - "reunion", - "revamp", - "rewind", - "rhino", - "rhythm", - "ribbon", - "richly", - "ridges", - "rift", - "rigid", - "rims", - "ringing", - "riots", - "ripped", - "rising", - "ritual", - "river", - "roared", - "robot", - "rockets", - "rodent", - "rogue", - "roles", - "romance", - "roomy", - "roped", - "roster", - "rotate", - "rounded", - "rover", - "rowboat", - "royal", - "ruby", - "rudely", - "ruffled", - "rugged", - "ruined", - "ruling", - "rumble", - "runway", - "rural", - "rustled", - "ruthless", - "sabotage", - "sack", - "sadness", - "safety", - "saga", - "sailor", - "sake", - "salads", - "sample", - "sanity", - "sapling", - "sarcasm", - "sash", - "satin", - "saucepan", - "saved", - "sawmill", - "saxophone", - "sayings", - "scamper", - "scenic", - "school", - "science", - "scoop", - "scrub", - "scuba", - "seasons", - "second", - "sedan", - "seeded", - "segments", - "seismic", - "selfish", - "semifinal", - "sensible", - "september", - "sequence", - "serving", - "session", - "setup", - "seventh", - "sewage", - "shackles", - "shelter", - "shipped", - "shocking", - "shrugged", - "shuffled", - "shyness", - "siblings", - "sickness", - "sidekick", - "sieve", - "sifting", - "sighting", - "silk", - "simplest", - "sincerely", - "sipped", - "siren", - "situated", - "sixteen", - "sizes", - "skater", - "skew", - "skirting", - "skulls", - "skydive", - "slackens", - "sleepless", - "slid", - "slower", - "slug", - "smash", - "smelting", - "smidgen", - "smog", - "smuggled", - "snake", - "sneeze", - "sniff", - "snout", - "snug", - "soapy", - "sober", - "soccer", - "soda", - "software", - "soggy", - "soil", - "solved", - "somewhere", - "sonic", - "soothe", - "soprano", - "sorry", - "southern", - "sovereign", - "sowed", - "soya", - "space", - "speedy", - "sphere", - "spiders", - "splendid", - "spout", - "sprig", - "spud", - "spying", - "square", - "stacking", - "stellar", - "stick", - "stockpile", - "strained", - "stunning", - "stylishly", - "subtly", - "succeed", - "suddenly", - "suede", - "suffice", - "sugar", - "suitcase", - "sulking", - "summon", - "sunken", - "superior", - "surfer", - "sushi", - "suture", - "swagger", - "swept", - "swiftly", - "sword", - "swung", - "syllabus", - "symptoms", - "syndrome", - "syringe", - "system", - "taboo", - "tacit", - "tadpoles", - "tagged", - "tail", - "taken", - "talent", - "tamper", - "tanks", - "tapestry", - "tarnished", - "tasked", - "tattoo", - "taunts", - "tavern", - "tawny", - "taxi", - "teardrop", - "technical", - "tedious", - "teeming", - "tell", - "template", - "tender", - "tepid", - "tequila", - "terminal", - "testing", - "tether", - "textbook", - "thaw", - "theatrics", - "thirsty", - "thorn", - "threaten", - "thumbs", - "thwart", - "ticket", - "tidy", - "tiers", - "tiger", - "tilt", - "timber", - "tinted", - "tipsy", - "tirade", - "tissue", - "titans", - "toaster", - "tobacco", - "today", - "toenail", - "toffee", - "together", - "toilet", - "token", - "tolerant", - "tomorrow", - "tonic", - "toolbox", - "topic", - "torch", - "tossed", - "total", - "touchy", - "towel", - "toxic", - "toyed", - "trash", - "trendy", - "tribal", - "trolling", - "truth", - "trying", - "tsunami", - "tubes", - "tucks", - "tudor", - "tuesday", - "tufts", - "tugs", - "tuition", - "tulips", - "tumbling", - "tunnel", - "turnip", - "tusks", - "tutor", - "tuxedo", - "twang", - "tweezers", - "twice", - "twofold", - "tycoon", - "typist", - "tyrant", - "ugly", - "ulcers", - "ultimate", - "umbrella", - "umpire", - "unafraid", - "unbending", - "uncle", - "under", - "uneven", - "unfit", - "ungainly", - "unhappy", - "union", - "unjustly", - "unknown", - "unlikely", - "unmask", - "unnoticed", - "unopened", - "unplugs", - "unquoted", - "unrest", - "unsafe", - "until", - "unusual", - "unveil", - "unwind", - "unzip", - "upbeat", - "upcoming", - "update", - "upgrade", - "uphill", - "upkeep", - "upload", - "upon", - "upper", - "upright", - "upstairs", - "uptight", - "upwards", - "urban", - "urchins", - "urgent", - "usage", - "useful", - "usher", - "using", - "usual", - "utensils", - "utility", - "utmost", - "utopia", - "uttered", - "vacation", - "vague", - "vain", - "value", - "vampire", - "vane", - "vapidly", - "vary", - "vastness", - "vats", - "vaults", - "vector", - "veered", - "vegan", - "vehicle", - "vein", - "velvet", - "venomous", - "verification", - "vessel", - "veteran", - "vexed", - "vials", - "vibrate", - "victim", - "video", - "viewpoint", - "vigilant", - "viking", - "village", - "vinegar", - "violin", - "vipers", - "virtual", - "visited", - "vitals", - "vivid", - "vixen", - "vocal", - "vogue", - "voice", - "volcano", - "vortex", - "voted", - "voucher", - "vowels", - "voyage", - "vulture", - "wade", - "waffle", - "wagtail", - "waist", - "waking", - "wallets", - "wanted", - "warped", - "washing", - "water", - "waveform", - "waxing", - "wayside", - "weavers", - "website", - "wedge", - "weekday", - "weird", - "welders", - "went", - "wept", - "were", - "western", - "wetsuit", - "whale", - "when", - "whipped", - "whole", - "wickets", - "width", - "wield", - "wife", - "wiggle", - "wildly", - "winter", - "wipeout", - "wiring", - "wise", - "withdrawn", - "wives", - "wizard", - "wobbly", - "woes", - "woken", - "wolf", - "womanly", - "wonders", - "woozy", - "worry", - "wounded", - "woven", - "wrap", - "wrist", - "wrong", - "yacht", - "yahoo", - "yanks", - "yard", - "yawning", - "yearbook", - "yellow", - "yesterday", - "yeti", - "yields", - "yodel", - "yoga", - "younger", - "yoyo", - "zapped", - "zeal", - "zebra", - "zero", - "zesty", - "zigzags", - "zinger", - "zippers", - "zodiac", - "zombie", - "zones", - "zoom" -]; diff --git a/lib/monero/pending_monero_transaction.dart b/lib/monero/pending_monero_transaction.dart deleted file mode 100644 index c939110a0..000000000 --- a/lib/monero/pending_monero_transaction.dart +++ /dev/null @@ -1,47 +0,0 @@ -import 'package:cw_monero/structs/pending_transaction.dart'; -import 'package:cw_monero/transaction_history.dart' - as monero_transaction_history; -import 'package:cake_wallet/entities/crypto_currency.dart'; -import 'package:cake_wallet/core/amount_converter.dart'; -import 'package:cake_wallet/core/pending_transaction.dart'; - -class DoubleSpendException implements Exception { - DoubleSpendException(); - - @override - String toString() => - 'This transaction cannot be committed. This can be due to many reasons including the wallet not being synced, there is not enough XMR in your available balance, or previous transactions are not yet fully processed.'; -} - -class PendingMoneroTransaction with PendingTransaction { - PendingMoneroTransaction(this.pendingTransactionDescription); - - final PendingTransactionDescription pendingTransactionDescription; - - @override - String get id => pendingTransactionDescription.hash; - - @override - String get amountFormatted => AmountConverter.amountIntToString( - CryptoCurrency.xmr, pendingTransactionDescription.amount); - - @override - String get feeFormatted => AmountConverter.amountIntToString( - CryptoCurrency.xmr, pendingTransactionDescription.fee); - - @override - Future commit() async { - try { - monero_transaction_history.commitTransactionFromPointerAddress( - address: pendingTransactionDescription.pointerAddress); - } catch (e) { - final message = e.toString(); - - if (message.contains('Reason: double spend')) { - throw DoubleSpendException(); - } - - rethrow; - } - } -} diff --git a/lib/monero/subaddress.dart b/lib/monero/subaddress.dart deleted file mode 100644 index cb230044a..000000000 --- a/lib/monero/subaddress.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:cw_monero/structs/subaddress_row.dart'; - -class Subaddress { - Subaddress({this.id, this.address, this.label}); - - Subaddress.fromMap(Map map) - : this.id = map['id'] == null ? 0 : int.parse(map['id'] as String), - this.address = (map['address'] ?? '') as String, - this.label = (map['label'] ?? '') as String; - - Subaddress.fromRow(SubaddressRow row) - : this.id = row.getId(), - this.address = row.getAddress(), - this.label = row.getId() == 0 && - row.getLabel().toLowerCase() == 'Primary account'.toLowerCase() - ? 'Primary address' - : row.getLabel(); - - final int id; - final String address; - final String label; -} diff --git a/lib/reactions/check_connection.dart b/lib/reactions/check_connection.dart index b5550fcff..5e18cf15f 100644 --- a/lib/reactions/check_connection.dart +++ b/lib/reactions/check_connection.dart @@ -1,7 +1,7 @@ import 'dart:async'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/sync_status.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:connectivity/connectivity.dart'; diff --git a/lib/reactions/on_current_node_change.dart b/lib/reactions/on_current_node_change.dart index 2922e6ec7..b1271bad1 100644 --- a/lib/reactions/on_current_node_change.dart +++ b/lib/reactions/on_current_node_change.dart @@ -1,5 +1,5 @@ import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/entities/node.dart'; +import 'package:cw_core/node.dart'; import 'package:cake_wallet/store/app_store.dart'; ReactionDisposer _onCurrentNodeChangeReaction; diff --git a/lib/reactions/on_current_wallet_change.dart b/lib/reactions/on_current_wallet_change.dart index 3e3ce4694..4a7f8b101 100644 --- a/lib/reactions/on_current_wallet_change.dart +++ b/lib/reactions/on_current_wallet_change.dart @@ -1,6 +1,6 @@ -import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/entities/balance.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; +import 'package:cw_core/transaction_history.dart'; +import 'package:cw_core/balance.dart'; +import 'package:cw_core/transaction_info.dart'; import 'package:mobx/mobx.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:cake_wallet/di.dart'; @@ -11,8 +11,8 @@ import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart'; import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/core/fiat_conversion_service.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/store/yat/yat_store.dart'; ReactionDisposer _onCurrentWalletChangeReaction; diff --git a/lib/reactions/on_wallet_sync_status_change.dart b/lib/reactions/on_wallet_sync_status_change.dart index f02dd0441..8f14d7927 100644 --- a/lib/reactions/on_wallet_sync_status_change.dart +++ b/lib/reactions/on_wallet_sync_status_change.dart @@ -1,9 +1,9 @@ import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/balance.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; +import 'package:cw_core/transaction_history.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/balance.dart'; +import 'package:cw_core/transaction_info.dart'; +import 'package:cw_core/sync_status.dart'; ReactionDisposer _onWalletSyncStatusChangeReaction; diff --git a/lib/router.dart b/lib/router.dart index 10898f625..1dfde4891 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -28,8 +28,8 @@ import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart'; import 'package:cake_wallet/view_model/wallet_restoration_from_keys_vm.dart'; import 'package:cake_wallet/entities/contact.dart'; import 'package:cake_wallet/exchange/trade.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/transaction_info.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/src/screens/dashboard/dashboard_page.dart'; import 'package:cake_wallet/src/screens/seed/wallet_seed_page.dart'; import 'package:cake_wallet/src/screens/auth/auth_page.dart'; diff --git a/lib/src/screens/buy/pre_order_page.dart b/lib/src/screens/buy/pre_order_page.dart index 474276d79..f6b327e14 100644 --- a/lib/src/screens/buy/pre_order_page.dart +++ b/lib/src/screens/buy/pre_order_page.dart @@ -2,7 +2,7 @@ import 'dart:ui'; import 'package:cake_wallet/buy/buy_amount.dart'; import 'package:cake_wallet/buy/buy_provider.dart'; import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/src/screens/buy/widgets/buy_list_item.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/src/widgets/keyboard_done_button.dart'; diff --git a/lib/src/screens/buy/widgets/buy_list_item.dart b/lib/src/screens/buy/widgets/buy_list_item.dart index 26d173eb4..3d6f19d23 100644 --- a/lib/src/screens/buy/widgets/buy_list_item.dart +++ b/lib/src/screens/buy/widgets/buy_list_item.dart @@ -1,6 +1,6 @@ import 'package:cake_wallet/buy/buy_provider.dart'; import 'package:cake_wallet/buy/get_buy_provider_icon.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/palette.dart'; import 'package:flutter/material.dart'; diff --git a/lib/src/screens/contact/contact_list_page.dart b/lib/src/screens/contact/contact_list_page.dart index fd126981a..e29b78a1e 100644 --- a/lib/src/screens/contact/contact_list_page.dart +++ b/lib/src/screens/contact/contact_list_page.dart @@ -8,7 +8,7 @@ import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart'; diff --git a/lib/src/screens/contact/contact_page.dart b/lib/src/screens/contact/contact_page.dart index be8ac900d..3a140b707 100644 --- a/lib/src/screens/contact/contact_page.dart +++ b/lib/src/screens/contact/contact_page.dart @@ -10,7 +10,7 @@ import 'package:cake_wallet/core/address_validator.dart'; import 'package:cake_wallet/core/contact_name_validator.dart'; import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/view_model/contact_list/contact_view_model.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index 5fb4fb326..5ed599ebf 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/yat/yat_popup.dart'; diff --git a/lib/src/screens/dashboard/widgets/menu_widget.dart b/lib/src/screens/dashboard/widgets/menu_widget.dart index d9e34280a..480dddd32 100644 --- a/lib/src/screens/dashboard/widgets/menu_widget.dart +++ b/lib/src/screens/dashboard/widgets/menu_widget.dart @@ -2,7 +2,7 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/src/screens/dashboard/wallet_menu.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; diff --git a/lib/src/screens/dashboard/widgets/sync_indicator.dart b/lib/src/screens/dashboard/widgets/sync_indicator.dart index 8f2cacae5..ba434d588 100644 --- a/lib/src/screens/dashboard/widgets/sync_indicator.dart +++ b/lib/src/screens/dashboard/widgets/sync_indicator.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; +import 'package:cake_wallet/core/sync_status_title.dart'; import 'package:cake_wallet/palette.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; +import 'package:cw_core/sync_status.dart'; class SyncIndicator extends StatelessWidget { SyncIndicator({@required this.dashboardViewModel}); @@ -15,7 +16,7 @@ class SyncIndicator extends StatelessWidget { builder: (_) { final syncIndicatorWidth = 237.0; final status = dashboardViewModel.status; - final statusText = status != null ? status.title() : ''; + final statusText = status != null ? syncStatusTitle(status) : ''; final progress = status != null ? status.progress() : 0.0; final indicatorOffset = progress * syncIndicatorWidth; final indicatorWidth = progress < 1 diff --git a/lib/src/screens/dashboard/widgets/trade_row.dart b/lib/src/screens/dashboard/widgets/trade_row.dart index 449c4d016..88745aa2c 100644 --- a/lib/src/screens/dashboard/widgets/trade_row.dart +++ b/lib/src/screens/dashboard/widgets/trade_row.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; class TradeRow extends StatelessWidget { diff --git a/lib/src/screens/dashboard/widgets/transaction_raw.dart b/lib/src/screens/dashboard/widgets/transaction_raw.dart index 23a3eccec..9f2c6f734 100644 --- a/lib/src/screens/dashboard/widgets/transaction_raw.dart +++ b/lib/src/screens/dashboard/widgets/transaction_raw.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/entities/transaction_direction.dart'; +import 'package:cw_core/transaction_direction.dart'; import 'package:cake_wallet/generated/i18n.dart'; class TransactionRow extends StatelessWidget { diff --git a/lib/src/screens/exchange/exchange_page.dart b/lib/src/screens/exchange/exchange_page.dart index ca8ef2af6..03bf643df 100644 --- a/lib/src/screens/exchange/exchange_page.dart +++ b/lib/src/screens/exchange/exchange_page.dart @@ -1,7 +1,7 @@ import 'dart:ui'; import 'package:cake_wallet/entities/parsed_address.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/sync_status.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/entities/parse_address_from_domain.dart'; import 'package:cake_wallet/src/screens/send/widgets/extract_address_from_parsed.dart'; import 'package:cake_wallet/src/widgets/standard_checkbox.dart'; @@ -22,7 +22,7 @@ import 'package:cake_wallet/src/widgets/trail_button.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/exchange_card.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; diff --git a/lib/src/screens/exchange/exchange_template_page.dart b/lib/src/screens/exchange/exchange_template_page.dart index 3708df87f..653ec9d13 100644 --- a/lib/src/screens/exchange/exchange_template_page.dart +++ b/lib/src/screens/exchange/exchange_template_page.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/xmrto/xmrto_exchange_provider.dart'; // import 'package:cake_wallet/exchange/exchange_trade_state.dart'; // import 'package:cake_wallet/exchange/limits_state.dart'; diff --git a/lib/src/screens/exchange/widgets/currency_picker.dart b/lib/src/screens/exchange/widgets/currency_picker.dart index 59d53518e..7e149c875 100644 --- a/lib/src/screens/exchange/widgets/currency_picker.dart +++ b/lib/src/screens/exchange/widgets/currency_picker.dart @@ -2,7 +2,7 @@ import 'dart:ui'; import 'package:cake_wallet/palette.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/src/widgets/alert_background.dart'; import 'package:cake_wallet/src/widgets/alert_close_button.dart'; import 'package:cake_wallet/src/widgets/cake_scrollbar.dart'; diff --git a/lib/src/screens/exchange/widgets/exchange_card.dart b/lib/src/screens/exchange/widgets/exchange_card.dart index 727d6808f..0a5580625 100644 --- a/lib/src/screens/exchange/widgets/exchange_card.dart +++ b/lib/src/screens/exchange/widgets/exchange_card.dart @@ -5,7 +5,7 @@ import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/src/widgets/address_text_field.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart'; diff --git a/lib/src/screens/new_wallet/new_wallet_type_page.dart b/lib/src/screens/new_wallet/new_wallet_type_page.dart index f808a237c..d1838c550 100644 --- a/lib/src/screens/new_wallet/new_wallet_type_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_type_page.dart @@ -1,12 +1,12 @@ import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/di.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/view_model/wallet_new_vm.dart'; import 'package:flushbar/flushbar.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; @@ -15,6 +15,7 @@ import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart'; +import 'package:cake_wallet/wallet_types.g.dart'; class NewWalletTypePage extends BasePage { NewWalletTypePage(this.walletNewVM, {this.onTypeSelected, this.isNewWallet}); @@ -71,7 +72,7 @@ class WalletTypeFormState extends State { @override void initState() { - types = [WalletType.bitcoin, WalletType.monero, WalletType.litecoin]; + types = availableWalletTypes; super.initState(); } diff --git a/lib/src/screens/restore/restore_wallet_from_seed_page.dart b/lib/src/screens/restore/restore_wallet_from_seed_page.dart index d81c2eb28..0b4cf2fb1 100644 --- a/lib/src/screens/restore/restore_wallet_from_seed_page.dart +++ b/lib/src/screens/restore/restore_wallet_from_seed_page.dart @@ -13,7 +13,7 @@ import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/seed_widget.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/core/seed_validator.dart'; import 'package:cake_wallet/core/mnemonic_length.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart'; diff --git a/lib/src/screens/restore/restore_wallet_options_page.dart b/lib/src/screens/restore/restore_wallet_options_page.dart index 4ae5e491b..f6b34d44c 100644 --- a/lib/src/screens/restore/restore_wallet_options_page.dart +++ b/lib/src/screens/restore/restore_wallet_options_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:cake_wallet/src/screens/restore/widgets/restore_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/generated/i18n.dart'; class RestoreWalletOptionsPage extends BasePage { diff --git a/lib/src/screens/restore/wallet_restore_from_seed_form.dart b/lib/src/screens/restore/wallet_restore_from_seed_form.dart index 9955750ab..4f9301ee0 100644 --- a/lib/src/screens/restore/wallet_restore_from_seed_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_seed_form.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/view_model/wallet_restore_view_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/src/screens/seed/pre_seed_page.dart b/lib/src/screens/seed/pre_seed_page.dart index 0a12b752a..ba2ce5209 100644 --- a/lib/src/screens/seed/pre_seed_page.dart +++ b/lib/src/screens/seed/pre_seed_page.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/src/screens/send/widgets/send_card.dart b/lib/src/screens/send/widgets/send_card.dart index 17e5df519..0e145d9b5 100644 --- a/lib/src/screens/send/widgets/send_card.dart +++ b/lib/src/screens/send/widgets/send_card.dart @@ -1,5 +1,5 @@ import 'dart:ui'; -import 'package:cake_wallet/entities/transaction_priority.dart'; +import 'package:cw_core/transaction_priority.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/widgets/keyboard_done_button.dart'; import 'package:cake_wallet/src/widgets/picker.dart'; diff --git a/lib/src/screens/wallet_list/wallet_list_page.dart b/lib/src/screens/wallet_list/wallet_list_page.dart index 0d41bda11..a7f634675 100644 --- a/lib/src/screens/wallet_list/wallet_list_page.dart +++ b/lib/src/screens/wallet_list/wallet_list_page.dart @@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; diff --git a/lib/src/widgets/blockchain_height_widget.dart b/lib/src/widgets/blockchain_height_widget.dart index 8626fc8b1..409cacb93 100644 --- a/lib/src/widgets/blockchain_height_widget.dart +++ b/lib/src/widgets/blockchain_height_widget.dart @@ -2,7 +2,7 @@ import 'package:cake_wallet/utils/date_picker.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/monero/get_height_by_date.dart'; +import 'package:cake_wallet/monero/monero.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; class BlockchainHeightWidget extends StatefulWidget { @@ -117,7 +117,7 @@ class BlockchainHeightState extends State { lastDate: now); if (date != null) { - final height = getHeigthByDate(date: date); + final height = monero.getHeigthByDate(date: date); setState(() { dateController.text = DateFormat('yyyy-MM-dd').format(date); diff --git a/lib/src/widgets/seed_widget.dart b/lib/src/widgets/seed_widget.dart index b53dd8644..ef768c0de 100644 --- a/lib/src/widgets/seed_widget.dart +++ b/lib/src/widgets/seed_widget.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/src/widgets/validable_annotated_editable_text.dart'; import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/src/widgets/validable_annotated_editable_text.dart b/lib/src/widgets/validable_annotated_editable_text.dart index 37bde13a2..071d527d9 100644 --- a/lib/src/widgets/validable_annotated_editable_text.dart +++ b/lib/src/widgets/validable_annotated_editable_text.dart @@ -1,5 +1,5 @@ import 'package:cake_wallet/core/seed_validator.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:flutter/material.dart'; class Annotation extends Comparable { diff --git a/lib/store/app_store.dart b/lib/store/app_store.dart index aee7610cd..84bae1d5b 100644 --- a/lib/store/app_store.dart +++ b/lib/store/app_store.dart @@ -1,8 +1,8 @@ -import 'package:cake_wallet/entities/transaction_info.dart'; +import 'package:cw_core/transaction_info.dart'; import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/entities/balance.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/core/transaction_history.dart'; +import 'package:cw_core/balance.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/transaction_history.dart'; import 'package:cake_wallet/store/wallet_list_store.dart'; import 'package:cake_wallet/store/authentication_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; diff --git a/lib/store/dashboard/fiat_conversion_store.dart b/lib/store/dashboard/fiat_conversion_store.dart index 386ad6455..eaa2e5c8a 100644 --- a/lib/store/dashboard/fiat_conversion_store.dart +++ b/lib/store/dashboard/fiat_conversion_store.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:mobx/mobx.dart'; part 'fiat_conversion_store.g.dart'; diff --git a/lib/store/dashboard/trade_filter_store.dart b/lib/store/dashboard/trade_filter_store.dart index 02ad383e7..11ac2a8a4 100644 --- a/lib/store/dashboard/trade_filter_store.dart +++ b/lib/store/dashboard/trade_filter_store.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/view_model/dashboard/trade_list_item.dart'; diff --git a/lib/store/dashboard/transaction_filter_store.dart b/lib/store/dashboard/transaction_filter_store.dart index aca1b6c37..04ff21cd3 100644 --- a/lib/store/dashboard/transaction_filter_store.dart +++ b/lib/store/dashboard/transaction_filter_store.dart @@ -1,5 +1,5 @@ import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/entities/transaction_direction.dart'; +import 'package:cw_core/transaction_direction.dart'; import 'package:cake_wallet/view_model/dashboard/transaction_list_item.dart'; part 'transaction_filter_store.g.dart'; diff --git a/lib/store/node_list_store.dart b/lib/store/node_list_store.dart index 56fe0333a..90b08cb4e 100644 --- a/lib/store/node_list_store.dart +++ b/lib/store/node_list_store.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/di.dart'; -import 'package:cake_wallet/entities/node.dart'; +import 'package:cw_core/node.dart'; import 'package:cake_wallet/utils/mobx.dart'; part 'node_list_store.g.dart'; diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index 5b52f9b19..40f700192 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -1,6 +1,6 @@ -import 'package:cake_wallet/bitcoin/bitcoin_transaction_priority.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; -import 'package:cake_wallet/entities/transaction_priority.dart'; +import 'package:cw_core/transaction_priority.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/themes/theme_list.dart'; import 'package:flutter/foundation.dart'; @@ -9,13 +9,13 @@ import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; import 'package:package_info/package_info.dart'; import 'package:cake_wallet/di.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:cake_wallet/entities/language_service.dart'; import 'package:cake_wallet/entities/balance_display_mode.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; -import 'package:cake_wallet/entities/node.dart'; -import 'package:cake_wallet/entities/monero_transaction_priority.dart'; +import 'package:cw_core/node.dart'; +import 'package:cake_wallet/monero/monero.dart'; import 'package:cake_wallet/entities/action_list_display_mode.dart'; import 'package:cake_wallet/.secrets.g.dart' as secrets; @@ -166,23 +166,28 @@ abstract class SettingsStoreBase with Store { {@required Box nodeSource, @required bool isBitcoinBuyEnabled, FiatCurrency initialFiatCurrency = FiatCurrency.usd, - MoneroTransactionPriority initialMoneroTransactionPriority = - MoneroTransactionPriority.slow, - BitcoinTransactionPriority initialBitcoinTransactionPriority = - BitcoinTransactionPriority.medium, + TransactionPriority initialMoneroTransactionPriority, + TransactionPriority initialBitcoinTransactionPriority, BalanceDisplayMode initialBalanceDisplayMode = BalanceDisplayMode.availableBalance}) async { + if (initialBitcoinTransactionPriority == null) { + initialBitcoinTransactionPriority = bitcoin?.getMediumTransactionPriority(); + } + + if (initialMoneroTransactionPriority == null) { + initialMoneroTransactionPriority = monero?.getDefaultTransactionPriority(); + } + final sharedPreferences = await getIt.getAsync(); final currentFiatCurrency = FiatCurrency( symbol: sharedPreferences.getString(PreferencesKey.currentFiatCurrencyKey)); final savedMoneroTransactionPriority = - MoneroTransactionPriority.deserialize( + monero?.deserializeMoneroTransactionPriority( raw: sharedPreferences .getInt(PreferencesKey.moneroTransactionPriority)); final savedBitcoinTransactionPriority = - BitcoinTransactionPriority.deserialize( - raw: sharedPreferences + bitcoin?.deserializeBitcoinTransactionPriority(sharedPreferences .getInt(PreferencesKey.bitcoinTransactionPriority)); final moneroTransactionPriority = savedMoneroTransactionPriority ?? initialMoneroTransactionPriority; @@ -254,12 +259,18 @@ abstract class SettingsStoreBase with Store { Future reload( {@required Box nodeSource, FiatCurrency initialFiatCurrency = FiatCurrency.usd, - MoneroTransactionPriority initialMoneroTransactionPriority = - MoneroTransactionPriority.slow, - BitcoinTransactionPriority initialBitcoinTransactionPriority = - BitcoinTransactionPriority.medium, + TransactionPriority initialMoneroTransactionPriority, + TransactionPriority initialBitcoinTransactionPriority, BalanceDisplayMode initialBalanceDisplayMode = BalanceDisplayMode.availableBalance}) async { + if (initialBitcoinTransactionPriority == null) { + initialBitcoinTransactionPriority = bitcoin?.getMediumTransactionPriority(); + } + + if (initialMoneroTransactionPriority == null) { + initialMoneroTransactionPriority = monero?.getDefaultTransactionPriority(); + } + final isBitcoinBuyEnabled = (secrets.wyreSecretKey?.isNotEmpty ?? false) && (secrets.wyreApiKey?.isNotEmpty ?? false) && (secrets.wyreAccountId?.isNotEmpty ?? false); diff --git a/lib/store/yat/yat_store.dart b/lib/store/yat/yat_store.dart index cace91a88..caee5b0fa 100644 --- a/lib/store/yat/yat_store.dart +++ b/lib/store/yat/yat_store.dart @@ -1,14 +1,11 @@ -import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/balance.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; +import 'package:cw_core/transaction_history.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/balance.dart'; +import 'package:cw_core/transaction_info.dart'; import 'package:cake_wallet/store/app_store.dart'; import 'package:flutter/foundation.dart'; import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; -import 'package:cake_wallet/monero/monero_subaddress_list.dart'; -import 'package:cake_wallet/monero/monero_wallet.dart'; +import 'package:cw_core/wallet_type.dart'; import 'dart:convert'; import 'package:cake_wallet/store/yat/yat_exception.dart'; import 'package:http/http.dart'; diff --git a/lib/utils/item_cell.dart b/lib/utils/item_cell.dart index 150df6d50..237f2386a 100644 --- a/lib/utils/item_cell.dart +++ b/lib/utils/item_cell.dart @@ -1,7 +1,7 @@ import 'package:flutter/foundation.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/utils/mobx.dart'; - +import 'package:cw_core/keyable.dart'; // part 'node_list_view_model.g.dart'; // // class NodeListViewModel = NodeListViewModelBase with _$NodeListViewModel; diff --git a/lib/utils/mobx.dart b/lib/utils/mobx.dart index a5bfb2220..119b34fe5 100644 --- a/lib/utils/mobx.dart +++ b/lib/utils/mobx.dart @@ -1,10 +1,7 @@ import 'dart:async'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; - -mixin Keyable { - dynamic keyIndex; -} +import 'package:cw_core/keyable.dart'; void connectMapToListWithTransform( ObservableMap source, diff --git a/lib/view_model/buy/buy_view_model.dart b/lib/view_model/buy/buy_view_model.dart index 270d6213a..7d8fe5f9c 100644 --- a/lib/view_model/buy/buy_view_model.dart +++ b/lib/view_model/buy/buy_view_model.dart @@ -1,9 +1,9 @@ import 'package:cake_wallet/buy/buy_provider.dart'; import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart'; import 'package:cake_wallet/buy/wyre/wyre_buy_provider.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/view_model/buy/buy_item.dart'; import 'package:flutter/foundation.dart'; @@ -11,7 +11,7 @@ import 'package:hive/hive.dart'; import 'package:cake_wallet/buy/order.dart'; import 'package:cake_wallet/store/dashboard/orders_store.dart'; import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'buy_amount_view_model.dart'; part 'buy_view_model.g.dart'; diff --git a/lib/view_model/contact_list/contact_list_view_model.dart b/lib/view_model/contact_list/contact_list_view_model.dart index 1a8bbc021..9c206d7d1 100644 --- a/lib/view_model/contact_list/contact_list_view_model.dart +++ b/lib/view_model/contact_list/contact_list_view_model.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:cake_wallet/entities/wallet_contact.dart'; -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_info.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/entities/contact_record.dart'; diff --git a/lib/view_model/contact_list/contact_view_model.dart b/lib/view_model/contact_list/contact_view_model.dart index 7e6312d1d..68bc288b1 100644 --- a/lib/view_model/contact_list/contact_view_model.dart +++ b/lib/view_model/contact_list/contact_view_model.dart @@ -2,9 +2,9 @@ import 'package:cake_wallet/entities/contact_record.dart'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/core/execution_state.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:cake_wallet/entities/contact.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/crypto_currency.dart'; part 'contact_view_model.g.dart'; diff --git a/lib/view_model/dashboard/balance_view_model.dart b/lib/view_model/dashboard/balance_view_model.dart index a0935a936..290282ed6 100644 --- a/lib/view_model/dashboard/balance_view_model.dart +++ b/lib/view_model/dashboard/balance_view_model.dart @@ -1,12 +1,10 @@ -import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart'; -import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/balance.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/transaction_history.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/balance.dart'; +import 'package:cw_core/crypto_currency.dart'; +import 'package:cw_core/transaction_info.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/monero/monero_wallet.dart'; import 'package:cake_wallet/entities/balance_display_mode.dart'; import 'package:cake_wallet/entities/calculate_fiat_amount.dart'; import 'package:cake_wallet/store/app_store.dart'; @@ -26,15 +24,7 @@ abstract class BalanceViewModelBase with Store { @required this.fiatConvertationStore}) { isReversing = false; wallet ??= appStore.wallet; - final _wallet = wallet; - - if (_wallet is MoneroWallet) { - balance = _wallet.balance; - } - - if (_wallet is BitcoinWallet) { - balance = _wallet.balance; - } + balance = wallet.balance; reaction((_) => appStore.wallet, _onWalletChange); diff --git a/lib/view_model/dashboard/dashboard_view_model.dart b/lib/view_model/dashboard/dashboard_view_model.dart index b99e03ca6..1fc355e6d 100644 --- a/lib/view_model/dashboard/dashboard_view_model.dart +++ b/lib/view_model/dashboard/dashboard_view_model.dart @@ -1,14 +1,10 @@ -import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/entities/balance.dart'; +import 'package:cw_core/transaction_history.dart'; +import 'package:cw_core/balance.dart'; import 'package:cake_wallet/buy/order.dart'; import 'package:cake_wallet/entities/transaction_history.dart'; import 'package:cake_wallet/exchange/trade_state.dart'; -import 'package:cake_wallet/monero/account.dart'; -import 'package:cake_wallet/monero/monero_balance.dart'; -import 'package:cake_wallet/monero/monero_transaction_info.dart'; -import 'package:cake_wallet/monero/monero_wallet.dart'; import 'package:cake_wallet/entities/balance_display_mode.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; +import 'package:cw_core/transaction_info.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/store/dashboard/orders_store.dart'; @@ -25,15 +21,16 @@ import 'package:crypto/crypto.dart'; import 'package:flutter/services.dart'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/sync_status.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/store/dashboard/trades_store.dart'; import 'package:cake_wallet/store/dashboard/trade_filter_store.dart'; import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart'; import 'package:cake_wallet/view_model/dashboard/formatted_item_list.dart'; +import 'package:cake_wallet/monero/monero.dart'; part 'dashboard_view_model.g.dart'; @@ -93,18 +90,18 @@ abstract class DashboardViewModelBase with Store { isShowThirdYatIntroduction = false; final _wallet = wallet; - if (_wallet is MoneroWallet) { - subname = _wallet.walletAddresses.account?.label; + if (_wallet.type == WalletType.monero) { + subname = monero.getCurrentAccount(_wallet)?.label; - _onMoneroAccountChangeReaction = reaction((_) => _wallet.walletAddresses + _onMoneroAccountChangeReaction = reaction((_) => monero.getMoneroWalletDetails(wallet) .account, (Account account) => _onMoneroAccountChange(_wallet)); - _onMoneroBalanceChangeReaction = reaction((_) => _wallet.balance, + _onMoneroBalanceChangeReaction = reaction((_) => monero.getMoneroWalletDetails(wallet).balance, (MoneroBalance balance) => _onMoneroTransactionsUpdate(_wallet)); final _accountTransactions = _wallet .transactionHistory.transactions.values - .where((tx) => tx.accountIndex == _wallet.walletAddresses.account.id) + .where((tx) => monero.getTransactionInfoAccountId(tx) == monero.getCurrentAccount(wallet).id) .toList(); transactions = ObservableList.of(_accountTransactions.map((transaction) => @@ -132,8 +129,8 @@ abstract class DashboardViewModelBase with Store { settingsStore: appStore.settingsStore), filter: (TransactionInfo tx) { final wallet = _wallet; - if (tx is MoneroTransactionInfo && wallet is MoneroWallet) { - return tx.accountIndex == wallet.walletAddresses.account.id; + if (wallet.type == WalletType.monero) { + return monero.getTransactionInfoAccountId(tx) == monero.getCurrentAccount(wallet).id; } return true; @@ -265,16 +262,16 @@ abstract class DashboardViewModelBase with Store { isOutdatedElectrumWallet = wallet.type == WalletType.bitcoin && wallet.seed.split(' ').length < 24; - if (wallet is MoneroWallet) { - subname = wallet.walletAddresses.account?.label; + if (wallet.type == WalletType.monero) { + subname = monero.getCurrentAccount(wallet)?.label; _onMoneroAccountChangeReaction?.reaction?.dispose(); _onMoneroBalanceChangeReaction?.reaction?.dispose(); - _onMoneroAccountChangeReaction = reaction((_) => wallet.walletAddresses + _onMoneroAccountChangeReaction = reaction((_) => monero.getMoneroWalletDetails(wallet) .account, (Account account) => _onMoneroAccountChange(wallet)); - _onMoneroBalanceChangeReaction = reaction((_) => wallet.balance, + _onMoneroBalanceChangeReaction = reaction((_) => monero.getMoneroWalletDetails(wallet).balance, (MoneroBalance balance) => _onMoneroTransactionsUpdate(wallet)); _onMoneroTransactionsUpdate(wallet); @@ -298,8 +295,8 @@ abstract class DashboardViewModelBase with Store { balanceViewModel: balanceViewModel, settingsStore: appStore.settingsStore), filter: (TransactionInfo tx) { - if (tx is MoneroTransactionInfo && wallet is MoneroWallet) { - return tx.accountIndex == wallet.walletAddresses.account.id; + if (wallet.type == WalletType.monero) { + return monero.getTransactionInfoAccountId(tx) == monero.getCurrentAccount(wallet).id; } return true; @@ -307,17 +304,17 @@ abstract class DashboardViewModelBase with Store { } @action - void _onMoneroAccountChange(MoneroWallet wallet) { - subname = wallet.walletAddresses.account?.label; + void _onMoneroAccountChange(WalletBase wallet) { + subname = monero.getCurrentAccount(wallet)?.label; _onMoneroTransactionsUpdate(wallet); } @action - void _onMoneroTransactionsUpdate(MoneroWallet wallet) { + void _onMoneroTransactionsUpdate(WalletBase wallet) { transactions.clear(); - final _accountTransactions = wallet.transactionHistory.transactions.values - .where((tx) => tx.accountIndex == wallet.walletAddresses.account.id) + final _accountTransactions = monero.getTransactionHistory(wallet).transactions.values + .where((tx) => monero.getTransactionInfoAccountId(tx) == monero.getCurrentAccount(wallet).id) .toList(); transactions.addAll(_accountTransactions.map((transaction) => diff --git a/lib/view_model/dashboard/transaction_list_item.dart b/lib/view_model/dashboard/transaction_list_item.dart index 9974e3b11..989de3e3f 100644 --- a/lib/view_model/dashboard/transaction_list_item.dart +++ b/lib/view_model/dashboard/transaction_list_item.dart @@ -1,15 +1,15 @@ import 'package:cake_wallet/entities/balance_display_mode.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; +import 'package:cw_core/transaction_info.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/utils/mobx.dart'; import 'package:cake_wallet/view_model/dashboard/action_list_item.dart'; -import 'package:cake_wallet/bitcoin/electrum_transaction_info.dart'; -import 'package:cake_wallet/monero/monero_transaction_info.dart'; -import 'package:cake_wallet/monero/monero_amount_format.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; +import 'package:cake_wallet/monero/monero.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/entities/calculate_fiat_amount_raw.dart'; import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart'; +import 'package:cw_core/keyable.dart'; +import 'package:cw_core/wallet_type.dart'; class TransactionListItem extends ActionListItem with Keyable { TransactionListItem( @@ -35,16 +35,17 @@ class TransactionListItem extends ActionListItem with Keyable { } String get formattedFiatAmount { - if (transaction is MoneroTransactionInfo) { + if (balanceViewModel.wallet.type == WalletType.monero) { final amount = calculateFiatAmountRaw( - cryptoAmount: moneroAmountToDouble(amount: transaction.amount), + cryptoAmount: monero.formatterMoneroAmountToDouble(amount: transaction.amount), price: price); transaction.changeFiatAmount(amount); } - if (transaction is ElectrumTransactionInfo) { + if (balanceViewModel.wallet.type == WalletType.bitcoin + || balanceViewModel.wallet.type == WalletType.litecoin) { final amount = calculateFiatAmountRaw( - cryptoAmount: bitcoinAmountToDouble(amount: transaction.amount), + cryptoAmount: bitcoin.formatterBitcoinAmountToDouble(amount: transaction.amount), price: price); transaction.changeFiatAmount(amount); } diff --git a/lib/view_model/exchange/exchange_trade_view_model.dart b/lib/view_model/exchange/exchange_trade_view_model.dart index 5445823a2..de2ac6daa 100644 --- a/lib/view_model/exchange/exchange_trade_view_model.dart +++ b/lib/view_model/exchange/exchange_trade_view_model.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/exchange/changenow/changenow_exchange_provider.dart'; import 'package:cake_wallet/exchange/exchange_provider.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; diff --git a/lib/view_model/exchange/exchange_view_model.dart b/lib/view_model/exchange/exchange_view_model.dart index 97034358c..2fe6b3d53 100644 --- a/lib/view_model/exchange/exchange_view_model.dart +++ b/lib/view_model/exchange/exchange_view_model.dart @@ -1,15 +1,12 @@ -import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_transaction_priority.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/crypto_currency.dart'; +import 'package:cw_core/sync_status.dart'; +import 'package:cw_core/wallet_type.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/exchange/exchange_provider.dart'; import 'package:cake_wallet/exchange/limits.dart'; import 'package:cake_wallet/exchange/trade.dart'; import 'package:cake_wallet/exchange/limits_state.dart'; -import 'package:cake_wallet/monero/monero_wallet.dart'; import 'package:cake_wallet/store/dashboard/trades_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:intl/intl.dart'; @@ -126,7 +123,7 @@ abstract class ExchangeViewModelBase with Store { bool get hasAllAmount => wallet.type == WalletType.bitcoin && depositCurrency == wallet.currency; - bool get isMoneroWallet => wallet is MoneroWallet; + bool get isMoneroWallet => wallet.type == WalletType.monero; List receiveCurrencies; @@ -324,10 +321,9 @@ abstract class ExchangeViewModelBase with Store { @action void calculateDepositAllAmount() { - if (wallet is BitcoinWallet) { + if (wallet.type == WalletType.bitcoin) { final availableBalance = wallet.balance.available; - final priority = - _settingsStore.priority[wallet.type] as BitcoinTransactionPriority; + final priority = _settingsStore.priority[wallet.type]; final fee = wallet.calculateEstimatedFee(priority, null); if (availableBalance < fee || availableBalance == 0) { @@ -335,7 +331,7 @@ abstract class ExchangeViewModelBase with Store { } final amount = availableBalance - fee; - changeDepositAmount(amount: bitcoinAmountToString(amount: amount)); + changeDepositAmount(amount: bitcoin.formatterBitcoinAmountToString(amount: amount)); } } diff --git a/lib/view_model/monero_account_list/monero_account_edit_or_create_view_model.dart b/lib/view_model/monero_account_list/monero_account_edit_or_create_view_model.dart index a86fa2773..d9a73c325 100644 --- a/lib/view_model/monero_account_list/monero_account_edit_or_create_view_model.dart +++ b/lib/view_model/monero_account_list/monero_account_edit_or_create_view_model.dart @@ -1,8 +1,8 @@ -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:flutter/foundation.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/core/execution_state.dart'; -import 'package:cake_wallet/monero/monero_account_list.dart'; +import 'package:cake_wallet/monero/monero.dart'; import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart'; part 'monero_account_edit_or_create_view_model.g.dart'; @@ -37,9 +37,13 @@ abstract class MoneroAccountEditOrCreateViewModelBase with Store { if (_accountListItem != null) { await _moneroAccountList.setLabelAccount( - accountIndex: _accountListItem.id, label: label); + _wallet, + accountIndex: _accountListItem.id, + label: label); } else { - await _moneroAccountList.addAccount(label: label); + await _moneroAccountList.addAccount( + _wallet, + label: label); } await _wallet.save(); diff --git a/lib/view_model/monero_account_list/monero_account_list_view_model.dart b/lib/view_model/monero_account_list/monero_account_list_view_model.dart index ca0eb67ef..679c3985b 100644 --- a/lib/view_model/monero_account_list/monero_account_list_view_model.dart +++ b/lib/view_model/monero_account_list/monero_account_list_view_model.dart @@ -1,7 +1,7 @@ import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/monero/account.dart'; -import 'package:cake_wallet/monero/monero_wallet.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart'; +import 'package:cake_wallet/monero/monero.dart'; part 'monero_account_list_view_model.g.dart'; @@ -9,7 +9,7 @@ class MoneroAccountListViewModel = MoneroAccountListViewModelBase with _$MoneroAccountListViewModel; abstract class MoneroAccountListViewModelBase with Store { - MoneroAccountListViewModelBase(this._moneroWallet) : scrollOffsetFromTop = 0; + MoneroAccountListViewModelBase(this._wallet) : scrollOffsetFromTop = 0; @observable double scrollOffsetFromTop; @@ -20,16 +20,20 @@ abstract class MoneroAccountListViewModelBase with Store { } @computed - List get accounts => _moneroWallet.walletAddresses - .accountList.accounts.map((acc) => AccountListItem( + List get accounts => monero + .getAccountList(_wallet) + .accounts.map((acc) => AccountListItem( label: acc.label, id: acc.id, - isSelected: acc.id == _moneroWallet.walletAddresses.account.id)) + isSelected: acc.id == monero.getCurrentAccount(_wallet).id)) .toList(); - final MoneroWallet _moneroWallet; + final WalletBase _wallet; void select(AccountListItem item) => - _moneroWallet.walletAddresses.account = - Account(id: item.id, label: item.label); + monero.setCurrentAccount( + _wallet, + Account( + id: item.id, + label: item.label)); } diff --git a/lib/view_model/node_list/node_create_or_edit_view_model.dart b/lib/view_model/node_list/node_create_or_edit_view_model.dart index 0a5e07266..a097e59cf 100644 --- a/lib/view_model/node_list/node_create_or_edit_view_model.dart +++ b/lib/view_model/node_list/node_create_or_edit_view_model.dart @@ -1,9 +1,9 @@ import 'package:cake_wallet/core/execution_state.dart'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/node.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/node.dart'; +import 'package:cw_core/wallet_type.dart'; part 'node_create_or_edit_view_model.g.dart'; diff --git a/lib/view_model/node_list/node_list_view_model.dart b/lib/view_model/node_list/node_list_view_model.dart index c680cc859..30e5cb9c2 100644 --- a/lib/view_model/node_list/node_list_view_model.dart +++ b/lib/view_model/node_list/node_list_view_model.dart @@ -1,11 +1,11 @@ import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:cake_wallet/store/settings_store.dart'; -import 'package:cake_wallet/entities/node.dart'; +import 'package:cw_core/node.dart'; import 'package:cake_wallet/entities/node_list.dart'; import 'package:cake_wallet/entities/default_settings_migration.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/utils/mobx.dart'; part 'node_list_view_model.g.dart'; diff --git a/lib/view_model/order_details_view_model.dart b/lib/view_model/order_details_view_model.dart index d50469d4a..f23d8e396 100644 --- a/lib/view_model/order_details_view_model.dart +++ b/lib/view_model/order_details_view_model.dart @@ -8,7 +8,7 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart'; import 'package:cake_wallet/src/screens/trade_details/track_trade_list_item.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart'; import 'package:cake_wallet/buy/wyre/wyre_buy_provider.dart'; diff --git a/lib/view_model/rescan_view_model.dart b/lib/view_model/rescan_view_model.dart index be9477df5..1f7f38dbe 100644 --- a/lib/view_model/rescan_view_model.dart +++ b/lib/view_model/rescan_view_model.dart @@ -1,4 +1,4 @@ -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:mobx/mobx.dart'; part 'rescan_view_model.g.dart'; diff --git a/lib/view_model/restore_from_backup_view_model.dart b/lib/view_model/restore_from_backup_view_model.dart index 1c0915fe7..31895bddb 100644 --- a/lib/view_model/restore_from_backup_view_model.dart +++ b/lib/view_model/restore_from_backup_view_model.dart @@ -5,7 +5,7 @@ import 'package:mobx/mobx.dart'; import 'package:cake_wallet/main.dart'; import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/core/backup_service.dart'; -import 'package:cake_wallet/entities/node.dart'; +import 'package:cw_core/node.dart'; import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/store/authentication_store.dart'; diff --git a/lib/view_model/send/output.dart b/lib/view_model/send/output.dart index 1e52bc404..e2f07bdcf 100644 --- a/lib/view_model/send/output.dart +++ b/lib/view_model/send/output.dart @@ -1,20 +1,18 @@ -import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet.dart'; import 'package:cake_wallet/entities/calculate_fiat_amount_raw.dart'; import 'package:cake_wallet/entities/parse_address_from_domain.dart'; import 'package:cake_wallet/entities/parsed_address.dart'; -import 'package:cake_wallet/monero/monero_amount_format.dart'; import 'package:cake_wallet/src/screens/send/widgets/extract_address_from_parsed.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/monero/monero_wallet.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cake_wallet/monero/monero.dart'; import 'package:cake_wallet/entities/calculate_fiat_amount.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; part 'output.g.dart'; @@ -67,13 +65,13 @@ abstract class OutputBase with Store { int _amount = 0; switch (walletType) { case WalletType.monero: - _amount = moneroParseAmount(amount: _cryptoAmount); + _amount = monero.formatterMoneroParseAmount(amount: _cryptoAmount); break; case WalletType.bitcoin: - _amount = stringDoubleToBitcoinAmount(_cryptoAmount); + _amount = bitcoin.formatterStringDoubleToBitcoinAmount(_cryptoAmount); break; case WalletType.litecoin: - _amount = stringDoubleToBitcoinAmount(_cryptoAmount); + _amount = bitcoin.formatterStringDoubleToBitcoinAmount(_cryptoAmount); break; default: break; @@ -96,12 +94,13 @@ abstract class OutputBase with Store { final fee = _wallet.calculateEstimatedFee( _settingsStore.priority[_wallet.type], formattedCryptoAmount); - if (_wallet is ElectrumWallet) { - return bitcoinAmountToDouble(amount: fee); + if (_wallet.type == WalletType.bitcoin + || _wallet.type == WalletType.litecoin) { + return bitcoin.formatterBitcoinAmountToDouble(amount: fee); } - if (_wallet is MoneroWallet) { - return moneroAmountToDouble(amount: fee); + if (_wallet.type == WalletType.monero) { + return monero.formatterMoneroAmountToDouble(amount: fee); } } catch (e) { print(e.toString()); diff --git a/lib/view_model/send/send_template_view_model.dart b/lib/view_model/send/send_template_view_model.dart index 9ddd8f5f6..9e1e49f06 100644 --- a/lib/view_model/send/send_template_view_model.dart +++ b/lib/view_model/send/send_template_view_model.dart @@ -6,8 +6,8 @@ import 'package:cake_wallet/core/template_validator.dart'; import 'package:cake_wallet/core/address_validator.dart'; import 'package:cake_wallet/core/amount_validator.dart'; import 'package:cake_wallet/core/validator.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cw_core/wallet_base.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index e72b48a61..9de6eefc8 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -1,7 +1,5 @@ -import 'package:cake_wallet/bitcoin/bitcoin_transaction_priority.dart'; -import 'package:cake_wallet/bitcoin/electrum_wallet.dart'; import 'package:cake_wallet/entities/transaction_description.dart'; -import 'package:cake_wallet/entities/transaction_priority.dart'; +import 'package:cw_core/transaction_priority.dart'; import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cake_wallet/view_model/send/send_template_view_model.dart'; import 'package:cake_wallet/view_model/settings/settings_view_model.dart'; @@ -10,22 +8,21 @@ import 'package:mobx/mobx.dart'; import 'package:cake_wallet/entities/template.dart'; import 'package:cake_wallet/core/address_validator.dart'; import 'package:cake_wallet/core/amount_validator.dart'; -import 'package:cake_wallet/core/pending_transaction.dart'; +import 'package:cw_core/pending_transaction.dart'; import 'package:cake_wallet/core/validator.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cw_core/wallet_base.dart'; import 'package:cake_wallet/core/execution_state.dart'; -import 'package:cake_wallet/bitcoin/bitcoin_transaction_credentials.dart'; -import 'package:cake_wallet/monero/monero_transaction_creation_credentials.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; -import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cake_wallet/monero/monero.dart'; +import 'package:cw_core/sync_status.dart'; +import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/entities/fiat_currency.dart'; -import 'package:cake_wallet/entities/monero_transaction_priority.dart'; import 'package:cake_wallet/entities/calculate_fiat_amount.dart'; -import 'package:cake_wallet/entities/wallet_type.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/view_model/send/send_view_model_state.dart'; import 'package:cake_wallet/entities/parsed_address.dart'; +import 'package:cake_wallet/bitcoin/bitcoin.dart'; part 'send_view_model.g.dart'; @@ -133,7 +130,7 @@ abstract class SendViewModelBase with Store { ObservableList