Enable buying MATIC on Polygon, BNB on BSC, AVAX on Avalanche, FTM on Fantom, CELO on Celo, and respective stablecoins on Transak (#13398)

feature/default_network_editable
David Walsh 3 years ago committed by GitHub
parent 8d2d64a32f
commit 851fce9a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/_locales/am/messages.json
  2. 6
      app/_locales/ar/messages.json
  3. 6
      app/_locales/bg/messages.json
  4. 6
      app/_locales/bn/messages.json
  5. 6
      app/_locales/ca/messages.json
  6. 6
      app/_locales/cs/messages.json
  7. 6
      app/_locales/da/messages.json
  8. 6
      app/_locales/de/messages.json
  9. 12
      app/_locales/el/messages.json
  10. 20
      app/_locales/en/messages.json
  11. 6
      app/_locales/es/messages.json
  12. 6
      app/_locales/es_419/messages.json
  13. 6
      app/_locales/et/messages.json
  14. 6
      app/_locales/fa/messages.json
  15. 6
      app/_locales/fi/messages.json
  16. 6
      app/_locales/fil/messages.json
  17. 12
      app/_locales/fr/messages.json
  18. 6
      app/_locales/he/messages.json
  19. 12
      app/_locales/hi/messages.json
  20. 6
      app/_locales/hn/messages.json
  21. 6
      app/_locales/hr/messages.json
  22. 6
      app/_locales/ht/messages.json
  23. 6
      app/_locales/hu/messages.json
  24. 12
      app/_locales/id/messages.json
  25. 6
      app/_locales/it/messages.json
  26. 12
      app/_locales/ja/messages.json
  27. 6
      app/_locales/kn/messages.json
  28. 12
      app/_locales/ko/messages.json
  29. 6
      app/_locales/lt/messages.json
  30. 6
      app/_locales/lv/messages.json
  31. 3
      app/_locales/ms/messages.json
  32. 6
      app/_locales/nl/messages.json
  33. 6
      app/_locales/no/messages.json
  34. 6
      app/_locales/ph/messages.json
  35. 6
      app/_locales/pl/messages.json
  36. 6
      app/_locales/pt/messages.json
  37. 6
      app/_locales/pt_BR/messages.json
  38. 6
      app/_locales/ro/messages.json
  39. 12
      app/_locales/ru/messages.json
  40. 6
      app/_locales/sk/messages.json
  41. 6
      app/_locales/sl/messages.json
  42. 6
      app/_locales/sr/messages.json
  43. 6
      app/_locales/sv/messages.json
  44. 6
      app/_locales/sw/messages.json
  45. 6
      app/_locales/ta/messages.json
  46. 6
      app/_locales/th/messages.json
  47. 12
      app/_locales/tl/messages.json
  48. 12
      app/_locales/tr/messages.json
  49. 6
      app/_locales/uk/messages.json
  50. 12
      app/_locales/vi/messages.json
  51. 12
      app/_locales/zh_CN/messages.json
  52. 6
      app/_locales/zh_TW/messages.json
  53. 75
      app/scripts/lib/buy-eth-url.test.js
  54. 19
      app/scripts/lib/buy-url.js
  55. 117
      app/scripts/lib/buy-url.test.js
  56. 58
      shared/constants/network.js
  57. 41
      ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js
  58. 6
      ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.container.js
  59. 8
      ui/components/app/wallet-overview/eth-overview.js
  60. 11
      ui/selectors/selectors.js
  61. 4
      ui/store/actions.js

@ -283,9 +283,6 @@
"deleteNetworkDescription": {
"message": "ይህን አውታረ መረብ ለመሰረዝ እንደሚፈልጉ እርግጠኛ ነዎት?"
},
"depositEther": {
"message": "Ether አስቀምጥ"
},
"details": {
"message": "ዝርዝሮች"
},
@ -581,9 +578,6 @@
"myAccounts": {
"message": "የእኔ መለያዎች"
},
"needEtherInWallet": {
"message": "MetaMask በመጠቀም ያልተማከሉ መተግበሪያዎች ጋር ግንኙነት ለማድረግ፣ በቋትዎ ውስጥ Ether ያስፈልግዎታል።"
},
"needImportFile": {
"message": "የሚያስመጡትን ፋይል መምረጥ አለብዎት።",
"description": "User is important an account and needs to add a file to continue"

@ -300,9 +300,6 @@
"deleteNetworkDescription": {
"message": "هل أنت متأكد أنك تريد حذف هذه الشبكة؟"
},
"depositEther": {
"message": "إيداع عملة إيثير"
},
"details": {
"message": "التفاصيل"
},
@ -597,9 +594,6 @@
"myAccounts": {
"message": "حساباتي"
},
"needEtherInWallet": {
"message": "للتفاعل مع التطبيقات اللامركزية باستخدام MetaMask، ستحتاج إلى الإيثير في محفظتك."
},
"needImportFile": {
"message": "يلزم تحديد ملف للاستيراد.",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Наистина ли искате да изтриете тази мрежа?"
},
"depositEther": {
"message": "Депозирайте етер"
},
"details": {
"message": "Подробности"
},
@ -592,9 +589,6 @@
"myAccounts": {
"message": "Моите акаунти"
},
"needEtherInWallet": {
"message": "За да взаимодействате с децентрализираните приложения, използвайки MetaMask, ще ви е необходим етер в портфейла ви."
},
"needImportFile": {
"message": "Трябва да изберете файл за импортиране.",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "আপনিি এই নটওয়কটির বিষয়িিত?"
},
"depositEther": {
"message": "ইথর জম করন"
},
"details": {
"message": "বিশদ বিবরণ"
},
@ -596,9 +593,6 @@
"myAccounts": {
"message": "আমর অউনটগি"
},
"needEtherInWallet": {
"message": "MetaMask বযবহর কর ছড়িিিিশনগির সগ করত, আপনর ওয় ইথর লগব।"
},
"needImportFile": {
"message": "আমদি করর জনয আপন অবশযই একটিইল নিচন করত হব।",
"description": "User is important an account and needs to add a file to continue"

@ -289,9 +289,6 @@
"deleteNetworkDescription": {
"message": "Estàs segur que vols eliminar aquesta xarxa?"
},
"depositEther": {
"message": "Diposita Ether"
},
"details": {
"message": "Detalls"
},
@ -580,9 +577,6 @@
"myAccounts": {
"message": "Els meus Comptes"
},
"needEtherInWallet": {
"message": "Per a interactuar amb aplicacions descentralitzades fent servir MetaMask, necessitaràs Ether al teu moneder."
},
"needImportFile": {
"message": "Has de seleccionar un arxiu per a importar.",
"description": "User is important an account and needs to add a file to continue"

@ -108,9 +108,6 @@
"decimalsMustZerotoTen": {
"message": "Desetinných míst musí být od 0 do 36."
},
"depositEther": {
"message": "Vložit Ether"
},
"details": {
"message": "Podrobnosti"
},
@ -246,9 +243,6 @@
"myAccounts": {
"message": "Moje účty"
},
"needEtherInWallet": {
"message": "Potřebujete Ether v peněžence, abyste mohli pomocí MetaMasku interagovat s decentralizovanými aplikacemi."
},
"needImportFile": {
"message": "Musíte zvolit soubor k importu.",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Er du sikker på, at du vil slette dette netværk?"
},
"depositEther": {
"message": "Indbetal Ether"
},
"details": {
"message": "Detaljer"
},
@ -580,9 +577,6 @@
"myAccounts": {
"message": "Mine Konti"
},
"needEtherInWallet": {
"message": "Du skal have Ether i din tegnebog for at interagere med decentraliserede applikationer, der bruger MetaMask."
},
"needImportFile": {
"message": "Du skal vælge en fil, der skal importeres.",
"description": "User is important an account and needs to add a file to continue"

@ -283,9 +283,6 @@
"deleteNetworkDescription": {
"message": "Sind Sie sicher, dass Sie dieses Netzwerk löschen möchten?"
},
"depositEther": {
"message": "Ether einzahlen"
},
"directDepositEther": {
"message": "Sofort Ether einzahlen"
},
@ -569,9 +566,6 @@
"myAccounts": {
"message": "Meine Accounts"
},
"needEtherInWallet": {
"message": "Um dezentralisierte Applikationen mit MetaMask verwenden zu können, benötigst du Ether in deiner Wallet."
},
"needImportFile": {
"message": "Für den Import musst du eine Datei auswählen.",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "Αγορά"
},
"buyWithTransak": {
"message": "Αγοράστε ETH με Transak"
},
"buyWithTransakDescription": {
"message": "Η Transak υποστηρίζει χρεωστική κάρτα και τραπεζικές μεταφορές (ανάλογα με τη τοποθεσία σας) σε 59+ χώρες. Το ETH κατατίθεται στο λογαριασμό σας MetaMask."
},
"buyWithWyre": {
"message": "Αγοράστε ETH με το Wyre"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "Θέλετε σίγουρα να διαγράψετε αυτό το δίκτυο;"
},
"depositEther": {
"message": "Κατάθεση Ether"
},
"description": {
"message": "Περιγραφή"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "Όνομα"
},
"needEtherInWallet": {
"message": "Για να αλληλεπιδράσετε με αποκεντρωμένες εφαρμογές χρησιμοποιώντας το MetaMask, θα χρειαστείτε Ether στο πορτοφόλι σας."
},
"needHelp": {
"message": "Χρειάζεστε βοήθεια? Επικοινωνήστε με $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -389,11 +389,13 @@
"buy": {
"message": "Buy"
},
"buyWithTransak": {
"message": "Buy ETH with Transak"
"buyCryptoWithTransak": {
"message": "Buy $1 with Transak",
"description": "$1 represents the cypto symbol to be purchased"
},
"buyWithTransakDescription": {
"message": "Transak supports debit card and bank transfers (depending on location) in 59+ countries. ETH deposits into your MetaMask account."
"buyCryptoWithTransakDescription": {
"message": "Transak supports debit card and bank transfers (depending on location) in 59+ countries. $1 deposits into your MetaMask account.",
"description": "$1 represents the cypto symbol to be purchased"
},
"buyWithWyre": {
"message": "Buy ETH with Wyre"
@ -745,8 +747,9 @@
"deleteNetworkDescription": {
"message": "Are you sure you want to delete this network?"
},
"depositEther": {
"message": "Deposit Ether"
"depositCrypto": {
"message": "Deposit $1",
"description": "$1 represents the cypto symbol to be purchased"
},
"description": {
"message": "Description"
@ -1796,8 +1799,9 @@
"name": {
"message": "Name"
},
"needEtherInWallet": {
"message": "To interact with decentralized applications using MetaMask, you’ll need Ether in your wallet."
"needCryptoInWallet": {
"message": "To interact with decentralized applications using MetaMask, you’ll need $1 in your wallet.",
"description": "$1 represents the cypto symbol to be purchased"
},
"needHelp": {
"message": "Need help? Contact $1",

@ -516,9 +516,6 @@
"deleteNetworkDescription": {
"message": "¿Está seguro de que quiere eliminar esta red?"
},
"depositEther": {
"message": "Depositar ether"
},
"details": {
"message": "Detalles"
},
@ -1100,9 +1097,6 @@
"name": {
"message": "Nombre"
},
"needEtherInWallet": {
"message": "Para interactuar con aplicaciones descentralizadas mediante MetaMask, necesitará ethers en su cartera."
},
"needHelp": {
"message": "¿Necesita ayuda? Comuníquese con $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -525,9 +525,6 @@
"deleteNetworkDescription": {
"message": "¿Está seguro de que quiere eliminar esta red?"
},
"depositEther": {
"message": "Depositar ether"
},
"details": {
"message": "Detalles"
},
@ -1112,9 +1109,6 @@
"name": {
"message": "Nombre"
},
"needEtherInWallet": {
"message": "Para interactuar con aplicaciones descentralizadas mediante MetaMask, necesitará ethers en su cartera."
},
"needHelp": {
"message": "¿Necesita ayuda? Comuníquese con $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Olete kindel, et soovite selle võrgu kustutada?"
},
"depositEther": {
"message": "Eetri sissemakse"
},
"details": {
"message": "Üksikasjad"
},
@ -586,9 +583,6 @@
"myAccounts": {
"message": "Minu kontod"
},
"needEtherInWallet": {
"message": "Selleks, et suhelda MetaMaski abil detsentraliseeritud rakendustega, peab teil rahakotis eetrit olema."
},
"needImportFile": {
"message": "Peate importimiseks faili valima.",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "آیا مطمئن هستید که این شبکه حذف شود؟"
},
"depositEther": {
"message": "پرداخت ایتر"
},
"details": {
"message": "جزئیات"
},
@ -596,9 +593,6 @@
"myAccounts": {
"message": "حساب های من"
},
"needEtherInWallet": {
"message": "برای تعامل با اپلیکیشن های غیر متمرکز شده با استفاده از MetaMask، شما نیاز به ایتر در کیف تان خواهید داشت."
},
"needImportFile": {
"message": "شما باید یک فایل برای وارد کردن را انتخاب کنید.",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Haluatko varmasti poistaa tämän verkon?"
},
"depositEther": {
"message": "Talleta Etheriä"
},
"details": {
"message": "Tiedot"
},
@ -596,9 +593,6 @@
"myAccounts": {
"message": "Omat tilit"
},
"needEtherInWallet": {
"message": "Ollaksesi vuorovaikutuksessa hajautettujen sovellusten kanssa sinulla on oltava lompakossasi Ether."
},
"needImportFile": {
"message": "Sinun tarvitsee valita tuotava tiedosto.",
"description": "User is important an account and needs to add a file to continue"

@ -268,9 +268,6 @@
"deleteNetworkDescription": {
"message": "Sigurado ka bang gusto mong i-delete ang network na ito?"
},
"depositEther": {
"message": "Magdeposito ng Ether"
},
"details": {
"message": "Mga Detalye"
},
@ -534,9 +531,6 @@
"myAccounts": {
"message": "Mga Account Ko"
},
"needEtherInWallet": {
"message": "Para gumamit ng mga decentralized na application gamit ang MetaMask, mangangailangan ka ng Ether sa iyong wallet."
},
"needImportFile": {
"message": "Dapat kang pumili ng file na ii-import.",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "Acheter"
},
"buyWithTransak": {
"message": "Achetez des ETH avec Transak"
},
"buyWithTransakDescription": {
"message": "Transak prend en charge les cartes de débit et les virements bancaires (en fonction de l’emplacement) dans plus de 59 pays. Les ETH sont ensuite déposés sur votre compte MetaMask."
},
"buyWithWyre": {
"message": "Acheter ETH avec Wyre"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "Êtes-vous sûr de vouloir supprimer ce réseau ?"
},
"depositEther": {
"message": "Déposer de l'Ether"
},
"description": {
"message": "Description"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "Nom"
},
"needEtherInWallet": {
"message": "Pour interagir avec des applications décentralisées à l'aide de MetaMask, vous avez besoin d'Ether dans votre portefeuille."
},
"needHelp": {
"message": "Vous avez besoin d’aide? Contactez $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "הנך בטוח/ה שברצונך למחוק רשת זו?"
},
"depositEther": {
"message": "הפקדת את'ר"
},
"details": {
"message": "פרטים"
},
@ -593,9 +590,6 @@
"myAccounts": {
"message": "החשבונות שלי"
},
"needEtherInWallet": {
"message": "כדי לתקשר עם אפליקציות מבוזרות באמצעות MetaMask, צריך להיות לך את'ר בארנק."
},
"needImportFile": {
"message": "יש לבחור קובץ לייצוא.",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "खर"
},
"buyWithTransak": {
"message": "Transak कथ ETH खर"
},
"buyWithTransakDescription": {
"message": "Transak 59+ दिट कड और बक हसतरण (सन क आधर पर) क समरथन करत। ETH आपक MetaMask अकट म जम करत।"
},
"buyWithWyre": {
"message": "ETH क Wyre सथ खर"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "क आप वकई इस नटवरक क हटहत?"
},
"depositEther": {
"message": "Ether जम कर"
},
"description": {
"message": "विवरण"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "नम"
},
"needEtherInWallet": {
"message": "MetaMask क उपयग करकित एपिशन कथ सहभि करनिए, आपक अपनट म Ether क आवशयकत।"
},
"needHelp": {
"message": "मदद चिए? $1 सपरक कर",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -84,9 +84,6 @@
"decimalsMustZerotoTen": {
"message": "दशमलव कम स कम 0 हिए, और 36 स अधिक नहिए।"
},
"depositEther": {
"message": "जम - Ether"
},
"details": {
"message": "सश विवरण"
},
@ -223,9 +220,6 @@
"myAccounts": {
"message": "म"
},
"needEtherInWallet": {
"message": "मक क उपयग करनित अनरयथ बतचत करनिए, आपक अपनट म ईथर क आवशयकत।"
},
"needImportFile": {
"message": "आयत करनिए आपक एक फइल क चयन करन।",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Sigurno želite izbrisati ovu mrežu?"
},
"depositEther": {
"message": "Položi Ether"
},
"details": {
"message": "Detalji"
},
@ -589,9 +586,6 @@
"myAccounts": {
"message": "Moji računi"
},
"needEtherInWallet": {
"message": "Trebate Ether u svojem novčaniku kako biste ostvarili interakciju s decentraliziranim aplikacijama uporabom usluge MetaMask. "
},
"needImportFile": {
"message": "Morate odabrati datoteku za uvoz.",
"description": "User is important an account and needs to add a file to continue"

@ -159,9 +159,6 @@
"decimalsMustZerotoTen": {
"message": "Desimal yo dwe omwen 0, epi pa dwe plis pase 36."
},
"depositEther": {
"message": "Depo Ether"
},
"details": {
"message": "Detay yo"
},
@ -355,9 +352,6 @@
"myAccounts": {
"message": "Kont mwen"
},
"needEtherInWallet": {
"message": "Pou kominike avèk aplikasyon desantralize ou dwe itilize MetaMask, ou pral bezwen Ether nan Wallet ou."
},
"needImportFile": {
"message": "Ou dwe chwazi yon dosye pou enpòte.",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Biztosan törli ezt a hálózatot?"
},
"depositEther": {
"message": "Ether befizetése"
},
"details": {
"message": "Részletek"
},
@ -589,9 +586,6 @@
"myAccounts": {
"message": "Fiókjaim"
},
"needEtherInWallet": {
"message": "Ha a MetaMaskon keresztül szeretne interakcióba lépni decentralizált alkalmazással, ahhoz a tárcájában Ethernek kell lennie."
},
"needImportFile": {
"message": "Ki kell választania az importálni kívánt fájlt.",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "Beli"
},
"buyWithTransak": {
"message": "Beli ETH dengan Transak"
},
"buyWithTransakDescription": {
"message": "Transak mendukung kartu debit dan transfer bank (tergantung lokasi) di 59+ negara. Deposito ETH ke akun MetaMask Anda."
},
"buyWithWyre": {
"message": "Beli ETH dengan Wyre"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "Anda yakin ingin menghapus jaringan ini?"
},
"depositEther": {
"message": "Depositokan Ether"
},
"description": {
"message": "Deskripsi"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "Nama"
},
"needEtherInWallet": {
"message": "Untuk berinteraksi dengan aplikasi yang terdesentralisasi menggunakan MetaMask, Anda memerlukan Ether di dompet Anda."
},
"needHelp": {
"message": "Butuh bantuan? Hubungi $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -450,9 +450,6 @@
"deleteNetworkDescription": {
"message": "Sei sicuro di voler eliminare questa rete?"
},
"depositEther": {
"message": "Deposita Ether"
},
"details": {
"message": "Dettagli"
},
@ -948,9 +945,6 @@
"myAccounts": {
"message": "Miei Account"
},
"needEtherInWallet": {
"message": "Per interagire con applicazioni decentralizzate con MetaMask, devi possedere Ether nel tuo portafoglio."
},
"needImportFile": {
"message": "Devi selezionare un file da importare.",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "購入"
},
"buyWithTransak": {
"message": "TransakでETHを購入"
},
"buyWithTransakDescription": {
"message": "Transakは59か国以上でデビットカードと銀行振込 (場所によって異なります) をサポートしています。ETHはMetaMaskアカウントに入金されます。"
},
"buyWithWyre": {
"message": "Wyre で ETH を購入"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "このネットワークを削除しますか?"
},
"depositEther": {
"message": "Ether 入金"
},
"description": {
"message": "説明"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "名前"
},
"needEtherInWallet": {
"message": "MetaMask を使用して分散型アプリケーションとやりとりするには、ウォレットに Ether が必要です。"
},
"needHelp": {
"message": "お手伝いしましょうか?$1 に連絡",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "ನ ಈ ನವರ ಅನ ಖಚಿತವಿ ಅಳಿಸಲ ಬಯಸ?"
},
"depositEther": {
"message": "ಎಥರವಣಿಿ"
},
"details": {
"message": "ವಿವರಗಳ"
},
@ -596,9 +593,6 @@
"myAccounts": {
"message": "ನನನ ಖಗಳ"
},
"needEtherInWallet": {
"message": "MetaMask ಬಳಸಿಿತ ಖಗಳಿವಹನ ನಡಸಲ, ನಿಮ ವನಲಿಿಮಗ ಎಥರ ಅಗತಯವಿ."
},
"needImportFile": {
"message": "ಆಮದಡಲ ಅನ ಆಯಡಬ.",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "구매"
},
"buyWithTransak": {
"message": "Transak으로 ETH 구매"
},
"buyWithTransakDescription": {
"message": "Transak은 59개 이상의 국가에서 직불 카드 및 은행 송금(지역에 따라 다름)을 지원합니다. ETH는 메타마스크 계정에 예치됩니다."
},
"buyWithWyre": {
"message": "Wyre로 ETH 구매"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "이 네트워크를 삭제하시겠어요?"
},
"depositEther": {
"message": "Ether 예치"
},
"description": {
"message": "설명"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "이름"
},
"needEtherInWallet": {
"message": "MetaMask를 이용하는 분산형 애플리케이션과 상호작용하려면 지갑에 Ether가 있어야 합니다."
},
"needHelp": {
"message": "도움이 필요하신가요? $1에 문의하세요.",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Ar tikrai norite panaikinti šį tinklą?"
},
"depositEther": {
"message": "Įnešti eterių"
},
"details": {
"message": "Išsami informacija"
},
@ -596,9 +593,6 @@
"myAccounts": {
"message": "Mano paskyros"
},
"needEtherInWallet": {
"message": "Norėdami dirbti su decentralizuotomis programomis „MetaMask“, savo piniginėje turite turėti eterių."
},
"needImportFile": {
"message": "Turite pasirinkti failą, kurį pageidaujate importuoti.",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Vai tiešām vēlaties dzēst šo tīklu?"
},
"depositEther": {
"message": "Noguldīt Ether"
},
"details": {
"message": "Informācija"
},
@ -592,9 +589,6 @@
"myAccounts": {
"message": "Mani konti"
},
"needEtherInWallet": {
"message": "Lai izmantotu decentralizētas lietotnes ar MetaMask, jūsu makā jābūt Ether."
},
"needImportFile": {
"message": "Jums jāatlasa fails, ko importēt",
"description": "User is important an account and needs to add a file to continue"

@ -576,9 +576,6 @@
"myAccounts": {
"message": "Akaun Saya"
},
"needEtherInWallet": {
"message": "Untuk berinteraksi dengan aplikasi ternyahpusat menggunakan MetaMask, anda memerlukan Ether di dalam dompet anda."
},
"needImportFile": {
"message": "Anda mesti pilih fail untuk diimport.",
"description": "User is important an account and needs to add a file to continue"

@ -84,9 +84,6 @@
"decimalsMustZerotoTen": {
"message": "Decimalen moeten minimaal 0 en niet meer dan 36 zijn."
},
"depositEther": {
"message": "Stort Ether"
},
"directDepositEther": {
"message": "Directe Ether storten"
},
@ -217,9 +214,6 @@
"myAccounts": {
"message": "Mijn accounts"
},
"needEtherInWallet": {
"message": "Om te communiceren met gedecentraliseerde applicaties met MetaMask, heb je Ether nodig in je portemonnee."
},
"needImportFile": {
"message": "U moet een bestand selecteren om te importeren.",
"description": "User is important an account and needs to add a file to continue"

@ -289,9 +289,6 @@
"deleteNetworkDescription": {
"message": "Er du sikker på at du vil slette dette nettverket?"
},
"depositEther": {
"message": "Sett inn Ether "
},
"details": {
"message": "Detaljer"
},
@ -583,9 +580,6 @@
"myAccounts": {
"message": "Mine kontoer "
},
"needEtherInWallet": {
"message": "Du må ha Ether i lommeboken din for å samhandle med desentraliserte applikasjoner gjennom MateMask."
},
"needImportFile": {
"message": "Du må velge en fil å importere.",
"description": "User is important an account and needs to add a file to continue"

@ -519,9 +519,6 @@
"deleteNetworkDescription": {
"message": "Sigurado ka bang gusto mong i-delete ang network na ito?"
},
"depositEther": {
"message": "Mag-deposit ng Ether"
},
"details": {
"message": "Mga Detalye"
},
@ -1116,9 +1113,6 @@
"name": {
"message": "Pangalan"
},
"needEtherInWallet": {
"message": "Para makaugnayan ang mga decentralized na application gamit ang MetaMask, kakailanganin mo ang Ether sa iyong wallet."
},
"needHelp": {
"message": "Kailangan ng tulong? Makipag-ugnayan sa $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Czy na pewno chcesz usunąć tę sieć?"
},
"depositEther": {
"message": "Zdeponuj Eter"
},
"details": {
"message": "Szczegóły"
},
@ -593,9 +590,6 @@
"myAccounts": {
"message": "Moje konta"
},
"needEtherInWallet": {
"message": "Żeby skorzystać ze zdecentraliowanych aplikacji (dApps) przy pomocy MetaMask, potrzebujesz Eteru w swoim portfelu."
},
"needImportFile": {
"message": "Musisz wybrać plik do zaimportowania.",
"description": "User is important an account and needs to add a file to continue"

@ -84,9 +84,6 @@
"decimalsMustZerotoTen": {
"message": "Decimais devem ser no mínimo 0 e não passar de 36."
},
"depositEther": {
"message": "Depositar Ether"
},
"details": {
"message": "Detalhes"
},
@ -220,9 +217,6 @@
"myAccounts": {
"message": "As minhas contas"
},
"needEtherInWallet": {
"message": "Para interagir com applicações descentralizadas usando MetaMask tem de ter Ether na sua carteira."
},
"needImportFile": {
"message": "Deve selecionar um ficheiro para importar.",
"description": "User is important an account and needs to add a file to continue"

@ -519,9 +519,6 @@
"deleteNetworkDescription": {
"message": "Tem certeza de que deseja excluir esta rede?"
},
"depositEther": {
"message": "Depositar ether"
},
"details": {
"message": "Detalhes"
},
@ -1100,9 +1097,6 @@
"name": {
"message": "Nome"
},
"needEtherInWallet": {
"message": "Para interagir com aplicativos descentralizados usando o MetaMask, você precisará de ethers na sua carteira."
},
"needHelp": {
"message": "Precisa de ajuda? Contato $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Sigur vreți să ștergeți această rețea?"
},
"depositEther": {
"message": "Depuneți Ether"
},
"details": {
"message": "Detalii"
},
@ -583,9 +580,6 @@
"myAccounts": {
"message": "Conturile mele"
},
"needEtherInWallet": {
"message": "Pentru a interacționa cu aplicațiile descentralizate prin intermediul MetaMask, trebuie să aveți Ether în portofel."
},
"needImportFile": {
"message": "Trebuie să selectați un fișier pentru importare.",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "Купить"
},
"buyWithTransak": {
"message": "Купить ETH с помощью Transak"
},
"buyWithTransakDescription": {
"message": "Transak поддерживает дебетовые карты и банковские переводы (в зависимости от местоположения) в 59 странах. ETH будут зачислены на ваш счет MetaMask."
},
"buyWithWyre": {
"message": "Купить ETH с Wyre"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "Вы уверены, что хотите удалить эту сеть?"
},
"depositEther": {
"message": "Внести Ether"
},
"description": {
"message": "Описание"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "Название"
},
"needEtherInWallet": {
"message": "Для взаимодействия с децентрализованными приложениями с помощью MetaMask вам понадобится Ether в вашем кошельке."
},
"needHelp": {
"message": "Нужна помощь? Обратитесь в $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -286,9 +286,6 @@
"deleteNetworkDescription": {
"message": "Naozaj chcete túto sieť odstrániť?"
},
"depositEther": {
"message": "Vložit Ether"
},
"details": {
"message": "Podrobnosti"
},
@ -568,9 +565,6 @@
"myAccounts": {
"message": "Moje účty"
},
"needEtherInWallet": {
"message": "Potřebujete Ether v peněžence, abyste mohli pomocí MetaMasku interagovat s decentralizovanými aplikacemi."
},
"needImportFile": {
"message": "Musíte zvolit soubor k importu.",
"description": "User is important an account and needs to add a file to continue"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Ali ste prepričani, da želite izbrisati to omrežje?"
},
"depositEther": {
"message": "Vplačilo ethra"
},
"details": {
"message": "Podrobnosti"
},
@ -584,9 +581,6 @@
"myAccounts": {
"message": "Moji računi"
},
"needEtherInWallet": {
"message": "Za interakcijo z decentraliziranimi aplikacijami boste v svoji denarnici potrebovali Eter."
},
"needImportFile": {
"message": "Za uvoz morate izbrati datoteko.",
"description": "User is important an account and needs to add a file to continue"

@ -289,9 +289,6 @@
"deleteNetworkDescription": {
"message": "Da li ste sigurni da želite da izbrišete ovu mrežu?"
},
"depositEther": {
"message": "Dajte depozit Ether-u"
},
"details": {
"message": "Детаљи"
},
@ -587,9 +584,6 @@
"myAccounts": {
"message": "Moji nalozi"
},
"needEtherInWallet": {
"message": "Da biste stupili u interakciju sa decentralizovanim aplikacijama koristeći MetaMask, biće vam potreban Ether u vašem novčaniku."
},
"needImportFile": {
"message": "Morate izabrati fajl koji ćete uvesti.",
"description": "User is important an account and needs to add a file to continue"

@ -286,9 +286,6 @@
"deleteNetworkDescription": {
"message": "Är du säker på att du vill ta bort detta nätverk?"
},
"depositEther": {
"message": "Sätt in Ether"
},
"details": {
"message": "Info"
},
@ -580,9 +577,6 @@
"myAccounts": {
"message": "Mina konton"
},
"needEtherInWallet": {
"message": "För att interagera med decentraliserade applikationer med MetaMask behöver du Ether i din plånbok."
},
"needImportFile": {
"message": "Du måste välja en fil att importera.",
"description": "User is important an account and needs to add a file to continue"

@ -286,9 +286,6 @@
"deleteNetworkDescription": {
"message": "Una uhakika unataka kufuta mtandao huu?"
},
"depositEther": {
"message": "Weka Ether"
},
"details": {
"message": "Maelezo"
},
@ -574,9 +571,6 @@
"myAccounts": {
"message": "Akaunti zangu"
},
"needEtherInWallet": {
"message": "Ili kuingiliana na programu zilizosambazwa kwa kutumia MetaMask, utahitaji kuwa na Ether kwenye waleti yako."
},
"needImportFile": {
"message": "Unapaswa kuchagua faili la kuhamisha.",
"description": "User is important an account and needs to add a file to continue"

@ -129,9 +129,6 @@
"delete": {
"message": "ந"
},
"depositEther": {
"message": "வ எதி "
},
"details": {
"message": "விவரஙகள"
},
@ -295,9 +292,6 @@
"myAccounts": {
"message": "எனத கணககள"
},
"needEtherInWallet": {
"message": "மடமஸ ஐ பயனபடி பரவலகபபடட பயனகளடனடரள, உஙகள பணபபரிறதி ஈதர."
},
"needImportFile": {
"message": "இறகமதிய ஒரகளக வ.",
"description": "User is important an account and needs to add a file to continue"

@ -132,9 +132,6 @@
"deleteNetwork": {
"message": "ลบเครอขาย?"
},
"depositEther": {
"message": "การฝากอเธอร"
},
"details": {
"message": "รายละเอยด"
},
@ -301,9 +298,6 @@
"myAccounts": {
"message": "บญชของฉน"
},
"needEtherInWallet": {
"message": "คณจะตองมเธอรในกระเปาเงนของคณในการใชงานกบแอพพลเคชนแบบกระจายดวย MetaMask"
},
"needImportFile": {
"message": "คณตองเลอกไฟลจะนำเขา",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "Bilhin"
},
"buyWithTransak": {
"message": "Bumili ng ETH gamit ang Transak"
},
"buyWithTransakDescription": {
"message": "Magagamit sa Transak ang debit card at mga bank transfer (depende sa lokasyon) sa 59+ na bansa. Mga depositong ETH sa iyong MetaMask account."
},
"buyWithWyre": {
"message": "Bumili ng ETH gamit ang Wyre"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "Sigurado ka bang gusto mong i-delete ang network na ito?"
},
"depositEther": {
"message": "Mag-deposit ng Ether"
},
"description": {
"message": "Deskripsyon"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "Pangalan"
},
"needEtherInWallet": {
"message": "Para makaugnayan ang mga decentralized ma application gamit ang MetaMask, kakailanganin mo ang Ether sa iyong wallet."
},
"needHelp": {
"message": "Kailangan ng tulong? Kontakin ang $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -389,12 +389,6 @@
"buy": {
"message": "Satın Al"
},
"buyWithTransak": {
"message": "Transak ile ETH satın alın"
},
"buyWithTransakDescription": {
"message": "Transak 59'dan fazla ülkede banka kartı ve banka transferlerini (konuma bağlı olarak) destekler. MetaMask hesabınıza ETH para yatırma işlemleri."
},
"buyWithWyre": {
"message": "Wyre ile ETH satın alın"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "Bu ağı silmek istediğinizden emin misiniz?"
},
"depositEther": {
"message": "Ether yatır"
},
"description": {
"message": "Açıklama"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "Adı"
},
"needEtherInWallet": {
"message": "MetaMask kullanarak merkezi olamayan uygulamalarla etkileşmek için cüzdanınızda Ether bulunmalıdır."
},
"needHelp": {
"message": "Yardıma mı ihtiyacınız var? $1 ile iletişim kurun",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "Ви впевнені, що хочете видалити цю мережу?"
},
"depositEther": {
"message": "Депонувати Ether"
},
"details": {
"message": "Деталі"
},
@ -596,9 +593,6 @@
"myAccounts": {
"message": "Мої облікові записи"
},
"needEtherInWallet": {
"message": "Щоб взаємодіяти з децентралізованими застосунками використовуючи MetaMask, вам буде потрібен Ether у вашому гаманці."
},
"needImportFile": {
"message": "Потрібно вибрати файл для імпорту.",
"description": "User is important an account and needs to add a file to continue"

@ -389,12 +389,6 @@
"buy": {
"message": "Mua"
},
"buyWithTransak": {
"message": "Mua ETH bằng Transak"
},
"buyWithTransakDescription": {
"message": "Transak hỗ trợ thẻ ghi nợ và chuyển khoản ngân hàng (tùy vào địa điểm) tại hơn 59 quốc gia. Nạp ETH vào tài khoản MetaMask của bạn."
},
"buyWithWyre": {
"message": "Mua ETH qua Wyre"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "Bạn có chắc chắn muốn xóa mạng này không?"
},
"depositEther": {
"message": "Nộp Ether"
},
"description": {
"message": "Mô tả"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "Tên"
},
"needEtherInWallet": {
"message": "Để tương tác với các ứng dụng phi tập trung bằng MetaMask, bạn sẽ cần phải có Ether trong ví của mình."
},
"needHelp": {
"message": "Bạn cần trợ giúp? Liên hệ $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -389,12 +389,6 @@
"buy": {
"message": "购买"
},
"buyWithTransak": {
"message": "使用Transak购买ETH"
},
"buyWithTransakDescription": {
"message": "Transak 支持在59多个国家/地区的借记卡和银行转账(取决于地点)。ETH可存款到您的MetaMask账户。"
},
"buyWithWyre": {
"message": "使用 Wyre 购买 ETH"
},
@ -721,9 +715,6 @@
"deleteNetworkDescription": {
"message": "是否确认要删除该网络?"
},
"depositEther": {
"message": "存入 Ether"
},
"description": {
"message": "描述"
},
@ -1702,9 +1693,6 @@
"name": {
"message": "名称"
},
"needEtherInWallet": {
"message": "使用 MetaMask 与分布式应用交互,需要您的钱包里需要有 Ether。"
},
"needHelp": {
"message": "需要帮助?请联系 $1",
"description": "$1 represents `needHelpLinkText`, the text which goes in the help link"

@ -292,9 +292,6 @@
"deleteNetworkDescription": {
"message": "你確定要刪除網路嗎?"
},
"depositEther": {
"message": "存入以太幣"
},
"details": {
"message": "詳情"
},
@ -590,9 +587,6 @@
"myAccounts": {
"message": "我的帳戶"
},
"needEtherInWallet": {
"message": "要使用 MetaMask 存取去中心化應用服務時,您的錢包中需要有以太幣。"
},
"needImportFile": {
"message": "您必須選擇一個檔案來匯入",
"description": "User is important an account and needs to add a file to continue"

@ -1,75 +0,0 @@
import nock from 'nock';
import {
KOVAN_CHAIN_ID,
MAINNET_CHAIN_ID,
RINKEBY_CHAIN_ID,
ROPSTEN_CHAIN_ID,
} from '../../../shared/constants/network';
import { TRANSAK_API_KEY } from '../constants/on-ramp';
import { SWAPS_API_V2_BASE_URL } from '../../../shared/constants/swaps';
import getBuyEthUrl from './buy-eth-url';
const WYRE_ACCOUNT_ID = 'AC-7AG3W4XH4N2';
const ETH_ADDRESS = '0x0dcd5d886577d5581b0c524242ef2ee70be3e7bc';
const MAINNET = {
chainId: MAINNET_CHAIN_ID,
amount: 5,
address: ETH_ADDRESS,
};
const ROPSTEN = {
chainId: ROPSTEN_CHAIN_ID,
};
const RINKEBY = {
chainId: RINKEBY_CHAIN_ID,
};
const KOVAN = {
chainId: KOVAN_CHAIN_ID,
};
describe('buy-eth-url', () => {
it('returns Wyre url with an ETH address for Ethereum mainnet', async () => {
nock(SWAPS_API_V2_BASE_URL)
.get(
`/networks/1/fiatOnRampUrl?serviceName=wyre&destinationAddress=${ETH_ADDRESS}`,
)
.reply(200, {
url: `https://pay.sendwyre.com/purchase?accountId=${WYRE_ACCOUNT_ID}&utm_campaign=${WYRE_ACCOUNT_ID}&destCurrency=ETH&utm_medium=widget&paymentMethod=debit-card&reservation=MLZVUF8FMXZUMARJC23B&dest=ethereum%3A${ETH_ADDRESS}&utm_source=checkout`,
});
const wyreUrl = await getBuyEthUrl(MAINNET);
expect(wyreUrl).toStrictEqual(
`https://pay.sendwyre.com/purchase?accountId=${WYRE_ACCOUNT_ID}&utm_campaign=${WYRE_ACCOUNT_ID}&destCurrency=ETH&utm_medium=widget&paymentMethod=debit-card&reservation=MLZVUF8FMXZUMARJC23B&dest=ethereum%3A${ETH_ADDRESS}&utm_source=checkout`,
);
nock.cleanAll();
});
it('returns a fallback Wyre url if /orders/reserve API call fails', async () => {
const wyreUrl = await getBuyEthUrl(MAINNET);
expect(wyreUrl).toStrictEqual(
`https://pay.sendwyre.com/purchase?dest=ethereum:${ETH_ADDRESS}&destCurrency=ETH&accountId=${WYRE_ACCOUNT_ID}&paymentMethod=debit-card`,
);
});
it('returns Transak url with an ETH address for Ethereum mainnet', async () => {
const transakUrl = await getBuyEthUrl({ ...MAINNET, service: 'transak' });
expect(transakUrl).toStrictEqual(
`https://global.transak.com/?apiKey=${TRANSAK_API_KEY}&hostURL=https%3A%2F%2Fmetamask.io&defaultCryptoCurrency=ETH&walletAddress=${ETH_ADDRESS}`,
);
});
it('returns metamask ropsten faucet for network 3', async () => {
const ropstenUrl = await getBuyEthUrl(ROPSTEN);
expect(ropstenUrl).toStrictEqual('https://faucet.metamask.io/');
});
it('returns rinkeby dapp for network 4', async () => {
const rinkebyUrl = await getBuyEthUrl(RINKEBY);
expect(rinkebyUrl).toStrictEqual('https://www.rinkeby.io/');
});
it('returns kovan github test faucet for network 42', async () => {
const kovanUrl = await getBuyEthUrl(KOVAN);
expect(kovanUrl).toStrictEqual('https://github.com/kovan-testnet/faucet');
});
});

@ -8,6 +8,7 @@ import {
RINKEBY_CHAIN_ID,
ROPSTEN_CHAIN_ID,
MAINNET_NETWORK_ID,
BUYABLE_CHAINS_MAP,
} from '../../../shared/constants/network';
import { SECOND } from '../../../shared/constants/time';
import getFetchWithTimeout from '../../../shared/modules/fetch-with-timeout';
@ -47,16 +48,22 @@ const createWyrePurchaseUrl = async (address) => {
* Create a Transak Checkout URL.
* API docs here: https://www.notion.so/Query-Parameters-9ec523df3b874ec58cef4fa3a906f238
*
* @param {string} address - Ethereum destination address
* @param {string} walletAddress - Ethereum destination address
* @param {string} chainId - Current chain ID
* @returns String
*/
const createTransakUrl = (address) => {
const createTransakUrl = (walletAddress, chainId) => {
const { transakCurrencies, network } = BUYABLE_CHAINS_MAP[chainId];
const queryParams = new URLSearchParams({
apiKey: TRANSAK_API_KEY,
hostURL: 'https://metamask.io',
defaultCryptoCurrency: 'ETH',
walletAddress: address,
cryptoCurrencyList: transakCurrencies.join(','),
defaultCryptoCurrency: transakCurrencies[0],
networks: network,
walletAddress,
});
return `https://global.transak.com/?${queryParams}`;
};
@ -70,7 +77,7 @@ const createTransakUrl = (address) => {
* @returns {string|undefined} The url at which the user can access ETH, while in the given chain. If the passed
* chainId does not match any of the specified cases, or if no chainId is given, returns undefined.
*/
export default async function getBuyEthUrl({ chainId, address, service }) {
export default async function getBuyUrl({ chainId, address, service }) {
// default service by network if not specified
if (!service) {
// eslint-disable-next-line no-param-reassign
@ -81,7 +88,7 @@ export default async function getBuyEthUrl({ chainId, address, service }) {
case 'wyre':
return await createWyrePurchaseUrl(address);
case 'transak':
return createTransakUrl(address);
return createTransakUrl(address, chainId);
case 'metamask-faucet':
return 'https://faucet.metamask.io/';
case 'rinkeby-faucet':

@ -0,0 +1,117 @@
import nock from 'nock';
import {
KOVAN_CHAIN_ID,
MAINNET_CHAIN_ID,
RINKEBY_CHAIN_ID,
ROPSTEN_CHAIN_ID,
BSC_CHAIN_ID,
POLYGON_CHAIN_ID,
ETH_SYMBOL,
BUYABLE_CHAINS_MAP,
} from '../../../shared/constants/network';
import { TRANSAK_API_KEY } from '../constants/on-ramp';
import { SWAPS_API_V2_BASE_URL } from '../../../shared/constants/swaps';
import getBuyUrl from './buy-url';
const WYRE_ACCOUNT_ID = 'AC-7AG3W4XH4N2';
const ETH_ADDRESS = '0x0dcd5d886577d5581b0c524242ef2ee70be3e7bc';
const MAINNET = {
chainId: MAINNET_CHAIN_ID,
amount: 5,
address: ETH_ADDRESS,
};
const ROPSTEN = {
chainId: ROPSTEN_CHAIN_ID,
};
const RINKEBY = {
chainId: RINKEBY_CHAIN_ID,
};
const KOVAN = {
chainId: KOVAN_CHAIN_ID,
};
const BSC = {
chainId: BSC_CHAIN_ID,
amount: 5,
address: ETH_ADDRESS,
};
const POLYGON = {
chainId: POLYGON_CHAIN_ID,
amount: 5,
address: ETH_ADDRESS,
};
describe('buy-url', () => {
it('returns Wyre url with an ETH address for Ethereum mainnet', async () => {
nock(SWAPS_API_V2_BASE_URL)
.get(
`/networks/1/fiatOnRampUrl?serviceName=wyre&destinationAddress=${ETH_ADDRESS}`,
)
.reply(200, {
url: `https://pay.sendwyre.com/purchase?accountId=${WYRE_ACCOUNT_ID}&utm_campaign=${WYRE_ACCOUNT_ID}&destCurrency=${ETH_SYMBOL}&utm_medium=widget&paymentMethod=debit-card&reservation=MLZVUF8FMXZUMARJC23B&dest=ethereum%3A${ETH_ADDRESS}&utm_source=checkout`,
});
const wyreUrl = await getBuyUrl(MAINNET);
expect(wyreUrl).toStrictEqual(
`https://pay.sendwyre.com/purchase?accountId=${WYRE_ACCOUNT_ID}&utm_campaign=${WYRE_ACCOUNT_ID}&destCurrency=${ETH_SYMBOL}&utm_medium=widget&paymentMethod=debit-card&reservation=MLZVUF8FMXZUMARJC23B&dest=ethereum%3A${ETH_ADDRESS}&utm_source=checkout`,
);
nock.cleanAll();
});
it('returns a fallback Wyre url if /orders/reserve API call fails', async () => {
const wyreUrl = await getBuyUrl(MAINNET);
expect(wyreUrl).toStrictEqual(
`https://pay.sendwyre.com/purchase?dest=ethereum:${ETH_ADDRESS}&destCurrency=${ETH_SYMBOL}&accountId=${WYRE_ACCOUNT_ID}&paymentMethod=debit-card`,
);
});
it('returns Transak url with an ETH address for Ethereum mainnet', async () => {
const transakUrl = await getBuyUrl({ ...MAINNET, service: 'transak' });
const buyableChain = BUYABLE_CHAINS_MAP[MAINNET.chainId];
const buyableCurrencies = encodeURIComponent(
buyableChain.transakCurrencies.join(','),
);
expect(transakUrl).toStrictEqual(
`https://global.transak.com/?apiKey=${TRANSAK_API_KEY}&hostURL=https%3A%2F%2Fmetamask.io&cryptoCurrencyList=${buyableCurrencies}&defaultCryptoCurrency=${buyableChain.transakCurrencies[0]}&networks=${buyableChain.network}&walletAddress=${ETH_ADDRESS}`,
);
});
it('returns Transak url with an BNB address for Binance Smart Chain', async () => {
const transakUrl = await getBuyUrl({ ...BSC, service: 'transak' });
const buyableChain = BUYABLE_CHAINS_MAP[BSC.chainId];
const buyableCurrencies = encodeURIComponent(
buyableChain.transakCurrencies.join(','),
);
expect(transakUrl).toStrictEqual(
`https://global.transak.com/?apiKey=${TRANSAK_API_KEY}&hostURL=https%3A%2F%2Fmetamask.io&cryptoCurrencyList=${buyableCurrencies}&defaultCryptoCurrency=${buyableChain.transakCurrencies[0]}&networks=${buyableChain.network}&walletAddress=${ETH_ADDRESS}`,
);
});
it('returns Transak url with an MATIC address for Polygon', async () => {
const transakUrl = await getBuyUrl({ ...POLYGON, service: 'transak' });
const buyableChain = BUYABLE_CHAINS_MAP[POLYGON.chainId];
const buyableCurrencies = encodeURIComponent(
buyableChain.transakCurrencies.join(','),
);
expect(transakUrl).toStrictEqual(
`https://global.transak.com/?apiKey=${TRANSAK_API_KEY}&hostURL=https%3A%2F%2Fmetamask.io&cryptoCurrencyList=${buyableCurrencies}&defaultCryptoCurrency=${buyableChain.transakCurrencies[0]}&networks=${buyableChain.network}&walletAddress=${ETH_ADDRESS}`,
);
});
it('returns metamask ropsten faucet for network 3', async () => {
const ropstenUrl = await getBuyUrl(ROPSTEN);
expect(ropstenUrl).toStrictEqual('https://faucet.metamask.io/');
});
it('returns rinkeby dapp for network 4', async () => {
const rinkebyUrl = await getBuyUrl(RINKEBY);
expect(rinkebyUrl).toStrictEqual('https://www.rinkeby.io/');
});
it('returns kovan github test faucet for network 42', async () => {
const kovanUrl = await getBuyUrl(KOVAN);
expect(kovanUrl).toStrictEqual('https://github.com/kovan-testnet/faucet');
});
});

@ -23,6 +23,9 @@ export const BSC_CHAIN_ID = '0x38';
export const OPTIMISM_CHAIN_ID = '0xa';
export const OPTIMISM_TESTNET_CHAIN_ID = '0x45';
export const POLYGON_CHAIN_ID = '0x89';
export const AVALANCHE_CHAIN_ID = '0xa86a';
export const FANTOM_CHAIN_ID = '0xfa';
export const CELO_CHAIN_ID = '0xa4ec';
/**
* The largest possible chain ID we can handle.
@ -53,6 +56,9 @@ export const WETH_SYMBOL = 'WETH';
export const TEST_ETH_SYMBOL = 'TESTETH';
export const BNB_SYMBOL = 'BNB';
export const MATIC_SYMBOL = 'MATIC';
export const AVALANCHE_SYMBOL = 'AVAX';
export const FANTOM_SYMBOL = 'FTM';
export const CELO_SYMBOL = 'CELO';
export const ETH_TOKEN_IMAGE_URL = './images/eth_logo.svg';
export const TEST_ETH_TOKEN_IMAGE_URL = './images/black-eth-logo.svg';
@ -173,3 +179,55 @@ export const UNSUPPORTED_RPC_METHODS = new Set([
]);
export const IPFS_DEFAULT_GATEWAY_URL = 'dweb.link';
// The first item in transakCurrencies must be the
// default crypto currency for the network
const BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME = 'ethereum';
export const BUYABLE_CHAINS_MAP = {
[MAINNET_CHAIN_ID]: {
nativeCurrency: ETH_SYMBOL,
network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME,
transakCurrencies: [ETH_SYMBOL, 'USDT', 'USDC', 'DAI'],
},
[ROPSTEN_CHAIN_ID]: {
nativeCurrency: ETH_SYMBOL,
network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME,
},
[RINKEBY_CHAIN_ID]: {
nativeCurrency: ETH_SYMBOL,
network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME,
},
[GOERLI_CHAIN_ID]: {
nativeCurrency: ETH_SYMBOL,
network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME,
},
[KOVAN_CHAIN_ID]: {
nativeCurrency: ETH_SYMBOL,
network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME,
},
[BSC_CHAIN_ID]: {
nativeCurrency: BNB_SYMBOL,
network: 'bsc',
transakCurrencies: [BNB_SYMBOL, 'BUSD'],
},
[POLYGON_CHAIN_ID]: {
nativeCurrency: MATIC_SYMBOL,
network: 'polygon',
transakCurrencies: [MATIC_SYMBOL, 'USDT', 'USDC', 'DAI'],
},
[AVALANCHE_CHAIN_ID]: {
nativeCurrency: AVALANCHE_SYMBOL,
network: 'avaxcchain',
transakCurrencies: [AVALANCHE_SYMBOL],
},
[FANTOM_CHAIN_ID]: {
nativeCurrency: FANTOM_SYMBOL,
network: 'fantom',
transakCurrencies: [FANTOM_SYMBOL],
},
[CELO_CHAIN_ID]: {
nativeCurrency: CELO_SYMBOL,
network: 'celo',
transakCurrencies: [CELO_SYMBOL],
},
};

@ -1,6 +1,9 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { NETWORK_TO_NAME_MAP } from '../../../../../shared/constants/network';
import {
NETWORK_TO_NAME_MAP,
BUYABLE_CHAINS_MAP,
} from '../../../../../shared/constants/network';
import Button from '../../../ui/button';
export default class DepositEtherModal extends Component {
@ -13,6 +16,7 @@ export default class DepositEtherModal extends Component {
chainId: PropTypes.string.isRequired,
isTestnet: PropTypes.bool.isRequired,
isMainnet: PropTypes.bool.isRequired,
isBuyableTransakChain: PropTypes.bool.isRequired,
toWyre: PropTypes.func.isRequired,
toTransak: PropTypes.func.isRequired,
address: PropTypes.string.isRequired,
@ -93,17 +97,20 @@ export default class DepositEtherModal extends Component {
toFaucet,
isTestnet,
isMainnet,
isBuyableTransakChain,
} = this.props;
const { t } = this.context;
const networkName = NETWORK_TO_NAME_MAP[chainId];
const symbol = BUYABLE_CHAINS_MAP[chainId].nativeCurrency;
return (
<div className="page-container page-container--full-width page-container--full-height">
<div className="page-container__header">
<div className="page-container__title">
{this.context.t('depositEther')}
{t('depositCrypto', [symbol])}
</div>
<div className="page-container__subtitle">
{this.context.t('needEtherInWallet')}
{t('needCryptoInWallet', [symbol])}
</div>
<div
className="page-container__header-close"
@ -125,9 +132,9 @@ export default class DepositEtherModal extends Component {
}}
/>
),
title: this.context.t('buyWithWyre'),
text: this.context.t('buyWithWyreDescription'),
buttonLabel: this.context.t('continueToWyre'),
title: t('buyWithWyre'),
text: t('buyWithWyreDescription'),
buttonLabel: t('continueToWyre'),
onButtonClick: () => {
this.context.metricsEvent({
eventOpts: {
@ -150,9 +157,9 @@ export default class DepositEtherModal extends Component {
}}
/>
),
title: this.context.t('buyWithTransak'),
text: this.context.t('buyWithTransakDescription'),
buttonLabel: this.context.t('continueToTransak'),
title: t('buyCryptoWithTransak', [symbol]),
text: t('buyCryptoWithTransakDescription', [symbol]),
buttonLabel: t('continueToTransak'),
onButtonClick: () => {
this.context.metricsEvent({
eventOpts: {
@ -161,9 +168,9 @@ export default class DepositEtherModal extends Component {
name: 'Click buy Ether via Transak',
},
});
toTransak(address);
toTransak(address, chainId);
},
hide: !isMainnet,
hide: !isBuyableTransakChain,
})}
{this.renderRow({
logo: (
@ -177,17 +184,17 @@ export default class DepositEtherModal extends Component {
}}
/>
),
title: this.context.t('directDepositEther'),
text: this.context.t('directDepositEtherExplainer'),
buttonLabel: this.context.t('viewAccount'),
title: t('directDepositEther'),
text: t('directDepositEtherExplainer'),
buttonLabel: t('viewAccount'),
onButtonClick: () => this.goToAccountDetailsModal(),
})}
{networkName &&
this.renderRow({
logo: <i className="fa fa-tint fa-2x" />,
title: this.context.t('testFaucet'),
text: this.context.t('getEtherFromFaucet', [networkName]),
buttonLabel: this.context.t('getEther'),
title: t('testFaucet'),
text: t('getEtherFromFaucet', [networkName]),
buttonLabel: t('getEther'),
onButtonClick: () => toFaucet(chainId),
hide: !isTestnet,
})}

@ -10,6 +10,7 @@ import {
getIsMainnet,
getCurrentChainId,
getSelectedAddress,
getIsBuyableTransakChain,
} from '../../../../selectors/selectors';
import DepositEtherModal from './deposit-ether-modal.component';
@ -19,6 +20,7 @@ function mapStateToProps(state) {
isTestnet: getIsTestnet(state),
isMainnet: getIsMainnet(state),
address: getSelectedAddress(state),
isBuyableTransakChain: getIsBuyableTransakChain(state),
};
}
@ -27,8 +29,8 @@ function mapDispatchToProps(dispatch) {
toWyre: (address) => {
dispatch(buyEth({ service: 'wyre', address }));
},
toTransak: (address) => {
dispatch(buyEth({ service: 'transak', address }));
toTransak: (address, chainId) => {
dispatch(buyEth({ service: 'transak', address, chainId }));
},
hideModal: () => {
dispatch(hideModal());

@ -22,11 +22,10 @@ import {
isBalanceCached,
getSelectedAccount,
getShouldShowFiat,
getIsMainnet,
getIsTestnet,
getCurrentKeyring,
getSwapsDefaultToken,
getIsSwapsChain,
getIsBuyableChain,
getNativeCurrencyImage,
} from '../../../selectors/selectors';
import SwapIcon from '../../ui/icon/swap-icon.component';
@ -61,9 +60,8 @@ const EthOverview = ({ className }) => {
const showFiat = useSelector(getShouldShowFiat);
const selectedAccount = useSelector(getSelectedAccount);
const { balance } = selectedAccount;
const isMainnetChain = useSelector(getIsMainnet);
const isTestnetChain = useSelector(getIsTestnet);
const isSwapsChain = useSelector(getIsSwapsChain);
const isBuyableChain = useSelector(getIsBuyableChain);
const primaryTokenImage = useSelector(getNativeCurrencyImage);
const enteredSwapsEvent = useNewMetricEvent({
@ -118,7 +116,7 @@ const EthOverview = ({ className }) => {
<IconButton
className="eth-overview__button"
Icon={BuyIcon}
disabled={!(isMainnetChain || isTestnetChain)}
disabled={!isBuyableChain}
label={t('buy')}
onClick={() => {
depositEvent();

@ -7,6 +7,7 @@ import {
NATIVE_CURRENCY_TOKEN_IMAGE_MAP,
OPTIMISM_CHAIN_ID,
OPTIMISM_TESTNET_CHAIN_ID,
BUYABLE_CHAINS_MAP,
} from '../../shared/constants/network';
import {
KEYRING_TYPES,
@ -626,6 +627,16 @@ export function getIsSwapsChain(state) {
return ALLOWED_SWAPS_CHAIN_IDS[chainId];
}
export function getIsBuyableChain(state) {
const chainId = getCurrentChainId(state);
return Object.keys(BUYABLE_CHAINS_MAP).includes(chainId);
}
export function getIsBuyableTransakChain(state) {
const chainId = getCurrentChainId(state);
return Boolean(BUYABLE_CHAINS_MAP?.[chainId]?.transakCurrencies);
}
export function getNativeCurrencyImage(state) {
const nativeCurrency = getNativeCurrency(state).toUpperCase();
return NATIVE_CURRENCY_TOKEN_IMAGE_MAP[nativeCurrency];

@ -2,7 +2,7 @@ import pify from 'pify';
import log from 'loglevel';
import { captureException } from '@sentry/browser';
import { capitalize, isEqual } from 'lodash';
import getBuyEthUrl from '../../app/scripts/lib/buy-eth-url';
import getBuyUrl from '../../app/scripts/lib/buy-url';
import {
fetchLocale,
loadRelativeTimeFormatLocaleData,
@ -2002,7 +2002,7 @@ export function showSendTokenPage() {
export function buyEth(opts) {
return async (dispatch) => {
const url = await getBuyEthUrl(opts);
const url = await getBuyUrl(opts);
global.platform.openTab({ url });
dispatch({
type: actionConstants.BUY_ETH,

Loading…
Cancel
Save