From 80bd43d12d15659e0295d4193f62a8438f664f4d Mon Sep 17 00:00:00 2001 From: N3TC4T Date: Sat, 25 Nov 2023 13:55:27 +0100 Subject: [PATCH] feat: loading list of vetted tokens only when adding new token --- src/common/constants/screens.ts | 2 +- .../Modules/AssetsList/Tokens/TokensList.tsx | 2 +- src/locale/en.json | 3 +- src/locale/translations/af.json | 3 +- src/locale/translations/ar.json | 3 +- src/locale/translations/bg.json | 3 +- src/locale/translations/bn-BD.json | 3 +- src/locale/translations/ca.json | 3 +- src/locale/translations/cs.json | 3 +- src/locale/translations/da.json | 3 +- src/locale/translations/de.json | 3 +- src/locale/translations/el.json | 3 +- src/locale/translations/en-AU.json | 3 +- src/locale/translations/es-419.json | 3 +- src/locale/translations/es.json | 3 +- src/locale/translations/et.json | 3 +- src/locale/translations/eu.json | 3 +- src/locale/translations/fi.json | 3 +- src/locale/translations/fil.json | 3 +- src/locale/translations/fr.json | 3 +- src/locale/translations/gl-ES.json | 3 +- src/locale/translations/gu.json | 3 +- src/locale/translations/he.json | 3 +- src/locale/translations/hi-IN.json | 3 +- src/locale/translations/hr.json | 3 +- src/locale/translations/ht.json | 3 +- src/locale/translations/hu.json | 3 +- src/locale/translations/id.json | 3 +- src/locale/translations/it.json | 3 +- src/locale/translations/ja.json | 3 +- src/locale/translations/ka.json | 3 +- src/locale/translations/kk.json | 3 +- src/locale/translations/kn.json | 3 +- src/locale/translations/ko.json | 3 +- src/locale/translations/lt.json | 3 +- src/locale/translations/lv.json | 3 +- src/locale/translations/ml.json | 3 +- src/locale/translations/mr.json | 3 +- src/locale/translations/nl.json | 3 +- src/locale/translations/no-NO.json | 3 +- src/locale/translations/pa.json | 3 +- src/locale/translations/pl.json | 3 +- src/locale/translations/pt-BR.json | 3 +- src/locale/translations/pt.json | 3 +- src/locale/translations/ro.json | 3 +- src/locale/translations/ru.json | 3 +- src/locale/translations/sd.json | 3 +- src/locale/translations/sk.json | 3 +- src/locale/translations/sl.json | 3 +- src/locale/translations/sr.json | 3 +- src/locale/translations/sv.json | 3 +- src/locale/translations/sw.json | 3 +- src/locale/translations/ta-IN.json | 3 +- src/locale/translations/te-IN.json | 3 +- src/locale/translations/tr.json | 3 +- src/locale/translations/uk.json | 3 +- src/locale/translations/ur.json | 3 +- src/locale/translations/uz.json | 3 +- src/locale/translations/vi.json | 3 +- src/locale/translations/zh-TW.json | 3 +- src/locale/translations/zh.json | 3 +- src/screens/Overlay/AddCurrency/index.ts | 3 - .../AddTokenModal.tsx} | 253 +++++++++++------- src/screens/Overlay/AddToken/index.ts | 3 + .../{AddCurrency => AddToken}/styles.tsx | 7 + src/screens/index.ts | 4 +- src/services/BackendService.ts | 11 +- src/store/repositories/account.ts | 4 +- src/typings/xaman-backend/index.d.ts | 60 +++-- 69 files changed, 324 insertions(+), 202 deletions(-) delete mode 100644 src/screens/Overlay/AddCurrency/index.ts rename src/screens/Overlay/{AddCurrency/AddCurrencyModal.tsx => AddToken/AddTokenModal.tsx} (58%) create mode 100644 src/screens/Overlay/AddToken/index.ts rename src/screens/Overlay/{AddCurrency => AddToken}/styles.tsx (87%) diff --git a/src/common/constants/screens.ts b/src/common/constants/screens.ts index 251feeac5..9d7e0dadc 100644 --- a/src/common/constants/screens.ts +++ b/src/common/constants/screens.ts @@ -45,7 +45,7 @@ const screens = { }, Overlay: { SwitchAccount: 'overlay.SwitchAccount', - AddCurrency: 'overlay.AddCurrency', + AddToken: 'overlay.AddToken', TokenSettings: 'overlay.TokenSettings', Vault: 'overlay.Vault', Auth: 'overlay.Auth', diff --git a/src/components/Modules/AssetsList/Tokens/TokensList.tsx b/src/components/Modules/AssetsList/Tokens/TokensList.tsx index b3736d5a7..2f70ec31c 100644 --- a/src/components/Modules/AssetsList/Tokens/TokensList.tsx +++ b/src/components/Modules/AssetsList/Tokens/TokensList.tsx @@ -179,7 +179,7 @@ class TokensList extends Component { onTokenAddButtonPress = () => { const { account } = this.state; - Navigator.showOverlay(AppScreens.Overlay.AddCurrency, { account }); + Navigator.showOverlay(AppScreens.Overlay.AddToken, { account }); }; onTokenItemPress = (token: TrustLineModel) => { diff --git a/src/locale/en.json b/src/locale/en.json index 26800ae38..cd91277a3 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Exchanging", diff --git a/src/locale/translations/af.json b/src/locale/translations/af.json index ddbf40ec1..38519779e 100644 --- a/src/locale/translations/af.json +++ b/src/locale/translations/af.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Meer inligting en herstel", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Ruil uit", diff --git a/src/locale/translations/ar.json b/src/locale/translations/ar.json index 013e515bb..a44cd45c5 100644 --- a/src/locale/translations/ar.json +++ b/src/locale/translations/ar.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "مزيد من المعلومات والإصلاح", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "تبادل", diff --git a/src/locale/translations/bg.json b/src/locale/translations/bg.json index 2a2e950a9..91f189322 100644 --- a/src/locale/translations/bg.json +++ b/src/locale/translations/bg.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Обмен", diff --git a/src/locale/translations/bn-BD.json b/src/locale/translations/bn-BD.json index 580b1630a..1c4aa6c5c 100644 --- a/src/locale/translations/bn-BD.json +++ b/src/locale/translations/bn-BD.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "আরও তথ্য এবং ঠিক করুন", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "এক্সচেঞ্জিং", diff --git a/src/locale/translations/ca.json b/src/locale/translations/ca.json index d8aac1d78..8bb5e58e1 100644 --- a/src/locale/translations/ca.json +++ b/src/locale/translations/ca.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Més informació i solucionar", "addingTrustLineWarning": "XRPL Labs / Xaman no avala cap token ni cap emissor de tokens. Continua només en el cas que l'emissor del token sigui de la teva confiança.\r\nEn cas de dubtes o problemes amb relació al token (Línia de confiança) hauràs de contactar amb l'emissor del token.\r\nSi continues ho fas al teu propi risc.\r\n", "trustLineIsAlreadyExist": "Aquest token ja existeix. No pots tornar a afegir el mateix token un altre cop.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Intercanviant", diff --git a/src/locale/translations/cs.json b/src/locale/translations/cs.json index bb52f0f40..a494dca0d 100644 --- a/src/locale/translations/cs.json +++ b/src/locale/translations/cs.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Další informace a oprava", "addingTrustLineWarning": "XRPL Labs/Xaman neschvaluje žádný token nebo vydavatele tokenu. Měli byste pokračovat pouze v případě, že důvěřujete vydavateli tokenů.\r\nV případě otázek nebo problémů týkajících se tokenu (Trust Line) se musíte obrátit na vydavatele tokenu.\r\n\r\nPokračujte ve svém vlastním riziku.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Probíhá směna", diff --git a/src/locale/translations/da.json b/src/locale/translations/da.json index a4eaceddb..bbfa72f9e 100644 --- a/src/locale/translations/da.json +++ b/src/locale/translations/da.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Flere oplysninger og fix", "addingTrustLineWarning": "XRPL Labs / Xaman står ikke bag nogen token- eller tokenudsteder. Du bør kun fortsætte, hvis du har tillid til tokenudstederen.\r\nI tilfælde af spørgsmål eller problemer vedrørende den pågældende token (Trust Line) skal du kontakte tokenudstederen.\r\n\r\nFortsæt på egen risiko.", "trustLineIsAlreadyExist": "Denne token findes allerede. Du kan ikke tilføje den samme token igen.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Veksel", diff --git a/src/locale/translations/de.json b/src/locale/translations/de.json index c67b4b195..67616ced2 100644 --- a/src/locale/translations/de.json +++ b/src/locale/translations/de.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Weitere Infos & Fix", "addingTrustLineWarning": "XRPL Labs/Xaman unterstützt keine Token-oder Token-Emittenten. Sie sollten nur vorgehen, wenn Sie dem Tokenaussteller vertrauen.\r\nBei Fragen oder Problemen im Zusammenhang mit dem Token (TrustLine) müssen Sie sich an den Tokenaussteller wenden.\r\n\r\nGehen Sie auf Ihr eigenes Risiko weiter.", "trustLineIsAlreadyExist": "Dieses Token ist bereits vorhanden. Sie können das gleiche Token nicht erneut hinzufügen.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Umtauschen", diff --git a/src/locale/translations/el.json b/src/locale/translations/el.json index cae0d3969..3448f7628 100644 --- a/src/locale/translations/el.json +++ b/src/locale/translations/el.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Περισσότερες πληροφορίες & διόρθωση", "addingTrustLineWarning": "Το XRPL Labs/Xaman δεν υποστηρίζει κανένα διακριτικό ή εκδότη διακριτικών. Θα πρέπει να προχωρήσετε μόνο αν εμπιστεύεστε τον εκδότη του διακριτικού.\nΣε περίπτωση ερωτήσεων ή προβλημάτων σχετικά με το διακριτικό (Trust Line) θα πρέπει να επικοινωνήσετε με τον εκδότη του διακριτικού.\n\nΣυνεχίστε με δικό σας ρίσκο.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Ανταλλαγή", diff --git a/src/locale/translations/en-AU.json b/src/locale/translations/en-AU.json index bb04a30ee..b3e31a87d 100644 --- a/src/locale/translations/en-AU.json +++ b/src/locale/translations/en-AU.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Exchanging", diff --git a/src/locale/translations/es-419.json b/src/locale/translations/es-419.json index 3a5d0084f..f1f2b4574 100644 --- a/src/locale/translations/es-419.json +++ b/src/locale/translations/es-419.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Más información y soluciones", "addingTrustLineWarning": "XRPL Labs/Xaman no respalda ningún token o emisor de tokens. Sólo debe continuar si confía en el emisor del token.\r\nEn caso de preguntas o problemas relacionados con el token (línea de confianza), deberá ponerse en contacto con el emisor de token.\r\n\r\nContinúe bajo su propio riesgo.", "trustLineIsAlreadyExist": "Este token ya existe. No puede volver a añadir el mismo token.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Intercambiando", diff --git a/src/locale/translations/es.json b/src/locale/translations/es.json index aeec8c03d..a51507bb0 100644 --- a/src/locale/translations/es.json +++ b/src/locale/translations/es.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Más información y arreglo", "addingTrustLineWarning": "XRPL Labs/Xaman no respalda ningún token o emisor de tokens. Sólo debe continuar si confía en el emisor del token.\r\nEn caso de preguntas o problemas relacionados con el token (línea de confianza), deberá ponerse en contacto con el emisor de token.\r\n\r\nContinúe bajo su propio riesgo.", "trustLineIsAlreadyExist": "Este token ya existe. No puede volver a añadir el mismo token.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Cambiando", diff --git a/src/locale/translations/et.json b/src/locale/translations/et.json index f3bfb4df7..9342bd06e 100644 --- a/src/locale/translations/et.json +++ b/src/locale/translations/et.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Vahetamine", diff --git a/src/locale/translations/eu.json b/src/locale/translations/eu.json index 788d0112d..cc6182982 100644 --- a/src/locale/translations/eu.json +++ b/src/locale/translations/eu.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Informazio gehiago & konponketa", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Trukatzen", diff --git a/src/locale/translations/fi.json b/src/locale/translations/fi.json index fe4b83ebf..36c482317 100644 --- a/src/locale/translations/fi.json +++ b/src/locale/translations/fi.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Lisätietoja ja korjauksia", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Vaihto", diff --git a/src/locale/translations/fil.json b/src/locale/translations/fil.json index cb93aeadc..79b46fc64 100644 --- a/src/locale/translations/fil.json +++ b/src/locale/translations/fil.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Higit pang impormasyon at pag-aayos", "addingTrustLineWarning": "XRPL Labs / Xaman ay hindi nag-eendorso ng anumang token o token issuer. Dapat ka lang magpatuloy kung nagtitiwala ka sa nagbigay ng token. \r\nSa kaso ng mga tanong o problema tungkol sa token (TrustLine) makipag ugnayan ka sa nagpadala ng token.", "trustLineIsAlreadyExist": "Umiral na ang token na ito. Hindi mo na maidaragdag muli ang parehong token.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "pakikipagpalitan", diff --git a/src/locale/translations/fr.json b/src/locale/translations/fr.json index efc26fc8f..0b9da2d26 100644 --- a/src/locale/translations/fr.json +++ b/src/locale/translations/fr.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Plus d'informations et de correctifs", "addingTrustLineWarning": "XRPL Labs / Xaman n'endosse aucun émetteur de jeton ou de jeton. Vous ne devez procéder que si vous faites confiance à l'émetteur du jeton.\nEn cas de questions ou de problèmes concernant le jeton (Ligne de confiance), vous devez contacter l'émetteur du jeton.\n\nContinuez à vos propres risques.", "trustLineIsAlreadyExist": "Ce jeton existe déjà. Vous ne pouvez pas ajouter le même jeton.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Conversion en cours", diff --git a/src/locale/translations/gl-ES.json b/src/locale/translations/gl-ES.json index 707062b1c..096c75d41 100644 --- a/src/locale/translations/gl-ES.json +++ b/src/locale/translations/gl-ES.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Máis información e fix", "addingTrustLineWarning": "XRPL Labs / Xaman non apoia ningún token nin emisor de token. Só debería proceder se confía no emisor de tokens.\r\nEn caso de preguntas ou problemas relacionados co token (TrustLine), deberá contactar co emisor do token.\r\n\r\nContinúe baixo o seu propio risco.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Intercambiando", diff --git a/src/locale/translations/gu.json b/src/locale/translations/gu.json index 4a5781294..1bdd974f9 100644 --- a/src/locale/translations/gu.json +++ b/src/locale/translations/gu.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "વધુ માહિતી અને ફિક્સ", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "વિનિમય", diff --git a/src/locale/translations/he.json b/src/locale/translations/he.json index 0bab4d1ef..9948968e1 100644 --- a/src/locale/translations/he.json +++ b/src/locale/translations/he.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "מידע נוסף ותיקון", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "מתחלפים", diff --git a/src/locale/translations/hi-IN.json b/src/locale/translations/hi-IN.json index 9a5c91b99..b7bf5bd1a 100644 --- a/src/locale/translations/hi-IN.json +++ b/src/locale/translations/hi-IN.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "अधिक जानकारी और फिक्स", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "विनिमय", diff --git a/src/locale/translations/hr.json b/src/locale/translations/hr.json index 01130e7ab..9637a3ff4 100644 --- a/src/locale/translations/hr.json +++ b/src/locale/translations/hr.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Više informacija i popravak", "addingTrustLineWarning": "XRPL Labs / Xaman ne podržava izdavatelj tokena ili tokena. Trebali biste nastaviti samo ako vjerujete izdavaču tokena.\nU slučaju pitanja ili problema koji se odnose na token (Trust Line), trebate kontaktirati izdavača tokena.\n\nNastavi na svoj vlastiti rizik.", "trustLineIsAlreadyExist": "Ovaj token već postoji. Ne možete ponovno dodati istu oznaku.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Zamjena", diff --git a/src/locale/translations/ht.json b/src/locale/translations/ht.json index 646b39d67..34d66c675 100644 --- a/src/locale/translations/ht.json +++ b/src/locale/translations/ht.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Plis enfòmasyon & ranje", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Echanj", diff --git a/src/locale/translations/hu.json b/src/locale/translations/hu.json index 0a30e20bb..719341e0d 100644 --- a/src/locale/translations/hu.json +++ b/src/locale/translations/hu.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Exchanging", diff --git a/src/locale/translations/id.json b/src/locale/translations/id.json index abd22753c..8b66dc138 100644 --- a/src/locale/translations/id.json +++ b/src/locale/translations/id.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Info lebih lanjut & memperbaiki", "addingTrustLineWarning": "XRPL Labs/Xaman tidak mendukung penerbit token atau token apapun. Anda hanya harus melanjutkan jika Anda percaya pada penerbit token.\r\nDalam hal pertanyaan atau masalah mengenai token (TrustLine) Anda akan perlu menghubungi penerbit token.\r\n\r\nLanjutkan dengan risikonya sendiri.", "trustLineIsAlreadyExist": "Token ini sudah ada. Anda tidak dapat menambahkan token yang sama lagi.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Bertukar", diff --git a/src/locale/translations/it.json b/src/locale/translations/it.json index e7af2ce33..f63a852f9 100644 --- a/src/locale/translations/it.json +++ b/src/locale/translations/it.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Più info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman non sostiene nè promuove alcun token o emittente token. Si deve procedere solo se ci si fida dell'emittente token.\r\nIn caso di domande o problemi riguardanti il token (Trust Line) sarà necessario contattare l'emittente del token stesso.\r\n\r\nContinua a tuo rischio.", "trustLineIsAlreadyExist": "Questo token esiste già. Non è possibile aggiungere di nuovo lo stesso token.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Scambiare", diff --git a/src/locale/translations/ja.json b/src/locale/translations/ja.json index bbaa10e0a..914122bc7 100644 --- a/src/locale/translations/ja.json +++ b/src/locale/translations/ja.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "詳細情報および修正", "addingTrustLineWarning": "XRPL Labs / Xamanは、いかなるトークンやトークン発行者も推奨していません。トークン発行者を信頼する場合にのみ手続きを行ってください。\r\nトークン(TrustLine)に関する質問や問題が発生した場合には、トークン発行者に連絡する必要があります。\r\n\r\nご自身のリスクでお進みください。", "trustLineIsAlreadyExist": "このトークンはすでに存在しています。同じトークンを再度追加することはできません。", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "両替中", diff --git a/src/locale/translations/ka.json b/src/locale/translations/ka.json index 8750719ce..f87504560 100644 --- a/src/locale/translations/ka.json +++ b/src/locale/translations/ka.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "დამატებითი ინფორმაცია და დაფიქსირება", "addingTrustLineWarning": "XRPL Labs / Xaman არ ადასტურებს ტოკენის ან ტოკენის გამცემს. თქვენ უნდა გააგრძელოთ მხოლოდ იმ შემთხვევაში, თუ ენდობით ჟეტონის გამცემს.\r\nჟეტონთან დაკავშირებით კითხვების ან პრობლემების შემთხვევაში (TrustLine) თქვენ უნდა დაუკავშირდეთ ტოკენის გამცემს.\r\n\r\nგანაგრძეთ თქვენი რისკის ქვეშ.", "trustLineIsAlreadyExist": "ეს ჟეტონი უკვე არსებობს. თქვენ აღარ შეგიძლიათ დაამატოთ იგივე ჟეტონი", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "გაცვლა", diff --git a/src/locale/translations/kk.json b/src/locale/translations/kk.json index 3b3394be0..30d970947 100644 --- a/src/locale/translations/kk.json +++ b/src/locale/translations/kk.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Қосымша ақпарат және түзету", "addingTrustLineWarning": "XRPL Labs / Xaman таңбалауыштарды немесе эмитенттерді қолдамайды. Егер сіз токен эмитентіне сенсеңіз ғана жалғастыруыңыз керек.\r\nТаңбалауышқа қатысты сұрақтар немесе мәселелер туындаған жағдайда (сенім желісі), сіз таңбалауыштың эмитентімен байланысуыңыз керек.\r\nӨз тәуекеліңізді жалғастырыңыз.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Алмасу", diff --git a/src/locale/translations/kn.json b/src/locale/translations/kn.json index 121d44140..bfc2e6323 100644 --- a/src/locale/translations/kn.json +++ b/src/locale/translations/kn.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "ಹೆಚ್ಚಿನ ಮಾಹಿತಿ ಮತ್ತು ಸರಿಪಡಿಸಿ", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "ವಿನಿಮಯ", diff --git a/src/locale/translations/ko.json b/src/locale/translations/ko.json index 0d48726bc..a5082971d 100644 --- a/src/locale/translations/ko.json +++ b/src/locale/translations/ko.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "추가 정보 및 수정사항", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "교환", diff --git a/src/locale/translations/lt.json b/src/locale/translations/lt.json index cde8f080c..faad02f34 100644 --- a/src/locale/translations/lt.json +++ b/src/locale/translations/lt.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Daugiau informacijos ir pataisymai", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Apsikeitimas", diff --git a/src/locale/translations/lv.json b/src/locale/translations/lv.json index 9aa5e1988..cf80afc23 100644 --- a/src/locale/translations/lv.json +++ b/src/locale/translations/lv.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Apmainīšana", diff --git a/src/locale/translations/ml.json b/src/locale/translations/ml.json index 0e8b075ff..618ce20b4 100644 --- a/src/locale/translations/ml.json +++ b/src/locale/translations/ml.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "കൂടുതൽ വിവരങ്ങൾ & ശരിയാക്കുക", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "കൈമാറ്റം ചെയ്യുന്നു", diff --git a/src/locale/translations/mr.json b/src/locale/translations/mr.json index 14e445229..5c283dcf7 100644 --- a/src/locale/translations/mr.json +++ b/src/locale/translations/mr.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "अधिक माहिती & निश्चित", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "एक्सचेंज करत आहे", diff --git a/src/locale/translations/nl.json b/src/locale/translations/nl.json index 90e75713b..a2e55bbfd 100644 --- a/src/locale/translations/nl.json +++ b/src/locale/translations/nl.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Meer info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Aan het wisselen", diff --git a/src/locale/translations/no-NO.json b/src/locale/translations/no-NO.json index d7ff1eeb6..256ad90cd 100644 --- a/src/locale/translations/no-NO.json +++ b/src/locale/translations/no-NO.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Mer informasjon og retting", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "Denne enheten eksistrer allerede. Du kan ikke legge til denne enheten flere ganger.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Veksler", diff --git a/src/locale/translations/pa.json b/src/locale/translations/pa.json index 6384a9ca4..eba624162 100644 --- a/src/locale/translations/pa.json +++ b/src/locale/translations/pa.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "ਵਧੇਰੇ ਜਾਣਕਾਰੀ ਅਤੇ ਫਿਕਸ", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "ਐਕਸਚੇਂਜ ਕਰ ਰਿਹਾ ਹੈ", diff --git a/src/locale/translations/pl.json b/src/locale/translations/pl.json index eb8b331ff..ca02c0094 100644 --- a/src/locale/translations/pl.json +++ b/src/locale/translations/pl.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Więcej informacji i poprawka", "addingTrustLineWarning": "XRPL Labs/Xaman nie promuje żadnego wystawcy tokenów jak i samych tokenów. Kontynuuj tylko wtedy, gdy ufasz wystawcy tokenów.\r\nW przypadku pytań lub problemów dotyczących tokenu (TrustLine) będziesz musiał skontaktować się z wydawcą tokenu.\r\n\r\nKontynuuj na własne ryzyko.", "trustLineIsAlreadyExist": "Ten Token już istnieje. Nie można ponownie dodać tego samego Tokena.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Wymienianie", diff --git a/src/locale/translations/pt-BR.json b/src/locale/translations/pt-BR.json index 3675b36c3..861cb199e 100644 --- a/src/locale/translations/pt-BR.json +++ b/src/locale/translations/pt-BR.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Mais info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman não endossou nenhum emissor de token ou token. Você só deve proceder se confiar no emissor do token.\nEm caso de dúvidas ou problemas relativos ao token (Linha Confiança) você precisará entrar em contato com o emissor do token.\n\nContinue por seu próprio risco.", "trustLineIsAlreadyExist": "Este token já existe. Não é possível adicionar o mesmo token novamente.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Trocando", diff --git a/src/locale/translations/pt.json b/src/locale/translations/pt.json index 9425f2936..98fe9bba1 100644 --- a/src/locale/translations/pt.json +++ b/src/locale/translations/pt.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Mais info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman não endossou nenhum emissor de token ou token. Você só deve proceder se confiar no emissor do token.\nEm caso de dúvidas ou problemas relativos ao token (Linha Confiança) você precisará entrar em contato com o emissor do token.\n\nContinue por seu próprio risco.", "trustLineIsAlreadyExist": "Este token já existe. Não é possível adicionar o mesmo token novamente.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "A trocar", diff --git a/src/locale/translations/ro.json b/src/locale/translations/ro.json index 39786b78f..1ef07f394 100644 --- a/src/locale/translations/ro.json +++ b/src/locale/translations/ro.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Mai multe informaţii şi corecţii", "addingTrustLineWarning": "XRPL Labs/Xaman nu sprijină niciun emitent de monedă sau o monedă. Avansați doar dacă aveți încredere în emitentul monedei.\r\nÎn cazul în care aveți întrebări sau probleme în ceea ce privește moneda (TrustLine), va trebui să contactați emitentul monedei.\r\n\r\nContinuați pe propria răspundere.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Schimb", diff --git a/src/locale/translations/ru.json b/src/locale/translations/ru.json index a440c44f3..786459f5c 100644 --- a/src/locale/translations/ru.json +++ b/src/locale/translations/ru.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Больше информации и исправление", "addingTrustLineWarning": "XRPL Labs/Xaman не поддерживает ни маркер, ни эмитент маркеров. Продолжить работу следует только в том случае, если вы доверяете эмитенту маркеров.\nВ случае вопросов или проблем, связанных с маркером (Trust Line), необходимо связаться с эмитентом маркеров.\n\nПродолжай на свой страх и риск.", "trustLineIsAlreadyExist": "Этот маркер уже существует. Нельзя повторно добавить один и тот же маркер.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Обменивающий", diff --git a/src/locale/translations/sd.json b/src/locale/translations/sd.json index 008c8d61a..4cd3301c8 100644 --- a/src/locale/translations/sd.json +++ b/src/locale/translations/sd.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "وڌيڪ معلومات ۽ درستگي", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "تبادلي", diff --git a/src/locale/translations/sk.json b/src/locale/translations/sk.json index 464757008..64edf32de 100644 --- a/src/locale/translations/sk.json +++ b/src/locale/translations/sk.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Viac informácií & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Výmena", diff --git a/src/locale/translations/sl.json b/src/locale/translations/sl.json index 1a3316dc7..f662428db 100644 --- a/src/locale/translations/sl.json +++ b/src/locale/translations/sl.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Več informacij in popravek", "addingTrustLineWarning": "XRPL Labs / Xaman ne podpira nobenega žetona ali izdajatelja žetona. Nadaljujte samo, če zaupate izdajatelju žetonov.\r\nV primeru vprašanj ali težav v zvezi z žetonom (TrustLine) boste morali stopiti v stik z izdajateljem žetonov.\r\n\r\nNadaljujte na lastno odgovornost.", "trustLineIsAlreadyExist": "Ta žeton že obstaja. Istega žetona ne morete več dodati.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Menjava", diff --git a/src/locale/translations/sr.json b/src/locale/translations/sr.json index bb30d54b3..140442f7b 100644 --- a/src/locale/translations/sr.json +++ b/src/locale/translations/sr.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Више информација и поправак", "addingTrustLineWarning": "XRPL Labs/Xaman не подржава било који токен или токен издавач. Требало би да наставите само ако верујете у токен издаваоца.\nУ случају питања или проблема у вези са токеном (Поверење поверења), потребно је да контактирате издавач токена.\n\nНаставите са својим ризиком.", "trustLineIsAlreadyExist": "Овај токен већ постоји. Не можете додати исти токен поново.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Размена", diff --git a/src/locale/translations/sv.json b/src/locale/translations/sv.json index d3bdb2b80..e114002e3 100644 --- a/src/locale/translations/sv.json +++ b/src/locale/translations/sv.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Mer info och fix", "addingTrustLineWarning": "XRPL Labs / Xaman stöder inte någon token eller tokenutfärdare. Du bör bara fortsätta om du litar på tokenemittenten.\nNär det gäller frågor eller problem med elementet (Trust Line) måste du kontakta Emittenten.\n\nFortsätt med din egen risk.", "trustLineIsAlreadyExist": "Elementet finns redan. Du kan inte lägga till samma token igen.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Utbyte", diff --git a/src/locale/translations/sw.json b/src/locale/translations/sw.json index 056fd07bb..30ca6884c 100644 --- a/src/locale/translations/sw.json +++ b/src/locale/translations/sw.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Exchanging", diff --git a/src/locale/translations/ta-IN.json b/src/locale/translations/ta-IN.json index 414ec6b70..f4284959b 100644 --- a/src/locale/translations/ta-IN.json +++ b/src/locale/translations/ta-IN.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "மேலும் தகவல் & திருத்தம்", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "பரிமாற்றம்", diff --git a/src/locale/translations/te-IN.json b/src/locale/translations/te-IN.json index 9d94de045..e06bf84c6 100644 --- a/src/locale/translations/te-IN.json +++ b/src/locale/translations/te-IN.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "మరింత సమాచారం & పరిష్కరించండి", "addingTrustLineWarning": "XRPL Labs/Xaman ఏదైనా టోకెన్ లేదా టోకెన్ జారీని దోహదించదు. మీరు టోకెన్ జారీని విశ్వసించండి ఉంటే మాత్రమే కదిలించాలి.\nటోకెన్ (ట్రస్ట్ లైన్) గురించి ప్రశ్నలు లేదా సమస్యలు లేదా సమస్యలు విషయంలో మీరు టోకెన్ జారీని సంప్రదించవలసి ఉంటుంది.\n\nమీ సొంత ప్రమాదంలో కొనసాగించు.", "trustLineIsAlreadyExist": "ఈ టోకెన్ ఇప్పటికే వుంది. మీరు మళ్ళీ అదే టోకెన్ను జతచేయలేరు.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "మార్పిడి", diff --git a/src/locale/translations/tr.json b/src/locale/translations/tr.json index 86cee4e13..2d3c72858 100644 --- a/src/locale/translations/tr.json +++ b/src/locale/translations/tr.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Ek bilgi ve düzeltme", "addingTrustLineWarning": "XRPL Labs / Xaman, herhangi bir jeton veya jeton vereni onaylamaz. Yalnızca jeton verene güveniyorsanız devam etmelisiniz.\r\nToken (Güven Hattı) ile ilgili sorularınız veya sorunlarınız olması durumunda, jeton veren kuruluşla iletişime geçmeniz gerekecektir.\r\n\r\nKendi sorumluluğunuzda devam edin.", "trustLineIsAlreadyExist": "Bu Token zaten var. Aynı Token'ı yeniden ekleyemezsiniz.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Takas gerçekleşiyor", diff --git a/src/locale/translations/uk.json b/src/locale/translations/uk.json index 4f83077c4..4fb1d6800 100644 --- a/src/locale/translations/uk.json +++ b/src/locale/translations/uk.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Більше інформації та виправлення", "addingTrustLineWarning": "XRPL Labs / Xaman не схвалює жодного емітента токенів або токен. Ви повинні продовжити, лише якщо довіряєте емітенту токена.\r\nУ разі виникнення запитань або проблем щодо токена (Лінії довіри) вам потрібно буде зв’язатися з емітентом токена.\r\n\r\nПродовжуйте на свій страх і ризик.", "trustLineIsAlreadyExist": "Цей токен вже існує. Ви не можете знову додати той самий токен.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Обмін", diff --git a/src/locale/translations/ur.json b/src/locale/translations/ur.json index deaabd049..99e42b270 100644 --- a/src/locale/translations/ur.json +++ b/src/locale/translations/ur.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "مزید معلومات اور طے کریں", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "تبادلہ کرنا", diff --git a/src/locale/translations/uz.json b/src/locale/translations/uz.json index 133d6b02a..aeecf6f33 100644 --- a/src/locale/translations/uz.json +++ b/src/locale/translations/uz.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Qo'shimcha ma'lumot va tuzatish", "addingTrustLineWarning": "XRPL Labs / Xaman hech qanday token yoki token emitentini tasdiqlamaydi. Siz token emitentiga ishonganingizda davom etishingiz kerak.\r\nAgar token (TrustLine) bilan bog'liq savollar yoki muammolar yuzaga kelsa, siz token emitentiga murojaat qilishingiz kerak bo'ladi.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Almashish", diff --git a/src/locale/translations/vi.json b/src/locale/translations/vi.json index beb9d8bab..a8c6c467d 100644 --- a/src/locale/translations/vi.json +++ b/src/locale/translations/vi.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "Thêm thông tin và sửa chữa", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Trao đổi", diff --git a/src/locale/translations/zh-TW.json b/src/locale/translations/zh-TW.json index 44ab40d0f..f1dd3d822 100644 --- a/src/locale/translations/zh-TW.json +++ b/src/locale/translations/zh-TW.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "Exchanging", diff --git a/src/locale/translations/zh.json b/src/locale/translations/zh.json index 087cd3921..1a134cb0e 100644 --- a/src/locale/translations/zh.json +++ b/src/locale/translations/zh.json @@ -1002,7 +1002,8 @@ "moreInfoAndFix": "More info & fix", "addingTrustLineWarning": "XRPL Labs / Xaman does not endorse any token or token issuer. You should only proceed if you trust the token issuer.\r\nIn case of questions or problems regarding the token (TrustLine) you will need to contact the token issuer.\r\n\r\nContinue at your own risk.", "trustLineIsAlreadyExist": "This token already exists. You cannot add the same token again.", - "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard" + "issuerAddressCopiedToClipboard": "Issuer address copied to the clipboard", + "unableToLoadListOfTokens": "Unable to load the list of tokens!" }, "exchange": { "exchanging": "兑换中", diff --git a/src/screens/Overlay/AddCurrency/index.ts b/src/screens/Overlay/AddCurrency/index.ts deleted file mode 100644 index 7de25d548..000000000 --- a/src/screens/Overlay/AddCurrency/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import AddCurrencyModal from './AddCurrencyModal'; - -export default AddCurrencyModal; diff --git a/src/screens/Overlay/AddCurrency/AddCurrencyModal.tsx b/src/screens/Overlay/AddToken/AddTokenModal.tsx similarity index 58% rename from src/screens/Overlay/AddCurrency/AddCurrencyModal.tsx rename to src/screens/Overlay/AddToken/AddTokenModal.tsx index 3b6d4b925..4ad8a83f1 100644 --- a/src/screens/Overlay/AddCurrency/AddCurrencyModal.tsx +++ b/src/screens/Overlay/AddToken/AddTokenModal.tsx @@ -1,14 +1,15 @@ /** - * Add Currency Screen + * Add Token Screen */ -import { head, first, forEach, isEmpty, get } from 'lodash'; +import { first, get, values, find, isEmpty } from 'lodash'; import React, { Component } from 'react'; -import { View, Text, Image, ScrollView, Alert } from 'react-native'; +import { View, Text, Image, ScrollView, Alert, InteractionManager } from 'react-native'; import LedgerService from '@services/LedgerService'; import NetworkService from '@services/NetworkService'; +import BackendService from '@services/BackendService'; import { Navigator } from '@common/helpers/navigator'; import { AppScreens } from '@common/constants'; @@ -16,11 +17,19 @@ import { AppScreens } from '@common/constants'; import { TrustSet } from '@common/libs/ledger/transactions'; import { Payload } from '@common/libs/payload'; -import { AccountRepository, CounterPartyRepository } from '@store/repositories'; -import { CounterPartyModel, CurrencyModel, AccountModel } from '@store/models'; +import { AccountRepository } from '@store/repositories'; +import { AccountModel } from '@store/models'; // components -import { TouchableDebounce, Button, Footer, ActionPanel } from '@components/General'; +import { + TouchableDebounce, + Button, + Footer, + ActionPanel, + LoadingIndicator, + Spacer, + InfoMessage, +} from '@components/General'; import Localize from '@locale'; @@ -33,21 +42,18 @@ export interface Props { account: AccountModel; } -export interface CurrenciesList { - [key: string]: CurrencyModel[]; -} - export interface State { - counterParties: CounterPartyModel[]; - currencies: CurrenciesList; - selectedCurrency: CurrencyModel; - selectedParty: CounterPartyModel; + dataSource: XamanBackend.CuratedIOUsDetails; + selectedPartyId: number; + selectedCurrencyId: number; isLoading: boolean; + isLoadingTokenInfo: boolean; + error: boolean; } /* Component ==================================================================== */ -class AddCurrencyOverlay extends Component { - static screenName = AppScreens.Overlay.AddCurrency; +class AddTokenModal extends Component { + static screenName = AppScreens.Overlay.AddToken; private actionPanel: ActionPanel; @@ -66,65 +72,82 @@ class AddCurrencyOverlay extends Component { super(props); this.state = { - counterParties: undefined, - currencies: undefined, - selectedParty: undefined, - selectedCurrency: undefined, - isLoading: false, + dataSource: undefined, + selectedPartyId: undefined, + selectedCurrencyId: undefined, + isLoading: true, + isLoadingTokenInfo: false, + error: false, }; } componentDidMount() { - this.setDefaults(); + InteractionManager.runAfterInteractions(this.loadVettedTokens); } - setDefaults = () => { - const counterParties = CounterPartyRepository.query({ shortlist: true }).sorted([['id', false]]) as any; - - if (counterParties.isEmpty()) return; + loadVettedTokens = async () => { + const { isLoading } = this.state; - const availableParties = [] as CounterPartyModel[]; - const availableCurrencies = [] as any; + try { + if (!isLoading) { + this.setState({ + isLoading: true, + error: false, + }); + } - forEach(counterParties, (counterParty) => { - const currencies = [] as any; + const { details } = await BackendService.getCuratedIOUs(0, true); - forEach(counterParty.currencies, (currency) => { - if (currency.shortlist === true) { - currencies.push(currency); - } - }); + // set default selected party and currency to the first in the list + const selectedParty = first(values(details)); + const selectedPartyId = get(selectedParty, 'id'); + const selectedCurrencyId = get(first(values(get(selectedParty, 'currencies'))), 'id'); - if (!isEmpty(currencies)) { - availableParties.push(counterParty); - availableCurrencies[counterParty.id] = currencies; + // something is not right, + if (!selectedPartyId || !selectedCurrencyId) { + this.setState({ + error: true, + }); + return; } - }); - this.setState({ - counterParties: availableParties, - currencies: availableCurrencies, - selectedParty: head(availableParties), - selectedCurrency: head(get(availableCurrencies, head(availableParties)?.id)), - }); + this.setState({ + dataSource: details, + selectedPartyId, + selectedCurrencyId, + }); + } catch { + this.setState({ + error: true, + }); + } finally { + this.setState({ + isLoading: false, + }); + } }; onAddPress = async () => { const { account } = this.props; - const { selectedCurrency } = this.state; + const { dataSource, selectedPartyId, selectedCurrencyId } = this.state; - if (!selectedCurrency.isValid()) { - return; - } + const selectedCurrency = find(values(get(find(values(dataSource), { id: selectedPartyId }), 'currencies')), { + id: selectedCurrencyId, + }); // if trustline is already exist return - if (AccountRepository.hasCurrency(account, selectedCurrency)) { + if ( + AccountRepository.hasCurrency(account, { + issuer: selectedCurrency.issuer, + currency: selectedCurrency.currency, + }) + ) { Alert.alert(Localize.t('global.error'), Localize.t('asset.trustLineIsAlreadyExist')); return; } this.setState({ - isLoading: true, + isLoadingTokenInfo: true, }); // set the default line limit @@ -142,7 +165,7 @@ class AddCurrencyOverlay extends Component { // ignore } finally { this.setState({ - isLoading: false, + isLoadingTokenInfo: false, }); } @@ -180,9 +203,11 @@ class AddCurrencyOverlay extends Component { }; renderCurrencies = () => { - const { counterParties, selectedParty, selectedCurrency, currencies } = this.state; + const { dataSource, selectedPartyId, selectedCurrencyId } = this.state; + + const currencies = values(get(find(values(dataSource), { id: selectedPartyId }), 'currencies')); - if (isEmpty(counterParties)) { + if (isEmpty(currencies)) { return ( No Item to show @@ -190,35 +215,31 @@ class AddCurrencyOverlay extends Component { ); } - return currencies[selectedParty.id].map((c, index) => { - if (!c.isValid()) { - return null; - } + return currencies.map((currency, index) => { + const selected = currency.id === selectedCurrencyId; return ( { - if (c.isValid() && selectedParty.isValid()) { - this.setState({ - selectedCurrency: c, - }); - } + this.setState({ + selectedCurrencyId: currency.id, + }); }} > - - + + - + - {c.name} + {currency.name} @@ -228,9 +249,11 @@ class AddCurrencyOverlay extends Component { }; renderParties = () => { - const { counterParties, selectedParty, currencies } = this.state; + const { dataSource, selectedPartyId } = this.state; + + const parties = values(dataSource); - if (isEmpty(counterParties)) { + if (isEmpty(parties)) { return ( { ); } - return counterParties.map((c, index) => { - if (!c?.isValid()) return null; - - const selected = selectedParty.id === c.id; + return parties.map((party, index) => { + // if selected party on the list + const selected = selectedPartyId === party.id; return ( { - if (c.isValid()) { - this.setState({ - selectedParty: c, - selectedCurrency: first(get(currencies, c.id)), - }); - } + this.setState({ + selectedPartyId: party.id, + selectedCurrencyId: get(first(values(get(party, 'currencies'))), 'id'), + }); }} > - - + + - + - {c.name} - {c.name && ` (${currencies[c.id].length})`} + {party.name} + {party.name && ` (${values(get(party, 'currencies')).length})`} @@ -282,8 +302,44 @@ class AddCurrencyOverlay extends Component { }); }; + renderContent = () => { + const { isLoading, error } = this.state; + + if (isLoading) { + return ( + + + + {Localize.t('global.loading')} + + ); + } + + if (error) { + return ( + + + + ); + } + + return ( + + {this.renderParties()} + + {this.renderCurrencies()} + + ); + }; + render() { - const { selectedCurrency, isLoading } = this.state; + const { selectedCurrencyId, isLoadingTokenInfo } = this.state; return ( { - + { - + { - - {this.renderParties()} - - {this.renderCurrencies()} - + + {this.renderContent()}
@@ -364,4 +417,4 @@ class AddCurrencyOverlay extends Component { } /* Export Component ==================================================================== */ -export default AddCurrencyOverlay; +export default AddTokenModal; diff --git a/src/screens/Overlay/AddToken/index.ts b/src/screens/Overlay/AddToken/index.ts new file mode 100644 index 000000000..0837356f6 --- /dev/null +++ b/src/screens/Overlay/AddToken/index.ts @@ -0,0 +1,3 @@ +import AddTokenModal from './AddTokenModal'; + +export default AddTokenModal; diff --git a/src/screens/Overlay/AddCurrency/styles.tsx b/src/screens/Overlay/AddToken/styles.tsx similarity index 87% rename from src/screens/Overlay/AddCurrency/styles.tsx rename to src/screens/Overlay/AddToken/styles.tsx index 5941d524a..978281d8c 100644 --- a/src/screens/Overlay/AddCurrency/styles.tsx +++ b/src/screens/Overlay/AddToken/styles.tsx @@ -3,6 +3,13 @@ import StyleService from '@services/StyleService'; import { AppSizes, AppFonts } from '@theme'; /* Styles ==================================================================== */ const styles = StyleService.create({ + errorContainer: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + width: '100%', + paddingHorizontal: AppSizes.padding, + }, cancelButton: { height: AppSizes.screen.heightHalf * 0.1, backgroundColor: '$grey', diff --git a/src/screens/index.ts b/src/screens/index.ts index afbbf3902..d3c11bbcb 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -36,7 +36,7 @@ import DestinationPicker from './Modal/DestinationPicker'; // Overlay import SwitchAccount from './Overlay/SwitchAccount'; import ShareAccount from './Overlay/ShareAccount'; -import AddCurrency from './Overlay/AddCurrency'; +import AddToken from './Overlay/AddToken'; import Vault from './Overlay/Vault'; import Auth from './Overlay/Authenticate'; import Lock from './Overlay/Lock'; @@ -132,7 +132,7 @@ export { // overlay SwitchAccount, ShareAccount, - AddCurrency, + AddToken, TokenSettings, Vault, Auth, diff --git a/src/services/BackendService.ts b/src/services/BackendService.ts index ece7e44e4..05d3d4bf0 100644 --- a/src/services/BackendService.ts +++ b/src/services/BackendService.ts @@ -105,13 +105,10 @@ class BackendService { */ syncCuratedIOUs = async () => { try { - const LOCALE_VERSION = await Preferences.get(Preferences.keys.CURATED_LIST_VERSION); - // in case of not exist, then Number(LOCALE_VERSION) will be 0 + const LOCALE_VERSION = await Preferences.get(Preferences.keys.CURATED_LIST_VERSION); - const { details, version, changed } = (await ApiService.curatedIOUs.get({ - version: Number(LOCALE_VERSION), - })) as XamanBackend.CuratedIOUsResponse; + const { details, version, changed } = await this.getCuratedIOUs(Number(LOCALE_VERSION)); // nothing has been changed if (!changed) { @@ -302,6 +299,10 @@ class BackendService { }); }; + getCuratedIOUs = (version = 0, promoted = false): Promise => { + return ApiService.curatedIOUs.get({ version, promoted }); + }; + /** * Gets a list of authorized third-party apps. * @returns {Promise} A promise that resolves with a list of authorized third-party app. diff --git a/src/store/repositories/account.ts b/src/store/repositories/account.ts index 68b6fccf5..fd2eb1d70 100644 --- a/src/store/repositories/account.ts +++ b/src/store/repositories/account.ts @@ -203,8 +203,8 @@ class AccountRepository extends BaseRepository { hasCurrency = (account: AccountModel, currency: Partial): boolean => { let found = false; - account.lines.forEach((t: TrustLineModel) => { - if (t.currency.issuer === currency.issuer && t.currency.currency === currency.currency) { + account.lines.forEach((line: TrustLineModel) => { + if (line.currency.issuer === currency.issuer && line.currency.currency === currency.currency) { found = true; } }); diff --git a/src/typings/xaman-backend/index.d.ts b/src/typings/xaman-backend/index.d.ts index 49eeb5639..bed094b69 100644 --- a/src/typings/xaman-backend/index.d.ts +++ b/src/typings/xaman-backend/index.d.ts @@ -1,39 +1,41 @@ declare namespace XamanBackend { + interface CuratedIOUsDetails { + [key: string]: { + id: number; + name: string; + domain: string; + avatar: string; + shortlist: number; + info_source: { + type: string; + source: string; + }; + currencies: { + [key: string]: { + id: number; + issuer_id: number; + issuer: string; + currency: string; + name: string; + avatar: string; + shortlist: number; + info_source: { + type: string; + source: string; + }; + xapp_identifier: string | null; + }; + }; + }; + } + interface CuratedIOUsResponse { version: number; changed: boolean; network: string; issuers: string[]; currencies: string[]; - details: { - [key: string]: { - id: number; - name: string; - domain: string; - avatar: string; - shortlist: number; - info_source: { - type: string; - source: string; - }; - currencies: { - [key: string]: { - id: number; - issuer_id: number; - issuer: string; - currency: string; - name: string; - avatar: string; - shortlist: number; - info_source: { - type: string; - source: string; - }; - xapp_identifier: string | null; - }; - }; - }; - }; + details: CuratedIOUsDetails; } interface AddUserResponse { user: {