@tonconnect/ui 2.4.0-beta.0 → 2.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { WalletInfoInjectable, WalletInfoRemote, RequiredFeatures, VersionEvent, ConnectionEvent, ConnectionRestoringEvent, DisconnectionEvent, TransactionSigningEvent, DataSigningEvent, WalletModalOpenedEvent, SelectedWalletEvent, EventDispatcher, SdkActionEvent, ITonConnect, Wallet, OptionalTraceable, FeatureName, WalletInfo, Account, ConnectAdditionalRequest, TonConnectError, SendTransactionRequest, SendTransactionResponse, SignDataPayload, SignDataResponse } from '@tonconnect/sdk';
1
+ import { WalletInfoInjectable, WalletInfoRemote, RequiredFeatures, VersionEvent, ConnectionEvent, ConnectionRestoringEvent, DisconnectionEvent, TransactionSigningEvent, DataSigningEvent, WalletModalOpenedEvent, SelectedWalletEvent, EventDispatcher, SdkActionEvent, ITonConnect, WalletInfoBase, Wallet, OptionalTraceable, FeatureName, WalletInfo, Account, ConnectAdditionalRequest, ChainId, TonConnectError, SendTransactionRequest, SendTransactionResponse, SignDataPayload, SignDataResponse } from '@tonconnect/sdk';
2
2
  export * from '@tonconnect/sdk';
3
3
  import { Property } from 'csstype';
4
4
 
@@ -214,10 +214,13 @@ interface TonConnectUiCreateOptionsBase extends TonConnectUiOptions {
214
214
  }
215
215
 
216
216
  type WalletOpenMethod = 'qrcode' | 'universal-link' | 'custom-deeplink';
217
- type WalletInfoWithOpenMethod = WalletInfoInjectable | WalletInfoRemoteWithOpenMethod | (WalletInfoInjectable & WalletInfoRemoteWithOpenMethod);
217
+ type WalletInfoWithOpenMethod = WalletInfoInjectable | WalletInfoRemoteWithOpenMethod | WalletInfoWalletConnect | (WalletInfoInjectable & WalletInfoRemoteWithOpenMethod);
218
218
  type WalletInfoRemoteWithOpenMethod = WalletInfoRemote & {
219
219
  openMethod?: WalletOpenMethod;
220
220
  };
221
+ type WalletInfoWalletConnect = WalletInfoBase & {
222
+ type: 'wallet-connect';
223
+ };
221
224
  type ConnectedWallet = Wallet & WalletInfoWithOpenMethod;
222
225
 
223
226
  type Loadable<T> = LoadableLoading | LoadableReady<T>;
@@ -404,6 +407,12 @@ declare class TonConnectUI {
404
407
  * If `connectRequestParameters.state` was changed to 'ready' or it's value has been changed, QR will be re-rendered.
405
408
  */
406
409
  setConnectRequestParameters(connectRequestParameters: Loadable<ConnectAdditionalRequest> | undefined | null): void;
410
+ /**
411
+ * Set desired network for the connection. Can only be set before connecting.
412
+ * If wallet connects with a different chain, the SDK will throw an error and abort connection.
413
+ * @param network desired network id (e.g., '-239', '-3', or custom). Pass undefined to allow any network.
414
+ */
415
+ setConnectionNetwork(network?: ChainId): void;
407
416
  /**
408
417
  * Returns available wallets list.
409
418
  */
@@ -550,4 +559,4 @@ declare class TonConnectUIError extends TonConnectError {
550
559
  }
551
560
 
552
561
  export { THEME, TonConnectUI, TonConnectUIError };
553
- export type { ActionConfiguration, BorderRadius, Color, ColorsSet, ConnectedWallet, Loadable, LoadableLoading, LoadableReady, Locales, PartialColorsSet, ReturnStrategy, Theme, TonConnectUiCreateOptions, TonConnectUiCreateOptionsBase, TonConnectUiOptions, TonConnectUiOptionsWithConnector, TonConnectUiOptionsWithManifest, UIPreferences, UIWallet, UserActionEvent, WalletInfoRemoteWithOpenMethod, WalletInfoWithOpenMethod, WalletModalClosed, WalletModalOpened, WalletOpenMethod, WalletsListConfiguration, WalletsModal, WalletsModalCloseReason, WalletsModalState };
562
+ export type { ActionConfiguration, BorderRadius, Color, ColorsSet, ConnectedWallet, Loadable, LoadableLoading, LoadableReady, Locales, PartialColorsSet, ReturnStrategy, Theme, TonConnectUiCreateOptions, TonConnectUiCreateOptionsBase, TonConnectUiOptions, TonConnectUiOptionsWithConnector, TonConnectUiOptionsWithManifest, UIPreferences, UIWallet, UserActionEvent, WalletInfoRemoteWithOpenMethod, WalletInfoWalletConnect, WalletInfoWithOpenMethod, WalletModalClosed, WalletModalOpened, WalletOpenMethod, WalletsListConfiguration, WalletsModal, WalletsModalCloseReason, WalletsModalState };
package/lib/index.mjs CHANGED
@@ -50,7 +50,7 @@ var __async = (__this, __arguments, generator) => {
50
50
  });
51
51
  };
52
52
  var _a, _b, _c, _d, _e, _f, _g, _h;
53
- import { TonConnectError, isWalletInfoCurrentlyInjected, toUserFriendlyAddress, CHAIN, TonConnect, isTelegramUrl, decodeTelegramUrlParameters, encodeTelegramUrlParameters, WalletMissingRequiredFeaturesError, isWalletInfoRemote, checkRequiredWalletFeatures, isConnectUrl, UUIDv7, isWalletInfoCurrentlyEmbedded, createVersionInfo, createResponseVersionEvent, createRequestVersionEvent, createWalletModalOpenedEvent, createSelectedWalletEvent, createConnectionStartedEvent, createConnectionCompletedEvent, createConnectionErrorEvent, createConnectionRestoringStartedEvent, createConnectionRestoringCompletedEvent, createConnectionRestoringErrorEvent, createDisconnectionEvent, createTransactionSentForSignatureEvent, createTransactionSignedEvent, createTransactionSigningFailedEvent, createDataSentForSignatureEvent, createDataSignedEvent, createDataSigningFailedEvent, BrowserEventDispatcher, WalletNotSupportFeatureError, SessionCrypto } from "@tonconnect/sdk";
53
+ import { TonConnectError, isWalletInfoCurrentlyInjected, toUserFriendlyAddress, CHAIN, TonConnect, isWalletConnectInitialized, isTelegramUrl, decodeTelegramUrlParameters, encodeTelegramUrlParameters, WalletMissingRequiredFeaturesError, WalletWrongNetworkError, isWalletInfoRemote, checkRequiredWalletFeatures, isConnectUrl, UUIDv7, isWalletInfoCurrentlyEmbedded, createVersionInfo, createResponseVersionEvent, createRequestVersionEvent, createWalletModalOpenedEvent, createSelectedWalletEvent, createConnectionStartedEvent, createConnectionCompletedEvent, createConnectionErrorEvent, createConnectionRestoringStartedEvent, createConnectionRestoringCompletedEvent, createConnectionRestoringErrorEvent, createDisconnectionEvent, createTransactionSentForSignatureEvent, createTransactionSignedEvent, createTransactionSigningFailedEvent, createDataSentForSignatureEvent, createDataSignedEvent, createDataSigningFailedEvent, BrowserEventDispatcher, WalletNotSupportFeatureError, SessionCrypto } from "@tonconnect/sdk";
54
54
  export * from "@tonconnect/sdk";
55
55
  import UAParser from "ua-parser-js";
56
56
  import deepmerge from "deepmerge";
@@ -1974,7 +1974,7 @@ const common$1 = { "close": "Close", "openWallet": "Open wallet", "copyLink": "C
1974
1974
  const button$1 = { "connectWallet": "Connect Wallet", "dropdown": { "copy": "Copy address", "copied": "Address copied!", "disconnect": "Disconnect" } };
1975
1975
  const notifications$1 = { "confirm": { "header": "Open {{ name }} to confirm the transaction." }, "transactionSent": { "header": "Transaction sent", "text": "Your transaction will be processed in a few seconds." }, "transactionCanceled": { "header": "Transaction canceled", "text": "There will be no changes to your account." }, "dataSigned": { "header": "Data signed" }, "signDataCanceled": { "header": "Sign data canceled" } };
1976
1976
  const walletItem$1 = { "walletOn": "Wallet in", "recent": "Recent", "installed": "Installed", "popular": "Popular" };
1977
- const walletModal$1 = { "loading": "Loading wallets", "wallets": "Wallets", "mobileUniversalModal": { "connectYourWallet": "Connect your TON wallet", "openWalletOnTelegramOrSelect": "Use Wallet in Telegram or choose other application", "openWalletOnTelegram": "Connect Wallet in Telegram", "chooseOtherApplication": "Choose other application", "openLink": "Open Link", "scan": "Scan with your mobile wallet" }, "desktopUniversalModal": { "connectYourWallet": "Connect your TON wallet", "scan": "Scan with your mobile wallet", "availableWallets": "Available wallets" }, "mobileConnectionModal": { "showQR": "Show QR Code", "scanQR": "Scan the QR code below with your phone’s or {{ name }}’s camera", "missingFeatures": "Please update {{ name }}, your version does not support required features for this dApp", "notSupportedWallet": "{{ name }} doesn’t support the requested action. Please connect another wallet that supports it", "continueIn": "Continue in {{ name }}…", "updateWallet": "Update {{ name }}", "chooseAnotherWallet": "Choose Another Wallet", "connectionDeclined": "Connection declined" }, "desktopConnectionModal": { "scanQR": "Scan the QR code below with your phone’s or {{ name }}’s camera", "continueInExtension": "Continue in {{ name }} browser extension…", "dontHaveExtension": "Seems you don't have installed {{ name }} browser extension", "missingFeatures": "Please update {{ name }}, your version does not support required features for this dApp", "notSupportedWallet": "{{ name }} doesn’t support the requested action. Please connect another wallet that supports it", "getWallet": "Get {{ name }}", "updateWallet": "Update {{ name }}", "chooseAnotherWallet": "Choose Another Wallet", "continueOnDesktop": "Continue in {{ name }} on desktop…", "openWalletOnTelegram": "Connect Wallet in Telegram on desktop", "connectionDeclined": "Connection declined" }, "infoModal": { "whatIsAWallet": "What is a wallet", "secureDigitalAssets": "Secure digital assets storage", "walletProtects": "A wallet protects and manages your digital assets including TON, tokens and collectables.", "controlIdentity": "Control your Web3 identity", "manageIdentity": "Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.", "effortlessCryptoTransactions": "Effortless crypto transactions", "easilySend": "Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.", "getAWallet": "Get a Wallet" }, "restoreModal": { "title": "Restore", "step1": { "title": "Find your current recovery phrase", "text": "Open your wallet settings and locate the recovery phrase" }, "step2": { "title": "Copy your recovery phrase", "text": "Write it down or copy it to a safe place" }, "step3": { "title": "Restore in a supported wallet", "text": "Enter the recovery phrase to access your wallet" } }, "allWallets": { "walletsBelowNotSupported": "The wallets below don’t support all features of the connected service. You can use your recovery phrase in one of the supported wallets above.", "walletNotSupportService": "{{ name }} doesn’t support connected service" }, "featureNotSupported": { "wallet": { "title": "{{ name }} doesn’t support the requested action", "description": "Install a supported wallet from the list below, restore it with your recovery phrase, then connect it and try again.", "info": "Learn how to restore your wallet" }, "version": { "description": "Your current version of {{ name }} or wallet contract type doesn't support the required features. Please update it to continue.", "updateButton": "Update {{ name }}", "aboutW5": "About W5" }, "disconnect": { "title": "Confirm Disconnect", "description": "You will be disconnected from your current wallet and redirected to connect {{ name }}.", "button": "Disconnect" } } };
1977
+ const walletModal$1 = { "loading": "Loading wallets", "wallets": "Wallets", "mobileUniversalModal": { "connectYourWallet": "Connect your TON wallet", "openWalletOnTelegramOrSelect": "Use Wallet in Telegram or choose other application", "openWalletOnTelegram": "Connect Wallet in Telegram", "chooseOtherApplication": "Choose other application", "openLink": "Open Link", "scan": "Scan with your mobile wallet" }, "desktopUniversalModal": { "connectYourWallet": "Connect your TON wallet", "scan": "Scan with your mobile wallet", "availableWallets": "Available wallets" }, "mobileConnectionModal": { "showQR": "Show QR Code", "scanQR": "Scan the QR code below with your phone’s or {{ name }}’s camera", "missingFeatures": "Please update {{ name }}, your version does not support required features for this dApp", "wrongNetwork": "Connected wallet is on a different network. Please switch network in {{ name }} and try again", "notSupportedWallet": "{{ name }} doesn’t support the requested action. Please connect another wallet that supports it", "continueIn": "Continue in {{ name }}…", "updateWallet": "Update {{ name }}", "chooseAnotherWallet": "Choose Another Wallet", "connectionDeclined": "Connection declined" }, "desktopConnectionModal": { "scanQR": "Scan the QR code below with your phone’s or {{ name }}’s camera", "continueInExtension": "Continue in {{ name }} browser extension…", "dontHaveExtension": "Seems you don't have installed {{ name }} browser extension", "missingFeatures": "Please update {{ name }}, your version does not support required features for this dApp", "wrongNetwork": "Connected wallet is on a different network. Please switch network in {{ name }} and try again", "notSupportedWallet": "{{ name }} doesn’t support the requested action. Please connect another wallet that supports it", "getWallet": "Get {{ name }}", "updateWallet": "Update {{ name }}", "chooseAnotherWallet": "Choose Another Wallet", "continueOnDesktop": "Continue in {{ name }} on desktop…", "openWalletOnTelegram": "Connect Wallet in Telegram on desktop", "connectionDeclined": "Connection declined" }, "infoModal": { "whatIsAWallet": "What is a wallet", "secureDigitalAssets": "Secure digital assets storage", "walletProtects": "A wallet protects and manages your digital assets including TON, tokens and collectables.", "controlIdentity": "Control your Web3 identity", "manageIdentity": "Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.", "effortlessCryptoTransactions": "Effortless crypto transactions", "easilySend": "Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.", "getAWallet": "Get a Wallet" }, "restoreModal": { "title": "Restore", "step1": { "title": "Find your current recovery phrase", "text": "Open your wallet settings and locate the recovery phrase" }, "step2": { "title": "Copy your recovery phrase", "text": "Write it down or copy it to a safe place" }, "step3": { "title": "Restore in a supported wallet", "text": "Enter the recovery phrase to access your wallet" } }, "allWallets": { "walletsBelowNotSupported": "The wallets below don’t support all features of the connected service. You can use your recovery phrase in one of the supported wallets above.", "walletNotSupportService": "{{ name }} doesn’t support connected service" }, "featureNotSupported": { "wallet": { "title": "{{ name }} doesn’t support the requested action", "description": "Install a supported wallet from the list below, restore it with your recovery phrase, then connect it and try again.", "info": "Learn how to restore your wallet" }, "version": { "description": "Your current version of {{ name }} or wallet contract type doesn't support the required features. Please update it to continue.", "updateButton": "Update {{ name }}", "aboutW5": "About W5" }, "disconnect": { "title": "Confirm Disconnect", "description": "You will be disconnected from your current wallet and redirected to connect {{ name }}.", "button": "Disconnect" } } };
1978
1978
  const actionModal$1 = { "confirmTransaction": { "header": "Confirm the transaction in {{ name }}", "text": "It will only take a moment." }, "signData": { "header": "Sign the data in {{ name }}", "text": "It will only take a moment." }, "transactionSent": "$notifications.transactionSent", "transactionCanceled": "$notifications.transactionCanceled", "dataSigned": "$notifications.dataSigned", "signDataCanceled": "$notifications.signDataCanceled" };
1979
1979
  const en = {
1980
1980
  common: common$1,
@@ -1988,7 +1988,7 @@ const common = { "close": "Закрыть", "openWallet": "Открыть кош
1988
1988
  const button = { "connectWallet": "Подключить кошелёк", "dropdown": { "copy": "Скопировать адрес", "copied": "Адрес скопирован!", "disconnect": "Отключить кошелёк" } };
1989
1989
  const notifications = { "confirm": { "header": "Откройте {{ name }}, чтобы подтвердить транзакцию." }, "transactionSent": { "header": "Транзакция отправлена", "text": "Ваша транзакция будет обработана через несколько секунд." }, "transactionCanceled": { "header": "Транзакция отменена", "text": "Состояние вашего счёта не изменится." }, "dataSigned": { "header": "Данные подписаны" }, "signDataCanceled": { "header": "Подпись данных отменена" } };
1990
1990
  const walletItem = { "walletOn": "Wallet в", "recent": "Недавний", "installed": "Установлен", "popular": "Популярен" };
1991
- const walletModal = { "loading": "Кошельки загружаются", "wallets": "Кошельки", "mobileUniversalModal": { "connectYourWallet": "Подключите TON кошелёк", "openWalletOnTelegramOrSelect": "Подключите Wallet в Telegram или выберете другое приложение", "openWalletOnTelegram": "Открыть Wallet в Telegram", "chooseOtherApplication": "Выберите другое приложение", "openLink": "Открыть", "scan": "Отсканируйте камерой вашего телефона" }, "desktopUniversalModal": { "connectYourWallet": "Подключите TON кошелёк", "scan": "Отсканируйте QR-код камерой вашего телефона", "availableWallets": "Доступные кошельки" }, "mobileConnectionModal": { "showQR": "Показать QR-код", "scanQR": "Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона", "missingFeatures": "Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp", "notSupportedWallet": "{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это", "continueIn": "Продолжите в {{ name }}…", "updateWallet": "Обновить {{ name }}", "chooseAnotherWallet": "Выбрать другой кошелёк", "connectionDeclined": "Подключение отклонено" }, "desktopConnectionModal": { "scanQR": "Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона", "continueInExtension": "Откройте браузерное расширение {{ name }}", "dontHaveExtension": "Похоже, у вас не установлено браузерное расширение {{ name }}", "missingFeatures": "Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp", "notSupportedWallet": "{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это", "getWallet": "Скачать {{ name }}", "updateWallet": "Обновить {{ name }}", "chooseAnotherWallet": "Выбрать другой кошелёк", "continueOnDesktop": "Откройте {{ name }} на компьютере…", "openWalletOnTelegram": "Открыть Wallet в Telegram", "connectionDeclined": "Подключение отклонено" }, "infoModal": { "whatIsAWallet": "Что такое кошелёк?", "secureDigitalAssets": "Надежное хранилище цифровых активов", "walletProtects": "Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.", "controlIdentity": "Контроль своей личности Web3", "manageIdentity": "Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.", "effortlessCryptoTransactions": "Простые криптотранзакции", "easilySend": "Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.", "getAWallet": "Скачать кошелёк" }, "restoreModal": { "title": "Восстановление", "step1": { "title": "Найдите вашу текущую фразу восстановления", "text": "Откройте настройки кошелька и найдите фразу восстановления" }, "step2": { "title": "Скопируйте вашу фразу восстановления", "text": "Запишите её или сохраните в безопасном месте" }, "step3": { "title": "Восстановите в поддерживаемом кошельке", "text": "Введите фразу восстановления для доступа к вашему кошельку" } }, "allWallets": { "walletsBelowNotSupported": "Кошельки ниже не поддерживают все функции подключённого сервиса. Вы можете использовать свою фразу восстановления в одном из поддерживаемых выше кошельков.", "walletNotSupportService": "{{ name }} не поддерживает подключённый сервис" }, "featureNotSupported": { "wallet": { "title": "{{ name }} не поддерживает запрошенное действие", "description": "Установите поддерживаемый кошелёк из списка ниже, восстановите его с помощью фразы восстановления, затем подключитесь и попробуйте снова.", "info": "Узнать, как восстановить кошелёк" }, "version": { "description": "Текущая версия {{ name }} или тип контракта кошелька не поддерживает необходимые функции. Обновите кошелёк, чтобы продолжить.", "updateButton": "Обновить {{ name }}", "aboutW5": "Про W5" }, "disconnect": { "title": "Подтвердите отключение", "description": "Вы будете отключены от текущего кошелька и перенаправлены на подключение {{ name }}.", "button": "Отключиться" } } };
1991
+ const walletModal = { "loading": "Кошельки загружаются", "wallets": "Кошельки", "mobileUniversalModal": { "connectYourWallet": "Подключите TON кошелёк", "openWalletOnTelegramOrSelect": "Подключите Wallet в Telegram или выберете другое приложение", "openWalletOnTelegram": "Открыть Wallet в Telegram", "chooseOtherApplication": "Выберите другое приложение", "openLink": "Открыть", "scan": "Отсканируйте камерой вашего телефона" }, "desktopUniversalModal": { "connectYourWallet": "Подключите TON кошелёк", "scan": "Отсканируйте QR-код камерой вашего телефона", "availableWallets": "Доступные кошельки" }, "mobileConnectionModal": { "showQR": "Показать QR-код", "scanQR": "Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона", "missingFeatures": "Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp", "wrongNetwork": "Подключённый кошелёк находится в другой сети. Пожалуйста, переключите сеть в {{ name }} и попробуйте снова", "notSupportedWallet": "{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это", "continueIn": "Продолжите в {{ name }}…", "updateWallet": "Обновить {{ name }}", "chooseAnotherWallet": "Выбрать другой кошелёк", "connectionDeclined": "Подключение отклонено" }, "desktopConnectionModal": { "scanQR": "Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона", "continueInExtension": "Откройте браузерное расширение {{ name }}", "dontHaveExtension": "Похоже, у вас не установлено браузерное расширение {{ name }}", "missingFeatures": "Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp", "wrongNetwork": "Подключённый кошелёк находится в другой сети. Пожалуйста, переключите сеть в {{ name }} и попробуйте снова", "notSupportedWallet": "{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это", "getWallet": "Скачать {{ name }}", "updateWallet": "Обновить {{ name }}", "chooseAnotherWallet": "Выбрать другой кошелёк", "continueOnDesktop": "Откройте {{ name }} на компьютере…", "openWalletOnTelegram": "Открыть Wallet в Telegram", "connectionDeclined": "Подключение отклонено" }, "infoModal": { "whatIsAWallet": "Что такое кошелёк?", "secureDigitalAssets": "Надежное хранилище цифровых активов", "walletProtects": "Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.", "controlIdentity": "Контроль своей личности Web3", "manageIdentity": "Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.", "effortlessCryptoTransactions": "Простые криптотранзакции", "easilySend": "Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.", "getAWallet": "Скачать кошелёк" }, "restoreModal": { "title": "Восстановление", "step1": { "title": "Найдите вашу текущую фразу восстановления", "text": "Откройте настройки кошелька и найдите фразу восстановления" }, "step2": { "title": "Скопируйте вашу фразу восстановления", "text": "Запишите её или сохраните в безопасном месте" }, "step3": { "title": "Восстановите в поддерживаемом кошельке", "text": "Введите фразу восстановления для доступа к вашему кошельку" } }, "allWallets": { "walletsBelowNotSupported": "Кошельки ниже не поддерживают все функции подключённого сервиса. Вы можете использовать свою фразу восстановления в одном из поддерживаемых выше кошельков.", "walletNotSupportService": "{{ name }} не поддерживает подключённый сервис" }, "featureNotSupported": { "wallet": { "title": "{{ name }} не поддерживает запрошенное действие", "description": "Установите поддерживаемый кошелёк из списка ниже, восстановите его с помощью фразы восстановления, затем подключитесь и попробуйте снова.", "info": "Узнать, как восстановить кошелёк" }, "version": { "description": "Текущая версия {{ name }} или тип контракта кошелька не поддерживает необходимые функции. Обновите кошелёк, чтобы продолжить.", "updateButton": "Обновить {{ name }}", "aboutW5": "Про W5" }, "disconnect": { "title": "Подтвердите отключение", "description": "Вы будете отключены от текущего кошелька и перенаправлены на подключение {{ name }}.", "button": "Отключиться" } } };
1992
1992
  const actionModal = { "confirmTransaction": { "header": "Подтвердите действие в {{ name }}", "text": "Это займет пару секунд." }, "signData": { "header": "Подпишите данные в {{ name }}", "text": "Это займет пару секунд." }, "transactionSent": "$notifications.transactionSent", "transactionCanceled": "$notifications.transactionCanceled", "dataSigned": "$notifications.dataSigned", "signDataCanceled": "$notifications.signDataCanceled" };
1993
1993
  const ru = {
1994
1994
  common,
@@ -6314,8 +6314,12 @@ const FourWalletsItem = (props) => {
6314
6314
  const AT_WALLET_APP_NAME = "telegram-wallet";
6315
6315
  const IMG = {
6316
6316
  TON: "https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",
6317
- TG: "https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png"
6317
+ TG: "https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png",
6318
+ WALLET_CONNECT: "https://raw.githubusercontent.com/ton-connect/sdk/main/assets/walletconnect-icon-288.png"
6318
6319
  };
6320
+ function isWalletUi(wallet) {
6321
+ return !("type" in wallet) || wallet.type !== "wallet-connect";
6322
+ }
6319
6323
  const WalletLabeledItem = (props) => {
6320
6324
  const [t2] = useI18n();
6321
6325
  const walletsSecondLine = () => {
@@ -6325,12 +6329,12 @@ const WalletLabeledItem = (props) => {
6325
6329
  if ("isPreferred" in props.wallet && props.wallet.isPreferred) {
6326
6330
  return t2("walletItem.recent", {}, "Recent");
6327
6331
  }
6328
- if (isWalletInfoCurrentlyInjected(props.wallet)) {
6329
- return t2("walletItem.installed", {}, "Installed");
6330
- }
6331
6332
  if (props.wallet.name === "Tonkeeper") {
6332
6333
  return t2("walletItem.popular", {}, "Popular");
6333
6334
  }
6335
+ if (isWalletUi(props.wallet) && isWalletInfoCurrentlyInjected(props.wallet)) {
6336
+ return t2("walletItem.installed", {}, "Installed");
6337
+ }
6334
6338
  return void 0;
6335
6339
  };
6336
6340
  return memo(() => memo(() => props.wallet.appName === AT_WALLET_APP_NAME)() ? createComponent(WalletItem, {
@@ -8720,9 +8724,19 @@ const ExclamationIcon = (props) => {
8720
8724
  return _el$9;
8721
8725
  })() : null);
8722
8726
  };
8727
+ const WALLET_CONNECT_APP_NAME = "wallet_connect";
8728
+ const WALLET_CONNECT_WALLET_NAME = "WalletConnect";
8729
+ const WALLET_CONNECT_ABOUT_URL = "https://reown.com/";
8723
8730
  var _tmpl$$2 = /* @__PURE__ */ template$1(`<li>`);
8724
8731
  const AllWalletsListModal = (props) => {
8725
8732
  const maxHeight = () => isMobile() ? void 0 : 510;
8733
+ const connector = appState.connector;
8734
+ const additionalRequest = appState.connectRequestParameters;
8735
+ const connectWalletConnect = () => {
8736
+ connector.connect({
8737
+ type: "wallet-connect"
8738
+ }, (additionalRequest == null ? void 0 : additionalRequest.state) === "ready" ? additionalRequest.value : void 0);
8739
+ };
8726
8740
  const [errorSupportOpened, setErrorSupportOpened] = createSignal(null);
8727
8741
  let timeoutId = null;
8728
8742
  const onErrorClick = (wallet) => {
@@ -8762,7 +8776,7 @@ const AllWalletsListModal = (props) => {
8762
8776
  get children() {
8763
8777
  return [createComponent(WalletsUl, {
8764
8778
  get children() {
8765
- return createComponent(For, {
8779
+ return [createComponent(For, {
8766
8780
  get each() {
8767
8781
  return supportedWallets();
8768
8782
  },
@@ -8774,7 +8788,24 @@ const AllWalletsListModal = (props) => {
8774
8788
  }));
8775
8789
  return _el$;
8776
8790
  })()
8777
- });
8791
+ }), createComponent(Show, {
8792
+ get when() {
8793
+ return memo(() => !!!isInTMA())() && isWalletConnectInitialized();
8794
+ },
8795
+ get children() {
8796
+ return createComponent(WalletLabeledItemStyled, {
8797
+ get wallet() {
8798
+ return {
8799
+ type: "wallet-connect",
8800
+ name: WALLET_CONNECT_WALLET_NAME,
8801
+ appName: WALLET_CONNECT_APP_NAME,
8802
+ imageUrl: IMG.WALLET_CONNECT
8803
+ };
8804
+ },
8805
+ onClick: connectWalletConnect
8806
+ });
8807
+ }
8808
+ })];
8778
8809
  }
8779
8810
  }), createComponent(Show, {
8780
8811
  get when() {
@@ -9365,6 +9396,10 @@ const DesktopConnectionModal = (props) => {
9365
9396
  setConnectionErrored("missing-features");
9366
9397
  return;
9367
9398
  }
9399
+ if (error instanceof WalletWrongNetworkError) {
9400
+ setConnectionErrored("wrong-network");
9401
+ return;
9402
+ }
9368
9403
  if (props.wallet.appName !== AT_WALLET_APP_NAME) {
9369
9404
  setConnectionErrored("connection-declined");
9370
9405
  }
@@ -9543,6 +9578,23 @@ const DesktopConnectionModal = (props) => {
9543
9578
  }
9544
9579
  });
9545
9580
  }
9581
+ }), createComponent(Match, {
9582
+ get when() {
9583
+ return connectionErrored() === "wrong-network";
9584
+ },
9585
+ get children() {
9586
+ return createComponent(BodyTextStyled$2, {
9587
+ translationKey: "walletModal.desktopConnectionModal.wrongNetwork",
9588
+ get translationValues() {
9589
+ return {
9590
+ name: props.wallet.name
9591
+ };
9592
+ },
9593
+ get children() {
9594
+ return ["Connected wallet is on a different network. Please switch network in ", memo(() => props.wallet.name), " and try again."];
9595
+ }
9596
+ });
9597
+ }
9546
9598
  })];
9547
9599
  }
9548
9600
  }), createComponent(ButtonsContainerStyled$2, {
@@ -10150,7 +10202,15 @@ const MobileConnectionModal = (props) => {
10150
10202
  });
10151
10203
  const connector = useContext(ConnectorContext);
10152
10204
  const unsubscribe = connector.onStatusChange(() => {
10153
- }, () => {
10205
+ }, (error) => {
10206
+ if (error instanceof WalletMissingRequiredFeaturesError) {
10207
+ setConnectionErrored("missing-features");
10208
+ return;
10209
+ }
10210
+ if (error instanceof WalletWrongNetworkError) {
10211
+ setConnectionErrored("wrong-network");
10212
+ return;
10213
+ }
10154
10214
  setConnectionErrored(null);
10155
10215
  });
10156
10216
  const universalLink = createMemo(() => {
@@ -10298,6 +10358,23 @@ const MobileConnectionModal = (props) => {
10298
10358
  children: "Connection declined"
10299
10359
  });
10300
10360
  }
10361
+ }), createComponent(Match, {
10362
+ get when() {
10363
+ return connectionErrored() === "wrong-network";
10364
+ },
10365
+ get children() {
10366
+ return createComponent(BodyTextStyled$1, {
10367
+ translationKey: "walletModal.mobileConnectionModal.wrongNetwork",
10368
+ get translationValues() {
10369
+ return {
10370
+ name: props.wallet.name
10371
+ };
10372
+ },
10373
+ get children() {
10374
+ return ["Connected wallet is on a different network. Please switch network in ", memo(() => props.wallet.name), " and try again."];
10375
+ }
10376
+ });
10377
+ }
10301
10378
  }), createComponent(Match, {
10302
10379
  get when() {
10303
10380
  return connectionErrored() === "not-supported";
@@ -10311,7 +10388,7 @@ const MobileConnectionModal = (props) => {
10311
10388
  };
10312
10389
  },
10313
10390
  get children() {
10314
- return [memo(() => props.wallet.name), " doesnt support the requested action. Please connect another wallet that supports it."];
10391
+ return [memo(() => props.wallet.name), " doesn't support the requested action. Please connect another wallet that supports it."];
10315
10392
  }
10316
10393
  });
10317
10394
  }
@@ -10379,6 +10456,24 @@ const MobileConnectionModal = (props) => {
10379
10456
  }
10380
10457
  });
10381
10458
  }
10459
+ }), createComponent(Match, {
10460
+ get when() {
10461
+ return connectionErrored() === "wrong-network";
10462
+ },
10463
+ get children() {
10464
+ return createComponent(Button, {
10465
+ get leftIcon() {
10466
+ return createComponent(RetryIcon, {});
10467
+ },
10468
+ onClick: onRetry,
10469
+ get children() {
10470
+ return createComponent(Translation, {
10471
+ translationKey: "common.retry",
10472
+ children: "Retry"
10473
+ });
10474
+ }
10475
+ });
10476
+ }
10382
10477
  }), createComponent(Match, {
10383
10478
  get when() {
10384
10479
  return connectionErrored() === "connection-declined";
@@ -12676,7 +12771,7 @@ class TonConnectUITracker {
12676
12771
  }
12677
12772
  }
12678
12773
  }
12679
- const tonConnectUiVersion = "2.4.0-beta.0";
12774
+ const tonConnectUiVersion = "2.4.0-beta.2";
12680
12775
  class TonConnectEnvironment {
12681
12776
  constructor() {
12682
12777
  this.userAgent = getUserAgent();
@@ -12868,6 +12963,14 @@ class TonConnectUI {
12868
12963
  (_a2 = this.connectRequestParametersCallback) == null ? void 0 : _a2.call(this, connectRequestParameters == null ? void 0 : connectRequestParameters.value);
12869
12964
  }
12870
12965
  }
12966
+ /**
12967
+ * Set desired network for the connection. Can only be set before connecting.
12968
+ * If wallet connects with a different chain, the SDK will throw an error and abort connection.
12969
+ * @param network desired network id (e.g., '-239', '-3', or custom). Pass undefined to allow any network.
12970
+ */
12971
+ setConnectionNetwork(network) {
12972
+ this.connector.setConnectionNetwork(network);
12973
+ }
12871
12974
  /**
12872
12975
  * Returns available wallets list.
12873
12976
  */
@@ -13500,8 +13603,18 @@ class TonConnectUI {
13500
13603
  if (!lastSelectedWalletInfo2) {
13501
13604
  return null;
13502
13605
  }
13503
- let fullLastSelectedWalletInfo;
13504
13606
  if (!("name" in lastSelectedWalletInfo2)) {
13607
+ if (wallet.device.appName === WALLET_CONNECT_APP_NAME) {
13608
+ return {
13609
+ type: "wallet-connect",
13610
+ name: WALLET_CONNECT_WALLET_NAME,
13611
+ appName: WALLET_CONNECT_APP_NAME,
13612
+ imageUrl: IMG.WALLET_CONNECT,
13613
+ aboutUrl: WALLET_CONNECT_ABOUT_URL,
13614
+ features: wallet.device.features,
13615
+ platforms: []
13616
+ };
13617
+ }
13505
13618
  const walletsList = applyWalletsListConfiguration(
13506
13619
  yield this.walletsList,
13507
13620
  appState.walletsListConfiguration
@@ -13512,11 +13625,9 @@ class TonConnectUI {
13512
13625
  `Cannot find WalletInfo for the '${wallet.device.appName}' wallet`
13513
13626
  );
13514
13627
  }
13515
- fullLastSelectedWalletInfo = __spreadValues(__spreadValues({}, walletInfo), lastSelectedWalletInfo2);
13516
- } else {
13517
- fullLastSelectedWalletInfo = lastSelectedWalletInfo2;
13628
+ return __spreadValues(__spreadValues({}, walletInfo), lastSelectedWalletInfo2);
13518
13629
  }
13519
- return fullLastSelectedWalletInfo;
13630
+ return lastSelectedWalletInfo2;
13520
13631
  });
13521
13632
  }
13522
13633
  updateWalletInfo(wallet) {