From bfd0e9921a8ba3cdb8023065914ca4679f39f166 Mon Sep 17 00:00:00 2001 From: mytonwalletorg Date: Fri, 13 Sep 2024 18:55:18 +0200 Subject: [PATCH] v3.0.13 --- changelogs/3.0.13.txt | 1 + package-lock.json | 4 +- package.json | 2 +- public/static-sites/go/index.html | 5 +- public/version.txt | 2 +- src/api/methods/auth.ts | 4 ++ src/api/methods/nfts.ts | 3 +- src/api/methods/polling.ts | 12 +++-- src/components/auth/AuthImportMnemonic.tsx | 4 +- src/components/explore/hooks/useDappBridge.ts | 18 +++++-- .../main/sections/Content/Token.module.scss | 2 +- src/components/settings/Settings.module.scss | 4 ++ src/components/settings/Settings.tsx | 2 +- src/components/transfer/TransferComplete.tsx | 9 +++- src/components/ui/PasswordForm.tsx | 8 ++- .../vesting/VestingModal.module.scss | 6 +-- src/config.ts | 1 + src/global/actions/api/auth.ts | 11 +++- src/global/actions/api/swap.ts | 2 + src/hooks/useVesting.ts | 2 +- src/styles/_variables.scss | 14 ++--- src/util/deeplink/index.ts | 13 +++++ src/util/ledger/index.ts | 54 ++++++++++++++----- 23 files changed, 134 insertions(+), 49 deletions(-) create mode 100644 changelogs/3.0.13.txt diff --git a/changelogs/3.0.13.txt b/changelogs/3.0.13.txt new file mode 100644 index 00000000..619f4cd5 --- /dev/null +++ b/changelogs/3.0.13.txt @@ -0,0 +1 @@ +Bug fixes and performance improvements diff --git a/package-lock.json b/package-lock.json index 5fd2f4fd..f66633ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mytonwallet", - "version": "3.0.12", + "version": "3.0.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mytonwallet", - "version": "3.0.12", + "version": "3.0.13", "license": "GPL-3.0-or-later", "dependencies": { "@awesome-cordova-plugins/core": "^6.6.0", diff --git a/package.json b/package.json index 383cc9e5..e371af4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mytonwallet", - "version": "3.0.12", + "version": "3.0.13", "description": "The most feature-rich web wallet and browser extension for TON – with support of multi-accounts, tokens (jettons), NFT, TON DNS, TON Sites, TON Proxy, and TON Magic.", "main": "index.js", "scripts": { diff --git a/public/static-sites/go/index.html b/public/static-sites/go/index.html index 4b6595a5..47dcd0a5 100644 --- a/public/static-sites/go/index.html +++ b/public/static-sites/go/index.html @@ -34,11 +34,12 @@

Open MyTonWallet

} = location; const redirectTo = `${pathname.slice(1)}${search}`; + const protocol = redirectTo.startsWith('transfer') ? 'ton://' : 'mtw://'; - document.getElementById('btn-sign-in').href = `mtw://${redirectTo}`; + document.getElementById('btn-sign-in').href = `${protocol}${redirectTo}`; if (!search?.includes('no-redirect')) { - location.href = `mtw://${redirectTo}`; + location.href = `${protocol}${redirectTo}`; history.replaceState({}, '', `${pathname}${search}${search ? '&' : '?'}no-redirect`); } diff --git a/public/version.txt b/public/version.txt index f93fc9f4..eea30e59 100644 --- a/public/version.txt +++ b/public/version.txt @@ -1 +1 @@ -3.0.12 +3.0.13 diff --git a/src/api/methods/auth.ts b/src/api/methods/auth.ts index 63b80b1a..3ae13b9e 100644 --- a/src/api/methods/auth.ts +++ b/src/api/methods/auth.ts @@ -150,10 +150,13 @@ export async function importNewWalletVersion(accountId: string, version: ApiWall const newAddress = publicKeyToAddress(network, publicKey, version); const newAccountId = await getNewAccountId(network); + + const ledger = account.ledger; const newAccount: ApiAccount = { address: newAddress, publicKey: account.publicKey, version, + ledger, }; await Promise.all([ @@ -166,6 +169,7 @@ export async function importNewWalletVersion(accountId: string, version: ApiWall return { accountId: newAccountId, address: newAddress, + ledger, }; } diff --git a/src/api/methods/nfts.ts b/src/api/methods/nfts.ts index 38174e05..b27a5533 100644 --- a/src/api/methods/nfts.ts +++ b/src/api/methods/nfts.ts @@ -93,10 +93,11 @@ export async function submitNftTransfers( createLocalTransaction(accountId, { amount: message.amount, fromAddress, - toAddress: message.toAddress, + toAddress, comment, fee, slug: TONCOIN_SLUG, + normalizedAddress: message.toAddress, inMsgHash: result.msgHash, type: 'nftTransferred', nft: nfts?.[i], diff --git a/src/api/methods/polling.ts b/src/api/methods/polling.ts index 5c3a5561..3e04c099 100644 --- a/src/api/methods/polling.ts +++ b/src/api/methods/polling.ts @@ -17,7 +17,9 @@ import type { OnApiUpdate, } from '../types'; -import { DEFAULT_PRICE_CURRENCY, POPULAR_WALLET_VERSIONS, TONCOIN_SLUG } from '../../config'; +import { + DEFAULT_PRICE_CURRENCY, LEDGER_WALLET_VERSIONS, POPULAR_WALLET_VERSIONS, TONCOIN_SLUG, +} from '../../config'; import { parseAccountId } from '../../util/account'; import { areDeepEqual } from '../../util/areDeepEqual'; import { compareActivities } from '../../util/compareActivities'; @@ -573,12 +575,13 @@ export async function setupWalletVersionsPolling(accountId: string) { const localOnUpdate = onUpdate; const { - address, publicKey, version, isInitialized, + address, publicKey, version, isInitialized, ledger, } = await fetchStoredAccount(accountId); const publicKeyBytes = hexToBytes(publicKey); const { network } = parseAccountId(accountId); - const versions = POPULAR_WALLET_VERSIONS.filter((value) => value !== version); + const walletVersions = ledger ? LEDGER_WALLET_VERSIONS : POPULAR_WALLET_VERSIONS; + const versions = walletVersions.filter((value) => value !== version); let lastResult: ApiWalletInfo[] | undefined; let shouldCheckV4 = false; @@ -588,6 +591,9 @@ export async function setupWalletVersionsPolling(accountId: string) { const { lastTxId } = await ton.getWalletInfo(network, address); shouldCheckV4 = !lastTxId; } + if (ledger) { + shouldCheckV4 = true; + } while (isAlive(localOnUpdate, accountId)) { try { diff --git a/src/components/auth/AuthImportMnemonic.tsx b/src/components/auth/AuthImportMnemonic.tsx index 7d09c13f..63ad5e45 100644 --- a/src/components/auth/AuthImportMnemonic.tsx +++ b/src/components/auth/AuthImportMnemonic.tsx @@ -118,12 +118,12 @@ const AuthImportMnemonic = ({ isActive, isLoading, error }: OwnProps & StateProp }); useEffect(() => { - return isSubmitDisabled + return isSubmitDisabled || isLoading ? undefined : captureKeyboardListeners({ onEnter: handleSubmit, }); - }, [afterImportMnemonic, handleSubmit, isSubmitDisabled, mnemonic]); + }, [afterImportMnemonic, handleSubmit, isLoading, isSubmitDisabled, mnemonic]); return (
diff --git a/src/components/explore/hooks/useDappBridge.ts b/src/components/explore/hooks/useDappBridge.ts index e7162e1d..d26f3fe6 100644 --- a/src/components/explore/hooks/useDappBridge.ts +++ b/src/components/explore/hooks/useDappBridge.ts @@ -1,11 +1,16 @@ import type { - AppRequest, ConnectEvent, - ConnectEventError, ConnectRequest, DeviceInfo, RpcMethod, WalletEvent, + AppRequest, + ConnectEvent, + ConnectEventError, + ConnectRequest, + DeviceInfo, + RpcMethod, + WalletEvent, WalletResponse, } from '@tonconnect/protocol'; import { BottomSheet } from 'native-bottom-sheet'; import { useMemo, useRef, useState } from '../../../lib/teact/teact'; -import { getGlobal } from '../../../global'; +import { getActions, getGlobal } from '../../../global'; import type { CustomInAppBrowserObject } from './useWebViewBridge'; import { CONNECT_EVENT_ERROR_CODES, SEND_TRANSACTION_ERROR_CODES } from '../../../api/tonConnect/types'; @@ -36,6 +41,8 @@ interface OwnProps { export function useDappBridge({ endpoint, }: OwnProps) { + const { openLoadingOverlay, closeLoadingOverlay } = getActions(); + // eslint-disable-next-line no-null/no-null const inAppBrowserRef = useRef(null); const [requestId, setRequestId] = useState(0); @@ -67,12 +74,17 @@ export function useDappBridge({ await BottomSheet.enable(); } + openLoadingOverlay(); + const response = await callApi( 'tonConnect_connect', buildDappRequest(origin), request, requestId, ); + + closeLoadingOverlay(); + if (IS_DELEGATING_BOTTOM_SHEET) { await BottomSheet.disable(); } diff --git a/src/components/main/sections/Content/Token.module.scss b/src/components/main/sections/Content/Token.module.scss index 42013fd0..b91abb1c 100644 --- a/src/components/main/sections/Content/Token.module.scss +++ b/src/components/main/sections/Content/Token.module.scss @@ -260,6 +260,6 @@ -webkit-text-fill-color: transparent; :global(.theme-dark) & { - background-image: linear-gradient(81.88deg, #44B5ED 19.42%, #2CD36F 71.55%); + background-image: linear-gradient(81.88deg, #58AFFF 19.42%, #2CD36F 71.55%); } } diff --git a/src/components/settings/Settings.module.scss b/src/components/settings/Settings.module.scss index b5c0ba13..bb01bae1 100644 --- a/src/components/settings/Settings.module.scss +++ b/src/components/settings/Settings.module.scss @@ -837,6 +837,10 @@ a.item:hover { color: var(--color-black); } +.walletVersionAddress { + white-space: nowrap; +} + .walletVersionAddress, .walletVersionAmount { font-size: 0.75rem; diff --git a/src/components/settings/Settings.tsx b/src/components/settings/Settings.tsx index c11846f6..7194a726 100644 --- a/src/components/settings/Settings.tsx +++ b/src/components/settings/Settings.tsx @@ -549,7 +549,7 @@ function Settings({
)} - {!!versions?.length && !isHardwareAccount && ( + {!!versions?.length && (
{lang('Wallet {lang('Wallet Versions')} diff --git a/src/components/transfer/TransferComplete.tsx b/src/components/transfer/TransferComplete.tsx index 1d296950..f96f0182 100644 --- a/src/components/transfer/TransferComplete.tsx +++ b/src/components/transfer/TransferComplete.tsx @@ -1,10 +1,11 @@ -import React, { memo } from '../../lib/teact/teact'; +import React, { memo, useEffect } from '../../lib/teact/teact'; import { getActions } from '../../global'; import type { ApiNft } from '../../api/types'; import { TONCOIN_SLUG } from '../../config'; import buildClassName from '../../util/buildClassName'; +import captureKeyboardListeners from '../../util/captureKeyboardListeners'; import { ANIMATED_STICKERS_PATHS } from '../ui/helpers/animatedAssets'; import { useDeviceScreen } from '../../hooks/useDeviceScreen'; @@ -68,6 +69,12 @@ function TransferComplete({ onBack: onClose, }); + useEffect(() => { + return isActive + ? captureKeyboardListeners({ onEnter: onClose }) + : undefined; + }, [isActive, onClose]); + const handleTransactionRepeatClick = useLastCallback(() => { startTransfer({ isPortrait, diff --git a/src/components/ui/PasswordForm.tsx b/src/components/ui/PasswordForm.tsx index 6e7275fb..112cc23b 100644 --- a/src/components/ui/PasswordForm.tsx +++ b/src/components/ui/PasswordForm.tsx @@ -142,12 +142,10 @@ function PasswordForm({ }); useEffect(() => { - return isSubmitDisabled + return isSubmitDisabled || isLoading ? undefined - : captureKeyboardListeners({ - onEnter: handleSubmit, - }); - }, [handleSubmit, isSubmitDisabled]); + : captureKeyboardListeners({ onEnter: handleSubmit }); + }, [handleSubmit, isLoading, isSubmitDisabled]); function getPinPadTitle() { switch (operationType) { diff --git a/src/components/vesting/VestingModal.module.scss b/src/components/vesting/VestingModal.module.scss index 8bba593e..bccd96d9 100644 --- a/src/components/vesting/VestingModal.module.scss +++ b/src/components/vesting/VestingModal.module.scss @@ -84,7 +84,7 @@ -webkit-text-fill-color: transparent; :global(.theme-dark) & { - background: linear-gradient(81.88deg, #44B5ED 19.42%, #2CD36F 71.55%); + background: linear-gradient(81.88deg, #58AFFF 19.42%, #2CD36F 71.55%); background-clip: text; -webkit-text-fill-color: transparent; @@ -294,7 +294,7 @@ background-size: 100%; :global(.theme-dark) & { - background-image: linear-gradient(81.88deg, #0C9EE8 19.42%, #2CD36F 71.55%); + background-image: linear-gradient(81.88deg, #469CEC 19.42%, #2CD36F 71.55%); } } } @@ -326,7 +326,7 @@ background-size: 100%; :global(.theme-dark) & { - background-image: linear-gradient(81.88deg, #0C9EE8 19.42%, #2CD36F 71.55%); + background-image: linear-gradient(81.88deg, #469CEC 19.42%, #2CD36F 71.55%); } } } diff --git a/src/config.ts b/src/config.ts index 02bd7e5c..64ad2fb4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -291,6 +291,7 @@ export const BURN_ADDRESS = 'UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ'; export const DEFAULT_WALLET_VERSION: ApiWalletVersion = 'W5'; export const POPULAR_WALLET_VERSIONS: ApiWalletVersion[] = ['v3R1', 'v3R2', 'v4R2', 'W5']; +export const LEDGER_WALLET_VERSIONS: ApiWalletVersion[] = ['v3R2', 'v4R2']; export const DEFAULT_TIMEOUT = 10000; export const DEFAULT_RETRIES = 3; diff --git a/src/global/actions/api/auth.ts b/src/global/actions/api/auth.ts index 3aac1937..b446b656 100644 --- a/src/global/actions/api/auth.ts +++ b/src/global/actions/api/auth.ts @@ -1016,7 +1016,16 @@ addActionHandler('importAccountByVersion', async (global, actions, { version }) const { title: currentWalletTitle } = (global.accounts?.byId ?? {})[accountId]; global = updateCurrentAccountId(global, wallet!.accountId); - global = createAccount(global, wallet!.accountId, wallet!.address, { title: currentWalletTitle }, version); + + const ledgerInfo = wallet!.ledger ? { + isHardware: true, + ledger: wallet?.ledger, + } : undefined; + + global = createAccount(global, wallet!.accountId, wallet!.address, { + title: currentWalletTitle, + ...ledgerInfo, + }, version); setGlobal(global); }); diff --git a/src/global/actions/api/swap.ts b/src/global/actions/api/swap.ts index ae61e94d..18711302 100644 --- a/src/global/actions/api/swap.ts +++ b/src/global/actions/api/swap.ts @@ -183,7 +183,9 @@ addActionHandler('cancelSwap', (global, actions, { shouldReset } = {}) => { swapFee: '0', networkFee: 0, realNetworkFee: 0, + amountIn: '0', amountOutMin: '0', + amountOut: '0', inputSource: SwapInputSource.In, swapType, pairs, diff --git a/src/hooks/useVesting.ts b/src/hooks/useVesting.ts index 092d6138..1a577a9d 100644 --- a/src/hooks/useVesting.ts +++ b/src/hooks/useVesting.ts @@ -43,7 +43,7 @@ export default function useVesting({ vesting, userMycoin }: { vesting?: ApiVesti const { shouldRender, transitionClassNames, - } = useShowTransition(Boolean(hasVesting && isMycoinLoaded && userMycoin)); + } = useShowTransition(Boolean(hasVesting && isMycoinLoaded && userMycoin && amount !== '0')); const onVestingTokenClick = useLastCallback(() => { openVestingModal(); diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss index 9d0370cb..8e6f90a4 100644 --- a/src/styles/_variables.scss +++ b/src/styles/_variables.scss @@ -209,7 +209,7 @@ &:global(.theme-dark), :global(.component-theme-dark) { - --color-blue: #0C9EE8; + --color-blue: #469CEC; --color-black: #DCEEFF; --color-gray-1: #A3B8CA; --color-gray-2: #8799B3; @@ -219,7 +219,7 @@ --color-green-2: #79A28B; --color-purple-1: #95A0FE; --color-purple-2: #7986F7; - --color-blue-10o: #0C9EE81A; + --color-blue-10o: #469CEC1A; --color-background-first: #1E2732; --color-background-first-disabled: #1A2129; @@ -236,8 +236,8 @@ --color-input-hint: #435362; - --color-blue-button-background: #0C9EE8; - --color-blue-button-background-hover: #39BAFB; + --color-blue-button-background: #469CEC; + --color-blue-button-background-hover: #51A7F7; --color-red-button-background: #D74A4A; --color-red-button-background-hover: #F35B5B; @@ -317,9 +317,9 @@ --color-background-blue-second: #133950; --color-vesting-close-background: #124B6B; --color-vesting-close-background-hover: #105F89; - --color-vesting-blue: #0C9EE8; - --color-vesting-blue-hover: #28AAEA; - --color-vesting-text: #34B5F6; + --color-vesting-blue: #469CEC; + --color-vesting-blue-hover: #51A7F7; + --color-vesting-text: #58AFFF; --color-vesting-background: #115073; } } diff --git a/src/util/deeplink/index.ts b/src/util/deeplink/index.ts index 9db67c0f..b7a526e5 100644 --- a/src/util/deeplink/index.ts +++ b/src/util/deeplink/index.ts @@ -37,6 +37,7 @@ enum DeeplinkCommand { BuyWithCrypto = 'buy-with-crypto', BuyWithCard = 'buy-with-card', Stake = 'stake', + Transfer = 'transfer', } let urlAfterSignIn: string | undefined; @@ -286,6 +287,18 @@ export function processSelfDeeplink(deeplink: string) { } break; } + + case DeeplinkCommand.Transfer: { + let tonDeeplink = deeplink; + SELF_UNIVERSAL_URLS.forEach((prefix) => { + if (tonDeeplink.startsWith(prefix)) { + tonDeeplink = tonDeeplink.replace(prefix, TON_PROTOCOL); + } + }); + + processTonDeeplink(tonDeeplink); + break; + } } } catch (err) { logDebugError('processSelfDeeplink', err); diff --git a/src/util/ledger/index.ts b/src/util/ledger/index.ts index 5e7b38e8..d9814f46 100644 --- a/src/util/ledger/index.ts +++ b/src/util/ledger/index.ts @@ -73,9 +73,15 @@ type TransactionParams = { }; }; +export type PossibleWalletVersion = 'v3R2' | 'v4R2'; + +enum LedgerWalletVersion { + v3R2 = 'v3r2', + v4R2 = 'v4', +} + const CHAIN = 0; // workchain === -1 ? 255 : 0; -const WALLET_VERSION = 'v4R2'; -const INTERNAL_WALLET_VERSION = 'v4'; +const DEFAULT_WALLET_VERSION = 'v3R2'; const ATTEMPTS = 10; const PAUSE = 125; const IS_BOUNCEABLE = false; @@ -90,6 +96,10 @@ const knownJettonAddresses = KNOWN_JETTONS.map( let transport: TransportWebHID | TransportWebUSB | undefined; let tonTransport: TonTransport | undefined; +function getInternalWalletVersion(version: PossibleWalletVersion) { + return LedgerWalletVersion[version]; +} + export async function importLedgerWallet(network: ApiNetwork, accountIndex: number) { const walletInfo = await getLedgerWalletInfo(network, accountIndex); return callApi('importLedgerWallet', network, walletInfo); @@ -142,7 +152,7 @@ export async function checkTonApp() { // Workaround for Ledger S, this is a way to check if it is unlocked. // There will be an error with code 0x530c await tonTransport?.getAddress(getLedgerAccountPathByIndex(0), { - walletVersion: INTERNAL_WALLET_VERSION, + walletVersion: LedgerWalletVersion.v3R2, }); return true; @@ -318,10 +328,11 @@ export async function submitLedgerTransfer( const fromAddress = await callApi('fetchAddress', accountId); - const [path, walletInfo, appInfo] = await Promise.all([ + const [path, walletInfo, appInfo, accountInfo] = await Promise.all([ getLedgerAccountPath(accountId), callApi('getWalletInfo', network, fromAddress!), getTonAppInfo(), + callApi('fetchAccount', accountId), ]); const { seqno, balance } = walletInfo!; @@ -361,6 +372,8 @@ export async function submitLedgerTransfer( ? SendMode.CARRY_ALL_REMAINING_BALANCE : SendMode.PAY_GAS_SEPARATELY + SendMode.IGNORE_ERRORS; + const walletSpecifiers = accountInfo!.version === 'v3R2' ? { includeWalletOp: false } : undefined; + try { const signedCell = await tonTransport!.signTransaction(path, { to: Address.parse(toAddress), @@ -370,6 +383,7 @@ export async function submitLedgerTransfer( bounce: isBounceable, amount: BigInt(amount), payload, + walletSpecifiers, }); const message: ApiSignedTransfer = { @@ -413,10 +427,11 @@ export async function submitLedgerNftTransfer(options: { const fromAddress = await callApi('fetchAddress', accountId); - const [path, walletInfo, appInfo] = await Promise.all([ + const [path, walletInfo, appInfo, accountInfo] = await Promise.all([ getLedgerAccountPath(accountId), callApi('getWalletInfo', network, fromAddress!), getTonAppInfo(), + callApi('fetchAccount', accountId), ]); if (!appInfo.isUnsafeSupported) { @@ -440,6 +455,8 @@ export async function submitLedgerNftTransfer(options: { forwardPayload = buildCommentPayload(comment); } + const walletSpecifiers = accountInfo!.version === 'v3R2' ? { includeWalletOp: false } : undefined; + try { const signedCell = await tonTransport!.signTransaction(path, { to: Address.parse(nftAddress), @@ -458,6 +475,7 @@ export async function submitLedgerNftTransfer(options: { forwardAmount, forwardPayload, }, + walletSpecifiers, }); const message: ApiSignedTransfer = { @@ -556,11 +574,12 @@ export async function signLedgerTransactions(accountId: string, messages: ApiDap await callApi('waitLastTransfer', accountId); - const [path, fromAddress, appInfo] = await Promise.all([ + const [path, appInfo, accountInfo] = await Promise.all([ getLedgerAccountPath(accountId), - callApi('fetchAddress', accountId), getTonAppInfo(), + callApi('fetchAccount', accountId), ]); + const fromAddress = accountInfo!.address; const { isUnsafeSupported, isJettonIdSupported } = appInfo; @@ -569,9 +588,13 @@ export async function signLedgerTransactions(accountId: string, messages: ApiDap } const seqno = await callApi('getWalletSeqno', accountId, vestingAddress); - const walletSpecifiers: TransactionParams['walletSpecifiers'] = vestingAddress - ? { subwalletId: VESTING_SUBWALLET_ID, includeWalletOp: false } - : undefined; + let walletSpecifiers: TransactionParams['walletSpecifiers']; + if (accountInfo!.version === 'v3R2') { + walletSpecifiers = { includeWalletOp: false }; + } + if (vestingAddress) { + walletSpecifiers = { subwalletId: VESTING_SUBWALLET_ID, includeWalletOp: false }; + } const preparedParams: TransactionParams[] = await Promise.all(messages.map(async (message, index) => { const { @@ -706,7 +729,7 @@ export async function getLedgerWalletInfo(network: ApiNetwork, accountIndex: num address, publicKey: publicKey!.toString('hex'), balance, - version: WALLET_VERSION, + version: DEFAULT_WALLET_VERSION, driver: 'HID', deviceId: transport!.deviceModel?.id, deviceName: transport!.deviceModel?.productName, @@ -719,16 +742,19 @@ export function getLedgerWalletAddress(index: number, isTestnet?: boolean) { return tonTransport!.getAddress(path, { chain: CHAIN, bounceable: WALLET_IS_BOUNCEABLE, - walletVersion: INTERNAL_WALLET_VERSION, + walletVersion: LedgerWalletVersion.v3R2, }); } export async function verifyAddress(accountId: string) { - const path = await getLedgerAccountPath(accountId); + const [accountInfo, path] = await Promise.all([ + callApi('fetchAccount', accountId), + getLedgerAccountPath(accountId), + ]); await tonTransport!.validateAddress(path, { bounceable: IS_BOUNCEABLE, - walletVersion: INTERNAL_WALLET_VERSION, + walletVersion: getInternalWalletVersion(accountInfo!.version as PossibleWalletVersion), }); }