From 5983984cc8179c83746ce6ae2accec88c7447f4f Mon Sep 17 00:00:00 2001 From: reasje Date: Thu, 14 Sep 2023 10:48:14 +0330 Subject: [PATCH 01/23] fix: Added decimal to config --- lib/common/config.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/common/config.dart b/lib/common/config.dart index 84457504..ac687b48 100644 --- a/lib/common/config.dart +++ b/lib/common/config.dart @@ -13,8 +13,13 @@ class Config { "https://wannsee-erc20.mxc.com" ]; - static String mainnetMns(String name) => 'https://mns.mxc.com/$name.mxc/register'; - static String testnetMns(String name) => 'https://wannsee-mns.mxc.com/$name.mxc/register'; + static String mainnetMns(String name) => + 'https://mns.mxc.com/$name.mxc/register'; + static String testnetMns(String name) => + 'https://wannsee-mns.mxc.com/$name.mxc/register'; + + // Numbers fixed decimals + static int decimalFixed = 3; static bool isMxcChains(int chainId) { return chainId == mxcMainnetChainId || chainId == mxcTestnetChainId; From 3f17d5bef9cafb97295ab3f86a1f2098a4d738db Mon Sep 17 00:00:00 2001 From: reasje Date: Thu, 14 Sep 2023 10:59:00 +0330 Subject: [PATCH 02/23] fix: Added decimal formatter to numbers --- lib/common/utils/formatter.dart | 19 ++++++++++++------- .../open_dapp/open_dapp_presenter.dart | 2 +- .../portfolio/domain/portfolio_use_case.dart | 4 +++- packages/shared | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/common/utils/formatter.dart b/lib/common/utils/formatter.dart index 6d499c87..f539998a 100644 --- a/lib/common/utils/formatter.dart +++ b/lib/common/utils/formatter.dart @@ -1,4 +1,5 @@ import 'dart:math'; +import 'package:datadashwallet/common/config.dart'; import 'package:intl/intl.dart' as intl; import 'package:flutter/material.dart'; import 'package:web3dart/web3dart.dart'; @@ -8,15 +9,15 @@ class Formatter { if (number >= 1000000000) { // Convert to millions double num = number / 1000000000.0; - return '${num.toStringAsFixed(num.truncateToDouble() == num ? 0 : 1)}B'; + return '${num.toStringAsFixed(num.truncateToDouble() == num ? 0 : Config.decimalFixed)}B'; } else if (number >= 1000000) { // Convert to millions double num = number / 1000000.0; - return '${num.toStringAsFixed(num.truncateToDouble() == num ? 0 : 1)}M'; + return '${num.toStringAsFixed(num.truncateToDouble() == num ? 0 : Config.decimalFixed)}M'; } else if (number >= 1000) { // Convert to thousands double num = number / 1000.0; - return '${num.toStringAsFixed(num.truncateToDouble() == num ? 0 : 1)}K'; + return '${num.toStringAsFixed(num.truncateToDouble() == num ? 0 : Config.decimalFixed)}K'; } else { int accuracy = number.toString().split('.').last.length; var str = number.toString(); @@ -47,8 +48,10 @@ class Formatter { if (double.parse(inputString).toDouble() < 10000000000000000) { return '0'; } - String convertedString = - (double.parse(inputString).toDouble() / pow(10, 18)).toStringAsFixed(1); + final valueDouble = double.parse(inputString).toDouble() / pow(10, 18); + String convertedString = valueDouble % 1 == 0 + ? valueDouble.toString() + : valueDouble.toStringAsFixed(Config.decimalFixed); return convertedString; } @@ -59,8 +62,10 @@ class Formatter { String fractionalPart = ""; String integerPart = input; if (input.contains('.')) { - integerPart = input.split('.')[0]; - fractionalPart = ".${input.split('.')[1].substring(0, 1)}"; + final spitedString = input.split('.'); + integerPart = spitedString[0]; + fractionalPart = + ".${spitedString[1].substring(0, spitedString[1].length > Config.decimalFixed ? Config.decimalFixed : spitedString[1].length)}"; } integerPart = intThousandsSeparator(integerPart); return '$integerPart$fractionalPart'; diff --git a/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart b/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart index b5f3961d..2f1a68c9 100644 --- a/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart +++ b/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart @@ -135,7 +135,7 @@ class OpenDAppPresenter extends CompletePresenter { String finalFee = estimatedGasFee.gasFee.toString(); if (Validation.isExpoNumber(finalFee)) { - finalFee = '0.0'; + finalFee = '0.000'; } final symbol = state.network!.symbol; diff --git a/lib/features/portfolio/domain/portfolio_use_case.dart b/lib/features/portfolio/domain/portfolio_use_case.dart index 4929a5e6..39176aa2 100644 --- a/lib/features/portfolio/domain/portfolio_use_case.dart +++ b/lib/features/portfolio/domain/portfolio_use_case.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:developer'; import 'dart:math'; +import 'package:datadashwallet/common/config.dart'; import 'package:datadashwallet/core/core.dart'; import 'package:mxc_logic/mxc_logic.dart'; import 'package:web3dart/web3dart.dart'; @@ -14,6 +15,7 @@ class PortfolioUseCase extends ReactiveUseCase { Future getWalletNativeTokenBalance(String address) async { final wallet = await (await _repository.tokenContract).getEthBalance(address); - return (wallet.getInWei.toDouble() / pow(10, 18)).toStringAsFixed(2); + return (wallet.getInWei.toDouble() / pow(10, 18)) + .toStringAsFixed(Config.decimalFixed); } } diff --git a/packages/shared b/packages/shared index 95006188..96a44235 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 95006188a3c7b06fe575aab2b5d9e252c2a2b1d5 +Subproject commit 96a44235fb888eed30775d41b5d18d07df041790 From 686ed6d4a5e14a72ad943a724c13b8c1c71eee47 Mon Sep 17 00:00:00 2001 From: reasje Date: Thu, 14 Sep 2023 19:41:19 +0330 Subject: [PATCH 03/23] fix: Handle tokens balance & price & native token support --- .../contract/token_contract_use_case.dart | 29 +++++++++++++++---- packages/shared | 2 +- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lib/features/common/contract/token_contract_use_case.dart b/lib/features/common/contract/token_contract_use_case.dart index 8ce13814..8668670b 100644 --- a/lib/features/common/contract/token_contract_use_case.dart +++ b/lib/features/common/contract/token_contract_use_case.dart @@ -66,13 +66,21 @@ class TokenContractUseCase extends ReactiveUseCase { if (cNetwork.chainId == Config.mxcTestnetChainId || cNetwork.chainId == Config.mxcMainnetChainId) { - final mxcToken = Token( + final mxcNativeToken = Token( logoUri: result!.logoUri!, symbol: Config.mxcSymbol, name: Config.mxcName, decimals: Config.ethDecimals); - tokensList.value.add(mxcToken); + tokensList.value.add(mxcNativeToken); + } else { + final chainNativeToken = Token( + logoUri: result!.logoUri ?? 'assets/svg/networks/unknown.svg', + symbol: cNetwork.symbol, + name: '${cNetwork.symbol} Token', + decimals: Config.ethDecimals); + + tokensList.value.add(chainNativeToken); } if (result!.tokens != null) { @@ -102,10 +110,19 @@ class TokenContractUseCase extends ReactiveUseCase { } Future getTokensBalance(String walletAddress) async { - final result = await _repository.tokenContract - .getTokensBalance(tokensList.value, walletAddress); - update(tokensList, result); - getTokensPrice(); + try { + final result = await _repository.tokenContract + .getTokensBalance(tokensList.value, walletAddress); + update(tokensList, result); + getTokensPrice(); + } catch (e) { + final newList = []; + for (Token token in tokensList.value) { + newList.add(token.copyWith(balance: 0.0)); + } + update(tokensList, newList); + getTokensBalance(walletAddress); + } } Future getTokensPrice() async { diff --git a/packages/shared b/packages/shared index 96a44235..21a92abb 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 96a44235fb888eed30775d41b5d18d07df041790 +Subproject commit 21a92abbb628ddceffd806cc807dd8caf4d75be8 From 682dc33bf48bca1195f3b0b9a9451c4e70e940e8 Mon Sep 17 00:00:00 2001 From: reasje Date: Fri, 15 Sep 2023 11:41:26 +0330 Subject: [PATCH 04/23] fix: Improved adding native token to list & token list update --- .../contract/token_contract_use_case.dart | 33 +++++++------------ .../portfolio_page_presenter.dart | 10 +++--- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/lib/features/common/contract/token_contract_use_case.dart b/lib/features/common/contract/token_contract_use_case.dart index 8668670b..d1c18ccc 100644 --- a/lib/features/common/contract/token_contract_use_case.dart +++ b/lib/features/common/contract/token_contract_use_case.dart @@ -59,32 +59,21 @@ class TokenContractUseCase extends ReactiveUseCase { Future getDefaultTokens(String walletAddress) async { final result = await _repository.tokenContract.getDefaultTokens(); - tokensList.value.clear(); - final cNetwork = _repository.tokenContract.getCurrentNetwork(); - if (cNetwork.chainId == Config.mxcTestnetChainId || - cNetwork.chainId == Config.mxcMainnetChainId) { - final mxcNativeToken = Token( - logoUri: result!.logoUri!, - symbol: Config.mxcSymbol, - name: Config.mxcName, - decimals: Config.ethDecimals); - - tokensList.value.add(mxcNativeToken); - } else { - final chainNativeToken = Token( - logoUri: result!.logoUri ?? 'assets/svg/networks/unknown.svg', - symbol: cNetwork.symbol, - name: '${cNetwork.symbol} Token', - decimals: Config.ethDecimals); - - tokensList.value.add(chainNativeToken); - } + final chainNativeToken = Token( + logoUri: result?.logoUri ?? 'assets/svg/networks/unknown.svg', + symbol: cNetwork.symbol, + name: '${cNetwork.symbol} Token', + decimals: Config.ethDecimals); - if (result!.tokens != null) { - tokensList.value.addAll(result.tokens!); + tokensList.value.add(chainNativeToken); + + if (result != null) { + if (result.tokens != null) { + tokensList.value.addAll(result.tokens!); + } } update(tokensList, tokensList.value); diff --git a/lib/features/portfolio/presentation/portfolio_page_presenter.dart b/lib/features/portfolio/presentation/portfolio_page_presenter.dart index 526822e4..18cd04e8 100644 --- a/lib/features/portfolio/presentation/portfolio_page_presenter.dart +++ b/lib/features/portfolio/presentation/portfolio_page_presenter.dart @@ -39,12 +39,10 @@ class PortfolioPresenter extends CompletePresenter { }); listen(_tokenContractUseCase.tokensList, (newTokenList) { - if (newTokenList.isNotEmpty) { - if (state.tokensList != null) { - notify(() => state.tokensList = newTokenList); - } else { - state.tokensList = newTokenList; - } + if (state.tokensList != null) { + notify(() => state.tokensList = newTokenList); + } else { + state.tokensList = newTokenList; } }); From d618f5c97d8d5db2aa34ffa4be3b1783a86658e8 Mon Sep 17 00:00:00 2001 From: reasje Date: Fri, 15 Sep 2023 11:45:01 +0330 Subject: [PATCH 05/23] fix: Network currency missing from AXS wallet tx sheet --- .../send_crypto/send_crypto_presenter.dart | 21 ++++++++-------- .../widgets/transaction_dialog.dart | 2 ++ .../send_crypto/widgets/transaction_info.dart | 25 +++++++++++-------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/lib/features/portfolio/subfeatures/token/send_token/send_crypto/send_crypto_presenter.dart b/lib/features/portfolio/subfeatures/token/send_token/send_crypto/send_crypto_presenter.dart index bb31c108..6678cb39 100644 --- a/lib/features/portfolio/subfeatures/token/send_token/send_crypto/send_crypto_presenter.dart +++ b/lib/features/portfolio/subfeatures/token/send_token/send_crypto/send_crypto_presenter.dart @@ -115,17 +115,16 @@ class SendCryptoPresenter extends CompletePresenter { estimatedGasFee = await _estimatedFee(recipientAddress); sumBalance -= estimatedGasFee?.gasFee ?? 0.0; - final result = await showTransactionDialog( - context!, - amount: amount, - balance: sumBalance.toString(), - token: token, - newtork: state.network?.label ?? '--', - from: state.account!.address, - to: recipient, - estimatedFee: estimatedGasFee?.gasFee.toString(), - onTap: (transactionType) => _nextTransactionStep(transactionType), - ); + final result = await showTransactionDialog(context!, + amount: amount, + balance: sumBalance.toString(), + token: token, + newtork: state.network?.label ?? '--', + from: state.account!.address, + to: recipient, + estimatedFee: estimatedGasFee?.gasFee.toString(), + onTap: (transactionType) => _nextTransactionStep(transactionType), + networkSymbol: state.network?.symbol ?? '--'); } Future _nextTransactionStep(TransactionProcessType type) async { diff --git a/lib/features/portfolio/subfeatures/token/send_token/send_crypto/widgets/transaction_dialog.dart b/lib/features/portfolio/subfeatures/token/send_token/send_crypto/widgets/transaction_dialog.dart index 7c838bf1..79284703 100644 --- a/lib/features/portfolio/subfeatures/token/send_token/send_crypto/widgets/transaction_dialog.dart +++ b/lib/features/portfolio/subfeatures/token/send_token/send_crypto/widgets/transaction_dialog.dart @@ -12,6 +12,7 @@ Future showTransactionDialog( required String balance, required Token token, required String newtork, + required String networkSymbol, required String from, required String to, String? estimatedFee, @@ -37,6 +38,7 @@ Future showTransactionDialog( balance: balance, token: token, newtork: newtork, + networkSymbol: networkSymbol, from: from, to: to, estimatedFee: estimatedFee, diff --git a/lib/features/portfolio/subfeatures/token/send_token/send_crypto/widgets/transaction_info.dart b/lib/features/portfolio/subfeatures/token/send_token/send_crypto/widgets/transaction_info.dart index 5274ff8e..77e91ed3 100644 --- a/lib/features/portfolio/subfeatures/token/send_token/send_crypto/widgets/transaction_info.dart +++ b/lib/features/portfolio/subfeatures/token/send_token/send_crypto/widgets/transaction_info.dart @@ -13,6 +13,7 @@ class TransactionInfo extends StatefulWidget { required this.balance, required this.token, required this.newtork, + required this.networkSymbol, required this.from, required this.to, this.estimatedFee, @@ -24,6 +25,7 @@ class TransactionInfo extends StatefulWidget { final String balance; final Token token; final String newtork; + final String networkSymbol; final String from; final String to; final String? estimatedFee; @@ -58,12 +60,14 @@ class _TransactionInfoState extends State { child: Column( children: [ amountItem(context), - priceItem(context, 'balance', widget.balance), + priceItem( + context, 'balance', widget.balance, widget.token.symbol), textItem(context, 'network', widget.newtork), addressItem(context, 'from', widget.from), addressItem(context, 'to', widget.to), if (TransactionProcessType.confirm != processType) - priceItem(context, 'estimated_fee', widget.estimatedFee), + priceItem(context, 'estimated_fee', widget.estimatedFee, + widget.networkSymbol), ], ), ), @@ -143,7 +147,9 @@ class _TransactionInfoState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - Formatter.formatNumberForUI(widget.amount,), + Formatter.formatNumberForUI( + widget.amount, + ), style: FontTheme.of(context).h5(), ), const SizedBox(width: 4), @@ -158,11 +164,8 @@ class _TransactionInfoState extends State { ); } - Widget priceItem( - BuildContext context, - String label, - String? price, - ) { + Widget priceItem(BuildContext context, String label, String? price, + String? networkSymbol) { return TransactionItem( label: label, content: Row( @@ -170,13 +173,15 @@ class _TransactionInfoState extends State { children: [ Text( price != null - ? Formatter.formatNumberForUI(price, ) + ? Formatter.formatNumberForUI( + price, + ) : '--', style: FontTheme.of(context).body1.primary(), ), const SizedBox(width: 4), Text( - widget.token.symbol ?? '--', + networkSymbol ?? '--', style: FontTheme.of(context).body1().copyWith( color: ColorsTheme.of(context).grey2, ), From 286de1102e59006a96955d6858a1480e2e915aa2 Mon Sep 17 00:00:00 2001 From: reasje Date: Fri, 15 Sep 2023 11:48:11 +0330 Subject: [PATCH 06/23] fix: Avoid socket bug for other networks without socket --- lib/features/wallet/presentation/wallet_page_presenter.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/features/wallet/presentation/wallet_page_presenter.dart b/lib/features/wallet/presentation/wallet_page_presenter.dart index 3d14f49d..8db0f426 100644 --- a/lib/features/wallet/presentation/wallet_page_presenter.dart +++ b/lib/features/wallet/presentation/wallet_page_presenter.dart @@ -95,7 +95,7 @@ class WalletPresenter extends CompletePresenter { } void createSubscriptions() async { - if (state.subscription == null) { + if (state.subscription == null && state.network!.web3WebSocketUrl != null) { if (state.network!.web3WebSocketUrl!.isNotEmpty) { final subscription = await _tokenContractUseCase.subscribeToBalance( "addresses:${state.walletAddress}".toLowerCase(), From eaaedc0fcdecc27905503168b4174d6ec56acbe9 Mon Sep 17 00:00:00 2001 From: reasje Date: Fri, 15 Sep 2023 11:48:59 +0330 Subject: [PATCH 07/23] fix: bug with mxc token balance format in token list --- .../portfolio/subfeatures/tokens_balance_list/utils.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/features/portfolio/subfeatures/tokens_balance_list/utils.dart b/lib/features/portfolio/subfeatures/tokens_balance_list/utils.dart index 07a804b9..c40005f5 100644 --- a/lib/features/portfolio/subfeatures/tokens_balance_list/utils.dart +++ b/lib/features/portfolio/subfeatures/tokens_balance_list/utils.dart @@ -19,12 +19,8 @@ class TokensBalanceListUtils { final tokenName = currentToken.name ?? ''; final symbol = currentToken.symbol ?? ''; - balance = tokenName == 'MXC Token' - ? balance - : Formatter.formatNumberForUI(balance); - balanceInXsd = tokenName == 'MXC Token' - ? balanceInXsd - : Formatter.formatNumberForUI(balanceInXsd); + balance = Formatter.formatNumberForUI(balance); + balanceInXsd = Formatter.formatNumberForUI(balanceInXsd); widgets.add(TokenBalanceItem( logoUrl: logoUrl, From 38e8e0382c20bce3566b977b0a575bc414adc85c Mon Sep 17 00:00:00 2001 From: HU Xin Date: Fri, 15 Sep 2023 12:12:37 +0200 Subject: [PATCH 08/23] translate:fix import wallet --- assets/flutter_i18n/de.json | 2 +- assets/flutter_i18n/en.json | 2 +- assets/flutter_i18n/es.json | 2 +- assets/flutter_i18n/fr.json | 2 +- assets/flutter_i18n/id.json | 2 +- assets/flutter_i18n/it.json | 2 +- assets/flutter_i18n/ja.json | 2 +- assets/flutter_i18n/ko.json | 2 +- assets/flutter_i18n/nl.json | 2 +- assets/flutter_i18n/pt.json | 2 +- assets/flutter_i18n/ro.json | 2 +- assets/flutter_i18n/ru.json | 2 +- assets/flutter_i18n/tr.json | 2 +- assets/flutter_i18n/vi.json | 2 +- assets/flutter_i18n/zh_CN.json | 2 +- assets/flutter_i18n/zh_TW.json | 2 +- packages/shared | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/assets/flutter_i18n/de.json b/assets/flutter_i18n/de.json index 041b23d9..32151abe 100644 --- a/assets/flutter_i18n/de.json +++ b/assets/flutter_i18n/de.json @@ -229,7 +229,7 @@ "change_passcode_note": "Ändern Sie Ihren aktuellen Passcode. Wenn Sie Ihren neuen Passcode verlieren, können Sie ihn jederzeit wiederherstellen, indem Sie Ihre Wallet erneut importieren.", "clear_browser_cache_note": "Browserverlauf und Cookies löschen", "clear_browser_cache": "Verlauf & Cookies löschen", - "delete_wallet_note": "Setzen Sie alle Ihre Wallet-Daten zurück", + "delete_wallet_note": "Wallet importieren/Setzen Sie alle Ihre Wallet-Daten zurück", "clear_browser_history_note": "Browserverlauf und Cookies löschen?", "delete_wallet": "Wallet zurücksetzen", "export_wallet_note": "Wallet in gesicherten Speicher exportieren", diff --git a/assets/flutter_i18n/en.json b/assets/flutter_i18n/en.json index f82f7f01..01095529 100644 --- a/assets/flutter_i18n/en.json +++ b/assets/flutter_i18n/en.json @@ -230,7 +230,7 @@ "change_passcode_note": "Change your current passcode. If you lose your new passcode, you can always recover it by re-importing your wallet.", "clear_browser_cache_note": "Clear browser history and cookies", "clear_browser_cache": "Clear history & cookies", - "delete_wallet_note": "Delete wallet and clear all data", + "delete_wallet_note": "Import Wallet/Delete wallet and clear all data", "clear_browser_history_note": "Clear browser history and cookies?", "delete_wallet": "Delete wallet", "export_wallet_note": "Export wallet to secured storage", diff --git a/assets/flutter_i18n/es.json b/assets/flutter_i18n/es.json index 4d3deb85..d35e0c66 100644 --- a/assets/flutter_i18n/es.json +++ b/assets/flutter_i18n/es.json @@ -229,7 +229,7 @@ "change_passcode_note": "Cambia tu código de acceso actual. Si pierdes tu nuevo código, siempre puedes recuperarlo volviendo a importar tu billetera.", "clear_browser_cache_note": "Borra el historial del navegador y las cookies", "clear_browser_cache": "Borrar historial y cookies", - "delete_wallet_note": "Restablece todos los datos de tu billetera", + "delete_wallet_note": "Importar cartera/Restablece todos los datos de tu billetera", "clear_browser_history_note": "¿Borrar historial del navegador y cookies?", "delete_wallet": "Restablecer billetera", "export_wallet_note": "Exportar cartera a almacenamiento seguro", diff --git a/assets/flutter_i18n/fr.json b/assets/flutter_i18n/fr.json index 8595b7ae..831b6cdd 100644 --- a/assets/flutter_i18n/fr.json +++ b/assets/flutter_i18n/fr.json @@ -229,7 +229,7 @@ "change_passcode_note": "Changez votre code d'accès actuel. Si vous perdez votre nouveau code, vous pouvez toujours le récupérer en réimportant votre portefeuille.", "clear_browser_cache_note": "Effacez l'historique de navigation et les cookies", "clear_browser_cache": "Effacer l'historique & les cookies", - "delete_wallet_note": "Réinitialisez toutes vos données de portefeuille", + "delete_wallet_note": "Importer le portefeuille/Réinitialisez toutes vos données de portefeuille", "clear_browser_history_note": "Effacer l'historique de navigation et les cookies?", "delete_wallet": "Réinitialiser le portefeuille", "export_wallet_note": "Exporter le portefeuille vers un stockage sécurisé", diff --git a/assets/flutter_i18n/id.json b/assets/flutter_i18n/id.json index 806f1d51..071e0ae2 100644 --- a/assets/flutter_i18n/id.json +++ b/assets/flutter_i18n/id.json @@ -229,7 +229,7 @@ "change_passcode_note": "Ganti kode sandi saat ini Anda. Jika Anda kehilangan kode sandi baru, Anda selalu dapat memulihkannya dengan mengimpor ulang dompet Anda.", "clear_browser_cache_note": "Hapus riwayat penjelajahan dan cookies", "clear_browser_cache": "Hapus riwayat & cookies", - "delete_wallet_note": "Atur ulang semua data dompet Anda", + "delete_wallet_note": "Impor Dompet/Atur ulang semua data dompet Anda", "clear_browser_history_note": "Hapus riwayat penjelajahan dan cookies?", "delete_wallet": "Reset dompet", "export_wallet_note": "Ekspor dompet ke penyimpanan yang aman", diff --git a/assets/flutter_i18n/it.json b/assets/flutter_i18n/it.json index 48eb5d5b..424479c3 100644 --- a/assets/flutter_i18n/it.json +++ b/assets/flutter_i18n/it.json @@ -229,7 +229,7 @@ "change_passcode_note": "Cambia il tuo codice di accesso attuale. Se perdi il tuo nuovo codice, puoi sempre recuperarlo reimportando il tuo portafoglio.", "clear_browser_cache_note": "Cancella la cronologia del browser e i cookie", "clear_browser_cache": "Cancella cronologia e cookie", - "delete_wallet_note": "Reimposta tutti i dati del tuo portafoglio", + "delete_wallet_note": "Importa portafoglio/Reimposta tutti i dati del tuo portafoglio", "clear_browser_history_note": "Cancellare cronologia del browser e cookie?", "delete_wallet": "Ripristina portafoglio", "export_wallet_note": "Esporta il portafoglio in memoria sicura", diff --git a/assets/flutter_i18n/ja.json b/assets/flutter_i18n/ja.json index 1a349c30..e198e145 100644 --- a/assets/flutter_i18n/ja.json +++ b/assets/flutter_i18n/ja.json @@ -229,7 +229,7 @@ "change_passcode_note": "現在のパスコードを変更してください。新しいパスコードを紛失した場合でも、ウォレットを再インポートすることでいつでも回復できます。", "clear_browser_cache_note": "ブラウザの履歴とクッキーを消去してください", "clear_browser_cache": "履歴とクッキーを消去", - "delete_wallet_note": "あなたのウォレットデータをすべてリセットします", + "delete_wallet_note": "ウォレットのインポート/あなたのウォレットデータをすべてリセットします", "clear_browser_history_note": "ブラウザの履歴とクッキーを消去しますか?", "delete_wallet": "ウォレットをリセット", "export_wallet_note": "セキュアストレージにウォレットをエクスポートする", diff --git a/assets/flutter_i18n/ko.json b/assets/flutter_i18n/ko.json index 28d9a682..1e2d346e 100644 --- a/assets/flutter_i18n/ko.json +++ b/assets/flutter_i18n/ko.json @@ -229,7 +229,7 @@ "change_passcode_note": "현재 패스코드를 변경하세요. 새 패스코드를 잃어버린 경우, 지갑을 다시 가져오기로 항상 복구할 수 있습니다.", "clear_browser_cache_note": "브라우저 기록과 쿠키를 삭제하세요", "clear_browser_cache": "히스토리 & 쿠키 삭제", - "delete_wallet_note": "당신의 지갑 데이터를 모두 초기화하세요", + "delete_wallet_note": "지갑 가져오기/당신의 지갑 데이터를 모두 초기화하세요", "clear_browser_history_note": "브라우저 기록과 쿠키를 삭제하시겠습니까?", "delete_wallet": "지갑 초기화", "export_wallet_note": "지갑을 안전한 저장소로 내보내기", diff --git a/assets/flutter_i18n/nl.json b/assets/flutter_i18n/nl.json index 0cd53eb9..9a51f58c 100644 --- a/assets/flutter_i18n/nl.json +++ b/assets/flutter_i18n/nl.json @@ -229,7 +229,7 @@ "change_passcode_note": "Wijzig uw huidige toegangscode. Als u uw nieuwe toegangscode verliest, kunt u deze altijd herstellen door uw wallet opnieuw te importeren.", "clear_browser_cache_note": "Wis browsergeschiedenis en cookies", "clear_browser_cache": "Wis geschiedenis & cookies", - "delete_wallet_note": "Reset al uw walletgegevens.", + "delete_wallet_note": "Portemonnee importeren/Reset al uw walletgegevens.", "clear_browser_history_note": "Browsergeschiedenis en cookies wissen?", "delete_wallet": "Wallet resetten", "export_wallet_note": "Exporteer uw wallet naar een beveiligde opslag.", diff --git a/assets/flutter_i18n/pt.json b/assets/flutter_i18n/pt.json index 304d0330..3f0a165a 100644 --- a/assets/flutter_i18n/pt.json +++ b/assets/flutter_i18n/pt.json @@ -229,7 +229,7 @@ "change_passcode_note": "Altere seu código de acesso atual. Se perder seu novo código, você sempre pode recuperá-lo ao reimportar sua carteira.", "clear_browser_cache_note": "Limpe o histórico do navegador e os cookies", "clear_browser_cache": "Limpar histórico & cookies", - "delete_wallet_note": "Redefina todos os dados da sua carteira", + "delete_wallet_note": "Importar carteira/Redefina todos os dados da sua carteira", "clear_browser_history_note": "Limpar histórico do navegador e cookies?", "delete_wallet": "Redefinir carteira", "export_wallet_note": "Exportar carteira para armazenamento seguro", diff --git a/assets/flutter_i18n/ro.json b/assets/flutter_i18n/ro.json index 230e1ccd..9c9eb8c8 100644 --- a/assets/flutter_i18n/ro.json +++ b/assets/flutter_i18n/ro.json @@ -229,7 +229,7 @@ "change_passcode_note": "Schimbă-ți codul de acces actual. Dacă îți pierzi noul cod de acces, îl poți recupera oricând reimportând portofelul tău.", "clear_browser_cache_note": "Șterge istoricul și cookie-urile browserului", "clear_browser_cache": "Șterge istoricul & cookie-urile", - "delete_wallet_note": "Resetează toate datele portofelului tău", + "delete_wallet_note": "Importă portofelul/Resetează toate datele portofelului tău", "clear_browser_history_note": "Ștergeți istoricul și cookie-urile browserului?", "delete_wallet": "Resetează portofelul", "export_wallet_note": "Exportați portofelul în spațiul de stocare securizat", diff --git a/assets/flutter_i18n/ru.json b/assets/flutter_i18n/ru.json index 09767806..ff9cad4d 100644 --- a/assets/flutter_i18n/ru.json +++ b/assets/flutter_i18n/ru.json @@ -229,7 +229,7 @@ "change_passcode_note": "Измените текущий пароль. Если вы потеряете новый пароль, всегда сможете восстановить его, повторно импортировав кошелек.", "clear_browser_cache_note": "Очистите историю браузера и куки", "clear_browser_cache": "Очистить историю и куки", - "delete_wallet_note": "Сбросьте все данные вашего кошелька", + "delete_wallet_note": "Импортировать кошелек/Сбросьте все данные вашего кошелька", "clear_browser_history_note": "Очистить историю браузера и куки?", "delete_wallet": "Сбросить кошелек", "export_wallet_note": "Экспорт кошелька в защищенное хранилище", diff --git a/assets/flutter_i18n/tr.json b/assets/flutter_i18n/tr.json index ea550ee5..cd18a928 100644 --- a/assets/flutter_i18n/tr.json +++ b/assets/flutter_i18n/tr.json @@ -229,7 +229,7 @@ "change_passcode_note": "Mevcut şifrenizi değiştirin. Yeni şifrenizi kaybederseniz, cüzdanınızı yeniden içe aktararak her zaman kurtarabilirsiniz.", "clear_browser_cache_note": "Tarayıcı geçmişini ve çerezleri temizle", "clear_browser_cache": "Geçmişi temizle & çerezleri sil", - "delete_wallet_note": "Cüzdan verilerinizi sıfırlayın", + "delete_wallet_note": "Cüzdanı İçe Aktar/Cüzdan verilerinizi sıfırlayın", "clear_browser_history_note": "Tarayıcı geçmişi ve çerezler temizlensin mi?", "delete_wallet": "Cüzdanı sıfırla", "export_wallet_note": "Cüzdanı güvenli depolamaya aktar", diff --git a/assets/flutter_i18n/vi.json b/assets/flutter_i18n/vi.json index f6fb81a3..869b41d6 100644 --- a/assets/flutter_i18n/vi.json +++ b/assets/flutter_i18n/vi.json @@ -229,7 +229,7 @@ "change_passcode_note": "Đổi mã passcode hiện tại của bạn. Nếu bạn mất mã passcode mới, bạn luôn có thể khôi phục nó bằng cách nhập lại ví của bạn.", "clear_browser_cache_note": "Xóa lịch sử trình duyệt và cookie", "clear_browser_cache": "Xóa lịch sử & cookie", - "delete_wallet_note": "Đặt lại tất cả dữ liệu ví của bạn", + "delete_wallet_note": "Nhập ví/Đặt lại tất cả dữ liệu ví của bạn", "clear_browser_history_note": "Xóa lịch sử trình duyệt và cookie?", "delete_wallet": "Đặt lại ví", "export_wallet_note": "Xuất ví vào bộ nhớ an toàn", diff --git a/assets/flutter_i18n/zh_CN.json b/assets/flutter_i18n/zh_CN.json index 812d754c..ced96e7d 100644 --- a/assets/flutter_i18n/zh_CN.json +++ b/assets/flutter_i18n/zh_CN.json @@ -229,7 +229,7 @@ "change_passcode_note": "更改您当前的密码。如果您遗失了新密码,可以通过重新导入钱包来恢复。", "clear_browser_cache_note": "清除浏览器历史记录和cookies", "clear_browser_cache": "清除历史记录和cookies", - "delete_wallet_note": "重置您的所有钱包数据", + "delete_wallet_note": "导入钱包/重置您的所有钱包数据", "clear_browser_history_note": "清除浏览器历史记录和cookies?", "delete_wallet": "重置钱包", "export_wallet_note": "将钱包导出到安全存储", diff --git a/assets/flutter_i18n/zh_TW.json b/assets/flutter_i18n/zh_TW.json index c82c822a..5c27fe32 100644 --- a/assets/flutter_i18n/zh_TW.json +++ b/assets/flutter_i18n/zh_TW.json @@ -229,7 +229,7 @@ "change_passcode_note": "更改您當前的密碼。如果您遺失了新的密碼,您可以通過重新導入您的錢包來恢復它。", "clear_browser_cache_note": "清除瀏覽器歷史記錄和cookies", "clear_browser_cache": "清除歷史記錄和cookies", - "delete_wallet_note": "重設所有的錢包數據", + "delete_wallet_note": "導入錢包/重設所有的錢包數據", "clear_browser_history_note": "清除瀏覽器歷史記錄和cookies?", "delete_wallet": "重設錢包", "export_wallet_note": "將錢包導出到安全儲存區", diff --git a/packages/shared b/packages/shared index 21a92abb..95006188 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 21a92abbb628ddceffd806cc807dd8caf4d75be8 +Subproject commit 95006188a3c7b06fe575aab2b5d9e252c2a2b1d5 From 9d4010baa66252f4756534c57779d8e8f21a94db Mon Sep 17 00:00:00 2001 From: reasje Date: Fri, 15 Sep 2023 14:39:43 +0330 Subject: [PATCH 09/23] fix: Webview reload bug --- .../subfeatures/open_dapp/open_dapp_page.dart | 1 + .../open_dapp/open_dapp_presenter.dart | 18 +++++++++++++----- .../lib/js_bridge_callback_bean.dart | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart b/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart index 7eec00b0..a8559737 100644 --- a/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart +++ b/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart @@ -68,6 +68,7 @@ class OpenAppPage extends HookConsumerWidget { presenter.onWebViewCreated(controller), onProgressChanged: (controller, progress) async { presenter.changeProgress(progress); + presenter.setChain(null); }, signCallback: (params, eip1193, controller) async { final id = params['id']; diff --git a/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart b/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart index 2f1a68c9..6db8718c 100644 --- a/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart +++ b/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart @@ -199,16 +199,24 @@ class OpenDAppPresenter extends CompletePresenter { _chainConfigurationUseCase.switchDefaultNetwork(toNetwork); _authUseCase.resetNetwork(toNetwork); notify(() => state.network = toNetwork); - var config = """{ + + setChain(id); + } + + void setChain(int? id) { + state.webviewController?.setChain(getConfig(), state.network!.chainId, id); + } + + String getConfig() { + return """{ ethereum: { - chainId: ${toNetwork.chainId}, - rpcUrl: "${toNetwork.web3RpcHttpUrl}", + chainId: ${state.network!.chainId}, + rpcUrl: "${state.network!.web3RpcHttpUrl}", address: "${state.account!.address}", isDebug: true, - networkVersion: "${toNetwork.chainId}", + networkVersion: "${state.network!.chainId}", isMetaMask: true } }"""; - state.webviewController?.setChain(config, toNetwork.chainId, id); } } diff --git a/packages/web3_provider/lib/js_bridge_callback_bean.dart b/packages/web3_provider/lib/js_bridge_callback_bean.dart index 9a5ac3aa..5d4ebc87 100644 --- a/packages/web3_provider/lib/js_bridge_callback_bean.dart +++ b/packages/web3_provider/lib/js_bridge_callback_bean.dart @@ -39,12 +39,12 @@ extension Web3Result on InAppWebViewController { sendResults([address], id); } - void setChain(String config, int chainId, int id) async { + void setChain(String config, int chainId, int? id) async { final setConfigScript = "console.log(window.ethereum.setConfig($config))"; final emitChainChangeScript = "console.log(window.ethereum.emitChainChanged($chainId))"; await evaluateJavascript(source: setConfigScript); await evaluateJavascript(source: emitChainChangeScript); - sendResult('null', id); + if (id != null) sendResult('null', id); } } From ee1b5e9acc80ec9f379e1e26c01cf3b1dad7e864 Mon Sep 17 00:00:00 2001 From: reasje Date: Fri, 15 Sep 2023 14:40:27 +0330 Subject: [PATCH 10/23] fix: update shared --- packages/shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared b/packages/shared index 95006188..21a92abb 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 95006188a3c7b06fe575aab2b5d9e252c2a2b1d5 +Subproject commit 21a92abbb628ddceffd806cc807dd8caf4d75be8 From c057bf33f748e7e7c9e4ce888d2f034332535aba Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 18 Sep 2023 15:17:29 +0330 Subject: [PATCH 11/23] fix: Added microphone permission ios --- ios/Runner/Info.plist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index db9dab66..5b274e5e 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -113,6 +113,8 @@ Would you allow AXS Wallet to use the Calendar? NSCameraUsageDescription AXS Wallet needs camera access to scan QR codes for transactions. Scanned data is stored locally and isn't shared. + NSMicrophoneUsageDescription + AXS Wallet needs microphone access to scan QR codes for transactions. Scanned data is stored locally and isn't shared. NSContactsUsageDescription Would you allow AXS Wallet to use the Contacts? NSFaceIDUsageDescription From 3dfed82ffc993b7375ab5fe1473fb3a921879da7 Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 18 Sep 2023 15:18:20 +0330 Subject: [PATCH 12/23] fix: Added location package for location service --- pubspec.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 606ec8b3..e5f0b4ba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,10 +28,13 @@ environment: # the latest version available on pub.dev. To see which dependencies have newer # versions available, run `flutter pub outdated`. dependencies: + android_metadata: ^0.2.1 appinio_social_share: path: packages/appinio_social_share + cached_network_image: ^3.2.3 clipboard: ^0.1.3 collection: ^1.17.0 + connectivity_plus: ^4.0.2 convert: ^3.1.1 cupertino_icons: ^1.0.2 dotted_line: ^3.2.2 @@ -39,57 +42,54 @@ dependencies: path: packages/ens_dart equatable: ^2.0.3 eth_sig_util: ^0.0.9 + f_logs: ^2.0.1 fl_chart: ^0.62.0 fl_shared_link: ^0.0.3 flutter: sdk: flutter + flutter_app_update: + path: packages/flutter_app_update + flutter_dotenv: ^5.1.0 flutter_hooks: ^0.18.5+1 flutter_i18n: ^0.32.4 flutter_inappwebview: ^5.7.2+3 flutter_mailer: ^2.0.2 + flutter_staggered_grid_view: ^0.7.0 flutter_svg: ^2.0.1 hooks_riverpod: ^1.0.3 + jdenticon_dart: ^2.0.0 local_auth: path: packages/local_auth/local_auth + location: ^4.4.0 lottie: ^2.3.2 mxc_logic: path: packages/shared/logic mxc_ui: path: packages/shared/ui open_mail_app: ^0.4.5 + package_info_plus: ^1.0.0 path_provider: ^2.0.12 permission_handler: ^10.4.1 - qr_flutter: ^4.1.0 qr_code_scanner: ^1.0.1 + qr_flutter: ^4.1.0 + responsive_builder: ^0.7.0 riverpod: ^1.0.3 sha3: ^0.2.0 + share_plus: ^6.3.4 + shimmer: ^2.0.0 sliver_tools: ^0.2.5 + social_embed_webview: ^0.3.2 + twitter_oembed_api: ^0.1.0 url_launcher: ^6.1.11 wallet_connect: ^1.0.4 - # web3_provider: ^1.1.3 web3_provider: path: packages/web3_provider - package_info_plus: ^1.0.0 - jdenticon_dart: ^2.0.0 - twitter_oembed_api: ^0.1.0 - social_embed_webview: ^0.3.2 - connectivity_plus: ^4.0.2 - f_logs: ^2.0.1 - responsive_builder: ^0.7.0 - flutter_staggered_grid_view: ^0.7.0 - shimmer: ^2.0.0 - cached_network_image: ^3.2.3 - flutter_dotenv: ^5.1.0 - flutter_app_update: - path: packages/flutter_app_update - android_metadata: ^0.2.1 - share_plus: ^6.3.4 dev_dependencies: + flutter_launcher_icons: ^0.9.0 flutter_lints: ^2.0.0 flutter_test: sdk: flutter - flutter_launcher_icons: ^0.9.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec From a1f0886a40946946e4b3b54722721b59d177cfd8 Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 18 Sep 2023 15:23:42 +0330 Subject: [PATCH 13/23] fix: location permission denied --- .../subfeatures/open_dapp/open_dapp_page.dart | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart b/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart index a8559737..1da45717 100644 --- a/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart +++ b/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart @@ -96,13 +96,6 @@ class OpenAppPage extends HookConsumerWidget { case EIP1193.addEthereumChain: bool? result = await presenter.addEthereumChain(id, params); - // final isL3Bridge = - // Config.reloadDapp.any((e) => url.contains(e)); - // if (isL3Bridge) { - // if (result != null && result) { - // controller!.reload(); - // } - // } break; default: break; @@ -112,12 +105,34 @@ class OpenAppPage extends HookConsumerWidget { crossPlatform: InAppWebViewOptions( useShouldOverrideUrlLoading: true, ), + android: AndroidInAppWebViewOptions( + useWideViewPort: true, + geolocationEnabled: true, + useHybridComposition: true, + ), + ios: IOSInAppWebViewOptions( + allowsInlineMediaPlayback: true, + ), ), gestureRecognizers: >{ Factory( () => VerticalDragGestureRecognizer(), ), }, + androidOnPermissionRequest: + (controller, origin, resources) async { + return PermissionRequestResponse( + resources: resources, + action: PermissionRequestResponseAction.GRANT, + ); + }, + androidOnGeolocationPermissionsHidePrompt: (controller) { + }, + androidOnGeolocationPermissionsShowPrompt: + (InAppWebViewController controller, String origin) async { + return GeolocationPermissionShowPromptResponse( + origin: origin, allow: true, retain: true); + }, ), ), if (state.progress != 100) From f11e3b54cfbf8b0189e563251ec409e6ce8e70f0 Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 18 Sep 2023 15:24:22 +0330 Subject: [PATCH 14/23] fix: Location service request --- .../dapps/presentation/dapps_presenter.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/features/dapps/presentation/dapps_presenter.dart b/lib/features/dapps/presentation/dapps_presenter.dart index c36881d0..eb1b4a7e 100644 --- a/lib/features/dapps/presentation/dapps_presenter.dart +++ b/lib/features/dapps/presentation/dapps_presenter.dart @@ -4,7 +4,7 @@ import 'package:datadashwallet/features/dapps/dapps.dart'; import 'package:flutter/services.dart'; import 'package:mxc_logic/mxc_logic.dart'; import 'package:permission_handler/permission_handler.dart'; - +import 'package:location/location.dart' as lc; import 'dapps_state.dart'; import 'responsive_layout/dapp_utils.dart'; import 'widgets/gestures_instruction.dart'; @@ -162,6 +162,9 @@ class DAppsPagePresenter extends CompletePresenter { } } + if (keys.contains('location')) { + await checkLocationService(); + } if (needPermissions.isNotEmpty) { await needPermissions.request(); await PermissionUtils.permissionsStatus(); @@ -185,4 +188,16 @@ class DAppsPagePresenter extends CompletePresenter { } } } + + Future checkLocationService() async { + lc.Location location = lc.Location(); + + bool _serviceEnabled; + + _serviceEnabled = await location.serviceEnabled(); + if (!_serviceEnabled) { + _serviceEnabled = await location.requestService(); + } + return _serviceEnabled; + } } From f01fdf37407ca05dfb84632c0e50ffb563214ffb Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 18 Sep 2023 15:49:24 +0330 Subject: [PATCH 15/23] fix: Auto media play added to webview config --- lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart b/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart index 1da45717..5db5de7a 100644 --- a/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart +++ b/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart @@ -101,9 +101,11 @@ class OpenAppPage extends HookConsumerWidget { break; } }, + initialOptions: InAppWebViewGroupOptions( crossPlatform: InAppWebViewOptions( useShouldOverrideUrlLoading: true, + mediaPlaybackRequiresUserGesture: false ), android: AndroidInAppWebViewOptions( useWideViewPort: true, From 4bd09725db3e988bd370e56768fe62ce1ce3660e Mon Sep 17 00:00:00 2001 From: rd101rahul <65663039+rd101rahul@users.noreply.github.com> Date: Mon, 18 Sep 2023 14:46:34 +0200 Subject: [PATCH 16/23] Update pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e5f0b4ba..8d250a94 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.2.2 +version: 1.2.2+2 environment: sdk: ">=2.19.0 <3.0.0" From 5affe1b4528de0432417933f28d09bdf670a9fed Mon Sep 17 00:00:00 2001 From: rd101rahul <65663039+rd101rahul@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:09:32 +0200 Subject: [PATCH 17/23] Update pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 8d250a94..94bc9afa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.2.2+2 +version: 1.2.3 environment: sdk: ">=2.19.0 <3.0.0" From a1d3bcac6736946a9c7cf8465ec80aaa20645d25 Mon Sep 17 00:00:00 2001 From: rd101rahul <65663039+rd101rahul@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:12:59 +0200 Subject: [PATCH 18/23] Update pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 606ec8b3..ee7a35b1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.2.2 +version: 1.2.3 environment: sdk: ">=2.19.0 <3.0.0" From 6d391eb86de81d20e826259381c99edaec9e8e74 Mon Sep 17 00:00:00 2001 From: HU Xin Date: Mon, 18 Sep 2023 15:48:07 +0200 Subject: [PATCH 19/23] translate: fix sending token --- assets/flutter_i18n/de.json | 2 +- assets/flutter_i18n/en.json | 2 +- assets/flutter_i18n/es.json | 2 +- assets/flutter_i18n/fr.json | 2 +- assets/flutter_i18n/id.json | 2 +- assets/flutter_i18n/it.json | 2 +- assets/flutter_i18n/ja.json | 2 +- assets/flutter_i18n/ko.json | 2 +- assets/flutter_i18n/nl.json | 2 +- assets/flutter_i18n/pt.json | 2 +- assets/flutter_i18n/ro.json | 2 +- assets/flutter_i18n/ru.json | 2 +- assets/flutter_i18n/tr.json | 2 +- assets/flutter_i18n/vi.json | 2 +- assets/flutter_i18n/zh_CN.json | 2 +- assets/flutter_i18n/zh_TW.json | 2 +- packages/shared | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/assets/flutter_i18n/de.json b/assets/flutter_i18n/de.json index 32151abe..311da349 100644 --- a/assets/flutter_i18n/de.json +++ b/assets/flutter_i18n/de.json @@ -32,7 +32,7 @@ "active": "Aktiv", "date": "Datum", "tx": "Tx = Transaktion", - "manage_portfolio": "Portfolio verwalten", + "manage_portfolio": "Token senden/Portfolio verwalten", "fiat_options": "FIAT Optionen", "show/hide_balance": "Balance anzeigen/verbergen", "balance": "Balance", diff --git a/assets/flutter_i18n/en.json b/assets/flutter_i18n/en.json index 01095529..de3c5e4c 100644 --- a/assets/flutter_i18n/en.json +++ b/assets/flutter_i18n/en.json @@ -33,7 +33,7 @@ "active": "Active", "date": "Date", "tx": "Tx", - "manage_portfolio": "Manage Portfolio", + "manage_portfolio": "Send Token/Manage Portfolio", "fiat_options": "FIAT Options", "show/hide_balance": "Show/Hide Balance", "balance": "Balance", diff --git a/assets/flutter_i18n/es.json b/assets/flutter_i18n/es.json index d35e0c66..3a55174d 100644 --- a/assets/flutter_i18n/es.json +++ b/assets/flutter_i18n/es.json @@ -32,7 +32,7 @@ "active": "Activo", "date": "Fecha", "tx": "Tx", - "manage_portfolio": "Gestionar Cartera", + "manage_portfolio": "Enviar token/Gestionar Cartera", "fiat_options": "Opciones FIAT", "show/hide_balance": "Mostrar/Ocultar Saldo", "balance": "Saldo", diff --git a/assets/flutter_i18n/fr.json b/assets/flutter_i18n/fr.json index 831b6cdd..f1f7ac2a 100644 --- a/assets/flutter_i18n/fr.json +++ b/assets/flutter_i18n/fr.json @@ -32,7 +32,7 @@ "active": "Actif", "date": "Date", "tx": "Tx devient Transaction", - "manage_portfolio": "Gérer le Portefeuille", + "manage_portfolio": "Envoyer le token/Gérer le Portefeuille", "fiat_options": "Options FIAT", "show/hide_balance": "Afficher/Masquer Solde", "balance": "Solde", diff --git a/assets/flutter_i18n/id.json b/assets/flutter_i18n/id.json index 071e0ae2..83b3cbac 100644 --- a/assets/flutter_i18n/id.json +++ b/assets/flutter_i18n/id.json @@ -32,7 +32,7 @@ "active": "Aktif", "date": "Tanggal", "tx": "Tx", - "manage_portfolio": "Kelola Portofolio", + "manage_portfolio": "Kirim token/Kelola Portofolio", "fiat_options": "Opsi FIAT", "show/hide_balance": "Tampilkan/Sembunyikan Saldo", "balance": "Saldo", diff --git a/assets/flutter_i18n/it.json b/assets/flutter_i18n/it.json index 424479c3..64e1cbeb 100644 --- a/assets/flutter_i18n/it.json +++ b/assets/flutter_i18n/it.json @@ -32,7 +32,7 @@ "active": "Attivo", "date": "Data", "tx": "Tx = Transazione", - "manage_portfolio": "Gestisci Portfolio", + "manage_portfolio": "Invia token/Gestisci Portfolio", "fiat_options": "Opzioni FIAT", "show/hide_balance": "Mostra/Nascondi Saldo", "balance": "Saldo", diff --git a/assets/flutter_i18n/ja.json b/assets/flutter_i18n/ja.json index e198e145..48d586ca 100644 --- a/assets/flutter_i18n/ja.json +++ b/assets/flutter_i18n/ja.json @@ -32,7 +32,7 @@ "active": "アクティブ", "date": "日付", "tx": "取引", - "manage_portfolio": "ポートフォリオを管理する", + "manage_portfolio": "トークンを送る/ポートフォリオを管理する", "fiat_options": "FIATオプション", "show/hide_balance": "残高の表示/非表示", "balance": "残高", diff --git a/assets/flutter_i18n/ko.json b/assets/flutter_i18n/ko.json index 1e2d346e..471d7883 100644 --- a/assets/flutter_i18n/ko.json +++ b/assets/flutter_i18n/ko.json @@ -32,7 +32,7 @@ "active": "활성화", "date": "날짜", "tx": "거래", - "manage_portfolio": "포트폴리오 관리", + "manage_portfolio": "토큰 보내기/포트폴리오 관리", "fiat_options": "현금자산 관리", "show/hide_balance": "잔액 표시/숨기기", "balance": "잔액", diff --git a/assets/flutter_i18n/nl.json b/assets/flutter_i18n/nl.json index 9a51f58c..d1105760 100644 --- a/assets/flutter_i18n/nl.json +++ b/assets/flutter_i18n/nl.json @@ -32,7 +32,7 @@ "active": "Actief", "date": "Datum", "tx": "Transactie", - "manage_portfolio": "Beheer Portfolio", + "manage_portfolio": "Token versturen/Beheer Portfolio", "fiat_options": "FIAT Opties", "show/hide_balance": "Toon/Verberg Saldo", "balance": "Saldo", diff --git a/assets/flutter_i18n/pt.json b/assets/flutter_i18n/pt.json index 3f0a165a..1d58ce8d 100644 --- a/assets/flutter_i18n/pt.json +++ b/assets/flutter_i18n/pt.json @@ -32,7 +32,7 @@ "active": "Ativo", "date": "Data", "tx": "Transação", - "manage_portfolio": "Gerenciar Portfólio", + "manage_portfolio": "Enviar token/Gerenciar Portfólio", "fiat_options": "Opções FIAT", "show/hide_balance": "Mostrar/Ocultar Saldo", "balance": "Saldo", diff --git a/assets/flutter_i18n/ro.json b/assets/flutter_i18n/ro.json index 9c9eb8c8..7cf8ede1 100644 --- a/assets/flutter_i18n/ro.json +++ b/assets/flutter_i18n/ro.json @@ -32,7 +32,7 @@ "active": "Activă", "date": "Dată", "tx": "Tranzacție", - "manage_portfolio": "Gestionează Portofoliu", + "manage_portfolio": "Trimite token/Gestionează Portofoliu", "fiat_options": "Opțiuni FIAT", "show/hide_balance": "Afișează/Ascunde Balanța", "balance": "Sold", diff --git a/assets/flutter_i18n/ru.json b/assets/flutter_i18n/ru.json index ff9cad4d..53b9c3df 100644 --- a/assets/flutter_i18n/ru.json +++ b/assets/flutter_i18n/ru.json @@ -32,7 +32,7 @@ "active": "Активный", "date": "Дата", "tx": "Транзакция", - "manage_portfolio": "Управление Портфелем", + "manage_portfolio": "Otpravit' token/Управление Портфелем", "fiat_options": "Наличные", "show/hide_balance": "Показать/Скрыть Баланс", "balance": "Баланс", diff --git a/assets/flutter_i18n/tr.json b/assets/flutter_i18n/tr.json index cd18a928..31efb6af 100644 --- a/assets/flutter_i18n/tr.json +++ b/assets/flutter_i18n/tr.json @@ -32,7 +32,7 @@ "active": "Aktif", "date": "Tarih", "tx": "İşlem", - "manage_portfolio": "Portföyü Yönet", + "manage_portfolio": "Token gönder/Portföyü Yönet", "fiat_options": "FIAT Seçenekleri", "show/hide_balance": "Bakiyeyi Göster/Gizle", "balance": "Bakiye", diff --git a/assets/flutter_i18n/vi.json b/assets/flutter_i18n/vi.json index 869b41d6..968e5d60 100644 --- a/assets/flutter_i18n/vi.json +++ b/assets/flutter_i18n/vi.json @@ -32,7 +32,7 @@ "active": "Hoạt động", "date": "Ngày", "tx": "Giao dịch", - "manage_portfolio": "Quản lý Danh mục đầu tư", + "manage_portfolio": "Gửi token/Quản lý Danh mục đầu tư", "fiat_options": "Tùy chọn FIAT", "show/hide_balance": "Hiển thị/Ẩn Số dư", "balance": "Số dư", diff --git a/assets/flutter_i18n/zh_CN.json b/assets/flutter_i18n/zh_CN.json index ced96e7d..053282c9 100644 --- a/assets/flutter_i18n/zh_CN.json +++ b/assets/flutter_i18n/zh_CN.json @@ -32,7 +32,7 @@ "active": "活跃", "date": "日期", "tx": "交易", - "manage_portfolio": "管理投资组合", + "manage_portfolio": "发送Token/管理投资组合", "fiat_options": "法币选项", "show/hide_balance": "显示/隐藏余额", "balance": "余额", diff --git a/assets/flutter_i18n/zh_TW.json b/assets/flutter_i18n/zh_TW.json index 5c27fe32..022f313a 100644 --- a/assets/flutter_i18n/zh_TW.json +++ b/assets/flutter_i18n/zh_TW.json @@ -32,7 +32,7 @@ "active": "活躍", "date": "日期", "tx": "交易", - "manage_portfolio": "管理投資組合", + "manage_portfolio": "發送Token管理投資組合", "fiat_options": "法幣選項", "show/hide_balance": "顯示/隱藏餘額", "balance": "餘額", diff --git a/packages/shared b/packages/shared index 21a92abb..95006188 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 21a92abbb628ddceffd806cc807dd8caf4d75be8 +Subproject commit 95006188a3c7b06fe575aab2b5d9e252c2a2b1d5 From adb0f3aceee0286de05e497371b896ea3edfde4d Mon Sep 17 00:00:00 2001 From: rd101rahul <65663039+rd101rahul@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:38:02 +0200 Subject: [PATCH 20/23] Update pubspec.yaml Version update to 1,3,0 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 94bc9afa..3c3852f7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.2.3 +version: 1.3.0 environment: sdk: ">=2.19.0 <3.0.0" From a8bf691131566eb5ffebee3c502589fd9ec04246 Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 18 Sep 2023 18:52:24 +0330 Subject: [PATCH 21/23] fix: Added token transfer --- .../common/contract/token_contract_use_case.dart | 15 ++++++++------- .../send_crypto/send_crypto_presenter.dart | 8 ++++---- packages/shared | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/features/common/contract/token_contract_use_case.dart b/lib/features/common/contract/token_contract_use_case.dart index d1c18ccc..f12f8420 100644 --- a/lib/features/common/contract/token_contract_use_case.dart +++ b/lib/features/common/contract/token_contract_use_case.dart @@ -152,15 +152,16 @@ class TokenContractUseCase extends ReactiveUseCase { required EtherAmount amount, EstimatedGasFee? estimatedGasFee, Uint8List? data, + String? tokenAddress, }) async => await _repository.tokenContract.sendTransaction( - privateKey: privateKey, - to: to, - from: from, - amount: amount, - estimatedGasFee: estimatedGasFee, - data: data, - ); + privateKey: privateKey, + to: to, + from: from, + amount: amount, + estimatedGasFee: estimatedGasFee, + data: data, + tokenAddress: tokenAddress); Future getChainId(String rpcUrl) async { return await _repository.tokenContract.getChainId(rpcUrl); diff --git a/lib/features/portfolio/subfeatures/token/send_token/send_crypto/send_crypto_presenter.dart b/lib/features/portfolio/subfeatures/token/send_token/send_crypto/send_crypto_presenter.dart index 6678cb39..c5844e3f 100644 --- a/lib/features/portfolio/subfeatures/token/send_token/send_crypto/send_crypto_presenter.dart +++ b/lib/features/portfolio/subfeatures/token/send_token/send_crypto/send_crypto_presenter.dart @@ -168,10 +168,10 @@ class SendCryptoPresenter extends CompletePresenter { String recipientAddress = await getAddress(recipient); final res = await _tokenContractUseCase.sendTransaction( - privateKey: state.account!.privateKey, - to: recipientAddress, - amount: amount, - ); + privateKey: state.account!.privateKey, + to: recipientAddress, + amount: amount, + tokenAddress: token.address); return res; } catch (e, s) { diff --git a/packages/shared b/packages/shared index 21a92abb..00158a47 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 21a92abbb628ddceffd806cc807dd8caf4d75be8 +Subproject commit 00158a47ce074e64970a9ea4486b620c2fadf63e From 695e6eb5d3f7c117b6043b3c52012357b9c07901 Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 18 Sep 2023 19:39:45 +0330 Subject: [PATCH 22/23] fix: Added token transfer pending more info --- .../components/recent_transactions/utils.dart | 14 +++++++++++ packages/shared | 2 +- pubspec.lock | 24 +++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/lib/common/components/recent_transactions/utils.dart b/lib/common/components/recent_transactions/utils.dart index 51bd7549..2be06817 100644 --- a/lib/common/components/recent_transactions/utils.dart +++ b/lib/common/components/recent_transactions/utils.dart @@ -104,6 +104,20 @@ class RecentTransactionsUtils { currentTx.value ?? '0', Config.ethDecimals); logoUrl = Config.mxcLogoUri; symbol = Config.mxcName; + + if (currentTx.decodedInput != null) { + if (currentTx.to?.hash != null) { + final tokenIndex = tokensList + .indexWhere((element) => element.address == currentTx.to!.hash); + if (tokenIndex != -1) { + logoUrl = tokensList[tokenIndex].logoUri!; + } + symbol = currentTx.to!.name!; + amount = Formatter.convertWeiToEth( + currentTx.decodedInput?.parameters?[1].value ?? '0', + Config.ethDecimals); + } + } } else if (currentTx.txTypes != null && currentTx.txTypes!.contains('coin_transfer')) { logoUrl = Config.mxcLogoUri; diff --git a/packages/shared b/packages/shared index 00158a47..48c16017 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 00158a47ce074e64970a9ea4486b620c2fadf63e +Subproject commit 48c16017adf3404442c0385184880342578d9031 diff --git a/pubspec.lock b/pubspec.lock index 7eeb104a..318e3e42 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -705,6 +705,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.1+4" + location: + dependency: "direct main" + description: + name: location + sha256: "9051959f6f2ccadd887b28b66e9cbbcc25b6838e37cf9e894c421ccc0ebf80b5" + url: "https://pub.dev" + source: hosted + version: "4.4.0" + location_platform_interface: + dependency: transitive + description: + name: location_platform_interface + sha256: "62eeaf1658e92e4459b727f55a3c328eccbac8ba043fa6d262ac5286ad48384c" + url: "https://pub.dev" + source: hosted + version: "2.3.0" + location_web: + dependency: transitive + description: + name: location_web + sha256: "6c08c408a040534c0269c4ff9fe17eebb5a36dea16512fbaf116b9c8bc21545b" + url: "https://pub.dev" + source: hosted + version: "3.1.1" logging: dependency: transitive description: From 58f93393a539b1f40a15ac80a4f3c1610ca9bccb Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 18 Sep 2023 19:44:19 +0330 Subject: [PATCH 23/23] fix: update share --- packages/shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared b/packages/shared index 95006188..48c16017 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 95006188a3c7b06fe575aab2b5d9e252c2a2b1d5 +Subproject commit 48c16017adf3404442c0385184880342578d9031