@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/README.md +17 -0
- package/dist/tonconnect-ui.min.js +239 -239
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +127 -16
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +12 -3
- package/lib/index.mjs +128 -17
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -1975,7 +1975,7 @@ const common$1 = { "close": "Close", "openWallet": "Open wallet", "copyLink": "C
|
|
|
1975
1975
|
const button$1 = { "connectWallet": "Connect Wallet", "dropdown": { "copy": "Copy address", "copied": "Address copied!", "disconnect": "Disconnect" } };
|
|
1976
1976
|
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" } };
|
|
1977
1977
|
const walletItem$1 = { "walletOn": "Wallet in", "recent": "Recent", "installed": "Installed", "popular": "Popular" };
|
|
1978
|
-
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" } } };
|
|
1978
|
+
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" } } };
|
|
1979
1979
|
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" };
|
|
1980
1980
|
const en = {
|
|
1981
1981
|
common: common$1,
|
|
@@ -1989,7 +1989,7 @@ const common = { "close": "Закрыть", "openWallet": "Открыть кош
|
|
|
1989
1989
|
const button = { "connectWallet": "Подключить кошелёк", "dropdown": { "copy": "Скопировать адрес", "copied": "Адрес скопирован!", "disconnect": "Отключить кошелёк" } };
|
|
1990
1990
|
const notifications = { "confirm": { "header": "Откройте {{ name }}, чтобы подтвердить транзакцию." }, "transactionSent": { "header": "Транзакция отправлена", "text": "Ваша транзакция будет обработана через несколько секунд." }, "transactionCanceled": { "header": "Транзакция отменена", "text": "Состояние вашего счёта не изменится." }, "dataSigned": { "header": "Данные подписаны" }, "signDataCanceled": { "header": "Подпись данных отменена" } };
|
|
1991
1991
|
const walletItem = { "walletOn": "Wallet в", "recent": "Недавний", "installed": "Установлен", "popular": "Популярен" };
|
|
1992
|
-
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": "Отключиться" } } };
|
|
1992
|
+
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": "Отключиться" } } };
|
|
1993
1993
|
const actionModal = { "confirmTransaction": { "header": "Подтвердите действие в {{ name }}", "text": "Это займет пару секунд." }, "signData": { "header": "Подпишите данные в {{ name }}", "text": "Это займет пару секунд." }, "transactionSent": "$notifications.transactionSent", "transactionCanceled": "$notifications.transactionCanceled", "dataSigned": "$notifications.dataSigned", "signDataCanceled": "$notifications.signDataCanceled" };
|
|
1994
1994
|
const ru = {
|
|
1995
1995
|
common,
|
|
@@ -6315,8 +6315,12 @@ const FourWalletsItem = (props) => {
|
|
|
6315
6315
|
const AT_WALLET_APP_NAME = "telegram-wallet";
|
|
6316
6316
|
const IMG = {
|
|
6317
6317
|
TON: "https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",
|
|
6318
|
-
TG: "https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png"
|
|
6318
|
+
TG: "https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png",
|
|
6319
|
+
WALLET_CONNECT: "https://raw.githubusercontent.com/ton-connect/sdk/main/assets/walletconnect-icon-288.png"
|
|
6319
6320
|
};
|
|
6321
|
+
function isWalletUi(wallet) {
|
|
6322
|
+
return !("type" in wallet) || wallet.type !== "wallet-connect";
|
|
6323
|
+
}
|
|
6320
6324
|
const WalletLabeledItem = (props) => {
|
|
6321
6325
|
const [t2] = useI18n();
|
|
6322
6326
|
const walletsSecondLine = () => {
|
|
@@ -6326,12 +6330,12 @@ const WalletLabeledItem = (props) => {
|
|
|
6326
6330
|
if ("isPreferred" in props.wallet && props.wallet.isPreferred) {
|
|
6327
6331
|
return t2("walletItem.recent", {}, "Recent");
|
|
6328
6332
|
}
|
|
6329
|
-
if (sdk.isWalletInfoCurrentlyInjected(props.wallet)) {
|
|
6330
|
-
return t2("walletItem.installed", {}, "Installed");
|
|
6331
|
-
}
|
|
6332
6333
|
if (props.wallet.name === "Tonkeeper") {
|
|
6333
6334
|
return t2("walletItem.popular", {}, "Popular");
|
|
6334
6335
|
}
|
|
6336
|
+
if (isWalletUi(props.wallet) && sdk.isWalletInfoCurrentlyInjected(props.wallet)) {
|
|
6337
|
+
return t2("walletItem.installed", {}, "Installed");
|
|
6338
|
+
}
|
|
6335
6339
|
return void 0;
|
|
6336
6340
|
};
|
|
6337
6341
|
return memo(() => memo(() => props.wallet.appName === AT_WALLET_APP_NAME)() ? createComponent(WalletItem, {
|
|
@@ -8721,9 +8725,19 @@ const ExclamationIcon = (props) => {
|
|
|
8721
8725
|
return _el$9;
|
|
8722
8726
|
})() : null);
|
|
8723
8727
|
};
|
|
8728
|
+
const WALLET_CONNECT_APP_NAME = "wallet_connect";
|
|
8729
|
+
const WALLET_CONNECT_WALLET_NAME = "WalletConnect";
|
|
8730
|
+
const WALLET_CONNECT_ABOUT_URL = "https://reown.com/";
|
|
8724
8731
|
var _tmpl$$2 = /* @__PURE__ */ template$1(`<li>`);
|
|
8725
8732
|
const AllWalletsListModal = (props) => {
|
|
8726
8733
|
const maxHeight = () => isMobile() ? void 0 : 510;
|
|
8734
|
+
const connector = appState.connector;
|
|
8735
|
+
const additionalRequest = appState.connectRequestParameters;
|
|
8736
|
+
const connectWalletConnect = () => {
|
|
8737
|
+
connector.connect({
|
|
8738
|
+
type: "wallet-connect"
|
|
8739
|
+
}, (additionalRequest == null ? void 0 : additionalRequest.state) === "ready" ? additionalRequest.value : void 0);
|
|
8740
|
+
};
|
|
8727
8741
|
const [errorSupportOpened, setErrorSupportOpened] = createSignal(null);
|
|
8728
8742
|
let timeoutId = null;
|
|
8729
8743
|
const onErrorClick = (wallet) => {
|
|
@@ -8763,7 +8777,7 @@ const AllWalletsListModal = (props) => {
|
|
|
8763
8777
|
get children() {
|
|
8764
8778
|
return [createComponent(WalletsUl, {
|
|
8765
8779
|
get children() {
|
|
8766
|
-
return createComponent(For, {
|
|
8780
|
+
return [createComponent(For, {
|
|
8767
8781
|
get each() {
|
|
8768
8782
|
return supportedWallets();
|
|
8769
8783
|
},
|
|
@@ -8775,7 +8789,24 @@ const AllWalletsListModal = (props) => {
|
|
|
8775
8789
|
}));
|
|
8776
8790
|
return _el$;
|
|
8777
8791
|
})()
|
|
8778
|
-
})
|
|
8792
|
+
}), createComponent(Show, {
|
|
8793
|
+
get when() {
|
|
8794
|
+
return memo(() => !!!isInTMA())() && sdk.isWalletConnectInitialized();
|
|
8795
|
+
},
|
|
8796
|
+
get children() {
|
|
8797
|
+
return createComponent(WalletLabeledItemStyled, {
|
|
8798
|
+
get wallet() {
|
|
8799
|
+
return {
|
|
8800
|
+
type: "wallet-connect",
|
|
8801
|
+
name: WALLET_CONNECT_WALLET_NAME,
|
|
8802
|
+
appName: WALLET_CONNECT_APP_NAME,
|
|
8803
|
+
imageUrl: IMG.WALLET_CONNECT
|
|
8804
|
+
};
|
|
8805
|
+
},
|
|
8806
|
+
onClick: connectWalletConnect
|
|
8807
|
+
});
|
|
8808
|
+
}
|
|
8809
|
+
})];
|
|
8779
8810
|
}
|
|
8780
8811
|
}), createComponent(Show, {
|
|
8781
8812
|
get when() {
|
|
@@ -9366,6 +9397,10 @@ const DesktopConnectionModal = (props) => {
|
|
|
9366
9397
|
setConnectionErrored("missing-features");
|
|
9367
9398
|
return;
|
|
9368
9399
|
}
|
|
9400
|
+
if (error instanceof sdk.WalletWrongNetworkError) {
|
|
9401
|
+
setConnectionErrored("wrong-network");
|
|
9402
|
+
return;
|
|
9403
|
+
}
|
|
9369
9404
|
if (props.wallet.appName !== AT_WALLET_APP_NAME) {
|
|
9370
9405
|
setConnectionErrored("connection-declined");
|
|
9371
9406
|
}
|
|
@@ -9544,6 +9579,23 @@ const DesktopConnectionModal = (props) => {
|
|
|
9544
9579
|
}
|
|
9545
9580
|
});
|
|
9546
9581
|
}
|
|
9582
|
+
}), createComponent(Match, {
|
|
9583
|
+
get when() {
|
|
9584
|
+
return connectionErrored() === "wrong-network";
|
|
9585
|
+
},
|
|
9586
|
+
get children() {
|
|
9587
|
+
return createComponent(BodyTextStyled$2, {
|
|
9588
|
+
translationKey: "walletModal.desktopConnectionModal.wrongNetwork",
|
|
9589
|
+
get translationValues() {
|
|
9590
|
+
return {
|
|
9591
|
+
name: props.wallet.name
|
|
9592
|
+
};
|
|
9593
|
+
},
|
|
9594
|
+
get children() {
|
|
9595
|
+
return ["Connected wallet is on a different network. Please switch network in ", memo(() => props.wallet.name), " and try again."];
|
|
9596
|
+
}
|
|
9597
|
+
});
|
|
9598
|
+
}
|
|
9547
9599
|
})];
|
|
9548
9600
|
}
|
|
9549
9601
|
}), createComponent(ButtonsContainerStyled$2, {
|
|
@@ -10151,7 +10203,15 @@ const MobileConnectionModal = (props) => {
|
|
|
10151
10203
|
});
|
|
10152
10204
|
const connector = useContext(ConnectorContext);
|
|
10153
10205
|
const unsubscribe = connector.onStatusChange(() => {
|
|
10154
|
-
}, () => {
|
|
10206
|
+
}, (error) => {
|
|
10207
|
+
if (error instanceof sdk.WalletMissingRequiredFeaturesError) {
|
|
10208
|
+
setConnectionErrored("missing-features");
|
|
10209
|
+
return;
|
|
10210
|
+
}
|
|
10211
|
+
if (error instanceof sdk.WalletWrongNetworkError) {
|
|
10212
|
+
setConnectionErrored("wrong-network");
|
|
10213
|
+
return;
|
|
10214
|
+
}
|
|
10155
10215
|
setConnectionErrored(null);
|
|
10156
10216
|
});
|
|
10157
10217
|
const universalLink = createMemo(() => {
|
|
@@ -10299,6 +10359,23 @@ const MobileConnectionModal = (props) => {
|
|
|
10299
10359
|
children: "Connection declined"
|
|
10300
10360
|
});
|
|
10301
10361
|
}
|
|
10362
|
+
}), createComponent(Match, {
|
|
10363
|
+
get when() {
|
|
10364
|
+
return connectionErrored() === "wrong-network";
|
|
10365
|
+
},
|
|
10366
|
+
get children() {
|
|
10367
|
+
return createComponent(BodyTextStyled$1, {
|
|
10368
|
+
translationKey: "walletModal.mobileConnectionModal.wrongNetwork",
|
|
10369
|
+
get translationValues() {
|
|
10370
|
+
return {
|
|
10371
|
+
name: props.wallet.name
|
|
10372
|
+
};
|
|
10373
|
+
},
|
|
10374
|
+
get children() {
|
|
10375
|
+
return ["Connected wallet is on a different network. Please switch network in ", memo(() => props.wallet.name), " and try again."];
|
|
10376
|
+
}
|
|
10377
|
+
});
|
|
10378
|
+
}
|
|
10302
10379
|
}), createComponent(Match, {
|
|
10303
10380
|
get when() {
|
|
10304
10381
|
return connectionErrored() === "not-supported";
|
|
@@ -10312,7 +10389,7 @@ const MobileConnectionModal = (props) => {
|
|
|
10312
10389
|
};
|
|
10313
10390
|
},
|
|
10314
10391
|
get children() {
|
|
10315
|
-
return [memo(() => props.wallet.name), " doesn
|
|
10392
|
+
return [memo(() => props.wallet.name), " doesn't support the requested action. Please connect another wallet that supports it."];
|
|
10316
10393
|
}
|
|
10317
10394
|
});
|
|
10318
10395
|
}
|
|
@@ -10380,6 +10457,24 @@ const MobileConnectionModal = (props) => {
|
|
|
10380
10457
|
}
|
|
10381
10458
|
});
|
|
10382
10459
|
}
|
|
10460
|
+
}), createComponent(Match, {
|
|
10461
|
+
get when() {
|
|
10462
|
+
return connectionErrored() === "wrong-network";
|
|
10463
|
+
},
|
|
10464
|
+
get children() {
|
|
10465
|
+
return createComponent(Button, {
|
|
10466
|
+
get leftIcon() {
|
|
10467
|
+
return createComponent(RetryIcon, {});
|
|
10468
|
+
},
|
|
10469
|
+
onClick: onRetry,
|
|
10470
|
+
get children() {
|
|
10471
|
+
return createComponent(Translation, {
|
|
10472
|
+
translationKey: "common.retry",
|
|
10473
|
+
children: "Retry"
|
|
10474
|
+
});
|
|
10475
|
+
}
|
|
10476
|
+
});
|
|
10477
|
+
}
|
|
10383
10478
|
}), createComponent(Match, {
|
|
10384
10479
|
get when() {
|
|
10385
10480
|
return connectionErrored() === "connection-declined";
|
|
@@ -12677,7 +12772,7 @@ class TonConnectUITracker {
|
|
|
12677
12772
|
}
|
|
12678
12773
|
}
|
|
12679
12774
|
}
|
|
12680
|
-
const tonConnectUiVersion = "2.4.0-beta.
|
|
12775
|
+
const tonConnectUiVersion = "2.4.0-beta.2";
|
|
12681
12776
|
class TonConnectEnvironment {
|
|
12682
12777
|
constructor() {
|
|
12683
12778
|
this.userAgent = getUserAgent();
|
|
@@ -12869,6 +12964,14 @@ class TonConnectUI {
|
|
|
12869
12964
|
(_a2 = this.connectRequestParametersCallback) == null ? void 0 : _a2.call(this, connectRequestParameters == null ? void 0 : connectRequestParameters.value);
|
|
12870
12965
|
}
|
|
12871
12966
|
}
|
|
12967
|
+
/**
|
|
12968
|
+
* Set desired network for the connection. Can only be set before connecting.
|
|
12969
|
+
* If wallet connects with a different chain, the SDK will throw an error and abort connection.
|
|
12970
|
+
* @param network desired network id (e.g., '-239', '-3', or custom). Pass undefined to allow any network.
|
|
12971
|
+
*/
|
|
12972
|
+
setConnectionNetwork(network) {
|
|
12973
|
+
this.connector.setConnectionNetwork(network);
|
|
12974
|
+
}
|
|
12872
12975
|
/**
|
|
12873
12976
|
* Returns available wallets list.
|
|
12874
12977
|
*/
|
|
@@ -13501,8 +13604,18 @@ class TonConnectUI {
|
|
|
13501
13604
|
if (!lastSelectedWalletInfo2) {
|
|
13502
13605
|
return null;
|
|
13503
13606
|
}
|
|
13504
|
-
let fullLastSelectedWalletInfo;
|
|
13505
13607
|
if (!("name" in lastSelectedWalletInfo2)) {
|
|
13608
|
+
if (wallet.device.appName === WALLET_CONNECT_APP_NAME) {
|
|
13609
|
+
return {
|
|
13610
|
+
type: "wallet-connect",
|
|
13611
|
+
name: WALLET_CONNECT_WALLET_NAME,
|
|
13612
|
+
appName: WALLET_CONNECT_APP_NAME,
|
|
13613
|
+
imageUrl: IMG.WALLET_CONNECT,
|
|
13614
|
+
aboutUrl: WALLET_CONNECT_ABOUT_URL,
|
|
13615
|
+
features: wallet.device.features,
|
|
13616
|
+
platforms: []
|
|
13617
|
+
};
|
|
13618
|
+
}
|
|
13506
13619
|
const walletsList = applyWalletsListConfiguration(
|
|
13507
13620
|
yield this.walletsList,
|
|
13508
13621
|
appState.walletsListConfiguration
|
|
@@ -13513,11 +13626,9 @@ class TonConnectUI {
|
|
|
13513
13626
|
`Cannot find WalletInfo for the '${wallet.device.appName}' wallet`
|
|
13514
13627
|
);
|
|
13515
13628
|
}
|
|
13516
|
-
|
|
13517
|
-
} else {
|
|
13518
|
-
fullLastSelectedWalletInfo = lastSelectedWalletInfo2;
|
|
13629
|
+
return __spreadValues(__spreadValues({}, walletInfo), lastSelectedWalletInfo2);
|
|
13519
13630
|
}
|
|
13520
|
-
return
|
|
13631
|
+
return lastSelectedWalletInfo2;
|
|
13521
13632
|
});
|
|
13522
13633
|
}
|
|
13523
13634
|
updateWalletInfo(wallet) {
|