From 4da3abcf5f963f2d3cca62db76a8144e2ec97460 Mon Sep 17 00:00:00 2001 From: Max Voloshinskii Date: Tue, 12 Mar 2024 17:06:34 +0300 Subject: [PATCH 01/11] fix(mobile): DNS as name for watch-only account (#760) --- packages/mobile/src/core/AddWatchOnly/AddWatchOnly.tsx | 5 ++++- packages/mobile/src/wallet/Tonkeeper.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/mobile/src/core/AddWatchOnly/AddWatchOnly.tsx b/packages/mobile/src/core/AddWatchOnly/AddWatchOnly.tsx index a88c22da5..971956831 100644 --- a/packages/mobile/src/core/AddWatchOnly/AddWatchOnly.tsx +++ b/packages/mobile/src/core/AddWatchOnly/AddWatchOnly.tsx @@ -129,7 +129,10 @@ export const AddWatchOnly: FC = () => { setLoading(true); try { - const identifiers = await tk.addWatchOnlyWallet(account.address); + const identifiers = await tk.addWatchOnlyWallet( + account.address, + account.domain ? account.domain.split('.')[0] : undefined, + ); const isNotificationsDenied = await tk.wallet.notifications.getIsDenied(); if (isNotificationsDenied) { diff --git a/packages/mobile/src/wallet/Tonkeeper.ts b/packages/mobile/src/wallet/Tonkeeper.ts index 1fe5a8834..2b2d8d1b4 100644 --- a/packages/mobile/src/wallet/Tonkeeper.ts +++ b/packages/mobile/src/wallet/Tonkeeper.ts @@ -302,7 +302,7 @@ export class Tonkeeper { }); } - public async addWatchOnlyWallet(address: string) { + public async addWatchOnlyWallet(address: string, name?: string) { const rawAddress = Address.parse(address).toRaw(); const { public_key: pubkey } = await this.tonapi.mainnet.accounts.getAccountPublicKey( rawAddress, @@ -325,7 +325,7 @@ export class Tonkeeper { const config: WalletConfig = { ...DEFAULT_WALLET_STYLE_CONFIG, - name: this.getNewWalletName(), + name: name ?? this.getNewWalletName(), identifier: uuidv4(), network: WalletNetwork.mainnet, type: WalletType.WatchOnly, From 92ca6be8e0d78029d39a28dfe68afbb11556a6d0 Mon Sep 17 00:00:00 2001 From: Andrey Sorokin Date: Tue, 12 Mar 2024 18:25:27 +0000 Subject: [PATCH 02/11] feat(mobile): add swap host to dev menu (#761) --- packages/mobile/src/core/DevMenu/DevConfigScreen.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/mobile/src/core/DevMenu/DevConfigScreen.tsx b/packages/mobile/src/core/DevMenu/DevConfigScreen.tsx index 0a8f0a937..79a539a0b 100644 --- a/packages/mobile/src/core/DevMenu/DevConfigScreen.tsx +++ b/packages/mobile/src/core/DevMenu/DevConfigScreen.tsx @@ -56,6 +56,18 @@ export const DevConfigScreen = memo(() => { }) } /> + + nav.navigate('/dev/config/edit', { + configKey: 'stonfiUrl', + title: 'Swap host', + onSave: handleSave, + }) + } + /> Date: Wed, 13 Mar 2024 14:04:45 +0300 Subject: [PATCH 03/11] fix(mobile): Avoid update cache by adding query param (#767) --- packages/mobile/src/store/zustand/updates/useUpdatesStore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mobile/src/store/zustand/updates/useUpdatesStore.ts b/packages/mobile/src/store/zustand/updates/useUpdatesStore.ts index c100f98d5..e95784ccd 100644 --- a/packages/mobile/src/store/zustand/updates/useUpdatesStore.ts +++ b/packages/mobile/src/store/zustand/updates/useUpdatesStore.ts @@ -45,8 +45,9 @@ export const useUpdatesStore = create( } }, startUpdate: async () => { + const state = getState(); let download = RNFS.downloadFile({ - fromUrl: 'https://data2.ton.app/apk/tonkeeper.apk', + fromUrl: `https://data2.ton.app/apk/tonkeeper.apk?requestVersion=${state.meta?.version}`, toFile: getUpdatePath(), progress: (res) => { set({ From 3cdcdb4e1b34c20a77830beb1f840053430d37e4 Mon Sep 17 00:00:00 2001 From: Andrey Sorokin Date: Wed, 13 Mar 2024 14:40:32 +0000 Subject: [PATCH 04/11] fix(mobile): fix seed phrase on small displays --- .../BackupPhraseScreen/BackupPhraseScreen.tsx | 77 +++++++++---------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/packages/mobile/src/screens/BackupPhraseScreen/BackupPhraseScreen.tsx b/packages/mobile/src/screens/BackupPhraseScreen/BackupPhraseScreen.tsx index 0b03553ec..9b56fb282 100644 --- a/packages/mobile/src/screens/BackupPhraseScreen/BackupPhraseScreen.tsx +++ b/packages/mobile/src/screens/BackupPhraseScreen/BackupPhraseScreen.tsx @@ -41,43 +41,45 @@ export const BackupPhraseScreen = memo(() => { return ( - - - {t('recovery_phrase.title')} - - - - {t('recovery_phrase.caption')} - - + + + + {t('recovery_phrase.title')} + + + + {t('recovery_phrase.caption')} + + - - - - {leftColumn.map((word, index) => ( - - - {index + 1}. - - {word} - - ))} - - - {rightColumn.map((word, index) => ( - - - {index + 1 + 12}. - - {word} - - ))} + + + + {leftColumn.map((word, index) => ( + + + {index + 1}. + + {word} + + ))} + + + {rightColumn.map((word, index) => ( + + + {index + 1 + 12}. + + {word} + + ))} + - - - + + + {lastBackupAt !== null && !params.isBackupAgain ? (