Filters out TRC10 spam transactions and modifies Solana error messages (#1587)
Some checks failed
Cache Dependencies / test (push) Has been cancelled

* fix: Tron and solana fixes

* fix: Disable send all for solana wallets

* fix: Add localization and add tostring to get more info on error

* fix: Fix spelling for comment

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
David Adegoke 2024-08-10 00:02:47 +01:00 committed by GitHub
parent b412d45f0e
commit 96baf460f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 42 additions and 5 deletions

View file

@ -456,7 +456,7 @@ class SolanaWalletClient {
funder: ownerKeypair,
);
} catch (e) {
throw Exception('Insufficient SOL balance to complete this transaction');
throw Exception('Insufficient SOL balance to complete this transaction: ${e.toString()}');
}
// Input by the user

View file

@ -11,7 +11,7 @@ environment:
dependencies:
flutter:
sdk: flutter
solana: ^0.30.1
solana: ^0.30.4
cw_core:
path: ../cw_core
http: ^1.1.0

View file

@ -349,6 +349,11 @@ abstract class TronWalletBase
continue;
}
// Filter out spam transaactions that involve receiving TRC10 assets transaction, we deal with TRX and TRC20 transactions
if (transactionModel.contracts?.first.type == "TransferAssetContract") {
continue;
}
String? tokenSymbol;
if (transactionModel.contractAddress != null) {
final tokenAddress = TronAddress(transactionModel.contractAddress!);

View file

@ -216,7 +216,7 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
onTapPicker: () => _presentPicker(context),
isPickerEnable: sendViewModel.hasMultipleTokens,
tag: sendViewModel.selectedCryptoCurrency.tag,
allAmountButton: !sendViewModel.isBatchSending,
allAmountButton: !sendViewModel.isBatchSending && sendViewModel.shouldDisplaySendALL,
currencyValueValidator: output.sendAll
? sendViewModel.allAmountValidator
: sendViewModel.amountValidator,

View file

@ -118,7 +118,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
@computed
bool get isBatchSending => outputs.length > 1;
bool get shouldDisplaySendALL => walletType != WalletType.solana || walletType != WalletType.tron;
bool get shouldDisplaySendALL => walletType != WalletType.solana;
@computed
String get pendingTransactionFiatAmount {
@ -582,9 +582,15 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
) {
String errorMessage = error.toString();
if (walletType == WalletType.solana) {
if (errorMessage.contains('insufficient funds for rent')) {
return S.current.insufficientFundsForRentError;
}
return errorMessage;
}
if (walletType == WalletType.ethereum ||
walletType == WalletType.polygon ||
walletType == WalletType.solana ||
walletType == WalletType.haven) {
if (errorMessage.contains('gas required exceeds allowance') ||
errorMessage.contains('insufficient funds')) {

View file

@ -337,6 +337,7 @@
"incoming": "الواردة",
"incorrect_seed": "النص الذي تم إدخاله غير صالح.",
"inputs": "المدخلات",
"insufficientFundsForRentError": "ليس لديك ما يكفي من SOL لتغطية رسوم المعاملة والإيجار للحساب. يرجى إضافة المزيد من sol إلى محفظتك أو تقليل مبلغ sol الذي ترسله",
"introducing_cake_pay": "نقدم لكم Cake Pay!",
"invalid_input": "مدخل غير صالح",
"invoice_details": "تفاصيل الفاتورة",

View file

@ -337,6 +337,7 @@
"incoming": "Входящи",
"incorrect_seed": "Въведеният текст е невалиден.",
"inputs": "Входове",
"insufficientFundsForRentError": "Нямате достатъчно SOL, за да покриете таксата за транзакцията и наемането на сметката. Моля, добавете повече SOL към портфейла си или намалете сумата на SOL, която изпращате",
"introducing_cake_pay": "Запознайте се с Cake Pay!",
"invalid_input": "Невалиден вход",
"invoice_details": "IДанни за фактура",

View file

@ -337,6 +337,7 @@
"incoming": "Příchozí",
"incorrect_seed": "Zadaný text není správný.",
"inputs": "Vstupy",
"insufficientFundsForRentError": "Nemáte dostatek SOL na pokrytí transakčního poplatku a nájemného za účet. Laskavě přidejte do své peněženky více SOL nebo snižte množství Sol, kterou odesíláte",
"introducing_cake_pay": "Představujeme Cake Pay!",
"invalid_input": "Neplatný vstup",
"invoice_details": "detaily faktury",

View file

@ -337,6 +337,7 @@
"incoming": "Eingehend",
"incorrect_seed": "Der eingegebene Text ist ungültig.",
"inputs": "Eingänge",
"insufficientFundsForRentError": "Sie haben nicht genug SOL, um die Transaktionsgebühr und die Miete für das Konto zu decken. Bitte fügen Sie mehr Sol zu Ihrer Brieftasche hinzu oder reduzieren Sie den von Ihnen gesendeten Sol -Betrag",
"introducing_cake_pay": "Einführung von Cake Pay!",
"invalid_input": "Ungültige Eingabe",
"invoice_details": "Rechnungs-Details",

View file

@ -337,6 +337,7 @@
"incoming": "Incoming",
"incorrect_seed": "The text entered is not valid.",
"inputs": "Inputs",
"insufficientFundsForRentError": "You do not have enough SOL to cover the transaction fee and rent for the account. Kindly add more SOL to your wallet or reduce the SOL amount you\\'re sending",
"introducing_cake_pay": "Introducing Cake Pay!",
"invalid_input": "Invalid input",
"invoice_details": "Invoice details",

View file

@ -337,6 +337,7 @@
"incoming": "Entrante",
"incorrect_seed": "El texto ingresado no es válido.",
"inputs": "Entradas",
"insufficientFundsForRentError": "No tiene suficiente SOL para cubrir la tarifa de transacción y alquilar para la cuenta. Por favor, agregue más sol a su billetera o reduzca la cantidad de sol que está enviando",
"introducing_cake_pay": "¡Presentamos Cake Pay!",
"invalid_input": "Entrada inválida",
"invoice_details": "Detalles de la factura",

View file

@ -337,6 +337,7 @@
"incoming": "Entrantes",
"incorrect_seed": "Le texte entré est invalide.",
"inputs": "Contributions",
"insufficientFundsForRentError": "Vous n'avez pas assez de SOL pour couvrir les frais de transaction et le loyer pour le compte. Veuillez ajouter plus de Sol à votre portefeuille ou réduire la quantité de sol que vous envoyez",
"introducing_cake_pay": "Présentation de Cake Pay !",
"invalid_input": "Entrée invalide",
"invoice_details": "Détails de la facture",

View file

@ -337,6 +337,7 @@
"incoming": "Mai shigowa",
"incorrect_seed": "rubutun da aka shigar ba shi da inganci.",
"inputs": "Abubuwan da ke ciki",
"insufficientFundsForRentError": "Ba ku da isasshen Sol don rufe kuɗin ma'amala da haya don asusun. Da kyau ƙara ƙarin sool zuwa walat ɗinku ko rage adadin Sol ɗin da kuke aikawa",
"introducing_cake_pay": "Gabatar da Cake Pay!",
"invalid_input": "Shigar da ba daidai ba",
"invoice_details": "Bayanin wadannan",

View file

@ -337,6 +337,7 @@
"incoming": "आने वाली",
"incorrect_seed": "दर्ज किया गया पाठ मान्य नहीं है।",
"inputs": "इनपुट",
"insufficientFundsForRentError": "आपके पास लेन -देन शुल्क और खाते के लिए किराए को कवर करने के लिए पर्याप्त सोल नहीं है। कृपया अपने बटुए में अधिक सोल जोड़ें या सोल राशि को कम करें जिसे आप भेज रहे हैं",
"introducing_cake_pay": "परिचय Cake Pay!",
"invalid_input": "अमान्य निवेश",
"invoice_details": "चालान विवरण",

View file

@ -337,6 +337,7 @@
"incoming": "Dolazno",
"incorrect_seed": "Uneseni tekst nije valjan.",
"inputs": "Unosi",
"insufficientFundsForRentError": "Nemate dovoljno SOL -a za pokrivanje naknade za transakciju i najamninu za račun. Ljubazno dodajte više sol u svoj novčanik ili smanjite količinu SOL -a koju šaljete",
"introducing_cake_pay": "Predstavljamo Cake Pay!",
"invalid_input": "Pogrešan unos",
"invoice_details": "Podaci o fakturi",

View file

@ -337,6 +337,7 @@
"incoming": "Masuk",
"incorrect_seed": "Teks yang dimasukkan tidak valid.",
"inputs": "Input",
"insufficientFundsForRentError": "Anda tidak memiliki cukup SOL untuk menutupi biaya transaksi dan menyewa untuk akun tersebut. Mohon tambahkan lebih banyak sol ke dompet Anda atau kurangi jumlah sol yang Anda kirim",
"introducing_cake_pay": "Perkenalkan Cake Pay!",
"invalid_input": "Masukan tidak valid",
"invoice_details": "Detail faktur",

View file

@ -338,6 +338,7 @@
"incoming": "In arrivo",
"incorrect_seed": "Il testo inserito non è valido.",
"inputs": "Input",
"insufficientFundsForRentError": "Non hai abbastanza SOL per coprire la tassa di transazione e l'affitto per il conto. Si prega di aggiungere più SOL al tuo portafoglio o ridurre l'importo SOL che stai inviando",
"introducing_cake_pay": "Presentazione di Cake Pay!",
"invalid_input": "Inserimento non valido",
"invoice_details": "Dettagli della fattura",

View file

@ -338,6 +338,7 @@
"incoming": "着信",
"incorrect_seed": "入力されたテキストは無効です。",
"inputs": "入力",
"insufficientFundsForRentError": "アカウントの取引料金とレンタルをカバーするのに十分なソルがありません。財布にソルを追加するか、送信するソル量を減らしてください",
"introducing_cake_pay": "序章Cake Pay",
"invalid_input": "無効入力",
"invoice_details": "請求の詳細",

View file

@ -337,6 +337,7 @@
"incoming": "들어오는",
"incorrect_seed": "입력하신 텍스트가 유효하지 않습니다.",
"inputs": "입력",
"insufficientFundsForRentError": "거래 수수료와 계좌 임대료를 충당하기에 충분한 SOL이 없습니다. 지갑에 더 많은 솔을 추가하거나 보내는 솔을 줄이십시오.",
"introducing_cake_pay": "소개 Cake Pay!",
"invalid_input": "잘못된 입력",
"invoice_details": "인보이스 세부정보",

View file

@ -337,6 +337,7 @@
"incoming": "ဝင်လာ",
"incorrect_seed": "ထည့်သွင်းထားသော စာသားသည် မမှန်ကန်ပါ။",
"inputs": "သွင်းငေှ",
"insufficientFundsForRentError": "သင်ငွေပေးချေမှုအခကြေးငွေကိုဖုံးအုပ်ရန်နှင့်အကောင့်ငှားရန်လုံလောက်သော sol ရှိသည်မဟုတ်ကြဘူး။ ကြင်နာစွာသင်၏ပိုက်ဆံအိတ်သို့ပိုမို sol ကိုပိုမိုထည့်ပါသို့မဟုတ်သင်ပို့ခြင်း sol ပမာဏကိုလျှော့ချပါ",
"introducing_cake_pay": "Cake Pay ကို မိတ်ဆက်ခြင်း။",
"invalid_input": "ထည့်သွင်းမှု မမှန်ကန်ပါ။",
"invoice_details": "ပြေစာအသေးစိတ်",

View file

@ -337,6 +337,7 @@
"incoming": "inkomend",
"incorrect_seed": "De ingevoerde tekst is niet geldig.",
"inputs": "Invoer",
"insufficientFundsForRentError": "U hebt niet genoeg SOL om de transactiekosten en huur voor de rekening te dekken. Voeg vriendelijk meer SOL toe aan uw portemonnee of verminder de SOL -hoeveelheid die u verzendt",
"introducing_cake_pay": "Introductie van Cake Pay!",
"invalid_input": "Ongeldige invoer",
"invoice_details": "Factuurgegevens",

View file

@ -337,6 +337,7 @@
"incoming": "Przychodzące",
"incorrect_seed": "Wprowadzony seed jest nieprawidłowy.",
"inputs": "Wejścia",
"insufficientFundsForRentError": "Nie masz wystarczającej ilości SOL, aby pokryć opłatę za transakcję i czynsz za konto. Uprzejmie dodaj więcej sol do portfela lub zmniejsz solę, którą wysyłasz",
"introducing_cake_pay": "Przedstawiamy Cake Pay!",
"invalid_input": "Nieprawidłowe dane wejściowe",
"invoice_details": "Dane do faktury",

View file

@ -337,6 +337,7 @@
"incoming": "Recebidas",
"incorrect_seed": "O texto digitado não é válido.",
"inputs": "Entradas",
"insufficientFundsForRentError": "Você não tem Sol suficiente para cobrir a taxa de transação e o aluguel da conta. Por favor, adicione mais sol à sua carteira ou reduza a quantidade de sol que você envia",
"introducing_cake_pay": "Apresentando o Cake Pay!",
"invalid_input": "Entrada inválida",
"invoice_details": "Detalhes da fatura",

View file

@ -337,6 +337,7 @@
"incoming": "Входящие",
"incorrect_seed": "Введённый текст некорректный.",
"inputs": "Входы",
"insufficientFundsForRentError": "У вас недостаточно Sol, чтобы покрыть плату за транзакцию и аренду для счета. Пожалуйста, добавьте больше Sol в свой кошелек или уменьшите сумму Sol, которую вы отправляете",
"introducing_cake_pay": "Представляем Cake Pay!",
"invalid_input": "Неверный Ввод",
"invoice_details": "Детали счета",

View file

@ -337,6 +337,7 @@
"incoming": "ขาเข้า",
"incorrect_seed": "ข้อความที่ป้อนไม่ถูกต้อง",
"inputs": "อินพุต",
"insufficientFundsForRentError": "คุณไม่มีโซลเพียงพอที่จะครอบคลุมค่าธรรมเนียมการทำธุรกรรมและค่าเช่าสำหรับบัญชี กรุณาเพิ่มโซลให้มากขึ้นลงในกระเป๋าเงินของคุณหรือลดจำนวนโซลที่คุณส่งมา",
"introducing_cake_pay": "ยินดีต้อนรับสู่ Cake Pay!",
"invalid_input": "อินพุตไม่ถูกต้อง",
"invoice_details": "รายละเอียดใบแจ้งหนี้",

View file

@ -337,6 +337,7 @@
"incoming": "Papasok",
"incorrect_seed": "Ang teksto na ipinasok ay hindi wasto.",
"inputs": "Mga input",
"insufficientFundsForRentError": "Wala kang sapat na sol upang masakop ang bayad sa transaksyon at upa para sa account. Mabait na magdagdag ng higit pa sa iyong pitaka o bawasan ang halaga ng sol na iyong ipinapadala",
"introducing_cake_pay": "Ipinakikilala ang cake pay!",
"invalid_input": "Di -wastong input",
"invoice_details": "Mga detalye ng invoice",

View file

@ -337,6 +337,7 @@
"incoming": "Gelen",
"incorrect_seed": "Girilen metin geçerli değil.",
"inputs": "Girişler",
"insufficientFundsForRentError": "İşlem ücretini karşılamak ve hesap için kiralamak için yeterli SOL'nuz yok. Lütfen cüzdanınıza daha fazla sol ekleyin veya gönderdiğiniz sol miktarını azaltın",
"introducing_cake_pay": "Cake Pay ile tanışın!",
"invalid_input": "Geçersiz Giriş",
"invoice_details": "fatura detayları",

View file

@ -337,6 +337,7 @@
"incoming": "Вхідні",
"incorrect_seed": "Введений текст невірний.",
"inputs": "Вхoди",
"insufficientFundsForRentError": "У вас недостатньо SOL, щоб покрити плату за транзакцію та оренду на рахунок. Будь ласка, додайте до свого гаманця більше SOL або зменшіть суму, яку ви надсилаєте",
"introducing_cake_pay": "Представляємо Cake Pay!",
"invalid_input": "Неправильні дані",
"invoice_details": "Реквізити рахунку-фактури",

View file

@ -337,6 +337,7 @@
"incoming": "آنے والا",
"incorrect_seed": "درج کردہ متن درست نہیں ہے۔",
"inputs": "آدانوں",
"insufficientFundsForRentError": "آپ کے پاس ٹرانزیکشن فیس اور اکاؤنٹ کے لئے کرایہ لینے کے ل enough اتنا SOL نہیں ہے۔ برائے مہربانی اپنے بٹوے میں مزید سول شامل کریں یا آپ کو بھیجنے والی سول رقم کو کم کریں",
"introducing_cake_pay": "Cake پے کا تعارف!",
"invalid_input": "غلط ان پٹ",
"invoice_details": "رسید کی تفصیلات",

View file

@ -338,6 +338,7 @@
"incoming": "Wọ́n tó ń bọ̀",
"incorrect_seed": "Ọ̀rọ̀ tí a tẹ̀ kì í ṣe èyí.",
"inputs": "Igbewọle",
"insufficientFundsForRentError": "O ko ni Sol kan lati bo owo isanwo naa ki o yalo fun iroyin naa. Fi agbara kun Sol diẹ sii si apamọwọ rẹ tabi dinku soso naa ti o \\ 'tun n firanṣẹ",
"introducing_cake_pay": "Ẹ bá Cake Pay!",
"invalid_input": "Iṣawọle ti ko tọ",
"invoice_details": "Iru awọn ẹya ọrọ",

View file

@ -337,6 +337,7 @@
"incoming": "收到",
"incorrect_seed": "输入的文字无效。",
"inputs": "输入",
"insufficientFundsForRentError": "您没有足够的溶胶来支付该帐户的交易费和租金。请在钱包中添加更多溶胶或减少您发送的溶胶量",
"introducing_cake_pay": "介绍 Cake Pay!",
"invalid_input": "输入无效",
"invoice_details": "发票明细",