diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index f6f5bdaf8..73168c7cf 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -41,9 +41,6 @@ "advanced": { "message": "የላቀ" }, - "advancedOptions": { - "message": "የላቁ አማራጮች" - }, "amount": { "message": "ሰርዝ " }, diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 8ac0b5cf3..500ff79ea 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -55,9 +55,6 @@ "advanced": { "message": "إعدادات متقدمة" }, - "advancedOptions": { - "message": "خيارات متقدمة" - }, "amount": { "message": "المبلغ" }, diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index 868ca520f..754d60491 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Разширени" }, - "advancedOptions": { - "message": "Разширени опции" - }, "amount": { "message": "Сума" }, diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index e8a015d03..b9500543a 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "উন্নত" }, - "advancedOptions": { - "message": "উন্নত বিকল্পসমূহ" - }, "amount": { "message": "পরিমান" }, diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index cd111134e..35d2bdadc 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Configuració avançada" }, - "advancedOptions": { - "message": "Opcions Avançades" - }, "amount": { "message": "Quantitat" }, diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index f734b5de7..bc1c0fb9d 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Avanceret" }, - "advancedOptions": { - "message": "Avancerede Valgmuligheder" - }, "amount": { "message": "Beløb" }, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 78d8afa9c..f9adc745d 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Gaspreis" }, - "advancedOptions": { - "message": "Erweiterte Optionen" - }, "advancedPriorityFeeToolTip": { "message": "Prioritätsgebühr (alias „Miner Tip“) geht direkt an Miner und veranlasst sie, Ihre Transaktion zu priorisieren." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Kontakt bearbeiten" }, - "editGasEducationButtonText": { - "message": "Wie soll ich wählen?" - }, - "editGasEducationHighExplanation": { - "message": "Dies ist am besten für zeitsensible Transaktionen (wie Swaps), da es die Wahrscheinlichkeit einer erfolgreichen Transaktion erhöht. Wenn es zu lange dauert, einen Swap zu verarbeiten, kann dies fehlschlagen und dazu führen, dass ein Teil Ihrer Gasgebühr verloren geht." - }, - "editGasEducationLowExplanation": { - "message": "Eine geringere Gasgebühr sollte nur bei geringerer Verarbeitungszeit verwendet werden. Niedrigere Gebühren machen es schwer vorherzusagen, wann (oder ob) Ihre Transaktion erfolgreich sein wird." - }, - "editGasEducationMediumExplanation": { - "message": "Eine mittlere Gasgebühr ist gut zum Versenden, Abheben oder für andere nicht-zeitsensible Transaktionen. Diese Einstellung führt meist zu einer erfolgreichen Transaktion." - }, - "editGasEducationModalIntro": { - "message": "Die Auswahl der richtigen Gasgebühr hängt von der Art der Transaktion ab und wie wichtig sie für Sie ist." - }, - "editGasEducationModalTitle": { - "message": "Wie wählen?" - }, "editGasFeeModalTitle": { "message": "Gasgebühr bearbeiten" }, - "editGasHigh": { - "message": "Hoch" - }, "editGasLimitOutOfBounds": { "message": "Gaslimit muss mindestens 1$ betragen" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "Gaslimit ist die maximale Gaseinheit die Sie zu verwenden bereit sind. Gaseinheiten sind ein Multiplikator der „Max. Prioritätsgebühr“ und der „Max. Gebühr“." }, - "editGasLow": { - "message": "Niedrig" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Maximale Basisgebühr darf nicht niedriger sein als die Prioritätsgebühr" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Die maximale Gebühr darf nicht niedriger sein als die maximale Prioritätsgebühr" }, - "editGasMaxFeeTooltip": { - "message": "Die Maximalgebühr ist der Höchstbetrag, den Sie zahlen müssen (Basisgebühr + Prioritätsgebühr)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Die maximale Prioritätsgebühr muss größer als 0 GWEI sein" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Die Prioritätsgebühr ist niedrig für aktuelle Netzwerkbedingungen" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Die max. Prioritätsgebühr (alias „Miner Tip“) geht direkt an die Miner und veranlasst sie, Ihre Transaktion zu priorisieren. Sie zahlen meist Ihre maximale Einstellung" - }, - "editGasMedium": { - "message": "Mittel" - }, "editGasPriceTooLow": { "message": "Gaspreis muss größer als 0 sein" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Unbekannte Bearbeitungszeit" }, - "editGasTooLowTooltip": { - "message": "Ihre Maximalgebühr oder die maximale Prioritätsgebühr kann für die aktuellen Marktbedingungen niedrig sein. Wir wissen nicht, wann (oder ob Ihre Transaktion verarbeitet wird). " - }, - "editGasTooLowWarningTooltip": { - "message": "Dies senkt Ihre maximale Gebühr, aber wenn der Netzwerktraffic steigt, kann Ihre Transaktion sich verzögern oder scheitern." - }, "editNonceField": { "message": "Nonce bearbeiten" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Auto-Erkennung aktivieren" }, - "enableEIP1559V2": { - "message": "Verbesserte Gasgebühr-UI aktivieren" - }, - "enableEIP1559V2AlertMessage": { - "message": "Wir haben die Funktionsweise der Gaspreisschätzung und -anpassung aktualisiert." - }, - "enableEIP1559V2ButtonText": { - "message": "Verbesserte Gaspreis-UI in Einstellungen einschalten" - }, - "enableEIP1559V2Description": { - "message": "Wir haben die Funktionsweise der Gasschätzung und -anpassung aktualisiert. Schalten Sie ein, wenn Sie das neue Gaserlebnis nutzen möchten. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Neues Gaserlebnis" - }, "enableFromSettings": { "message": " In den Einstellungen aktivieren." }, @@ -1395,9 +1337,6 @@ "message": "Diese Gasgebühr wurde von $1 vorgeschlagen. Dies kann ein Problem mit Ihrer Transaktion verursachen. Bei Fragen wenden Sie sich bitte an $1.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Unsere niedrigen, mittleren und hohen Schätzungen sind nicht verfügbar." - }, "gasFee": { "message": "Gasgebühr" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Private Keys anzeigen" }, - "showRecommendations": { - "message": "Empfehlungen anzeigen" - }, "showTestnetNetworks": { "message": "Test-Netzwerke anzeigen" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 439101457..740d490f4 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Τιμή τελών συναλλαγής" }, - "advancedOptions": { - "message": "Σύνθετες Επιλογές" - }, "advancedPriorityFeeToolTip": { "message": "Το τέλος προτεραιότητας (γνωστό και ως “miner tip”) πηγαίνει άμεσα στους miner και τους ενθαρρύνει να δώσουν προτεραιότητα στη συναλλαγή σας." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Επεξεργασία Επαφής" }, - "editGasEducationButtonText": { - "message": "Πώς πρέπει να επιλέξω;" - }, - "editGasEducationHighExplanation": { - "message": "Αυτό είναι καλύτερο για ευαίσθητες στον χρόνο συναλλαγές (όπως τα Swaps) καθώς αυξάνει την πιθανότητα επιτυχούς συναλλαγής. Εάν ένα Swap πάρει πολύ χρόνο για να επεξεργαστεί, μπορεί να αποτύχει και να έχει ως αποτέλεσμα την απώλεια κάποιων τελών συναλλαγής." - }, - "editGasEducationLowExplanation": { - "message": "Ένα χαμηλότερο τέλος συναλλαγής θα πρέπει να χρησιμοποιείται μόνο όταν ο χρόνος επεξεργασίας είναι λιγότερο σημαντικός. Οι χαμηλότερες χρεώσεις καθιστούν δύσκολη την πρόβλεψη πότε (ή αν) η συναλλαγή σας θα είναι επιτυχής." - }, - "editGasEducationMediumExplanation": { - "message": "Ένα μέσο τέλος συναλλαγής είναι καλό για την αποστολή, την ανάληψη ή άλλες συναλλαγές που δεν είναι χρονικά ευαίσθητες. Αυτή η ρύθμιση θα οδηγήσει πιο συχνά σε μια επιτυχημένη συναλλαγή." - }, - "editGasEducationModalIntro": { - "message": "Η επιλογή του σωστού τέλους συναλλαγής εξαρτάται από το είδος της συναλλαγής και πόσο σημαντικό είναι για εσάς." - }, - "editGasEducationModalTitle": { - "message": "Πώς να επιλέξετε;" - }, "editGasFeeModalTitle": { "message": "Επεξεργασία τέλους συναλλαγής" }, - "editGasHigh": { - "message": "Υψηλό" - }, "editGasLimitOutOfBounds": { "message": "Το όριο τελών συναλλαγής πρέπει να είναι τουλάχιστον $1" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "Το τελών συναλλαγής είναι οι μέγιστες μονάδες τελών συναλλαγής που είστε πρόθυμοι να χρησιμοποιήσετε. Τα τέλη συναλλαγής είναι ένας πολλαπλασιαστής στο \"Μέγιστο τέλος προτεραιότητας\" και το \"Μέγιστο τέλος\"." }, - "editGasLow": { - "message": "Χαμηλό" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Η μέγιστη βασική χρέωση δεν μπορεί να είναι χαμηλότερη από το τέλος προτεραιότητας" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Η μέγιστη βασική χρέωση δεν μπορεί να είναι χαμηλότερη από το μέγιστο τέλος προτεραιότητας" }, - "editGasMaxFeeTooltip": { - "message": "Το μέγιστο τέλος είναι το περισσότερο που θα πληρώσετε (βασικό τέλος + τέλος προτεραιότητας)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Το μέγιστο τέλος προτεραιότητας πρέπει να είναι μεγαλύτερο από 0 GWEI" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Το τέλος προτεραιότητας είναι χαμηλό για τις τρέχουσες συνθήκες δικτύου" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Το μέγιστο τέλος προτεραιότητας (γνωστό και ως “miner tip”) πηγαίνει άμεσα στους miner και τους ενθαρρύνει να δώσουν προτεραιότητα στη συναλλαγή σας. Συχνά θα πληρώνετε το μέγιστο που επιλέξατε" - }, - "editGasMedium": { - "message": "Μεσαίο" - }, "editGasPriceTooLow": { "message": "Η τιμή τέλους συναλλαγής πρέπει να είναι μεγαλύτερη από 0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Άγνωστος χρόνος επεξεργασίας" }, - "editGasTooLowTooltip": { - "message": "Η μέγιστη χρέωση ή το μέγιστο τέλος προτεραιότητας μπορεί να είναι χαμηλά για τις τρέχουσες συνθήκες της αγοράς. Δεν γνωρίζουμε πότε (ή εάν) η συναλλαγή σας θα επεξεργαστεί. " - }, - "editGasTooLowWarningTooltip": { - "message": "Αυτό μειώνει τη μέγιστη χρέωση αλλά αν η κίνηση δικτύου αυξήσει τη συναλλαγή σας μπορεί να καθυστερήσει ή να αποτύχει." - }, "editNonceField": { "message": "Επεξεργασία Nonce" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Ενεργοποίηση Αυτόματου Εντοπισμού" }, - "enableEIP1559V2": { - "message": "Ενεργοποίηση βελτιωμένου περιβάλλοντος χρήστη για τέλη συναλλαγής" - }, - "enableEIP1559V2AlertMessage": { - "message": "Ενημερώσαμε τον τρόπο με τον οποίο λειτουργεί η εκτίμηση και η προσαρμογή των τελών συναλλαγής." - }, - "enableEIP1559V2ButtonText": { - "message": "Ενεργοποίηση βελτιωμένου περιβάλλοντος χρήστη για τέλη συναλλαγής στις Ρυθμίσεις" - }, - "enableEIP1559V2Description": { - "message": "Ενημερώσαμε τον τρόπο με τον οποίο λειτουργεί η εκτίμηση και η προσαρμογή των τελών συναλλαγής. Ενεργοποιήστε εάν θέλετε να χρησιμοποιήσετε τα νέα τέλη συναλλαγής. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Νέα εμπειρία τελών συναλλαγής" - }, "enableFromSettings": { "message": " Ενεργοποίηση του από τις Ρυθμίσεις." }, @@ -1395,9 +1337,6 @@ "message": "Αυτό το τέλος συναλλαγής έχει προταθεί από το $1. Η παράκαμψη μπορεί να προκαλέσει πρόβλημα με τη συναλλαγή σας. Εάν έχετε απορίες, επικοινωνήστε με $1.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Οι χαμηλές, μεσαίες και υψηλές εκτιμήσεις μας δεν είναι διαθέσιμες." - }, "gasFee": { "message": "Τέλη Συναλλαγής" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Εμφάνιση Ιδιωτικών Κλειδιών" }, - "showRecommendations": { - "message": "Εμφάνιση Προτάσεων" - }, "showTestnetNetworks": { "message": "Εμφάνιση δοκιμαστικών δικτύων" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index d023d962c..10ea07a68 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -281,9 +281,6 @@ "advancedGasPriceTitle": { "message": "Gas price" }, - "advancedOptions": { - "message": "Advanced options" - }, "advancedPriorityFeeToolTip": { "message": "Priority fee (aka “miner tip”) goes directly to miners and incentivizes them to prioritize your transaction." }, @@ -1099,30 +1096,9 @@ "editContact": { "message": "Edit contact" }, - "editGasEducationButtonText": { - "message": "How should I choose?" - }, - "editGasEducationHighExplanation": { - "message": "This is best for time sensitive transactions (like Swaps) as it increases the likelihood of a successful transaction. If a Swap takes too long to process it may fail and result in losing some of your gas fee." - }, - "editGasEducationLowExplanation": { - "message": "A lower gas fee should only be used when processing time is less important. Lower fees make it hard predict when (or if) your transaction will be successful." - }, - "editGasEducationMediumExplanation": { - "message": "A medium gas fee is good for sending, withdrawing or other non-time sensitive transactions. This setting will most often result in a successful transaction." - }, - "editGasEducationModalIntro": { - "message": "Selecting the right gas fee depends on the type of transaction and how important it is to you." - }, - "editGasEducationModalTitle": { - "message": "How to choose?" - }, "editGasFeeModalTitle": { "message": "Edit gas fee" }, - "editGasHigh": { - "message": "High" - }, "editGasLimitOutOfBounds": { "message": "Gas limit must be at least $1" }, @@ -1133,9 +1109,6 @@ "editGasLimitTooltip": { "message": "Gas limit is the maximum units of gas you are willing to use. Units of gas are a multiplier to “Max priority fee” and “Max fee”." }, - "editGasLow": { - "message": "Low" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Max base fee cannot be lower than priority fee" }, @@ -1154,9 +1127,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Max fee cannot be lower than max priority fee" }, - "editGasMaxFeeTooltip": { - "message": "The max fee is the most you’ll pay (base fee + priority fee)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Max priority fee must be greater than 0 GWEI" }, @@ -1175,12 +1145,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Priority fee is low for current network conditions" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Max priority fee (aka “miner tip”) goes directly to miners and incentivizes them to prioritize your transaction. You’ll most often pay your max setting" - }, - "editGasMedium": { - "message": "Medium" - }, "editGasPriceTooLow": { "message": "Gas price must be greater than 0" }, @@ -1200,12 +1164,6 @@ "editGasTooLow": { "message": "Unknown processing time" }, - "editGasTooLowTooltip": { - "message": "Your max fee or max priority fee may be low for current market conditions. We don't know when (or if) your transaction will be processed. " - }, - "editGasTooLowWarningTooltip": { - "message": "This lowers your maximum fee but if network traffic increases your transaction may be delayed or fail." - }, "editNonceField": { "message": "Edit nonce" }, @@ -1221,22 +1179,6 @@ "enableAutoDetect": { "message": " Enable autodetect" }, - "enableEIP1559V2": { - "message": "Enable enhanced gas fee UI" - }, - "enableEIP1559V2AlertMessage": { - "message": "We've updated how gas fee estimation and customization works." - }, - "enableEIP1559V2ButtonText": { - "message": "Turn on enhanced gas fee UI in Settings" - }, - "enableEIP1559V2Description": { - "message": "We've updated how gas estimation and customization works. Turn on if you'd like to use the new gas experience. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "New gas experience" - }, "enableFromSettings": { "message": " Enable it from Settings." }, @@ -1496,9 +1438,6 @@ "message": "This gas fee has been suggested by $1. Overriding this may cause a problem with your transaction. Please reach out to $1 if you have questions.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Our low, medium and high estimates are not available." - }, "gasFee": { "message": "Gas fee" }, @@ -3364,9 +3303,6 @@ "showPrivateKeys": { "message": "Show Private Keys" }, - "showRecommendations": { - "message": "Show recommendations" - }, "showTestnetNetworks": { "message": "Show test networks" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index f3a1f5344..ed00eafc7 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Precio del gas" }, - "advancedOptions": { - "message": "Opciones avanzadas" - }, "advancedPriorityFeeToolTip": { "message": "La tarifa de prioridad (también llamada “propina del minero”) va directamente a los mineros para incentivarlos a priorizar su transacción." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Editar contacto" }, - "editGasEducationButtonText": { - "message": "¿Cómo debo elegir?" - }, - "editGasEducationHighExplanation": { - "message": "Esto es lo más conveniente para transacciones con límite de tiempo (como Swaps/Intercambios) ya que aumenta la probabilidad de que la transacción sea exitosa. Si un intercambio tarda demasiado en procesarse, puede que falle y esto resulte en la pérdida de parte de su tarifa de gas." - }, - "editGasEducationLowExplanation": { - "message": "Una tarifa de gas más baja debería utilizarse solo cuando el tiempo de procesamiento es menos importante. Las tarifas reducidas dificultan la predicción de cuándo (o si) su transacción tendrá éxito." - }, - "editGasEducationMediumExplanation": { - "message": "Una tarifa de gas media es buena para enviar, retirar u otras transacciones sin límites de tiempo. Esta configuración será exitosa en la mayoría de los casos." - }, - "editGasEducationModalIntro": { - "message": "Seleccionar la tarifa de gas adecuada depende del tipo de transacción y de la importancia que tenga para usted." - }, - "editGasEducationModalTitle": { - "message": "¿Cómo elegir?" - }, "editGasFeeModalTitle": { "message": "Editar cuota de Gas" }, - "editGasHigh": { - "message": "Alto" - }, "editGasLimitOutOfBounds": { "message": "El límite de gas debe ser al menos $1" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "El límite de gas es el máximo de unidades de gas que está dispuesto a utilizar. Las unidades de gas son un multiplicador de la \"Tarifa de prioridad máxima\" y de la \"Tarifa máxima\"." }, - "editGasLow": { - "message": "Bajo" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "La tarifa base máxima no puede ser inferior a la tarifa de prioridad" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "La tarifa base máxima no puede ser inferior a la tarifa de prioridad máxima" }, - "editGasMaxFeeTooltip": { - "message": "La tarifa máxima es lo máximo que se pagará (tarifa básica + tarifa de prioridad)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "La tarifa máxima de prioridad debe ser superior a 0 GWEI" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "La tarifa de prioridad es baja para las condiciones actuales de la red" }, - "editGasMaxPriorityFeeTooltip": { - "message": "La tarifa de prioridad máxima (también llamada “propina del minero”) va directamente a los mineros para incentivarlos a priorizar su transacción. Lo más habitual es que se pague la configuración máxima" - }, - "editGasMedium": { - "message": "Medio" - }, "editGasPriceTooLow": { "message": "El precio del gas debe ser superior a 0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Se desconoce el tiempo de procesamiento" }, - "editGasTooLowTooltip": { - "message": "Su tarifa máxima o su tarifa prioritaria máxima pueden ser bajas para las condiciones actuales del mercado. No sabemos cuándo (o si) se procesará su transacción. " - }, - "editGasTooLowWarningTooltip": { - "message": "Esto reduce su tarifa máxima, pero si el tráfico de la red aumenta, su transacción puede retrasarse o resultar fallida." - }, "editNonceField": { "message": "Editar nonce" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Activar autodetección" }, - "enableEIP1559V2": { - "message": "Activar interfaz de tarifa de gas mejorada" - }, - "enableEIP1559V2AlertMessage": { - "message": "Hemos actualizado la forma en que funciona la estimación y la personalización de la tarifa de gas." - }, - "enableEIP1559V2ButtonText": { - "message": "Activar interfaz de tarifa de gas mejorada en Configuración" - }, - "enableEIP1559V2Description": { - "message": "Hemos actualizado la forma en que funciona la estimación y la personalización de la tarifa de gas. Actívela si desea utilizar la nueva experiencia de gas. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Nueva experiencia de gas" - }, "enableFromSettings": { "message": " Actívela en Configuración." }, @@ -1395,9 +1337,6 @@ "message": "Esta tarifa de gas ha sido sugerida por $1. Anularla puede causar un problema con su transacción. Comuníquese con $1 si tiene preguntas.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Nuestras estimaciones bajas, medias y altas no están disponibles." - }, "gasFee": { "message": "Cuota de gas" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Mostrar claves privadas" }, - "showRecommendations": { - "message": "Mostrar recomendaciones" - }, "showTestnetNetworks": { "message": "Mostrar redes de prueba" }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index e8cf6c682..0d625fd2e 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -167,9 +167,6 @@ "advancedGasPriceTitle": { "message": "Precio del gas" }, - "advancedOptions": { - "message": "Opciones avanzadas" - }, "advancedPriorityFeeToolTip": { "message": "La tarifa de prioridad (también llamada “propina del minero”) va directamente a los mineros para incentivarlos a priorizar su transacción." }, @@ -738,30 +735,9 @@ "editContact": { "message": "Editar contacto" }, - "editGasEducationButtonText": { - "message": "¿Cómo debería elegir?" - }, - "editGasEducationHighExplanation": { - "message": "Esta es la mejor opción para las transacciones urgentes (como los Swaps) ya que aumenta la probabilidad de una transacción exitosa. Si un Swap tarda demasiado en procesarse, puede fallar y causar la pérdida de una parte de la tarifa de gas." - }, - "editGasEducationLowExplanation": { - "message": "Una tarifa de gas más baja debería utilizarse solo cuando el tiempo de procesamiento es menos importante. Las tarifas reducidas dificultan la predicción de cuándo (o si) su transacción tendrá éxito." - }, - "editGasEducationMediumExplanation": { - "message": "Una tasa de gas media es buena para enviar, retirar o para otras transacciones no urgentes. Esta configuración suele dar lugar a una transacción exitosa." - }, - "editGasEducationModalIntro": { - "message": "La selección de la tarifa de gas adecuada depende del tipo de transacción y de la importancia que tenga para usted." - }, - "editGasEducationModalTitle": { - "message": "¿Cómo elegir?" - }, "editGasFeeModalTitle": { "message": "Editar tarifa de gas" }, - "editGasHigh": { - "message": "Alta" - }, "editGasLimitOutOfBounds": { "message": "El límite de gas debe ser al menos $1" }, @@ -772,9 +748,6 @@ "editGasLimitTooltip": { "message": "El límite de gas es el máximo de unidades de gas que está dispuesto a utilizar. Las unidades de gas son un multiplicador de la \"Tarifa de prioridad máxima\" y de la \"Tarifa máxima\"." }, - "editGasLow": { - "message": "Baja" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "La tarifa base máxima no puede ser inferior a la tarifa de prioridad" }, @@ -793,9 +766,6 @@ "editGasMaxFeePriorityImbalance": { "message": "La tarifa base máxima no puede ser inferior a la tarifa de prioridad máxima" }, - "editGasMaxFeeTooltip": { - "message": "La tarifa máxima es lo máximo que se pagará (tarifa básica + tarifa de prioridad)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "La tarifa máxima de prioridad debe ser superior a 0 GWEI" }, @@ -814,12 +784,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "La tarifa de prioridad es baja para las condiciones actuales de la red" }, - "editGasMaxPriorityFeeTooltip": { - "message": "La tarifa de prioridad máxima (también llamada “propina del minero”) va directamente a los mineros para incentivarlos a priorizar su transacción. Lo más habitual es que se pague la configuración máxima" - }, - "editGasMedium": { - "message": "Medio" - }, "editGasPriceTooLow": { "message": "El precio del gas debe ser superior a 0" }, @@ -839,12 +803,6 @@ "editGasTooLow": { "message": "Tiempo de procesamiento desconocido" }, - "editGasTooLowTooltip": { - "message": "Su tarifa máxima o su tarifa prioritaria máxima pueden ser bajas para las condiciones actuales del mercado. No sabemos cuándo (o si) se procesará su transacción. " - }, - "editGasTooLowWarningTooltip": { - "message": "Esto reduce su tarifa máxima, pero si el tráfico de la red aumenta, su transacción puede retrasarse o fallar." - }, "editNonceField": { "message": "Editar Nonce" }, @@ -860,22 +818,6 @@ "enableAutoDetect": { "message": " Activar autodetección" }, - "enableEIP1559V2": { - "message": "Activar interfaz de tarifa de gas mejorada" - }, - "enableEIP1559V2AlertMessage": { - "message": "Hemos actualizado la forma en que funciona la estimación y la personalización de la tarifa de gas." - }, - "enableEIP1559V2ButtonText": { - "message": "Activar interfaz de tarifa de gas mejorada en Configuración" - }, - "enableEIP1559V2Description": { - "message": "Hemos actualizado la forma en que funciona la estimación y la personalización de la tarifa de gas. Actívela si desea utilizar la nueva experiencia de gas. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Nueva experiencia de gas" - }, "enableFromSettings": { "message": " Actívela en Configuración." }, @@ -1101,9 +1043,6 @@ "message": "Esta tarifa de gas ha sido sugerida por $1. Anularla puede causar un problema con su transacción. Comuníquese con $1 si tiene preguntas.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Nuestras estimaciones bajas, medias y altas no están disponibles." - }, "gasLimit": { "message": "Límite de gas" }, @@ -2379,9 +2318,6 @@ "showPrivateKeys": { "message": "Mostrar claves privadas" }, - "showRecommendations": { - "message": "Mostrar recomendaciones" - }, "showTestnetNetworks": { "message": "Mostrar redes de prueba" }, diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 6a6a84895..ededf9ade 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Täpsemad" }, - "advancedOptions": { - "message": "Täpsemad suvandid" - }, "amount": { "message": "Summa" }, diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index f508016bc..82051b503 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "پیشرفته" }, - "advancedOptions": { - "message": "گزینه های پیشرفته" - }, "amount": { "message": "مبلغ" }, diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 9bd39694b..4fc9a65e8 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Lisäasetukset" }, - "advancedOptions": { - "message": "Tarkemmat vaihtoehdot" - }, "amount": { "message": "Summa" }, diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index 237d14f93..3103a6a88 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -41,9 +41,6 @@ "addToken": { "message": "Magdagdag ng Token" }, - "advancedOptions": { - "message": "Mga Advanced na Opsyon" - }, "amount": { "message": "Halaga" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 0137b5e34..284a0fd48 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Prix du gaz" }, - "advancedOptions": { - "message": "Options avancées" - }, "advancedPriorityFeeToolTip": { "message": "Les frais de priorité (aussi appelés « pourboire du mineur ») vont directement aux mineurs et les incitent à accorder la priorité à votre transaction." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Modifier le contact" }, - "editGasEducationButtonText": { - "message": "Comment puis-je choisir ?" - }, - "editGasEducationHighExplanation": { - "message": "Ce choix est préférable pour les transactions urgentes (comme les swaps), car cela multiplie les chances de réussite de la transaction. Si le traitement d’un swap prend trop de temps, il peut échouer et vous faire perdre une partie de vos frais de carburant." - }, - "editGasEducationLowExplanation": { - "message": "Des frais de carburant inférieurs ne doivent être utilisés que lorsque le temps de traitement est moins important. En effet, il est difficile de prévoir quand (ou si) votre transaction aboutira." - }, - "editGasEducationMediumExplanation": { - "message": "Des frais de carburant modérés conviennent pour l’envoi, le retrait ou d’autres transactions pour lesquelles le facteur temps n’est pas décisif. Ce paramètre permet le plus souvent de conclure une transaction avec succès." - }, - "editGasEducationModalIntro": { - "message": "Le choix du bon prix de carburant dépend du type de transaction et de son importance à vos yeux." - }, - "editGasEducationModalTitle": { - "message": "Comment choisir ?" - }, "editGasFeeModalTitle": { "message": "Modifier le prix du carburant" }, - "editGasHigh": { - "message": "Élevé" - }, "editGasLimitOutOfBounds": { "message": "La limite de carburant doit être d’au moins $1" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "La limite de carburant correspond au maximum d’unités de carburant que vous consentez à utiliser. Celles-ci servent de multiplicateur aux « Frais de priorité maximaux » et aux « Frais maximaux »." }, - "editGasLow": { - "message": "Bas" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Les frais de base maximaux ne peuvent pas être inférieurs aux frais de priorité" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Les frais maximaux ne peuvent pas être inférieurs aux frais de priorité maximaux" }, - "editGasMaxFeeTooltip": { - "message": "Les frais maximaux correspondent au montant le plus élevé que vous aurez à payer (frais de base + frais de priorité)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Les frais de priorité maximaux doivent être supérieurs à 0 GWEI" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Les frais de priorité sont faibles par rapport aux conditions actuelles du réseau" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Les frais de priorité maximaux (aussi appelés « pourboire du mineur ») vont directement aux mineurs et les incitent à accorder la priorité à votre transaction. Vous paierez le plus souvent votre réglage maximal" - }, - "editGasMedium": { - "message": "Moyen" - }, "editGasPriceTooLow": { "message": "Les frais de carburant doivent être supérieurs à 0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Délai de traitement inconnu" }, - "editGasTooLowTooltip": { - "message": "Vos frais maximaux ou vos frais de priorité maximaux risquent d’être faibles compte tenu des conditions actuelles du marché. Nous ignorons quand (ou si) votre transaction sera traitée. " - }, - "editGasTooLowWarningTooltip": { - "message": "Cela réduit vos frais maximaux, mais si le trafic réseau augmente, votre transaction peut être retardée ou ne pas aboutir." - }, "editNonceField": { "message": "Modifier le nonce" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Activer la détection automatique" }, - "enableEIP1559V2": { - "message": "Activer l’interface utilisateur améliorée des frais de transaction" - }, - "enableEIP1559V2AlertMessage": { - "message": "Nous avons mis à jour le fonctionnement de l’estimation et de la personnalisation des gas fees." - }, - "enableEIP1559V2ButtonText": { - "message": "Activez l’interface utilisateur améliorée des frais de transaction dans les Paramètres" - }, - "enableEIP1559V2Description": { - "message": "Nous avons mis à jour le fonctionnement de l’estimation et de la personnalisation du gas. À activer si vous souhaitez utiliser la nouvelle expérience de gas. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Nouvelle expérience de gas" - }, "enableFromSettings": { "message": " Activez-la depuis les Paramètres." }, @@ -1395,9 +1337,6 @@ "message": "Ce prix de carburant a été suggéré par $1. Si vous n’en tenez pas compte, vous risquez de rencontrer des difficultés lors de votre transaction. Veuillez contacter $1 pour toute question.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Nos estimations basses, moyennes et hautes ne sont pas disponibles." - }, "gasFee": { "message": "Frais de transaction" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Afficher les clés privées" }, - "showRecommendations": { - "message": "Afficher les recommandations" - }, "showTestnetNetworks": { "message": "Afficher les réseaux de test" }, diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 74c4af780..f4d35ba57 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "מתקדם" }, - "advancedOptions": { - "message": "אפשרויות מתקדמות" - }, "amount": { "message": "כמות" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 5749d1add..f893f4496 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "गैस की कीमत" }, - "advancedOptions": { - "message": "उन्नत विकल्प" - }, "advancedPriorityFeeToolTip": { "message": "प्राथमिकता शुल्क (उर्फ \"माइनर टिप\") सीधे खनिकों के पास जाता है और उन्हें आपके लेन-देन को प्राथमिकता देने के लिए प्रोत्साहित करता है।" }, @@ -1001,30 +998,9 @@ "editContact": { "message": "संपर्क संपादित करें" }, - "editGasEducationButtonText": { - "message": "मुझे कैसे चुनना चाहिए?" - }, - "editGasEducationHighExplanation": { - "message": "समय के प्रति संवेदनशील लेन-देन (जैसे कि विनिमय) के लिए यह सबसे अच्छा है क्योंकि यह एक सफल लेन-देन की संभावना को बढ़ाता है। यदि विनिमय को प्रोसेस होने में ज्यादा समय लगता है तो यह विफल हो सकता है और इसके परिणामस्वरुप आपके गैस शुल्क की कुछ हानि हो सकती है।" - }, - "editGasEducationLowExplanation": { - "message": "एक निम्न गैस शुल्क का उपयोग केवल तभी किया जाना चाहिए जब प्रोसेस का समय कम महत्वपूर्ण हो। निम्न शुल्क से यह अनुमान लगाना मुश्किल हो जाता है कि आपका लेन-देन कब (या यदि) सफल होगा।" - }, - "editGasEducationMediumExplanation": { - "message": "एक मध्यम गैस शुल्क भेजने, निकालने या अन्य गैर-समय संवेदनशील लेन-देन के लिए अच्छा है। इस सेटिंग के परिणामस्वरुप अक्सर एक सफल लेन-देन होता है।" - }, - "editGasEducationModalIntro": { - "message": "सही गैस शुल्क का चयन लेन-देन के प्रकार और यह आपके लिए कितना महत्वपूर्ण है इस पर निर्भर करता है।" - }, - "editGasEducationModalTitle": { - "message": "कैसे चुनें?" - }, "editGasFeeModalTitle": { "message": "गैस शुल्क संपादित करें" }, - "editGasHigh": { - "message": "उच्च" - }, "editGasLimitOutOfBounds": { "message": "गैस सीमा कम से कम $1 होनी चाहिए" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "गैस सीमा, गैस की वो अधिकतम यूनिट है जिसका आप उपयोग करना चाहते हैं। गैस यूनिट “अधिकतम प्राथमिकता शुल्क” और “अधिकतम शुल्क” का गुणक होती हैं।" }, - "editGasLow": { - "message": "निम्न" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "अधिकतम आधार शुल्क प्राथमिकता शुल्क से कम नहीं हो सकता है।" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "अधिकतम शुल्क अधिकतम प्राथमिकता शुल्क से कम नहीं हो सकता है" }, - "editGasMaxFeeTooltip": { - "message": "अधिकतम शुल्क वह अधिकतम शुल्क है जिसका आप भुगतान करेंगे (आधार शुल्क + प्राथमिकता शुल्क)।" - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "अधिकतम प्राथमिकता शुल्क 0 GWEI से अधिक होना चाहिए" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "मौजूदा नेटवर्क स्थितियों के लिए प्राथमिकता शुल्क कम है" }, - "editGasMaxPriorityFeeTooltip": { - "message": "अधिकतम प्राथमिकता शुल्क (उर्फ \"माइनर टिप\") सीधे खनिकों के पास जाता है और उन्हें आपके लेनदेन को प्राथमिकता देने के लिए प्रोत्साहित करता है। आप अक्सर अपनी अधिकतम सेटिंग का भुगतान करेंगे" - }, - "editGasMedium": { - "message": "माध्यम" - }, "editGasPriceTooLow": { "message": "गैस का मूल्य 0 से अधिक होना चाहिए" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "अज्ञात प्रोसेसिंग समय" }, - "editGasTooLowTooltip": { - "message": "मौजूदा बाजार स्थितियों के लिए आपका अधिकतम शुल्क या अधिकतम प्राथमिकता शुल्क कम हो सकता है। हम नहीं जानते कि आपका लेन-देन कब (या यदि) प्रोसेस किया जाएगा। " - }, - "editGasTooLowWarningTooltip": { - "message": "यह आपके अधिकतम शुल्क को कम करता है लेकिन यदि नेटवर्क ट्रैफिक बढ़ता है तो आपके लेन-देन में देरी हो सकती है या लेन-देन विफल हो सकता है।" - }, "editNonceField": { "message": "नॉन्स संपादित करें" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " ऑटो डिटेक्ट सक्षम करें" }, - "enableEIP1559V2": { - "message": "उन्नत गैस शुल्क UI सक्षम करें" - }, - "enableEIP1559V2AlertMessage": { - "message": "हमने अपडेट किया है कि गैस शुल्क अनुमान और कस्टमाइज़ेशन कैसे काम करता है।" - }, - "enableEIP1559V2ButtonText": { - "message": "सेटिंग्स में उन्नत गैस शुल्क UI को चालू करें" - }, - "enableEIP1559V2Description": { - "message": "हमने अपडेट किया है कि गैस शुल्क अनुमान और कस्टमाइज़ेशन कैसे काम करता है। अगर आप नए गैस अनुभव का इस्तेमाल करना चाहते हैं तो चालू करें। $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "नया गैस अनुभव" - }, "enableFromSettings": { "message": " इसे सेटिंग्स से इनेबल करें।" }, @@ -1395,9 +1337,6 @@ "message": "यह गैस शुल्क $1 द्वारा सुझाया गया है। इसे ओवरराइड करने से आपके लेन-देन में समस्या हो सकती है। यदि आपके पास कोई सवाल हैं तो कृपया $1 तक पहुंचें।", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "हमारे निम्न, मध्यम और उच्च अनुमान उपलब्ध नहीं हैं।" - }, "gasFee": { "message": "गैस शुल्क" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "निजी कुंजियां दिखाएं" }, - "showRecommendations": { - "message": "सिफ़ारिशें दिखाएं" - }, "showTestnetNetworks": { "message": "परीक्षण नेटवर्क दिखाएं" }, diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index da98246af..a64b3301c 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Napredno" }, - "advancedOptions": { - "message": "Napredne mogućnosti" - }, "amount": { "message": "Iznos" }, diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index b0f06395b..830957f8e 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Speciális" }, - "advancedOptions": { - "message": "Haladó beállítások" - }, "amount": { "message": "Összeg" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 98e061177..9e0fb2768 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Harga gas" }, - "advancedOptions": { - "message": "Opsi lanjutan" - }, "advancedPriorityFeeToolTip": { "message": "Biaya prioritas (alias “tip penambang”) langsung masuk ke penambang dan memberi insentif kepada mereka untuk memprioritaskan transaksi Anda." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Edit kontak" }, - "editGasEducationButtonText": { - "message": "Bagaimana saya harus memilih?" - }, - "editGasEducationHighExplanation": { - "message": "Ini adalah pilihan terbaik untuk transaksi di waktu sensitif (seperti Swap) karena meningkatkan kemungkinan keberhasilan transaksi. Jika pemrosesan Swap terlalu lama, maka berpotensi gagal dan mengakibatkan hilangnya sebagian biaya gas Anda." - }, - "editGasEducationLowExplanation": { - "message": "Biaya gas yang lebih rendah hanya boleh digunakan saat waktu pemrosesan kurang penting. Biaya yang lebih rendah membuat sulit untuk memprediksi kapan (atau jika) transaksi Anda akan berhasil." - }, - "editGasEducationMediumExplanation": { - "message": "Biaya gas sedang cocok untuk mengirim, menarik, atau transaksi non-waktu sensitif lainnya. Pengaturan ini paling sering menghasilkan transaksi yang berhasil." - }, - "editGasEducationModalIntro": { - "message": "Memilih biaya gas yang tepat tergantung jenis transaksi dan seberapa penting bagi Anda." - }, - "editGasEducationModalTitle": { - "message": "Bagaimana cara memilihnya?" - }, "editGasFeeModalTitle": { "message": "Edit biaya gas" }, - "editGasHigh": { - "message": "Tinggi" - }, "editGasLimitOutOfBounds": { "message": "Batas gas minimum adalah $1" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "Batas gas merupakan unit maksimum gas yang ingin Anda gunakan. Unit gas adalah pengganda untuk “Biaya prioritas maks” dan “Biaya maks”." }, - "editGasLow": { - "message": "Rendah" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Biaya dasar maks tidak boleh lebih rendah dari biaya prioritas" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Biaya maks tidak boleh lebih rendah dari biaya prioritas maks" }, - "editGasMaxFeeTooltip": { - "message": "Biaya maks merupakan biaya tertinggi yang akan Anda bayarkan (biaya dasar + biaya prioritas)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Biaya prioritas maks harus lebih besar dari 0 GWEI" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Biaya prioritas rendah untuk kondisi jaringan saat ini" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Biaya prioritas maks (alias “tip penambang”) langsung masuk ke penambang dan memberi insentif kepada mereka untuk memprioritaskan transaksi Anda. Pengaturan maks akan menjadi yang paling sering Anda bayar" - }, - "editGasMedium": { - "message": "Sedang" - }, "editGasPriceTooLow": { "message": "Harga gas harus lebih besar dari 0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Waktu pemrosesan tak diketahui" }, - "editGasTooLowTooltip": { - "message": "Biaya maks atau biaya prioritas maks Anda mungkin rendah untuk kondisi pasar saat ini. Kami tidak tahu kapan (atau jika) transaksi Anda akan diproses. " - }, - "editGasTooLowWarningTooltip": { - "message": "Ini akan menurunkan biaya maks Anda, tetapi jika lalu lintas jaringan meningkat, transaksi Anda mungkin tertunda atau gagal." - }, "editNonceField": { "message": "Edit nonce" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Aktifkan deteksi otomatis" }, - "enableEIP1559V2": { - "message": "Aktifkan UI biaya gas yang ditingkatkan" - }, - "enableEIP1559V2AlertMessage": { - "message": "Kami telah memperbarui cara kerja estimasi dan penyesuaian biaya gas." - }, - "enableEIP1559V2ButtonText": { - "message": "Aktifkan UI biaya gas yang ditingkatkan di Pengaturan" - }, - "enableEIP1559V2Description": { - "message": "Kami telah memperbarui cara kerja estimasi dan penyesuaian gas. Aktifkan jika Anda ingin menggunakan pengalaman gas baru. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Pengalaman gas baru" - }, "enableFromSettings": { "message": " Aktifkan dari Pengaturan." }, @@ -1395,9 +1337,6 @@ "message": "Biaya gas ini telah disarankan oleh $1. Pengabaian dapat menyebabkan masalah pada transaksi Anda. Hubungi $1 jika ada pertanyaan.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Estimasi rendah, sedang, dan tinggi kami tidak tersedia." - }, "gasFee": { "message": "Biaya gas" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Tampilkan Kunci Privat" }, - "showRecommendations": { - "message": "Tampilkan rekomendasi" - }, "showTestnetNetworks": { "message": "Tampilkan jaringan pengujian" }, diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 89ed52595..0d300b385 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -232,9 +232,6 @@ "advancedGasPriceTitle": { "message": "Prezzo gas" }, - "advancedOptions": { - "message": "Opzioni Avanzate" - }, "advancedPriorityFeeToolTip": { "message": "La commissione di priorità avanzata (nota anche come \"suggerimento del minatore\") va direttamente ai minatori e li incentiva a dare la priorità alla tua commissione di transazione." }, @@ -948,30 +945,9 @@ "editContact": { "message": "Modifica contatto" }, - "editGasEducationButtonText": { - "message": "Come devo scegliere?" - }, - "editGasEducationHighExplanation": { - "message": "Questo è il migliore per le transazioni sensibili al tempo (come gli swap) in quanto aumenta la probabilità di una transazione riuscita. Se uno Swap impiega troppo tempo per l'elaborazione, potrebbe non riuscire e comportare la perdita di parte della tariffa del gas." - }, - "editGasEducationLowExplanation": { - "message": "Una tariffa gas inferiore dovrebbe essere utilizzata solo quando il tempo di elaborazione è meno importante. Commissioni più basse rendono difficile prevedere quando (o se) la tua transazione avrà esito positivo." - }, - "editGasEducationMediumExplanation": { - "message": "Una commissione gas media va bene per l'invio, il prelievo o altre transazioni non sensibili al fattore tempo. Molto spesso questa impostazione risulterà in una transazione riuscita." - }, - "editGasEducationModalIntro": { - "message": "La scelta della giusta commissione per il gas dipende dal tipo di transazione e da quanto è importante per te." - }, - "editGasEducationModalTitle": { - "message": "Come scegliere?" - }, "editGasFeeModalTitle": { "message": "Modificare la tariffa del gas" }, - "editGasHigh": { - "message": "Alta" - }, "editGasLimitOutOfBounds": { "message": "Il limite di gas deve essere almeno $1" }, @@ -982,9 +958,6 @@ "editGasLimitTooltip": { "message": "Il limite del gas è l'unità massima di gas che sei disposto a utilizzare. Le unità di gas sono un moltiplicatore per “Commissione massima priorità“ e “Commissione massima“." }, - "editGasLow": { - "message": "Bassa" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "La tariffa base massima non può essere inferiore alla tariffa prioritaria" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index e1cb72794..acdf40c49 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "ガス代" }, - "advancedOptions": { - "message": "詳細オプション" - }, "advancedPriorityFeeToolTip": { "message": "優先手数料 (別名「マイナーチップ」) はマイナーに直接支払われ、トランザクションを優先するインセンティブとなります。" }, @@ -1001,30 +998,9 @@ "editContact": { "message": "連絡先を編集" }, - "editGasEducationButtonText": { - "message": "どのように選択すればいいですか?" - }, - "editGasEducationHighExplanation": { - "message": "これは、トランザクションが成功する可能性を高めるため、急ぎのトランザクション (スワップなど) に最適です。スワップは処理に時間がかかりすぎると失敗し、ガス代の一部が失われる可能性があります。" - }, - "editGasEducationLowExplanation": { - "message": "低いガス代は、処理時間が重要でない場合以外使用しないでください。ガス代を下げると、いつトランザクションが成功するか (または成功するかどうか) が予測しにくくなります。" - }, - "editGasEducationMediumExplanation": { - "message": "中程度のガス代は、送金、引き出し、その他急ぎではないトランザクションに適しています。この設定のトランザクションは、ほとんどの場合成功します。" - }, - "editGasEducationModalIntro": { - "message": "適切なガス代は、トランザクションのタイプと重要性によって異なります。" - }, - "editGasEducationModalTitle": { - "message": "選び方" - }, "editGasFeeModalTitle": { "message": "ガス代を編集" }, - "editGasHigh": { - "message": "高" - }, "editGasLimitOutOfBounds": { "message": "ガスの限度額は$1以上にする必要があります" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "ガスの限度額は、使用しても構わない最大のガス代です。 ガス代は、「最大優先手数料」と「最大手数料」の乗数です。" }, - "editGasLow": { - "message": "低" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "最大基本手数料を優先手数料よりも低くすることはできません" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "最大手数料を優先手数料よりも低くすることはできません" }, - "editGasMaxFeeTooltip": { - "message": "最大手数料は、支払う可能性のある最高額です (基本手数料 + 優先手数料)。" - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "最大優先手数料は0GWEIより高くなければなりません" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "現在のネットワーク状況に対して優先手数料が低いです" }, - "editGasMaxPriorityFeeTooltip": { - "message": "最大優先手数料 (別名「マイナーチップ」) はマイナーに直接支払われ、トランザクションを優先するインセンティブとなります。通常最大設定額が支払われます" - }, - "editGasMedium": { - "message": "中" - }, "editGasPriceTooLow": { "message": "ガス代は0より高くなければなりません" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "不明な処理時間" }, - "editGasTooLowTooltip": { - "message": "現在の市場の状況に対し、最大手数料または最大優先手数料が低い可能性があります。トランザクションがいつ処理されるか (または処理されるかどうか) わかりません。 " - }, - "editGasTooLowWarningTooltip": { - "message": "これにより最大手数料は下がりますが、ネットワークトラフィックが増加するとトランザクションが遅延または失敗する可能性があります。" - }, "editNonceField": { "message": "ナンスを編集" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " 自動検出を有効にする" }, - "enableEIP1559V2": { - "message": "改善されたガス代 UI を有効にする" - }, - "enableEIP1559V2AlertMessage": { - "message": "ガス代の見積もりとカスタマイズが新しくなりました。" - }, - "enableEIP1559V2ButtonText": { - "message": "設定で、改善されたガス代 UI をオンにしてください" - }, - "enableEIP1559V2Description": { - "message": "ガス代の見積もりとカスタマイズが新しくなりました。新しいガス代エクスペリエンスを利用するには、オンにしてください。$1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "新しいガス代エクスペリエンス" - }, "enableFromSettings": { "message": " 設定で有効にします。" }, @@ -1395,9 +1337,6 @@ "message": "このガス代は$1により提案されています。これを上書きすると、トランザクションに問題が発生する可能性があります。ご質問がございましたら、$1までお問い合わせください。", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "弊社の低・中・高の見積もりはご利用いただけません。" - }, "gasFee": { "message": "ガス代" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "秘密鍵を表示" }, - "showRecommendations": { - "message": "推奨を表示" - }, "showTestnetNetworks": { "message": "テストネットワークを表示" }, diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index f198fab3a..6f7ff32b3 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "ಸುಧಾರಿತ" }, - "advancedOptions": { - "message": "ಸುಧಾರಿತ ಆಯ್ಕೆಗಳು" - }, "amount": { "message": "ಮೊತ್ತ" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 6051e1195..0c37c3dd8 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "가스 가격" }, - "advancedOptions": { - "message": "고급 옵션" - }, "advancedPriorityFeeToolTip": { "message": "우선 요금(일명 \"채굴자 팁\")이란 나와 먼저 거래한 것에 대한 인센티브로 채굴자에게 직접 전달되는 금액입니다." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "연락처 편집" }, - "editGasEducationButtonText": { - "message": "어떻게 선택해야 하나요?" - }, - "editGasEducationHighExplanation": { - "message": "이는 거래 성공 가능성을 높이기 때문에 시간에 (스왑과 같이) 민감한 거래에 가장 적합합니다. 스왑 처리에 시간이 너무 오래 걸리면 실패하고 가스 요금의 일부를 손해볼 수 있습니다." - }, - "editGasEducationLowExplanation": { - "message": "처리 시간의 중요성이 낮을 때만 저렴한 가스 요금을 사용해야 합니다. 요금이 낮으면 거래 성공 시기(또는 거래 성공 여부)를 예측하기 어렵습니다." - }, - "editGasEducationMediumExplanation": { - "message": "중간 정도의 가스 요금은 송금, 인출 등 시간에 민감한 거래에 적합합니다. 이러한 설정은 대부분 성공적인 거래로 이어집니다." - }, - "editGasEducationModalIntro": { - "message": "거래 유형과 중요도에 따라 적절한 가스 요금을 선택해야 합니다." - }, - "editGasEducationModalTitle": { - "message": "어떻게 선택하나요?" - }, "editGasFeeModalTitle": { "message": "가스 요금 편집" }, - "editGasHigh": { - "message": "높음" - }, "editGasLimitOutOfBounds": { "message": "가스 최소 한도는 $1입니다." }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "가스 한도는 사용하려는 가스의 최대 단위입니다. 가스 단위는 \"최대 우선 요금\" 및 \"최대 요금\"의 승수입니다." }, - "editGasLow": { - "message": "낮음" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "최대 기본 요금은 우선 요금보다 낮을 수 없습니다." }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "최대 요금은 최대 우선 요금보다 낮을 수 없습니다." }, - "editGasMaxFeeTooltip": { - "message": "최대 요금은 지급할 최대 금액입니다(기본 요금 + 우선 요금)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "최대 우선 요금은 0GWEI보다 커야 합니다." }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "우선 요금이 현재 네트워크 조건에 비해 낮습니다." }, - "editGasMaxPriorityFeeTooltip": { - "message": "최대 우선 요금(일명 \"채굴자 팁\")이란 나와 먼저 거래한 것에 대한 인센티브로 채굴자에게 직접 전달되는 금액입니다. 대부분의 경우 최대 설정값을 지급합니다." - }, - "editGasMedium": { - "message": "중간" - }, "editGasPriceTooLow": { "message": "가스 가격은 0보다 커야 합니다." }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "알 수 없는 처리 시간" }, - "editGasTooLowTooltip": { - "message": "귀하의 최대 요금 또는 최대 우선 요금은 현재 시장 상황에 비해 낮은 것 같습니다. 귀하의 거래가 언제 진행(또는 처리)되는지 알 수 없습니다." - }, - "editGasTooLowWarningTooltip": { - "message": "이렇게 하면 최대 요금은 낮아지지만 네트워크 트래픽이 증가하여 거래가 지연되거나 실패할 수 있습니다." - }, "editNonceField": { "message": "논스 편집" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " 자동 감지 활성화" }, - "enableEIP1559V2": { - "message": "향상된 가스 수수료 UI 활성화" - }, - "enableEIP1559V2AlertMessage": { - "message": "가스비 견적 산정 방법과 맞춤화 작업을 업데이트했습니다." - }, - "enableEIP1559V2ButtonText": { - "message": "설정에서 향상된 가스 수수료 UI를 활성화" - }, - "enableEIP1559V2Description": { - "message": "가스비 견적 산정 방법과 맞춤화 작업을 업데이트했습니다. 새로운 가스 경험을 사용하기 원하시면 이 기능을 켜세요. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "새로운 가스 경험" - }, "enableFromSettings": { "message": " 설정에서 이 기능을 활성화합니다." }, @@ -1395,9 +1337,6 @@ "message": "$1에서 이 가스 요금을 제안했습니다. 이를 무시하면 거래에 문제가 발생할 수 있습니다. 질문이 있는 경우 $1에 문의하세요.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "낮은, 중간 및 높은 견적을 사용할 수 없습니다." - }, "gasFee": { "message": "가스 수수료" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "비공개 키 표시" }, - "showRecommendations": { - "message": "추천 보기" - }, "showTestnetNetworks": { "message": "테스트 네트워크 보기" }, diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index a836de3f8..7e000f408 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Išplėstiniai" }, - "advancedOptions": { - "message": "Išplėstinės parinktys" - }, "amount": { "message": "Suma" }, diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index 4931abf94..df7f02d69 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Papildu" }, - "advancedOptions": { - "message": "Papildu opcijas" - }, "amount": { "message": "Apjoms" }, diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index a3d9997c7..1191b96a6 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Lanjutan" }, - "advancedOptions": { - "message": "Pilihan Lanjutan" - }, "amount": { "message": "Jumlah" }, diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 68969830b..810e5d237 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Avansert" }, - "advancedOptions": { - "message": "Avanserte valg" - }, "amount": { "message": "Sum" }, diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index c908e5fb1..ed06090f8 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -82,9 +82,6 @@ "advanced": { "message": "Advanced" }, - "advancedOptions": { - "message": "Mga Advanced na Opsyon" - }, "affirmAgree": { "message": "Sang-ayon ako" }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 66554d185..869a7bb47 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Zaawansowane" }, - "advancedOptions": { - "message": "Opcje zaawansowane" - }, "amount": { "message": "Ilość" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 872d645b0..d83a6b56e 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Preço do Gas" }, - "advancedOptions": { - "message": "Opções avançadas" - }, "advancedPriorityFeeToolTip": { "message": "A taxa de prioridade (ou seja, \"gorjeta do minerador\") vai diretamente para os mineradores e os incentiva a priorizar a sua transação." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Editar contato" }, - "editGasEducationButtonText": { - "message": "Como eu escolho?" - }, - "editGasEducationHighExplanation": { - "message": "Essa é a melhor opção para transações suscetíveis ao tempo (como swaps), pois aumenta a probabilidade de sucesso da transação. Se um swap demorar demais para ser processado, ele pode falhar e resultar na perda de parte da taxa de Gas." - }, - "editGasEducationLowExplanation": { - "message": "Uma taxa de gás mais baixa só deve ser usada quando o tempo de processamento é menos importante. Taxas reduzidas dificultam a previsão de quando (ou se) a sua transação será bem-sucedida." - }, - "editGasEducationMediumExplanation": { - "message": "Uma taxa de Gas média é boa para envios, retiradas e outras transações não suscetíveis ao tempo. Essas condições quase sempre resultarão em uma transação de sucesso." - }, - "editGasEducationModalIntro": { - "message": "Selecionar a taxa de Gas correta depende do tipo de transação e do quanto ela é importante para você." - }, - "editGasEducationModalTitle": { - "message": "Como escolher?" - }, "editGasFeeModalTitle": { "message": "Editar taxa de Gas" }, - "editGasHigh": { - "message": "Alta" - }, "editGasLimitOutOfBounds": { "message": "O limite de gás deve ser de pelo menos $1" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "O limite de gás são as unidades máximas de gás que você está disposto a utilizar. Unidades de gás são um multiplicador para “Taxa de prioridade máxima” e “Taxa máxima”." }, - "editGasLow": { - "message": "Baixa" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "A taxa de base máxima não pode ser inferior à taxa de prioridade" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "A taxa máxima não pode ser inferior à taxa de prioridade máxima" }, - "editGasMaxFeeTooltip": { - "message": "A taxa máxima é o valor máximo que você pagará (taxa base + taxa de prioridade)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "A taxa de prioridade máxima deve ser superior a 0 GWEI" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "A taxa de prioridade está baixa para as condições atuais da rede" }, - "editGasMaxPriorityFeeTooltip": { - "message": "A taxa máxima de prioridade (também conhecida como \"gorjeta do minerador\") vai diretamente para os mineradores e os incentiva a priorizar sua transação. Na maioria dos casos, você paga o valor máximo definido" - }, - "editGasMedium": { - "message": "Média" - }, "editGasPriceTooLow": { "message": "O preço do gás deve ser superior a 0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Tempo de processamento desconhecido" }, - "editGasTooLowTooltip": { - "message": "Sua taxa máxima ou taxa de prioridade máxima pode estar baixa para as condições atuais do mercado. Não sabemos quando (ou se) a sua transação será processada. " - }, - "editGasTooLowWarningTooltip": { - "message": "Isso reduz sua taxa máxima, mas, se o tráfego na rede aumentar, sua transação pode ser postergada ou falhar." - }, "editNonceField": { "message": "Editar nonce" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Ativar detecção automática" }, - "enableEIP1559V2": { - "message": "Ativar UI aprimorada para taxa de gás" - }, - "enableEIP1559V2AlertMessage": { - "message": "Atualizamos o funcionamento da estimativa e personalização da taxa de gás." - }, - "enableEIP1559V2ButtonText": { - "message": "Ative a UI aprimorada para taxa de gás nas configurações" - }, - "enableEIP1559V2Description": { - "message": "Atualizamos o funcionamento da estimativa e personalização de gás. Ative se quiser desfrutar a nova experiência de gás. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Nova experiência de gás" - }, "enableFromSettings": { "message": " Habilite-a nas configurações." }, @@ -1395,9 +1337,6 @@ "message": "Essa taxa de gás foi sugerida por $1. Sua substituição pode causar um problema com a sua transação. Entre em contato com $1 se tiver perguntas.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Nossas estimativas baixas, médias e altas não estão disponíveis." - }, "gasFee": { "message": "Taxa de gás" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Mostrar Chaves Privadas" }, - "showRecommendations": { - "message": "Mostrar recomendações" - }, "showTestnetNetworks": { "message": "Mostrar redes de teste" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index d34872b32..4b7a39e80 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -167,9 +167,6 @@ "advancedGasPriceTitle": { "message": "Preço do gás" }, - "advancedOptions": { - "message": "Opções avançadas" - }, "advancedPriorityFeeToolTip": { "message": "A taxa de prioridade (ou seja, \"gorjeta do minerador\") vai diretamente para os mineradores e os incentiva a priorizar a sua transação." }, @@ -738,30 +735,9 @@ "editContact": { "message": "Editar contato" }, - "editGasEducationButtonText": { - "message": "Como devo escolher?" - }, - "editGasEducationHighExplanation": { - "message": "Essa opção é mais indicada para transações urgentes (como trocas, ou \"swaps\"), pois aumenta a probabilidade de sucesso da transação. Se uma troca leva muito tempo para ser processada, pode falhar e resultar na perda de parte da sua taxa de gás." - }, - "editGasEducationLowExplanation": { - "message": "Uma taxa de gás mais baixa só deve ser usada quando o tempo de processamento é menos importante. Taxas reduzidas dificultam a previsão de quando (ou se) a sua transação será bem-sucedida." - }, - "editGasEducationMediumExplanation": { - "message": "Uma taxa de gás média é indicada para envios, saques ou outras transações não urgentes. Essa configuração geralmente resulta em uma transação bem-sucedida." - }, - "editGasEducationModalIntro": { - "message": "A escolha da taxa de gás ideal depende do tipo de transação e da importância dela para você." - }, - "editGasEducationModalTitle": { - "message": "Como escolher?" - }, "editGasFeeModalTitle": { "message": "Editar taxa de gás" }, - "editGasHigh": { - "message": "Alta" - }, "editGasLimitOutOfBounds": { "message": "O limite de gás deve ser de pelo menos $1" }, @@ -772,9 +748,6 @@ "editGasLimitTooltip": { "message": "O limite de gás são as unidades máximas de gás que você está disposto a utilizar. Unidades de gás são um multiplicador para “Taxa de prioridade máxima” e “Taxa máxima”." }, - "editGasLow": { - "message": "Baixa" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "A taxa de base máxima não pode ser inferior à taxa de prioridade" }, @@ -793,9 +766,6 @@ "editGasMaxFeePriorityImbalance": { "message": "A taxa máxima não pode ser inferior à taxa de prioridade máxima" }, - "editGasMaxFeeTooltip": { - "message": "A taxa máxima é o maior valor que você pagará (taxa de base + taxa de prioridade)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "A taxa de prioridade máxima deve ser superior a 0 GWEI" }, @@ -814,12 +784,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "A taxa de prioridade está baixa para as condições atuais da rede" }, - "editGasMaxPriorityFeeTooltip": { - "message": "A taxa de prioridade máxima (ou seja, a \"gorjeta dos mineradores\") vai diretamente para os mineradores e os incentiva a priorizar a sua transação. Você geralmente paga a sua configuração máxima" - }, - "editGasMedium": { - "message": "Média" - }, "editGasPriceTooLow": { "message": "O preço do gás deve ser superior a 0" }, @@ -839,12 +803,6 @@ "editGasTooLow": { "message": "Tempo de processamento desconhecido" }, - "editGasTooLowTooltip": { - "message": "Sua taxa máxima ou taxa de prioridade máxima pode estar baixa para as condições atuais do mercado. Não sabemos quando (ou se) a sua transação será processada. " - }, - "editGasTooLowWarningTooltip": { - "message": "Isso reduz a sua taxa máxima, mas se o tráfego da rede aumentar, a sua transação poderá sofrer atrasos ou falhar." - }, "editNonceField": { "message": "Editar nonce" }, @@ -1085,9 +1043,6 @@ "message": "Essa taxa de gás foi sugerida por $1. Sua substituição pode causar um problema com a sua transação. Entre em contato com $1 se tiver perguntas.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Nossas estimativas baixas, médias e altas não estão disponíveis." - }, "gasLimit": { "message": "Limite de gás" }, @@ -2363,9 +2318,6 @@ "showPrivateKeys": { "message": "Mostrar chaves privadas" }, - "showRecommendations": { - "message": "Mostrar recomendações" - }, "showTestnetNetworks": { "message": "Mostrar redes de teste" }, diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index 9cc3801ce..0242b394e 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Avansate" }, - "advancedOptions": { - "message": "Opțiuni avansate" - }, "amount": { "message": "Sumă" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 6e54cf468..046e4f8c0 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Цена газа" }, - "advancedOptions": { - "message": "Дополнительные параметры" - }, "advancedPriorityFeeToolTip": { "message": "Плата за приоритет (также известная как «чаевые майнеру») направляется непосредственно майнерам, чтобы они уделили приоритетное внимание вашей транзакции." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Изменить контакт" }, - "editGasEducationButtonText": { - "message": "Как мне выбрать?" - }, - "editGasEducationHighExplanation": { - "message": "Это лучше всего подходит для транзакций, чувствительных ко времени (например, обмен), поскольку увеличивает вероятность успешной транзакции. Если обработка обмена занимает слишком много времени, он может завершиться неудачно и привести к потере части вашей платы за газ." - }, - "editGasEducationLowExplanation": { - "message": "Более низкую плату за газ следует использовать только тогда, когда время обработки менее важно. При более низких суммах платы сложнее предсказать, когда ваша транзакция будет выполнена (и будет ли она вообще выполнена)." - }, - "editGasEducationMediumExplanation": { - "message": "Средняя плата за газ хорошо подходит для отправки и вывода средств или других транзакций, не зависящих от времени. Этот параметр чаще всего позволяет успешно выполнить транзакцию." - }, - "editGasEducationModalIntro": { - "message": "Выбор правильной платы за газ зависит от типа транзакции и ее важности для вас." - }, - "editGasEducationModalTitle": { - "message": "Как выбрать?" - }, "editGasFeeModalTitle": { "message": "Изменить плату за газ" }, - "editGasHigh": { - "message": "Высокая" - }, "editGasLimitOutOfBounds": { "message": "Лимит газа должен быть не менее $1" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "Лимит газа — это максимальное количество единиц газа, которое вы готовы использовать. Единицы газа являются множителем «Максимальной платы за приоритет» и «Максимальной комиссии»." }, - "editGasLow": { - "message": "Низкая" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Максимальная базовая комиссия не может быть ниже платы за приоритет." }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Максимальная комиссия не может быть меньше максимальной платы за приоритет" }, - "editGasMaxFeeTooltip": { - "message": "Максимальная комиссия — это наибольшая сумма, которую вы заплатите (базовая комиссия + плата за приоритет)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Максимальная плата за приоритет должна быть больше 0 GWEI." }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Плата за приоритет низкая для текущих условий сети" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Максимальная плата за приоритет (также известная как «чаевые майнеру») направляется непосредственно майнерам, чтобы они уделили приоритетное внимание вашей транзакции. Чаще всего вы платите максимальную указанную вами сумму." - }, - "editGasMedium": { - "message": "Средняя" - }, "editGasPriceTooLow": { "message": "Цена газа должна быть больше 0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Время обработки неизвестно" }, - "editGasTooLowTooltip": { - "message": "Ваша максимальная комиссия или максимальная плата за приоритет могут быть низкими для текущих рыночных условий. Мы не знаем, когда ваша транзакция будет выполнена (и будет ли она вообще выполнена). " - }, - "editGasTooLowWarningTooltip": { - "message": "Это снижает вашу максимальную комиссию, но, если трафик в сети увеличивается, ваша транзакция может быть отложена или не выполнена." - }, "editNonceField": { "message": "Изменить одноразовый номер" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Включить автообнаружение" }, - "enableEIP1559V2": { - "message": "Включить расширенный интерфейс платы за газ" - }, - "enableEIP1559V2AlertMessage": { - "message": "Мы обновили принцип оценки и настройки платы за газ." - }, - "enableEIP1559V2ButtonText": { - "message": "Включите расширенный интерфейс платы за газ в Настройках." - }, - "enableEIP1559V2Description": { - "message": "Мы обновили принцип работы оценки и настройки газа. Включите эту опцию, если хотите использовать новый интерфейс газа. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Новый интерфейс газа" - }, "enableFromSettings": { "message": " Включите его в Настройках." }, @@ -1395,9 +1337,6 @@ "message": "Эта плата за газ была предложена $1. Ее переопредление может вызвать проблемы с вашей транзакцией. При наличии вопросов обратитесь к $1.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Наши примерные значения низкой, средней и высокой платы недоступны." - }, "gasFee": { "message": "Плата за газ" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Показать закрытые ключи" }, - "showRecommendations": { - "message": "Показать рекомендации" - }, "showTestnetNetworks": { "message": "Показать тестовые сети" }, diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 8ce0573f8..3091f7777 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Rozšírené" }, - "advancedOptions": { - "message": "Rozšírené nastavenia" - }, "amount": { "message": "Částka" }, diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index d2878ddbf..060601c5e 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Napredno" }, - "advancedOptions": { - "message": "Napredne možnosti" - }, "amount": { "message": "Znesek" }, diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 7ddafe941..e1bb15fac 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Напредне опције" }, - "advancedOptions": { - "message": "Dodatne opcije" - }, "amount": { "message": "Iznos" }, diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 2b9b3e9cc..afaacee8b 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Avancerat" }, - "advancedOptions": { - "message": "Avancerade alternativ" - }, "amount": { "message": "Belopp" }, diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 4afb57d3a..b04f2448b 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Mipangilio ya kina" }, - "advancedOptions": { - "message": "Machaguo ya Juu" - }, "amount": { "message": "Kiasi" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index ccdd4e4c6..b20c3974b 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Presyo ng gas" }, - "advancedOptions": { - "message": "Mga Advanced na Opsyon" - }, "advancedPriorityFeeToolTip": { "message": "Ang priority fee (kilala rin bilang “tip ng miner”) ay direktang napupunta sa mga miner at ginagawang insentibo ang mga ito upang unahin ang iyong mga transaksyon." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "I-edit ang contact" }, - "editGasEducationButtonText": { - "message": "Paano ako pipili?" - }, - "editGasEducationHighExplanation": { - "message": "Pinakamainam ito para sa mga transaksyong sensitibo sa oras (tulad ng Swap) dahil pinapataas nito ang posibilidad ng isang matagumpay na transaksyon. Kung ang isang Swap ay tumatagal ng masyadong mahaba upang maproseso ito ay maaaring mabigo at magresulta sa pagkawala ng ilan sa iyong gas fee." - }, - "editGasEducationLowExplanation": { - "message": "Ang mas mababang bayad sa gas ay dapat lamang gamitin kapag ang oras ng pagproseso ay hindi gaanong mahalaga. Dahil sa mas mababang mga bayarin, mahirap hulaan kung kailan (o kung) ang iyong transaksyon ay magiging matagumpay." - }, - "editGasEducationMediumExplanation": { - "message": "Ang katamtamang gas fee ay mainam para sa pagpapadala, pag-withdraw o iba pang wala oras na sensitibong mga transaksyon. Ang setting na ito ay kadalasang magreresulta sa isang matagumpay na transaksyon." - }, - "editGasEducationModalIntro": { - "message": "Ang pagpili ng tamang gas fee ay depende sa uri ng transaksyon at kung gaano ito kahalaga sa iyo." - }, - "editGasEducationModalTitle": { - "message": "Paano pipili?" - }, "editGasFeeModalTitle": { "message": "I-edit ang gas fee" }, - "editGasHigh": { - "message": "Mataas" - }, "editGasLimitOutOfBounds": { "message": "Ang limit ng gas ay dapat na $1 man lamang" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "Ang limit ng gas ay ang pinakamataas na yunit ng gas na handa mong gamitin. Ang mga yunit ng gas ay isang multiplier sa “Max priority fee” at “Max fee”." }, - "editGasLow": { - "message": "Mababa" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Ang max base fee ay hindi dapat mas mababa sa priority fee" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Ang max fee ay hindi dapat mas mababa kaysa max priority fee" }, - "editGasMaxFeeTooltip": { - "message": "Ang max fee ay ang pinakamataas na babayaran mo (base fee + priority fee)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Ang max priority fee ay dapat mas mataas sa 0 GWEI" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Ang priority fee ay mababa para sa kasalukuyang mga kundisyon ng network" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Ang max priority fee (kilala rin bilang “tip ng miner”) ay direktang napupunta sa mga miner at ginagawang insentibo ang mga ito upang unahin ang iyong mga transaksyon. Madalas kang magbabayad sa iyong max setting" - }, - "editGasMedium": { - "message": "Medium" - }, "editGasPriceTooLow": { "message": "Ang presyo ng gas ay dapat mas mataas sa 0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Hindi kilalang oras ng pagproseso" }, - "editGasTooLowTooltip": { - "message": "Ang iyong max fee o max priority fee ay maaaring mababa para sa kasalukuyang kondisyon ng market. Hindi namin alam kung kailan (o kung) ipoproseso ang iyong transaksyon. " - }, - "editGasTooLowWarningTooltip": { - "message": "Pinapababa nito ang iyong maximum fee ngunit kung network traffic ay maaaring maantala o mabigo ang iyong transaksyon." - }, "editNonceField": { "message": "I-edit sa Nonce" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Paganahin ang autodetect" }, - "enableEIP1559V2": { - "message": "Paganahin ang Pinahusay na UI ng Singil sa Gas" - }, - "enableEIP1559V2AlertMessage": { - "message": "Na-update na namin kung paano gumagana ang pagtantiya at pag-customize ng singil sa gas." - }, - "enableEIP1559V2ButtonText": { - "message": "I-on sa Settings ang pinahusay na UI ng singil sa gas" - }, - "enableEIP1559V2Description": { - "message": "Na-update na namin kung paano gumagana ang pagtantiya at pag-customize ng gas. I-on kung gusto mong gamitin ang bagong karanasan sa gas. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Bagong karanasan sa gas" - }, "enableFromSettings": { "message": " Paganahin ito mula sa Settings." }, @@ -1395,9 +1337,6 @@ "message": "Ang gas fee na ito ay iminungkahi ng $1. Ang pag-override dito ay maaaring magdulot ng problema sa iyong transaksyon. Mangyaring makipag-ugnayan sa $1 kung mayroon kang mga tanong.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Ang aming low, medium at high na mga pagtantiya ay hindi available." - }, "gasFee": { "message": "Bayarin sa Gas" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Ipakita ang Mga Pribadong Key" }, - "showRecommendations": { - "message": "Ipakita ang mga Rekomendasyon" - }, "showTestnetNetworks": { "message": "Ipakita ang mga test network" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 94230f55c..8f3a26cda 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Gaz fiyatı" }, - "advancedOptions": { - "message": "Gelişmiş Seçenekler" - }, "advancedPriorityFeeToolTip": { "message": "Maks. öncelik ücreti (başka bir deyişle \"madenci bahşişi\") doğrudan madencilere gider ve işleminizin öncelikli olarak gerçekleştirilmesini teşvik eder." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Kişiyi Düzenle" }, - "editGasEducationButtonText": { - "message": "Nasıl seçim yapmalıyım?" - }, - "editGasEducationHighExplanation": { - "message": "Başarılı işlem şansını artırdığı için zamana duyarlı işlemler (Takaslar gibi) için en iyi seçenektir. Bir Takas işleminin gerçekleşmesi çok uzun sürerse başarısız olabilir ya da gaz ücretinizin bir kısmını kaybetmenize neden olabilir." - }, - "editGasEducationLowExplanation": { - "message": "Daha az bir gaz ücreti sadece işlem süresi daha az önemli olduğunda kullanılabilir. Daha az ücretler işleminizin ne zaman başarılı olacağını (ya da başarılı olup olamayacağını) öngörmeyi zorlaştırır." - }, - "editGasEducationMediumExplanation": { - "message": "Orta düzey bir gaz ücreti gönderme, çekme ya da zamanlaması önemli olmayan diğer işlemler için iyidir. Bu ayar çoğunlukla başarılı bir işlemle sonuçlanacaktır." - }, - "editGasEducationModalIntro": { - "message": "Doğru gaz ücretinin seçilmesi işlem türüne ve işlemin sizin için ne kadar önemli olduğuna bağlıdır." - }, - "editGasEducationModalTitle": { - "message": "Seçim nasıl yapılmalıdır?" - }, "editGasFeeModalTitle": { "message": "Gaz ücretini düzenle" }, - "editGasHigh": { - "message": "Yüksek" - }, "editGasLimitOutOfBounds": { "message": "Gaz limiti en az $1 olmalıdır" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "Gaz limiti, kullanmak istediğiniz maksimum gaz birimidir. Gaz birimleri \"Maks. öncelik ücreti\" ve \"Maks. ücretin\" bir çarpanıdır." }, - "editGasLow": { - "message": "Düşük" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Maks. baz ücret, öncelik ücretinden daha düşük olamaz" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Maks. ücret maks. öncelik ücretinden daha düşük olamaz" }, - "editGasMaxFeeTooltip": { - "message": "Maks. ücret ödeyeceğiniz en yüksek ücrettir (baz ücret + öncelik ücreti)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Maks. öncelik ücreti 0 GWEI üzerinde olmalıdır" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Öncelik ücreti mevcut ağ koşulları için düşük" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Maks. öncelik ücreti (başka bir deyişle \"madenci bahşişi\") doğrudan madencilere gider ve işleminizin öncelikli olarak gerçekleştirilmesini teşvik eder. Sıklıkla maks. ayarınızda ödeme yaparsınız" - }, - "editGasMedium": { - "message": "Orta" - }, "editGasPriceTooLow": { "message": "Gaz fiyatı 0'dan büyük olmalıdır" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Bilinmeyen işlem süresi" }, - "editGasTooLowTooltip": { - "message": "Maks. ücretiniz veya maks. öncelik ücretiniz mevcut piyasa koşulları için düşük olabilir. İşleminizin ne zaman gerçekleştirileceğini (ya da gerçekleştirilip gerçekleştirilmeyeceğini) bilmeyiz. " - }, - "editGasTooLowWarningTooltip": { - "message": "Bu, maksimum ücretinizi düşürür ancak ağ trafiğiniz artarsa işleminiz gecikebilir ya da gerçekleşmeyebilir." - }, "editNonceField": { "message": "Geçici anahtarı düzenle" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Otomatik algılamayı etkinleştir" }, - "enableEIP1559V2": { - "message": "Gelişmiş Gas Ücreti Kullanıcı Arayüzü'nü Etkinleştir" - }, - "enableEIP1559V2AlertMessage": { - "message": "Gas ücreti tahmini ve özelleştirmenin nasıl çalıştığını güncelledik." - }, - "enableEIP1559V2ButtonText": { - "message": "Ayarlarda Gelişmiş Gas Ücreti Kullanıcı Arayüzü'nü aç" - }, - "enableEIP1559V2Description": { - "message": "Gas tahmini ve özelleştirmenin nasıl çalıştığını güncelledik. Yeni gas deneyimini kullanmak istiyorsan aç. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Yeni gas deneyimi" - }, "enableFromSettings": { "message": " Ayarlardan etkinleştir." }, @@ -1395,9 +1337,6 @@ "message": "Bu gaz ücreti $1 tarafından önerilmiştir. Bu değerin başka bir değerle değiştirilmesi işleminizle ilgili bir soruna neden olabilir. Sorularınız olursa lütfen $1 ile iletişime geçin.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Düşük, orta ve yüksek tahminlerimiz mevcut değil." - }, "gasFee": { "message": "Gaz Ücreti" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Özel Anahtarları Göster" }, - "showRecommendations": { - "message": "Önerileri Göster" - }, "showTestnetNetworks": { "message": "Test ağlarını göster" }, diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index 88c161322..59380e4f3 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -47,9 +47,6 @@ "advanced": { "message": "Розширені" }, - "advancedOptions": { - "message": "Додаткові параметри" - }, "amount": { "message": "Кількість" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index eab85358b..226670d8e 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "Giá gas" }, - "advancedOptions": { - "message": "Tùy chọn nâng cao" - }, "advancedPriorityFeeToolTip": { "message": "Phí ưu tiên (hay còn được gọi là \"phí khích lệ thợ đào\") được chuyển trực tiếp cho các thợ đào và khuyến khích họ ưu tiên giao dịch của bạn." }, @@ -1001,30 +998,9 @@ "editContact": { "message": "Chỉnh sửa địa chỉ liên hệ" }, - "editGasEducationButtonText": { - "message": "Tôi nên chọn như thế nào?" - }, - "editGasEducationHighExplanation": { - "message": "Đây là lựa chọn tốt nhất cho các giao dịch nhạy cảm với thời gian (chẳng hạn như Hoán đổi) vì nó làm tăng khả năng giao dịch thành công. Quá trình Hoán đổi diễn ra quá lâu có thể khiến giao dịch thất bại và bạn bị mất một phần phí gas." - }, - "editGasEducationLowExplanation": { - "message": "Bạn nên sử dụng phí gas thấp hơn cho các giao dịch không quá quan trọng đến thời gian. Mức phí thấp hơn khiến khó dự đoán được khi nào (hoặc liệu) giao dịch của bạn thành công." - }, - "editGasEducationMediumExplanation": { - "message": "Phí gas trung bình phù hợp để gửi, rút hoặc thực hiện các giao dịch không nhạy cảm với thời gian khác. Thiết lập này thường cho kết quả giao dịch thành công." - }, - "editGasEducationModalIntro": { - "message": "Lựa chọn phí gas phù hợp tùy thuộc vào loại giao dịch và tầm quan trọng của nó đối với bạn." - }, - "editGasEducationModalTitle": { - "message": "Cách chọn?" - }, "editGasFeeModalTitle": { "message": "Chỉnh sửa phí gas" }, - "editGasHigh": { - "message": "Cao" - }, "editGasLimitOutOfBounds": { "message": "Giới hạn gas tối thiểu phải là $1" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "Giới hạn gas là đơn vị gas tối đa mà bạn sẵn sàng sử dụng. Đơn vị gas là hệ số nhân của \"Phí ưu tiên tối đa\" và \"Phí tối đa\"." }, - "editGasLow": { - "message": "Thấp" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "Phí cơ bản tối đa không thể thấp hơn phí ưu tiên" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "Phí tối đa không thể thấp hơn phí ưu tiên tối đa" }, - "editGasMaxFeeTooltip": { - "message": "Phí tối đa là phí cao nhất mà bạn sẽ trả (phí cơ bản + phí ưu tiên)." - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "Phí ưu tiên tối đa phải lớn hơn 0 GWEI" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "Phí ưu tiên thấp so với tình trạng mạng hiện tại" }, - "editGasMaxPriorityFeeTooltip": { - "message": "Phí ưu tiên tối đa (hay còn được gọi là \"phí khích lệ thợ đào\") được chuyển trực tiếp cho các thợ đào và khuyến khích họ ưu tiên giao dịch của bạn. Thường thì bạn sẽ chi trả theo mức thiết lập tối đa của mình" - }, - "editGasMedium": { - "message": "Trung bình" - }, "editGasPriceTooLow": { "message": "Giá gas phải lớn hơn 0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "Thời gian xử lý không rõ" }, - "editGasTooLowTooltip": { - "message": "Phí tối đa hoặc phí ưu tiên tối đa của bạn có thể thấp so với tình trạng mạng hiện tại. Chúng tôi không biết khi nào (hoặc liệu) giao dịch của bạn được xử lý. " - }, - "editGasTooLowWarningTooltip": { - "message": "Việc này sẽ giảm mức phí tối đa, nhưng nếu lưu lượng mạng tăng lên, giao dịch của bạn có thể bị trì hoãn hoặc thất bại." - }, "editNonceField": { "message": "Chỉnh sửa số chỉ dùng một lần" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " Bật tự động phát hiện" }, - "enableEIP1559V2": { - "message": "Bật giao diện phí gas nâng cao" - }, - "enableEIP1559V2AlertMessage": { - "message": "Chúng tôi đã cập nhật cách thức hoạt động của việc ước tính và tùy chỉnh phí gas." - }, - "enableEIP1559V2ButtonText": { - "message": "Bật giao diện phí gas nâng cao trong phần Cài đặt" - }, - "enableEIP1559V2Description": { - "message": "Chúng tôi đã cập nhật cách thức hoạt động của việc ước tính và tùy chỉnh phí gas. Bật lên nếu bạn muốn sử dụng trải nghiệm gas mới. $1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "Trải nghiệm gas mới" - }, "enableFromSettings": { "message": " Bật lên trong Cài Đặt." }, @@ -1395,9 +1337,6 @@ "message": "Phí gas này đã được gợi ý bởi $1. Việc sửa đổi có thể khiến giao dịch của bạn gặp sự cố. Vui lòng liên hệ với $1 nếu bạn có câu hỏi.", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "Các ước tính thấp, trung bình và cao của chúng tôi hiện không có sẵn." - }, "gasFee": { "message": "Phí gas" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "Hiện khóa riêng tư" }, - "showRecommendations": { - "message": "Hiển thị các đề xuất" - }, "showTestnetNetworks": { "message": "Hiển thị các mạng thử nghiệm" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index c8b1b237c..b6a4dfd4d 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -247,9 +247,6 @@ "advancedGasPriceTitle": { "message": "燃料价格" }, - "advancedOptions": { - "message": "高级选项" - }, "advancedPriorityFeeToolTip": { "message": "优先费(又称“矿工费”)直接向矿工支付,激励他们优先处理您的交易。" }, @@ -1001,30 +998,9 @@ "editContact": { "message": "编辑联系信息" }, - "editGasEducationButtonText": { - "message": "我应该如何选择?" - }, - "editGasEducationHighExplanation": { - "message": "这最适合对时间敏感的交易(如交换),因为它能增加交易成功的可能性。如果交换需要太长的时间来处理,它可能会失败,并导致您损失一些燃料费。" - }, - "editGasEducationLowExplanation": { - "message": "只有在处理时间不太重要时才能使用较低的燃料费用。较低的费用使我们难以预测您的交易何时(或会否)成功。" - }, - "editGasEducationMediumExplanation": { - "message": "中燃料费用适合用于发送、提取或其他非时间敏感交易。此设置最常导致交易成功。" - }, - "editGasEducationModalIntro": { - "message": "选择合适的燃料费取决于交易的类型和它对您的重要性。" - }, - "editGasEducationModalTitle": { - "message": "如何选择?" - }, "editGasFeeModalTitle": { "message": "编辑网络费" }, - "editGasHigh": { - "message": "高" - }, "editGasLimitOutOfBounds": { "message": "燃料上限至少为 $1" }, @@ -1035,9 +1011,6 @@ "editGasLimitTooltip": { "message": "燃料上限是您愿意使用的最大燃料单位。燃料单位是“最大优先费”和“最大费用”的乘数。" }, - "editGasLow": { - "message": "低" - }, "editGasMaxBaseFeeGWEIImbalance": { "message": "最大基本费用不能低于优先费用" }, @@ -1056,9 +1029,6 @@ "editGasMaxFeePriorityImbalance": { "message": "最大费用不能低于最大优先费用" }, - "editGasMaxFeeTooltip": { - "message": "最大费用是您将支付的最大费用(基本费用+优先费用)。" - }, "editGasMaxPriorityFeeBelowMinimum": { "message": "最大优先费用必须大于0 GWEI。" }, @@ -1077,12 +1047,6 @@ "editGasMaxPriorityFeeLowV2": { "message": "对于当前网络条件而言,优先费用较低" }, - "editGasMaxPriorityFeeTooltip": { - "message": "最大优先费(又称“矿工费”)直接向矿工支付,激励他们优先处理您的交易。您通常会支付您的最大设置" - }, - "editGasMedium": { - "message": "中" - }, "editGasPriceTooLow": { "message": "燃料价格必须大于0" }, @@ -1102,12 +1066,6 @@ "editGasTooLow": { "message": "处理时间未知" }, - "editGasTooLowTooltip": { - "message": "对于当前的市场条件而言,您的最大费用或最大优先费用可能较低。我们不知道您的交易将在何时(或会否)处理。" - }, - "editGasTooLowWarningTooltip": { - "message": "这降低了您的最大费用,但如果网络流量增加,您的交易可能会被延迟或失败。" - }, "editNonceField": { "message": "编辑 Nonce" }, @@ -1123,22 +1081,6 @@ "enableAutoDetect": { "message": " 启用自动检测" }, - "enableEIP1559V2": { - "message": "启用增强型燃料费用户界面" - }, - "enableEIP1559V2AlertMessage": { - "message": "我们已经更新了燃料费用估算和定制的方式。" - }, - "enableEIP1559V2ButtonText": { - "message": "在设置中开启增强型燃料费用户界面" - }, - "enableEIP1559V2Description": { - "message": "我们已经更新了燃料估算和定制的方式。如果您想使用新的燃料体验,请开启。$1", - "description": "$1 here is Learn More link" - }, - "enableEIP1559V2Header": { - "message": "新燃料体验" - }, "enableFromSettings": { "message": " 从设置中启用它。" }, @@ -1395,9 +1337,6 @@ "message": "这笔燃料费是由 $1 建议的。忽略它可能会导致您的交易出现问题。如果您有疑问,请联系 $1。", "description": "$1 represents the Dapp's origin" }, - "gasEstimatesUnavailableWarning": { - "message": "无法获取我们的低、中、高估计值。" - }, "gasFee": { "message": "燃料费" }, @@ -3090,9 +3029,6 @@ "showPrivateKeys": { "message": "显示私钥" }, - "showRecommendations": { - "message": "显示建议" - }, "showTestnetNetworks": { "message": "显示测试网络" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 7ff0bc49b..4a3146dc0 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -81,9 +81,6 @@ "advanced": { "message": "進階" }, - "advancedOptions": { - "message": "進階選項" - }, "affirmAgree": { "message": "我同意" }, diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index 9b62cf3e2..c90ec6223 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -34,7 +34,6 @@ export default class AppStateController extends EventEmitter { recoveryPhraseReminderHasBeenShown: false, recoveryPhraseReminderLastShown: new Date().getTime(), collectiblesDetectionNoticeDismissed: false, - enableEIP1559V2NoticeDismissed: false, showTestnetMessageInDropdown: true, showPortfolioTooltip: true, showBetaHeader: isBeta(), @@ -317,17 +316,6 @@ export default class AppStateController extends EventEmitter { }); } - /** - * A setter for the `enableEIP1559V2NoticeDismissed` property - * - * @param enableEIP1559V2NoticeDismissed - */ - setEnableEIP1559V2NoticeDismissed(enableEIP1559V2NoticeDismissed) { - this.store.updateState({ - enableEIP1559V2NoticeDismissed, - }); - } - /** * A setter for the `collectiblesDropdownState` property * diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 9bacef113..acd5c0c72 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -182,15 +182,6 @@ export default class PreferencesController { this.store.updateState({ advancedGasFee: val }); } - /** - * Setter for the `eip1559V2Enabled` property - * - * @param {object} val - holds the eip1559V2Enabled that the user set as experimental settings. - */ - setEIP1559V2Enabled(val) { - this.store.updateState({ eip1559V2Enabled: val }); - } - /** * Setter for the `theme` property * diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 2b42ed3ff..71601f2af 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -882,10 +882,8 @@ export default class TransactionController extends EventEmitter { } if (eip1559Compatibility) { - const { eip1559V2Enabled } = this.preferencesStore.getState(); const advancedGasFeeDefaultValues = this.getAdvancedGasFee(); if ( - eip1559V2Enabled && Boolean(advancedGasFeeDefaultValues) && !SWAP_TRANSACTION_TYPES.includes(txMeta.type) ) { @@ -905,10 +903,10 @@ export default class TransactionController extends EventEmitter { // then we set maxFeePerGas and maxPriorityFeePerGas to the suggested gasPrice. txMeta.txParams.maxFeePerGas = txMeta.txParams.gasPrice; txMeta.txParams.maxPriorityFeePerGas = txMeta.txParams.gasPrice; - if (eip1559V2Enabled && txMeta.origin !== ORIGIN_METAMASK) { - txMeta.userFeeLevel = PRIORITY_LEVELS.DAPP_SUGGESTED; - } else { + if (txMeta.origin === ORIGIN_METAMASK) { txMeta.userFeeLevel = CUSTOM_GAS_ESTIMATE; + } else { + txMeta.userFeeLevel = PRIORITY_LEVELS.DAPP_SUGGESTED; } } else { if ( @@ -919,10 +917,8 @@ export default class TransactionController extends EventEmitter { txMeta.origin === ORIGIN_METAMASK ) { txMeta.userFeeLevel = GAS_RECOMMENDATIONS.MEDIUM; - } else if (eip1559V2Enabled) { - txMeta.userFeeLevel = PRIORITY_LEVELS.DAPP_SUGGESTED; } else { - txMeta.userFeeLevel = CUSTOM_GAS_ESTIMATE; + txMeta.userFeeLevel = PRIORITY_LEVELS.DAPP_SUGGESTED; } if (defaultMaxFeePerGas && !txMeta.txParams.maxFeePerGas) { @@ -2218,8 +2214,7 @@ export default class TransactionController extends EventEmitter { let eip1559Version = '0'; if (txMeta.txParams.maxFeePerGas) { - const { eip1559V2Enabled } = this.preferencesStore.getState(); - eip1559Version = eip1559V2Enabled ? '2' : '1'; + eip1559Version = '2'; } const contractInteractionTypes = [ diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js index 660b8e191..7c9be16b9 100644 --- a/app/scripts/controllers/transactions/index.test.js +++ b/app/scripts/controllers/transactions/index.test.js @@ -2202,7 +2202,7 @@ describe('Transaction Controller', function () { category: EVENT.CATEGORIES.TRANSACTIONS, properties: { chain_id: '0x5', - eip_1559_version: '1', + eip_1559_version: '2', gas_edit_attempted: 'none', gas_edit_type: 'none', network: '5', diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index fbabf61b8..ff433cd47 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1738,9 +1738,6 @@ export default class MetamaskController extends EventEmitter { setAdvancedGasFee: preferencesController.setAdvancedGasFee.bind( preferencesController, ), - setEIP1559V2Enabled: preferencesController.setEIP1559V2Enabled.bind( - preferencesController, - ), setTheme: preferencesController.setTheme.bind(preferencesController), setImprovedTokenAllowanceEnabled: preferencesController.setImprovedTokenAllowanceEnabled.bind( @@ -1808,10 +1805,6 @@ export default class MetamaskController extends EventEmitter { appStateController.setCollectiblesDetectionNoticeDismissed.bind( appStateController, ), - setEnableEIP1559V2NoticeDismissed: - appStateController.setEnableEIP1559V2NoticeDismissed.bind( - appStateController, - ), updateCollectibleDropDownState: appStateController.updateCollectibleDropDownState.bind( appStateController, diff --git a/development/ts-migration-dashboard/files-to-convert.json b/development/ts-migration-dashboard/files-to-convert.json index bc94b3e44..b479cd2d3 100644 --- a/development/ts-migration-dashboard/files-to-convert.json +++ b/development/ts-migration-dashboard/files-to-convert.json @@ -431,8 +431,6 @@ "ui/components/app/confirm-page-container/confirm-page-container-navigation/index.js", "ui/components/app/confirm-page-container/confirm-page-container.component.js", "ui/components/app/confirm-page-container/confirm-page-container.container.js", - "ui/components/app/confirm-page-container/enableEIP1559V2-notice/enableEIP1559V2-notice.js", - "ui/components/app/confirm-page-container/enableEIP1559V2-notice/index.js", "ui/components/app/confirm-page-container/index.js", "ui/components/app/connected-accounts-list/connected-accounts-list-item/connected-accounts-list-item.component.js", "ui/components/app/connected-accounts-list/connected-accounts-list-item/index.js", @@ -483,9 +481,6 @@ "ui/components/app/dropdowns/dropdown.test.js", "ui/components/app/dropdowns/network-dropdown.js", "ui/components/app/dropdowns/network-dropdown.test.js", - "ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js", - "ui/components/app/edit-gas-display-education/edit-gas-display-education.stories.js", - "ui/components/app/edit-gas-display-education/index.js", "ui/components/app/edit-gas-display/edit-gas-display.component.js", "ui/components/app/edit-gas-display/edit-gas-display.stories.js", "ui/components/app/edit-gas-display/edit-gas-display.test.js", diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index abb25331c..5f245e8a8 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -123,7 +123,6 @@ function defaultFixture() { collectiblesDropdownState: {}, connectedStatusPopoverHasBeenShown: true, defaultHomeActiveTabName: null, - enableEIP1559V2NoticeDismissed: false, fullScreenGasPollTokens: [], notificationGasPollTokens: [], popupGasPollTokens: [], @@ -289,7 +288,6 @@ function onboardingFixture() { collectiblesDropdownState: {}, connectedStatusPopoverHasBeenShown: true, defaultHomeActiveTabName: null, - enableEIP1559V2NoticeDismissed: false, fullScreenGasPollTokens: [], notificationGasPollTokens: [], popupGasPollTokens: [], @@ -1102,6 +1100,15 @@ class FixtureBuilder { }); } + withNetworkSupportEIP1559() { + merge(this.fixture.data.NetworkController, { + networkDetails: { + EIPS: { 1559: true }, + }, + }); + return this; + } + build() { this.fixture.meta = { version: 74, diff --git a/test/e2e/tests/edit-gas-fee.spec.js b/test/e2e/tests/edit-gas-fee.spec.js index e41039f8c..5ac4bc0ef 100644 --- a/test/e2e/tests/edit-gas-fee.spec.js +++ b/test/e2e/tests/edit-gas-fee.spec.js @@ -21,9 +21,6 @@ describe('Editing Confirm Transaction', function () { await withFixtures( { fixtures: new FixtureBuilder() - .withPreferencesController({ - eip1559V2Enabled: true, - }) .withTransactionControllerTypeTwoTransaction() .build(), ganacheOptions, @@ -110,9 +107,6 @@ describe('Editing Confirm Transaction', function () { await withFixtures( { fixtures: new FixtureBuilder() - .withPreferencesController({ - eip1559V2Enabled: true, - }) .withTransactionControllerTypeTwoTransaction() .build(), ganacheOptions, @@ -199,9 +193,6 @@ describe('Editing Confirm Transaction', function () { { fixtures: new FixtureBuilder() .withPermissionControllerConnectedToTestDapp() - .withPreferencesController({ - eip1559V2Enabled: true, - }) .build(), ganacheOptions, title: this.test.title, diff --git a/test/e2e/tests/gas-api-fallback.spec.js b/test/e2e/tests/network-error.spec.js similarity index 54% rename from test/e2e/tests/gas-api-fallback.spec.js rename to test/e2e/tests/network-error.spec.js index 9ccc023e5..fdb51df9e 100644 --- a/test/e2e/tests/gas-api-fallback.spec.js +++ b/test/e2e/tests/network-error.spec.js @@ -10,8 +10,34 @@ describe('Gas API fallback', function () { ) .thenCallback(() => { return { - statusCode: 500, - json: {}, + statusCode: 200, + json: { + low: { + minWaitTimeEstimate: 180000, + maxWaitTimeEstimate: 300000, + suggestedMaxPriorityFeePerGas: '3', + suggestedMaxFeePerGas: '53', + }, + medium: { + minWaitTimeEstimate: 15000, + maxWaitTimeEstimate: 60000, + suggestedMaxPriorityFeePerGas: '7', + suggestedMaxFeePerGas: '70', + }, + high: { + minWaitTimeEstimate: 0, + maxWaitTimeEstimate: 15000, + suggestedMaxPriorityFeePerGas: '10', + suggestedMaxFeePerGas: '100', + }, + estimatedBaseFee: '50', + networkCongestion: 0.9, + latestPriorityFeeRange: ['1', '20'], + historicalPriorityFeeRange: ['2', '125'], + historicalBaseFeeRange: ['50', '100'], + priorityFeeTrend: 'up', + baseFeeTrend: 'down', + }, }; }); } @@ -27,7 +53,7 @@ describe('Gas API fallback', function () { ], }; - it('error message is displayed but gas recommendation is not displayed', async function () { + it('network error message is displayed if network is congested', async function () { await withFixtures( { fixtures: new FixtureBuilder().build(), @@ -51,19 +77,12 @@ describe('Gas API fallback', function () { await inputAmount.fill('1'); await driver.clickElement({ text: 'Next', tag: 'button' }); - await driver.clickElement({ text: 'Edit', tag: 'button' }); - const error = await driver.isElementPresent('.error-message__text'); - const gasRecommendation = await driver.isElementPresent( - '[data-testid="gas-recommendation"]', - ); + const error = await driver.isElementPresent({ + text: 'Network is busy. Gas prices are high and estimates are less accurate.', + }); - assert.equal(error, true, 'Error message is not displayed'); - assert.equal( - gasRecommendation, - false, - 'Gas recommendation is displayed', - ); + assert.equal(error, true, 'Network error is present'); }, ); }); diff --git a/test/e2e/tests/send-edit.spec.js b/test/e2e/tests/send-edit.spec.js index bd3c7120d..6157f2e66 100644 --- a/test/e2e/tests/send-edit.spec.js +++ b/test/e2e/tests/send-edit.spec.js @@ -96,9 +96,6 @@ describe('Editing Confirm Transaction', function () { await withFixtures( { fixtures: new FixtureBuilder() - .withPreferencesController({ - eip1559V2Enabled: true, - }) .withTransactionControllerTypeTwoTransaction() .build(), ganacheOptions, diff --git a/test/e2e/tests/send-eth.spec.js b/test/e2e/tests/send-eth.spec.js index fe5204cff..6ef95e455 100644 --- a/test/e2e/tests/send-eth.spec.js +++ b/test/e2e/tests/send-eth.spec.js @@ -1,5 +1,5 @@ const { strict: assert } = require('assert'); -const { convertToHexValue, withFixtures } = require('../helpers'); +const { convertToHexValue, withFixtures, tinyDelayMs } = require('../helpers'); const FixtureBuilder = require('../fixture-builder'); describe('Send ETH from inside MetaMask using default gas', function () { @@ -218,7 +218,7 @@ describe('Send ETH from dapp using advanced gas controls', function () { ], }; - it('should display the correct gas price on the transaction', async function () { + it('should display the correct gas price on the legacy transaction', async function () { await withFixtures( { dapp: true, @@ -246,7 +246,6 @@ describe('Send ETH from dapp using advanced gas controls', function () { await driver.assertElementNotPresent({ text: 'Data', tag: 'li' }); await driver.clickElement({ text: 'Edit', tag: 'button' }); await driver.waitForSelector({ - css: '.transaction-total-banner', text: '0.00021 ETH', }); await driver.clickElement({ @@ -254,14 +253,12 @@ describe('Send ETH from dapp using advanced gas controls', function () { tag: 'button', }); await driver.waitForSelector({ - css: '.transaction-total-banner', text: '0.00021 ETH', }); const inputs = await driver.findElements('input[type="number"]'); const gasPriceInput = inputs[1]; await gasPriceInput.fill('100'); await driver.waitForSelector({ - css: '.transaction-total-banner', text: '0.0021 ETH', }); await driver.clickElement({ text: 'Save', tag: 'button' }); @@ -297,4 +294,73 @@ describe('Send ETH from dapp using advanced gas controls', function () { }, ); }); + + it('should display correct gas values for EIP-1559 transaction', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPermissionControllerConnectedToTestDapp() + .withNetworkSupportEIP1559() + .build(), + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // initiates a transaction from the dapp + await driver.openNewPage('http://127.0.0.1:8080/'); + await driver.clickElement({ text: 'Create Token', tag: 'button' }); + await driver.waitUntilXWindowHandles(3); + const windowHandles = await driver.getAllWindowHandles(); + const extension = windowHandles[0]; + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.assertElementNotPresent({ text: 'Data', tag: 'li' }); + await driver.clickElement('[data-testid="edit-gas-fee-button"]'); + await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]'); + + const baseFeeInput = await driver.findElement( + '[data-testid="base-fee-input"]', + ); + await baseFeeInput.fill('25'); + const priorityFeeInput = await driver.findElement( + '[data-testid="priority-fee-input"]', + ); + await priorityFeeInput.fill('1'); + + await driver.clickElement({ text: 'Save', tag: 'button' }); + await driver.delay(tinyDelayMs); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + + // finds the transaction in the transactions list + await driver.clickElement('[data-testid="home__activity-tab"]'); + await driver.waitForSelector( + '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)', + { timeout: 10000 }, + ); + await driver.waitForSelector({ + css: '.transaction-list-item__primary-currency', + text: '-0 ETH', + }); + + // the transaction has the expected gas value + const txValue = await driver.findClickableElement( + '.transaction-list-item__primary-currency', + ); + await txValue.click(); + const baseFeeValue = await driver.waitForSelector({ + text: '0.000000025', + }); + assert.equal(await baseFeeValue.getText(), '0.000000025'); + }, + ); + }); }); diff --git a/test/e2e/tests/settings-search.spec.js b/test/e2e/tests/settings-search.spec.js index b4c3ab278..52c00dfaf 100644 --- a/test/e2e/tests/settings-search.spec.js +++ b/test/e2e/tests/settings-search.spec.js @@ -19,7 +19,7 @@ describe('Settings Search', function () { security: 'Reveal Secret', alerts: 'Browsing a website', networks: 'Ethereum Mainnet', - experimental: 'Enable Enhanced Gas Fee UI', + experimental: 'Transaction security check', about: 'Terms of Use', }; diff --git a/ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js b/ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js index f045c33af..547d0dced 100644 --- a/ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js +++ b/ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js @@ -4,36 +4,19 @@ import { useSelector } from 'react-redux'; import { I18nContext } from '../../../contexts/i18n'; import FormField from '../../ui/form-field'; -import { GAS_ESTIMATE_TYPES } from '../../../../shared/constants/gas'; import { getGasFormErrorText } from '../../../helpers/constants/gas'; -import { getIsGasEstimatesLoading } from '../../../ducks/metamask/metamask'; import { getNetworkSupportsSettingGasFees } from '../../../selectors'; export default function AdvancedGasControls({ - gasEstimateType, - maxPriorityFee, - maxFee, - setMaxPriorityFee, - setMaxFee, onManualChange, gasLimit, setGasLimit, gasPrice, setGasPrice, - maxPriorityFeeFiat, - maxFeeFiat, gasErrors, minimumGasLimit, - supportsEIP1559, }) { const t = useContext(I18nContext); - const isGasEstimatesLoading = useSelector(getIsGasEstimatesLoading); - - const showFeeMarketFields = - supportsEIP1559 && - (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET || - gasEstimateType === GAS_ESTIMATE_TYPES.ETH_GASPRICE || - isGasEstimatesLoading); const networkSupportsSettingGasFees = useSelector( getNetworkSupportsSettingGasFees, @@ -58,85 +41,36 @@ export default function AdvancedGasControls({ disabled={!networkSupportsSettingGasFees} numeric /> - {showFeeMarketFields ? ( - <> - { - onManualChange?.(); - setMaxPriorityFee(value); - }} - value={maxPriorityFee} - detailText={maxPriorityFeeFiat} - numeric - allowDecimals - error={ - gasErrors?.maxPriorityFee - ? getGasFormErrorText(gasErrors.maxPriorityFee, t) - : null - } - /> - { - onManualChange?.(); - setMaxFee(value); - }} - value={maxFee} - numeric - allowDecimals - detailText={maxFeeFiat} - error={ - gasErrors?.maxFee - ? getGasFormErrorText(gasErrors.maxFee, t) - : null - } - /> - - ) : ( - <> - { - onManualChange?.(); - setGasPrice(value); - }} - tooltipText={t('editGasPriceTooltip')} - value={gasPrice} - numeric - allowDecimals - error={ - gasErrors?.gasPrice - ? getGasFormErrorText(gasErrors.gasPrice, t) - : null - } - disabled={!networkSupportsSettingGasFees} - /> - - )} + <> + { + onManualChange?.(); + setGasPrice(value); + }} + tooltipText={t('editGasPriceTooltip')} + value={gasPrice} + numeric + allowDecimals + error={ + gasErrors?.gasPrice + ? getGasFormErrorText(gasErrors.gasPrice, t) + : null + } + disabled={!networkSupportsSettingGasFees} + /> + ); } AdvancedGasControls.propTypes = { - gasEstimateType: PropTypes.oneOf(Object.values(GAS_ESTIMATE_TYPES)), - setMaxPriorityFee: PropTypes.func, - setMaxFee: PropTypes.func, - maxPriorityFee: PropTypes.string, - maxFee: PropTypes.string, onManualChange: PropTypes.func, gasLimit: PropTypes.number, setGasLimit: PropTypes.func, gasPrice: PropTypes.string, setGasPrice: PropTypes.func, - maxPriorityFeeFiat: PropTypes.string, - maxFeeFiat: PropTypes.string, - gasErrors: PropTypes.object, minimumGasLimit: PropTypes.string, - supportsEIP1559: PropTypes.bool, + gasErrors: PropTypes.object, }; diff --git a/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js b/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js index 7ca1ae6aa..bd6007774 100644 --- a/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js +++ b/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js @@ -1,7 +1,6 @@ import React from 'react'; import configureMockStore from 'redux-mock-store'; -import { GAS_ESTIMATE_TYPES } from '../../../../shared/constants/gas'; import { renderWithProvider } from '../../../../test/jest/rendering'; import AdvancedGasControls from './advanced-gas-controls.component'; @@ -20,22 +19,9 @@ describe('AdvancedGasControls Component', () => { }).not.toThrow(); }); - it('should not render maxFee and maxPriorityFee inputs if supportsEIP1559 is false', () => { - const { queryByText } = renderComponent({ supportsEIP1559: false }); + it('should render gasLimit and gasPrice inputs', () => { + const { queryByText } = renderComponent(); expect(queryByText('Gas limit')).toBeInTheDocument(); expect(queryByText('Gas price')).toBeInTheDocument(); - expect(queryByText('Max fee')).not.toBeInTheDocument(); - expect(queryByText('Max priority fee')).not.toBeInTheDocument(); - }); - - it('should render maxFee and maxPriorityFee inputs if supportsEIP1559 is true', () => { - const { queryByText } = renderComponent({ - gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, - supportsEIP1559: true, - }); - expect(queryByText('Gas price')).not.toBeInTheDocument(); - expect(queryByText('Gas limit')).toBeInTheDocument(); - expect(queryByText('Max fee')).toBeInTheDocument(); - expect(queryByText('Max priority fee')).toBeInTheDocument(); }); }); diff --git a/ui/components/app/app-components.scss b/ui/components/app/app-components.scss index f22a31e70..47289aa8a 100644 --- a/ui/components/app/app-components.scss +++ b/ui/components/app/app-components.scss @@ -13,7 +13,6 @@ @import 'cancel-speedup-popover/index'; @import 'confirm-page-container/index'; @import 'confirmation-warning-modal/index'; -@import 'confirm-page-container/enableEIP1559V2-notice'; @import 'collectibles-items/index'; @import 'collectibles-tab/index'; @import 'collectible-details/index'; @@ -28,7 +27,6 @@ @import 'custom-spending-cap/index'; @import 'deposit-popover/index'; @import 'edit-gas-display/index'; -@import 'edit-gas-display-education/index'; @import 'edit-gas-fee-button/index'; @import 'edit-gas-fee-popover/index'; @import 'edit-gas-fee-popover/edit-gas-item/index'; @@ -82,7 +80,6 @@ @import 'transaction-list-item/index'; @import 'transaction-list/index'; @import 'transaction-status/index'; -@import 'transaction-total-banner/index'; @import 'wallet-overview/index'; @import 'whats-new-popup/index'; @import 'loading-network-screen/index'; diff --git a/ui/components/app/approve-content-card/approve-content-card.js b/ui/components/app/approve-content-card/approve-content-card.js index 2e821eaa0..539ee0574 100644 --- a/ui/components/app/approve-content-card/approve-content-card.js +++ b/ui/components/app/approve-content-card/approve-content-card.js @@ -30,7 +30,7 @@ export default function ApproveContentCard({ onEditClick, footer, noBorder, - supportsEIP1559V2, + supportsEIP1559, renderTransactionDetailsContent, renderDataContent, isMultiLayerFeeNetwork, @@ -61,7 +61,7 @@ export default function ApproveContentCard({ justifyContent={JUSTIFY_CONTENT.FLEX_END} className="approve-content-card-container__card-header" > - {supportsEIP1559V2 && title === t('transactionFee') ? null : ( + {supportsEIP1559 && title === t('transactionFee') ? null : ( <> {symbol} @@ -79,7 +79,7 @@ export default function ApproveContentCard({ )} - {showEdit && (!showAdvanceGasFeeOptions || !supportsEIP1559V2) && ( + {showEdit && (!showAdvanceGasFeeOptions || !supportsEIP1559) && ( - - - - - - - {t('enableEIP1559V2Header')} - - - {t('enableEIP1559V2AlertMessage')} - - - - - - - ); -} diff --git a/ui/components/app/confirm-page-container/enableEIP1559V2-notice/index.js b/ui/components/app/confirm-page-container/enableEIP1559V2-notice/index.js deleted file mode 100644 index c616b7286..000000000 --- a/ui/components/app/confirm-page-container/enableEIP1559V2-notice/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './enableEIP1559V2-notice'; diff --git a/ui/components/app/confirm-page-container/enableEIP1559V2-notice/index.scss b/ui/components/app/confirm-page-container/enableEIP1559V2-notice/index.scss deleted file mode 100644 index b1ab95cec..000000000 --- a/ui/components/app/confirm-page-container/enableEIP1559V2-notice/index.scss +++ /dev/null @@ -1,16 +0,0 @@ -.enableEIP1559V2-notice { - position: relative; - - &__close-button { - background-color: transparent; - position: absolute; - right: 12px; - top: 12px; - padding: 0; - - &__icon { - color: var(--color-icon-default); - font-size: $font-size-paragraph; - } - } -} diff --git a/ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js b/ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js deleted file mode 100644 index 2287f07e9..000000000 --- a/ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js +++ /dev/null @@ -1,68 +0,0 @@ -import React, { useContext } from 'react'; - -import Typography from '../../ui/typography/typography'; -import { - COLORS, - TYPOGRAPHY, - FONT_WEIGHT, -} from '../../../helpers/constants/design-system'; - -import { I18nContext } from '../../../contexts/i18n'; - -export default function EditGasDisplayEducation() { - const t = useContext(I18nContext); - - return ( -
- - {t('editGasEducationModalIntro')} - - - {t('editGasHigh')} - - - {t('editGasEducationHighExplanation')} - - - {t('editGasMedium')} - - - {t('editGasEducationMediumExplanation')} - - - {t('editGasLow')} - - - {t('editGasEducationLowExplanation')} - -
- ); -} diff --git a/ui/components/app/edit-gas-display-education/edit-gas-display-education.stories.js b/ui/components/app/edit-gas-display-education/edit-gas-display-education.stories.js deleted file mode 100644 index 04ee10fbb..000000000 --- a/ui/components/app/edit-gas-display-education/edit-gas-display-education.stories.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import EditGasDisplayEducation from '.'; - -export default { - title: 'Components/App/EditGasDisplayEducation', - id: __filename, -}; - -export const DefaultStory = () => { - return ( -
- -
- ); -}; - -DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/edit-gas-display-education/index.js b/ui/components/app/edit-gas-display-education/index.js deleted file mode 100644 index dec57af8b..000000000 --- a/ui/components/app/edit-gas-display-education/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './edit-gas-display-education.component'; diff --git a/ui/components/app/edit-gas-display-education/index.scss b/ui/components/app/edit-gas-display-education/index.scss deleted file mode 100644 index c37683182..000000000 --- a/ui/components/app/edit-gas-display-education/index.scss +++ /dev/null @@ -1,5 +0,0 @@ -.edit-gas-display-education { - a { - color: var(--color-primary-default); - } -} diff --git a/ui/components/app/edit-gas-display/edit-gas-display.component.js b/ui/components/app/edit-gas-display/edit-gas-display.component.js index 298820f30..4be1bd4e1 100644 --- a/ui/components/app/edit-gas-display/edit-gas-display.component.js +++ b/ui/components/app/edit-gas-display/edit-gas-display.component.js @@ -1,104 +1,47 @@ -import React, { useContext, useLayoutEffect, useRef, useState } from 'react'; -import { useSelector } from 'react-redux'; +import React, { useContext, useRef } from 'react'; import PropTypes from 'prop-types'; import BigNumber from 'bignumber.js'; -import { - GAS_RECOMMENDATIONS, - EDIT_GAS_MODES, - GAS_ESTIMATE_TYPES, - CUSTOM_GAS_ESTIMATE, -} from '../../../../shared/constants/gas'; -import { EVENT } from '../../../../shared/constants/metametrics'; +import { EDIT_GAS_MODES } from '../../../../shared/constants/gas'; import Button from '../../ui/button'; import Typography from '../../ui/typography/typography'; -import { - getIsMainnet, - checkNetworkAndAccountSupports1559, - getAdvancedInlineGasShown, -} from '../../../selectors'; import { COLORS, + TEXT_ALIGN, TYPOGRAPHY, FONT_WEIGHT, } from '../../../helpers/constants/design-system'; import { areDappSuggestedAndTxParamGasFeesTheSame } from '../../../helpers/utils/confirm-tx.util'; -import { isLegacyTransaction } from '../../../helpers/utils/transactions.util'; import InfoTooltip from '../../ui/info-tooltip'; import ErrorMessage from '../../ui/error-message'; -import TransactionTotalBanner from '../transaction-total-banner/transaction-total-banner.component'; -import RadioGroup from '../../ui/radio-group/radio-group.component'; import AdvancedGasControls from '../advanced-gas-controls/advanced-gas-controls.component'; import ActionableMessage from '../../ui/actionable-message/actionable-message'; import { I18nContext } from '../../../contexts/i18n'; -import GasTiming from '../gas-timing'; -import { MetaMetricsContext } from '../../../contexts/metametrics'; export default function EditGasDisplay({ mode = EDIT_GAS_MODES.MODIFY_IN_PLACE, - showEducationButton = false, - onEducationClick, - transaction, - defaultEstimateToUse, - maxPriorityFeePerGas, - setMaxPriorityFeePerGas, - maxPriorityFeePerGasFiat, - maxFeePerGas, - setMaxFeePerGas, - maxFeePerGasFiat, - estimatedMaximumNative, estimatedMinimumNative, - isGasEstimatesLoading, - gasEstimateType, + transaction, gasPrice, setGasPrice, gasLimit, setGasLimit, properGasLimit, - estimateToUse, - setEstimateToUse, - estimatedMinimumFiat, - estimatedMaximumFiat, dappSuggestedGasFeeAcknowledged, setDappSuggestedGasFeeAcknowledged, - gasErrors, - gasWarnings, onManualChange, minimumGasLimit, balanceError, - estimatesUnavailableWarning, - hasGasErrors, + gasErrors, txParamsHaveBeenCustomized, - isNetworkBusy, }) { const t = useContext(I18nContext); const scrollRef = useRef(null); - const isMainnet = useSelector(getIsMainnet); - const supportsEIP1559 = - useSelector(checkNetworkAndAccountSupports1559) && - !isLegacyTransaction(transaction?.txParams); - const showAdvancedInlineGasIfPossible = useSelector( - getAdvancedInlineGasShown, - ); - - const [showAdvancedForm, setShowAdvancedForm] = useState( - !estimateToUse || estimateToUse === CUSTOM_GAS_ESTIMATE || !supportsEIP1559, - ); - const [hideRadioButtons, setHideRadioButtons] = useState( - showAdvancedInlineGasIfPossible, - ); - - useLayoutEffect(() => { - if (showAdvancedForm && scrollRef.current) { - scrollRef.current.scrollIntoView?.(); - } - }, [showAdvancedForm]); - const dappSuggestedAndTxParamGasFeesAreTheSame = areDappSuggestedAndTxParamGasFeesTheSame(transaction); @@ -117,22 +60,13 @@ export default function EditGasDisplay({ warningMessage = t('gasLimitRecommended', [properGasLimit]); } - const showTopError = - (balanceError || estimatesUnavailableWarning) && - (!isGasEstimatesLoading || txParamsHaveBeenCustomized); - const radioButtonsEnabled = - supportsEIP1559 && - gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET && - !requireDappAcknowledgement; + const showTopError = balanceError && txParamsHaveBeenCustomized; let errorKey; if (balanceError) { errorKey = 'insufficientFunds'; - } else if (estimatesUnavailableWarning) { - errorKey = 'gasEstimatesUnavailableWarning'; } - const trackEvent = useContext(MetaMetricsContext); return (
@@ -151,7 +85,7 @@ export default function EditGasDisplay({ />
)} - {requireDappAcknowledgement && !isGasEstimatesLoading && ( + {requireDappAcknowledgement && (
)} - {isNetworkBusy ? ( -
- -
- ) : null} {mode === EDIT_GAS_MODES.SPEED_UP && (
)} - - - {t('editGasSubTextFeeLabel')} - - - {estimatedMaximumFiat} - - - {`(${estimatedMaximumNative})`} - - - ) - } - timing={ - hasGasErrors === false && - supportsEIP1559 && ( - - ) - } - /> + + {estimatedMinimumNative} + {requireDappAcknowledgement && ( - )} - {radioButtonsEnabled && !hideRadioButtons && ( - )} - {!requireDappAcknowledgement && - radioButtonsEnabled && - !showAdvancedInlineGasIfPossible && ( - - )} - {!requireDappAcknowledgement && - (showAdvancedForm || - hasGasErrors || - estimatesUnavailableWarning || - showAdvancedInlineGasIfPossible) && ( - - )}
- {supportsEIP1559 && !requireDappAcknowledgement && showEducationButton && ( -
- -
- )}
); @@ -332,38 +144,18 @@ export default function EditGasDisplay({ EditGasDisplay.propTypes = { mode: PropTypes.oneOf(Object.values(EDIT_GAS_MODES)), - showEducationButton: PropTypes.bool, - onEducationClick: PropTypes.func, - defaultEstimateToUse: PropTypes.oneOf(Object.values(GAS_RECOMMENDATIONS)), - maxPriorityFeePerGas: PropTypes.string, - setMaxPriorityFeePerGas: PropTypes.func, - maxPriorityFeePerGasFiat: PropTypes.string, - maxFeePerGas: PropTypes.string, - setMaxFeePerGas: PropTypes.func, - maxFeePerGasFiat: PropTypes.string, - estimatedMaximumNative: PropTypes.string, estimatedMinimumNative: PropTypes.string, - isGasEstimatesLoading: PropTypes.bool, - gasEstimateType: PropTypes.string, gasPrice: PropTypes.string, setGasPrice: PropTypes.func, gasLimit: PropTypes.number, setGasLimit: PropTypes.func, properGasLimit: PropTypes.number, - estimateToUse: PropTypes.string, - setEstimateToUse: PropTypes.func, - estimatedMinimumFiat: PropTypes.string, - estimatedMaximumFiat: PropTypes.string, dappSuggestedGasFeeAcknowledged: PropTypes.bool, setDappSuggestedGasFeeAcknowledged: PropTypes.func, transaction: PropTypes.object, - gasErrors: PropTypes.object, - gasWarnings: PropTypes.object, onManualChange: PropTypes.func, minimumGasLimit: PropTypes.string, balanceError: PropTypes.bool, - estimatesUnavailableWarning: PropTypes.bool, - hasGasErrors: PropTypes.bool, + gasErrors: PropTypes.object, txParamsHaveBeenCustomized: PropTypes.bool, - isNetworkBusy: PropTypes.bool, }; diff --git a/ui/components/app/edit-gas-display/edit-gas-display.stories.js b/ui/components/app/edit-gas-display/edit-gas-display.stories.js index 89ef4174b..dabd79455 100644 --- a/ui/components/app/edit-gas-display/edit-gas-display.stories.js +++ b/ui/components/app/edit-gas-display/edit-gas-display.stories.js @@ -18,23 +18,3 @@ export const DefaultStory = (args) => { }; DefaultStory.storyName = 'Default'; - -export const WithEducation = (args) => { - return ( -
- -
- ); -}; - -export const WithDappSuggestedGas = (args) => { - return ( -
- -
- ); -}; diff --git a/ui/components/app/edit-gas-display/edit-gas-display.test.js b/ui/components/app/edit-gas-display/edit-gas-display.test.js index b85e0d3fd..22591f03f 100644 --- a/ui/components/app/edit-gas-display/edit-gas-display.test.js +++ b/ui/components/app/edit-gas-display/edit-gas-display.test.js @@ -1,5 +1,4 @@ import React from 'react'; -import { screen } from '@testing-library/react'; import { renderWithProvider } from '../../../../test/jest'; import configureStore from '../../../store/store'; import EditGasDisplay from '.'; @@ -14,25 +13,7 @@ function render({ componentProps = {} } = {}) { } describe('EditGasDisplay', () => { - describe('if getIsNetworkBusy returns a truthy value', () => { - it('informs the user', () => { - render({ componentProps: { isNetworkBusy: true } }); - expect( - screen.getByText( - 'Network is busy. Gas prices are high and estimates are less accurate.', - ), - ).toBeInTheDocument(); - }); - }); - - describe('if getIsNetworkBusy does not return a truthy value', () => { - it('does not inform the user', () => { - render({ componentProps: { isNetworkBusy: false } }); - expect( - screen.queryByText( - 'Network is busy. Gas prices are high and estimates are less accurate.', - ), - ).not.toBeInTheDocument(); - }); + it('if render correctly', () => { + expect(render).not.toThrow(); }); }); diff --git a/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js b/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js index d872a2895..5a2298bae 100644 --- a/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js +++ b/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js @@ -23,7 +23,7 @@ export default function EditGasFeeButton({ userAcknowledgedGasMissing }) { estimateUsed, maxFeePerGas, maxPriorityFeePerGas, - supportsEIP1559V2, + supportsEIP1559, transaction, } = useGasFeeContext(); const { updateTransactionEventFragment } = useTransactionEventFragment(); @@ -31,7 +31,7 @@ export default function EditGasFeeButton({ userAcknowledgedGasMissing }) { const editEnabled = !hasSimulationError || userAcknowledgedGasMissing === true; - if (!supportsEIP1559V2 || !estimateUsed || !editEnabled) { + if (!supportsEIP1559 || !estimateUsed || !editEnabled) { return null; } diff --git a/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.test.js b/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.test.js index 696fd7d6a..e49cc8a1b 100644 --- a/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.test.js +++ b/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.test.js @@ -36,7 +36,6 @@ const render = ({ componentProps, contextProps } = {}) => { }, }, gasFeeEstimates: mockEstimates[GAS_ESTIMATE_TYPES.FEE_MARKET], - eip1559V2Enabled: true, }, }); diff --git a/ui/components/app/edit-gas-popover/edit-gas-popover.component.js b/ui/components/app/edit-gas-popover/edit-gas-popover.component.js index 92cdd1b82..9b29ed991 100644 --- a/ui/components/app/edit-gas-popover/edit-gas-popover.component.js +++ b/ui/components/app/edit-gas-popover/edit-gas-popover.component.js @@ -1,14 +1,13 @@ import React, { useCallback, useContext, useState } from 'react'; import PropTypes from 'prop-types'; -import { useDispatch, useSelector } from 'react-redux'; +import { useDispatch } from 'react-redux'; import { useGasFeeInputs } from '../../../hooks/gasFeeInput/useGasFeeInputs'; -import { getGasLoadingAnimationIsShowing } from '../../../ducks/app/app'; import { txParamsAreDappSuggested } from '../../../../shared/modules/transaction.utils'; import { EDIT_GAS_MODES, GAS_LIMITS, - GAS_RECOMMENDATIONS, CUSTOM_GAS_ESTIMATE, + GAS_RECOMMENDATIONS, } from '../../../../shared/constants/gas'; import { decGWEIToHexWEI } from '../../../helpers/utils/conversions.util'; @@ -16,7 +15,6 @@ import { decGWEIToHexWEI } from '../../../helpers/utils/conversions.util'; import Popover from '../../ui/popover'; import Button from '../../ui/button'; import EditGasDisplay from '../edit-gas-display'; -import EditGasDisplayEducation from '../edit-gas-display-education'; import { I18nContext } from '../../../contexts/i18n'; import { @@ -24,15 +22,11 @@ import { createSpeedUpTransaction, hideModal, updateTransactionGasFees, - updateCustomSwapsEIP1559GasParams, - updateSwapsUserFeeLevel, hideLoadingIndication, showLoadingIndication, } from '../../../store/actions'; import LoadingHeartBeat from '../../ui/loading-heartbeat'; -import { checkNetworkAndAccountSupports1559 } from '../../../selectors'; import { useIncrementedGasFees } from '../../../hooks/useIncrementedGasFees'; -import { isLegacyTransaction } from '../../../helpers/utils/transactions.util'; import { hexToDecimal } from '../../../../shared/lib/metamask-controller-utils'; import { decimalToHex } from '../../../../shared/lib/transactions-controller-utils'; @@ -40,7 +34,6 @@ export default function EditGasPopover({ popoverTitle = '', confirmButtonText = '', editGasDisplayProps = {}, - defaultEstimateToUse = GAS_RECOMMENDATIONS.MEDIUM, transaction, mode, onClose, @@ -48,18 +41,6 @@ export default function EditGasPopover({ }) { const t = useContext(I18nContext); const dispatch = useDispatch(); - const supportsEIP1559 = - useSelector(checkNetworkAndAccountSupports1559) && - !isLegacyTransaction(transaction?.txParams); - const gasLoadingAnimationIsShowing = useSelector( - getGasLoadingAnimationIsShowing, - ); - - const showEducationButton = - (mode === EDIT_GAS_MODES.MODIFY_IN_PLACE || - mode === EDIT_GAS_MODES.SWAPS) && - supportsEIP1559; - const [showEducationContent, setShowEducationContent] = useState(false); const [dappSuggestedGasFeeAcknowledged, setDappSuggestedGasFeeAcknowledged] = useState(false); @@ -80,35 +61,19 @@ export default function EditGasPopover({ } const { - maxPriorityFeePerGas, - setMaxPriorityFeePerGas, - maxPriorityFeePerGasFiat, - maxFeePerGas, - setMaxFeePerGas, - maxFeePerGasFiat, - estimatedMaximumNative, estimatedMinimumNative, - isGasEstimatesLoading, - gasEstimateType, gasPrice, setGasPrice, gasLimit, setGasLimit, properGasLimit, estimateToUse, - setEstimateToUse, - estimatedMinimumFiat, - estimatedMaximumFiat, hasGasErrors, gasErrors, - gasWarnings, onManualChange, balanceError, - estimatesUnavailableWarning, - estimatedBaseFee, - isNetworkBusy, } = useGasFeeInputs( - defaultEstimateToUse, + GAS_RECOMMENDATIONS.MEDIUM, updatedTransaction, minimumGasLimit, mode, @@ -140,25 +105,12 @@ export default function EditGasPopover({ const newGasSettings = { gas: decimalToHex(gasLimit), gasLimit: decimalToHex(gasLimit), - estimateSuggested: defaultEstimateToUse, estimateUsed: estimateToUse, + gasPrice: decGWEIToHexWEI(gasPrice), }; - if (supportsEIP1559) { - newGasSettings.maxFeePerGas = decGWEIToHexWEI(maxFeePerGas ?? gasPrice); - newGasSettings.maxPriorityFeePerGas = decGWEIToHexWEI( - maxPriorityFeePerGas ?? maxFeePerGas ?? gasPrice, - ); - } else { - newGasSettings.gasPrice = decGWEIToHexWEI(gasPrice); - } - const cleanTransactionParams = { ...updatedTransaction.txParams }; - if (supportsEIP1559) { - delete cleanTransactionParams.gasPrice; - } - const updatedTxMeta = { ...updatedTransaction, userEditedGasLimit: gasLimit !== Number(transaction.originalGasEstimate), @@ -172,16 +124,12 @@ export default function EditGasPopover({ switch (mode) { case EDIT_GAS_MODES.CANCEL: dispatch( - createCancelTransaction(updatedTransaction.id, newGasSettings, { - estimatedBaseFee, - }), + createCancelTransaction(updatedTransaction.id, newGasSettings), ); break; case EDIT_GAS_MODES.SPEED_UP: dispatch( - createSpeedUpTransaction(updatedTransaction.id, newGasSettings, { - estimatedBaseFee, - }), + createSpeedUpTransaction(updatedTransaction.id, newGasSettings), ); break; case EDIT_GAS_MODES.MODIFY_IN_PLACE: @@ -194,15 +142,6 @@ export default function EditGasPopover({ ); dispatch(hideLoadingIndication()); break; - case EDIT_GAS_MODES.SWAPS: - // This popover component should only be used for the "FEE_MARKET" type in Swaps. - if (supportsEIP1559) { - dispatch( - updateSwapsUserFeeLevel(estimateToUse || CUSTOM_GAS_ESTIMATE), - ); - dispatch(updateCustomSwapsEIP1559GasParams(newGasSettings)); - } - break; default: break; } @@ -216,19 +155,12 @@ export default function EditGasPopover({ gasLimit, gasPrice, transaction.originalGasEstimate, - maxFeePerGas, - maxPriorityFeePerGas, - supportsEIP1559, estimateToUse, - estimatedBaseFee, - defaultEstimateToUse, ]); let title = t('editGasTitle'); if (popoverTitle) { title = popoverTitle; - } else if (showEducationContent) { - title = t('editGasEducationModalTitle'); } else if (mode === EDIT_GAS_MODES.SPEED_UP) { title = t('speedUpPopoverTitle'); } else if (mode === EDIT_GAS_MODES.CANCEL) { @@ -241,75 +173,38 @@ export default function EditGasPopover({ title={title} onClose={closePopover} className="edit-gas-popover__wrapper" - onBack={ - showEducationContent ? () => setShowEducationContent(false) : undefined - } footer={ - showEducationContent ? null : ( - <> - - - ) + } >
- {showEducationContent ? ( - - ) : ( - <> - {process.env.IN_TEST ? null : } - setShowEducationContent(true)} - mode={mode} - transaction={updatedTransaction} - gasErrors={gasErrors} - gasWarnings={gasWarnings} - onManualChange={onManualChange} - minimumGasLimit={minimumGasLimitDec} - balanceError={balanceError} - estimatesUnavailableWarning={estimatesUnavailableWarning} - hasGasErrors={hasGasErrors} - txParamsHaveBeenCustomized={txParamsHaveBeenCustomized} - isNetworkBusy={isNetworkBusy} - {...editGasDisplayProps} - /> - - )} + {process.env.IN_TEST ? null : } +
); @@ -322,6 +217,5 @@ EditGasPopover.propTypes = { onClose: PropTypes.func, transaction: PropTypes.object, mode: PropTypes.oneOf(Object.values(EDIT_GAS_MODES)), - defaultEstimateToUse: PropTypes.string, minimumGasLimit: PropTypes.string, }; diff --git a/ui/components/app/gas-timing/gas-timing.component.js b/ui/components/app/gas-timing/gas-timing.component.js index 6b10d0def..6eb633f48 100644 --- a/ui/components/app/gas-timing/gas-timing.component.js +++ b/ui/components/app/gas-timing/gas-timing.component.js @@ -8,24 +8,22 @@ import { GAS_ESTIMATE_TYPES } from '../../../../shared/constants/gas'; import { usePrevious } from '../../../hooks/usePrevious'; import { I18nContext } from '../../../contexts/i18n'; +import { useGasFeeContext } from '../../../contexts/gasFee'; import { getGasEstimateType, getGasFeeEstimates, getIsGasEstimatesLoading, } from '../../../ducks/metamask/metamask'; -import { getEIP1559V2Enabled } from '../../../selectors'; import Typography from '../../ui/typography/typography'; import { TYPOGRAPHY, FONT_WEIGHT, } from '../../../helpers/constants/design-system'; -import InfoTooltip from '../../ui/info-tooltip/info-tooltip'; import { getGasFeeTimeEstimate } from '../../../store/actions'; import { GAS_FORM_ERRORS } from '../../../helpers/constants/gas'; -import { useGasFeeContext } from '../../../contexts/gasFee'; // Once we reach this second threshold, we switch to minutes as a unit const SECOND_CUTOFF = 90; @@ -46,11 +44,10 @@ export default function GasTiming({ const gasEstimateType = useSelector(getGasEstimateType); const gasFeeEstimates = useSelector(getGasFeeEstimates); const isGasEstimatesLoading = useSelector(getIsGasEstimatesLoading); - const eip1559V2Enabled = useSelector(getEIP1559V2Enabled); const [customEstimatedTime, setCustomEstimatedTime] = useState(null); const t = useContext(I18nContext); - const { estimateUsed, supportsEIP1559V2 } = useGasFeeContext(); + const { estimateUsed } = useGasFeeContext(); // If the user has chosen a value lower than the low gas fee estimate, // We'll need to use the useEffect hook below to make a call to calculate @@ -96,18 +93,6 @@ export default function GasTiming({ previousIsUnknownLow, ]); - let unknownProcessingTimeText; - if (supportsEIP1559V2) { - unknownProcessingTimeText = t('editGasTooLow'); - } else { - unknownProcessingTimeText = ( - <> - {t('editGasTooLow')}{' '} - - - ); - } - if ( gasWarnings?.maxPriorityFee === GAS_FORM_ERRORS.MAX_PRIORITY_FEE_TOO_LOW || gasWarnings?.maxFee === GAS_FORM_ERRORS.MAX_FEE_TOO_LOW @@ -118,7 +103,7 @@ export default function GasTiming({ fontWeight={FONT_WEIGHT.BOLD} className={classNames('gas-timing', 'gas-timing--negative')} > - {unknownProcessingTimeText} + {t('editGasTooLow')} ); } @@ -155,7 +140,7 @@ export default function GasTiming({ ]); } } else { - if (!supportsEIP1559V2 || estimateUsed === 'low') { + if (estimateUsed === 'low') { attitude = 'negative'; } // If the user has chosen a value less than our low estimate, @@ -168,28 +153,16 @@ export default function GasTiming({ customEstimatedTime === 'unknown' || customEstimatedTime?.upperTimeBound === 'unknown' ) { - text = unknownProcessingTimeText; + text = t('editGasTooLow'); } else { text = t('gasTimingNegative', [ toHumanReadableTime(Number(customEstimatedTime?.upperTimeBound), t), ]); } - } else if (supportsEIP1559V2) { + } else { text = t('gasTimingNegative', [ toHumanReadableTime(low.maxWaitTimeEstimate, t), ]); - } else { - text = ( - <> - {t('gasTimingNegative', [ - toHumanReadableTime(low.maxWaitTimeEstimate, t), - ])} - - - ); } } @@ -197,10 +170,7 @@ export default function GasTiming({ {text} diff --git a/ui/components/app/gas-timing/index.scss b/ui/components/app/gas-timing/index.scss index 00d6c024d..4845fe3e2 100644 --- a/ui/components/app/gas-timing/index.scss +++ b/ui/components/app/gas-timing/index.scss @@ -3,10 +3,6 @@ &--positive { color: var(--color-success-default); - } - - &--positive-V2 { - color: var(--color-success-default); font-weight: bold; } @@ -15,11 +11,6 @@ } &--negative { - color: var(--color-error-default); - font-weight: bold; - } - - &--negative-V2 { color: var(--color-warning-default); font-weight: bold; } diff --git a/ui/components/app/transaction-detail/transaction-detail.component.js b/ui/components/app/transaction-detail/transaction-detail.component.js index bb17e72ae..937598834 100644 --- a/ui/components/app/transaction-detail/transaction-detail.component.js +++ b/ui/components/app/transaction-detail/transaction-detail.component.js @@ -15,18 +15,18 @@ export default function TransactionDetail({ disableEditGasFeeButton = false, }) { const t = useI18nContext(); - const { supportsEIP1559V2 } = useGasFeeContext(); + const { supportsEIP1559 } = useGasFeeContext(); return (
- {supportsEIP1559V2 && !disableEditGasFeeButton && ( + {supportsEIP1559 && !disableEditGasFeeButton && ( )} - {!supportsEIP1559V2 && onEdit && ( + {!supportsEIP1559 && onEdit && (
diff --git a/ui/components/app/transaction-detail/transaction-detail.component.test.js b/ui/components/app/transaction-detail/transaction-detail.component.test.js index 958e0e9d2..9a274e516 100644 --- a/ui/components/app/transaction-detail/transaction-detail.component.test.js +++ b/ui/components/app/transaction-detail/transaction-detail.component.test.js @@ -32,7 +32,6 @@ const render = ({ componentProps, contextProps } = {}) => { }, }, gasFeeEstimates: mockEstimates[GAS_ESTIMATE_TYPES.FEE_MARKET], - eip1559V2Enabled: true, }, }); diff --git a/ui/components/app/transaction-list-item/transaction-list-item.component.js b/ui/components/app/transaction-list-item/transaction-list-item.component.js index 3d462c14e..c70f6d565 100644 --- a/ui/components/app/transaction-list-item/transaction-list-item.component.js +++ b/ui/components/app/transaction-list-item/transaction-list-item.component.js @@ -27,10 +27,7 @@ import { TransactionModalContextProvider, useTransactionModalContext, } from '../../../contexts/transaction-modal'; -import { - checkNetworkAndAccountSupports1559, - getEIP1559V2Enabled, -} from '../../../selectors'; +import { checkNetworkAndAccountSupports1559 } from '../../../selectors'; import { isLegacyTransaction } from '../../../helpers/utils/transactions.util'; import Button from '../../ui/button'; import AdvancedGasFeePopover from '../advanced-gas-fee-popover'; @@ -53,7 +50,7 @@ function TransactionListItemInner({ const [showCancelEditGasPopover, setShowCancelEditGasPopover] = useState(false); const [showRetryEditGasPopover, setShowRetryEditGasPopover] = useState(false); - const { supportsEIP1559V2 } = useGasFeeContext(); + const { supportsEIP1559 } = useGasFeeContext(); const { openModal } = useTransactionModalContext(); const { @@ -74,14 +71,14 @@ function TransactionListItemInner({ legacy_event: true, }, }); - if (supportsEIP1559V2) { + if (supportsEIP1559) { setEditGasMode(EDIT_GAS_MODES.SPEED_UP); openModal('cancelSpeedUpTransaction'); } else { setShowRetryEditGasPopover(true); } }, - [openModal, setEditGasMode, trackEvent, supportsEIP1559V2], + [openModal, setEditGasMode, trackEvent, supportsEIP1559], ); const cancelTransaction = useCallback( @@ -95,14 +92,14 @@ function TransactionListItemInner({ legacy_event: true, }, }); - if (supportsEIP1559V2) { + if (supportsEIP1559) { setEditGasMode(EDIT_GAS_MODES.CANCEL); openModal('cancelSpeedUpTransaction'); } else { setShowCancelEditGasPopover(true); } }, - [trackEvent, openModal, setEditGasMode, supportsEIP1559V2], + [trackEvent, openModal, setEditGasMode, supportsEIP1559], ); const shouldShowSpeedUp = useShouldShowSpeedUp( @@ -253,14 +250,14 @@ function TransactionListItemInner({ )} /> )} - {!supportsEIP1559V2 && showRetryEditGasPopover && ( + {!supportsEIP1559 && showRetryEditGasPopover && ( setShowRetryEditGasPopover(false)} mode={EDIT_GAS_MODES.SPEED_UP} transaction={transactionGroup.primaryTransaction} /> )} - {!supportsEIP1559V2 && showCancelEditGasPopover && ( + {!supportsEIP1559 && showCancelEditGasPopover && ( setShowCancelEditGasPopover(false)} mode={EDIT_GAS_MODES.CANCEL} @@ -281,14 +278,11 @@ const TransactionListItem = (props) => { const { transactionGroup } = props; const [editGasMode, setEditGasMode] = useState(); const transaction = transactionGroup.primaryTransaction; - const eip1559V2Enabled = useSelector(getEIP1559V2Enabled); const supportsEIP1559 = useSelector(checkNetworkAndAccountSupports1559) && !isLegacyTransaction(transaction?.txParams); - const supportsEIP1559V2 = eip1559V2Enabled && supportsEIP1559; - return ( { > - {supportsEIP1559V2 && ( + {supportsEIP1559 && ( <> diff --git a/ui/components/app/transaction-total-banner/index.js b/ui/components/app/transaction-total-banner/index.js deleted file mode 100644 index 42ccf75f4..000000000 --- a/ui/components/app/transaction-total-banner/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './transaction-total-banner.component'; diff --git a/ui/components/app/transaction-total-banner/index.scss b/ui/components/app/transaction-total-banner/index.scss deleted file mode 100644 index 1bb2f0674..000000000 --- a/ui/components/app/transaction-total-banner/index.scss +++ /dev/null @@ -1,11 +0,0 @@ -.transaction-total-banner { - text-align: center; - - &__detail { - padding-bottom: 4px; - } - - span { - margin-inline-start: 2px; - } -} diff --git a/ui/components/app/transaction-total-banner/transaction-total-banner.component.js b/ui/components/app/transaction-total-banner/transaction-total-banner.component.js deleted file mode 100644 index 47961f021..000000000 --- a/ui/components/app/transaction-total-banner/transaction-total-banner.component.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -import Typography from '../../ui/typography/typography'; -import { COLORS, TYPOGRAPHY } from '../../../helpers/constants/design-system'; - -export default function TransactionTotalBanner({ - total = '', - detail = '', - timing, -}) { - return ( -
- - {total} - - {detail && ( - - {detail} - - )} - {timing} -
- ); -} - -TransactionTotalBanner.propTypes = { - total: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - detail: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - timing: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), -}; diff --git a/ui/components/app/transaction-total-banner/transaction-total-banner.stories.js b/ui/components/app/transaction-total-banner/transaction-total-banner.stories.js deleted file mode 100644 index eb2159a4d..000000000 --- a/ui/components/app/transaction-total-banner/transaction-total-banner.stories.js +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import TransactionTotalBanner from '.'; - -export default { - title: 'Components/App/TransactionTotalBanner', - id: __filename, -}; - -export const DefaultStory = () => { - return ( - - Up to $19.81 (0.01234 ETH) - - } - timing="Very likely in < 15 seconds" - /> - ); -}; - -DefaultStory.storyName = 'Default'; diff --git a/ui/ducks/metamask/metamask.js b/ui/ducks/metamask/metamask.js index d27b68657..0a8a26501 100644 --- a/ui/ducks/metamask/metamask.js +++ b/ui/ducks/metamask/metamask.js @@ -271,10 +271,6 @@ export function getCollectiblesDropdownState(state) { return state.metamask.collectiblesDropdownState; } -export function getEnableEIP1559V2NoticeDismissed(state) { - return state.metamask.enableEIP1559V2NoticeDismissed; -} - export const getCollectibles = (state) => { const { metamask: { diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index e67e91153..10a838d8a 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -292,13 +292,6 @@ export const SETTINGS_CONSTANTS = [ route: `${ABOUT_US_ROUTE}#beta-terms`, icon: 'fa fa-info-circle', }, - { - tabMessage: (t) => t('experimental'), - sectionMessage: (t) => t('enableEIP1559V2'), - descriptionMessage: (t) => t('enableEIP1559V2Description'), - route: `${EXPERIMENTAL_ROUTE}#enable-advanced-gas`, - icon: 'fa fa-flask', - }, { tabMessage: (t) => t('advanced'), sectionMessage: (t) => t('enhancedTokenDetection'), diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js index 9efe18bc5..c405eda8c 100644 --- a/ui/helpers/utils/settings-search.test.js +++ b/ui/helpers/utils/settings-search.test.js @@ -107,10 +107,6 @@ const t = (key) => { return 'Enhanced token detection'; case 'enhancedTokenDetectionDescription': return "ConsenSys' token API aggregates a list of tokens from various third party token lists. When turned on, tokens will be automatically detected, and searchable, on Ethereum mainnet, Binance, Polygon and Avalanche. When turned off, automatic detection and search can only be done on Ethereum mainnet."; - case 'enableEIP1559V2': - return 'Enable enhanced gas fee UI'; - case 'enableEIP1559V2Description': - return "We've updated how gas estimation and customization works. Turn on if you'd like to use the new gas experience. Learn more"; case 'enableOpenSeaAPI': return 'Enable OpenSea API'; case 'enableOpenSeaAPIDescription': @@ -182,7 +178,7 @@ describe('Settings Search Utils', () => { it('should get good experimental section number', () => { expect(getNumberOfSettingsInSection(t, t('experimental'))).toStrictEqual( - 3, + 2, ); }); diff --git a/ui/hooks/gasFeeInput/test-utils.js b/ui/hooks/gasFeeInput/test-utils.js index 5b365be8f..949600092 100644 --- a/ui/hooks/gasFeeInput/test-utils.js +++ b/ui/hooks/gasFeeInput/test-utils.js @@ -12,7 +12,6 @@ import { import { checkNetworkAndAccountSupports1559, getCurrentCurrency, - getEIP1559V2Enabled, getSelectedAccount, getShouldShowFiat, getPreferences, @@ -100,7 +99,6 @@ export const generateUseSelectorRouter = ({ checkNetworkAndAccountSupports1559Response, shouldShowFiat = true, - eip1559V2Enabled = false, } = {}) => (selector) => { if (selector === getConversionRate) { @@ -141,9 +139,6 @@ export const generateUseSelectorRouter = if (selector === checkNetworkAndAccountSupports1559) { return checkNetworkAndAccountSupports1559Response; } - if (selector === getEIP1559V2Enabled) { - return eip1559V2Enabled; - } if (selector === getCurrentKeyring) { return { type: '' }; } diff --git a/ui/hooks/gasFeeInput/useGasEstimates.js b/ui/hooks/gasFeeInput/useGasEstimates.js index 25317e265..47619ef7a 100644 --- a/ui/hooks/gasFeeInput/useGasEstimates.js +++ b/ui/hooks/gasFeeInput/useGasEstimates.js @@ -9,11 +9,8 @@ import { getMinimumGasTotalInHexWei, } from '../../../shared/modules/gas.utils'; -import { PRIMARY, SECONDARY } from '../../helpers/constants/common'; -import { - checkNetworkAndAccountSupports1559, - getShouldShowFiat, -} from '../../selectors'; +import { PRIMARY } from '../../helpers/constants/common'; +import { checkNetworkAndAccountSupports1559 } from '../../selectors'; import { decGWEIToHexWEI } from '../../helpers/utils/conversions.util'; import { isLegacyTransaction } from '../../helpers/utils/transactions.util'; @@ -23,16 +20,9 @@ import { decimalToHex } from '../../../shared/lib/transactions-controller-utils' /** * @typedef {object} GasEstimatesReturnType - * @property {string} [estimatedMinimumFiat] - The amount estimated to be paid - * based on current network conditions. Expressed in user's preferred currency. - * @property {string} [estimatedMaximumFiat] - the maximum amount estimated to be paid if current - * network transaction volume increases. Expressed in user's preferred currency. - * @property {string} [estimatedMaximumNative] - the maximum amount estimated to be paid if the - * current network transaction volume increases. Expressed in the network's native currency. * @property {string} [estimatedMinimumNative] - the maximum amount estimated to be paid if the * current network transaction volume increases. Expressed in the network's native currency. - * @property {HexWeiString} [estimatedBaseFee] - estimatedBaseFee from fee-market gasFeeEstimates - * in HexWei. + * @property {HexWeiString} [maximumCostInHexWei] - the maximum amount this transaction will cost. * @property {HexWeiString} [minimumCostInHexWei] - the minimum amount this transaction will cost. */ @@ -64,11 +54,6 @@ export function useGasEstimates({ useSelector(checkNetworkAndAccountSupports1559) && !isLegacyTransaction(transaction?.txParams); - const { currency: fiatCurrency, numberOfDecimals: fiatNumberOfDecimals } = - useUserPreferencedCurrency(SECONDARY); - - const showFiat = useSelector(getShouldShowFiat); - const { currency: primaryCurrency, numberOfDecimals: primaryNumberOfDecimals, @@ -91,15 +76,13 @@ export function useGasEstimates({ ), baseFeePerGas: decGWEIToHexWEI(gasFeeEstimates.estimatedBaseFee ?? '0'), }; - } else if (gasEstimateType === GAS_ESTIMATE_TYPES.NONE) { - gasSettings = { - ...gasSettings, - gasPrice: '0x0', - }; } else { gasSettings = { ...gasSettings, - gasPrice: decGWEIToHexWEI(gasPrice), + gasPrice: + gasEstimateType === GAS_ESTIMATE_TYPES.NONE + ? '0x0' + : decGWEIToHexWEI(gasPrice), }; } @@ -113,44 +96,13 @@ export function useGasEstimates({ // The minimum amount this transaction will cost const minimumCostInHexWei = getMinimumGasTotalInHexWei(gasSettings); - // The estimated total amount of native currency that will be expended - // given the selected gas fees. - const [estimatedMaximumNative] = useCurrencyDisplay(maximumCostInHexWei, { - numberOfDecimals: primaryNumberOfDecimals, - currency: primaryCurrency, - }); - - const [, { value: estimatedMaximumFiat }] = useCurrencyDisplay( - maximumCostInHexWei, - { - numberOfDecimals: fiatNumberOfDecimals, - currency: fiatCurrency, - }, - ); - const [estimatedMinimumNative] = useCurrencyDisplay(minimumCostInHexWei, { numberOfDecimals: primaryNumberOfDecimals, currency: primaryCurrency, }); - // We also need to display our closest estimate of the low end of estimation - // in fiat. - const [, { value: estimatedMinimumFiat }] = useCurrencyDisplay( - minimumCostInHexWei, - { - numberOfDecimals: fiatNumberOfDecimals, - currency: fiatCurrency, - }, - ); - return { - estimatedMaximumFiat: showFiat ? estimatedMaximumFiat : '', - estimatedMinimumFiat: showFiat ? estimatedMinimumFiat : '', - estimatedMaximumNative, estimatedMinimumNative, - estimatedBaseFee: supportsEIP1559 - ? decGWEIToHexWEI(gasFeeEstimates.estimatedBaseFee ?? '0') - : undefined, maximumCostInHexWei, minimumCostInHexWei, }; diff --git a/ui/hooks/gasFeeInput/useGasEstimates.test.js b/ui/hooks/gasFeeInput/useGasEstimates.test.js index 894cf00af..a0c207f36 100644 --- a/ui/hooks/gasFeeInput/useGasEstimates.test.js +++ b/ui/hooks/gasFeeInput/useGasEstimates.test.js @@ -1,4 +1,3 @@ -import { useSelector } from 'react-redux'; import { renderHook } from '@testing-library/react-hooks'; import { getMaximumGasTotalInHexWei, @@ -11,9 +10,6 @@ import { LEGACY_GAS_ESTIMATE_RETURN_VALUE, configureEIP1559, configureLegacy, - convertFromHexToETH, - convertFromHexToFiat, - generateUseSelectorRouter, } from './test-utils'; import { useGasEstimates } from './useGasEstimates'; @@ -71,12 +67,6 @@ describe('useGasEstimates', () => { }); expect(result.current.minimumCostInHexWei).toBe(minimumHexValue); - expect(result.current.estimatedMinimumFiat).toBe( - convertFromHexToFiat(minimumHexValue), - ); - expect(result.current.estimatedMinimumNative).toBe( - convertFromHexToETH(minimumHexValue), - ); }); it('uses new EIP-1559 gas fields to calculate maximum values', () => { @@ -89,38 +79,7 @@ describe('useGasEstimates', () => { gasLimit: decimalToHex(gasLimit), maxFeePerGas: decGWEIToHexWEI(maxFeePerGas), }); - expect(result.current.estimatedMaximumFiat).toBe( - convertFromHexToFiat(maximumHexValue), - ); - expect(result.current.estimatedMaximumNative).toBe( - convertFromHexToETH(maximumHexValue), - ); - }); - - it('does not return fiat values if showFiat is false', () => { - const gasLimit = '21000'; - const maxFeePerGas = '100'; - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - shouldShowFiat: false, - }), - ); - const { result } = renderHook(() => - useGasEstimatesHook({ gasLimit, maxFeePerGas }), - ); - - expect(result.current.estimatedMaximumFiat).toBe(''); - expect(result.current.estimatedMinimumFiat).toBe(''); - }); - - it('uses gasFeeEstimates.estimatedBaseFee prop to calculate estimatedBaseFee', () => { - const { estimatedBaseFee } = - FEE_MARKET_ESTIMATE_RETURN_VALUE.gasFeeEstimates; - const { result } = renderHook(() => useGasEstimatesHook()); - expect(result.current.estimatedBaseFee).toBe( - decGWEIToHexWEI(estimatedBaseFee), - ); + expect(result.current.maximumCostInHexWei).toBe(maximumHexValue); }); }); @@ -146,12 +105,6 @@ describe('useGasEstimates', () => { }); expect(result.current.minimumCostInHexWei).toBe(minimumHexValue); - expect(result.current.estimatedMinimumFiat).toBe( - convertFromHexToFiat(minimumHexValue), - ); - expect(result.current.estimatedMinimumNative).toBe( - convertFromHexToETH(minimumHexValue), - ); }); it('uses legacy gas fields to calculate maximum values', () => { @@ -169,12 +122,7 @@ describe('useGasEstimates', () => { gasLimit: decimalToHex(gasLimit), gasPrice: decGWEIToHexWEI(gasPrice), }); - expect(result.current.estimatedMaximumFiat).toBe( - convertFromHexToFiat(maximumHexValue), - ); - expect(result.current.estimatedMaximumNative).toBe( - convertFromHexToETH(maximumHexValue), - ); + expect(result.current.maximumCostInHexWei).toBe(maximumHexValue); }); it('estimatedBaseFee is undefined', () => { diff --git a/ui/hooks/gasFeeInput/useGasFeeErrors.js b/ui/hooks/gasFeeInput/useGasFeeErrors.js index f73cc3e44..ca0796388 100644 --- a/ui/hooks/gasFeeInput/useGasFeeErrors.js +++ b/ui/hooks/gasFeeInput/useGasFeeErrors.js @@ -154,10 +154,8 @@ const hasBalanceError = (minimumCostInHexWei, transaction, ethBalance) => { * @typedef {object} GasFeeErrorsReturnType * @property {object} [gasErrors] - combined map of errors and warnings. * @property {boolean} [hasGasErrors] - true if there are errors that can block submission. - * @property {object} gasWarnings - map of gas warnings for EIP-1559 fields. * @property {boolean} [balanceError] - true if user balance is less than transaction value. - * @property {boolean} [estimatesUnavailableWarning] - true if supportsEIP1559 is true and - * estimate is not of type fee-market. + * @property {boolean} [hasSimulationError] - true if simulation error exists. */ /** @@ -265,9 +263,6 @@ export function useGasFeeErrors({ return warnings; }, [maxPriorityFeeWarning, maxFeeWarning]); - const estimatesUnavailableWarning = - supportsEIP1559 && !isFeeMarketGasEstimate; - // Determine if we have any errors which should block submission const hasGasErrors = Boolean(Object.keys(gasErrors).length); @@ -291,9 +286,7 @@ export function useGasFeeErrors({ return { gasErrors: errorsAndWarnings, hasGasErrors, - gasWarnings, balanceError, - estimatesUnavailableWarning, hasSimulationError: Boolean(transaction?.simulationFails), }; } diff --git a/ui/hooks/gasFeeInput/useGasFeeErrors.test.js b/ui/hooks/gasFeeInput/useGasFeeErrors.test.js index 30dfb1ada..48cedcaad 100644 --- a/ui/hooks/gasFeeInput/useGasFeeErrors.test.js +++ b/ui/hooks/gasFeeInput/useGasFeeErrors.test.js @@ -1,5 +1,4 @@ import { renderHook } from '@testing-library/react-hooks'; -import { useSelector } from 'react-redux'; import { GAS_FORM_ERRORS } from '../../helpers/constants/gas'; @@ -10,7 +9,6 @@ import { LEGACY_GAS_ESTIMATE_RETURN_VALUE, configureEIP1559, configureLegacy, - generateUseSelectorRouter, } from './test-utils'; jest.mock('../useGasFeeEstimates', () => ({ @@ -185,20 +183,20 @@ describe('useGasFeeErrors', () => { }); }); - describe('maxPriorityFee warning', () => { + describe('maxPriorityFee gasErrors (derived from warnings)', () => { describe('EIP1559 compliant estimates', () => { beforeEach(() => { configureEIP1559(); }); it('does not return maxPriorityFeeWarning if maxPriorityFee is > suggestedMaxPriorityFeePerGas', () => { const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.gasWarnings.maxPriorityFee).toBeUndefined(); + expect(result.current.gasErrors.maxPriorityFee).toBeUndefined(); }); it('return maxPriorityFeeWarning if maxPriorityFee is < suggestedMaxPriorityFeePerGas', () => { const { result } = renderUseGasFeeErrorsHook({ maxPriorityFeePerGas: '1', }); - expect(result.current.gasWarnings.maxPriorityFee).toBe( + expect(result.current.gasErrors.maxPriorityFee).toBe( GAS_FORM_ERRORS.MAX_PRIORITY_FEE_TOO_LOW, ); }); @@ -206,7 +204,7 @@ describe('useGasFeeErrors', () => { const { result } = renderUseGasFeeErrorsHook({ maxPriorityFeePerGas: '100', }); - expect(result.current.gasWarnings.maxPriorityFee).toBe( + expect(result.current.gasErrors.maxPriorityFee).toBe( GAS_FORM_ERRORS.MAX_PRIORITY_FEE_HIGH_WARNING, ); }); @@ -215,31 +213,31 @@ describe('useGasFeeErrors', () => { beforeEach(() => { configureLegacy(); }); - it('does not return maxPriorityFeeWarning if maxPriorityFee is < gasFeeEstimates.low.suggestedMaxPriorityFeePerGas', () => { + it('does not return maxPriorityFee error if maxPriorityFee is < gasFeeEstimates.low.suggestedMaxPriorityFeePerGas', () => { const { result } = renderUseGasFeeErrorsHook({ maxPriorityFeePerGas: '1', ...LEGACY_GAS_ESTIMATE_RETURN_VALUE, }); - expect(result.current.gasWarnings.maxPriorityFee).toBeUndefined(); + expect(result.current.gasErrors.maxPriorityFee).toBeUndefined(); expect(result.current.hasGasErrors).toBe(false); }); }); }); - describe('maxFee warning', () => { + describe('maxFee gasErrors', () => { describe('EIP1559 compliant estimates', () => { beforeEach(() => { configureEIP1559(); }); it('does not return maxFeeWarning if maxFee is > suggestedMaxFeePerGas', () => { const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.gasWarnings.maxFee).toBeUndefined(); + expect(result.current.gasErrors.maxFee).toBeUndefined(); }); it('return maxFeeWarning if maxFee is < suggestedMaxFeePerGas', () => { const { result } = renderUseGasFeeErrorsHook({ maxFeePerGas: '20', }); - expect(result.current.gasWarnings.maxFee).toBe( + expect(result.current.gasErrors.maxFee).toBe( GAS_FORM_ERRORS.MAX_FEE_TOO_LOW, ); }); @@ -247,7 +245,7 @@ describe('useGasFeeErrors', () => { const { result } = renderUseGasFeeErrorsHook({ maxFeePerGas: '1000', }); - expect(result.current.gasWarnings.maxFee).toBe( + expect(result.current.gasErrors.maxFee).toBe( GAS_FORM_ERRORS.MAX_FEE_HIGH_WARNING, ); }); @@ -261,7 +259,7 @@ describe('useGasFeeErrors', () => { maxFeePerGas: '1', ...LEGACY_GAS_ESTIMATE_RETURN_VALUE, }); - expect(result.current.gasWarnings.maxFee).toBeUndefined(); + expect(result.current.gasErrors.maxFee).toBeUndefined(); }); }); }); @@ -296,23 +294,4 @@ describe('useGasFeeErrors', () => { expect(result.current.hasSimulationError).toBe(true); }); }); - - describe('estimatesUnavailableWarning', () => { - it('is false if supportsEIP1559 and gasEstimateType is fee-market', () => { - configureEIP1559(); - const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.estimatesUnavailableWarning).toBe(false); - }); - it('is true if supportsEIP1559 and gasEstimateType is not fee-market', () => { - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - }), - ); - const { result } = renderUseGasFeeErrorsHook( - LEGACY_GAS_ESTIMATE_RETURN_VALUE, - ); - expect(result.current.estimatesUnavailableWarning).toBe(true); - }); - }); }); diff --git a/ui/hooks/gasFeeInput/useGasFeeInputs.js b/ui/hooks/gasFeeInput/useGasFeeInputs.js index 91bbbb678..6805c1819 100644 --- a/ui/hooks/gasFeeInput/useGasFeeInputs.js +++ b/ui/hooks/gasFeeInput/useGasFeeInputs.js @@ -11,7 +11,6 @@ import { GAS_FORM_ERRORS } from '../../helpers/constants/gas'; import { checkNetworkAndAccountSupports1559, getAdvancedInlineGasShown, - getEIP1559V2Enabled, } from '../../selectors'; import { isLegacyTransaction } from '../../helpers/utils/transactions.util'; import { useGasFeeEstimates } from '../useGasFeeEstimates'; @@ -42,37 +41,39 @@ import { useTransactionFunctions } from './useTransactionFunctions'; /** * @typedef {object} GasFeeInputReturnType + * @property {object} [transaction] - . * @property {DecGweiString} [maxFeePerGas] - the maxFeePerGas input value. - * @property {string} [maxFeePerGasFiat] - the maxFeePerGas converted to the - * user's preferred currency. - * @property {(DecGweiString) => void} setMaxFeePerGas - state setter method to - * update the maxFeePerGas. * @property {DecGweiString} [maxPriorityFeePerGas] - the maxPriorityFeePerGas * input value. - * @property {string} [maxPriorityFeePerGasFiat] - the maxPriorityFeePerGas - * converted to the user's preferred currency. - * @property {(DecGweiString) => void} setMaxPriorityFeePerGas - state setter - * method to update the maxPriorityFeePerGas. * @property {DecGweiString} [gasPrice] - the gasPrice input value. * @property {(DecGweiString) => void} setGasPrice - state setter method to * update the gasPrice. * @property {DecGweiString} gasLimit - the gasLimit input value. * @property {(DecGweiString) => void} setGasLimit - state setter method to * update the gasLimit. + * @property {DecGweiString} [properGasLimit] - proper gas limit. + * @property {string} [editGasMode] - one of CANCEL, SPEED-UP, MODIFY_IN_PLACE, SWAPS. * @property {EstimateLevel} [estimateToUse] - the estimate level currently - * selected. This will be null if the user has ejected from using the - * estimates. - * @property {([EstimateLevel]) => void} setEstimateToUse - Setter method for - * choosing which EstimateLevel to use. - * @property {string} [estimatedMinimumFiat] - The amount estimated to be paid - * based on current network conditions. Expressed in user's preferred - * currency. - * @property {string} [estimatedMaximumFiat] - the maximum amount estimated to be - * paid if current network transaction volume increases. Expressed in user's - * preferred currency. - * @property {string} [estimatedMaximumNative] - the maximum amount estimated to - * be paid if the current network transaction volume increases. Expressed in - * the network's native currency. + * selected. This will be null if the user has ejected from using the estimates. + * @property {boolean} [isGasEstimatesLoading] - true if gas estimate is loading. + * @property {DecGweiString} [maximumCostInHexWei] - maximum cost of transaction in HexWei. + * @property {DecGweiString} [minimumCostInHexWei] - minimum cost of transaction in HexWei. + * @property {string} [estimateUsed] - estimate used in the transaction. + * @property {boolean} [isNetworkBusy] - true if network is busy. + * @property {() => void} [onManualChange] - function to call when transaciton is manually changed. + * @property {boolean} [balanceError] - true if user balance is less than transaction value. + * @property {object} [gasErrors] - object of gas errors. + * @property {boolean} [hasGasErrors] - true if there are gas errors. + * @property {boolean} [hasSimulationError] - true if simulation error exists. + * @property {number} [minimumGasLimitDec] - minimum gas limit in decimals. + * @property {boolean} [supportsEIP1559] - true if EIP1559 is cupported. + * @property {() => void} cancelTransaction - cancel the transaction. + * @property {() => void} speedUpTransaction - speed up the transaction. + * @property {(string, number, number, number, string) => void} updateTransaction - update the transaction. + * @property {(boolean) => void} updateTransactionToTenPercentIncreasedGasFee - update the cancel / speed transaction to + * gas fee which is equal to current gas fee +10 percent. + * @property {(string) => void} updateTransactionUsingDAPPSuggestedValues - update the transaction to DAPP suggested gas value. + * @property {(string) => void} updateTransactionUsingEstimate - update the transaction using the estimate passed. */ /** @@ -113,14 +114,10 @@ export function useGasFeeInputs( ? retryTxMeta : _transaction; - const eip1559V2Enabled = useSelector(getEIP1559V2Enabled); - const supportsEIP1559 = useSelector(checkNetworkAndAccountSupports1559) && !isLegacyTransaction(transaction?.txParams); - const supportsEIP1559V2 = supportsEIP1559 && eip1559V2Enabled; - // We need the gas estimates from the GasFeeController in the background. // Calling this hooks initiates polling for new gas estimates and returns the // current estimate. @@ -128,7 +125,6 @@ export function useGasFeeInputs( gasEstimateType, gasFeeEstimates, isGasEstimatesLoading, - estimatedGasFeeTimeBounds, isNetworkBusy, } = useGasFeeEstimates(); @@ -161,17 +157,13 @@ export function useGasFeeInputs( const properGasLimit = Number(hexToDecimal(transaction?.originalGasEstimate)); - const [userEditedGasLimit, setUserEditedGasLimit] = useState(() => - Boolean(transaction?.userEditedGasLimit), - ); - /** * In EIP-1559 V2 designs change to gas estimate is always updated to transaction * Thus callback setEstimateToUse can be deprecate in favour of this useEffect * so that transaction is source of truth whenever possible. */ useEffect(() => { - if (supportsEIP1559V2) { + if (supportsEIP1559) { if (transaction?.userFeeLevel) { setEstimateUsed(transaction?.userFeeLevel); setInternalEstimateToUse(transaction?.userFeeLevel); @@ -182,7 +174,7 @@ export function useGasFeeInputs( setEstimateUsed, setGasLimit, setInternalEstimateToUse, - supportsEIP1559V2, + supportsEIP1559, transaction, ]); @@ -194,69 +186,47 @@ export function useGasFeeInputs( transaction, }); - const { maxFeePerGas, maxFeePerGasFiat, setMaxFeePerGas } = - useMaxFeePerGasInput({ + const { maxFeePerGas, setMaxFeePerGas } = useMaxFeePerGasInput({ + estimateToUse, + gasEstimateType, + gasFeeEstimates, + transaction, + }); + + const { maxPriorityFeePerGas, setMaxPriorityFeePerGas } = + useMaxPriorityFeePerGasInput({ estimateToUse, gasEstimateType, gasFeeEstimates, + transaction, + }); + + const { estimatedMinimumNative, maximumCostInHexWei, minimumCostInHexWei } = + useGasEstimates({ + editGasMode, + gasEstimateType, + gasFeeEstimates, gasLimit, gasPrice, - supportsEIP1559V2, + maxFeePerGas, + maxPriorityFeePerGas, + minimumGasLimit, transaction, }); - const { - maxPriorityFeePerGas, - maxPriorityFeePerGasFiat, - setMaxPriorityFeePerGas, - } = useMaxPriorityFeePerGasInput({ - estimateToUse, - gasEstimateType, - gasFeeEstimates, - gasLimit, - supportsEIP1559V2, - transaction, - }); - - const { - estimatedBaseFee, - estimatedMaximumFiat, - estimatedMinimumFiat, - estimatedMaximumNative, - estimatedMinimumNative, - maximumCostInHexWei, - minimumCostInHexWei, - } = useGasEstimates({ - editGasMode, - gasEstimateType, - gasFeeEstimates, - gasLimit, - gasPrice, - maxFeePerGas, - maxPriorityFeePerGas, - minimumGasLimit, - transaction, - }); - - const { - balanceError, - estimatesUnavailableWarning, - gasErrors, - gasWarnings, - hasGasErrors, - hasSimulationError, - } = useGasFeeErrors({ - gasEstimateType, - gasFeeEstimates, - isGasEstimatesLoading, - gasLimit, - gasPrice, - maxPriorityFeePerGas, - maxFeePerGas, - minimumCostInHexWei, - minimumGasLimit, - transaction, - }); + const { balanceError, gasErrors, hasGasErrors, hasSimulationError } = + useGasFeeErrors({ + gasEstimateType, + gasFeeEstimates, + isGasEstimatesLoading, + gasLimit, + gasPrice, + maxPriorityFeePerGas, + maxFeePerGas, + minimumCostInHexWei, + minimumGasLimit, + transaction, + }); const handleGasLimitOutOfBoundError = useCallback(() => { if (gasErrors.gasLimit === GAS_FORM_ERRORS.GAS_LIMIT_OUT_OF_BOUNDS) { @@ -288,37 +258,12 @@ export function useGasFeeInputs( setRetryTxMeta, }); - // When a user selects an estimate level, it will wipe out what they have - // previously put in the inputs. This returns the inputs to the estimated - // values at the level specified. - const setEstimateToUse = useCallback( - (estimateLevel) => { - setInternalEstimateToUse(estimateLevel); - handleGasLimitOutOfBoundError(); - setMaxFeePerGas(null); - setMaxPriorityFeePerGas(null); - setGasPrice(null); - setGasPriceHasBeenManuallySet(false); - setEstimateUsed(estimateLevel); - }, - [ - setInternalEstimateToUse, - handleGasLimitOutOfBoundError, - setMaxFeePerGas, - setMaxPriorityFeePerGas, - setGasPrice, - setGasPriceHasBeenManuallySet, - setEstimateUsed, - ], - ); - const onManualChange = useCallback(() => { setInternalEstimateToUse(CUSTOM_GAS_ESTIMATE); handleGasLimitOutOfBoundError(); // Restore existing values setGasPrice(gasPrice); setGasLimit(gasLimit); - setUserEditedGasLimit(true); setMaxFeePerGas(maxFeePerGas); setMaxPriorityFeePerGas(maxPriorityFeePerGas); setGasPriceHasBeenManuallySet(true); @@ -330,7 +275,6 @@ export function useGasFeeInputs( gasPrice, setGasLimit, gasLimit, - setUserEditedGasLimit, setMaxFeePerGas, maxFeePerGas, setMaxPriorityFeePerGas, @@ -341,44 +285,28 @@ export function useGasFeeInputs( return { transaction, maxFeePerGas, - maxFeePerGasFiat, - setMaxFeePerGas, maxPriorityFeePerGas, - maxPriorityFeePerGasFiat, - setMaxPriorityFeePerGas, gasPrice, setGasPrice, gasLimit, setGasLimit, properGasLimit, - userEditedGasLimit, editGasMode, estimateToUse, - setEstimateToUse, - estimatedMinimumFiat, - estimatedMaximumFiat, - estimatedMaximumNative, estimatedMinimumNative, - isGasEstimatesLoading, maximumCostInHexWei, minimumCostInHexWei, estimateUsed, gasFeeEstimates, - gasEstimateType, - estimatedGasFeeTimeBounds, isNetworkBusy, onManualChange, - estimatedBaseFee, // error and warnings balanceError, - estimatesUnavailableWarning, gasErrors, - gasWarnings, hasGasErrors, hasSimulationError, minimumGasLimitDec: hexToDecimal(minimumGasLimit), supportsEIP1559, - supportsEIP1559V2, cancelTransaction, speedUpTransaction, updateTransaction, diff --git a/ui/hooks/gasFeeInput/useGasFeeInputs.test.js b/ui/hooks/gasFeeInput/useGasFeeInputs.test.js index c3c722c18..ad8300d75 100644 --- a/ui/hooks/gasFeeInput/useGasFeeInputs.test.js +++ b/ui/hooks/gasFeeInput/useGasFeeInputs.test.js @@ -3,7 +3,6 @@ import { useSelector } from 'react-redux'; import { TRANSACTION_ENVELOPE_TYPES } from '../../../shared/constants/transaction'; import { GAS_RECOMMENDATIONS, - CUSTOM_GAS_ESTIMATE, EDIT_GAS_MODES, } from '../../../shared/constants/gas'; @@ -14,14 +13,12 @@ import { useGasFeeEstimates } from '../useGasFeeEstimates'; import { useGasFeeInputs } from './useGasFeeInputs'; import { - MOCK_ETH_USD_CONVERSION_RATE, LEGACY_GAS_ESTIMATE_RETURN_VALUE, FEE_MARKET_ESTIMATE_RETURN_VALUE, HIGH_FEE_MARKET_ESTIMATE_RETURN_VALUE, configureEIP1559, configureLegacy, generateUseSelectorRouter, - getTotalCostInETH, } from './test-utils'; jest.mock('../useUserPreferencedCurrency', () => ({ @@ -62,10 +59,6 @@ describe('useGasFeeInputs', () => { expect(result.current.gasFeeEstimates).toMatchObject( LEGACY_GAS_ESTIMATE_RETURN_VALUE.gasFeeEstimates, ); - expect(result.current.gasEstimateType).toBe( - LEGACY_GAS_ESTIMATE_RETURN_VALUE.gasEstimateType, - ); - expect(result.current.estimatedGasFeeTimeBounds).toMatchObject({}); }); it('returns gasPrice appropriately, and "0" for EIP1559 fields', () => { @@ -87,31 +80,10 @@ describe('useGasFeeInputs', () => { expect(result.current.gasPrice).toBe( LEGACY_GAS_ESTIMATE_RETURN_VALUE.gasFeeEstimates.medium, ); - let totalEthGasFee = getTotalCostInETH( - LEGACY_GAS_ESTIMATE_RETURN_VALUE.gasFeeEstimates.medium, - result.current.gasLimit, - ); - let totalFiat = ( - Number(totalEthGasFee) * MOCK_ETH_USD_CONVERSION_RATE - ).toFixed(2); - expect(result.current.estimatedMaximumNative).toBe( - `${totalEthGasFee} ETH`, - ); - expect(result.current.estimatedMaximumFiat).toBe(`$${totalFiat}`); - expect(result.current.estimatedMinimumFiat).toBe(`$${totalFiat}`); act(() => { result.current.setGasPrice('30'); }); - totalEthGasFee = getTotalCostInETH('30', result.current.gasLimit); - totalFiat = ( - Number(totalEthGasFee) * MOCK_ETH_USD_CONVERSION_RATE - ).toFixed(2); expect(result.current.gasPrice).toBe('30'); - expect(result.current.estimatedMaximumNative).toBe( - `${totalEthGasFee} ETH`, - ); - expect(result.current.estimatedMaximumFiat).toBe(`$${totalFiat}`); - expect(result.current.estimatedMinimumFiat).toBe(`$${totalFiat}`); }); }); @@ -147,10 +119,6 @@ describe('useGasFeeInputs', () => { expect(result.current.gasFeeEstimates).toMatchObject( FEE_MARKET_ESTIMATE_RETURN_VALUE.gasFeeEstimates, ); - expect(result.current.gasEstimateType).toBe( - FEE_MARKET_ESTIMATE_RETURN_VALUE.gasEstimateType, - ); - expect(result.current.estimatedGasFeeTimeBounds).toMatchObject({}); }); it('returns EIP-1559 fields appropriately, and "0" for gasPrice fields', () => { @@ -165,52 +133,6 @@ describe('useGasFeeInputs', () => { .suggestedMaxPriorityFeePerGas, ); }); - - it('updates values when user modifies maxFeePerGas', () => { - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - }), - ); - const { result } = renderHook(() => - useGasFeeInputs(null, { - txParams: {}, - userFeeLevel: GAS_RECOMMENDATIONS.MEDIUM, - }), - ); - expect(result.current.maxFeePerGas).toBe( - FEE_MARKET_ESTIMATE_RETURN_VALUE.gasFeeEstimates.medium - .suggestedMaxFeePerGas, - ); - let totalEthGasFee = getTotalCostInETH( - FEE_MARKET_ESTIMATE_RETURN_VALUE.gasFeeEstimates.medium - .suggestedMaxFeePerGas, - result.current.gasLimit, - ); - let totalMaxFiat = ( - Number(totalEthGasFee) * MOCK_ETH_USD_CONVERSION_RATE - ).toFixed(2); - expect(result.current.estimatedMaximumNative).toBe( - `${totalEthGasFee} ETH`, - ); - expect(result.current.estimatedMaximumFiat).toBe(`$${totalMaxFiat}`); - // TODO: test minimum fiat too - // expect(result.current.estimatedMinimumFiat).toBe(`$${totalMaxFiat}`); - act(() => { - result.current.setMaxFeePerGas('90'); - }); - totalEthGasFee = getTotalCostInETH('90', result.current.gasLimit); - totalMaxFiat = ( - Number(totalEthGasFee) * MOCK_ETH_USD_CONVERSION_RATE - ).toFixed(2); - expect(result.current.maxFeePerGas).toBe('90'); - expect(result.current.estimatedMaximumNative).toBe( - `${totalEthGasFee} ETH`, - ); - expect(result.current.estimatedMaximumFiat).toBe(`$${totalMaxFiat}`); - // TODO: test minimum fiat too - // expect(result.current.estimatedMinimumFiat).toBe(`$${totalMaxFiat}`); - }); }); describe('when balance is sufficient for minimum transaction cost', () => { @@ -243,111 +165,6 @@ describe('useGasFeeInputs', () => { }); }); - describe('callback setEstimateToUse', () => { - beforeEach(() => { - configureEIP1559(); - }); - - it('should change estimateToUse value', () => { - const { result } = renderHook(() => - useGasFeeInputs(null, { - userFeeLevel: GAS_RECOMMENDATIONS.MEDIUM, - txParams: { gas: '0x5208' }, - }), - ); - act(() => { - result.current.setEstimateToUse(GAS_RECOMMENDATIONS.HIGH); - }); - expect(result.current.estimateToUse).toBe(GAS_RECOMMENDATIONS.HIGH); - expect(result.current.maxFeePerGas).toBe( - FEE_MARKET_ESTIMATE_RETURN_VALUE.gasFeeEstimates.high - .suggestedMaxFeePerGas, - ); - expect(result.current.maxPriorityFeePerGas).toBe( - FEE_MARKET_ESTIMATE_RETURN_VALUE.gasFeeEstimates.high - .suggestedMaxPriorityFeePerGas, - ); - }); - }); - - describe('callback onManualChange', () => { - beforeEach(() => { - configureEIP1559(); - }); - - it('should change estimateToUse value to custom', () => { - const { result } = renderHook(() => - useGasFeeInputs(null, { - userFeeLevel: GAS_RECOMMENDATIONS.MEDIUM, - txParams: { gas: '0x5208' }, - }), - ); - act(() => { - result.current.onManualChange(); - result.current.setMaxFeePerGas('100'); - result.current.setMaxPriorityFeePerGas('10'); - }); - expect(result.current.estimateToUse).toBe(CUSTOM_GAS_ESTIMATE); - expect(result.current.maxFeePerGas).toBe('100'); - expect(result.current.maxPriorityFeePerGas).toBe('10'); - }); - }); - - describe('when showFiat is false', () => { - beforeEach(() => { - configureEIP1559(); - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - shouldShowFiat: false, - }), - ); - }); - - it('does not return fiat values', () => { - const { result } = renderHook(() => - useGasFeeInputs(null, { - userFeeLevel: GAS_RECOMMENDATIONS.MEDIUM, - txParams: { gas: '0x5208' }, - }), - ); - expect(result.current.maxFeePerGasFiat).toBe(''); - expect(result.current.maxPriorityFeePerGasFiat).toBe(''); - expect(result.current.estimatedMaximumFiat).toBe(''); - expect(result.current.estimatedMinimumFiat).toBe(''); - }); - }); - - describe('supportsEIP1559V2', () => { - beforeEach(() => { - configureEIP1559(); - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - eip1559V2Enabled: true, - }), - ); - }); - - it('return true for fee_market transaction type', () => { - const { result } = renderHook(() => - useGasFeeInputs(null, { - txParams: { type: TRANSACTION_ENVELOPE_TYPES.FEE_MARKET }, - }), - ); - expect(result.current.supportsEIP1559V2).toBe(true); - }); - - it('return false for legacy transaction type', () => { - const { result } = renderHook(() => - useGasFeeInputs(null, { - txParams: { type: TRANSACTION_ENVELOPE_TYPES.LEGACY }, - }), - ); - expect(result.current.supportsEIP1559V2).toBe(false); - }); - }); - describe('editGasMode', () => { it('should return editGasMode passed', () => { const { result } = renderHook(() => diff --git a/ui/hooks/gasFeeInput/useMaxFeePerGasInput.js b/ui/hooks/gasFeeInput/useMaxFeePerGasInput.js index 5bf672663..cc8788fb8 100644 --- a/ui/hooks/gasFeeInput/useMaxFeePerGasInput.js +++ b/ui/hooks/gasFeeInput/useMaxFeePerGasInput.js @@ -1,22 +1,10 @@ import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; -import { GAS_ESTIMATE_TYPES } from '../../../shared/constants/gas'; -import { SECONDARY } from '../../helpers/constants/common'; -import { getMaximumGasTotalInHexWei } from '../../../shared/modules/gas.utils'; -import { decGWEIToHexWEI } from '../../helpers/utils/conversions.util'; -import { - checkNetworkAndAccountSupports1559, - getShouldShowFiat, -} from '../../selectors'; +import { checkNetworkAndAccountSupports1559 } from '../../selectors'; import { isLegacyTransaction } from '../../helpers/utils/transactions.util'; -import { useCurrencyDisplay } from '../useCurrencyDisplay'; -import { useUserPreferencedCurrency } from '../useUserPreferencedCurrency'; -import { - decimalToHex, - hexWEIToDecGWEI, -} from '../../../shared/lib/transactions-controller-utils'; +import { hexWEIToDecGWEI } from '../../../shared/lib/transactions-controller-utils'; import { feeParamsAreCustom, getGasFeeEstimate } from './utils'; const getMaxFeePerGasFromTransaction = (transaction, gasFeeEstimates) => { @@ -29,20 +17,15 @@ const getMaxFeePerGasFromTransaction = (transaction, gasFeeEstimates) => { /** * @typedef {object} MaxFeePerGasInputReturnType - * @property {(DecGweiString) => void} setMaxFeePerGas - state setter method to - * update the maxFeePerGas. - * @property {string} [maxFeePerGasFiat] - the maxFeePerGas converted to the - * user's preferred currency. + * @property {(DecGweiString) => void} setMaxFeePerGas - state setter method to update the maxFeePerGas. + * @property {string} [maxFeePerGas] - getter method for maxFeePerGas. */ /** * @param options - * @param options.supportsEIP1559V2 * @param options.estimateToUse * @param options.gasEstimateType * @param options.gasFeeEstimates - * @param options.gasLimit - * @param options.gasPrice * @param options.transaction * @returns {MaxFeePerGasInputReturnType} */ @@ -50,20 +33,12 @@ export function useMaxFeePerGasInput({ estimateToUse, gasEstimateType, gasFeeEstimates, - gasLimit, - gasPrice, - supportsEIP1559V2, transaction, }) { const supportsEIP1559 = useSelector(checkNetworkAndAccountSupports1559) && !isLegacyTransaction(transaction?.txParams); - const { currency: fiatCurrency, numberOfDecimals: fiatNumberOfDecimals } = - useUserPreferencedCurrency(SECONDARY); - - const showFiat = useSelector(getShouldShowFiat); - const initialMaxFeePerGas = supportsEIP1559 ? getMaxFeePerGasFromTransaction(transaction, gasFeeEstimates) : 0; @@ -79,44 +54,10 @@ export function useMaxFeePerGasInput({ }); useEffect(() => { - if (supportsEIP1559V2 && initialMaxFeePerGas) { + if (supportsEIP1559 && initialMaxFeePerGas) { setMaxFeePerGas(initialMaxFeePerGas); } - }, [initialMaxFeePerGas, setMaxFeePerGas, supportsEIP1559V2]); - - let gasSettings = { - gasLimit: decimalToHex(gasLimit), - }; - if (supportsEIP1559) { - gasSettings = { - ...gasSettings, - maxFeePerGas: decGWEIToHexWEI(maxFeePerGas || gasPrice || '0'), - }; - } else if (gasEstimateType === GAS_ESTIMATE_TYPES.NONE) { - gasSettings = { - ...gasSettings, - gasPrice: '0x0', - }; - } else { - gasSettings = { - ...gasSettings, - gasPrice: decGWEIToHexWEI(gasPrice), - }; - } - - const maximumCostInHexWei = getMaximumGasTotalInHexWei(gasSettings); - - // We need to display thee estimated fiat currency impact of the maxFeePerGas - // field to the user. This hook calculates that amount. This also works for - // the gasPrice amount because in legacy transactions cost is always gasPrice - // * gasLimit. - const [, { value: maxFeePerGasFiat }] = useCurrencyDisplay( - maximumCostInHexWei, - { - numberOfDecimals: fiatNumberOfDecimals, - currency: fiatCurrency, - }, - ); + }, [initialMaxFeePerGas, setMaxFeePerGas, supportsEIP1559]); // We specify whether to use the estimate value by checking if the state // value has been set. The state value is only set by user input and is wiped @@ -134,7 +75,6 @@ export function useMaxFeePerGasInput({ return { maxFeePerGas: maxFeePerGasToUse, - maxFeePerGasFiat: showFiat ? maxFeePerGasFiat : '', setMaxFeePerGas, }; } diff --git a/ui/hooks/gasFeeInput/useMaxFeePerGasInput.test.js b/ui/hooks/gasFeeInput/useMaxFeePerGasInput.test.js index f2312a0f4..edfa52897 100644 --- a/ui/hooks/gasFeeInput/useMaxFeePerGasInput.test.js +++ b/ui/hooks/gasFeeInput/useMaxFeePerGasInput.test.js @@ -1,20 +1,15 @@ -import { useSelector } from 'react-redux'; import { act, renderHook } from '@testing-library/react-hooks'; -import { getMaximumGasTotalInHexWei } from '../../../shared/modules/gas.utils'; import { GAS_RECOMMENDATIONS, CUSTOM_GAS_ESTIMATE, } from '../../../shared/constants/gas'; -import { decimalToHex } from '../../../shared/lib/transactions-controller-utils'; import { FEE_MARKET_ESTIMATE_RETURN_VALUE, LEGACY_GAS_ESTIMATE_RETURN_VALUE, configureEIP1559, configureLegacy, - convertFromHexToFiat, - generateUseSelectorRouter, } from './test-utils'; import { useMaxFeePerGasInput } from './useMaxFeePerGasInput'; @@ -80,41 +75,6 @@ describe('useMaxFeePerGasInput', () => { ); }); - it('if no maxFeePerGas is provided by user or in transaction it returns value from fee market estimate', () => { - const { result } = renderUseMaxFeePerGasInputHook({ - transaction: { - userFeeLevel: GAS_RECOMMENDATIONS.HIGH, - txParams: {}, - }, - }); - expect(result.current.maxFeePerGas).toBe( - FEE_MARKET_ESTIMATE_RETURN_VALUE.gasFeeEstimates.medium - .suggestedMaxFeePerGas, - ); - }); - - it('maxFeePerGasFiat is maximum amount that the transaction can cost', () => { - const { result } = renderUseMaxFeePerGasInputHook(); - const maximumHexValue = getMaximumGasTotalInHexWei({ - gasLimit: decimalToHex('21000'), - maxFeePerGas: '0x5028', - }); - expect(result.current.maxFeePerGasFiat).toBe( - convertFromHexToFiat(maximumHexValue), - ); - }); - - it('does not return fiat values if showFiat is false', () => { - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - shouldShowFiat: false, - }), - ); - const { result } = renderUseMaxFeePerGasInputHook(); - expect(result.current.maxFeePerGasFiat).toBe(''); - }); - it('returns 0 if EIP1559 is not supported and legacy gas estimates have been provided', () => { configureLegacy(); const { result } = renderUseMaxFeePerGasInputHook({ diff --git a/ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.js b/ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.js index e2ae55047..478039ca1 100644 --- a/ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.js +++ b/ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.js @@ -1,18 +1,9 @@ import { useSelector } from 'react-redux'; import { useEffect, useState } from 'react'; -import { addHexPrefix } from 'ethereumjs-util'; - -import { SECONDARY } from '../../helpers/constants/common'; -import { - checkNetworkAndAccountSupports1559, - getShouldShowFiat, -} from '../../selectors'; +import { checkNetworkAndAccountSupports1559 } from '../../selectors'; import { isLegacyTransaction } from '../../helpers/utils/transactions.util'; -import { multiplyCurrencies } from '../../../shared/modules/conversion.utils'; -import { useCurrencyDisplay } from '../useCurrencyDisplay'; -import { useUserPreferencedCurrency } from '../useUserPreferencedCurrency'; import { hexWEIToDecGWEI } from '../../../shared/lib/transactions-controller-utils'; import { feeParamsAreCustom, getGasFeeEstimate } from './utils'; @@ -35,19 +26,15 @@ const getMaxPriorityFeePerGasFromTransaction = ( * @typedef {object} MaxPriorityFeePerGasInputReturnType * @property {DecGweiString} [maxPriorityFeePerGas] - the maxPriorityFeePerGas * input value. - * @property {string} [maxPriorityFeePerGasFiat] - the maxPriorityFeePerGas - * converted to the user's preferred currency. * @property {(DecGweiString) => void} setMaxPriorityFeePerGas - state setter * method to update the maxPriorityFeePerGas. */ /** * @param options - * @param options.supportsEIP1559V2 * @param options.estimateToUse * @param options.gasEstimateType * @param options.gasFeeEstimates - * @param options.gasLimit * @param options.transaction * @returns {MaxPriorityFeePerGasInputReturnType} */ @@ -55,19 +42,12 @@ export function useMaxPriorityFeePerGasInput({ estimateToUse, gasEstimateType, gasFeeEstimates, - gasLimit, - supportsEIP1559V2, transaction, }) { const supportsEIP1559 = useSelector(checkNetworkAndAccountSupports1559) && !isLegacyTransaction(transaction?.txParams); - const { currency: fiatCurrency, numberOfDecimals: fiatNumberOfDecimals } = - useUserPreferencedCurrency(SECONDARY); - - const showFiat = useSelector(getShouldShowFiat); - const initialMaxPriorityFeePerGas = supportsEIP1559 ? getMaxPriorityFeePerGasFromTransaction(transaction, gasFeeEstimates) : 0; @@ -80,10 +60,10 @@ export function useMaxPriorityFeePerGasInput({ }); useEffect(() => { - if (supportsEIP1559V2 && initialMaxPriorityFeePerGas) { + if (supportsEIP1559 && initialMaxPriorityFeePerGas) { setMaxPriorityFeePerGas(initialMaxPriorityFeePerGas); } - }, [initialMaxPriorityFeePerGas, setMaxPriorityFeePerGas, supportsEIP1559V2]); + }, [initialMaxPriorityFeePerGas, setMaxPriorityFeePerGas, supportsEIP1559]); const maxPriorityFeePerGasToUse = maxPriorityFeePerGas ?? @@ -95,27 +75,8 @@ export function useMaxPriorityFeePerGasInput({ initialMaxPriorityFeePerGas || 0, ); - // We need to display the estimated fiat currency impact of the - // maxPriorityFeePerGas field to the user. This hook calculates that amount. - const [, { value: maxPriorityFeePerGasFiat }] = useCurrencyDisplay( - addHexPrefix( - multiplyCurrencies(maxPriorityFeePerGasToUse, gasLimit, { - toNumericBase: 'hex', - fromDenomination: 'GWEI', - toDenomination: 'WEI', - multiplicandBase: 10, - multiplierBase: 10, - }), - ), - { - numberOfDecimals: fiatNumberOfDecimals, - currency: fiatCurrency, - }, - ); - return { maxPriorityFeePerGas: maxPriorityFeePerGasToUse, - maxPriorityFeePerGasFiat: showFiat ? maxPriorityFeePerGasFiat : '', setMaxPriorityFeePerGas, }; } diff --git a/ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.test.js b/ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.test.js index 5601ef98a..ac79332ed 100644 --- a/ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.test.js +++ b/ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.test.js @@ -1,4 +1,3 @@ -import { useSelector } from 'react-redux'; import { act, renderHook } from '@testing-library/react-hooks'; import { @@ -10,8 +9,6 @@ import { LEGACY_GAS_ESTIMATE_RETURN_VALUE, configureEIP1559, configureLegacy, - convertFromHexToFiat, - generateUseSelectorRouter, } from './test-utils'; import { useMaxPriorityFeePerGasInput } from './useMaxPriorityFeePerGasInput'; @@ -52,9 +49,6 @@ describe('useMaxPriorityFeePerGasInput', () => { it('returns maxPriorityFeePerGas values from transaction if transaction.userFeeLevel is custom', () => { const { result } = renderUseMaxPriorityFeePerGasInputHook(); expect(result.current.maxPriorityFeePerGas).toBe(0.00002052); - expect(result.current.maxPriorityFeePerGasFiat).toBe( - convertFromHexToFiat('0x5028'), - ); }); it('returns maxFeePerGas values from transaction if transaction.userFeeLevel is custom and maxPriorityFeePerGas is not provided', () => { @@ -93,17 +87,6 @@ describe('useMaxPriorityFeePerGasInput', () => { ); }); - it('does not return fiat values if showFiat is false', () => { - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - shouldShowFiat: false, - }), - ); - const { result } = renderUseMaxPriorityFeePerGasInputHook(); - expect(result.current.maxPriorityFeePerGasFiat).toBe(''); - }); - it('returns 0 if EIP1559 is not supported and gas estimates are legacy', () => { configureLegacy(); const { result } = renderUseMaxPriorityFeePerGasInputHook({ diff --git a/ui/hooks/gasFeeInput/useTransactionFunctions.js b/ui/hooks/gasFeeInput/useTransactionFunctions.js index 4219a9510..fab8376f2 100644 --- a/ui/hooks/gasFeeInput/useTransactionFunctions.js +++ b/ui/hooks/gasFeeInput/useTransactionFunctions.js @@ -17,6 +17,29 @@ import { updateTransactionGasFees, } from '../../store/actions'; +/** + * @typedef {object} TransactionFunctionsReturnType + * @property {() => void} cancelTransaction - cancel the transaction. + * @property {() => void} speedUpTransaction - speed up the transaction. + * @property {(string, number, number, number, string) => void} updateTransaction - update the transaction. + * @property {(boolean) => void} updateTransactionToTenPercentIncreasedGasFee - update the cancel / speed transaction to + * gas fee which is equal to current gas fee +10 percent. + * @property {(string) => void} updateTransactionUsingDAPPSuggestedValues - update the transaction to DAPP suggested gas value. + * @property {(string) => void} updateTransactionUsingEstimate - update the transaction using the estimate passed. + */ + +/** + * @param options + * @param options.defaultEstimateToUse + * @param options.editGasMode + * @param options.estimatedBaseFee + * @param options.gasFeeEstimates + * @param options.gasLimit + * @param options.maxPriorityFeePerGas + * @param options.transaction + * @param options.setRetryTxMeta + * @returns {TransactionFunctionsReturnType} + */ export const useTransactionFunctions = ({ defaultEstimateToUse, editGasMode, diff --git a/ui/hooks/useGasFeeErrors.js b/ui/hooks/useGasFeeErrors.js deleted file mode 100644 index d914004c5..000000000 --- a/ui/hooks/useGasFeeErrors.js +++ /dev/null @@ -1,299 +0,0 @@ -import { useMemo } from 'react'; -import { useSelector } from 'react-redux'; -import { GAS_ESTIMATE_TYPES, GAS_LIMITS } from '../../shared/constants/gas'; -import { - conversionLessThan, - conversionGreaterThan, -} from '../../shared/modules/conversion.utils'; -import { - checkNetworkAndAccountSupports1559, - getSelectedAccount, -} from '../selectors'; -import { addHexes } from '../helpers/utils/conversions.util'; -import { isLegacyTransaction } from '../helpers/utils/transactions.util'; -import { - bnGreaterThan, - bnLessThan, - bnLessThanEqualTo, -} from '../helpers/utils/util'; -import { GAS_FORM_ERRORS } from '../helpers/constants/gas'; - -const HIGH_FEE_WARNING_MULTIPLIER = 1.5; - -const validateGasLimit = (gasLimit, minimumGasLimit) => { - const gasLimitTooLow = conversionLessThan( - { value: gasLimit, fromNumericBase: 'dec' }, - { value: minimumGasLimit || GAS_LIMITS.SIMPLE, fromNumericBase: 'hex' }, - ); - - if (gasLimitTooLow) { - return GAS_FORM_ERRORS.GAS_LIMIT_OUT_OF_BOUNDS; - } - return undefined; -}; - -const validateMaxPriorityFee = (maxPriorityFeePerGasToUse, supportsEIP1559) => { - if (supportsEIP1559 && bnLessThanEqualTo(maxPriorityFeePerGasToUse, 0)) { - return GAS_FORM_ERRORS.MAX_PRIORITY_FEE_BELOW_MINIMUM; - } - return undefined; -}; - -const validateMaxFee = ( - maxFeePerGasToUse, - maxPriorityFeeError, - maxPriorityFeePerGasToUse, - supportsEIP1559, -) => { - if (maxPriorityFeeError) { - return undefined; - } - if ( - supportsEIP1559 && - bnGreaterThan(maxPriorityFeePerGasToUse, maxFeePerGasToUse) - ) { - return GAS_FORM_ERRORS.MAX_FEE_IMBALANCE; - } - return undefined; -}; - -const validateGasPrice = ( - isFeeMarketGasEstimate, - gasPriceToUse, - supportsEIP1559, - transaction, -) => { - if ( - (!supportsEIP1559 || transaction?.txParams?.gasPrice) && - !isFeeMarketGasEstimate && - bnLessThanEqualTo(gasPriceToUse, 0) - ) { - return GAS_FORM_ERRORS.GAS_PRICE_TOO_LOW; - } - return undefined; -}; - -const getMaxPriorityFeeWarning = ( - gasFeeEstimates, - isFeeMarketGasEstimate, - isGasEstimatesLoading, - maxPriorityFeePerGasToUse, - supportsEIP1559, -) => { - if (!supportsEIP1559 || !isFeeMarketGasEstimate || isGasEstimatesLoading) { - return undefined; - } - if ( - bnLessThan( - maxPriorityFeePerGasToUse, - gasFeeEstimates?.low?.suggestedMaxPriorityFeePerGas, - ) - ) { - return GAS_FORM_ERRORS.MAX_PRIORITY_FEE_TOO_LOW; - } - if ( - gasFeeEstimates?.high && - bnGreaterThan( - maxPriorityFeePerGasToUse, - gasFeeEstimates.high.suggestedMaxPriorityFeePerGas * - HIGH_FEE_WARNING_MULTIPLIER, - ) - ) { - return GAS_FORM_ERRORS.MAX_PRIORITY_FEE_HIGH_WARNING; - } - return undefined; -}; - -const getMaxFeeWarning = ( - gasFeeEstimates, - isGasEstimatesLoading, - isFeeMarketGasEstimate, - maxFeeError, - maxPriorityFeeError, - maxFeePerGasToUse, - supportsEIP1559, -) => { - if ( - maxPriorityFeeError || - maxFeeError || - !isFeeMarketGasEstimate || - !supportsEIP1559 - ) { - return undefined; - } - if ( - !isGasEstimatesLoading && - bnLessThan(maxFeePerGasToUse, gasFeeEstimates?.low?.suggestedMaxFeePerGas) - ) { - return GAS_FORM_ERRORS.MAX_FEE_TOO_LOW; - } - if ( - gasFeeEstimates?.high && - bnGreaterThan( - maxFeePerGasToUse, - gasFeeEstimates.high.suggestedMaxFeePerGas * HIGH_FEE_WARNING_MULTIPLIER, - ) - ) { - return GAS_FORM_ERRORS.MAX_FEE_HIGH_WARNING; - } - return undefined; -}; - -const getBalanceError = (minimumCostInHexWei, transaction, ethBalance) => { - const minimumTxCostInHexWei = addHexes( - minimumCostInHexWei, - transaction?.txParams?.value || '0x0', - ); - - return conversionGreaterThan( - { value: minimumTxCostInHexWei, fromNumericBase: 'hex' }, - { value: ethBalance, fromNumericBase: 'hex' }, - ); -}; - -/** - * @typedef {object} GasFeeErrorsReturnType - * @property {object} [gasErrors] - combined map of errors and warnings. - * @property {boolean} [hasGasErrors] - true if there are errors that can block submission. - * @property {object} gasWarnings - map of gas warnings for EIP-1559 fields. - * @property {boolean} [balanceError] - true if user balance is less than transaction value. - * @property {boolean} [estimatesUnavailableWarning] - true if supportsEIP1559 is true and - * estimate is not of type fee-market. - */ - -/** - * @param options - * @param options.transaction - * @param options.gasEstimateType - * @param options.gasFeeEstimates - * @param options.gasLimit - * @param options.gasPriceToUse - * @param options.isGasEstimatesLoading - * @param options.maxPriorityFeePerGasToUse - * @param options.maxFeePerGasToUse - * @param options.minimumCostInHexWei - * @param options.minimumGasLimit - * @returns {GasFeeErrorsReturnType} - */ -export function useGasFeeErrors({ - transaction, - gasEstimateType, - gasFeeEstimates, - gasLimit, - gasPriceToUse, - isGasEstimatesLoading, - maxPriorityFeePerGasToUse, - maxFeePerGasToUse, - minimumCostInHexWei, - minimumGasLimit, -}) { - const supportsEIP1559 = - useSelector(checkNetworkAndAccountSupports1559) && - !isLegacyTransaction(transaction?.txParams); - - const isFeeMarketGasEstimate = - gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET; - - // Get all errors - const gasLimitError = validateGasLimit(gasLimit, minimumGasLimit); - - const maxPriorityFeeError = validateMaxPriorityFee( - maxPriorityFeePerGasToUse, - supportsEIP1559, - ); - - const maxFeeError = validateMaxFee( - maxFeePerGasToUse, - maxPriorityFeeError, - maxPriorityFeePerGasToUse, - supportsEIP1559, - ); - - const gasPriceError = validateGasPrice( - isFeeMarketGasEstimate, - gasPriceToUse, - supportsEIP1559, - transaction, - ); - - // Get all warnings - const maxPriorityFeeWarning = getMaxPriorityFeeWarning( - gasFeeEstimates, - isFeeMarketGasEstimate, - isGasEstimatesLoading, - maxPriorityFeePerGasToUse, - supportsEIP1559, - ); - - const maxFeeWarning = getMaxFeeWarning( - gasFeeEstimates, - isGasEstimatesLoading, - isFeeMarketGasEstimate, - maxFeeError, - maxPriorityFeeError, - maxFeePerGasToUse, - supportsEIP1559, - ); - - // Separating errors from warnings so we can know which value problems - // are blocking or simply useful information for the users - - const gasErrors = useMemo(() => { - const errors = {}; - if (gasLimitError) { - errors.gasLimit = gasLimitError; - } - if (maxPriorityFeeError) { - errors.maxPriorityFee = maxPriorityFeeError; - } - if (maxFeeError) { - errors.maxFee = maxFeeError; - } - if (gasPriceError) { - errors.gasPrice = gasPriceError; - } - return errors; - }, [gasLimitError, maxPriorityFeeError, maxFeeError, gasPriceError]); - - const gasWarnings = useMemo(() => { - const warnings = {}; - if (maxPriorityFeeWarning) { - warnings.maxPriorityFee = maxPriorityFeeWarning; - } - if (maxFeeWarning) { - warnings.maxFee = maxFeeWarning; - } - return warnings; - }, [maxPriorityFeeWarning, maxFeeWarning]); - - const estimatesUnavailableWarning = - supportsEIP1559 && !isFeeMarketGasEstimate; - - // Determine if we have any errors which should block submission - const hasGasErrors = Boolean(Object.keys(gasErrors).length); - - // Combine the warnings and errors into one object for easier use within the UI. - // This object should have no effect on whether or not the user can submit the form - const errorsAndWarnings = useMemo( - () => ({ - ...gasWarnings, - ...gasErrors, - }), - [gasErrors, gasWarnings], - ); - - const { balance: ethBalance } = useSelector(getSelectedAccount); - const balanceError = getBalanceError( - minimumCostInHexWei, - transaction, - ethBalance, - ); - - return { - gasErrors: errorsAndWarnings, - hasGasErrors, - gasWarnings, - balanceError, - estimatesUnavailableWarning, - }; -} diff --git a/ui/hooks/useGasFeeErrors.test.js b/ui/hooks/useGasFeeErrors.test.js deleted file mode 100644 index eedcfc915..000000000 --- a/ui/hooks/useGasFeeErrors.test.js +++ /dev/null @@ -1,364 +0,0 @@ -import { renderHook } from '@testing-library/react-hooks'; -import { useSelector } from 'react-redux'; - -import { GAS_ESTIMATE_TYPES } from '../../shared/constants/gas'; -import { GAS_FORM_ERRORS } from '../helpers/constants/gas'; -import { - checkNetworkAndAccountSupports1559, - getSelectedAccount, -} from '../selectors'; - -import { useGasFeeErrors } from './useGasFeeErrors'; - -jest.mock('./useGasFeeEstimates', () => ({ - useGasFeeEstimates: jest.fn(), -})); - -jest.mock('react-redux', () => { - const actual = jest.requireActual('react-redux'); - - return { - ...actual, - useSelector: jest.fn(), - }; -}); - -const LEGACY_GAS_ESTIMATE_RETURN_VALUE = { - gasEstimateType: GAS_ESTIMATE_TYPES.LEGACY, - gasFeeEstimates: { - low: '10', - medium: '20', - high: '30', - }, - estimatedGasFeeTimeBounds: {}, -}; - -const FEE_MARKET_ESTIMATE_RETURN_VALUE = { - gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, - gasFeeEstimates: { - low: { - minWaitTimeEstimate: 180000, - maxWaitTimeEstimate: 300000, - suggestedMaxPriorityFeePerGas: '3', - suggestedMaxFeePerGas: '53', - }, - medium: { - minWaitTimeEstimate: 15000, - maxWaitTimeEstimate: 60000, - suggestedMaxPriorityFeePerGas: '7', - suggestedMaxFeePerGas: '70', - }, - high: { - minWaitTimeEstimate: 0, - maxWaitTimeEstimate: 15000, - suggestedMaxPriorityFeePerGas: '10', - suggestedMaxFeePerGas: '100', - }, - estimatedBaseFee: '50', - }, - estimatedGasFeeTimeBounds: {}, -}; - -const generateUseSelectorRouter = - ({ checkNetworkAndAccountSupports1559Response } = {}) => - (selector) => { - if (selector === getSelectedAccount) { - return { - balance: '0x440aa47cc2556', - }; - } - if (selector === checkNetworkAndAccountSupports1559) { - return checkNetworkAndAccountSupports1559Response; - } - return undefined; - }; - -const configureEIP1559 = () => { - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - }), - ); -}; - -const configureLegacy = () => { - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: false, - }), - ); -}; - -const renderUseGasFeeErrorsHook = (props) => { - return renderHook(() => - useGasFeeErrors({ - transaction: { txParams: { type: '0x2', value: '100' } }, - gasLimit: '21000', - gasPriceToUse: '10', - maxPriorityFeePerGasToUse: '10', - maxFeePerGasToUse: '100', - minimumCostInHexWei: '0x5208', - minimumGasLimit: '0x5208', - ...FEE_MARKET_ESTIMATE_RETURN_VALUE, - ...props, - }), - ); -}; - -describe('useGasFeeErrors', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('gasLimit validation', () => { - beforeEach(() => { - configureLegacy(); - }); - it('does not returns gasLimitError if gasLimit is not below minimum', () => { - const { result } = renderUseGasFeeErrorsHook( - LEGACY_GAS_ESTIMATE_RETURN_VALUE, - ); - expect(result.current.gasErrors.gasLimit).toBeUndefined(); - expect(result.current.hasGasErrors).toBe(false); - }); - it('returns gasLimitError if gasLimit is below minimum', () => { - const { result } = renderUseGasFeeErrorsHook({ - gasLimit: '100', - ...LEGACY_GAS_ESTIMATE_RETURN_VALUE, - }); - expect(result.current.gasErrors.gasLimit).toBe( - GAS_FORM_ERRORS.GAS_LIMIT_OUT_OF_BOUNDS, - ); - expect(result.current.hasGasErrors).toBe(true); - }); - }); - - describe('maxPriorityFee validation', () => { - describe('EIP1559 compliant estimates', () => { - beforeEach(() => { - configureEIP1559(); - }); - it('does not return maxPriorityFeeError if maxPriorityFee is not 0', () => { - const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.gasErrors.maxPriorityFee).toBeUndefined(); - expect(result.current.hasGasErrors).toBe(false); - }); - it('return maxPriorityFeeError if maxPriorityFee is 0', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxPriorityFeePerGasToUse: '0', - }); - expect(result.current.gasErrors.maxPriorityFee).toBe( - GAS_FORM_ERRORS.MAX_PRIORITY_FEE_BELOW_MINIMUM, - ); - expect(result.current.hasGasErrors).toBe(true); - }); - }); - describe('Legacy estimates', () => { - beforeEach(() => { - configureLegacy(); - }); - it('does not return maxPriorityFeeError if maxPriorityFee is 0', () => { - const { result } = renderUseGasFeeErrorsHook( - LEGACY_GAS_ESTIMATE_RETURN_VALUE, - ); - expect(result.current.gasErrors.maxPriorityFee).toBeUndefined(); - expect(result.current.hasGasErrors).toBe(false); - }); - }); - }); - - describe('maxFee validation', () => { - describe('EIP1559 compliant estimates', () => { - beforeEach(() => { - configureEIP1559(); - }); - it('does not return maxFeeError if maxFee is greater than maxPriorityFee', () => { - const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.gasErrors.maxFee).toBeUndefined(); - expect(result.current.hasGasErrors).toBe(false); - }); - it('return maxFeeError if maxFee is less than maxPriorityFee', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxFeePerGasToUse: '1', - maxPriorityFeePerGasToUse: '10', - }); - expect(result.current.gasErrors.maxFee).toBe( - GAS_FORM_ERRORS.MAX_FEE_IMBALANCE, - ); - expect(result.current.hasGasErrors).toBe(true); - }); - it('does not return MAX_FEE_IMBALANCE error if maxPriorityFeePerGasToUse is 0', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxFeePerGasToUse: '1', - maxPriorityFeePerGasToUse: '0', - }); - expect(result.current.gasErrors.maxFee).toBeUndefined(); - }); - }); - describe('Legacy estimates', () => { - beforeEach(() => { - configureLegacy(); - }); - it('does not return maxFeeError if maxFee is less than maxPriorityFee', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxFeePerGasToUse: '1', - maxPriorityFeePerGasToUse: '10', - ...LEGACY_GAS_ESTIMATE_RETURN_VALUE, - }); - expect(result.current.gasErrors.maxFee).toBeUndefined(); - expect(result.current.hasGasErrors).toBe(false); - }); - }); - }); - - describe('gasPrice validation', () => { - describe('EIP1559 compliant estimates', () => { - beforeEach(() => { - configureEIP1559(); - }); - it('does not return gasPriceError if gasPrice is 0', () => { - const { result } = renderUseGasFeeErrorsHook({ gasPriceToUse: '0' }); - expect(result.current.gasErrors.gasPrice).toBeUndefined(); - expect(result.current.hasGasErrors).toBe(false); - }); - }); - describe('Legacy estimates', () => { - beforeEach(() => { - configureLegacy(); - }); - it('returns gasPriceError if gasPrice is 0', () => { - const { result } = renderUseGasFeeErrorsHook({ - gasPriceToUse: '0', - ...LEGACY_GAS_ESTIMATE_RETURN_VALUE, - }); - expect(result.current.gasErrors.gasPrice).toBe( - GAS_FORM_ERRORS.GAS_PRICE_TOO_LOW, - ); - expect(result.current.hasGasErrors).toBe(true); - }); - it('does not return gasPriceError if gasPrice is > 0', () => { - const { result } = renderUseGasFeeErrorsHook( - LEGACY_GAS_ESTIMATE_RETURN_VALUE, - ); - expect(result.current.gasErrors.gasPrice).toBeUndefined(); - expect(result.current.hasGasErrors).toBe(false); - }); - }); - }); - - describe('maxPriorityFee warning', () => { - describe('EIP1559 compliant estimates', () => { - beforeEach(() => { - configureEIP1559(); - }); - it('does not return maxPriorityFeeWarning if maxPriorityFee is > suggestedMaxPriorityFeePerGas', () => { - const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.gasWarnings.maxPriorityFee).toBeUndefined(); - }); - it('return maxPriorityFeeWarning if maxPriorityFee is < suggestedMaxPriorityFeePerGas', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxPriorityFeePerGasToUse: '1', - }); - expect(result.current.gasWarnings.maxPriorityFee).toBe( - GAS_FORM_ERRORS.MAX_PRIORITY_FEE_TOO_LOW, - ); - }); - it('return maxPriorityFeeWarning if maxPriorityFee is > gasFeeEstimates.high.suggestedMaxPriorityFeePerGas', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxPriorityFeePerGasToUse: '100', - }); - expect(result.current.gasWarnings.maxPriorityFee).toBe( - GAS_FORM_ERRORS.MAX_PRIORITY_FEE_HIGH_WARNING, - ); - }); - }); - describe('Legacy estimates', () => { - beforeEach(() => { - configureLegacy(); - }); - it('does not return maxPriorityFeeWarning if maxPriorityFee is < gasFeeEstimates.low.suggestedMaxPriorityFeePerGas', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxPriorityFeePerGasToUse: '1', - ...LEGACY_GAS_ESTIMATE_RETURN_VALUE, - }); - expect(result.current.gasWarnings.maxPriorityFee).toBeUndefined(); - expect(result.current.hasGasErrors).toBe(false); - }); - }); - }); - - describe('maxFee warning', () => { - describe('EIP1559 compliant estimates', () => { - beforeEach(() => { - configureEIP1559(); - }); - it('does not return maxFeeWarning if maxFee is > suggestedMaxFeePerGas', () => { - const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.gasWarnings.maxFee).toBeUndefined(); - }); - it('return maxFeeWarning if maxFee is < suggestedMaxFeePerGas', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxFeePerGasToUse: '20', - }); - expect(result.current.gasWarnings.maxFee).toBe( - GAS_FORM_ERRORS.MAX_FEE_TOO_LOW, - ); - }); - it('return maxFeeWarning if gasFeeEstimates are high and maxFee is > suggestedMaxFeePerGas', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxFeePerGasToUse: '1000', - }); - expect(result.current.gasWarnings.maxFee).toBe( - GAS_FORM_ERRORS.MAX_FEE_HIGH_WARNING, - ); - }); - }); - describe('Legacy estimates', () => { - beforeEach(() => { - configureLegacy(); - }); - it('does not return maxFeeWarning if maxFee is < suggestedMaxFeePerGas', () => { - const { result } = renderUseGasFeeErrorsHook({ - maxFeePerGasToUse: '1', - ...LEGACY_GAS_ESTIMATE_RETURN_VALUE, - }); - expect(result.current.gasWarnings.maxFee).toBeUndefined(); - }); - }); - }); - - describe('Balance Error', () => { - it('is false if balance is greater than transaction value', () => { - configureEIP1559(); - const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.balanceError).toBe(false); - }); - it('is true if balance is less than transaction value', () => { - configureLegacy(); - const { result } = renderUseGasFeeErrorsHook({ - transaction: { txParams: { type: '0x2', value: '0x440aa47cc2556' } }, - ...LEGACY_GAS_ESTIMATE_RETURN_VALUE, - }); - expect(result.current.balanceError).toBe(true); - }); - }); - - describe('estimatesUnavailableWarning', () => { - it('is false if supportsEIP1559 and gasEstimateType is fee-market', () => { - configureEIP1559(); - const { result } = renderUseGasFeeErrorsHook(); - expect(result.current.estimatesUnavailableWarning).toBe(false); - }); - it('is true if supportsEIP1559 and gasEstimateType is not fee-market', () => { - useSelector.mockImplementation( - generateUseSelectorRouter({ - checkNetworkAndAccountSupports1559Response: true, - }), - ); - const { result } = renderUseGasFeeErrorsHook( - LEGACY_GAS_ESTIMATE_RETURN_VALUE, - ); - expect(result.current.estimatesUnavailableWarning).toBe(true); - }); - }); -}); diff --git a/ui/hooks/useGasFeeEstimates.js b/ui/hooks/useGasFeeEstimates.js index d61c94527..1cd11ccc0 100644 --- a/ui/hooks/useGasFeeEstimates.js +++ b/ui/hooks/useGasFeeEstimates.js @@ -1,7 +1,6 @@ import isEqual from 'lodash/isEqual'; -import { shallowEqual, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; import { - getEstimatedGasFeeTimeBounds, getGasEstimateType, getGasFeeEstimates, getIsGasEstimatesLoading, @@ -11,16 +10,13 @@ import { useSafeGasEstimatePolling } from './useSafeGasEstimatePolling'; /** * @typedef {object} GasEstimates - * @property {GasEstimateTypes} gasEstimateType - The type of estimate provided * @property {import( * '@metamask/gas-fee-controller' * ).GasFeeState['gasFeeEstimates']} gasFeeEstimates - The estimate object - * @property {import( - * '@metamask/gas-fee-controller' - * ).GasFeeState['estimatedGasFeeTimeBounds']} [estimatedGasFeeTimeBounds] - - * estimated time boundaries for fee-market type estimates + * @property {object} gasEstimateType - The type of estimate provided * @property {boolean} isGasEstimateLoading - indicates whether the gas * estimates are currently loading. + * @property {boolean} isNetworkBusy - indicates whether the network is busy. */ /** @@ -29,15 +25,11 @@ import { useSafeGasEstimatePolling } from './useSafeGasEstimatePolling'; * GasFeeController that it is done requiring new gas estimates. Also checks * the returned gas estimate for validity on the current network. * - * @returns {GasFeeEstimates} GasFeeEstimates object + * @returns {GasEstimates} GasEstimates object */ export function useGasFeeEstimates() { const gasEstimateType = useSelector(getGasEstimateType); const gasFeeEstimates = useSelector(getGasFeeEstimates, isEqual); - const estimatedGasFeeTimeBounds = useSelector( - getEstimatedGasFeeTimeBounds, - shallowEqual, - ); const isGasEstimatesLoading = useSelector(getIsGasEstimatesLoading); const isNetworkBusy = useSelector(getIsNetworkBusy); useSafeGasEstimatePolling(); @@ -45,7 +37,6 @@ export function useGasFeeEstimates() { return { gasFeeEstimates, gasEstimateType, - estimatedGasFeeTimeBounds, isGasEstimatesLoading, isNetworkBusy, }; diff --git a/ui/hooks/useGasFeeEstimates.test.js b/ui/hooks/useGasFeeEstimates.test.js index 16af8ff38..6e7ef45b0 100644 --- a/ui/hooks/useGasFeeEstimates.test.js +++ b/ui/hooks/useGasFeeEstimates.test.js @@ -107,7 +107,6 @@ describe('useGasFeeEstimates', () => { expect(current).toMatchObject({ gasFeeEstimates: DEFAULT_OPTS.gasFeeEstimates, gasEstimateType: GAS_ESTIMATE_TYPES.LEGACY, - estimatedGasFeeTimeBounds: undefined, isGasEstimatesLoading: false, }); }); @@ -128,7 +127,6 @@ describe('useGasFeeEstimates', () => { expect(current).toMatchObject({ gasFeeEstimates, gasEstimateType: GAS_ESTIMATE_TYPES.ETH_GASPRICE, - estimatedGasFeeTimeBounds: undefined, isGasEstimatesLoading: false, }); }); @@ -170,7 +168,6 @@ describe('useGasFeeEstimates', () => { expect(current).toMatchObject({ gasFeeEstimates, gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, - estimatedGasFeeTimeBounds: undefined, isGasEstimatesLoading: false, }); }); @@ -189,7 +186,6 @@ describe('useGasFeeEstimates', () => { expect(current).toMatchObject({ gasFeeEstimates: {}, gasEstimateType: GAS_ESTIMATE_TYPES.NONE, - estimatedGasFeeTimeBounds: undefined, isGasEstimatesLoading: true, }); }); @@ -211,7 +207,6 @@ describe('useGasFeeEstimates', () => { expect(current).toMatchObject({ gasFeeEstimates: { gasPrice: '10' }, gasEstimateType: GAS_ESTIMATE_TYPES.LEGACY, - estimatedGasFeeTimeBounds: undefined, isGasEstimatesLoading: true, }); }); @@ -252,7 +247,6 @@ describe('useGasFeeEstimates', () => { expect(current).toMatchObject({ gasFeeEstimates, gasEstimateType: GAS_ESTIMATE_TYPES.FEE_MARKET, - estimatedGasFeeTimeBounds: undefined, isGasEstimatesLoading: true, }); }); diff --git a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js index 36c6739fd..1d43a3169 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js +++ b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js @@ -71,7 +71,7 @@ export default class ConfirmApproveContent extends Component { isContract: PropTypes.bool, hexTransactionTotal: PropTypes.string, isMultiLayerFeeNetwork: PropTypes.bool, - supportsEIP1559V2: PropTypes.bool, + supportsEIP1559: PropTypes.bool, assetName: PropTypes.string, tokenId: PropTypes.string, assetStandard: PropTypes.string, @@ -97,7 +97,7 @@ export default class ConfirmApproveContent extends Component { footer, noBorder, }) { - const { supportsEIP1559V2 } = this.props; + const { supportsEIP1559 } = this.props; const { t } = this.context; return (
{showHeader && (
- {supportsEIP1559V2 && title === t('transactionFee') ? null : ( + {supportsEIP1559 && title === t('transactionFee') ? null : ( <>
{symbol} @@ -118,7 +118,7 @@ export default class ConfirmApproveContent extends Component {
)} - {showEdit && (!showAdvanceGasFeeOptions || !supportsEIP1559V2) && ( + {showEdit && (!showAdvanceGasFeeOptions || !supportsEIP1559) && (
@@ -151,9 +151,9 @@ export default class ConfirmApproveContent extends Component { hexTransactionTotal, txData, isMultiLayerFeeNetwork, - supportsEIP1559V2, + supportsEIP1559, } = this.props; - if (!isMultiLayerFeeNetwork && supportsEIP1559V2) { + if (!isMultiLayerFeeNetwork && supportsEIP1559) { return ; } return ( diff --git a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.stories.js b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.stories.js index d2c6d59ca..edbff288d 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.stories.js +++ b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.stories.js @@ -97,7 +97,7 @@ export default { isMultiLayerFeeNetwork: { control: 'boolean', }, - supportsEIP1559V2: { + supportsEIP1559: { control: 'boolean', }, assetName: { diff --git a/ui/pages/confirm-approve/confirm-approve.js b/ui/pages/confirm-approve/confirm-approve.js index 12295b3fa..1dd08cd75 100644 --- a/ui/pages/confirm-approve/confirm-approve.js +++ b/ui/pages/confirm-approve/confirm-approve.js @@ -26,7 +26,6 @@ import { getRpcPrefsForCurrentProvider, getIsMultiLayerFeeNetwork, checkNetworkAndAccountSupports1559, - getEIP1559V2Enabled, getIsImprovedTokenAllowanceEnabled, } from '../../selectors'; import { useApproveTransaction } from '../../hooks/useApproveTransaction'; @@ -85,8 +84,7 @@ export default function ConfirmApprove({ const [submitWarning, setSubmitWarning] = useState(''); const [isContract, setIsContract] = useState(false); - const eip1559V2Enabled = useSelector(getEIP1559V2Enabled); - const supportsEIP1559V2 = eip1559V2Enabled && networkAndAccountSupports1559; + const supportsEIP1559 = networkAndAccountSupports1559; const improvedTokenAllowanceEnabled = useSelector( getIsImprovedTokenAllowanceEnabled, @@ -182,7 +180,7 @@ export default function ConfirmApprove({ hexTransactionTotal={hexTransactionTotal} txData={transaction} isMultiLayerFeeNetwork={isMultiLayerFeeNetwork} - supportsEIP1559V2={supportsEIP1559V2} + supportsEIP1559={supportsEIP1559} userAddress={userAddress} tokenAddress={tokenAddress} data={transactionData} @@ -194,14 +192,14 @@ export default function ConfirmApprove({ tokenSymbol={tokenSymbol} decimals={decimals} /> - {showCustomizeGasPopover && !supportsEIP1559V2 && ( + {showCustomizeGasPopover && !supportsEIP1559 && ( )} - {supportsEIP1559V2 && ( + {supportsEIP1559 && ( <> @@ -310,16 +308,16 @@ export default function ConfirmApprove({ rpcPrefs={rpcPrefs} isContract={isContract} isMultiLayerFeeNetwork={isMultiLayerFeeNetwork} - supportsEIP1559V2={supportsEIP1559V2} + supportsEIP1559={supportsEIP1559} /> - {showCustomizeGasPopover && !supportsEIP1559V2 && ( + {showCustomizeGasPopover && !supportsEIP1559 && ( )} - {supportsEIP1559V2 && ( + {supportsEIP1559 && ( <> diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js index 1d3e9e133..c5dddfdaa 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -158,7 +158,6 @@ export default class ConfirmTransactionBase extends Component { supportsEIP1559: PropTypes.bool, hardwareWalletRequiresConnection: PropTypes.bool, isMultiLayerFeeNetwork: PropTypes.bool, - eip1559V2Enabled: PropTypes.bool, isBuyableChain: PropTypes.bool, isApprovalOrRejection: PropTypes.bool, ///: BEGIN:ONLY_INCLUDE_IN(flask) @@ -466,7 +465,7 @@ export default class ConfirmTransactionBase extends Component { ) : null; const renderGasDetailsItem = () => { - return this.supportsEIP1559V2 ? ( + return this.supportsEIP1559 ? ( this.handleCloseEditGas()} currentTransaction={txData} - supportsEIP1559V2={this.supportsEIP1559V2} + supportsEIP1559={this.supportsEIP1559} nativeCurrency={nativeCurrency} isApprovalOrRejection={isApprovalOrRejection} assetStandard={assetStandard} diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js index 28be31ed9..be74a6c78 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -32,7 +32,6 @@ import { doesAddressRequireLedgerHidConnection, getTokenList, getIsMultiLayerFeeNetwork, - getEIP1559V2Enabled, getIsBuyableChain, getEnsResolutionByAddress, getUnapprovedTransaction, @@ -194,7 +193,6 @@ const mapStateToProps = (state, ownProps) => { doesAddressRequireLedgerHidConnection(state, fromAddress); const isMultiLayerFeeNetwork = getIsMultiLayerFeeNetwork(state); - const eip1559V2Enabled = getEIP1559V2Enabled(state); ///: BEGIN:ONLY_INCLUDE_IN(flask) const insightSnaps = getInsightSnaps(state); @@ -250,7 +248,6 @@ const mapStateToProps = (state, ownProps) => { hardwareWalletRequiresConnection, isMultiLayerFeeNetwork, chainId, - eip1559V2Enabled, isBuyableChain, ///: BEGIN:ONLY_INCLUDE_IN(flask) insightSnaps, diff --git a/ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js b/ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js index def97fca4..b4add8613 100644 --- a/ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js +++ b/ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js @@ -15,18 +15,14 @@ const TransactionAlerts = ({ userAcknowledgedGasMissing, setUserAcknowledgedGasMissing, }) => { - const { estimateUsed, hasSimulationError, supportsEIP1559V2, isNetworkBusy } = + const { estimateUsed, hasSimulationError, supportsEIP1559, isNetworkBusy } = useGasFeeContext(); const pendingTransactions = useSelector(submittedPendingTransactionsSelector); const t = useI18nContext(); - if (!supportsEIP1559V2) { - return null; - } - return (
- {hasSimulationError && ( + {supportsEIP1559 && hasSimulationError && ( )} - {pendingTransactions?.length > 0 && ( + {supportsEIP1559 && pendingTransactions?.length > 0 && ( )} - {isNetworkBusy ? ( + {supportsEIP1559 && isNetworkBusy ? ( { - describe('when supportsEIP1559V2 from useGasFeeContext is truthy', () => { + describe('when supportsEIP1559 from useGasFeeContext is truthy', () => { describe('if hasSimulationError from useGasFeeContext is true', () => { it('informs the user that a simulation of the transaction failed', () => { const { getByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, hasSimulationError: true, }, }); @@ -50,7 +50,7 @@ describe('TransactionAlerts', () => { it('offers the user an option to bypass the warning', () => { const { getByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, hasSimulationError: true, }, }); @@ -61,7 +61,7 @@ describe('TransactionAlerts', () => { const setUserAcknowledgedGasMissing = jest.fn(); const { getByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, hasSimulationError: true, }, componentProps: { setUserAcknowledgedGasMissing }, @@ -75,7 +75,7 @@ describe('TransactionAlerts', () => { it('does not offer the user an option to bypass the warning', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, hasSimulationError: true, }, componentProps: { userAcknowledgedGasMissing: true }, @@ -91,7 +91,7 @@ describe('TransactionAlerts', () => { it('does not inform the user that a simulation of the transaction failed', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, }, }); expect( @@ -105,7 +105,7 @@ describe('TransactionAlerts', () => { describe('if the length of pendingTransactions is 1', () => { it('informs the user that they have a pending transaction', () => { const { getByText } = render({ - useGasFeeContextValue: { supportsEIP1559V2: true }, + useGasFeeContextValue: { supportsEIP1559: true }, submittedPendingTransactionsSelectorValue: [{ some: 'transaction' }], }); expect( @@ -117,7 +117,7 @@ describe('TransactionAlerts', () => { describe('if the length of pendingTransactions is more than 1', () => { it('informs the user that they have pending transactions', () => { const { getByText } = render({ - useGasFeeContextValue: { supportsEIP1559V2: true }, + useGasFeeContextValue: { supportsEIP1559: true }, submittedPendingTransactionsSelectorValue: [ { some: 'transaction' }, { some: 'transaction' }, @@ -132,7 +132,7 @@ describe('TransactionAlerts', () => { describe('if the length of pendingTransactions is 0', () => { it('does not inform the user that they have pending transactions', () => { const { queryByText } = render({ - useGasFeeContextValue: { supportsEIP1559V2: true }, + useGasFeeContextValue: { supportsEIP1559: true }, submittedPendingTransactionsSelectorValue: [], }); expect( @@ -145,7 +145,7 @@ describe('TransactionAlerts', () => { it('does not inform the user that they have insufficient funds', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, balanceError: false, }, }); @@ -157,7 +157,7 @@ describe('TransactionAlerts', () => { it('informs the user that the current transaction is queued', () => { const { getByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, estimateUsed: 'low', }, }); @@ -171,7 +171,7 @@ describe('TransactionAlerts', () => { it('does not inform the user that the current transaction is queued', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, estimateUsed: 'something_else', }, }); @@ -185,7 +185,7 @@ describe('TransactionAlerts', () => { it('informs the user that the network is busy', () => { const { getByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, isNetworkBusy: true, }, }); @@ -201,7 +201,7 @@ describe('TransactionAlerts', () => { it('does not inform the user that the network is busy', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: true, + supportsEIP1559: true, isNetworkBusy: false, }, }); @@ -214,12 +214,12 @@ describe('TransactionAlerts', () => { }); }); - describe('when supportsEIP1559V2 from useGasFeeContext is falsy', () => { + describe('when supportsEIP1559 from useGasFeeContext is falsy', () => { describe('if hasSimulationError from useGasFeeContext is true', () => { it('does not inform the user that a simulation of the transaction failed', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: false, + supportsEIP1559: false, hasSimulationError: true, }, }); @@ -233,9 +233,9 @@ describe('TransactionAlerts', () => { }); describe('if the length of pendingTransactions is at least 1', () => { - it('informs the user that they have a pending transaction', () => { + it('does not informs the user that they have a pending transaction', () => { const { queryByText } = render({ - useGasFeeContextValue: { supportsEIP1559V2: false }, + useGasFeeContextValue: { supportsEIP1559: false }, submittedPendingTransactionsSelectorValue: [{ some: 'transaction' }], }); expect( @@ -248,7 +248,7 @@ describe('TransactionAlerts', () => { it('informs the user that they have insufficient funds', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: false, + supportsEIP1559: false, balanceError: true, }, }); @@ -260,7 +260,7 @@ describe('TransactionAlerts', () => { it('informs the user that the current transaction is queued', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: false, + supportsEIP1559: false, estimateUsed: 'low', }, }); @@ -276,7 +276,7 @@ describe('TransactionAlerts', () => { it('does not inform the user that the network is busy', () => { const { queryByText } = render({ useGasFeeContextValue: { - supportsEIP1559V2: false, + supportsEIP1559: false, isNetworkBusy: true, }, }); diff --git a/ui/pages/send/gas-display/gas-display.js b/ui/pages/send/gas-display/gas-display.js index 3bc48c6ee..ce1d7217f 100644 --- a/ui/pages/send/gas-display/gas-display.js +++ b/ui/pages/send/gas-display/gas-display.js @@ -5,7 +5,6 @@ import classNames from 'classnames'; import { I18nContext } from '../../../contexts/i18n'; import { useGasFeeContext } from '../../../contexts/gasFee'; import { PRIMARY, SECONDARY } from '../../../helpers/constants/common'; -import { isLegacyTransaction } from '../../../helpers/utils/transactions.util'; import { hexWEIToDecGWEI } from '../../../../shared/lib/transactions-controller-utils'; import UserPreferencedCurrencyDisplay from '../../../components/app/user-preferenced-currency-display'; import GasTiming from '../../../components/app/gas-timing'; @@ -39,8 +38,6 @@ import { getIsBuyableChain, transactionFeeSelector, getIsMainnet, - getEIP1559V2Enabled, - checkNetworkAndAccountSupports1559, } from '../../../selectors'; import { @@ -60,25 +57,15 @@ export default function GasDisplay({ gasError }) { const isMainnet = useSelector(getIsMainnet); const isBuyableChain = useSelector(getIsBuyableChain); const draftTransaction = useSelector(getCurrentDraftTransaction); - const eip1559V2Enabled = useSelector(getEIP1559V2Enabled); - const networkAndAccountSupports1559 = useSelector( - checkNetworkAndAccountSupports1559, - ); const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); const { nativeCurrency, provider, unapprovedTxs } = useSelector( (state) => state.metamask, ); - const { confirmTransaction } = useSelector((state) => state); - const { txData } = confirmTransaction; - const { txParams = {} } = txData; - const supportsEIP1559 = - networkAndAccountSupports1559 && !isLegacyTransaction(txParams); const { chainId } = provider; const networkName = NETWORK_TO_NAME_MAP[chainId]; const isInsufficientTokenError = draftTransaction?.amount.error === INSUFFICIENT_TOKENS_ERROR; const editingTransaction = unapprovedTxs[draftTransaction.id]; - const supportsEIP1559V2 = eip1559V2Enabled && supportsEIP1559; const transactionData = { txParams: { @@ -166,194 +153,89 @@ export default function GasDisplay({ gasError }) { - {t('gas')} - - ({t('transactionDetailGasInfoV2')}) - - - - {t('transactionDetailGasTooltipIntro', [ - isMainnet ? t('networkNameEthereum') : '', - ])} - - - {t('transactionDetailGasTooltipExplanation')} - - - - {t('transactionDetailGasTooltipConversion')} - - - - } - position="right" - /> - - } - detailTitleColor={COLORS.TEXT_DEFAULT} - detailText={ - - - - - } - detailTotal={ - - - - - } - subText={ - <> - - - - - {estimateUsed === 'high' && '⚠ '} - {t('editGasSubTextFeeLabel')} - - - - - - - - - } - subTitle={ - + {t('gas')} + + ({t('transactionDetailGasInfoV2')}) + + + + {t('transactionDetailGasTooltipIntro', [ + isMainnet ? t('networkNameEthereum') : '', + ])} + + + {t('transactionDetailGasTooltipExplanation')} + + + + {t('transactionDetailGasTooltipConversion')} + + + + } + position="right" /> - } - /> - ) : ( - - {t('transactionDetailGasHeading')} - -

- {t('transactionDetailGasTooltipIntro', [ - isMainnet ? t('networkNameEthereum') : '', - ])} -

-

{t('transactionDetailGasTooltipExplanation')}

-

- - {t('transactionDetailGasTooltipConversion')} - -

- - } - position="right" - > - -
- - } - detailText={ + + } + detailTitleColor={COLORS.TEXT_DEFAULT} + detailText={ + + + + + } + detailTotal={ + + + + + } + subText={ + <> - - - - } - detailTotal={ - - - - - } - subText={ - <> - - {t('editGasSubTextFeeLabel')} - + + + + {estimateUsed === 'high' && '⚠ '} + {t('editGasSubTextFeeLabel')} + + - + - - } - subTitle={ - <> - - - } - /> - ), + + + } + subTitle={ + + } + />, (gasError || isInsufficientTokenError) && ( - Estimated gas fee
-
-
- + Gas +
+ + ( + estimated + ) + +
+
+
- - + + + +
@@ -225,7 +240,7 @@ exports[`SendContent Component render should match snapshot 1`] = ` class="box box--margin-top-1 box--margin-bottom-1 box--flex-direction-row typography typography--h6 typography--weight-normal typography--style-normal typography--color-text-alternative" >
- 0.000032 + 0.0000315
Unknown processing time - -
-
-
- - - -
-
-
- - Max fee: -
- - + Max fee: + +
+
+
- 0.0000315 - - - ETH - + + + 0.0000315 + + + ETH + +
diff --git a/ui/pages/settings/experimental-tab/experimental-tab.component.js b/ui/pages/settings/experimental-tab/experimental-tab.component.js index 139d48134..a048ed2a7 100644 --- a/ui/pages/settings/experimental-tab/experimental-tab.component.js +++ b/ui/pages/settings/experimental-tab/experimental-tab.component.js @@ -18,8 +18,6 @@ export default class ExperimentalTab extends PureComponent { setUseNftDetection: PropTypes.func, setOpenSeaEnabled: PropTypes.func, openSeaEnabled: PropTypes.bool, - eip1559V2Enabled: PropTypes.bool, - setEIP1559V2Enabled: PropTypes.func, improvedTokenAllowanceEnabled: PropTypes.bool, setImprovedTokenAllowanceEnabled: PropTypes.func, transactionSecurityCheckEnabled: PropTypes.bool, @@ -149,51 +147,6 @@ export default class ExperimentalTab extends PureComponent { ); } - renderEIP1559V2EnabledToggle() { - const { t } = this.context; - const { eip1559V2Enabled, setEIP1559V2Enabled } = this.props; - - return ( -
-
- {t('enableEIP1559V2')} -
- {t('enableEIP1559V2Description', [ - - {t('learnMoreUpperCase')} - , - ])} -
-
-
-
- { - this.context.trackEvent({ - category: EVENT.CATEGORIES.SETTINGS, - event: 'Enable/Disable Advanced Gas UI', - properties: { - action: 'Enable/Disable Advanced Gas UI', - legacy_event: true, - }, - }); - setEIP1559V2Enabled(!value); - }} - offLabel={t('off')} - onLabel={t('on')} - /> -
-
-
- ); - } - renderImprovedTokenAllowanceToggle() { const { t } = this.context; const { improvedTokenAllowanceEnabled, setImprovedTokenAllowanceEnabled } = @@ -279,7 +232,6 @@ export default class ExperimentalTab extends PureComponent { {this.renderImprovedTokenAllowanceToggle()} {this.renderOpenSeaEnabledToggle()} {this.renderCollectibleDetectionToggle()} - {this.renderEIP1559V2EnabledToggle()}
); } diff --git a/ui/pages/settings/experimental-tab/experimental-tab.container.js b/ui/pages/settings/experimental-tab/experimental-tab.container.js index d4e082ef5..8d028d5a9 100644 --- a/ui/pages/settings/experimental-tab/experimental-tab.container.js +++ b/ui/pages/settings/experimental-tab/experimental-tab.container.js @@ -4,14 +4,12 @@ import { withRouter } from 'react-router-dom'; import { setUseNftDetection, setOpenSeaEnabled, - setEIP1559V2Enabled, setImprovedTokenAllowanceEnabled, setTransactionSecurityCheckEnabled, } from '../../../store/actions'; import { getUseNftDetection, getOpenSeaEnabled, - getEIP1559V2Enabled, getIsImprovedTokenAllowanceEnabled, getIsTransactionSecurityCheckEnabled, } from '../../../selectors'; @@ -21,7 +19,6 @@ const mapStateToProps = (state) => { return { useNftDetection: getUseNftDetection(state), openSeaEnabled: getOpenSeaEnabled(state), - eip1559V2Enabled: getEIP1559V2Enabled(state), improvedTokenAllowanceEnabled: getIsImprovedTokenAllowanceEnabled(state), transactionSecurityCheckEnabled: getIsTransactionSecurityCheckEnabled(state), @@ -32,7 +29,6 @@ const mapDispatchToProps = (dispatch) => { return { setUseNftDetection: (val) => dispatch(setUseNftDetection(val)), setOpenSeaEnabled: (val) => dispatch(setOpenSeaEnabled(val)), - setEIP1559V2Enabled: (val) => dispatch(setEIP1559V2Enabled(val)), setImprovedTokenAllowanceEnabled: (val) => dispatch(setImprovedTokenAllowanceEnabled(val)), setTransactionSecurityCheckEnabled: (val) => diff --git a/ui/pages/settings/experimental-tab/experimental-tab.test.js b/ui/pages/settings/experimental-tab/experimental-tab.test.js index bb057fff0..aec08bb81 100644 --- a/ui/pages/settings/experimental-tab/experimental-tab.test.js +++ b/ui/pages/settings/experimental-tab/experimental-tab.test.js @@ -1,5 +1,4 @@ import React from 'react'; -import { screen } from '@testing-library/react'; import { renderWithProvider } from '../../../../test/jest'; import configureStore from '../../../store/store'; import mockState from '../../../../test/data/mock-state.json'; @@ -15,8 +14,9 @@ const render = () => { }; describe('ExperimentalTab', () => { - it('renders ExperimentalTab component and shows Enable enhanced gas fee UI text', () => { - render(); - expect(screen.getByText('Enable enhanced gas fee UI')).toBeInTheDocument(); + it('renders ExperimentalTab component without error', () => { + expect(() => { + render(); + }).not.toThrow(); }); }); diff --git a/ui/pages/swaps/fee-card/fee-card.stories.js b/ui/pages/swaps/fee-card/fee-card.stories.js index 252eb233d..280bfd6ee 100644 --- a/ui/pages/swaps/fee-card/fee-card.stories.js +++ b/ui/pages/swaps/fee-card/fee-card.stories.js @@ -80,11 +80,6 @@ export default { type: 'boolean', }, }, - supportsEIP1559V2: { - control: { - type: 'boolean', - }, - }, }, args: { primaryFee: '1 ETH', diff --git a/ui/pages/swaps/fee-card/fee-card.test.js b/ui/pages/swaps/fee-card/fee-card.test.js index a5daa5467..7a696aa64 100644 --- a/ui/pages/swaps/fee-card/fee-card.test.js +++ b/ui/pages/swaps/fee-card/fee-card.test.js @@ -85,7 +85,6 @@ const createProps = (customProps = {}) => { tokenConversionRate: 0.015, chainId: CHAIN_IDS.MAINNET, networkAndAccountSupports1559: false, - supportsEIP1559V2: false, ...customProps, }; }; diff --git a/ui/pages/token-allowance/token-allowance.js b/ui/pages/token-allowance/token-allowance.js index 1573e2a56..478d54be7 100644 --- a/ui/pages/token-allowance/token-allowance.js +++ b/ui/pages/token-allowance/token-allowance.js @@ -58,7 +58,7 @@ export default function TokenAllowance({ hexTransactionTotal, txData, isMultiLayerFeeNetwork, - supportsEIP1559V2, + supportsEIP1559, userAddress, tokenAddress, data, @@ -351,7 +351,7 @@ export default function TokenAllowance({ onEditClick={showCustomizeGasModal} renderTransactionDetailsContent noBorder={useNonceField || !showFullTxDetails} - supportsEIP1559V2={supportsEIP1559V2} + supportsEIP1559={supportsEIP1559} isMultiLayerFeeNetwork={isMultiLayerFeeNetwork} ethTransactionTotal={ethTransactionTotal} nativeCurrency={nativeCurrency} @@ -399,7 +399,7 @@ export default function TokenAllowance({ title={t('data')} renderDataContent noBorder - supportsEIP1559V2={supportsEIP1559V2} + supportsEIP1559={supportsEIP1559} isSetApproveForAll={isSetApproveForAll} isApprovalOrRejection={isApprovalOrRejection} data={customTxParamsData || data} @@ -478,7 +478,7 @@ TokenAllowance.propTypes = { /** * Is the enhanced gas fee enabled or not */ - supportsEIP1559V2: PropTypes.bool, + supportsEIP1559: PropTypes.bool, /** * User's address */ diff --git a/ui/pages/token-allowance/token-allowance.stories.js b/ui/pages/token-allowance/token-allowance.stories.js index 9335cf863..feaf62d05 100644 --- a/ui/pages/token-allowance/token-allowance.stories.js +++ b/ui/pages/token-allowance/token-allowance.stories.js @@ -35,7 +35,7 @@ export default { isMultiLayerFeeNetwork: { control: 'text', }, - supportsEIP1559V2: { + supportsEIP1559: { control: 'boolean', }, userAddress: { @@ -82,7 +82,7 @@ export default { fiatTransactionTotal: '1.6', hexTransactionTotal: '0x44364c5bb0000', isMultiLayerFeeNetwork: false, - supportsEIP1559V2: false, + supportsEIP1559: false, userAddress: '0xdd34b35ca1de17dfcdc07f79ff1f8f94868c40a1', tokenAddress: '0x55797717b9947b31306f4aac7ad1365c6e3923bd', data: '0x095ea7b30000000000000000000000009bc5baf874d2da8d216ae9f137804184ee5afef40000000000000000000000000000000000000000000000000000000000011170', diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 317c9ef5d..de6933bda 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -1160,10 +1160,6 @@ export function getAdvancedGasFeeValues(state) { return state.metamask.advancedGasFee; } -export function getEIP1559V2Enabled(state) { - return state.metamask.eip1559V2Enabled; -} - /** * To check if the user has set advanced gas fee settings as default with a non empty maxBaseFee and priotityFee. * diff --git a/ui/store/actions.js b/ui/store/actions.js index 4e1914099..4303ec9c4 100644 --- a/ui/store/actions.js +++ b/ui/store/actions.js @@ -1979,7 +1979,7 @@ export function clearPendingTokens() { }; } -export function createCancelTransaction(txId, customGasSettings, options) { +export function createCancelTransaction(txId, customGasSettings, options = {}) { log.debug('background.cancelTransaction'); let newTxId; @@ -2009,7 +2009,11 @@ export function createCancelTransaction(txId, customGasSettings, options) { }; } -export function createSpeedUpTransaction(txId, customGasSettings, options) { +export function createSpeedUpTransaction( + txId, + customGasSettings, + options = {}, +) { log.debug('background.createSpeedUpTransaction'); let newTx; @@ -2780,18 +2784,6 @@ export function setAdvancedGasFee(val) { }; } -export function setEIP1559V2Enabled(val) { - return async (dispatch) => { - dispatch(showLoadingIndication()); - log.debug(`background.setEIP1559V2Enabled`); - try { - await submitRequestToBackground('setEIP1559V2Enabled', [val]); - } finally { - dispatch(hideLoadingIndication()); - } - }; -} - export function setTheme(val) { return async (dispatch) => { dispatch(showLoadingIndication()); @@ -3798,10 +3790,6 @@ export function setCollectiblesDetectionNoticeDismissed() { ]); } -export function setEnableEIP1559V2NoticeDismissed() { - return submitRequestToBackground('setEnableEIP1559V2NoticeDismissed', [true]); -} - export function setImprovedTokenAllowanceEnabled( improvedTokenAllowanceEnabled, ) {