Skip to content

Commit

Permalink
fix(HW-599): incorrect tokens for swap
Browse files Browse the repository at this point in the history
  • Loading branch information
iGroza committed Aug 16, 2024
1 parent 46d6acf commit ca04316
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 80 deletions.
4 changes: 3 additions & 1 deletion assets/locales/ar/ar.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"StakingInfoUnDelegationDay": " ({{day}} يوم متبقي)",
"StakingInfoUnDelegationDays": " (بقي {{days}} يوم)",
"_hash": "c7dc5902b8286a71bd492f0ceaba03d160640abf0bd7feea09cb81cf6fd9583a",
"_hash": "68c7aeb851f24ae0469422cf14a75b6816e56bdbe7fe6c11e7a2080ef9f02542",
"accept": "قبول",
"accountInfoNftTabTitle": "NFTs",
"accountInfoTokensTabTitle": "الرموز المميزة",
Expand Down Expand Up @@ -351,6 +351,7 @@
"no": "لا",
"noInternetPopupDescription": "تأكد من أنك متصل بشبكة Wi-Fi أو شبكة خلوية",
"noInternetPopupTitle": "لا يوجد إنترنت",
"noSwapRoutesFound": "لم يتم العثور على مسارات المبادلة، يرجى تجربة شبكة بلوكتشين أخرى",
"noTokens": "لا توجد رموز مميزة",
"notEnoughGasDescription": "في الوقت الحالي, تتطلب المعاملة **{{gasLimit}}**, ولكن **ليس لديك سوى {{currentAmount}}** في حسابك.",
"notEnoughGasDescription1": "حاليًا, معاملة",
Expand Down Expand Up @@ -744,6 +745,7 @@
"sumAmountTooLow": "يجب أن يكون مساويًا أو أكبر من {{amount}}",
"sumBlockAvailable": "متاح",
"sumBlockMax": "الحد الأقصى",
"swapSupportedNetworks": "الشبكات (مع دعم المبادلة الأصلي)",
"termsAgreementFirst": "بالنقر على موافقة, فإنك توافق على",
"termsAgreementSecond": " و",
"termsOfService": "شروط الخدمة",
Expand Down
4 changes: 3 additions & 1 deletion assets/locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"StakingInfoUnDelegationDay": " ({{day}} day left)",
"StakingInfoUnDelegationDays": " ({{days}} days left)",
"Welcome_haqq_pin": "Welcome to HAQQ Wallet",
"_hash": "fd73aced8b5e070cb2eafe5958aeec977ed37e96628fd0ab056d99cec4e542c8",
"_hash": "4fd37808dc9c0b8dd789da69c848b4957dced3343710c86f8f4034e11cd9c06e",
"accept": "Accept",
"accountInfoNftTabTitle": "NFTs",
"accountInfoTokensTabTitle": "Tokens",
Expand Down Expand Up @@ -390,6 +390,7 @@
"no": "No",
"noInternetPopupDescription": "Make sure you are connected to Wi-Fi or a cellular network",
"noInternetPopupTitle": "No Internet",
"noSwapRoutesFound": "No swap routes found, please try a different blockchain network.",
"noTokens": "No Tokens",
"notEnoughGasDescription": "Currently, a transaction **requires {{gasLimit}}**, but **you only have {{currentAmount}}** on your account.",
"notEnoughGasDescription1": "Currently, a transaction ",
Expand Down Expand Up @@ -821,6 +822,7 @@
"swapSettingsSlippageLabel": "Slippage Tolerance (%)",
"swapSettingsSlippagePlaceholder": "from 0.05% to 50%",
"swapSettingsSlippageWarning": "Your transaction may be frontrun due to high slippage tolerance",
"swapSupportedNetworks": "Networks (with native swap support)",
"swapTransactionSettingsTitle": "Transaction setting",
"swapWidgetDescription": "Haqq wallet finds the best price for your token swap",
"swapWidgetTitle": "Swap tokens",
Expand Down
4 changes: 3 additions & 1 deletion assets/locales/ru/ru.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"StakingInfoUnDelegationDay": " ({{day}} день остался)",
"StakingInfoUnDelegationDays": " ({{days}} дней осталось)",
"_hash": "ecc3fde1ff572bdd3b4058c9b7d45556085b2190592b6dc0b9624e40108324c8",
"_hash": "e1781c9b1fc0e6483d4eb504c9d2746470c5e35be033966652dc20b37db38068",
"accept": "Принять",
"accountInfoTokensTabTitle": "Токены",
"accountInfoTransactionTabTitle": "Транзакции",
Expand Down Expand Up @@ -65,6 +65,7 @@
"modalRewardErrorTitle": "Что-то пошло не так",
"moreAbout": "Подробнее",
"nftDetailsTokenId": "Идентификатор токена",
"noSwapRoutesFound": "Не найдено swap маршрутов, попробуйте другую блокчейн сеть.",
"numericKeyboard0": "0",
"numericKeyboard1": "1",
"numericKeyboard2": "2",
Expand Down Expand Up @@ -96,6 +97,7 @@
"stakingUnDelegateFormCommission": "Комиссия",
"stakingUnDelegatePreviewCommission": "Комиссия",
"stakingValidators": "Список валидаторов",
"swapSupportedNetworks": "Сети (с поддержкой native swap)",
"transactionInfoFunctionValue": "Сумма токена",
"walletCardConnectedApps": "{{count}} подключиться",
"walletCardFullProtection": "Защищено",
Expand Down
4 changes: 3 additions & 1 deletion assets/locales/tr/tr.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"StakingInfoUnDelegationDay": "({{day}} gün kaldı)",
"StakingInfoUnDelegationDays": "({{days}} gün kaldı)",
"_hash": "834be9031dde29f83fcf4d8457b3a1e6b0e21ddb6f85314cc43299b7cd2dad9e",
"_hash": "4c02ced14897d67e089d85a38662dfd9f4601080706f3828592d2b81c81012c1",
"accept": "Kabul Et",
"accountInfoNftTabTitle": "NFT’ler",
"accountInfoTokensTabTitle": "Tokenlar",
Expand Down Expand Up @@ -371,6 +371,7 @@
"no": "Hayır",
"noInternetPopupDescription": "Wi-Fi veya hücresel ağa bağlı olduğunuzdan emin olun",
"noInternetPopupTitle": "İnternet yok",
"noSwapRoutesFound": "Swap yolları bulunamadı, lütfen başka bir blockchain ağı deneyin.",
"noTokens": "Token Yok",
"notEnoughGasDescription": "Şu anda, bir işlem **{{gasLimit}} gerektiriyor**, ancak **hesabınızda yalnızca {{currentAmount}} mevcut**.",
"notEnoughGasDescription1": "Şu anda, bir işlem ",
Expand Down Expand Up @@ -774,6 +775,7 @@
"sumBlockAvailable": "Mevcut",
"sumBlockMax": "Maks",
"swapSettingsApply": "Uygula",
"swapSupportedNetworks": "Ağlar (yerel swap desteği ile)",
"swapWidgetDescription": "Haqq cüzdan, token değişiminiz için en iyi fiyatı bulur",
"swapWidgetTitle": "Tokenları değiştir",
"termsAgreementFirst": "Bu düğmelere tıklayarak kabul edersiniz ",
Expand Down
8 changes: 4 additions & 4 deletions src/components/swap/swap-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {createTheme} from '@app/helpers';
import {useSumAmount} from '@app/hooks';
import {I18N} from '@app/i18n';
import {Balance} from '@app/services/balance';
import {IContract} from '@app/types';
import {IToken} from '@app/types';

import {ImageWrapper} from '../image-wrapper';
import {
Expand All @@ -26,7 +26,7 @@ import {
import {Placeholder} from '../ui/placeholder';

export type SwapInputProps = {
token: IContract;
token: IToken;
currentBalance: Balance;
availableBalance: Balance;
amounts: ReturnType<typeof useSumAmount>;
Expand Down Expand Up @@ -97,10 +97,10 @@ export const SwapInput = observer(
style={styles.cryptoBlock}
onPress={onPressChangeToken}>
<View style={styles.cryptoBlockWrapper}>
{!!token.icon && (
{!!token.image && (
<ImageWrapper
style={styles.cryptoBlockImage}
source={token.icon}
source={token.image}
/>
)}
<Text
Expand Down
6 changes: 3 additions & 3 deletions src/components/swap/swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
SushiPoolResponse,
SushiRoute,
} from '@app/services/indexer';
import {IContract} from '@app/types';
import {IToken} from '@app/types';
import {formatNumberString} from '@app/utils';
import {STRINGS} from '@app/variables/common';

Expand Down Expand Up @@ -47,8 +47,8 @@ export interface SwapProps {
currentWallet: Wallet;
poolData: SushiPoolResponse;
estimateData: SushiPoolEstimateResponse | null;
tokenIn: IContract;
tokenOut: IContract;
tokenIn: IToken;
tokenOut: IToken;
amountsIn: ReturnType<typeof useSumAmount>;
amountsOut: ReturnType<typeof useSumAmount>;
isEstimating: boolean;
Expand Down
4 changes: 0 additions & 4 deletions src/helpers/address-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,3 @@ export class AddressUtils {
export const NATIVE_TOKEN_ADDRESS = AddressUtils.toEth(
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
);

export const WRAPPED_TOKEN_ADDRESS = AddressUtils.toEth(
'0xeC8CC083787c6e5218D86f9FF5f28d4cC377Ac54',
);
2 changes: 2 additions & 0 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,8 @@ export enum I18N {
I18N = 'I18N',
feeSettingsExpectedFee = 'feeSettingsExpectedFee',
transactionNetwork = 'transactionNetwork',
noSwapRoutesFound = 'noSwapRoutesFound',
swapSupportedNetworks = 'swapSupportedNetworks',
}

const defaultTranslation = {en};
Expand Down
Loading

0 comments on commit ca04316

Please sign in to comment.