mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove gas editing in Swaps (#14673)
* Remove gas editing in Swaps * Remove "extraApprovalGas"
This commit is contained in:
parent
b258cbafe7
commit
9a153d2388
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Ich stimme zu"
|
"message": "Ich stimme zu"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Aggregator-Netzwerkgebühr"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap-Tresor"
|
"message": "AirGap-Tresor"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Netzwerkgebühr für Freigabe und Aggregator"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Tx-Gaskosten genehmigen"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Genehmigen"
|
"message": "Genehmigen"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Externe Erweiterung"
|
"message": "Externe Erweiterung"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 Genehmigungsgas",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Fehlgeschlagen"
|
"message": "Fehlgeschlagen"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Συμφωνώ"
|
"message": "Συμφωνώ"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Αμοιβή ανταλλακτηρίου"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "Θησαυροφυλάκιο AirGap"
|
"message": "Θησαυροφυλάκιο AirGap"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Τέλος έγκρισης και δικτύου ανταλλακτηρίου"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Έγκριση Tx τέλους συναλλαγής"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Έγκριση"
|
"message": "Έγκριση"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Εξωτερική Επέκταση"
|
"message": "Εξωτερική Επέκταση"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 τέλος συναλλαγής",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Απέτυχε"
|
"message": "Απέτυχε"
|
||||||
},
|
},
|
||||||
|
@ -203,9 +203,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "I Agree"
|
"message": "I Agree"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Aggregator network fee"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap Vault"
|
"message": "AirGap Vault"
|
||||||
},
|
},
|
||||||
@ -263,12 +260,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Approval and aggregator network fee"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Approval Tx Gas Cost"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Approve spend limit"
|
"message": "Approve spend limit"
|
||||||
},
|
},
|
||||||
@ -1185,10 +1176,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "External Extension"
|
"message": "External Extension"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 approval gas",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Failed"
|
"message": "Failed"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Acepto"
|
"message": "Acepto"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Cuota de red de agregador"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "Bóveda AirGap"
|
"message": "Bóveda AirGap"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Cuota de red de agregador y aprobación"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Costo de gas por transacción de aprobación"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Aprobar límite de gastos"
|
"message": "Aprobar límite de gastos"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Extensión externa"
|
"message": "Extensión externa"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 gas por aprobación",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Con errores"
|
"message": "Con errores"
|
||||||
},
|
},
|
||||||
|
@ -179,9 +179,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Acepto"
|
"message": "Acepto"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Cuota de red de agregador"
|
|
||||||
},
|
|
||||||
"alertDisableTooltip": {
|
"alertDisableTooltip": {
|
||||||
"message": "Esto se puede modificar en \"Configuración > Alertas\""
|
"message": "Esto se puede modificar en \"Configuración > Alertas\""
|
||||||
},
|
},
|
||||||
@ -233,12 +230,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Cuota de red de agregador y aprobación"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Costo de gas por transacción de aprobación"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Aprobar límite de gastos"
|
"message": "Aprobar límite de gastos"
|
||||||
},
|
},
|
||||||
@ -1047,10 +1038,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Extensión externa"
|
"message": "Extensión externa"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 de gas por aprobación",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Con errores"
|
"message": "Con errores"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Je suis d’accord"
|
"message": "Je suis d’accord"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Frais de réseau de l’agrégateur"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "Coffre-fort AirGap"
|
"message": "Coffre-fort AirGap"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Approbation et frais du réseau d’agrégateur"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Approbation du coût de carburant Tx"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Approuver"
|
"message": "Approuver"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Extension externe"
|
"message": "Extension externe"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 de carburant approuvé",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Échec"
|
"message": "Échec"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "मैं सहमत हूं"
|
"message": "मैं सहमत हूं"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "एग्रीगेटर नेटवर्क शुल्क"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap का वॉल्ट"
|
"message": "AirGap का वॉल्ट"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Fask",
|
"message": "MetaMask Fask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "अनुमोदन और एग्रीगेटर नेटवर्क शुल्क"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "अनुमोदन Tx गैस कीमत"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "खर्च सीमा अनुमोदित करें"
|
"message": "खर्च सीमा अनुमोदित करें"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "बाहरी विस्तार"
|
"message": "बाहरी विस्तार"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 अनुमोदन गैस",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "विफल"
|
"message": "विफल"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Saya Setuju"
|
"message": "Saya Setuju"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Biaya jaringan agregator"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "Brankas AirGap"
|
"message": "Brankas AirGap"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Persetujuan dan biaya jaringan agregator"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Persetujuan Ongkos Jaringan Tx"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Setujui batas penggunaan"
|
"message": "Setujui batas penggunaan"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Ekstensi Eksternal"
|
"message": "Ekstensi Eksternal"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 gas yang disetujui",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Gagal"
|
"message": "Gagal"
|
||||||
},
|
},
|
||||||
|
@ -67,9 +67,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Acconsento"
|
"message": "Acconsento"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Tassa per la rete aggregatore"
|
|
||||||
},
|
|
||||||
"alertDisableTooltip": {
|
"alertDisableTooltip": {
|
||||||
"message": "Può essere cambiato in \"Impostazioni > Avvisi\""
|
"message": "Può essere cambiato in \"Impostazioni > Avvisi\""
|
||||||
},
|
},
|
||||||
@ -117,12 +114,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Tassa di approvazione per la rete aggregatore"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Costo Gas Approvazione Tx"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Approva"
|
"message": "Approva"
|
||||||
},
|
},
|
||||||
@ -568,10 +559,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Estensione Esterna"
|
"message": "Estensione Esterna"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 gas approvazione",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Fallita"
|
"message": "Fallita"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "同意する"
|
"message": "同意する"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "アグリゲーター ネットワーク料金"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap Vault"
|
"message": "AirGap Vault"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "承認およびアグリゲーターネットワークの手数料"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "承認送信のガス代"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "使用限度額の承認"
|
"message": "使用限度額の承認"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "外部拡張機能"
|
"message": "外部拡張機能"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1承認ガス",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "失敗しました"
|
"message": "失敗しました"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "동의함"
|
"message": "동의함"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "애그리게이터 네트워크 수수료"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "에어갭 볼트"
|
"message": "에어갭 볼트"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "승인 및 애그리게이터 네트워크 수수료"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "승인 Tx 가스 비용"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "지출 한도 승인"
|
"message": "지출 한도 승인"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "외부 확장"
|
"message": "외부 확장"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1의 승인 가스",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "실패"
|
"message": "실패"
|
||||||
},
|
},
|
||||||
|
@ -91,9 +91,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Sang-ayon ako"
|
"message": "Sang-ayon ako"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Bayarin sa aggregator network"
|
|
||||||
},
|
|
||||||
"alertDisableTooltip": {
|
"alertDisableTooltip": {
|
||||||
"message": "Mababago ito sa \"Mga Setting > Mga Alerto\""
|
"message": "Mababago ito sa \"Mga Setting > Mga Alerto\""
|
||||||
},
|
},
|
||||||
@ -141,12 +138,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Bayarin sa pag-apruba at aggregator network"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Approval Tx Gas Cost"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Aprubahan ang limitasyon sa paggastos"
|
"message": "Aprubahan ang limitasyon sa paggastos"
|
||||||
},
|
},
|
||||||
@ -674,10 +665,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "External Extension"
|
"message": "External Extension"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 na pag-apruba sa gas",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Hindi matagumpay"
|
"message": "Hindi matagumpay"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Concordo"
|
"message": "Concordo"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Taxa de rede do agregador"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap Vault"
|
"message": "AirGap Vault"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Taxa de aprovação e da rede do agregador"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Custo em gás da transação de aprovação"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Aprovar"
|
"message": "Aprovar"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Extensão externa"
|
"message": "Extensão externa"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 de gás por aprovação",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Falhou"
|
"message": "Falhou"
|
||||||
},
|
},
|
||||||
|
@ -179,9 +179,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Concordo"
|
"message": "Concordo"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Taxa de rede do agregador"
|
|
||||||
},
|
|
||||||
"alertDisableTooltip": {
|
"alertDisableTooltip": {
|
||||||
"message": "Isso pode ser alterado em \"Configurações > Alertas\""
|
"message": "Isso pode ser alterado em \"Configurações > Alertas\""
|
||||||
},
|
},
|
||||||
@ -233,12 +230,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Taxa de aprovação e da rede do agregador"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Custo em gás da transação de aprovação"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Aprovar limite de gastos"
|
"message": "Aprovar limite de gastos"
|
||||||
},
|
},
|
||||||
@ -1031,10 +1022,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Extensão externa"
|
"message": "Extensão externa"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 de gás por aprovação",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Falhou"
|
"message": "Falhou"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Я согласен(-на)"
|
"message": "Я согласен(-на)"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Комиссия сети агрегатора"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "Хранилище AirGap"
|
"message": "Хранилище AirGap"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Комиссия сети за одобрение и для агрегатора"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Стоимость газа для утверждения транзакции"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Одобрить лимит расходов"
|
"message": "Одобрить лимит расходов"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Внешнее расширение"
|
"message": "Внешнее расширение"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 газа для утверждения",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Не удалось"
|
"message": "Не удалось"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Sang-ayon Ako"
|
"message": "Sang-ayon Ako"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Bayarin sa aggregator network"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap Vault"
|
"message": "AirGap Vault"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Bayarin sa pag-apruba at aggregator network"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Pag-apruba Tx Halaga ng Gas"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Aprubahan ang limitasyon sa paggastos"
|
"message": "Aprubahan ang limitasyon sa paggastos"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "External Extension"
|
"message": "External Extension"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 na pag-apruba sa gas",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Hindi matagumpay"
|
"message": "Hindi matagumpay"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Kabul Ediyorum"
|
"message": "Kabul Ediyorum"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Toplayıcı ağ ücreti"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap Kasası"
|
"message": "AirGap Kasası"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Onaylayıcı ve toplayıcı ağ ücreti"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Onaylayıcı İşlem Gaz Maliyeti"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Harcama limitini onayla"
|
"message": "Harcama limitini onayla"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Harici Uzantı"
|
"message": "Harici Uzantı"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+1$ onay gazı",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Başarısız oldu"
|
"message": "Başarısız oldu"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "Tôi đồng ý"
|
"message": "Tôi đồng ý"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "Phí mạng cho trình tổng hợp"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap Vault"
|
"message": "AirGap Vault"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "Phí mạng cho trình tổng hợp và việc phê duyệt"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "Chi phí gas cho giao dịch phê duyệt"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "Phê duyệt giới hạn chi tiêu"
|
"message": "Phê duyệt giới hạn chi tiêu"
|
||||||
},
|
},
|
||||||
@ -1174,10 +1165,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "Tiện ích bên ngoài"
|
"message": "Tiện ích bên ngoài"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 gas phê duyệt",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "Không thành công"
|
"message": "Không thành công"
|
||||||
},
|
},
|
||||||
|
@ -192,9 +192,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "我同意"
|
"message": "我同意"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "聚合器网络费用"
|
|
||||||
},
|
|
||||||
"airgapVault": {
|
"airgapVault": {
|
||||||
"message": "AirGap Vault"
|
"message": "AirGap Vault"
|
||||||
},
|
},
|
||||||
@ -252,12 +249,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "批准和聚合器网络费用"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "批准 Tx 燃料成本"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "批准消费限额"
|
"message": "批准消费限额"
|
||||||
},
|
},
|
||||||
@ -1177,10 +1168,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "外部扩展程序"
|
"message": "外部扩展程序"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "额外的 $1 批准燃料",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "失败"
|
"message": "失败"
|
||||||
},
|
},
|
||||||
|
@ -179,9 +179,6 @@
|
|||||||
"affirmAgree": {
|
"affirmAgree": {
|
||||||
"message": "我同意"
|
"message": "我同意"
|
||||||
},
|
},
|
||||||
"aggregatorFeeCost": {
|
|
||||||
"message": "聚集器网络手续费"
|
|
||||||
},
|
|
||||||
"alertDisableTooltip": {
|
"alertDisableTooltip": {
|
||||||
"message": "这个可以在“设置 > 提醒”中进行更改"
|
"message": "这个可以在“设置 > 提醒”中进行更改"
|
||||||
},
|
},
|
||||||
@ -233,12 +230,6 @@
|
|||||||
"message": "MetaMask Flask",
|
"message": "MetaMask Flask",
|
||||||
"description": "The name of the application (Flask)"
|
"description": "The name of the application (Flask)"
|
||||||
},
|
},
|
||||||
"approvalAndAggregatorTxFeeCost": {
|
|
||||||
"message": "批准聚合商网络手续费"
|
|
||||||
},
|
|
||||||
"approvalTxGasCost": {
|
|
||||||
"message": "批准交易燃料成本"
|
|
||||||
},
|
|
||||||
"approve": {
|
"approve": {
|
||||||
"message": "批准消费限额"
|
"message": "批准消费限额"
|
||||||
},
|
},
|
||||||
@ -1017,10 +1008,6 @@
|
|||||||
"externalExtension": {
|
"externalExtension": {
|
||||||
"message": "外部扩展"
|
"message": "外部扩展"
|
||||||
},
|
},
|
||||||
"extraApprovalGas": {
|
|
||||||
"message": "+$1 批准燃料",
|
|
||||||
"description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas"
|
|
||||||
},
|
|
||||||
"failed": {
|
"failed": {
|
||||||
"message": "失败"
|
"message": "失败"
|
||||||
},
|
},
|
||||||
|
@ -10,7 +10,6 @@ import { ENVIRONMENT_TYPE_POPUP } from '../../../../shared/constants/app';
|
|||||||
|
|
||||||
// Modal Components
|
// Modal Components
|
||||||
import ConfirmCustomizeGasModal from '../gas-customization/gas-modal-page-container';
|
import ConfirmCustomizeGasModal from '../gas-customization/gas-modal-page-container';
|
||||||
import SwapsGasCustomizationModal from '../../../pages/swaps/swaps-gas-customization-modal';
|
|
||||||
import DepositEtherModal from './deposit-ether-modal';
|
import DepositEtherModal from './deposit-ether-modal';
|
||||||
import AccountDetailsModal from './account-details-modal';
|
import AccountDetailsModal from './account-details-modal';
|
||||||
import ExportPrivateKeyModal from './export-private-key-modal';
|
import ExportPrivateKeyModal from './export-private-key-modal';
|
||||||
@ -265,31 +264,6 @@ const MODALS = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
CUSTOMIZE_METASWAP_GAS: {
|
|
||||||
contents: <SwapsGasCustomizationModal />,
|
|
||||||
mobileModalStyle: {
|
|
||||||
width: '100vw',
|
|
||||||
height: '100vh',
|
|
||||||
top: '0',
|
|
||||||
transform: 'none',
|
|
||||||
left: '0',
|
|
||||||
right: '0',
|
|
||||||
margin: '0 auto',
|
|
||||||
},
|
|
||||||
laptopModalStyle: {
|
|
||||||
width: 'auto',
|
|
||||||
height: '0px',
|
|
||||||
top: '80px',
|
|
||||||
left: '0px',
|
|
||||||
transform: 'none',
|
|
||||||
margin: '0 auto',
|
|
||||||
position: 'relative',
|
|
||||||
},
|
|
||||||
contentStyle: {
|
|
||||||
borderRadius: '8px',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
EDIT_APPROVAL_PERMISSION: {
|
EDIT_APPROVAL_PERMISSION: {
|
||||||
contents: <EditApprovalPermission />,
|
contents: <EditApprovalPermission />,
|
||||||
mobileModalStyle: {
|
mobileModalStyle: {
|
||||||
|
@ -29,7 +29,6 @@ export default function FeeCard({
|
|||||||
primaryFee,
|
primaryFee,
|
||||||
secondaryFee,
|
secondaryFee,
|
||||||
hideTokenApprovalRow,
|
hideTokenApprovalRow,
|
||||||
onFeeCardMaxRowClick,
|
|
||||||
tokenApprovalSourceTokenSymbol,
|
tokenApprovalSourceTokenSymbol,
|
||||||
onTokenApprovalClick,
|
onTokenApprovalClick,
|
||||||
metaMaskFee,
|
metaMaskFee,
|
||||||
@ -139,16 +138,6 @@ export default function FeeCard({
|
|||||||
{t('maxFee')}
|
{t('maxFee')}
|
||||||
</Typography>
|
</Typography>
|
||||||
{`: ${secondaryFee.maxFee}`}
|
{`: ${secondaryFee.maxFee}`}
|
||||||
{!supportsEIP1559V2 &&
|
|
||||||
(!smartTransactionsEnabled ||
|
|
||||||
!smartTransactionsOptInStatus) && (
|
|
||||||
<span
|
|
||||||
className="fee-card__edit-link"
|
|
||||||
onClick={() => onFeeCardMaxRowClick()}
|
|
||||||
>
|
|
||||||
{t('edit')}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -213,7 +202,6 @@ FeeCard.propTypes = {
|
|||||||
fee: PropTypes.string.isRequired,
|
fee: PropTypes.string.isRequired,
|
||||||
maxFee: PropTypes.string.isRequired,
|
maxFee: PropTypes.string.isRequired,
|
||||||
}),
|
}),
|
||||||
onFeeCardMaxRowClick: PropTypes.func.isRequired,
|
|
||||||
hideTokenApprovalRow: PropTypes.bool.isRequired,
|
hideTokenApprovalRow: PropTypes.bool.isRequired,
|
||||||
tokenApprovalSourceTokenSymbol: PropTypes.string,
|
tokenApprovalSourceTokenSymbol: PropTypes.string,
|
||||||
onTokenApprovalClick: PropTypes.func,
|
onTokenApprovalClick: PropTypes.func,
|
||||||
|
@ -1,136 +0,0 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalComponent renders the component with initial props 1`] = `
|
|
||||||
<div
|
|
||||||
class="page-container__header page-container__header--no-padding-bottom"
|
|
||||||
data-testid="page-container__header"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="page-container__title"
|
|
||||||
>
|
|
||||||
Customize Gas
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="page-container__subtitle"
|
|
||||||
>
|
|
||||||
Increasing fee may decrease processing times, but it is not guaranteed.
|
|
||||||
</div>
|
|
||||||
<a
|
|
||||||
class="button btn-link page-container__header-close-text"
|
|
||||||
role="button"
|
|
||||||
tabindex="0"
|
|
||||||
>
|
|
||||||
Close
|
|
||||||
</a>
|
|
||||||
<ul
|
|
||||||
class="page-container__tabs"
|
|
||||||
>
|
|
||||||
<li
|
|
||||||
class="tab page-container__tab tab--active"
|
|
||||||
>
|
|
||||||
<button>
|
|
||||||
Basic
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
class="tab page-container__tab"
|
|
||||||
>
|
|
||||||
<button>
|
|
||||||
Advanced
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalComponent renders the component with initial props 2`] = `
|
|
||||||
<button
|
|
||||||
aria-checked="false"
|
|
||||||
class="button-group__button"
|
|
||||||
data-testid="button-group__button0"
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<div
|
|
||||||
class="gas-price-button-group__label"
|
|
||||||
>
|
|
||||||
Fast
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="gas-price-button-group__time-estimate"
|
|
||||||
>
|
|
||||||
~ 1 min 0 sec
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="gas-price-button-group__primary-currency"
|
|
||||||
>
|
|
||||||
$0.52
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="gas-price-button-group__secondary-currency"
|
|
||||||
>
|
|
||||||
0.0048 ETH
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="button-check-wrapper"
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
class="fa fa-check fa-sm"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalComponent renders the component with initial props 3`] = `
|
|
||||||
<div
|
|
||||||
class="gas-modal-content__info-row__send-info"
|
|
||||||
data-testid="gas-modal-content__info-row__send-info"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__send-info__label"
|
|
||||||
>
|
|
||||||
Send Amount
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__send-info__value"
|
|
||||||
>
|
|
||||||
mockSendAmount
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalComponent renders the component with initial props 4`] = `
|
|
||||||
<div
|
|
||||||
class="gas-modal-content__info-row__transaction-info"
|
|
||||||
data-testid="gas-modal-content__info-row__transaction-info"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__transaction-info__label"
|
|
||||||
>
|
|
||||||
Transaction fee
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__transaction-info__value"
|
|
||||||
>
|
|
||||||
mockTransactionFee
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalComponent renders the component with initial props 5`] = `
|
|
||||||
<div
|
|
||||||
class="gas-modal-content__info-row__total-info"
|
|
||||||
data-testid="gas-modal-content__info-row__total-info"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__total-info__label"
|
|
||||||
>
|
|
||||||
New Total
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__total-info__value"
|
|
||||||
>
|
|
||||||
mockNewTotalEth
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
`;
|
|
@ -1,98 +0,0 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalContainer renders the component with initial props 1`] = `
|
|
||||||
<div
|
|
||||||
class="page-container__header page-container__header--no-padding-bottom"
|
|
||||||
data-testid="page-container__header"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="page-container__title"
|
|
||||||
>
|
|
||||||
Customize Gas
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="page-container__subtitle"
|
|
||||||
>
|
|
||||||
Increasing fee may decrease processing times, but it is not guaranteed.
|
|
||||||
</div>
|
|
||||||
<a
|
|
||||||
class="button btn-link page-container__header-close-text"
|
|
||||||
role="button"
|
|
||||||
tabindex="0"
|
|
||||||
>
|
|
||||||
Close
|
|
||||||
</a>
|
|
||||||
<ul
|
|
||||||
class="page-container__tabs"
|
|
||||||
>
|
|
||||||
<li
|
|
||||||
class="tab page-container__tab tab--active"
|
|
||||||
>
|
|
||||||
<button>
|
|
||||||
Basic
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
class="tab page-container__tab"
|
|
||||||
>
|
|
||||||
<button>
|
|
||||||
Advanced
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalContainer renders the component with initial props 2`] = `
|
|
||||||
<div
|
|
||||||
class="gas-modal-content__info-row__send-info"
|
|
||||||
data-testid="gas-modal-content__info-row__send-info"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__send-info__label"
|
|
||||||
>
|
|
||||||
Send Amount
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__send-info__value"
|
|
||||||
>
|
|
||||||
0 ETH
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalContainer renders the component with initial props 3`] = `
|
|
||||||
<div
|
|
||||||
class="gas-modal-content__info-row__transaction-info"
|
|
||||||
data-testid="gas-modal-content__info-row__transaction-info"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__transaction-info__label"
|
|
||||||
>
|
|
||||||
Transaction fee
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__transaction-info__value"
|
|
||||||
>
|
|
||||||
0 ETH
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`GasCustomizationModalContainer renders the component with initial props 4`] = `
|
|
||||||
<div
|
|
||||||
class="gas-modal-content__info-row__total-info"
|
|
||||||
data-testid="gas-modal-content__info-row__total-info"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__total-info__label"
|
|
||||||
>
|
|
||||||
New Total
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="gas-modal-content__info-row__total-info__value"
|
|
||||||
>
|
|
||||||
0 ETH
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
`;
|
|
@ -1 +0,0 @@
|
|||||||
export { default } from './swaps-gas-customization-modal.container';
|
|
@ -1,281 +0,0 @@
|
|||||||
import React, { Component } from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import PageContainer from '../../../components/ui/page-container';
|
|
||||||
import { Tabs, Tab } from '../../../components/ui/tabs';
|
|
||||||
import { calcGasTotal } from '../../send/send.utils';
|
|
||||||
import { sumHexWEIsToUnformattedFiat } from '../../../helpers/utils/conversions.util';
|
|
||||||
import AdvancedGasInputs from '../../../components/app/gas-customization/advanced-gas-inputs';
|
|
||||||
import BasicTabContent from '../../../components/app/gas-customization/gas-modal-page-container/basic-tab-content';
|
|
||||||
import { GAS_ESTIMATE_TYPES } from '../../../helpers/constants/common';
|
|
||||||
import { CUSTOM_GAS_ESTIMATE } from '../../../../shared/constants/gas';
|
|
||||||
import { EVENT } from '../../../../shared/constants/metametrics';
|
|
||||||
|
|
||||||
export default class GasModalPageContainer extends Component {
|
|
||||||
static contextTypes = {
|
|
||||||
t: PropTypes.func,
|
|
||||||
trackEvent: PropTypes.func,
|
|
||||||
};
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
insufficientBalance: PropTypes.bool,
|
|
||||||
gasPriceButtonGroupProps: PropTypes.object,
|
|
||||||
infoRowProps: PropTypes.shape({
|
|
||||||
originalTotalFiat: PropTypes.string,
|
|
||||||
originalTotalEth: PropTypes.string,
|
|
||||||
newTotalFiat: PropTypes.string,
|
|
||||||
newTotalEth: PropTypes.string,
|
|
||||||
sendAmount: PropTypes.string,
|
|
||||||
transactionFee: PropTypes.string,
|
|
||||||
extraInfoRow: PropTypes.shape({
|
|
||||||
label: PropTypes.string,
|
|
||||||
value: PropTypes.string,
|
|
||||||
}),
|
|
||||||
}),
|
|
||||||
onSubmit: PropTypes.func,
|
|
||||||
cancelAndClose: PropTypes.func,
|
|
||||||
showCustomPriceTooLowWarning: PropTypes.bool,
|
|
||||||
disableSave: PropTypes.bool,
|
|
||||||
customGasLimitMessage: PropTypes.string,
|
|
||||||
customTotalSupplement: PropTypes.string,
|
|
||||||
usdConversionRate: PropTypes.number,
|
|
||||||
customGasPrice: PropTypes.string,
|
|
||||||
customGasLimit: PropTypes.string,
|
|
||||||
setSwapsCustomizationModalPrice: PropTypes.func,
|
|
||||||
setSwapsCustomizationModalLimit: PropTypes.func,
|
|
||||||
gasEstimateLoadingHasFailed: PropTypes.bool,
|
|
||||||
minimumGasLimit: PropTypes.number.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
state = {
|
|
||||||
gasSpeedType: '',
|
|
||||||
};
|
|
||||||
|
|
||||||
setGasSpeedType(gasEstimateType) {
|
|
||||||
if (gasEstimateType === GAS_ESTIMATE_TYPES.AVERAGE) {
|
|
||||||
this.setState({ gasSpeedType: 'average' });
|
|
||||||
} else {
|
|
||||||
this.setState({ gasSpeedType: 'fast' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
renderBasicTabContent(gasPriceButtonGroupProps) {
|
|
||||||
return (
|
|
||||||
<BasicTabContent
|
|
||||||
gasPriceButtonGroupProps={{
|
|
||||||
...gasPriceButtonGroupProps,
|
|
||||||
handleGasPriceSelection: ({ gasPrice, gasEstimateType }) => {
|
|
||||||
this.setGasSpeedType(gasEstimateType);
|
|
||||||
this.props.setSwapsCustomizationModalPrice(gasPrice);
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderAdvancedTabContent() {
|
|
||||||
const {
|
|
||||||
insufficientBalance,
|
|
||||||
showCustomPriceTooLowWarning,
|
|
||||||
infoRowProps: { transactionFee },
|
|
||||||
customGasLimitMessage,
|
|
||||||
setSwapsCustomizationModalPrice,
|
|
||||||
setSwapsCustomizationModalLimit,
|
|
||||||
customGasPrice,
|
|
||||||
customGasLimit,
|
|
||||||
minimumGasLimit,
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="advanced-tab">
|
|
||||||
<div className="advanced-tab__transaction-data-summary">
|
|
||||||
<div className="advanced-tab__transaction-data-summary__titles">
|
|
||||||
<span>{this.context.t('newTransactionFee')}</span>
|
|
||||||
</div>
|
|
||||||
<div className="advanced-tab__transaction-data-summary__container">
|
|
||||||
<div className="advanced-tab__transaction-data-summary__fee">
|
|
||||||
{transactionFee}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="advanced-tab__fee-chart">
|
|
||||||
<div className="advanced-tab__gas-inputs">
|
|
||||||
<AdvancedGasInputs
|
|
||||||
updateCustomGasPrice={(updatedPrice) => {
|
|
||||||
this.setState({ gasSpeedType: CUSTOM_GAS_ESTIMATE });
|
|
||||||
setSwapsCustomizationModalPrice(updatedPrice);
|
|
||||||
}}
|
|
||||||
updateCustomGasLimit={(updatedLimit) => {
|
|
||||||
this.setState({ gasSpeedType: CUSTOM_GAS_ESTIMATE });
|
|
||||||
setSwapsCustomizationModalLimit(updatedLimit);
|
|
||||||
}}
|
|
||||||
customGasPrice={customGasPrice}
|
|
||||||
customGasLimit={customGasLimit}
|
|
||||||
insufficientBalance={insufficientBalance}
|
|
||||||
customPriceIsSafe={!showCustomPriceTooLowWarning}
|
|
||||||
customGasLimitMessage={customGasLimitMessage}
|
|
||||||
minimumGasLimit={minimumGasLimit}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderInfoRows(
|
|
||||||
newTotalFiat,
|
|
||||||
newTotalEth,
|
|
||||||
sendAmount,
|
|
||||||
transactionFee,
|
|
||||||
extraInfoRow,
|
|
||||||
) {
|
|
||||||
return (
|
|
||||||
<div className="gas-modal-content__info-row-wrapper">
|
|
||||||
<div className="gas-modal-content__info-row">
|
|
||||||
<div
|
|
||||||
className="gas-modal-content__info-row__send-info"
|
|
||||||
data-testid="gas-modal-content__info-row__send-info"
|
|
||||||
>
|
|
||||||
<span className="gas-modal-content__info-row__send-info__label">
|
|
||||||
{this.context.t('sendAmount')}
|
|
||||||
</span>
|
|
||||||
<span className="gas-modal-content__info-row__send-info__value">
|
|
||||||
{sendAmount}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="gas-modal-content__info-row__transaction-info"
|
|
||||||
data-testid="gas-modal-content__info-row__transaction-info"
|
|
||||||
>
|
|
||||||
<span className="gas-modal-content__info-row__transaction-info__label">
|
|
||||||
{this.context.t('transactionFee')}
|
|
||||||
</span>
|
|
||||||
<span className="gas-modal-content__info-row__transaction-info__value">
|
|
||||||
{transactionFee}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{extraInfoRow && (
|
|
||||||
<div className="gas-modal-content__info-row__transaction-info">
|
|
||||||
<span className="gas-modal-content__info-row__transaction-info__label">
|
|
||||||
{extraInfoRow.label}
|
|
||||||
</span>
|
|
||||||
<span className="gas-modal-content__info-row__transaction-info__value">
|
|
||||||
{extraInfoRow.value}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div
|
|
||||||
className="gas-modal-content__info-row__total-info"
|
|
||||||
data-testid="gas-modal-content__info-row__total-info"
|
|
||||||
>
|
|
||||||
<span className="gas-modal-content__info-row__total-info__label">
|
|
||||||
{this.context.t('newTotal')}
|
|
||||||
</span>
|
|
||||||
<span className="gas-modal-content__info-row__total-info__value">
|
|
||||||
{newTotalEth}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className="gas-modal-content__info-row__fiat-total-info">
|
|
||||||
<span className="gas-modal-content__info-row__fiat-total-info__value">
|
|
||||||
{newTotalFiat}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderTabs() {
|
|
||||||
const {
|
|
||||||
gasPriceButtonGroupProps,
|
|
||||||
infoRowProps: {
|
|
||||||
newTotalFiat,
|
|
||||||
newTotalEth,
|
|
||||||
sendAmount,
|
|
||||||
transactionFee,
|
|
||||||
extraInfoRow,
|
|
||||||
},
|
|
||||||
gasEstimateLoadingHasFailed,
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const basicTabInfo = {
|
|
||||||
name: this.context.t('basic'),
|
|
||||||
content: this.renderBasicTabContent({
|
|
||||||
...gasPriceButtonGroupProps,
|
|
||||||
handleGasPriceSelection: this.props.setSwapsCustomizationModalPrice,
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
const advancedTabInfo = {
|
|
||||||
name: this.context.t('advanced'),
|
|
||||||
content: this.renderAdvancedTabContent(),
|
|
||||||
};
|
|
||||||
|
|
||||||
const tabsToRender = gasEstimateLoadingHasFailed
|
|
||||||
? [advancedTabInfo]
|
|
||||||
: [basicTabInfo, advancedTabInfo];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Tabs>
|
|
||||||
{tabsToRender.map(({ name, content }, i) => (
|
|
||||||
<Tab name={name} key={`gas-modal-tab-${i}`}>
|
|
||||||
<div className="gas-modal-content">
|
|
||||||
{content}
|
|
||||||
{this.renderInfoRows(
|
|
||||||
newTotalFiat,
|
|
||||||
newTotalEth,
|
|
||||||
sendAmount,
|
|
||||||
transactionFee,
|
|
||||||
extraInfoRow,
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Tab>
|
|
||||||
))}
|
|
||||||
</Tabs>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
cancelAndClose,
|
|
||||||
onSubmit,
|
|
||||||
disableSave,
|
|
||||||
customGasPrice,
|
|
||||||
customGasLimit,
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="gas-modal-page-container">
|
|
||||||
<PageContainer
|
|
||||||
title={this.context.t('customGas')}
|
|
||||||
subtitle={this.context.t('customGasSubTitle')}
|
|
||||||
tabsComponent={this.renderTabs()}
|
|
||||||
disabled={disableSave}
|
|
||||||
onCancel={() => cancelAndClose()}
|
|
||||||
onClose={() => cancelAndClose()}
|
|
||||||
onSubmit={() => {
|
|
||||||
const newSwapGasTotal = calcGasTotal(
|
|
||||||
customGasLimit,
|
|
||||||
customGasPrice,
|
|
||||||
);
|
|
||||||
|
|
||||||
this.context.trackEvent({
|
|
||||||
event: 'Gas Fees Changed',
|
|
||||||
category: EVENT.CATEGORIES.SWAPS,
|
|
||||||
properties: {
|
|
||||||
speed_set: this.state.gasSpeedType,
|
|
||||||
gas_fees: sumHexWEIsToUnformattedFiat(
|
|
||||||
[newSwapGasTotal, this.props.customTotalSupplement],
|
|
||||||
'usd',
|
|
||||||
this.props.usdConversionRate,
|
|
||||||
)?.slice(1),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
onSubmit(customGasLimit, customGasPrice);
|
|
||||||
}}
|
|
||||||
submitText={this.context.t('save')}
|
|
||||||
headerCloseText={this.context.t('close')}
|
|
||||||
hideCancel
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { renderWithProvider } from '../../../../test/jest';
|
|
||||||
import GasCustomizationModalComponent from './swaps-gas-customization-modal.component';
|
|
||||||
|
|
||||||
const createProps = (customProps = {}) => {
|
|
||||||
return {
|
|
||||||
insufficientBalance: false,
|
|
||||||
onSubmit: jest.fn(),
|
|
||||||
cancelAndClose: jest.fn(),
|
|
||||||
minimumGasLimit: 100,
|
|
||||||
gasPriceButtonGroupProps: {
|
|
||||||
buttonDataLoading: false,
|
|
||||||
className: 'gas-price-button-group',
|
|
||||||
gasButtonInfo: [
|
|
||||||
{
|
|
||||||
feeInPrimaryCurrency: '$0.52',
|
|
||||||
feeInSecondaryCurrency: '0.0048 ETH',
|
|
||||||
timeEstimate: '~ 1 min 0 sec',
|
|
||||||
priceInHexWei: '0xa1b2c3f',
|
|
||||||
gasEstimateType: 'FAST',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
feeInPrimaryCurrency: '$0.39',
|
|
||||||
feeInSecondaryCurrency: '0.004 ETH',
|
|
||||||
timeEstimate: '~ 1 min 30 sec',
|
|
||||||
priceInHexWei: '0xa1b2c39',
|
|
||||||
gasEstimateType: 'FAST',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
feeInPrimaryCurrency: '$0.30',
|
|
||||||
feeInSecondaryCurrency: '0.00354 ETH',
|
|
||||||
timeEstimate: '~ 2 min 1 sec',
|
|
||||||
priceInHexWei: '0xa1b2c30',
|
|
||||||
gasEstimateType: 'FAST',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
handleGasPriceSelection: 'mockSelectionFunction',
|
|
||||||
noButtonActiveByDefault: true,
|
|
||||||
showCheck: true,
|
|
||||||
newTotalFiat: 'mockNewTotalFiat',
|
|
||||||
newTotalEth: 'mockNewTotalEth',
|
|
||||||
},
|
|
||||||
infoRowProps: {
|
|
||||||
originalTotalFiat: 'mockOriginalTotalFiat',
|
|
||||||
originalTotalEth: 'mockOriginalTotalEth',
|
|
||||||
newTotalFiat: 'mockNewTotalFiat',
|
|
||||||
newTotalEth: 'mockNewTotalEth',
|
|
||||||
sendAmount: 'mockSendAmount',
|
|
||||||
transactionFee: 'mockTransactionFee',
|
|
||||||
extraInfoRow: { label: 'mockLabel', value: 'mockValue' },
|
|
||||||
},
|
|
||||||
...customProps,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('GasCustomizationModalComponent', () => {
|
|
||||||
it('renders the component with initial props', () => {
|
|
||||||
const props = createProps();
|
|
||||||
const { getByText, getByTestId } = renderWithProvider(
|
|
||||||
<GasCustomizationModalComponent {...props} />,
|
|
||||||
);
|
|
||||||
expect(getByTestId('page-container__header')).toMatchSnapshot();
|
|
||||||
expect(getByText('$0.52')).toBeInTheDocument();
|
|
||||||
expect(getByText('0.0048 ETH')).toBeInTheDocument();
|
|
||||||
expect(getByTestId('button-group__button0')).toMatchSnapshot();
|
|
||||||
expect(getByText('~ 1 min 30 sec')).toBeInTheDocument();
|
|
||||||
expect(getByText('$0.39')).toBeInTheDocument();
|
|
||||||
expect(getByText('0.004 ETH')).toBeInTheDocument();
|
|
||||||
expect(
|
|
||||||
getByTestId('gas-modal-content__info-row__send-info'),
|
|
||||||
).toMatchSnapshot();
|
|
||||||
expect(
|
|
||||||
getByTestId('gas-modal-content__info-row__transaction-info'),
|
|
||||||
).toMatchSnapshot();
|
|
||||||
expect(
|
|
||||||
getByTestId('gas-modal-content__info-row__total-info'),
|
|
||||||
).toMatchSnapshot();
|
|
||||||
expect(getByText('Save')).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,186 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import BigNumber from 'bignumber.js';
|
|
||||||
import { hideModal, customSwapsGasParamsUpdated } from '../../../store/actions';
|
|
||||||
import {
|
|
||||||
conversionRateSelector as getConversionRate,
|
|
||||||
getCurrentCurrency,
|
|
||||||
getCurrentEthBalance,
|
|
||||||
getDefaultActiveButtonIndex,
|
|
||||||
getRenderableGasButtonData,
|
|
||||||
getUSDConversionRate,
|
|
||||||
getSwapsDefaultToken,
|
|
||||||
} from '../../../selectors';
|
|
||||||
import { getNativeCurrency } from '../../../ducks/metamask/metamask';
|
|
||||||
|
|
||||||
import {
|
|
||||||
getSwapsCustomizationModalPrice,
|
|
||||||
getSwapsCustomizationModalLimit,
|
|
||||||
swapGasEstimateLoadingHasFailed,
|
|
||||||
swapGasPriceEstimateIsLoading,
|
|
||||||
getSwapGasPriceEstimateData,
|
|
||||||
swapCustomGasModalPriceEdited,
|
|
||||||
swapCustomGasModalLimitEdited,
|
|
||||||
shouldShowCustomPriceTooLowWarning,
|
|
||||||
swapCustomGasModalClosed,
|
|
||||||
} from '../../../ducks/swaps/swaps';
|
|
||||||
import {
|
|
||||||
addHexes,
|
|
||||||
getValueFromWeiHex,
|
|
||||||
sumHexWEIsToRenderableFiat,
|
|
||||||
} from '../../../helpers/utils/conversions.util';
|
|
||||||
import { formatETHFee } from '../../../helpers/utils/formatters';
|
|
||||||
import { calcGasTotal, isBalanceSufficient } from '../../send/send.utils';
|
|
||||||
import SwapsGasCustomizationModalComponent from './swaps-gas-customization-modal.component';
|
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
|
||||||
const currentCurrency = getCurrentCurrency(state);
|
|
||||||
const conversionRate = getConversionRate(state);
|
|
||||||
const nativeCurrencySymbol = getNativeCurrency(state);
|
|
||||||
const { symbol: swapsDefaultCurrencySymbol } = getSwapsDefaultToken(state);
|
|
||||||
const usedCurrencySymbol = nativeCurrencySymbol || swapsDefaultCurrencySymbol;
|
|
||||||
|
|
||||||
const { modalState: { props: modalProps } = {} } = state.appState.modal || {};
|
|
||||||
const {
|
|
||||||
value,
|
|
||||||
customGasLimitMessage = '',
|
|
||||||
customTotalSupplement = '',
|
|
||||||
extraInfoRow = null,
|
|
||||||
initialGasPrice,
|
|
||||||
initialGasLimit,
|
|
||||||
minimumGasLimit,
|
|
||||||
} = modalProps;
|
|
||||||
const buttonDataLoading = swapGasPriceEstimateIsLoading(state);
|
|
||||||
|
|
||||||
const swapsCustomizationModalPrice = getSwapsCustomizationModalPrice(state);
|
|
||||||
const swapsCustomizationModalLimit = getSwapsCustomizationModalLimit(state);
|
|
||||||
|
|
||||||
const customGasPrice = swapsCustomizationModalPrice || initialGasPrice;
|
|
||||||
const customGasLimit = swapsCustomizationModalLimit || initialGasLimit;
|
|
||||||
|
|
||||||
const customGasTotal = calcGasTotal(customGasLimit, customGasPrice);
|
|
||||||
|
|
||||||
const gasEstimates = getSwapGasPriceEstimateData(state);
|
|
||||||
const gasEstimatesInNewFormat = {
|
|
||||||
low: gasEstimates.safeLow,
|
|
||||||
medium: gasEstimates.average,
|
|
||||||
high: gasEstimates.fast,
|
|
||||||
};
|
|
||||||
|
|
||||||
const { averageEstimateData, fastEstimateData } = getRenderableGasButtonData(
|
|
||||||
gasEstimatesInNewFormat,
|
|
||||||
customGasLimit,
|
|
||||||
true,
|
|
||||||
conversionRate,
|
|
||||||
currentCurrency,
|
|
||||||
usedCurrencySymbol,
|
|
||||||
);
|
|
||||||
const gasButtonInfo = [averageEstimateData, fastEstimateData];
|
|
||||||
|
|
||||||
const newTotalFiat = sumHexWEIsToRenderableFiat(
|
|
||||||
[value, customGasTotal, customTotalSupplement],
|
|
||||||
currentCurrency,
|
|
||||||
conversionRate,
|
|
||||||
);
|
|
||||||
|
|
||||||
const balance = getCurrentEthBalance(state);
|
|
||||||
|
|
||||||
const newTotalEth = sumHexWEIsToRenderableEth(
|
|
||||||
[value, customGasTotal, customTotalSupplement],
|
|
||||||
usedCurrencySymbol,
|
|
||||||
);
|
|
||||||
|
|
||||||
const sendAmount = sumHexWEIsToRenderableEth(
|
|
||||||
[value, '0x0'],
|
|
||||||
usedCurrencySymbol,
|
|
||||||
);
|
|
||||||
|
|
||||||
const insufficientBalance = !isBalanceSufficient({
|
|
||||||
amount: value,
|
|
||||||
gasTotal: customGasTotal,
|
|
||||||
balance,
|
|
||||||
conversionRate,
|
|
||||||
});
|
|
||||||
|
|
||||||
const customGasLimitTooLow = new BigNumber(customGasLimit, 16).lt(
|
|
||||||
minimumGasLimit,
|
|
||||||
10,
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
customGasPrice,
|
|
||||||
customGasLimit,
|
|
||||||
showCustomPriceTooLowWarning: shouldShowCustomPriceTooLowWarning(state),
|
|
||||||
gasPriceButtonGroupProps: {
|
|
||||||
buttonDataLoading,
|
|
||||||
defaultActiveButtonIndex: getDefaultActiveButtonIndex(
|
|
||||||
gasButtonInfo,
|
|
||||||
customGasPrice,
|
|
||||||
),
|
|
||||||
gasButtonInfo,
|
|
||||||
},
|
|
||||||
infoRowProps: {
|
|
||||||
originalTotalFiat: sumHexWEIsToRenderableFiat(
|
|
||||||
[value, customGasTotal, customTotalSupplement],
|
|
||||||
currentCurrency,
|
|
||||||
conversionRate,
|
|
||||||
),
|
|
||||||
originalTotalEth: sumHexWEIsToRenderableEth(
|
|
||||||
[value, customGasTotal, customTotalSupplement],
|
|
||||||
usedCurrencySymbol,
|
|
||||||
),
|
|
||||||
newTotalFiat,
|
|
||||||
newTotalEth,
|
|
||||||
transactionFee: sumHexWEIsToRenderableEth(
|
|
||||||
['0x0', customGasTotal],
|
|
||||||
usedCurrencySymbol,
|
|
||||||
),
|
|
||||||
sendAmount,
|
|
||||||
extraInfoRow,
|
|
||||||
},
|
|
||||||
gasEstimateLoadingHasFailed: swapGasEstimateLoadingHasFailed(state),
|
|
||||||
insufficientBalance,
|
|
||||||
customGasLimitMessage,
|
|
||||||
customTotalSupplement,
|
|
||||||
usdConversionRate: getUSDConversionRate(state),
|
|
||||||
disableSave: insufficientBalance || customGasLimitTooLow,
|
|
||||||
minimumGasLimit,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => {
|
|
||||||
return {
|
|
||||||
cancelAndClose: () => {
|
|
||||||
dispatch(swapCustomGasModalClosed());
|
|
||||||
dispatch(hideModal());
|
|
||||||
},
|
|
||||||
onSubmit: async (gasLimit, gasPrice) => {
|
|
||||||
await dispatch(customSwapsGasParamsUpdated(gasLimit, gasPrice));
|
|
||||||
dispatch(swapCustomGasModalClosed());
|
|
||||||
dispatch(hideModal());
|
|
||||||
},
|
|
||||||
setSwapsCustomizationModalPrice: (newPrice) => {
|
|
||||||
dispatch(swapCustomGasModalPriceEdited(newPrice));
|
|
||||||
},
|
|
||||||
setSwapsCustomizationModalLimit: (newLimit) => {
|
|
||||||
dispatch(swapCustomGasModalLimitEdited(newLimit));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(
|
|
||||||
mapStateToProps,
|
|
||||||
mapDispatchToProps,
|
|
||||||
)(SwapsGasCustomizationModalComponent);
|
|
||||||
|
|
||||||
function sumHexWEIsToRenderableEth(hexWEIs, currencySymbol = 'ETH') {
|
|
||||||
const hexWEIsSum = hexWEIs.filter(Boolean).reduce(addHexes);
|
|
||||||
return formatETHFee(
|
|
||||||
getValueFromWeiHex({
|
|
||||||
value: hexWEIsSum,
|
|
||||||
fromCurrency: currencySymbol,
|
|
||||||
toCurrency: currencySymbol,
|
|
||||||
numberOfDecimals: 6,
|
|
||||||
}),
|
|
||||||
currencySymbol,
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import configureMockStore from 'redux-mock-store';
|
|
||||||
|
|
||||||
import {
|
|
||||||
renderWithProvider,
|
|
||||||
createSwapsMockStore,
|
|
||||||
} from '../../../../test/jest';
|
|
||||||
import GasCustomizationModalContainer from '.';
|
|
||||||
|
|
||||||
describe('GasCustomizationModalContainer', () => {
|
|
||||||
it('renders the component with initial props', () => {
|
|
||||||
const store = configureMockStore()(createSwapsMockStore());
|
|
||||||
const { getByText, getByTestId } = renderWithProvider(
|
|
||||||
<GasCustomizationModalContainer />,
|
|
||||||
store,
|
|
||||||
);
|
|
||||||
expect(getByTestId('page-container__header')).toMatchSnapshot();
|
|
||||||
expect(getByText('Basic')).toBeInTheDocument();
|
|
||||||
expect(getByText('Advanced')).toBeInTheDocument();
|
|
||||||
expect(getByText('Estimated Processing Times')).toBeInTheDocument();
|
|
||||||
expect(getByText('Send Amount')).toBeInTheDocument();
|
|
||||||
expect(getByText('Transaction fee')).toBeInTheDocument();
|
|
||||||
expect(
|
|
||||||
getByTestId('gas-modal-content__info-row__send-info'),
|
|
||||||
).toMatchSnapshot();
|
|
||||||
expect(
|
|
||||||
getByTestId('gas-modal-content__info-row__transaction-info'),
|
|
||||||
).toMatchSnapshot();
|
|
||||||
expect(
|
|
||||||
getByTestId('gas-modal-content__info-row__total-info'),
|
|
||||||
).toMatchSnapshot();
|
|
||||||
expect(getByText('Save')).toBeInTheDocument();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,253 +0,0 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
|
||||||
import { Provider } from 'react-redux';
|
|
||||||
import configureStore from '../../../store/store';
|
|
||||||
import testData from '../../../../.storybook/test-data';
|
|
||||||
import { formatETHFee } from '../../../helpers/utils/formatters';
|
|
||||||
import {
|
|
||||||
addHexes,
|
|
||||||
getValueFromWeiHex,
|
|
||||||
getWeiHexFromDecimalValue,
|
|
||||||
sumHexWEIsToRenderableFiat,
|
|
||||||
} from '../../../helpers/utils/conversions.util';
|
|
||||||
import { ETH } from '../../../helpers/constants/common';
|
|
||||||
import { calcGasTotal, isBalanceSufficient } from '../../send/send.utils';
|
|
||||||
import { conversionLessThan } from '../../../../shared/modules/conversion.utils';
|
|
||||||
import GasModalPageContainer from './swaps-gas-customization-modal.component';
|
|
||||||
// Using Test Data For Redux
|
|
||||||
const store = configureStore(testData);
|
|
||||||
|
|
||||||
export default {
|
|
||||||
title: 'Pages/Swaps/GasModalPageContainer',
|
|
||||||
id: __filename,
|
|
||||||
component: GasModalPageContainer,
|
|
||||||
argTypes: {
|
|
||||||
sendAmountArg: {
|
|
||||||
name: 'Send Amount (this should be static)',
|
|
||||||
control: { type: 'number', min: 0, step: 0.01 },
|
|
||||||
},
|
|
||||||
walletBalance: {
|
|
||||||
name: 'Wallet Balance (this should be static)',
|
|
||||||
control: { type: 'number', min: 0, step: 0.01 },
|
|
||||||
},
|
|
||||||
averageGasPrice: {
|
|
||||||
name: 'Average Gas Price',
|
|
||||||
control: { type: 'number', min: 0, step: 0.01 },
|
|
||||||
},
|
|
||||||
insufficientBalance: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
gasPriceButtonGroupProps: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
infoRowProps: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onSubmit: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
cancelAndClose: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
showCustomPriceTooLowWarning: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
disableSave: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
customGasLimitMessage: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
usdConversionRate: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
customGasPrice: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
customGasLimit: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setSwapsCustomizationModalLimit: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setSwapsCustomizationModalPrice: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
customTotalSupplement: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
gasEstimateLoadingHasFailed: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
minimumGasLimit: {
|
|
||||||
table: {
|
|
||||||
disable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
args: {
|
|
||||||
sendAmountArg: 0.01,
|
|
||||||
walletBalance: 10,
|
|
||||||
averageGasPrice: 2,
|
|
||||||
},
|
|
||||||
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
|
|
||||||
};
|
|
||||||
|
|
||||||
// Convert Hex Wei to Decimal ETH
|
|
||||||
const sumHexWEIsToRenderableEth = (hexWEIs, currencySymbol = 'ETH') => {
|
|
||||||
const hexWEIsSum = hexWEIs.filter(Boolean).reduce(addHexes);
|
|
||||||
return formatETHFee(
|
|
||||||
getValueFromWeiHex({
|
|
||||||
value: hexWEIsSum,
|
|
||||||
fromCurrency: currencySymbol,
|
|
||||||
toCurrency: currencySymbol,
|
|
||||||
numberOfDecimals: 6,
|
|
||||||
}),
|
|
||||||
currencySymbol,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const DefaultStory = (args) => {
|
|
||||||
const { sendAmountArg, walletBalance, averageGasPrice } = args;
|
|
||||||
|
|
||||||
const hexWei = getWeiHexFromDecimalValue({
|
|
||||||
value: sendAmountArg,
|
|
||||||
fromCurrency: ETH,
|
|
||||||
fromDenomination: ETH,
|
|
||||||
});
|
|
||||||
|
|
||||||
// ETH Balance
|
|
||||||
const balanceHexWei = getWeiHexFromDecimalValue({
|
|
||||||
value: walletBalance,
|
|
||||||
fromCurrency: ETH,
|
|
||||||
fromDenomination: ETH,
|
|
||||||
});
|
|
||||||
|
|
||||||
const sendAmount = sumHexWEIsToRenderableEth([hexWei, '0x0']);
|
|
||||||
const [gasLimit, setGasLimit] = useState('5208');
|
|
||||||
const [gasPrice, setGasPrice] = useState('ee6b2800');
|
|
||||||
const [transactionFee, setTransactionFee] = useState('');
|
|
||||||
const [totalETH, setTotalETH] = useState('');
|
|
||||||
const [totalFiat, setTotalFiat] = useState('');
|
|
||||||
const [isInsufficientBalance, setIsInsufficientBalance] = useState(false);
|
|
||||||
|
|
||||||
const { metamask } = store.getState();
|
|
||||||
const { currentCurrency, conversionRate } = metamask;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
// Transfer Fee
|
|
||||||
const customGasTotal = calcGasTotal(gasLimit, gasPrice);
|
|
||||||
setTransactionFee(sumHexWEIsToRenderableEth(['0x0', customGasTotal]));
|
|
||||||
|
|
||||||
// New Total ETH
|
|
||||||
setTotalETH(sumHexWEIsToRenderableEth([hexWei, customGasTotal, '']));
|
|
||||||
|
|
||||||
// New Total Fiat
|
|
||||||
setTotalFiat(
|
|
||||||
sumHexWEIsToRenderableFiat(
|
|
||||||
[hexWei, customGasTotal, ''],
|
|
||||||
currentCurrency,
|
|
||||||
conversionRate,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Check If Balance is Sufficient
|
|
||||||
setIsInsufficientBalance(
|
|
||||||
!isBalanceSufficient({
|
|
||||||
amount: hexWei,
|
|
||||||
gasTotal: customGasTotal,
|
|
||||||
balance: balanceHexWei,
|
|
||||||
conversionRate,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}, [
|
|
||||||
gasPrice,
|
|
||||||
gasLimit,
|
|
||||||
hexWei,
|
|
||||||
totalETH,
|
|
||||||
conversionRate,
|
|
||||||
currentCurrency,
|
|
||||||
totalFiat,
|
|
||||||
balanceHexWei,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Check If Gas Price Is Too Low
|
|
||||||
const shouldShowCustomPriceTooLowWarning = () => {
|
|
||||||
const customGasPrice = gasPrice;
|
|
||||||
|
|
||||||
if (!customGasPrice || averageGasPrice === undefined) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const customPriceRisksSwapFailure = conversionLessThan(
|
|
||||||
{
|
|
||||||
value: customGasPrice,
|
|
||||||
fromNumericBase: 'hex',
|
|
||||||
fromDenomination: 'WEI',
|
|
||||||
toDenomination: 'GWEI',
|
|
||||||
},
|
|
||||||
{ value: averageGasPrice, fromNumericBase: 'dec' },
|
|
||||||
);
|
|
||||||
|
|
||||||
return customPriceRisksSwapFailure;
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<GasModalPageContainer
|
|
||||||
insufficientBalance={isInsufficientBalance}
|
|
||||||
showCustomPriceTooLowWarning={shouldShowCustomPriceTooLowWarning()}
|
|
||||||
minimumGasLimit={21000}
|
|
||||||
infoRowProps={{
|
|
||||||
sendAmount,
|
|
||||||
transactionFee,
|
|
||||||
newTotalEth: totalETH,
|
|
||||||
newTotalFiat: totalFiat,
|
|
||||||
}}
|
|
||||||
gasPriceButtonGroupProps={{
|
|
||||||
buttonDataLoading: true,
|
|
||||||
}}
|
|
||||||
setSwapsCustomizationModalPrice={(newPrice) => {
|
|
||||||
setGasPrice(newPrice);
|
|
||||||
}}
|
|
||||||
setSwapsCustomizationModalLimit={(newLimit) => {
|
|
||||||
setGasLimit(newLimit);
|
|
||||||
}}
|
|
||||||
customGasPrice={gasPrice}
|
|
||||||
customGasLimit={gasLimit}
|
|
||||||
disableSave={
|
|
||||||
isInsufficientBalance || shouldShowCustomPriceTooLowWarning()
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
DefaultStory.storyName = 'Default';
|
|
@ -19,7 +19,6 @@ import { usePrevious } from '../../../hooks/usePrevious';
|
|||||||
import { useGasFeeInputs } from '../../../hooks/gasFeeInput/useGasFeeInputs';
|
import { useGasFeeInputs } from '../../../hooks/gasFeeInput/useGasFeeInputs';
|
||||||
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
||||||
import FeeCard from '../fee-card';
|
import FeeCard from '../fee-card';
|
||||||
import EditGasPopover from '../../../components/app/edit-gas-popover/edit-gas-popover.component';
|
|
||||||
import {
|
import {
|
||||||
FALLBACK_GAS_MULTIPLIER,
|
FALLBACK_GAS_MULTIPLIER,
|
||||||
getQuotes,
|
getQuotes,
|
||||||
@ -89,16 +88,12 @@ import {
|
|||||||
} from '../../../helpers/utils/token-util';
|
} from '../../../helpers/utils/token-util';
|
||||||
import {
|
import {
|
||||||
decimalToHex,
|
decimalToHex,
|
||||||
hexToDecimal,
|
|
||||||
getValueFromWeiHex,
|
|
||||||
decGWEIToHexWEI,
|
decGWEIToHexWEI,
|
||||||
hexWEIToDecGWEI,
|
hexWEIToDecGWEI,
|
||||||
addHexes,
|
addHexes,
|
||||||
} from '../../../helpers/utils/conversions.util';
|
} from '../../../helpers/utils/conversions.util';
|
||||||
import { GasFeeContextProvider } from '../../../contexts/gasFee';
|
import { GasFeeContextProvider } from '../../../contexts/gasFee';
|
||||||
import { TransactionModalContextProvider } from '../../../contexts/transaction-modal';
|
import { TransactionModalContextProvider } from '../../../contexts/transaction-modal';
|
||||||
import AdvancedGasFeePopover from '../../../components/app/advanced-gas-fee-popover';
|
|
||||||
import EditGasFeePopover from '../../../components/app/edit-gas-fee-popover';
|
|
||||||
import MainQuoteSummary from '../main-quote-summary';
|
import MainQuoteSummary from '../main-quote-summary';
|
||||||
import { calcGasTotal } from '../../send/send.utils';
|
import { calcGasTotal } from '../../send/send.utils';
|
||||||
import { getCustomTxParamsData } from '../../confirm-approve/confirm-approve.util';
|
import { getCustomTxParamsData } from '../../confirm-approve/confirm-approve.util';
|
||||||
@ -137,7 +132,6 @@ export default function ViewQuote() {
|
|||||||
const [selectQuotePopoverShown, setSelectQuotePopoverShown] = useState(false);
|
const [selectQuotePopoverShown, setSelectQuotePopoverShown] = useState(false);
|
||||||
const [warningHidden, setWarningHidden] = useState(false);
|
const [warningHidden, setWarningHidden] = useState(false);
|
||||||
const [originalApproveAmount, setOriginalApproveAmount] = useState(null);
|
const [originalApproveAmount, setOriginalApproveAmount] = useState(null);
|
||||||
const [showEditGasPopover, setShowEditGasPopover] = useState(false);
|
|
||||||
// We need to have currentTimestamp in state, otherwise it would change with each rerender.
|
// We need to have currentTimestamp in state, otherwise it would change with each rerender.
|
||||||
const [currentTimestamp] = useState(Date.now());
|
const [currentTimestamp] = useState(Date.now());
|
||||||
|
|
||||||
@ -391,7 +385,6 @@ export default function ViewQuote() {
|
|||||||
rawEthFee: maxRawEthFee,
|
rawEthFee: maxRawEthFee,
|
||||||
feeInUsd: maxFeeInUsd,
|
feeInUsd: maxFeeInUsd,
|
||||||
} = renderableMaxFees;
|
} = renderableMaxFees;
|
||||||
const { nonGasFee } = renderableMaxFees;
|
|
||||||
additionalTrackingParams.reg_tx_max_fee_in_usd = Number(maxFeeInUsd);
|
additionalTrackingParams.reg_tx_max_fee_in_usd = Number(maxFeeInUsd);
|
||||||
additionalTrackingParams.reg_tx_max_fee_in_eth = Number(maxRawEthFee);
|
additionalTrackingParams.reg_tx_max_fee_in_eth = Number(maxRawEthFee);
|
||||||
|
|
||||||
@ -678,53 +671,6 @@ export default function ViewQuote() {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const nonGasFeeIsPositive = new BigNumber(nonGasFee, 16).gt(0);
|
|
||||||
const approveGasTotal = calcGasTotal(
|
|
||||||
approveGas || '0x0',
|
|
||||||
networkAndAccountSupports1559 ? baseAndPriorityFeePerGas : gasPrice,
|
|
||||||
);
|
|
||||||
const extraNetworkFeeTotalInHexWEI = new BigNumber(nonGasFee, 16)
|
|
||||||
.plus(approveGasTotal, 16)
|
|
||||||
.toString(16);
|
|
||||||
const extraNetworkFeeTotalInEth = getValueFromWeiHex({
|
|
||||||
value: extraNetworkFeeTotalInHexWEI,
|
|
||||||
toDenomination: 'ETH',
|
|
||||||
numberOfDecimals: 4,
|
|
||||||
});
|
|
||||||
|
|
||||||
let extraInfoRowLabel = '';
|
|
||||||
if (approveGas && nonGasFeeIsPositive) {
|
|
||||||
extraInfoRowLabel = t('approvalAndAggregatorTxFeeCost');
|
|
||||||
} else if (approveGas) {
|
|
||||||
extraInfoRowLabel = t('approvalTxGasCost');
|
|
||||||
} else if (nonGasFeeIsPositive) {
|
|
||||||
extraInfoRowLabel = t('aggregatorFeeCost');
|
|
||||||
}
|
|
||||||
|
|
||||||
const onFeeCardMaxRowClick = () => {
|
|
||||||
networkAndAccountSupports1559
|
|
||||||
? setShowEditGasPopover(true)
|
|
||||||
: dispatch(
|
|
||||||
showModal({
|
|
||||||
name: 'CUSTOMIZE_METASWAP_GAS',
|
|
||||||
value: tradeValue,
|
|
||||||
customGasLimitMessage: approveGas
|
|
||||||
? t('extraApprovalGas', [hexToDecimal(approveGas)])
|
|
||||||
: '',
|
|
||||||
customTotalSupplement: approveGasTotal,
|
|
||||||
extraInfoRow: extraInfoRowLabel
|
|
||||||
? {
|
|
||||||
label: extraInfoRowLabel,
|
|
||||||
value: `${extraNetworkFeeTotalInEth} ${nativeCurrencySymbol}`,
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
initialGasPrice: gasPrice,
|
|
||||||
initialGasLimit: maxGasLimit,
|
|
||||||
minimumGasLimit: new BigNumber(nonCustomMaxGasLimit, 16).toNumber(),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const actionableBalanceErrorMessage = tokenBalanceUnavailable
|
const actionableBalanceErrorMessage = tokenBalanceUnavailable
|
||||||
? t('swapTokenBalanceUnavailable', [sourceTokenSymbol])
|
? t('swapTokenBalanceUnavailable', [sourceTokenSymbol])
|
||||||
: t('swapApproveNeedMoreTokens', [
|
: t('swapApproveNeedMoreTokens', [
|
||||||
@ -863,10 +809,6 @@ export default function ViewQuote() {
|
|||||||
isSwapButtonDisabled,
|
isSwapButtonDisabled,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const onCloseEditGasPopover = () => {
|
|
||||||
setShowEditGasPopover(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Thanks to the next line we will only do quotes polling 3 times before showing a Quote Timeout modal.
|
// Thanks to the next line we will only do quotes polling 3 times before showing a Quote Timeout modal.
|
||||||
dispatch(setSwapsQuotesPollingLimitEnabled(true));
|
dispatch(setSwapsQuotesPollingLimitEnabled(true));
|
||||||
@ -928,25 +870,6 @@ export default function ViewQuote() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!supportsEIP1559V2 &&
|
|
||||||
showEditGasPopover &&
|
|
||||||
networkAndAccountSupports1559 && (
|
|
||||||
<EditGasPopover
|
|
||||||
transaction={transaction}
|
|
||||||
minimumGasLimit={usedGasLimit}
|
|
||||||
defaultEstimateToUse={GAS_RECOMMENDATIONS.HIGH}
|
|
||||||
mode={EDIT_GAS_MODES.SWAPS}
|
|
||||||
confirmButtonText={t('submit')}
|
|
||||||
onClose={onCloseEditGasPopover}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{supportsEIP1559V2 && (
|
|
||||||
<>
|
|
||||||
<EditGasFeePopover />
|
|
||||||
<AdvancedGasFeePopover />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={classnames('view-quote__warning-wrapper', {
|
className={classnames('view-quote__warning-wrapper', {
|
||||||
'view-quote__warning-wrapper--thin': !isShowingWarning,
|
'view-quote__warning-wrapper--thin': !isShowingWarning,
|
||||||
@ -1008,7 +931,6 @@ export default function ViewQuote() {
|
|||||||
fee: feeInFiat,
|
fee: feeInFiat,
|
||||||
maxFee: maxFeeInFiat,
|
maxFee: maxFeeInFiat,
|
||||||
}}
|
}}
|
||||||
onFeeCardMaxRowClick={onFeeCardMaxRowClick}
|
|
||||||
hideTokenApprovalRow={
|
hideTokenApprovalRow={
|
||||||
!approveTxParams || (balanceError && !warningHidden)
|
!approveTxParams || (balanceError && !warningHidden)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user