1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

EIP-1559 V2: Use default gas preferences of user for all transactions (#13238)

This commit is contained in:
Niranjana Binoy 2022-01-10 14:34:54 -05:00 committed by GitHub
parent 4d7689b2df
commit cd0892a3af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 67 additions and 350 deletions

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "Η μέγιστη βασική χρέωση τέλους είναι χαμηλή για τις τρέχουσες συνθήκες δικτύου" "message": "Η μέγιστη βασική χρέωση τέλους είναι χαμηλή για τις τρέχουσες συνθήκες δικτύου"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "Ο πολλαπλασιαστής είναι χαμηλός σε σχέση με το τέλος Προτεραιότητας"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "Η μέγιστη χρέωση είναι υψηλότερη από το απαραίτητο" "message": "Η μέγιστη χρέωση είναι υψηλότερη από το απαραίτητο"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "Αυτό μειώνει τη μέγιστη χρέωση αλλά αν η κίνηση δικτύου αυξήσει την συναλλαγή σας μπορεί να καθυστερήσει ή να αποτύχει." "message": "Αυτό μειώνει τη μέγιστη χρέωση αλλά αν η κίνηση δικτύου αυξήσει την συναλλαγή σας μπορεί να καθυστερήσει ή να αποτύχει."
}, },
"editInGwei": {
"message": "Επεξεργασία στο GWEI"
},
"editInMultiplier": {
"message": "Επεξεργασία στον πολλαπλασιαστή"
},
"editNonceField": { "editNonceField": {
"message": "Επεξεργασία Nonce" "message": "Επεξεργασία Nonce"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "Η λειτουργία 'Συγχρονισμός με επέκταση' είναι προσωρινά απενεργοποιημένη. Αν θέλετε να χρησιμοποιήσετε το πορτοφόλι της επέκτασής σας στο MetaMask mobile, τότε στην εφαρμογή για το κινητό σας: επιστρέψτε στις επιλογές εγκατάστασης του πορτοφολιού και επιλέξτε την επιλογή 'Εισαγωγή με Μυστική Φράση Ανάκτησης'. Χρησιμοποιήστε τη μυστική φράση του πορτοφολιού της επέκτασής σας για να εισαγάγετε το πορτοφόλι σας στο κινητό." "message": "Η λειτουργία 'Συγχρονισμός με επέκταση' είναι προσωρινά απενεργοποιημένη. Αν θέλετε να χρησιμοποιήσετε το πορτοφόλι της επέκτασής σας στο MetaMask mobile, τότε στην εφαρμογή για το κινητό σας: επιστρέψτε στις επιλογές εγκατάστασης του πορτοφολιού και επιλέξτε την επιλογή 'Εισαγωγή με Μυστική Φράση Ανάκτησης'. Χρησιμοποιήστε τη μυστική φράση του πορτοφολιού της επέκτασής σας για να εισαγάγετε το πορτοφόλι σας στο κινητό."
}, },
"multiplier": {
"message": "πολλαπλασιαστής"
},
"mustSelectOne": { "mustSelectOne": {
"message": "Πρέπει να επιλέξετε 1 τουλάχιστον διακριτικό." "message": "Πρέπει να επιλέξετε 1 τουλάχιστον διακριτικό."
}, },

View File

@ -857,9 +857,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "Max base fee is low for current network conditions" "message": "Max base fee is low for current network conditions"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "Multiplier is low relative to Priority fee"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "Max fee is higher than necessary" "message": "Max fee is higher than necessary"
}, },
@ -921,12 +918,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "This lowers your maximum fee but if network traffic increases your transaction may be delayed or fail." "message": "This lowers your maximum fee but if network traffic increases your transaction may be delayed or fail."
}, },
"editInGwei": {
"message": "Edit in GWEI"
},
"editInMultiplier": {
"message": "Edit in multiplier"
},
"editNonceField": { "editNonceField": {
"message": "Edit Nonce" "message": "Edit Nonce"
}, },
@ -1298,6 +1289,9 @@
"grantedToWithColon": { "grantedToWithColon": {
"message": "Granted to:" "message": "Granted to:"
}, },
"gwei": {
"message": "GWEI"
},
"happyToSeeYou": { "happyToSeeYou": {
"message": "Were happy to see you." "message": "Were happy to see you."
}, },
@ -1752,9 +1746,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "The 'Sync with extension' feature is temporarily disabled. If you want to use your extension wallet on MetaMask mobile, then on your mobile app: go back to the wallet setup options and select the 'Import with Secret Recovery Phrase' option. Use your extension wallet's secret phrase to then import your wallet into mobile." "message": "The 'Sync with extension' feature is temporarily disabled. If you want to use your extension wallet on MetaMask mobile, then on your mobile app: go back to the wallet setup options and select the 'Import with Secret Recovery Phrase' option. Use your extension wallet's secret phrase to then import your wallet into mobile."
}, },
"multiplier": {
"message": "multiplier"
},
"mustSelectOne": { "mustSelectOne": {
"message": "Must select at least 1 token." "message": "Must select at least 1 token."
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "Les frais de base maximaux sont faibles par rapport aux conditions actuelles du réseau" "message": "Les frais de base maximaux sont faibles par rapport aux conditions actuelles du réseau"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "Le multiplicateur est faible par rapport aux frais de priorité"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "Les frais maximaux sont plus élevés que nécessaire" "message": "Les frais maximaux sont plus élevés que nécessaire"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "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." "message": "Cela réduit vos frais maximaux, mais si le trafic réseau augmente, votre transaction peut être retardée ou ne pas aboutir."
}, },
"editInGwei": {
"message": "Modifier dans GWEI"
},
"editInMultiplier": {
"message": "Modifier le multiplicateur"
},
"editNonceField": { "editNonceField": {
"message": "Modifier le nonce" "message": "Modifier le nonce"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "La fonction «Synchronisation avec lextension» est temporairement désactivée. Si vous souhaitez utiliser votre portefeuille dextension sur MetaMask mobile: sur votre appli mobile, revenez aux options de configuration du portefeuille et sélectionnez loption «Importation avec Phrase secrète de récupération». Utilisez la phrase secrète de votre portefeuille dextension pour importer celui-ci sur votre mobile." "message": "La fonction «Synchronisation avec lextension» est temporairement désactivée. Si vous souhaitez utiliser votre portefeuille dextension sur MetaMask mobile: sur votre appli mobile, revenez aux options de configuration du portefeuille et sélectionnez loption «Importation avec Phrase secrète de récupération». Utilisez la phrase secrète de votre portefeuille dextension pour importer celui-ci sur votre mobile."
}, },
"multiplier": {
"message": "multiplicateur"
},
"mustSelectOne": { "mustSelectOne": {
"message": "Vous devez selectionner au moins 1 jeton." "message": "Vous devez selectionner au moins 1 jeton."
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "मौजूदा नेटवर्क स्थितियों के लिए अधिकतम आधार शुल्क कम है" "message": "मौजूदा नेटवर्क स्थितियों के लिए अधिकतम आधार शुल्क कम है"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "प्राथमिकता शुल्क के सापेक्ष गुणक कम है"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "अधिकतम शुल्क आवश्यकता से अधिक है" "message": "अधिकतम शुल्क आवश्यकता से अधिक है"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "यह आपके अधिकतम शुल्क को कम करता है लेकिन यदि नेटवर्क ट्रैफ़िक बढ़ता है तो आपके लेन-देन में देरी हो सकती है या लेन-देन विफल हो सकता है।" "message": "यह आपके अधिकतम शुल्क को कम करता है लेकिन यदि नेटवर्क ट्रैफ़िक बढ़ता है तो आपके लेन-देन में देरी हो सकती है या लेन-देन विफल हो सकता है।"
}, },
"editInGwei": {
"message": "GWEI में संपादित करें"
},
"editInMultiplier": {
"message": "गुणक में संपादित करें"
},
"editNonceField": { "editNonceField": {
"message": "नॉन्स संपादित करें" "message": "नॉन्स संपादित करें"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "'एक्सटेंशन के साथ सिंक' फीचर अस्थायी रूप से अक्षम है। यदि आप MetaMask मोबाइल पर अपने एक्सटेंशन वॉलेट का उपयोग करना चाहते हैं, तो अपने मोबाइल ऐप पर: वॉलेट सेटअप ऑप्शन पर वापस जाएं और 'सीक्रेट रिकवरी फ्रेज़ के साथ इम्पोर्ट करें' विकल्प चुनें। फिर अपने वॉलेट को मोबाइल में इम्पोर्ट करने के लिए अपने एक्सटेंशन वॉलेट के सीक्रेट फ्रेज़ का उपयोग करें।" "message": "'एक्सटेंशन के साथ सिंक' फीचर अस्थायी रूप से अक्षम है। यदि आप MetaMask मोबाइल पर अपने एक्सटेंशन वॉलेट का उपयोग करना चाहते हैं, तो अपने मोबाइल ऐप पर: वॉलेट सेटअप ऑप्शन पर वापस जाएं और 'सीक्रेट रिकवरी फ्रेज़ के साथ इम्पोर्ट करें' विकल्प चुनें। फिर अपने वॉलेट को मोबाइल में इम्पोर्ट करने के लिए अपने एक्सटेंशन वॉलेट के सीक्रेट फ्रेज़ का उपयोग करें।"
}, },
"multiplier": {
"message": "गुणक"
},
"mustSelectOne": { "mustSelectOne": {
"message": "कम से कम 1 टोकन का चयन करना चाहिए।" "message": "कम से कम 1 टोकन का चयन करना चाहिए।"
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "Biaya dasar maks rendah untuk kondisi jaringan saat ini" "message": "Biaya dasar maks rendah untuk kondisi jaringan saat ini"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "Pengganda relatif rendah terhadap biaya Prioritas"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "Biaya maks lebih tinggi dari yang diperlukan" "message": "Biaya maks lebih tinggi dari yang diperlukan"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "Ini akan menurunkan biaya maks Anda, tetapi jika lalu lintas jaringan meningkat, transaksi Anda mungkin tertunda atau gagal." "message": "Ini akan menurunkan biaya maks Anda, tetapi jika lalu lintas jaringan meningkat, transaksi Anda mungkin tertunda atau gagal."
}, },
"editInGwei": {
"message": "Edit dalam GWEI"
},
"editInMultiplier": {
"message": "Edit dalam pengganda"
},
"editNonceField": { "editNonceField": {
"message": "Edit Nonce" "message": "Edit Nonce"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "Fitur 'Sinkronkan dengan ekstensi' dinonaktifkan untuk sementara waktu. Jika Anda ingin menggunakan dompet ekstensi Anda di ponsel MetaMask, maka pada aplikasi seluler Anda: kembali ke opsi pengaturan dompet dan pilih opsi 'Impor dengan Frasa Pemulihan Rahasia'. Gunakan frasa rahasia dompet ekstensi Anda untuk mengimpor dompet Anda ke ponsel nantinya." "message": "Fitur 'Sinkronkan dengan ekstensi' dinonaktifkan untuk sementara waktu. Jika Anda ingin menggunakan dompet ekstensi Anda di ponsel MetaMask, maka pada aplikasi seluler Anda: kembali ke opsi pengaturan dompet dan pilih opsi 'Impor dengan Frasa Pemulihan Rahasia'. Gunakan frasa rahasia dompet ekstensi Anda untuk mengimpor dompet Anda ke ponsel nantinya."
}, },
"multiplier": {
"message": "pengganda"
},
"mustSelectOne": { "mustSelectOne": {
"message": "Harus memilih sekurangnya 1 token." "message": "Harus memilih sekurangnya 1 token."
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "現在のネットワーク状況に対して最大基本手数料が低いです" "message": "現在のネットワーク状況に対して最大基本手数料が低いです"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "優先手数料に対して乗数が低いです"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "最大手数料が必要以上です" "message": "最大手数料が必要以上です"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "これにより最大手数料は下がりますが、ネットワークトラフィックが増加するとトランザクションが遅延または失敗する可能性があります。" "message": "これにより最大手数料は下がりますが、ネットワークトラフィックが増加するとトランザクションが遅延または失敗する可能性があります。"
}, },
"editInGwei": {
"message": "GWEIで編集"
},
"editInMultiplier": {
"message": "乗数で編集"
},
"editNonceField": { "editNonceField": {
"message": "ナンスの編集" "message": "ナンスの編集"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "「拡張機能と同期」機能は一時的に無効になっています。拡張ウォレットをMetaMaskモバイルで使用する場合は、モバイルアプリでウォレットの設定オプションに戻り、「シークレットリカバリーフレーズでインポート」オプションを選択します。拡張ウォレットのシークレットフレーズを使用して、ウォレットをモバイルにインポートします。" "message": "「拡張機能と同期」機能は一時的に無効になっています。拡張ウォレットをMetaMaskモバイルで使用する場合は、モバイルアプリでウォレットの設定オプションに戻り、「シークレットリカバリーフレーズでインポート」オプションを選択します。拡張ウォレットのシークレットフレーズを使用して、ウォレットをモバイルにインポートします。"
}, },
"multiplier": {
"message": "乗数"
},
"mustSelectOne": { "mustSelectOne": {
"message": "トークンを 1 つ以上選択する必要があります。" "message": "トークンを 1 つ以上選択する必要があります。"
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "최대 기본 요금이 현재 네트워크 조건에 비해 낮습니다." "message": "최대 기본 요금이 현재 네트워크 조건에 비해 낮습니다."
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "승수가 우선 요금에 비해 낮습니다."
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "최대 요금이 필요 이상으로 높습니다." "message": "최대 요금이 필요 이상으로 높습니다."
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "이렇게 하면 최대 요금이 낮아지지만 네트워크 트래픽이 증가하여 거래가 지연되거나 실패할 수 있습니다." "message": "이렇게 하면 최대 요금이 낮아지지만 네트워크 트래픽이 증가하여 거래가 지연되거나 실패할 수 있습니다."
}, },
"editInGwei": {
"message": "GWEI에서 편집"
},
"editInMultiplier": {
"message": "승수에서 편집"
},
"editNonceField": { "editNonceField": {
"message": "임시값 편집" "message": "임시값 편집"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "'확장 프로그램과 동기화' 기능이 일시적으로 비활성화됩니다. 메타마스크 모바일에서 확장 지갑을 사용하려면 모바일 앱에서 지갑 설정 옵션으로 돌아가 '비밀 백업 문구 가져오기' 옵션을 선택하세요. 확장 지갑의 비밀 문구를 사용하여 지갑을 모바일로 가져올 수 있습니다." "message": "'확장 프로그램과 동기화' 기능이 일시적으로 비활성화됩니다. 메타마스크 모바일에서 확장 지갑을 사용하려면 모바일 앱에서 지갑 설정 옵션으로 돌아가 '비밀 백업 문구 가져오기' 옵션을 선택하세요. 확장 지갑의 비밀 문구를 사용하여 지갑을 모바일로 가져올 수 있습니다."
}, },
"multiplier": {
"message": "승수"
},
"mustSelectOne": { "mustSelectOne": {
"message": "토큰을 1개 이상 선택해야 합니다." "message": "토큰을 1개 이상 선택해야 합니다."
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "Максимальная базовая комиссия низкая для текущих условий сети" "message": "Максимальная базовая комиссия низкая для текущих условий сети"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "Множитель низкий по сравнению с платой за приоритет"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "Максимальная комиссия выше, чем необходимо" "message": "Максимальная комиссия выше, чем необходимо"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "Это снижает вашу максимальную комиссию, но, если трафик в сети увеличивается, ваша транзакция может быть отложена или завершиться ошибкой." "message": "Это снижает вашу максимальную комиссию, но, если трафик в сети увеличивается, ваша транзакция может быть отложена или завершиться ошибкой."
}, },
"editInGwei": {
"message": "Изменить в GWEI"
},
"editInMultiplier": {
"message": "Изменить в множителе"
},
"editNonceField": { "editNonceField": {
"message": "Изменить одноразовый номер" "message": "Изменить одноразовый номер"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "Функция «Синхронизация с расширением» временно отключена. Если вы хотите использовать свой кошелек из расширения браузера в мобильной версии MetaMask, тогда в мобильном приложении вернитесь к параметрам настройки кошелька и выберите параметр «Импортировать с помощью секретной фразы для восстановления». Используйте секретную фразу своего кошелька из расширения, чтобы импортировать кошелек на мобильное устройство." "message": "Функция «Синхронизация с расширением» временно отключена. Если вы хотите использовать свой кошелек из расширения браузера в мобильной версии MetaMask, тогда в мобильном приложении вернитесь к параметрам настройки кошелька и выберите параметр «Импортировать с помощью секретной фразы для восстановления». Используйте секретную фразу своего кошелька из расширения, чтобы импортировать кошелек на мобильное устройство."
}, },
"multiplier": {
"message": "множитель"
},
"mustSelectOne": { "mustSelectOne": {
"message": "Необходимо выбрать хотя бы 1 токен." "message": "Необходимо выбрать хотя бы 1 токен."
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "Ang max base fee ay mababa para sa kasalukuyang mga kundisyon ng network" "message": "Ang max base fee ay mababa para sa kasalukuyang mga kundisyon ng network"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "Ang multiplier ay mababa may kaugnayan sa Priority fee"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "Ang max fee ay mas mataas kaysa kinakailangan" "message": "Ang max fee ay mas mataas kaysa kinakailangan"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "Pinabababa nito ang iyong maximum fee ngunit kung network traffic ay maaaring maantala o mabigo ang iyong transaksyon." "message": "Pinabababa nito ang iyong maximum fee ngunit kung network traffic ay maaaring maantala o mabigo ang iyong transaksyon."
}, },
"editInGwei": {
"message": "I-edit sa GWEI"
},
"editInMultiplier": {
"message": "I-edit sa multiplier"
},
"editNonceField": { "editNonceField": {
"message": "I-edit sa Nonce" "message": "I-edit sa Nonce"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "Ang feature na 'I-sync gamit ang extension' ay pansamantalang hindi gumagana. Kung gusto mong gamitin ang iyong extension wallet sa MetaMask mobile, pagkatapos ay sa iyong mobile app: bumalik sa mga opsyon sa pag-setup ng wallet at piliin ang opsyong 'Mag-import gamit ang Secret Recovery Phrase'. Gamitin ang lihim na parirala ng iyong extension wallet upang pagkatapos ay i-import ang iyong wallet sa mobile." "message": "Ang feature na 'I-sync gamit ang extension' ay pansamantalang hindi gumagana. Kung gusto mong gamitin ang iyong extension wallet sa MetaMask mobile, pagkatapos ay sa iyong mobile app: bumalik sa mga opsyon sa pag-setup ng wallet at piliin ang opsyong 'Mag-import gamit ang Secret Recovery Phrase'. Gamitin ang lihim na parirala ng iyong extension wallet upang pagkatapos ay i-import ang iyong wallet sa mobile."
}, },
"multiplier": {
"message": "multiplier"
},
"mustSelectOne": { "mustSelectOne": {
"message": "Dapat pumili ng kahit 1 token lang." "message": "Dapat pumili ng kahit 1 token lang."
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "Maks. baz ücreti mevcut ağ koşulları için düşük" "message": "Maks. baz ücreti mevcut ağ koşulları için düşük"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "Öncelik ücretine göre çarpan düşük"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "Maks. ücret gerekenden daha yüksek" "message": "Maks. ücret gerekenden daha yüksek"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "Bu, maksimum ücretinizi düşürür ancak ağ trafiğiniz artarsa işleminiz gecikebilir ya da gerçekleşmeyebilir." "message": "Bu, maksimum ücretinizi düşürür ancak ağ trafiğiniz artarsa işleminiz gecikebilir ya da gerçekleşmeyebilir."
}, },
"editInGwei": {
"message": "GWEI'de düzenle"
},
"editInMultiplier": {
"message": "Çarpanda düzenle"
},
"editNonceField": { "editNonceField": {
"message": "Geçici anahtarı düzenle" "message": "Geçici anahtarı düzenle"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "\"Uzantı ile senkronize et\" özelliği geçici olarak devre dışı bırakılmış. MetaMask mobilde uzantı cüzdanınızı kullanmak istiyorsanız mobil uygulamaya gidin: cüzdan kurulum ayarlarına geri dönün ve \"Gizli Kurtarma İfadesi ile İçe Aktar\" seçeneğini seçin. Ardından cüzdanınızı mobil uygulamada içe aktarmak için uzantı cüzdanınızın gizli ifadesini kullanın." "message": "\"Uzantı ile senkronize et\" özelliği geçici olarak devre dışı bırakılmış. MetaMask mobilde uzantı cüzdanınızı kullanmak istiyorsanız mobil uygulamaya gidin: cüzdan kurulum ayarlarına geri dönün ve \"Gizli Kurtarma İfadesi ile İçe Aktar\" seçeneğini seçin. Ardından cüzdanınızı mobil uygulamada içe aktarmak için uzantı cüzdanınızın gizli ifadesini kullanın."
}, },
"multiplier": {
"message": "çarpan"
},
"mustSelectOne": { "mustSelectOne": {
"message": "En az bir jeton seçilmeli" "message": "En az bir jeton seçilmeli"
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "Phí cơ bản tối đa thấp so với tình trạng mạng hiện tại" "message": "Phí cơ bản tối đa thấp so với tình trạng mạng hiện tại"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "Hệ số nhân thấp so với phí ưu tiên"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "Phí tối đa cao hơn cần thiết" "message": "Phí tối đa cao hơn cần thiết"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "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." "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."
}, },
"editInGwei": {
"message": "Chỉnh sửa GWEI"
},
"editInMultiplier": {
"message": "Chỉnh sửa hệ số nhân"
},
"editNonceField": { "editNonceField": {
"message": "Chỉnh sửa số chỉ dùng một lần" "message": "Chỉnh sửa số chỉ dùng một lần"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "Tính năng 'Đồng bộ với tiện ích' tạm thời bị tắt. Nếu bạn muốn sử dụng ví tiện ích trên thiết bị di động MetaMask, thì trên ứng dụng di động: hãy quay lại các tùy chọn thiết lập ví và chọn phương án 'Nhập bằng Cụm Mật Khẩu Khôi Phục Bí Mật'. Sử dụng cụm mật khẩu bí mật của ví tiện ích để nhập ví của bạn vào thiết bị di động." "message": "Tính năng 'Đồng bộ với tiện ích' tạm thời bị tắt. Nếu bạn muốn sử dụng ví tiện ích trên thiết bị di động MetaMask, thì trên ứng dụng di động: hãy quay lại các tùy chọn thiết lập ví và chọn phương án 'Nhập bằng Cụm Mật Khẩu Khôi Phục Bí Mật'. Sử dụng cụm mật khẩu bí mật của ví tiện ích để nhập ví của bạn vào thiết bị di động."
}, },
"multiplier": {
"message": "hệ số nhân"
},
"mustSelectOne": { "mustSelectOne": {
"message": "Phải chọn ít nhất 1 token." "message": "Phải chọn ít nhất 1 token."
}, },

View File

@ -842,9 +842,6 @@
"editGasMaxBaseFeeLow": { "editGasMaxBaseFeeLow": {
"message": "当前网络条件的最高基本费用很低" "message": "当前网络条件的最高基本费用很低"
}, },
"editGasMaxBaseFeeMultiplierImbalance": {
"message": "乘数相对于优先级费用较低"
},
"editGasMaxFeeHigh": { "editGasMaxFeeHigh": {
"message": "最大费用高于必须" "message": "最大费用高于必须"
}, },
@ -906,12 +903,6 @@
"editGasTooLowWarningTooltip": { "editGasTooLowWarningTooltip": {
"message": "这会降低您的最大费用,但如果网络流量增加,您的交易可能会被延迟或失败。" "message": "这会降低您的最大费用,但如果网络流量增加,您的交易可能会被延迟或失败。"
}, },
"editInGwei": {
"message": "在 GWEI 编辑"
},
"editInMultiplier": {
"message": "按乘数编辑"
},
"editNonceField": { "editNonceField": {
"message": "编辑空格" "message": "编辑空格"
}, },
@ -1726,9 +1717,6 @@
"mobileSyncWarning": { "mobileSyncWarning": {
"message": "“同步扩展”功能暂时被禁用。 如果您想要在MetaMask手机上使用您的扩展钱包在您的手机应用上返回钱包设置选项并选择“使用账户助记词导入”选项。 使用您的扩展钱包的助记词来导入您的钱包。" "message": "“同步扩展”功能暂时被禁用。 如果您想要在MetaMask手机上使用您的扩展钱包在您的手机应用上返回钱包设置选项并选择“使用账户助记词导入”选项。 使用您的扩展钱包的助记词来导入您的钱包。"
}, },
"multiplier": {
"message": "倍数"
},
"mustSelectOne": { "mustSelectOne": {
"message": "至少选择 1 种代币。" "message": "至少选择 1 种代币。"
}, },

View File

@ -432,6 +432,7 @@ export default class TransactionController extends EventEmitter {
gasLimit: defaultGasLimit, gasLimit: defaultGasLimit,
simulationFails, simulationFails,
} = await this._getDefaultGasLimit(txMeta, getCodeResponse); } = await this._getDefaultGasLimit(txMeta, getCodeResponse);
const advancedGasFeeDefaultValues = this.getAdvancedGasFee();
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
txMeta = this.txStateManager.getTransaction(txMeta.id); txMeta = this.txStateManager.getTransaction(txMeta.id);
@ -440,13 +441,21 @@ export default class TransactionController extends EventEmitter {
} }
if (eip1559Compatibility) { if (eip1559Compatibility) {
// If the dapp has suggested a gas price, but no maxFeePerGas or maxPriorityFeePerGas if (process.env.EIP_1559_V2 && Boolean(advancedGasFeeDefaultValues)) {
// then we set maxFeePerGas and maxPriorityFeePerGas to the suggested gasPrice. txMeta.userFeeLevel = CUSTOM_GAS_ESTIMATE;
if ( txMeta.txParams.maxFeePerGas = decGWEIToHexWEI(
advancedGasFeeDefaultValues.maxBaseFee,
);
txMeta.txParams.maxPriorityFeePerGas = decGWEIToHexWEI(
advancedGasFeeDefaultValues.priorityFee,
);
} else if (
txMeta.txParams.gasPrice && txMeta.txParams.gasPrice &&
!txMeta.txParams.maxFeePerGas && !txMeta.txParams.maxFeePerGas &&
!txMeta.txParams.maxPriorityFeePerGas !txMeta.txParams.maxPriorityFeePerGas
) { ) {
// If the dapp has suggested a gas price, but no maxFeePerGas or maxPriorityFeePerGas
// then we set maxFeePerGas and maxPriorityFeePerGas to the suggested gasPrice.
txMeta.txParams.maxFeePerGas = txMeta.txParams.gasPrice; txMeta.txParams.maxFeePerGas = txMeta.txParams.gasPrice;
txMeta.txParams.maxPriorityFeePerGas = txMeta.txParams.gasPrice; txMeta.txParams.maxPriorityFeePerGas = txMeta.txParams.gasPrice;
if (process.env.EIP_1559_V2) { if (process.env.EIP_1559_V2) {
@ -1142,6 +1151,10 @@ export default class TransactionController extends EventEmitter {
* @param opts * @param opts
*/ */
this.getTransactions = (opts) => this.txStateManager.getTransactions(opts); this.getTransactions = (opts) => this.txStateManager.getTransactions(opts);
/** @returns {object} the saved default values for advancedGasFee */
this.getAdvancedGasFee = () =>
this.preferencesStore.getState().advancedGasFee;
} }
// called once on startup // called once on startup

View File

@ -162,7 +162,7 @@
}, },
"useTokenDetection": true, "useTokenDetection": true,
"advancedGasFee": { "advancedGasFee": {
"maxBaseFee": "1.5", "maxBaseFee": "75",
"priorityFee": "2" "priorityFee": "2"
}, },
"tokenList": { "tokenList": {

View File

@ -4,7 +4,6 @@ import { useSelector, useDispatch } from 'react-redux';
import Box from '../../../ui/box'; import Box from '../../../ui/box';
import Typography from '../../../ui/typography'; import Typography from '../../../ui/typography';
import CheckBox from '../../../ui/check-box'; import CheckBox from '../../../ui/check-box';
import I18nValue from '../../../ui/i18n-value';
import { import {
COLORS, COLORS,
DISPLAY, DISPLAY,
@ -23,7 +22,7 @@ const AdvancedGasFeeDefaults = () => {
const { const {
hasErrors, hasErrors,
baseFeeMultiplier, maxBaseFee,
maxPriorityFeePerGas, maxPriorityFeePerGas,
} = useAdvancedGasFeePopoverContext(); } = useAdvancedGasFeePopoverContext();
const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues); const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues);
@ -32,7 +31,7 @@ const AdvancedGasFeeDefaults = () => {
if (value) { if (value) {
dispatch( dispatch(
setAdvancedGasFee({ setAdvancedGasFee({
maxBaseFee: baseFeeMultiplier, maxBaseFee,
priorityFee: maxPriorityFeePerGas, priorityFee: maxPriorityFeePerGas,
}), }),
); );
@ -42,7 +41,7 @@ const AdvancedGasFeeDefaults = () => {
}; };
const isDefaultSettingsSelected = const isDefaultSettingsSelected =
Boolean(advancedGasFeeValues) && Boolean(advancedGasFeeValues) &&
advancedGasFeeValues.maxBaseFee === baseFeeMultiplier && advancedGasFeeValues.maxBaseFee === maxBaseFee &&
advancedGasFeeValues.priorityFee === maxPriorityFeePerGas; advancedGasFeeValues.priorityFee === maxPriorityFeePerGas;
const handleUpdateDefaultSettings = () => const handleUpdateDefaultSettings = () =>
@ -62,16 +61,11 @@ const AdvancedGasFeeDefaults = () => {
disabled={hasErrors} disabled={hasErrors}
/> />
<Typography variant={TYPOGRAPHY.H7} color={COLORS.UI4} margin={0}> <Typography variant={TYPOGRAPHY.H7} color={COLORS.UI4} margin={0}>
{!isDefaultSettingsSelected && Boolean(advancedGasFeeValues) ? ( {!isDefaultSettingsSelected && Boolean(advancedGasFeeValues)
<I18nValue ? t('advancedGasFeeDefaultOptIn', [
messageKey="advancedGasFeeDefaultOptIn"
options={[
<strong key="default-value-change">{t('newValues')}</strong>, <strong key="default-value-change">{t('newValues')}</strong>,
]} ])
/> : t('advancedGasFeeDefaultOptOut')}
) : (
<I18nValue messageKey="advancedGasFeeDefaultOptOut" />
)}
</Typography> </Typography>
</Box> </Box>
); );

View File

@ -41,11 +41,7 @@ const render = (defaultGasParams) => {
return renderWithProvider( return renderWithProvider(
<GasFeeContextProvider <GasFeeContextProvider
transaction={{ transaction={{
userFeeLevel: 'custom', userFeeLevel: 'medium',
txParams: {
maxFeePerGas: '0x174876E800',
maxPriorityFeePerGas: '0x77359400',
},
}} }}
> >
<AdvancedGasFeePopoverContextProvider> <AdvancedGasFeePopoverContextProvider>
@ -67,7 +63,7 @@ describe('AdvancedGasFeeDefaults', () => {
}); });
it('should renders correct message when the default values are set', () => { it('should renders correct message when the default values are set', () => {
render({ render({
advancedGasFee: { maxBaseFee: 2, priorityFee: 2 }, advancedGasFee: { maxBaseFee: 50, priorityFee: 2 },
}); });
expect( expect(
screen.queryByText( screen.queryByText(
@ -85,7 +81,7 @@ describe('AdvancedGasFeeDefaults', () => {
), ),
).toBeInTheDocument(); ).toBeInTheDocument();
fireEvent.change(document.getElementsByTagName('input')[0], { fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 3 }, target: { value: 100 },
}); });
fireEvent.change(document.getElementsByTagName('input')[1], { fireEvent.change(document.getElementsByTagName('input')[1], {
target: { value: 4 }, target: { value: 4 },
@ -93,7 +89,7 @@ describe('AdvancedGasFeeDefaults', () => {
}); });
it('should renders correct message when the default values are set and the maxBaseFee values are updated', () => { it('should renders correct message when the default values are set and the maxBaseFee values are updated', () => {
render({ render({
advancedGasFee: { maxBaseFee: 2, priorityFee: 2 }, advancedGasFee: { maxBaseFee: 50, priorityFee: 2 },
}); });
expect(document.getElementsByTagName('input')[2]).toBeChecked(); expect(document.getElementsByTagName('input')[2]).toBeChecked();
expect( expect(
@ -102,9 +98,9 @@ describe('AdvancedGasFeeDefaults', () => {
), ),
).toBeInTheDocument(); ).toBeInTheDocument();
fireEvent.change(document.getElementsByTagName('input')[0], { fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 4 }, target: { value: 75 },
}); });
expect(document.getElementsByTagName('input')[0]).toHaveValue(4); expect(document.getElementsByTagName('input')[0]).toHaveValue(75);
expect(screen.queryByText('new values')).toBeInTheDocument(); expect(screen.queryByText('new values')).toBeInTheDocument();
expect( expect(
screen.queryByText('Save these as my default for "Advanced"'), screen.queryByText('Save these as my default for "Advanced"'),
@ -112,7 +108,7 @@ describe('AdvancedGasFeeDefaults', () => {
}); });
it('should renders correct message when the default values are set and the priorityFee values are updated', () => { it('should renders correct message when the default values are set and the priorityFee values are updated', () => {
render({ render({
advancedGasFee: { maxBaseFee: 2, priorityFee: 2 }, advancedGasFee: { maxBaseFee: 50, priorityFee: 2 },
}); });
expect(document.getElementsByTagName('input')[2]).toBeChecked(); expect(document.getElementsByTagName('input')[2]).toBeChecked();
expect( expect(
@ -121,9 +117,9 @@ describe('AdvancedGasFeeDefaults', () => {
), ),
).toBeInTheDocument(); ).toBeInTheDocument();
fireEvent.change(document.getElementsByTagName('input')[1], { fireEvent.change(document.getElementsByTagName('input')[1], {
target: { value: 4 }, target: { value: 5 },
}); });
expect(document.getElementsByTagName('input')[1]).toHaveValue(4); expect(document.getElementsByTagName('input')[1]).toHaveValue(5);
expect(screen.queryByText('new values')).toBeInTheDocument(); expect(screen.queryByText('new values')).toBeInTheDocument();
expect( expect(
screen.queryByText('Save these as my default for "Advanced"'), screen.queryByText('Save these as my default for "Advanced"'),

View File

@ -3,11 +3,7 @@ import { useSelector } from 'react-redux';
import { HIGH_FEE_WARNING_MULTIPLIER } from '../../../../../pages/send/send.constants'; import { HIGH_FEE_WARNING_MULTIPLIER } from '../../../../../pages/send/send.constants';
import { PRIORITY_LEVELS } from '../../../../../../shared/constants/gas'; import { PRIORITY_LEVELS } from '../../../../../../shared/constants/gas';
import { import { SECONDARY } from '../../../../../helpers/constants/common';
divideCurrencies,
multiplyCurrencies,
} from '../../../../../../shared/modules/conversion.utils';
import { PRIMARY, SECONDARY } from '../../../../../helpers/constants/common';
import { bnGreaterThan, bnLessThan } from '../../../../../helpers/utils/util'; import { bnGreaterThan, bnLessThan } from '../../../../../helpers/utils/util';
import { decGWEIToHexWEI } from '../../../../../helpers/utils/conversions.util'; import { decGWEIToHexWEI } from '../../../../../helpers/utils/conversions.util';
import { getAdvancedGasFeeValues } from '../../../../../selectors'; import { getAdvancedGasFeeValues } from '../../../../../selectors';
@ -15,10 +11,8 @@ import { useGasFeeContext } from '../../../../../contexts/gasFee';
import { useI18nContext } from '../../../../../hooks/useI18nContext'; import { useI18nContext } from '../../../../../hooks/useI18nContext';
import { useUserPreferencedCurrency } from '../../../../../hooks/useUserPreferencedCurrency'; import { useUserPreferencedCurrency } from '../../../../../hooks/useUserPreferencedCurrency';
import { useCurrencyDisplay } from '../../../../../hooks/useCurrencyDisplay'; import { useCurrencyDisplay } from '../../../../../hooks/useCurrencyDisplay';
import Button from '../../../../ui/button';
import Box from '../../../../ui/box'; import Box from '../../../../ui/box';
import FormField from '../../../../ui/form-field'; import FormField from '../../../../ui/form-field';
import I18nValue from '../../../../ui/i18n-value';
import { useAdvancedGasFeePopoverContext } from '../../context'; import { useAdvancedGasFeePopoverContext } from '../../context';
import AdvancedGasFeeInputSubtext from '../../advanced-gas-fee-input-subtext'; import AdvancedGasFeeInputSubtext from '../../advanced-gas-fee-input-subtext';
@ -27,34 +21,9 @@ import {
renderFeeRange, renderFeeRange,
} from '../utils'; } from '../utils';
const divideCurrencyValues = (value, baseFee) => { const validateBaseFee = (value, gasFeeEstimates, maxPriorityFeePerGas) => {
if (baseFee === 0) {
return 0;
}
return divideCurrencies(value, baseFee, {
numberOfDecimals: 2,
dividendBase: 10,
divisorBase: 10,
}).toNumber();
};
const multiplyCurrencyValues = (baseFee, value, numberOfDecimals) =>
multiplyCurrencies(baseFee, value, {
numberOfDecimals,
multiplicandBase: 10,
multiplierBase: 10,
}).toNumber();
const validateBaseFee = (
editingInGwei,
value,
gasFeeEstimates,
maxPriorityFeePerGas,
) => {
if (bnGreaterThan(maxPriorityFeePerGas, value)) { if (bnGreaterThan(maxPriorityFeePerGas, value)) {
return editingInGwei return 'editGasMaxBaseFeeGWEIImbalance';
? 'editGasMaxBaseFeeGWEIImbalance'
: 'editGasMaxBaseFeeMultiplierImbalance';
} }
if ( if (
gasFeeEstimates?.low && gasFeeEstimates?.low &&
@ -82,7 +51,7 @@ const BaseFeeInput = () => {
maxPriorityFeePerGas, maxPriorityFeePerGas,
setErrorValue, setErrorValue,
setMaxFeePerGas, setMaxFeePerGas,
setBaseFeeMultiplier, setMaxBaseFee,
} = useAdvancedGasFeePopoverContext(); } = useAdvancedGasFeePopoverContext();
const { const {
@ -91,9 +60,6 @@ const BaseFeeInput = () => {
baseFeeTrend, baseFeeTrend,
} = gasFeeEstimates; } = gasFeeEstimates;
const [baseFeeError, setBaseFeeError] = useState(); const [baseFeeError, setBaseFeeError] = useState();
const {
numberOfDecimals: numberOfDecimalsPrimary,
} = useUserPreferencedCurrency(PRIMARY);
const { const {
currency, currency,
numberOfDecimals: numberOfDecimalsFiat, numberOfDecimals: numberOfDecimalsFiat,
@ -101,90 +67,48 @@ const BaseFeeInput = () => {
const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues); const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues);
const [editingInGwei, setEditingInGwei] = useState(false); const [baseFee, setBaseFee] = useState(() => {
const [maxBaseFeeGWEI, setMaxBaseFeeGWEI] = useState(() => {
if (
estimateUsed !== PRIORITY_LEVELS.CUSTOM &&
advancedGasFeeValues?.maxBaseFee
) {
return multiplyCurrencyValues(
estimatedBaseFee,
advancedGasFeeValues.maxBaseFee,
numberOfDecimalsPrimary,
);
}
return maxFeePerGas;
});
const [maxBaseFeeMultiplier, setMaxBaseFeeMultiplier] = useState(() => {
if ( if (
estimateUsed !== PRIORITY_LEVELS.CUSTOM && estimateUsed !== PRIORITY_LEVELS.CUSTOM &&
advancedGasFeeValues?.maxBaseFee advancedGasFeeValues?.maxBaseFee
) { ) {
return advancedGasFeeValues.maxBaseFee; return advancedGasFeeValues.maxBaseFee;
} }
return divideCurrencyValues(maxFeePerGas, estimatedBaseFee);
return maxFeePerGas;
}); });
const [, { value: baseFeeInFiat }] = useCurrencyDisplay( const [, { value: baseFeeInFiat }] = useCurrencyDisplay(
decGWEIToHexWEI(maxBaseFeeGWEI), decGWEIToHexWEI(baseFee),
{ currency, numberOfDecimalsFiat }, { currency, numberOfDecimalsFiat },
); );
const updateBaseFee = useCallback( const updateBaseFee = useCallback(
(value) => { (value) => {
let baseFeeInGWEI; setBaseFee(value);
let baseFeeMultiplierValue;
if (editingInGwei) {
baseFeeInGWEI = value;
baseFeeMultiplierValue = divideCurrencyValues(value, estimatedBaseFee);
} else {
baseFeeInGWEI = multiplyCurrencyValues(
estimatedBaseFee,
value,
numberOfDecimalsPrimary,
);
baseFeeMultiplierValue = value;
}
setMaxBaseFeeGWEI(baseFeeInGWEI);
setMaxBaseFeeMultiplier(baseFeeMultiplierValue);
}, },
[ [setBaseFee],
editingInGwei,
estimatedBaseFee,
numberOfDecimalsPrimary,
setMaxBaseFeeGWEI,
setMaxBaseFeeMultiplier,
],
); );
useEffect(() => { useEffect(() => {
setMaxFeePerGas(maxBaseFeeGWEI); setMaxFeePerGas(baseFee);
const error = validateBaseFee( const error = validateBaseFee(
editingInGwei, baseFee,
maxBaseFeeGWEI,
gasFeeEstimates, gasFeeEstimates,
maxPriorityFeePerGas, maxPriorityFeePerGas,
); );
setBaseFeeError(error); setBaseFeeError(error);
setErrorValue( setErrorValue('maxFeePerGas', error === 'editGasMaxBaseFeeGWEIImbalance');
'maxFeePerGas', setMaxBaseFee(baseFee);
error === 'editGasMaxBaseFeeGWEIImbalance' ||
error === 'editGasMaxBaseFeeMultiplierImbalance',
);
setBaseFeeMultiplier(maxBaseFeeMultiplier);
}, [ }, [
editingInGwei, baseFee,
gasFeeEstimates, gasFeeEstimates,
maxBaseFeeGWEI,
maxPriorityFeePerGas, maxPriorityFeePerGas,
maxBaseFeeMultiplier,
setBaseFeeError, setBaseFeeError,
setErrorValue, setErrorValue,
setMaxFeePerGas, setMaxFeePerGas,
setBaseFeeMultiplier, setMaxBaseFee,
]); ]);
return ( return (
@ -193,20 +117,9 @@ const BaseFeeInput = () => {
error={baseFeeError ? t(baseFeeError) : ''} error={baseFeeError ? t(baseFeeError) : ''}
onChange={updateBaseFee} onChange={updateBaseFee}
titleText={t('maxBaseFee')} titleText={t('maxBaseFee')}
titleUnit={editingInGwei ? 'GWEI' : `(${t('multiplier')})`} titleUnit={`(${t('gwei')})`}
tooltipText={t('advancedBaseGasFeeToolTip')} tooltipText={t('advancedBaseGasFeeToolTip')}
titleDetail={ value={baseFee}
<Button
className="base-fee-input__edit-link"
type="link"
onClick={() => setEditingInGwei(!editingInGwei)}
>
<I18nValue
messageKey={editingInGwei ? 'editInMultiplier' : 'editInGwei'}
/>
</Button>
}
value={editingInGwei ? maxBaseFeeGWEI : maxBaseFeeMultiplier}
detailText={`${baseFeeInFiat}`} detailText={`${baseFeeInFiat}`}
numeric numeric
/> />

View File

@ -30,7 +30,7 @@ const render = (txProps) => {
balance: '0x1F4', balance: '0x1F4',
}, },
}, },
advancedGasFee: { maxBaseFee: 2 }, advancedGasFee: { maxBaseFee: 100 },
featureFlags: { advancedInlineGas: true }, featureFlags: { advancedInlineGas: true },
gasFeeEstimates: gasFeeEstimates:
mockEstimates[GAS_ESTIMATE_TYPES.FEE_MARKET].gasFeeEstimates, mockEstimates[GAS_ESTIMATE_TYPES.FEE_MARKET].gasFeeEstimates,
@ -57,7 +57,7 @@ describe('BaseFeeInput', () => {
render({ render({
userFeeLevel: 'high', userFeeLevel: 'high',
}); });
expect(document.getElementsByTagName('input')[0]).toHaveValue(2); expect(document.getElementsByTagName('input')[0]).toHaveValue(100);
}); });
it('should renders baseFee values from transaction if current estimate used is custom', () => { it('should renders baseFee values from transaction if current estimate used is custom', () => {
@ -66,47 +66,8 @@ describe('BaseFeeInput', () => {
maxFeePerGas: '0x174876E800', maxFeePerGas: '0x174876E800',
}, },
}); });
expect(document.getElementsByTagName('input')[0]).toHaveValue(2);
});
it('should show GWEI value in input when Edit in GWEI link is clicked', () => {
render({
txParams: {
maxFeePerGas: '0x174876E800',
},
});
fireEvent.click(screen.queryByText('Edit in GWEI'));
expect(document.getElementsByTagName('input')[0]).toHaveValue(100); expect(document.getElementsByTagName('input')[0]).toHaveValue(100);
}); });
it('should correctly update GWEI value if multiplier is changed', () => {
render({
txParams: {
maxFeePerGas: '0x174876E800',
},
});
fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 4 },
});
fireEvent.click(screen.queryByText('Edit in GWEI'));
expect(document.getElementsByTagName('input')[0]).toHaveValue(200);
});
it('should correctly update multiplier value if GWEI is changed', () => {
render({
txParams: {
maxFeePerGas: '0x174876E800',
},
});
expect(document.getElementsByTagName('input')[0]).toHaveValue(2);
fireEvent.click(screen.queryByText('Edit in GWEI'));
fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 200 },
});
fireEvent.click(screen.queryByText('Edit in multiplier'));
expect(document.getElementsByTagName('input')[0]).toHaveValue(4);
});
it('should show current value of estimatedBaseFee in subtext', () => { it('should show current value of estimatedBaseFee in subtext', () => {
render({ render({
txParams: { txParams: {
@ -130,24 +91,14 @@ describe('BaseFeeInput', () => {
}, },
}); });
fireEvent.change(document.getElementsByTagName('input')[0], { fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 3 }, target: { value: 55 },
}); });
expect( expect(
screen.queryByText('Max base fee is low for current network conditions'), screen.queryByText('Max base fee is low for current network conditions'),
).not.toBeInTheDocument(); ).not.toBeInTheDocument();
fireEvent.change(document.getElementsByTagName('input')[0], { fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 0.01 }, target: { value: 50 },
}); });
expect(
screen.queryByText('Max base fee is low for current network conditions'),
).toBeInTheDocument();
fireEvent.click(screen.queryByText('Edit in GWEI'));
fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 10 },
});
expect(
screen.queryByText('Max base fee is low for current network conditions'),
).toBeInTheDocument();
}); });
it('should show error if base if is more than suggested high value', () => { it('should show error if base if is more than suggested high value', () => {
@ -157,18 +108,11 @@ describe('BaseFeeInput', () => {
}, },
}); });
fireEvent.change(document.getElementsByTagName('input')[0], { fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 3 }, target: { value: 75 },
}); });
expect( expect(
screen.queryByText('Max base fee is higher than necessary'), screen.queryByText('Max base fee is higher than necessary'),
).not.toBeInTheDocument(); ).not.toBeInTheDocument();
fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 10 },
});
fireEvent.click(screen.queryByText('Edit in GWEI'));
expect(
screen.queryByText('Max base fee is higher than necessary'),
).toBeInTheDocument();
fireEvent.change(document.getElementsByTagName('input')[0], { fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 500 }, target: { value: 500 },
}); });

View File

@ -103,7 +103,7 @@ const PriorityFeeInput = () => {
error={priorityFeeError ? t(priorityFeeError) : ''} error={priorityFeeError ? t(priorityFeeError) : ''}
onChange={updatePriorityFee} onChange={updatePriorityFee}
titleText={t('priorityFeeProperCase')} titleText={t('priorityFeeProperCase')}
titleUnit="(GWEI)" titleUnit={`(${t('gwei')})`}
tooltipText={t('advancedPriorityFeeToolTip')} tooltipText={t('advancedPriorityFeeToolTip')}
value={priorityFee} value={priorityFee}
detailText={`${priorityFeeInFiat}`} detailText={`${priorityFeeInFiat}`}

View File

@ -20,7 +20,7 @@ export const AdvancedGasFeePopoverContextProvider = ({ children }) => {
}, },
[errors, setErrors], [errors, setErrors],
); );
const [baseFeeMultiplier, setBaseFeeMultiplier] = useState(); const [maxBaseFee, setMaxBaseFee] = useState();
return ( return (
<AdvancedGasFeePopoverContext.Provider <AdvancedGasFeePopoverContext.Provider
@ -30,11 +30,11 @@ export const AdvancedGasFeePopoverContextProvider = ({ children }) => {
maxFeePerGas, maxFeePerGas,
maxPriorityFeePerGas, maxPriorityFeePerGas,
setErrorValue, setErrorValue,
baseFeeMultiplier, maxBaseFee,
setGasLimit, setGasLimit,
setMaxPriorityFeePerGas, setMaxPriorityFeePerGas,
setMaxFeePerGas, setMaxFeePerGas,
setBaseFeeMultiplier, setMaxBaseFee,
}} }}
> >
{children} {children}

View File

@ -68,7 +68,7 @@ const renderComponent = ({
gasEstimateType: 'fee-market', gasEstimateType: 'fee-market',
gasFeeEstimates: MOCK_FEE_ESTIMATE, gasFeeEstimates: MOCK_FEE_ESTIMATE,
advancedGasFee: { advancedGasFee: {
maxBaseFee: '1.5', maxBaseFee: '100',
priorityFee: '2', priorityFee: '2',
}, },
}, },
@ -161,7 +161,7 @@ describe('EditGasItem', () => {
expect(screen.queryByText('⚙️')).toBeInTheDocument(); expect(screen.queryByText('⚙️')).toBeInTheDocument();
expect(screen.queryByText('Advanced')).toBeInTheDocument(); expect(screen.queryByText('Advanced')).toBeInTheDocument();
// below value of custom gas fee estimate is default obtained from state.metamask.advancedGasFee // below value of custom gas fee estimate is default obtained from state.metamask.advancedGasFee
expect(screen.queryByTitle('0.001575 ETH')).toBeInTheDocument(); expect(screen.queryByTitle('0.0021 ETH')).toBeInTheDocument();
}); });
it('should renders +10% gas estimate option for priorityLevel minimum', () => { it('should renders +10% gas estimate option for priorityLevel minimum', () => {

View File

@ -59,9 +59,7 @@ export const useGasItemFeeDetails = (priorityLevel) => {
maxFeePerGas = maxFeePerGasValue; maxFeePerGas = maxFeePerGasValue;
maxPriorityFeePerGas = maxPriorityFeePerGasValue; maxPriorityFeePerGas = maxPriorityFeePerGasValue;
} else if (advancedGasFeeValues) { } else if (advancedGasFeeValues) {
maxFeePerGas = maxFeePerGas = advancedGasFeeValues.maxBaseFee;
gasFeeEstimates.estimatedBaseFee *
parseFloat(advancedGasFeeValues.maxBaseFee);
maxPriorityFeePerGas = advancedGasFeeValues.priorityFee; maxPriorityFeePerGas = advancedGasFeeValues.priorityFee;
} }
} else if ( } else if (

View File

@ -230,7 +230,7 @@ describe('Selectors', () => {
it('#getAdvancedGasFeeValues', () => { it('#getAdvancedGasFeeValues', () => {
const advancedGasFee = selectors.getAdvancedGasFeeValues(mockState); const advancedGasFee = selectors.getAdvancedGasFeeValues(mockState);
expect(advancedGasFee).toStrictEqual({ expect(advancedGasFee).toStrictEqual({
maxBaseFee: '1.5', maxBaseFee: '75',
priorityFee: '2', priorityFee: '2',
}); });
}); });