diff --git a/locale/da/texts.po b/locale/da/texts.po index 000437215..0a7dacd97 100644 --- a/locale/da/texts.po +++ b/locale/da/texts.po @@ -326,7 +326,7 @@ msgid "Back" msgstr "" #: src/screens/CreateTokenAmount.js:96 src/screens/CreateTokenAmount.js:108 -#: src/screens/SendAmountInput.js:142 +#: src/screens/SendAmountInput.js:92 msgid "Invalid amount" msgstr "" @@ -355,7 +355,7 @@ msgstr "" #: src/screens/CreateTokenAmount.js:211 src/screens/CreateTokenName.js:67 #: src/screens/CreateTokenSymbol.js:86 src/screens/InitWallet.js:229 #: src/screens/InitWallet.js:382 src/screens/SendAddressInput.js:66 -#: src/screens/SendAmountInput.js:239 +#: src/screens/SendAmountInput.js:169 msgid "Next" msgstr "Næste" @@ -383,8 +383,8 @@ msgstr "Indtast din 6-cifrede pin for at oprette din token" msgid "Authorize token creation" msgstr "Autoriser oprettelse af token" -#: src/screens/CreateTokenConfirm.js:158 src/screens/SendConfirmScreen.js:105 -#: src/screens/TokenSwapReview.js:205 +#: src/screens/CreateTokenConfirm.js:158 src/screens/SendConfirmScreen.js:166 +#: src/screens/TokenSwapReview.js:221 msgid "Building transaction" msgstr "" @@ -962,103 +962,110 @@ msgstr "SEND" msgid "Address to send" msgstr "Adresse, der skal sendes til" -#: src/screens/SendAmountInput.js:147 +#: src/screens/SendAmountInput.js:97 msgid "Insufficient funds" msgstr "Utilstrækkelige midler" -#: src/screens/SendAmountInput.js:154 -msgid "Calculating network fee..." -msgstr "" - -#: src/screens/SendAmountInput.js:161 src/screens/SendAmountInput.js:166 -msgid "Insufficient balance of HTR to cover the network fee." -msgstr "" - -#: src/screens/SendAmountInput.js:193 +#: src/screens/SendAmountInput.js:123 #, javascript-format msgid "${ amountAndToken } available" msgid_plural "${ amountAndToken } available" msgstr[0] "" msgstr[1] "" -#: src/screens/SendAmountInput.js:207 src/screens/SendConfirmScreen.js:193 +#: src/screens/SendAmountInput.js:137 src/screens/SendConfirmScreen.js:257 msgid "SEND ${ tokenNameUpperCase }" msgstr "SEND ${ tokenNameUpperCase }" -#: src/screens/SendConfirmScreen.js:33 src/screens/TokenSwapReview.js:304 +#: src/screens/SendConfirmScreen.js:42 src/screens/TokenSwapReview.js:320 msgid "No fee" msgstr "" -#. show loading modal -#: src/screens/SendConfirmScreen.js:90 src/screens/TokenSwapReview.js:189 +#: src/screens/SendConfirmScreen.js:54 +msgid "Insufficient HTR to cover the network fee." +msgstr "" + +#: src/screens/SendConfirmScreen.js:57 +msgid "Insufficient balance to send this transaction." +msgstr "" + +#: src/screens/SendConfirmScreen.js:59 +msgid "Failed to build transaction." +msgstr "" + +#: src/screens/SendConfirmScreen.js:146 src/screens/TokenSwapReview.js:205 msgid "Your transfer is being processed" msgstr "Din overførsel behandles" -#: src/sagas/helpers.js:147 src/screens/SendConfirmScreen.js:103 -#: src/screens/TokenSwapReview.js:203 +#: src/sagas/helpers.js:147 src/screens/SendConfirmScreen.js:164 +#: src/screens/TokenSwapReview.js:219 msgid "Enter your 6-digit pin to authorize operation" msgstr "Indtast din 6-cifrede pin for at godkende overførslen" -#: src/sagas/helpers.js:148 src/screens/SendConfirmScreen.js:104 -#: src/screens/TokenSwapReview.js:204 +#: src/sagas/helpers.js:148 src/screens/SendConfirmScreen.js:165 +#: src/screens/TokenSwapReview.js:220 msgid "Authorize operation" msgstr "Autoriserer overførslen" -#: src/screens/SendConfirmScreen.js:140 +#: src/screens/SendConfirmScreen.js:205 #, javascript-format msgid "${ availablePretty } available" msgid_plural "${ availablePretty } available" msgstr[0] "" msgstr[1] "" -#: src/screens/SendConfirmScreen.js:164 +#: src/screens/SendConfirmScreen.js:228 msgid "Loading fee information..." msgstr "" -#: src/screens/SendConfirmScreen.js:167 +#: src/screens/SendConfirmScreen.js:231 msgid "This is the native token, no network fees are charged." msgstr "" -#: src/screens/SendConfirmScreen.js:170 +#: src/screens/SendConfirmScreen.js:234 msgid "This token is Deposit Based, no network fee will be charged." msgstr "" -#: src/screens/SendConfirmScreen.js:172 +#: src/screens/SendConfirmScreen.js:236 msgid "This fee is fixed and required for every transfer of this token." msgstr "" #: src/components/Reown/NanoContract/NanoContractExecInfo.js:108 -#: src/screens/SendConfirmScreen.js:177 +#: src/screens/SendConfirmScreen.js:241 msgid "Loading..." msgstr "" -#: src/screens/SendConfirmScreen.js:202 +#: src/screens/SendConfirmScreen.js:263 +msgid "Building your transaction" +msgstr "" + +#: src/screens/SendConfirmScreen.js:281 #, javascript-format msgid "Your transfer of **${ amountAndToken }** has been confirmed" msgstr "" -#: src/screens/SendConfirmScreen.js:213 +#: src/screens/SendConfirmScreen.js:292 msgid "Read more." msgstr "" -#: src/screens/SendConfirmScreen.js:229 +#: src/screens/SendConfirmScreen.js:309 msgid "**Transaction summary**" msgstr "" -#: src/screens/SendConfirmScreen.js:232 +#: src/screens/SendConfirmScreen.js:312 msgid "**To**" msgstr "" -#: src/screens/SendConfirmScreen.js:237 +#: src/screens/SendConfirmScreen.js:317 msgid "**Network Fee**" msgstr "" -#: src/screens/SendConfirmScreen.js:245 +#: src/screens/SendConfirmScreen.js:325 msgid "**Total**" msgstr "" #: src/screens/NetworkSettings/CustomNetworkSettingsScreen.js:295 -#: src/screens/SendConfirmScreen.js:252 +#: src/screens/SendConfirmScreen.js:332 msgid "Send" msgstr "Send" @@ -1145,25 +1152,25 @@ msgstr "" msgid "Loading Token Swap" msgstr "" -#: src/screens/TokenSwapReview.js:215 +#: src/screens/TokenSwapReview.js:231 msgid "REVIEW TOKEN SWAP" msgstr "" -#: src/screens/TokenSwapReview.js:221 +#: src/screens/TokenSwapReview.js:237 msgid "Building the swap transaction for your review" msgstr "" -#: src/screens/TokenSwapReview.js:239 +#: src/screens/TokenSwapReview.js:255 msgid "Your swap was successful" msgstr "" #: src/components/Reown/CreateTokenRequest.js:130 #: src/components/Reown/TransactionFees.js:55 -#: src/screens/TokenSwapReview.js:300 +#: src/screens/TokenSwapReview.js:316 msgid "Network Fee" msgstr "" -#: src/screens/TokenSwapReview.js:312 +#: src/screens/TokenSwapReview.js:328 msgid "SWAP" msgstr "" diff --git a/locale/pt-br/texts.po b/locale/pt-br/texts.po index b5293acea..b67698ffc 100644 --- a/locale/pt-br/texts.po +++ b/locale/pt-br/texts.po @@ -339,7 +339,7 @@ msgid "Back" msgstr "Voltar" #: src/screens/CreateTokenAmount.js:96 src/screens/CreateTokenAmount.js:108 -#: src/screens/SendAmountInput.js:142 +#: src/screens/SendAmountInput.js:92 msgid "Invalid amount" msgstr "Quantidade inválida" @@ -368,7 +368,7 @@ msgstr "Quantidade de ${ name } (${ symbol })" #: src/screens/CreateTokenAmount.js:211 src/screens/CreateTokenName.js:67 #: src/screens/CreateTokenSymbol.js:86 src/screens/InitWallet.js:229 #: src/screens/InitWallet.js:382 src/screens/SendAddressInput.js:66 -#: src/screens/SendAmountInput.js:239 +#: src/screens/SendAmountInput.js:169 msgid "Next" msgstr "Próximo" @@ -400,8 +400,8 @@ msgstr "Digite seu PIN de 6 dígitos para criar o seu token" msgid "Authorize token creation" msgstr "Autorizar criação de token" -#: src/screens/CreateTokenConfirm.js:158 src/screens/SendConfirmScreen.js:105 -#: src/screens/TokenSwapReview.js:205 +#: src/screens/CreateTokenConfirm.js:158 src/screens/SendConfirmScreen.js:166 +#: src/screens/TokenSwapReview.js:221 msgid "Building transaction" msgstr "Criando transação" @@ -991,103 +991,110 @@ msgstr "ENVIAR" msgid "Address to send" msgstr "Endereço para enviar" -#: src/screens/SendAmountInput.js:147 +#: src/screens/SendAmountInput.js:97 msgid "Insufficient funds" msgstr "Saldo insuficiente" -#: src/screens/SendAmountInput.js:154 -msgid "Calculating network fee..." -msgstr "Calculando taxa da rede..." - -#: src/screens/SendAmountInput.js:161 src/screens/SendAmountInput.js:166 -msgid "Insufficient balance of HTR to cover the network fee." -msgstr "Saldo insuficiente para cobrir a taxa da rede." - -#: src/screens/SendAmountInput.js:193 +#: src/screens/SendAmountInput.js:123 #, javascript-format msgid "${ amountAndToken } available" msgid_plural "${ amountAndToken } available" msgstr[0] "${ amountAndToken } disponível" msgstr[1] "${ amountAndToken } disponíveis" -#: src/screens/SendAmountInput.js:207 src/screens/SendConfirmScreen.js:193 +#: src/screens/SendAmountInput.js:137 src/screens/SendConfirmScreen.js:257 msgid "SEND ${ tokenNameUpperCase }" msgstr "ENVIAR ${ tokenNameUpperCase }" -#: src/screens/SendConfirmScreen.js:33 src/screens/TokenSwapReview.js:304 +#: src/screens/SendConfirmScreen.js:42 src/screens/TokenSwapReview.js:320 msgid "No fee" msgstr "Sem taxa" -#. show loading modal -#: src/screens/SendConfirmScreen.js:90 src/screens/TokenSwapReview.js:189 +#: src/screens/SendConfirmScreen.js:54 +msgid "Insufficient HTR to cover the network fee." +msgstr "Saldo insuficiente de HTR para cobrir a taxa da rede." + +#: src/screens/SendConfirmScreen.js:57 +msgid "Insufficient balance to send this transaction." +msgstr "Saldo insuficiente para completar a transação." + +#: src/screens/SendConfirmScreen.js:59 +msgid "Failed to build transaction." +msgstr "Falha ao criar a transação" + +#: src/screens/SendConfirmScreen.js:146 src/screens/TokenSwapReview.js:205 msgid "Your transfer is being processed" msgstr "Sua transferência está sendo processada" -#: src/sagas/helpers.js:147 src/screens/SendConfirmScreen.js:103 -#: src/screens/TokenSwapReview.js:203 +#: src/sagas/helpers.js:147 src/screens/SendConfirmScreen.js:164 +#: src/screens/TokenSwapReview.js:219 msgid "Enter your 6-digit pin to authorize operation" msgstr "Digite seu PIN de 6 dígitos para autorizar a operação" -#: src/sagas/helpers.js:148 src/screens/SendConfirmScreen.js:104 -#: src/screens/TokenSwapReview.js:204 +#: src/sagas/helpers.js:148 src/screens/SendConfirmScreen.js:165 +#: src/screens/TokenSwapReview.js:220 msgid "Authorize operation" msgstr "Autorizar operação" -#: src/screens/SendConfirmScreen.js:140 +#: src/screens/SendConfirmScreen.js:205 #, javascript-format msgid "${ availablePretty } available" msgid_plural "${ availablePretty } available" msgstr[0] "Você tem ${ availablePretty } disponível" msgstr[1] "Você tem ${ availablePretty } disponíveis" -#: src/screens/SendConfirmScreen.js:164 +#: src/screens/SendConfirmScreen.js:228 msgid "Loading fee information..." msgstr "Carregando informações da taxa..." -#: src/screens/SendConfirmScreen.js:167 +#: src/screens/SendConfirmScreen.js:231 msgid "This is the native token, no network fees are charged." msgstr "Token nativo, nenhuma taxa aplicada." -#: src/screens/SendConfirmScreen.js:170 +#: src/screens/SendConfirmScreen.js:234 msgid "This token is Deposit Based, no network fee will be charged." msgstr "Este token é de Depósito, nenhuma taxa de rede será cobrada." -#: src/screens/SendConfirmScreen.js:172 +#: src/screens/SendConfirmScreen.js:236 msgid "This fee is fixed and required for every transfer of this token." msgstr "Esta taxa é fixa e obrigatória para cada transação deste token." #: src/components/Reown/NanoContract/NanoContractExecInfo.js:108 -#: src/screens/SendConfirmScreen.js:177 +#: src/screens/SendConfirmScreen.js:241 msgid "Loading..." msgstr "Carregando..." -#: src/screens/SendConfirmScreen.js:202 +#: src/screens/SendConfirmScreen.js:263 +msgid "Building your transaction" +msgstr "Criando sua transação" + +#: src/screens/SendConfirmScreen.js:281 #, javascript-format msgid "Your transfer of **${ amountAndToken }** has been confirmed" msgstr "Sua transferência de **${ amountAndToken }** foi confirmada" -#: src/screens/SendConfirmScreen.js:213 +#: src/screens/SendConfirmScreen.js:292 msgid "Read more." msgstr "Ler mais." -#: src/screens/SendConfirmScreen.js:229 +#: src/screens/SendConfirmScreen.js:309 msgid "**Transaction summary**" msgstr "**Resumo da transação**" -#: src/screens/SendConfirmScreen.js:232 +#: src/screens/SendConfirmScreen.js:312 msgid "**To**" msgstr "**Para**" -#: src/screens/SendConfirmScreen.js:237 +#: src/screens/SendConfirmScreen.js:317 msgid "**Network Fee**" msgstr "**Taxa de Rede**" -#: src/screens/SendConfirmScreen.js:245 +#: src/screens/SendConfirmScreen.js:325 msgid "**Total**" msgstr "**Total**" #: src/screens/NetworkSettings/CustomNetworkSettingsScreen.js:295 -#: src/screens/SendConfirmScreen.js:252 +#: src/screens/SendConfirmScreen.js:332 msgid "Send" msgstr "Enviar" @@ -1174,25 +1181,25 @@ msgstr "Ocorreu um erro ao carregar o protocolo de troca de tokens." msgid "Loading Token Swap" msgstr "Carregando troca de tokens" -#: src/screens/TokenSwapReview.js:215 +#: src/screens/TokenSwapReview.js:231 msgid "REVIEW TOKEN SWAP" msgstr "REVISAR TROCA DE TOKENS" -#: src/screens/TokenSwapReview.js:221 +#: src/screens/TokenSwapReview.js:237 msgid "Building the swap transaction for your review" msgstr "Criando transação de swap para ser revisada" -#: src/screens/TokenSwapReview.js:239 +#: src/screens/TokenSwapReview.js:255 msgid "Your swap was successful" msgstr "Sua troca foi bem-sucedida" #: src/components/Reown/CreateTokenRequest.js:130 #: src/components/Reown/TransactionFees.js:55 -#: src/screens/TokenSwapReview.js:300 +#: src/screens/TokenSwapReview.js:316 msgid "Network Fee" msgstr "Taxa de Rede" -#: src/screens/TokenSwapReview.js:312 +#: src/screens/TokenSwapReview.js:328 msgid "SWAP" msgstr "TROCAR" @@ -2849,6 +2856,12 @@ msgstr "${ tokenSymbol } Conceder Authority" msgid "${ tokenSymbol } Acquire Authority" msgstr "${ tokenSymbol } Obter Authority" +#~ msgid "Calculating network fee..." +#~ msgstr "Calculando taxa da rede..." + +#~ msgid "Insufficient balance of HTR to cover the network fee." +#~ msgstr "Saldo insuficiente para cobrir a taxa da rede." + #~ msgid "Calculating…" #~ msgstr "Calculando…" diff --git a/locale/ru-ru/texts.po b/locale/ru-ru/texts.po index 8ea81a37c..be6e3d4df 100644 --- a/locale/ru-ru/texts.po +++ b/locale/ru-ru/texts.po @@ -327,7 +327,7 @@ msgid "Back" msgstr "" #: src/screens/CreateTokenAmount.js:96 src/screens/CreateTokenAmount.js:108 -#: src/screens/SendAmountInput.js:142 +#: src/screens/SendAmountInput.js:92 msgid "Invalid amount" msgstr "" @@ -356,7 +356,7 @@ msgstr "" #: src/screens/CreateTokenAmount.js:211 src/screens/CreateTokenName.js:67 #: src/screens/CreateTokenSymbol.js:86 src/screens/InitWallet.js:229 #: src/screens/InitWallet.js:382 src/screens/SendAddressInput.js:66 -#: src/screens/SendAmountInput.js:239 +#: src/screens/SendAmountInput.js:169 msgid "Next" msgstr "Далее" @@ -384,8 +384,8 @@ msgstr "Введите 6-значный PIN-код для создания то msgid "Authorize token creation" msgstr "Авторизовать создание токена" -#: src/screens/CreateTokenConfirm.js:158 src/screens/SendConfirmScreen.js:105 -#: src/screens/TokenSwapReview.js:205 +#: src/screens/CreateTokenConfirm.js:158 src/screens/SendConfirmScreen.js:166 +#: src/screens/TokenSwapReview.js:221 msgid "Building transaction" msgstr "" @@ -963,19 +963,11 @@ msgstr "ОТПРАВИТЬ" msgid "Address to send" msgstr "Адрес отправки" -#: src/screens/SendAmountInput.js:147 +#: src/screens/SendAmountInput.js:97 msgid "Insufficient funds" msgstr "Недостаточно средств" -#: src/screens/SendAmountInput.js:154 -msgid "Calculating network fee..." -msgstr "" - -#: src/screens/SendAmountInput.js:161 src/screens/SendAmountInput.js:166 -msgid "Insufficient balance of HTR to cover the network fee." -msgstr "" - -#: src/screens/SendAmountInput.js:193 +#: src/screens/SendAmountInput.js:123 #, javascript-format msgid "${ amountAndToken } available" msgid_plural "${ amountAndToken } available" @@ -983,30 +975,41 @@ msgstr[0] "" msgstr[1] "" msgstr[2] "" -#: src/screens/SendAmountInput.js:207 src/screens/SendConfirmScreen.js:193 +#: src/screens/SendAmountInput.js:137 src/screens/SendConfirmScreen.js:257 msgid "SEND ${ tokenNameUpperCase }" msgstr "ОТПРАВИТЬ ${ tokenNameUpperCase }" -#: src/screens/SendConfirmScreen.js:33 src/screens/TokenSwapReview.js:304 +#: src/screens/SendConfirmScreen.js:42 src/screens/TokenSwapReview.js:320 msgid "No fee" msgstr "" -#. show loading modal -#: src/screens/SendConfirmScreen.js:90 src/screens/TokenSwapReview.js:189 +#: src/screens/SendConfirmScreen.js:54 +msgid "Insufficient HTR to cover the network fee." +msgstr "" + +#: src/screens/SendConfirmScreen.js:57 +msgid "Insufficient balance to send this transaction." +msgstr "" + +#: src/screens/SendConfirmScreen.js:59 +msgid "Failed to build transaction." +msgstr "" + +#: src/screens/SendConfirmScreen.js:146 src/screens/TokenSwapReview.js:205 msgid "Your transfer is being processed" msgstr "Ваш перевод обрабатывается" -#: src/sagas/helpers.js:147 src/screens/SendConfirmScreen.js:103 -#: src/screens/TokenSwapReview.js:203 +#: src/sagas/helpers.js:147 src/screens/SendConfirmScreen.js:164 +#: src/screens/TokenSwapReview.js:219 msgid "Enter your 6-digit pin to authorize operation" msgstr "Введите 6-значный PIN-код для авторизации операции" -#: src/sagas/helpers.js:148 src/screens/SendConfirmScreen.js:104 -#: src/screens/TokenSwapReview.js:204 +#: src/sagas/helpers.js:148 src/screens/SendConfirmScreen.js:165 +#: src/screens/TokenSwapReview.js:220 msgid "Authorize operation" msgstr "Авторизовать операцию" -#: src/screens/SendConfirmScreen.js:140 +#: src/screens/SendConfirmScreen.js:205 #, javascript-format msgid "${ availablePretty } available" msgid_plural "${ availablePretty } available" @@ -1014,54 +1017,58 @@ msgstr[0] "" msgstr[1] "" msgstr[2] "" -#: src/screens/SendConfirmScreen.js:164 +#: src/screens/SendConfirmScreen.js:228 msgid "Loading fee information..." msgstr "" -#: src/screens/SendConfirmScreen.js:167 +#: src/screens/SendConfirmScreen.js:231 msgid "This is the native token, no network fees are charged." msgstr "" -#: src/screens/SendConfirmScreen.js:170 +#: src/screens/SendConfirmScreen.js:234 msgid "This token is Deposit Based, no network fee will be charged." msgstr "" -#: src/screens/SendConfirmScreen.js:172 +#: src/screens/SendConfirmScreen.js:236 msgid "This fee is fixed and required for every transfer of this token." msgstr "" #: src/components/Reown/NanoContract/NanoContractExecInfo.js:108 -#: src/screens/SendConfirmScreen.js:177 +#: src/screens/SendConfirmScreen.js:241 msgid "Loading..." msgstr "" -#: src/screens/SendConfirmScreen.js:202 +#: src/screens/SendConfirmScreen.js:263 +msgid "Building your transaction" +msgstr "" + +#: src/screens/SendConfirmScreen.js:281 #, javascript-format msgid "Your transfer of **${ amountAndToken }** has been confirmed" msgstr "Ваш перевод **${ amountAndToken }** был подтвержден" -#: src/screens/SendConfirmScreen.js:213 +#: src/screens/SendConfirmScreen.js:292 msgid "Read more." msgstr "" -#: src/screens/SendConfirmScreen.js:229 +#: src/screens/SendConfirmScreen.js:309 msgid "**Transaction summary**" msgstr "" -#: src/screens/SendConfirmScreen.js:232 +#: src/screens/SendConfirmScreen.js:312 msgid "**To**" msgstr "" -#: src/screens/SendConfirmScreen.js:237 +#: src/screens/SendConfirmScreen.js:317 msgid "**Network Fee**" msgstr "" -#: src/screens/SendConfirmScreen.js:245 +#: src/screens/SendConfirmScreen.js:325 msgid "**Total**" msgstr "" #: src/screens/NetworkSettings/CustomNetworkSettingsScreen.js:295 -#: src/screens/SendConfirmScreen.js:252 +#: src/screens/SendConfirmScreen.js:332 msgid "Send" msgstr "Отправить" @@ -1148,25 +1155,25 @@ msgstr "" msgid "Loading Token Swap" msgstr "" -#: src/screens/TokenSwapReview.js:215 +#: src/screens/TokenSwapReview.js:231 msgid "REVIEW TOKEN SWAP" msgstr "" -#: src/screens/TokenSwapReview.js:221 +#: src/screens/TokenSwapReview.js:237 msgid "Building the swap transaction for your review" msgstr "" -#: src/screens/TokenSwapReview.js:239 +#: src/screens/TokenSwapReview.js:255 msgid "Your swap was successful" msgstr "" #: src/components/Reown/CreateTokenRequest.js:130 #: src/components/Reown/TransactionFees.js:55 -#: src/screens/TokenSwapReview.js:300 +#: src/screens/TokenSwapReview.js:316 msgid "Network Fee" msgstr "" -#: src/screens/TokenSwapReview.js:312 +#: src/screens/TokenSwapReview.js:328 msgid "SWAP" msgstr "" diff --git a/locale/texts.pot b/locale/texts.pot index 07a565e00..d3b0c6a9b 100644 --- a/locale/texts.pot +++ b/locale/texts.pot @@ -324,7 +324,7 @@ msgstr "" #: src/screens/CreateTokenAmount.js:96 #: src/screens/CreateTokenAmount.js:108 -#: src/screens/SendAmountInput.js:142 +#: src/screens/SendAmountInput.js:92 msgid "Invalid amount" msgstr "" @@ -356,7 +356,7 @@ msgstr "" #: src/screens/InitWallet.js:229 #: src/screens/InitWallet.js:382 #: src/screens/SendAddressInput.js:66 -#: src/screens/SendAmountInput.js:239 +#: src/screens/SendAmountInput.js:169 msgid "Next" msgstr "" @@ -385,8 +385,8 @@ msgid "Authorize token creation" msgstr "" #: src/screens/CreateTokenConfirm.js:158 -#: src/screens/SendConfirmScreen.js:105 -#: src/screens/TokenSwapReview.js:205 +#: src/screens/SendConfirmScreen.js:166 +#: src/screens/TokenSwapReview.js:221 msgid "Building transaction" msgstr "" @@ -967,109 +967,115 @@ msgstr "" msgid "Address to send" msgstr "" -#: src/screens/SendAmountInput.js:147 +#: src/screens/SendAmountInput.js:97 msgid "Insufficient funds" msgstr "" -#: src/screens/SendAmountInput.js:154 -msgid "Calculating network fee..." -msgstr "" - -#: src/screens/SendAmountInput.js:161 -#: src/screens/SendAmountInput.js:166 -msgid "Insufficient balance of HTR to cover the network fee." -msgstr "" - -#: src/screens/SendAmountInput.js:193 +#: src/screens/SendAmountInput.js:123 #, javascript-format msgid "${ amountAndToken } available" msgid_plural "${ amountAndToken } available" msgstr[0] "" msgstr[1] "" -#: src/screens/SendAmountInput.js:207 -#: src/screens/SendConfirmScreen.js:193 +#: src/screens/SendAmountInput.js:137 +#: src/screens/SendConfirmScreen.js:257 msgid "SEND ${ tokenNameUpperCase }" msgstr "" -#: src/screens/SendConfirmScreen.js:33 -#: src/screens/TokenSwapReview.js:304 +#: src/screens/SendConfirmScreen.js:42 +#: src/screens/TokenSwapReview.js:320 msgid "No fee" msgstr "" -#: src/screens/SendConfirmScreen.js:90 -#: src/screens/TokenSwapReview.js:189 -#. show loading modal +#: src/screens/SendConfirmScreen.js:54 +msgid "Insufficient HTR to cover the network fee." +msgstr "" + +#: src/screens/SendConfirmScreen.js:57 +msgid "Insufficient balance to send this transaction." +msgstr "" + +#: src/screens/SendConfirmScreen.js:59 +msgid "Failed to build transaction." +msgstr "" + +#: src/screens/SendConfirmScreen.js:146 +#: src/screens/TokenSwapReview.js:205 msgid "Your transfer is being processed" msgstr "" #: src/sagas/helpers.js:147 -#: src/screens/SendConfirmScreen.js:103 -#: src/screens/TokenSwapReview.js:203 +#: src/screens/SendConfirmScreen.js:164 +#: src/screens/TokenSwapReview.js:219 msgid "Enter your 6-digit pin to authorize operation" msgstr "" #: src/sagas/helpers.js:148 -#: src/screens/SendConfirmScreen.js:104 -#: src/screens/TokenSwapReview.js:204 +#: src/screens/SendConfirmScreen.js:165 +#: src/screens/TokenSwapReview.js:220 msgid "Authorize operation" msgstr "" -#: src/screens/SendConfirmScreen.js:140 +#: src/screens/SendConfirmScreen.js:205 #, javascript-format msgid "${ availablePretty } available" msgid_plural "${ availablePretty } available" msgstr[0] "" msgstr[1] "" -#: src/screens/SendConfirmScreen.js:164 +#: src/screens/SendConfirmScreen.js:228 msgid "Loading fee information..." msgstr "" -#: src/screens/SendConfirmScreen.js:167 +#: src/screens/SendConfirmScreen.js:231 msgid "This is the native token, no network fees are charged." msgstr "" -#: src/screens/SendConfirmScreen.js:170 +#: src/screens/SendConfirmScreen.js:234 msgid "This token is Deposit Based, no network fee will be charged." msgstr "" -#: src/screens/SendConfirmScreen.js:172 +#: src/screens/SendConfirmScreen.js:236 msgid "This fee is fixed and required for every transfer of this token." msgstr "" #: src/components/Reown/NanoContract/NanoContractExecInfo.js:108 -#: src/screens/SendConfirmScreen.js:177 +#: src/screens/SendConfirmScreen.js:241 msgid "Loading..." msgstr "" -#: src/screens/SendConfirmScreen.js:202 +#: src/screens/SendConfirmScreen.js:263 +msgid "Building your transaction" +msgstr "" + +#: src/screens/SendConfirmScreen.js:281 #, javascript-format msgid "Your transfer of **${ amountAndToken }** has been confirmed" msgstr "" -#: src/screens/SendConfirmScreen.js:213 +#: src/screens/SendConfirmScreen.js:292 msgid "Read more." msgstr "" -#: src/screens/SendConfirmScreen.js:229 +#: src/screens/SendConfirmScreen.js:309 msgid "**Transaction summary**" msgstr "" -#: src/screens/SendConfirmScreen.js:232 +#: src/screens/SendConfirmScreen.js:312 msgid "**To**" msgstr "" -#: src/screens/SendConfirmScreen.js:237 +#: src/screens/SendConfirmScreen.js:317 msgid "**Network Fee**" msgstr "" -#: src/screens/SendConfirmScreen.js:245 +#: src/screens/SendConfirmScreen.js:325 msgid "**Total**" msgstr "" #: src/screens/NetworkSettings/CustomNetworkSettingsScreen.js:295 -#: src/screens/SendConfirmScreen.js:252 +#: src/screens/SendConfirmScreen.js:332 msgid "Send" msgstr "" @@ -1157,25 +1163,25 @@ msgstr "" msgid "Loading Token Swap" msgstr "" -#: src/screens/TokenSwapReview.js:215 +#: src/screens/TokenSwapReview.js:231 msgid "REVIEW TOKEN SWAP" msgstr "" -#: src/screens/TokenSwapReview.js:221 +#: src/screens/TokenSwapReview.js:237 msgid "Building the swap transaction for your review" msgstr "" -#: src/screens/TokenSwapReview.js:239 +#: src/screens/TokenSwapReview.js:255 msgid "Your swap was successful" msgstr "" #: src/components/Reown/CreateTokenRequest.js:130 #: src/components/Reown/TransactionFees.js:55 -#: src/screens/TokenSwapReview.js:300 +#: src/screens/TokenSwapReview.js:316 msgid "Network Fee" msgstr "" -#: src/screens/TokenSwapReview.js:312 +#: src/screens/TokenSwapReview.js:328 msgid "SWAP" msgstr "" diff --git a/src/sagas/tokenImport.js b/src/sagas/tokenImport.js index 320df97b1..e29bdcdda 100644 --- a/src/sagas/tokenImport.js +++ b/src/sagas/tokenImport.js @@ -52,6 +52,7 @@ function* fetchTokenDetails(wallet, uid) { uid, name: details.tokenInfo.name, symbol: details.tokenInfo.symbol, + version: details.tokenInfo.version, }; } } catch (e) { @@ -101,6 +102,7 @@ export function* fetchUnregisteredTokens() { uid: details.uid, name: details.name, symbol: details.symbol, + version: details.version, }; yield put(tokenFetchBalanceRequested(uid, true)); } @@ -135,6 +137,7 @@ export function* handleNewTokenDetection(action) { uid: details.uid, name: details.name, symbol: details.symbol, + version: details.version, }; yield put(tokenFetchBalanceRequested(uid, true)); } @@ -168,11 +171,17 @@ export function* importSelectedTokens(action) { continue; } + const persistedPayload = { + uid: token.uid, + name: token.name, + symbol: token.symbol, + version: token.version, + }; yield call( [wallet.storage, wallet.storage.registerToken], - { uid: token.uid, name: token.name, symbol: token.symbol }, + persistedPayload, ); - yield put(newToken({ uid: token.uid, name: token.name, symbol: token.symbol })); + yield put(newToken(persistedPayload)); yield put(tokenFetchBalanceRequested(token.uid, true)); alreadyRegistered.add(token.uid); diff --git a/src/screens/SendAmountInput.js b/src/screens/SendAmountInput.js index 6550fb4a2..9fc9fb5cb 100644 --- a/src/screens/SendAmountInput.js +++ b/src/screens/SendAmountInput.js @@ -18,7 +18,6 @@ import { useSelector } from 'react-redux'; import { getStatusBarHeight } from 'react-native-status-bar-height'; import { t, ngettext, msgid } from 'ttag'; import { get } from 'lodash'; -import hathorLib, { TokenVersion } from '@hathor/wallet-lib'; import { IS_MULTI_TOKEN } from '../constants'; import { renderValue, isTokenNFT } from '../utils'; @@ -33,7 +32,6 @@ import { COLORS } from '../styles/themes'; import { useNavigation, useParams } from '../hooks/navigation'; const SendAmountInput = () => { - const wallet = useSelector((state) => state.wallet); const selectedToken = useSelector((state) => state.selectedToken); const tokensBalance = useSelector((state) => state.tokensBalance); const tokenMetadata = useSelector((state) => state.tokenMetadata); @@ -48,8 +46,6 @@ const SendAmountInput = () => { const [amountValue, setAmountValue] = useState(null); const [token, setToken] = useState(selectedToken); const [error, setError] = useState(null); - const [networkFee, setNetworkFee] = useState(null); - const [utxos, setUtxos] = useState(null); const inputRef = useRef(null); useEffect(() => { @@ -66,52 +62,6 @@ const SendAmountInput = () => { setToken(selectedToken); }, [selectedToken]); - useEffect(() => { - let cancelled = false; - - const calculateNetworkFee = async () => { - if (token.version !== TokenVersion.FEE) { - setNetworkFee(0n); - return; - } - - if (amountValue == null || amountValue <= 0n) { - setNetworkFee(null); - return; - } - - // Set to null while calculating to indicate loading state - setNetworkFee(null); - setUtxos(null); - - try { - const { utxos: selectedUtxos, changeAmount } = await wallet.getUtxosForAmount( - amountValue, - { token: token.uid } - ); - if (cancelled) return; - - setUtxos(selectedUtxos); - - if (changeAmount) { - // Since there is change, it means we will have the intended output and a change output. - // 2 FBT outputs means the fee value will be payed twice - setNetworkFee(2n * hathorLib.constants.FEE_PER_OUTPUT); - } else { - // No change means that there will only be the intended output. - setNetworkFee(hathorLib.constants.FEE_PER_OUTPUT); - } - } catch (err) { - if (!cancelled) { - setNetworkFee(hathorLib.constants.FEE_PER_OUTPUT); - } - } - }; - - calculateNetworkFee(); - return () => { cancelled = true; }; - }, [wallet, token.uid, token.version, amountValue]); - const focusInput = () => { if (inputRef.current) { inputRef.current.focus(); @@ -148,28 +98,8 @@ const SendAmountInput = () => { return; } - if (token.version === TokenVersion.FEE) { - // Guard against stale/unknown fee - if (networkFee == null) { - setError(t`Calculating network fee...`); - return; - } - // The user selected a fee based token - // So we need to check the HTR balance to make the transaction happen. - const htrBalance = get(tokensBalance, hathorLib.constants.NATIVE_TOKEN_UID); - if (!htrBalance) { - setError(t`Insufficient balance of HTR to cover the network fee.`); - return; - } - const { available: htrAvailable } = htrBalance.data; - if (networkFee > htrAvailable) { - setError(t`Insufficient balance of HTR to cover the network fee.`); - return; - } - } - const { address } = params; - navigation.navigate('SendConfirmScreen', { address, amount: amountValue, token, networkFee, utxos }); + navigation.navigate('SendConfirmScreen', { address, amount: amountValue, token }); }; const isButtonDisabled = () => ( diff --git a/src/screens/SendConfirmScreen.js b/src/screens/SendConfirmScreen.js index a6dd7d3a2..10158d14e 100644 --- a/src/screens/SendConfirmScreen.js +++ b/src/screens/SendConfirmScreen.js @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import React, { useState } from 'react'; -import { View, Text, StyleSheet, TouchableOpacity, Linking } from 'react-native'; +import React, { useEffect, useState } from 'react'; +import { View, Text, StyleSheet, TouchableOpacity, Linking, Image } from 'react-native'; import { useSelector } from 'react-redux'; import { msgid, ngettext, t } from 'ttag'; import hathorLib, { TokenVersion } from '@hathor/wallet-lib'; @@ -18,6 +18,8 @@ import OfflineBar from '../components/OfflineBar'; import TextFmt from '../components/TextFmt'; import SendTransactionFeedbackModal from '../components/SendTransactionFeedbackModal'; import TooltipModal from '../components/TooltipModal'; +import FeedbackModal from '../components/FeedbackModal'; +import Spinner from '../components/Spinner'; import { renderValue, isTokenNFT } from '../utils'; import NavigationService from '../NavigationService'; import { useNavigation, useParams } from '../hooks/navigation'; @@ -25,6 +27,13 @@ import { COLORS } from '../styles/themes'; import { InfoCircleIcon } from '../components/Icons/InfoCircle'; import { CheckIcon } from '../components/Icons/Check.icon'; import { TOKEN_DEPOSIT_URL, TOKEN_FEES_URL } from '../constants'; +import errorIcon from '../assets/images/icErrorBig.png'; + +const PHASE = Object.freeze({ + BUILDING: 'building', + ERROR: 'error', + READY: 'ready', +}); function NoFee() { return ( @@ -35,6 +44,21 @@ function NoFee() { ); } +// Wallet-lib raises "No UTXOs available for the token ." when auto- +// selection can't cover the amount. HTR shortage gets its own message because, +// on FBT sends, it means insufficient HTR for the network fee. +function mapBuildError(err) { + const msg = err?.message || ''; + const htrUid = hathorLib.constants.NATIVE_TOKEN_UID; + if (msg.includes(`No UTXOs available for the token ${htrUid}`)) { + return t`Insufficient HTR to cover the network fee.`; + } + if (msg.includes('No UTXOs available for the token')) { + return t`Insufficient balance to send this transaction.`; + } + return msg || t`Failed to build transaction.`; +} + const SendConfirmScreen = () => { const tokensBalance = useSelector((state) => state.tokensBalance); const wallet = useSelector((state) => state.wallet); @@ -47,50 +71,87 @@ const SendConfirmScreen = () => { const params = useParams(); // Parse and store navigation params - const { amount, address, token, networkFee, utxos } = params; + const { amount, address, token } = params; const isNFT = isTokenNFT(token.uid, tokenMetadata); const amountAndToken = `${renderValue(amount, isNFT)} ${token.symbol}`; + const [phase, setPhase] = useState(PHASE.BUILDING); + const [sendTx, setSendTx] = useState(null); + const [buildError, setBuildError] = useState(null); const [modal, setModal] = useState(null); const [isTooltipShown, setIsTooltipShown] = useState(false); const nativeSymbol = hathorLib.constants.DEFAULT_NATIVE_TOKEN_CONFIG.symbol; + // Build the transaction on mount (without inputs — let the lib auto-select + // FBT and HTR UTXOs). This produces the exact fee the user will pay, which + // we then show on the review screen. + useEffect(() => { + let cancelled = false; + + (async () => { + try { + const outputs = [{ address, value: amount, token: token.uid }]; + const sendTransaction = useWalletService + ? new hathorLib.SendTransactionWalletService(wallet, { outputs }) + : new hathorLib.SendTransaction({ storage: wallet.storage, outputs }); + + await sendTransaction.run('prepare-tx'); + + if (cancelled) { + try { await sendTransaction.releaseUtxos(); } catch (e) { console.error(e); } + return; + } + + setSendTx(sendTransaction); + setPhase(PHASE.READY); + } catch (err) { + if (cancelled) return; + console.error(err); + setBuildError({ message: mapBuildError(err) }); + setPhase(PHASE.ERROR); + } + })(); + + return () => { cancelled = true; }; + }, []); + + // Release reserved UTXOs on unmount. Safe to call unconditionally: + // no-op if the tx was already broadcast (UTXOs already cleared from the + // selection map) and skipped if no tx was built. + useEffect(() => () => { + if (sendTx) { + sendTx.releaseUtxos().catch((err) => console.error(err)); + } + }, [sendTx]); + + const networkFee = phase === PHASE.READY && sendTx + ? (sendTx.transaction.getFeeHeader()?.entries?.[0]?.amount ?? 0n) + : null; + /** - * In case we can prepare the data, open send tx feedback modal (while sending the tx) - * Otherwise, show error + * Sign and broadcast the pre-built transaction. Failures transition + * the flow to PHASE.ERROR. * - * @param {String} pin User PIN already validated + * @param {string} pin Validated user PIN */ const executeSend = async (pin) => { - const outputs = [{ address, value: amount, token: token.uid }]; - const inputs = utxos - ? utxos.map(({ txId, index }) => ({ txId, index })) - : []; - let sendTransaction; - - if (useWalletService) { - await wallet.validateAndRenewAuthToken(pin); - - sendTransaction = new hathorLib.SendTransactionWalletService(wallet, { - outputs, - inputs, - pin, + try { + if (useWalletService) { + await wallet.validateAndRenewAuthToken(pin); + } + await wallet.signTx(sendTx.transaction, { pinCode: pin }); + const promise = sendTx.runFromMining(); + setModal({ + text: t`Your transfer is being processed`, + sendTransaction: sendTx, + promise, }); - } else { - sendTransaction = new hathorLib.SendTransaction( - { storage: wallet.storage, outputs, inputs, pin } - ); + } catch (err) { + console.error(err); + setBuildError({ message: mapBuildError(err) }); + setPhase(PHASE.ERROR); } - - const promise = sendTransaction.run(); - - // show loading modal - setModal({ - text: t`Your transfer is being processed`, - sendTransaction, - promise, - }); }; /** @@ -132,6 +193,10 @@ const SendConfirmScreen = () => { }, 500); }; + const dismissBuildError = () => { + navigation.goBack(); + }; + const getAvailableString = () => { const balance = tokensBalance[token.uid].data; const available = balance ? balance.available : 0; @@ -148,7 +213,6 @@ const SendConfirmScreen = () => { const handleTooltipLinkPress = () => { setIsTooltipShown(false); - // Navigate to external link if (token.version === TokenVersion.DEPOSIT) { // for deposit based tokens @@ -181,7 +245,7 @@ const SendConfirmScreen = () => { {renderValue(networkFee, false)} {nativeSymbol} - ) + ); } return ; }; @@ -194,6 +258,21 @@ const SendConfirmScreen = () => { onBackPress={() => navigation.goBack()} /> + {phase === PHASE.BUILDING && ( + } + /> + )} + + {phase === PHASE.ERROR && buildError && ( + } + onDismiss={dismissBuildError} + /> + )} + {modal && ( { onLinkPress={handleTooltipLinkPress} /> - - - - - - {getAvailableString()} - - - - {t`**Transaction summary**`} - - - {t`**To**`} - {address.substr(0, 7)}...{address.substr(-7)} - - - - {t`**Network Fee**`} - - - + {phase === PHASE.READY && ( + + + + + + {getAvailableString()} + + + + {t`**Transaction summary**`} + + + {t`**To**`} + {address.substr(0, 7)}...{address.substr(-7)} + + + + {t`**Network Fee**`} + + + + + {renderNetworkFeeValue()} + + + {t`**Total**`} + {`${amountAndToken}${networkFee ? ` + ${renderValue(networkFee, false)} ${nativeSymbol}` : ''}`} - {renderNetworkFeeValue()} - - - {t`**Total**`} - {`${amountAndToken}${networkFee ? ` + ${renderValue(networkFee, false)} ${nativeSymbol}` : ''}`} + - - + )} );