Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crypto_plugins/frostdart
7 changes: 5 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import 'wallets/isar/providers/all_wallets_info_provider.dart';
import 'wallets/wallet/wallet_mixin_interfaces/spark_interface.dart';
import 'widgets/crypto_notifications.dart';
import 'wl_gen/interfaces/cs_monero_interface.dart';
import 'wl_gen/interfaces/cs_wownero_interface.dart';
import 'wl_gen/interfaces/lib_xelis_interface.dart';

final openedFromSWBFileStringStateProvider = StateProvider<String?>(
Expand Down Expand Up @@ -161,10 +162,12 @@ void main(List<String> args) async {

DB.instance.hive.registerAdapter(lib_monero_compat.WalletTypeAdapter());

if (AppConfig.coins.whereType<Monero>().isNotEmpty ||
AppConfig.coins.whereType<Wownero>().isNotEmpty) {
if (AppConfig.coins.whereType<Monero>().isNotEmpty) {
csMonero.setUseCsMoneroLoggerInternal(kDebugMode);
}
if (AppConfig.coins.whereType<Wownero>().isNotEmpty) {
csWownero.setUseCsWowneroLoggerInternal(kDebugMode);
}

DB.instance.hive.init(
(await StackFileSystem.applicationHiveDirectory()).path,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import '../../../../widgets/textfield_icon_button.dart';
import '../../../../widgets/toggle.dart';
import '../../../../wl_gen/interfaces/cs_monero_interface.dart';
import '../../../../wl_gen/interfaces/cs_salvium_interface.dart';
import '../../../../wl_gen/interfaces/cs_wownero_interface.dart';
import '../../create_or_restore_wallet_view/sub_widgets/coin_image.dart';
import '../restore_view_only_wallet_view.dart';
import '../restore_wallet_view.dart';
Expand Down Expand Up @@ -213,10 +214,10 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
int height = 0;
if (date != null) {
if (widget.coin is Monero) {
height = csMonero.getHeightByDate(date, csCoin: CsCoin.monero);
height = csMonero.getHeightByDate(date);
}
if (widget.coin is Wownero) {
height = csMonero.getHeightByDate(date, csCoin: CsCoin.wownero);
height = csWownero.getHeightByDate(date);
}
if (widget.coin is Salvium) {
height = csSalvium.getHeightByDate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import '../../../widgets/table_view/table_view.dart';
import '../../../widgets/table_view/table_view_cell.dart';
import '../../../widgets/table_view/table_view_row.dart';
import '../../../wl_gen/interfaces/cs_monero_interface.dart';
import '../../../wl_gen/interfaces/cs_wownero_interface.dart';
import '../../../wl_gen/interfaces/lib_xelis_interface.dart';
import '../../home_view/home_view.dart';
import '../add_token_view/edit_wallet_tokens_view.dart';
Expand Down Expand Up @@ -189,7 +190,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
}
}
if (widget.coin is Wownero) {
final wowneroWordList = csMonero.getWowneroWordList(
final wowneroWordList = csWownero.getWowneroWordList(
"English",
widget.seedWordsLength,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ import '../../../wallets/wallet/impl/epiccash_wallet.dart';
import '../../../wallets/wallet/impl/monero_wallet.dart';
import '../../../wallets/wallet/impl/wownero_wallet.dart';
import '../../../wallets/wallet/impl/xelis_wallet.dart';
import '../../../wallets/wallet/intermediate/lib_monero_wallet.dart';
import '../../../wallets/wallet/intermediate/lib_salvium_wallet.dart';
import '../../../wallets/wallet/intermediate/cryptonote_wallet.dart';
import '../../../wallets/wallet/wallet.dart';
import '../../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart';
import '../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart';
Expand All @@ -48,6 +47,7 @@ import '../../../widgets/desktop/desktop_scaffold.dart';
import '../../../widgets/stack_dialog.dart';
import '../../../wl_gen/interfaces/cs_monero_interface.dart';
import '../../../wl_gen/interfaces/cs_salvium_interface.dart';
import '../../../wl_gen/interfaces/cs_wownero_interface.dart';
import '../../home_view/home_view.dart';
import '../add_token_view/edit_wallet_tokens_view.dart';
import '../new_wallet_options/new_wallet_options_view.dart';
Expand Down Expand Up @@ -111,18 +111,15 @@ class _VerifyRecoveryPhraseViewState
final ViewOnlyWalletType viewOnlyWalletType;
if (widget.wallet is ExtendedKeysInterface) {
viewOnlyWalletType = ViewOnlyWalletType.xPub;
} else if (widget.wallet is LibMoneroWallet ||
widget.wallet is LibSalviumWallet) {
} else if (widget.wallet is CryptonoteWallet) {
if (widget.wallet.cryptoCurrency is Monero) {
height = csMonero.getHeightByDate(
DateTime.now().subtract(const Duration(days: 7)),
csCoin: CsCoin.monero,
);
}
if (widget.wallet.cryptoCurrency is Wownero) {
height = csMonero.getHeightByDate(
height = csWownero.getHeightByDate(
DateTime.now().subtract(const Duration(days: 7)),
csCoin: CsCoin.wownero,
);
}
if (widget.wallet.cryptoCurrency is Salvium) {
Expand Down Expand Up @@ -175,23 +172,8 @@ class _VerifyRecoveryPhraseViewState
walletId: voInfo.walletId,
xPubs: [xPub],
);
} else if (widget.wallet is LibMoneroWallet) {
final w = widget.wallet as LibMoneroWallet;

final info = await w
.hackToCreateNewViewOnlyWalletDataFromNewlyCreatedWalletThisFunctionShouldNotBeCalledUnlessYouKnowWhatYouAreDoing();
final address = info.$1;
final privateViewKey = info.$2;

await w.exit();

viewOnlyData = CryptonoteViewOnlyWalletData(
walletId: voInfo.walletId,
address: address,
privateViewKey: privateViewKey,
);
} else if (widget.wallet is LibSalviumWallet) {
final w = widget.wallet as LibSalviumWallet;
} else if (widget.wallet is CryptonoteWallet) {
final w = widget.wallet as CryptonoteWallet;

final info = await w
.hackToCreateNewViewOnlyWalletDataFromNewlyCreatedWalletThisFunctionShouldNotBeCalledUnlessYouKnowWhatYouAreDoing();
Expand Down
11 changes: 6 additions & 5 deletions lib/pages/send_view/send_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ import '../../utilities/show_loading.dart';
import '../../utilities/text_styles.dart';
import '../../utilities/util.dart';
import '../../wallets/crypto_currency/crypto_currency.dart';
import '../../wallets/crypto_currency/intermediate/cryptonote_currency.dart';
import '../../wallets/crypto_currency/intermediate/nano_currency.dart';
import '../../wallets/isar/providers/wallet_info_provider.dart';
import '../../wallets/models/tx_data.dart';
import '../../wallets/wallet/impl/firo_wallet.dart';
import '../../wallets/wallet/impl/mimblewimblecoin_wallet.dart';
import '../../wallets/wallet/intermediate/cryptonote_wallet.dart';
import '../../wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
import '../../wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart';
import '../../wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
Expand All @@ -74,7 +76,6 @@ import '../../widgets/rounded_white_container.dart';
import '../../widgets/stack_dialog.dart';
import '../../widgets/stack_text_field.dart';
import '../../widgets/textfield_icon_button.dart';
import '../../wl_gen/interfaces/cs_monero_interface.dart';
import '../address_book_views/address_book_view.dart';
import '../coin_control/coin_control_view.dart';
import 'confirm_transaction_view.dart';
Expand Down Expand Up @@ -559,17 +560,17 @@ class _SendViewState extends ConsumerState<SendView> {
}

Amount fee;
if (coin is Monero) {
if (coin is CryptonoteCurrency) {
final int specialMoneroId;
switch (ref.read(feeRateTypeMobileStateProvider.state).state) {
case FeeRateType.fast:
specialMoneroId = csMonero.getTxPriorityHigh();
specialMoneroId = (wallet as CryptonoteWallet).getTxPriorityHigh();
break;
case FeeRateType.average:
specialMoneroId = csMonero.getTxPriorityMedium();
specialMoneroId = (wallet as CryptonoteWallet).getTxPriorityMedium();
break;
case FeeRateType.slow:
specialMoneroId = csMonero.getTxPriorityNormal();
specialMoneroId = (wallet as CryptonoteWallet).getTxPriorityNormal();
break;
default:
throw ArgumentError("custom fee not available for monero");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import '../../../utilities/enums/fee_rate_type_enum.dart';
import '../../../utilities/logger.dart';
import '../../../utilities/text_styles.dart';
import '../../../wallets/crypto_currency/crypto_currency.dart';
import '../../../wallets/crypto_currency/intermediate/cryptonote_currency.dart';
import '../../../wallets/isar/providers/eth/current_token_wallet_provider.dart';
import '../../../wallets/isar/providers/wallet_info_provider.dart';
import '../../../wallets/wallet/impl/firo_wallet.dart';
import '../../../wallets/wallet/intermediate/cryptonote_wallet.dart';
import '../../../wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
import '../../../widgets/animated_text.dart';
import '../../../wl_gen/interfaces/cs_monero_interface.dart';

final feeSheetSessionCacheProvider =
ChangeNotifierProvider<FeeSheetSessionCache>((ref) {
Expand Down Expand Up @@ -88,10 +89,10 @@ class _TransactionFeeSelectionSheetState
if (widget.isToken == false) {
final wallet = ref.read(pWallets).getWallet(walletId);

if (coin is Monero || coin is Wownero) {
if (coin is CryptonoteCurrency) {
final fee = await wallet.estimateFeeFor(
amount,
BigInt.from(csMonero.getTxPriorityHigh()),
BigInt.from((wallet as CryptonoteWallet).getTxPriorityHigh()),
);
ref.read(feeSheetSessionCacheProvider).fast[amount] = fee;
} else if (coin is Firo) {
Expand Down Expand Up @@ -125,10 +126,10 @@ class _TransactionFeeSelectionSheetState
if (ref.read(feeSheetSessionCacheProvider).average[amount] == null) {
if (widget.isToken == false) {
final wallet = ref.read(pWallets).getWallet(walletId);
if (coin is Monero || coin is Wownero) {
if (coin is CryptonoteCurrency) {
final fee = await wallet.estimateFeeFor(
amount,
BigInt.from(csMonero.getTxPriorityMedium()),
BigInt.from((wallet as CryptonoteWallet).getTxPriorityMedium()),
);
ref.read(feeSheetSessionCacheProvider).average[amount] = fee;
} else if (coin is Firo) {
Expand Down Expand Up @@ -161,10 +162,10 @@ class _TransactionFeeSelectionSheetState
if (ref.read(feeSheetSessionCacheProvider).slow[amount] == null) {
if (widget.isToken == false) {
final wallet = ref.read(pWallets).getWallet(walletId);
if (coin is Monero || coin is Wownero) {
if (coin is CryptonoteCurrency) {
final fee = await wallet.estimateFeeFor(
amount,
BigInt.from(csMonero.getTxPriorityNormal()),
BigInt.from((wallet as CryptonoteWallet).getTxPriorityNormal()),
);
ref.read(feeSheetSessionCacheProvider).slow[amount] = fee;
} else if (coin is Firo) {
Expand Down
Loading
Loading